mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-30 18:47:51 +00:00
feat: Add user profile avatar (#9298)
* feat: add avatar * chore: add more colors * chore: add helpers * chore: build prettier issues * chore: refactor shouldShowImage * chore: code cleanup * Update app/javascript/v3/components/Form/InitialsAvatar.vue Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> * chore: revire comments --------- Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
@@ -108,6 +108,110 @@
|
||||
--color-teal-75: 236 249 255;
|
||||
--color-teal-800: 0 133 115;
|
||||
--color-teal-900: 13 61 56;
|
||||
|
||||
--color-green-25: 251 254 252;
|
||||
--color-green-50: 244 251 246;
|
||||
--color-green-75: 230 246 235;
|
||||
--color-green-100: 214 241 223;
|
||||
--color-green-200: 196 232 209;
|
||||
--color-green-300: 173 221 192;
|
||||
--color-green-400: 142 206 170;
|
||||
--color-green-500: 91 185 139;
|
||||
--color-green-600: 48 164 108;
|
||||
--color-green-700: 43 154 102;
|
||||
--color-green-800: 33 131 88;
|
||||
--color-green-900: 25 59 45;
|
||||
|
||||
--color-mint-25: 249 254 253;
|
||||
--color-mint-50: 242 251 249;
|
||||
--color-mint-75: 221 249 242;
|
||||
--color-mint-100: 200 244 233;
|
||||
--color-mint-200: 179 236 222;
|
||||
--color-mint-300: 156 224 208;
|
||||
--color-mint-400: 126 207 189;
|
||||
--color-mint-500: 76 187 165;
|
||||
--color-mint-600: 134 234 212;
|
||||
--color-mint-700: 125 224 203;
|
||||
--color-mint-800: 2 120 100;
|
||||
--color-mint-900: 22 67 60;
|
||||
|
||||
--color-sky-25: 249 254 255;
|
||||
--color-sky-50: 241 250 253;
|
||||
--color-sky-75: 225 246 253;
|
||||
--color-sky-100: 209 240 250;
|
||||
--color-sky-200: 190 231 245;
|
||||
--color-sky-300: 169 218 237;
|
||||
--color-sky-400: 141 202 227;
|
||||
--color-sky-500: 96 179 215;
|
||||
--color-sky-600: 124 226 254;
|
||||
--color-sky-700: 116 218 248;
|
||||
--color-sky-800: 0 116 158;
|
||||
--color-sky-900: 29 62 86;
|
||||
|
||||
--color-indigo-25: 253 253 254;
|
||||
--color-indigo-50: 247 249 255;
|
||||
--color-indigo-75: 237 242 254;
|
||||
--color-indigo-100: 225 233 255;
|
||||
--color-indigo-200: 210 222 255;
|
||||
--color-indigo-300: 193 208 255;
|
||||
--color-indigo-400: 171 189 249;
|
||||
--color-indigo-500: 141 164 239;
|
||||
--color-indigo-600: 62 99 221;
|
||||
--color-indigo-700: 51 88 212;
|
||||
--color-indigo-800: 58 91 199;
|
||||
--color-indigo-900: 31 45 92;
|
||||
|
||||
--color-iris-25: 253 253 255;
|
||||
--color-iris-50: 248 248 255;
|
||||
--color-iris-75: 240 241 254;
|
||||
--color-iris-100: 230 231 255;
|
||||
--color-iris-200: 218 220 255;
|
||||
--color-iris-300: 203 205 255;
|
||||
--color-iris-400: 184 186 248;
|
||||
--color-iris-500: 155 158 240;
|
||||
--color-iris-600: 91 91 214;
|
||||
--color-iris-700: 81 81 205;
|
||||
--color-iris-800: 87 83 198;
|
||||
--color-iris-900: 39 41 98;
|
||||
|
||||
--color-violet-25: 253 252 254;
|
||||
--color-violet-50: 250 248 255;
|
||||
--color-violet-75: 244 240 254;
|
||||
--color-violet-100: 235 228 255;
|
||||
--color-violet-200: 225 217 255;
|
||||
--color-violet-300: 212 202 254;
|
||||
--color-violet-400: 194 181 245;
|
||||
--color-violet-500: 170 153 236;
|
||||
--color-violet-600: 110 86 207;
|
||||
--color-violet-700: 101 77 196;
|
||||
--color-violet-800: 101 80 185;
|
||||
--color-violet-900: 47 38 95;
|
||||
|
||||
--color-pink-25: 255 252 254;
|
||||
--color-pink-50: 254 247 251;
|
||||
--color-pink-75: 254 233 245;
|
||||
--color-pink-100: 251 220 239;
|
||||
--color-pink-200: 246 206 231;
|
||||
--color-pink-300: 239 191 221;
|
||||
--color-pink-400: 231 172 208;
|
||||
--color-pink-500: 221 147 194;
|
||||
--color-pink-600: 214 64 159;
|
||||
--color-pink-700: 207 56 151;
|
||||
--color-pink-800: 194 41 138;
|
||||
--color-pink-900: 101 18 73;
|
||||
|
||||
--color-orange-25: 254 252 251;
|
||||
--color-orange-50: 255 247 237;
|
||||
--color-orange-75: 255 239 214;
|
||||
--color-orange-100: 255 223 181;
|
||||
--color-orange-200: 255 209 154;
|
||||
--color-orange-300: 255 193 130;
|
||||
--color-orange-400: 245 174 115;
|
||||
--color-orange-500: 236 148 85;
|
||||
--color-orange-600: 247 107 21;
|
||||
--color-orange-700: 239 95 0;
|
||||
--color-orange-800: 204 78 0;
|
||||
--color-orange-900: 88 45 29;
|
||||
}
|
||||
// scss-lint:disable QualifyingElement
|
||||
body.dark {
|
||||
@@ -175,5 +279,108 @@
|
||||
--color-teal-75: 13 45 42;
|
||||
--color-teal-800: 11 216 182;
|
||||
--color-teal-900: 173 240 221;
|
||||
|
||||
--color-green-25: 14 21 18;
|
||||
--color-green-50: 18 27 23;
|
||||
--color-green-75: 19 45 33;
|
||||
--color-green-100: 17 59 41;
|
||||
--color-green-200: 23 73 51;
|
||||
--color-green-300: 32 87 62;
|
||||
--color-green-400: 40 104 74;
|
||||
--color-green-500: 47 124 87;
|
||||
--color-green-600: 48 164 108;
|
||||
--color-green-700: 51 176 116;
|
||||
--color-green-800: 61 214 140;
|
||||
--color-green-900: 177 241 203;
|
||||
|
||||
--color-mint-25: 14 21 21;
|
||||
--color-mint-50: 15 27 27;
|
||||
--color-mint-75: 9 44 43;
|
||||
--color-mint-100: 0 58 56;
|
||||
--color-mint-200: 0 71 68;
|
||||
--color-mint-300: 16 86 80;
|
||||
--color-mint-400: 30 104 95;
|
||||
--color-mint-500: 39 127 112;
|
||||
--color-mint-600: 134 234 212;
|
||||
--color-mint-700: 168 245 229;
|
||||
--color-mint-800: 88 213 186;
|
||||
--color-mint-900: 196 245 225;
|
||||
|
||||
--color-sky-25: 14 21 21;
|
||||
--color-sky-50: 15 27 27;
|
||||
--color-sky-75: 9 44 43;
|
||||
--color-sky-100: 0 58 56;
|
||||
--color-sky-200: 0 71 68;
|
||||
--color-sky-300: 16 86 80;
|
||||
--color-sky-400: 30 104 95;
|
||||
--color-sky-500: 39 127 112;
|
||||
--color-sky-600: 134 234 212;
|
||||
--color-sky-700: 168 245 229;
|
||||
--color-sky-800: 88 213 186;
|
||||
--color-sky-900: 196 245 225;
|
||||
|
||||
--color-indigo-25: 17 19 31;
|
||||
--color-indigo-50: 20 23 38;
|
||||
--color-indigo-75: 24 36 73;
|
||||
--color-indigo-100: 29 46 98;
|
||||
--color-indigo-200: 37 57 116;
|
||||
--color-indigo-300: 48 67 132;
|
||||
--color-indigo-400: 58 79 151;
|
||||
--color-indigo-500: 67 93 177;
|
||||
--color-indigo-600: 62 99 221;
|
||||
--color-indigo-700: 84 114 228;
|
||||
--color-indigo-800: 158 177 255;
|
||||
--color-indigo-900: 214 225 255;
|
||||
|
||||
--color-iris-25: 19 19 30;
|
||||
--color-iris-50: 23 22 37;
|
||||
--color-iris-75: 32 34 72;
|
||||
--color-iris-100: 38 42 101;
|
||||
--color-iris-200: 48 51 116;
|
||||
--color-iris-300: 61 62 130;
|
||||
--color-iris-400: 74 74 149;
|
||||
--color-iris-500: 89 88 177;
|
||||
--color-iris-600: 91 91 214;
|
||||
--color-iris-700: 110 106 222;
|
||||
--color-iris-800: 177 169 255;
|
||||
--color-iris-900: 224 223 254;
|
||||
|
||||
--color-violet-25: 20 18 31;
|
||||
--color-violet-50: 27 21 37;
|
||||
--color-violet-75: 41 31 67;
|
||||
--color-violet-100: 51 37 91;
|
||||
--color-violet-200: 60 46 105;
|
||||
--color-violet-300: 71 56 118;
|
||||
--color-violet-400: 86 70 139;
|
||||
--color-violet-500: 105 88 173;
|
||||
--color-violet-600: 110 86 207;
|
||||
--color-violet-700: 125 102 217;
|
||||
--color-violet-800: 186 167 255;
|
||||
--color-violet-900: 226 221 254;
|
||||
|
||||
--color-pink-25: 25 17 23;
|
||||
--color-pink-50: 33 18 29;
|
||||
--color-pink-75: 55 23 47;
|
||||
--color-pink-100: 75 20 61;
|
||||
--color-pink-200: 89 28 71;
|
||||
--color-pink-300: 105 41 85;
|
||||
--color-pink-400: 131 56 105;
|
||||
--color-pink-500: 168 72 133;
|
||||
--color-pink-600: 214 64 159;
|
||||
--color-pink-700: 222 81 168;
|
||||
--color-pink-800: 255 141 204;
|
||||
--color-pink-900: 253 209 234;
|
||||
--color-orange-25: 23 18 14;
|
||||
--color-orange-50: 30 22 15;
|
||||
--color-orange-75: 51 30 11;
|
||||
--color-orange-100: 70 33 0;
|
||||
--color-orange-200: 86 40 0;
|
||||
--color-orange-300: 102 53 12;
|
||||
--color-orange-400: 126 69 29;
|
||||
--color-orange-500: 163 88 41;
|
||||
--color-orange-600: 247 107 21;
|
||||
--color-orange-700: 255 128 31;
|
||||
--color-orange-800: 255 160 87;
|
||||
--color-orange-900: 255 224 194;
|
||||
}
|
||||
}
|
||||
|
||||
43
app/javascript/v3/components/Form/InitialsAvatar.vue
Normal file
43
app/javascript/v3/components/Form/InitialsAvatar.vue
Normal file
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<div
|
||||
class="rounded-xl flex leading-[100%] font-medium items-center justify-center text-center cursor-default"
|
||||
:class="`h-[${size}px] w-[${size}px] ${colorClass}`"
|
||||
:style="style"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<slot>{{ initial }}</slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { userInitial } from 'v3/helpers/CommonHelper';
|
||||
const colors = {
|
||||
1: 'bg-ash-200 text-ash-900',
|
||||
2: 'bg-amber-200 text-amber-900',
|
||||
3: 'bg-pink-100 text-pink-800',
|
||||
4: 'bg-purple-100 text-purple-800',
|
||||
5: 'bg-indigo-100 text-indigo-800',
|
||||
6: 'bg-grass-100 text-grass-800',
|
||||
7: 'bg-mint-100 text-mint-800',
|
||||
8: 'bg-orange-100 text-orange-800',
|
||||
};
|
||||
const props = defineProps({
|
||||
name: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
size: {
|
||||
type: Number,
|
||||
default: 72,
|
||||
},
|
||||
});
|
||||
const style = computed(() => ({
|
||||
fontSize: `${Math.floor(props.size / 2.5)}px`,
|
||||
}));
|
||||
const colorClass = computed(() => {
|
||||
return colors[(props.name.length % 8) + 1];
|
||||
});
|
||||
|
||||
const initial = computed(() => userInitial(props.name));
|
||||
</script>
|
||||
84
app/javascript/v3/components/Form/ProfileAvatar.vue
Normal file
84
app/javascript/v3/components/Form/ProfileAvatar.vue
Normal file
@@ -0,0 +1,84 @@
|
||||
<template>
|
||||
<div class="relative rounded-xl h-[72px] w-[72px] cursor-pointe group">
|
||||
<img
|
||||
v-if="shouldShowImage"
|
||||
class="rounded-xl h-[72px] w-[72px]"
|
||||
:alt="name"
|
||||
:src="src"
|
||||
draggable="false"
|
||||
@load="onImageLoad"
|
||||
@error="onImageLoadError"
|
||||
/>
|
||||
<initials-avatar v-else-if="!shouldShowImage" :name="name" :size="72" />
|
||||
|
||||
<input
|
||||
ref="fileInputRef"
|
||||
type="file"
|
||||
accept="image/png, image/jpeg, image/jpg, image/gif, image/webp"
|
||||
hidden
|
||||
@change="onImageUpload"
|
||||
/>
|
||||
<div class="hidden group-hover:block">
|
||||
<button
|
||||
v-if="src"
|
||||
class="absolute z-10 flex items-center justify-center w-6 h-6 p-1 border border-white rounded-full select-none dark:border-ash-75 reset-base -top-2 -right-2 bg-ash-300"
|
||||
@click="onAvatarDelete"
|
||||
>
|
||||
<fluent-icon icon="dismiss" size="16" class="text-ash-900" />
|
||||
</button>
|
||||
<button
|
||||
class="reset-base absolute h-[72px] w-[72px] top-0 left-0 rounded-xl select-none flex items-center justify-center bg-modal-backdrop-dark dark:bg-modal-backdrop-dark"
|
||||
@click="openFileInput"
|
||||
>
|
||||
<fluent-icon icon="avatar-upload" size="32" class="text-white" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import InitialsAvatar from './InitialsAvatar.vue';
|
||||
const props = defineProps({
|
||||
src: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
|
||||
const emits = defineEmits(['change', 'delete']);
|
||||
|
||||
const hasImageLoaded = ref(false);
|
||||
const imageLoadedError = ref(false);
|
||||
const fileInputRef = ref(null);
|
||||
|
||||
const shouldShowImage = computed(() => props.src && !imageLoadedError.value);
|
||||
|
||||
const onImageLoadError = () => {
|
||||
imageLoadedError.value = true;
|
||||
};
|
||||
|
||||
const onImageLoad = () => {
|
||||
hasImageLoaded.value = true;
|
||||
imageLoadedError.value = false;
|
||||
};
|
||||
|
||||
const openFileInput = () => {
|
||||
fileInputRef.value.click();
|
||||
};
|
||||
|
||||
const onImageUpload = event => {
|
||||
const [file] = event.target.files;
|
||||
emits('change', {
|
||||
file,
|
||||
url: file ? URL.createObjectURL(file) : null,
|
||||
});
|
||||
};
|
||||
|
||||
const onAvatarDelete = () => {
|
||||
emits('delete');
|
||||
};
|
||||
</script>
|
||||
@@ -1,3 +1,9 @@
|
||||
export const replaceRouteWithReload = url => {
|
||||
window.location = url;
|
||||
};
|
||||
|
||||
export const userInitial = name => {
|
||||
const parts = name.split(/[ -]/).filter(Boolean);
|
||||
let initials = parts.map(part => part[0].toUpperCase()).join('');
|
||||
return initials.slice(0, 2);
|
||||
};
|
||||
|
||||
10
app/javascript/v3/helpers/specs/CommonHelper.spec.js
Normal file
10
app/javascript/v3/helpers/specs/CommonHelper.spec.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import { userInitial } from '../CommonHelper';
|
||||
|
||||
describe('#userInitial', () => {
|
||||
it('returns the initials of the user', () => {
|
||||
expect(userInitial('John Doe')).toEqual('JD');
|
||||
expect(userInitial('John')).toEqual('J');
|
||||
expect(userInitial('John-Doe')).toEqual('JD');
|
||||
expect(userInitial('John Doe Smith')).toEqual('JD');
|
||||
});
|
||||
});
|
||||
@@ -1,17 +1,5 @@
|
||||
const {
|
||||
blue,
|
||||
blueDark,
|
||||
green,
|
||||
greenDark,
|
||||
yellow,
|
||||
yellowDark,
|
||||
slate,
|
||||
slateDark,
|
||||
red,
|
||||
redDark,
|
||||
violet,
|
||||
violetDark,
|
||||
} = require('@radix-ui/colors');
|
||||
const { slateDark } = require('@radix-ui/colors');
|
||||
import { colors } from './theme/colors';
|
||||
const defaultTheme = require('tailwindcss/defaultTheme');
|
||||
module.exports = {
|
||||
darkMode: 'class',
|
||||
@@ -41,163 +29,7 @@ module.exports = {
|
||||
'modal-backdrop-light': 'rgba(0, 0, 0, 0.4)',
|
||||
'modal-backdrop-dark': 'rgba(0, 0, 0, 0.6)',
|
||||
current: 'currentColor',
|
||||
woot: {
|
||||
25: blue.blue2,
|
||||
50: blue.blue3,
|
||||
75: blue.blue4,
|
||||
100: blue.blue5,
|
||||
200: blue.blue7,
|
||||
300: blue.blue8,
|
||||
400: blueDark.blue11,
|
||||
500: blueDark.blue10,
|
||||
600: blueDark.blue9,
|
||||
700: blueDark.blue8,
|
||||
800: blueDark.blue6,
|
||||
900: blueDark.blue2,
|
||||
},
|
||||
green: {
|
||||
50: greenDark.green12,
|
||||
100: green.green6,
|
||||
200: green.green7,
|
||||
300: green.green8,
|
||||
400: greenDark.green10,
|
||||
500: greenDark.green9,
|
||||
600: green.green10,
|
||||
700: green.green11,
|
||||
800: greenDark.green7,
|
||||
900: greenDark.green6,
|
||||
},
|
||||
yellow: {
|
||||
50: yellow.yellow2,
|
||||
100: yellow.yellow3,
|
||||
200: yellow.yellow5,
|
||||
300: yellowDark.yellow10,
|
||||
400: yellowDark.yellow9,
|
||||
500: yellowDark.yellow11,
|
||||
600: yellow.yellow8,
|
||||
700: yellowDark.yellow7,
|
||||
800: yellowDark.yellow2,
|
||||
900: yellowDark.yellow1,
|
||||
},
|
||||
slate: {
|
||||
25: slate.slate2,
|
||||
50: slate.slate3,
|
||||
75: slate.slate4,
|
||||
100: slate.slate5,
|
||||
200: slate.slate7,
|
||||
300: slate.slate8,
|
||||
400: slateDark.slate11,
|
||||
500: slateDark.slate10,
|
||||
600: slate.slate11,
|
||||
700: slateDark.slate8,
|
||||
800: slateDark.slate4,
|
||||
900: slateDark.slate1,
|
||||
},
|
||||
black: {
|
||||
50: slate.slate2,
|
||||
100: slateDark.slate12,
|
||||
200: slate.slate7,
|
||||
300: slate.slate8,
|
||||
400: slateDark.slate11,
|
||||
500: slate.slate9,
|
||||
600: slateDark.slate9,
|
||||
700: slateDark.slate8,
|
||||
800: slateDark.slate7,
|
||||
900: slateDark.slate2,
|
||||
},
|
||||
red: {
|
||||
50: redDark.red12,
|
||||
100: red.red6,
|
||||
200: red.red8,
|
||||
300: redDark.red11,
|
||||
400: redDark.red10,
|
||||
500: red.red9,
|
||||
600: red.red10,
|
||||
700: red.red11,
|
||||
800: redDark.red8,
|
||||
900: red.red12,
|
||||
},
|
||||
violet: {
|
||||
50: violet.violet1,
|
||||
100: violetDark.violet12,
|
||||
200: violet.violet6,
|
||||
300: violet.violet8,
|
||||
400: violet.violet11,
|
||||
500: violet.violet9,
|
||||
600: violetDark.violet8,
|
||||
700: violetDark.violet7,
|
||||
800: violetDark.violet6,
|
||||
900: violet.violet12,
|
||||
},
|
||||
primary: {
|
||||
25: 'rgb(var(--color-primary-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-primary-50) / <alpha-value>)',
|
||||
75: 'rgb(var(--color-primary-75) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-primary-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-primary-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-primary-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-primary-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-primary-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-primary-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-primary-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-primary-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-primary-900) / <alpha-value>)',
|
||||
},
|
||||
ash: {
|
||||
25: 'rgb(var(--color-ash-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-ash-50) / <alpha-value>)',
|
||||
75: 'rgb(var(--color-ash-75) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-ash-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-ash-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-ash-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-ash-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-ash-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-ash-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-ash-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-ash-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-ash-900) / <alpha-value>)',
|
||||
},
|
||||
teal: {
|
||||
25: 'rgb(var(--color-teal-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-teal-50) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-teal-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-teal-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-teal-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-teal-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-teal-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-teal-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-teal-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-teal-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-teal-900) / <alpha-value>)',
|
||||
},
|
||||
amber: {
|
||||
25: 'rgb(var(--color-amber-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-amber-50) / <alpha-value>)',
|
||||
75: 'rgb(var(--color-amber-75) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-amber-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-amber-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-amber-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-amber-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-amber-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-amber-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-amber-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-amber-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-amber-900) / <alpha-value>)',
|
||||
},
|
||||
ruby: {
|
||||
25: 'rgb(var(--color-ruby-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-ruby-50) / <alpha-value>)',
|
||||
75: 'rgb(var(--color-ruby-75) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-ruby-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-ruby-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-ruby-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-ruby-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-ruby-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-ruby-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-ruby-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-ruby-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-ruby-900) / <alpha-value>)',
|
||||
},
|
||||
...colors,
|
||||
body: slateDark.slate7,
|
||||
},
|
||||
keyframes: {
|
||||
|
||||
285
theme/colors.js
Normal file
285
theme/colors.js
Normal file
@@ -0,0 +1,285 @@
|
||||
const {
|
||||
blue,
|
||||
blueDark,
|
||||
green,
|
||||
greenDark,
|
||||
yellow,
|
||||
yellowDark,
|
||||
slate,
|
||||
slateDark,
|
||||
red,
|
||||
redDark,
|
||||
violet,
|
||||
violetDark,
|
||||
} = require('@radix-ui/colors');
|
||||
export const colors = {
|
||||
woot: {
|
||||
25: blue.blue2,
|
||||
50: blue.blue3,
|
||||
75: blue.blue4,
|
||||
100: blue.blue5,
|
||||
200: blue.blue7,
|
||||
300: blue.blue8,
|
||||
400: blueDark.blue11,
|
||||
500: blueDark.blue10,
|
||||
600: blueDark.blue9,
|
||||
700: blueDark.blue8,
|
||||
800: blueDark.blue6,
|
||||
900: blueDark.blue2,
|
||||
},
|
||||
green: {
|
||||
50: greenDark.green12,
|
||||
100: green.green6,
|
||||
200: green.green7,
|
||||
300: green.green8,
|
||||
400: greenDark.green10,
|
||||
500: greenDark.green9,
|
||||
600: green.green10,
|
||||
700: green.green11,
|
||||
800: greenDark.green7,
|
||||
900: greenDark.green6,
|
||||
},
|
||||
yellow: {
|
||||
50: yellow.yellow2,
|
||||
100: yellow.yellow3,
|
||||
200: yellow.yellow5,
|
||||
300: yellowDark.yellow10,
|
||||
400: yellowDark.yellow9,
|
||||
500: yellowDark.yellow11,
|
||||
600: yellow.yellow8,
|
||||
700: yellowDark.yellow7,
|
||||
800: yellowDark.yellow2,
|
||||
900: yellowDark.yellow1,
|
||||
},
|
||||
slate: {
|
||||
25: slate.slate2,
|
||||
50: slate.slate3,
|
||||
75: slate.slate4,
|
||||
100: slate.slate5,
|
||||
200: slate.slate7,
|
||||
300: slate.slate8,
|
||||
400: slateDark.slate11,
|
||||
500: slateDark.slate10,
|
||||
600: slate.slate11,
|
||||
700: slateDark.slate8,
|
||||
800: slateDark.slate4,
|
||||
900: slateDark.slate1,
|
||||
},
|
||||
black: {
|
||||
50: slate.slate2,
|
||||
100: slateDark.slate12,
|
||||
200: slate.slate7,
|
||||
300: slate.slate8,
|
||||
400: slateDark.slate11,
|
||||
500: slate.slate9,
|
||||
600: slateDark.slate9,
|
||||
700: slateDark.slate8,
|
||||
800: slateDark.slate7,
|
||||
900: slateDark.slate2,
|
||||
},
|
||||
red: {
|
||||
50: redDark.red12,
|
||||
100: red.red6,
|
||||
200: red.red8,
|
||||
300: redDark.red11,
|
||||
400: redDark.red10,
|
||||
500: red.red9,
|
||||
600: red.red10,
|
||||
700: red.red11,
|
||||
800: redDark.red8,
|
||||
900: red.red12,
|
||||
},
|
||||
violet: {
|
||||
50: violet.violet1,
|
||||
100: violetDark.violet12,
|
||||
200: violet.violet6,
|
||||
300: violet.violet8,
|
||||
400: violet.violet11,
|
||||
500: violet.violet9,
|
||||
600: violetDark.violet8,
|
||||
700: violetDark.violet7,
|
||||
800: violetDark.violet6,
|
||||
900: violet.violet12,
|
||||
},
|
||||
primary: {
|
||||
25: 'rgb(var(--color-primary-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-primary-50) / <alpha-value>)',
|
||||
75: 'rgb(var(--color-primary-75) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-primary-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-primary-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-primary-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-primary-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-primary-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-primary-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-primary-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-primary-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-primary-900) / <alpha-value>)',
|
||||
},
|
||||
ash: {
|
||||
25: 'rgb(var(--color-ash-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-ash-50) / <alpha-value>)',
|
||||
75: 'rgb(var(--color-ash-75) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-ash-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-ash-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-ash-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-ash-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-ash-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-ash-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-ash-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-ash-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-ash-900) / <alpha-value>)',
|
||||
},
|
||||
teal: {
|
||||
25: 'rgb(var(--color-teal-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-teal-50) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-teal-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-teal-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-teal-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-teal-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-teal-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-teal-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-teal-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-teal-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-teal-900) / <alpha-value>)',
|
||||
},
|
||||
amber: {
|
||||
25: 'rgb(var(--color-amber-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-amber-50) / <alpha-value>)',
|
||||
75: 'rgb(var(--color-amber-75) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-amber-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-amber-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-amber-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-amber-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-amber-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-amber-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-amber-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-amber-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-amber-900) / <alpha-value>)',
|
||||
},
|
||||
ruby: {
|
||||
25: 'rgb(var(--color-ruby-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-ruby-50) / <alpha-value>)',
|
||||
75: 'rgb(var(--color-ruby-75) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-ruby-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-ruby-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-ruby-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-ruby-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-ruby-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-ruby-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-ruby-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-ruby-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-ruby-900) / <alpha-value>)',
|
||||
},
|
||||
grass: {
|
||||
25: 'rgb(var(--color-green-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-green-50) / <alpha-value>)',
|
||||
75: 'rgb(var(--color-green-75) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-green-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-green-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-green-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-green-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-green-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-green-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-green-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-green-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-green-900) / <alpha-value>)',
|
||||
},
|
||||
mint: {
|
||||
25: 'rgb(var(--color-mint-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-mint-50) / <alpha-value>)',
|
||||
75: 'rgb(var(--color-mint-75) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-mint-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-mint-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-mint-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-mint-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-mint-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-mint-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-mint-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-mint-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-mint-900) / <alpha-value>)',
|
||||
},
|
||||
sky: {
|
||||
25: 'rgb(var(--color-sky-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-sky-50) / <alpha-value>)',
|
||||
75: 'rgb(var(--color-sky-75) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-sky-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-sky-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-sky-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-sky-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-sky-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-sky-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-sky-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-sky-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-sky-900) / <alpha-value>)',
|
||||
},
|
||||
indigo: {
|
||||
25: 'rgb(var(--color-indigo-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-indigo-50) / <alpha-value>)',
|
||||
75: 'rgb(var(--color-indigo-75) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-indigo-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-indigo-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-indigo-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-indigo-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-indigo-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-indigo-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-indigo-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-indigo-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-indigo-900) / <alpha-value>)',
|
||||
},
|
||||
iris: {
|
||||
25: 'rgb(var(--color-iris-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-iris-50) / <alpha-value>)',
|
||||
75: 'rgb(var(--color-iris-75) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-iris-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-iris-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-iris-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-iris-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-iris-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-iris-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-iris-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-iris-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-iris-900) / <alpha-value>)',
|
||||
},
|
||||
purple: {
|
||||
25: 'rgb(var(--color-violet-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-violet-50) / <alpha-value>)',
|
||||
75: 'rgb(var(--color-violet-75) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-violet-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-violet-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-violet-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-violet-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-violet-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-violet-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-violet-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-violet-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-violet-900) / <alpha-value>)',
|
||||
},
|
||||
pink: {
|
||||
25: 'rgb(var(--color-pink-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-pink-50) / <alpha-value>)',
|
||||
75: 'rgb(var(--color-pink-75) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-pink-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-pink-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-pink-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-pink-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-pink-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-pink-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-pink-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-pink-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-pink-900) / <alpha-value>)',
|
||||
},
|
||||
orange: {
|
||||
25: 'rgb(var(--color-orange-25) / <alpha-value>)',
|
||||
50: 'rgb(var(--color-orange-50) / <alpha-value>)',
|
||||
75: 'rgb(var(--color-orange-75) / <alpha-value>)',
|
||||
100: 'rgb(var(--color-orange-100) / <alpha-value>)',
|
||||
200: 'rgb(var(--color-orange-200) / <alpha-value>)',
|
||||
300: 'rgb(var(--color-orange-300) / <alpha-value>)',
|
||||
400: 'rgb(var(--color-orange-400) / <alpha-value>)',
|
||||
500: 'rgb(var(--color-orange-500) / <alpha-value>)',
|
||||
600: 'rgb(var(--color-orange-600) / <alpha-value>)',
|
||||
700: 'rgb(var(--color-orange-700) / <alpha-value>)',
|
||||
800: 'rgb(var(--color-orange-800) / <alpha-value>)',
|
||||
900: 'rgb(var(--color-orange-900) / <alpha-value>)',
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user