@autofleet/theme 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/src/colors/atomic-colors.d.ts +132 -0
- package/src/colors/atomic-colors.js +150 -0
- package/src/colors/atomic-colors.js.map +1 -0
- package/src/colors/index.d.ts +12 -0
- package/src/colors/index.js +12 -0
- package/src/colors/index.js.map +1 -0
- package/src/colors/tokens/color-token-mapping.d.ts +8 -0
- package/src/colors/tokens/color-token-mapping.js +885 -0
- package/src/colors/tokens/color-token-mapping.js.map +1 -0
- package/src/colors/tokens/color-tokens.d.ts +17 -0
- package/src/colors/tokens/color-tokens.js +97 -0
- package/src/colors/tokens/color-tokens.js.map +1 -0
- package/src/colors-utils.d.ts +57 -0
- package/src/colors-utils.js +104 -0
- package/src/colors-utils.js.map +1 -0
- package/src/const.d.ts +4 -0
- package/src/const.js +5 -0
- package/src/const.js.map +1 -0
- package/src/fonts/atomic-fonts.d.ts +13 -0
- package/src/fonts/atomic-fonts.js +75 -0
- package/src/fonts/atomic-fonts.js.map +1 -0
- package/src/fonts/index.d.ts +20 -0
- package/src/fonts/index.js +22 -0
- package/src/fonts/index.js.map +1 -0
- package/src/index.d.ts +77 -0
- package/src/index.js +16 -0
- package/src/index.js.map +1 -0
- package/src/shadow/index.d.ts +19 -0
- package/src/shadow/{index.ts → index.js} +11 -32
- package/src/shadow/index.js.map +1 -0
- package/src/spacing/border-radius.d.ts +8 -0
- package/src/spacing/border-radius.js +9 -0
- package/src/spacing/border-radius.js.map +1 -0
- package/src/spacing/index.d.ts +25 -0
- package/src/spacing/{index.ts → index.js} +3 -3
- package/src/spacing/index.js.map +1 -0
- package/src/spacing/spacing.d.ts +15 -0
- package/src/spacing/spacing.js +16 -0
- package/src/spacing/spacing.js.map +1 -0
- package/.nvmrc +0 -1
- package/project.json +0 -40
- package/src/colors/atomic-colors.ts +0 -169
- package/src/colors/index.ts +0 -31
- package/src/colors/tokens/color-token-mapping.ts +0 -909
- package/src/colors/tokens/color-tokens.ts +0 -110
- package/src/colors-utils.ts +0 -196
- package/src/const.ts +0 -4
- package/src/fonts/atomic-fonts.ts +0 -102
- package/src/fonts/index.ts +0 -22
- package/src/index.ts +0 -38
- package/src/spacing/border-radius.ts +0 -8
- package/src/spacing/spacing.ts +0 -15
- package/tsconfig.json +0 -22
- package/tsconfig.lib.json +0 -10
- package/tsconfig.spec.json +0 -20
- package/vite.config.ts +0 -15
|
@@ -1,36 +1,14 @@
|
|
|
1
|
-
import type { ColorTokenResponse } from '../colors';
|
|
2
1
|
import { SPACING } from '../spacing/spacing';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/(rgba\(\d{1,3},\s?\d{1,3},\s?\d{1,3}(?:,|\s?\/)\s?)((?:\d\.)?\d)(\))/,
|
|
8
|
-
`$1${newAlpha}$3`
|
|
9
|
-
);
|
|
2
|
+
const changeColorAlpha = (color, newAlpha) => {
|
|
3
|
+
if (!color.startsWith('rgba('))
|
|
4
|
+
return color;
|
|
5
|
+
return color.replace(/(rgba\(\d{1,3},\s?\d{1,3},\s?\d{1,3}(?:,|\s?\/)\s?)((?:\d\.)?\d)(\))/, `$1${newAlpha}$3`);
|
|
10
6
|
};
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
)}` as const;
|
|
17
|
-
const getMedShadow = (color: string, opacity = 12) =>
|
|
18
|
-
`${SPACING.NONE} ${SPACING.SM} ${SPACING.LG} ${changeColorAlpha(
|
|
19
|
-
color,
|
|
20
|
-
opacity / 100
|
|
21
|
-
)}` as const;
|
|
22
|
-
const getHighShadow = (color: string, opacity = 16) =>
|
|
23
|
-
`${SPACING.NONE} ${SPACING.LG} ${SPACING['5XL']} ${changeColorAlpha(
|
|
24
|
-
color,
|
|
25
|
-
opacity / 100
|
|
26
|
-
)}` as const;
|
|
27
|
-
|
|
28
|
-
export const getThemeShadows = (colors: ColorTokenResponse) =>
|
|
29
|
-
({
|
|
30
|
-
'shadow-map-element': `${SPACING.NONE} 3px ${SPACING.LG} ${changeColorAlpha(
|
|
31
|
-
colors['neutral-dark'],
|
|
32
|
-
0.32
|
|
33
|
-
)}` as const,
|
|
7
|
+
const getLowShadow = (color, opacity = 12) => `${SPACING.NONE} ${SPACING.XS} ${SPACING.SM} ${changeColorAlpha(color, opacity / 100)}`;
|
|
8
|
+
const getMedShadow = (color, opacity = 12) => `${SPACING.NONE} ${SPACING.SM} ${SPACING.LG} ${changeColorAlpha(color, opacity / 100)}`;
|
|
9
|
+
const getHighShadow = (color, opacity = 16) => `${SPACING.NONE} ${SPACING.LG} ${SPACING['5XL']} ${changeColorAlpha(color, opacity / 100)}`;
|
|
10
|
+
export const getThemeShadows = (colors) => ({
|
|
11
|
+
'shadow-map-element': `${SPACING.NONE} 3px ${SPACING.LG} ${changeColorAlpha(colors['neutral-dark'], 0.32)}`,
|
|
34
12
|
// Neutral
|
|
35
13
|
'shadow-neutral-low': getLowShadow(colors['neutral-dark'], 8),
|
|
36
14
|
'shadow-neutral-medium': getMedShadow(colors['neutral-dark'], 8),
|
|
@@ -51,4 +29,5 @@ export const getThemeShadows = (colors: ColorTokenResponse) =>
|
|
|
51
29
|
'shadow-error-low': getLowShadow(colors.error),
|
|
52
30
|
'shadow-error-medium': getMedShadow(colors.error),
|
|
53
31
|
'shadow-error-high': getHighShadow(colors.error),
|
|
54
|
-
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/theme/src/shadow/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAE,QAAgB,EAAE,EAAE;IAC3D,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,KAAK,CAAC;IAC7C,OAAO,KAAK,CAAC,OAAO,CAClB,sEAAsE,EACtE,KAAK,QAAQ,IAAI,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE,CACnD,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,EAAE,IAAI,OAAO,CAAC,EAAE,IAAI,gBAAgB,CAC7D,KAAK,EACL,OAAO,GAAG,GAAG,CACd,EAAW,CAAC;AACf,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE,CACnD,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,EAAE,IAAI,OAAO,CAAC,EAAE,IAAI,gBAAgB,CAC7D,KAAK,EACL,OAAO,GAAG,GAAG,CACd,EAAW,CAAC;AACf,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE,CACpD,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,gBAAgB,CACjE,KAAK,EACL,OAAO,GAAG,GAAG,CACd,EAAW,CAAC;AAEf,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAA0B,EAAE,EAAE,CAC5D,CAAC;IACC,oBAAoB,EAAE,GAAG,OAAO,CAAC,IAAI,QAAQ,OAAO,CAAC,EAAE,IAAI,gBAAgB,CACzE,MAAM,CAAC,cAAc,CAAC,EACtB,IAAI,CACL,EAAW;IACZ,UAAU;IACV,oBAAoB,EAAE,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;IAC7D,uBAAuB,EAAE,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;IAChE,qBAAqB,EAAE,aAAa,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAC5D,OAAO;IACP,iBAAiB,EAAE,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC;IAC5C,oBAAoB,EAAE,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC;IAC/C,kBAAkB,EAAE,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC;IAC9C,UAAU;IACV,oBAAoB,EAAE,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC;IAClD,uBAAuB,EAAE,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC;IACrD,qBAAqB,EAAE,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC;IACpD,UAAU;IACV,oBAAoB,EAAE,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC;IAClD,uBAAuB,EAAE,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC;IACrD,qBAAqB,EAAE,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC;IACpD,QAAQ;IACR,kBAAkB,EAAE,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC;IAC9C,qBAAqB,EAAE,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC;IACjD,mBAAmB,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC;CACvC,CAAA,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"border-radius.js","sourceRoot":"","sources":["../../../../../packages/theme/src/spacing/border-radius.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,KAAK;IACX,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,MAAM;CACF,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const getThemeSpacings: () => {
|
|
2
|
+
borderRadius: {
|
|
3
|
+
readonly NONE: "0px";
|
|
4
|
+
readonly XS: "2px";
|
|
5
|
+
readonly SM: "4px";
|
|
6
|
+
readonly MD: "6px";
|
|
7
|
+
readonly LG: "8px";
|
|
8
|
+
readonly XL: "16px";
|
|
9
|
+
};
|
|
10
|
+
spacings: {
|
|
11
|
+
readonly NONE: "0px";
|
|
12
|
+
readonly XS: "2px";
|
|
13
|
+
readonly SM: "4px";
|
|
14
|
+
readonly MD: "6px";
|
|
15
|
+
readonly LG: "8px";
|
|
16
|
+
readonly XL: "12px";
|
|
17
|
+
readonly '2XL': "16px";
|
|
18
|
+
readonly '3XL': "24px";
|
|
19
|
+
readonly '4XL': "32px";
|
|
20
|
+
readonly '5XL': "40px";
|
|
21
|
+
readonly '6XL': "48px";
|
|
22
|
+
readonly '7XL': "56px";
|
|
23
|
+
readonly '8XL': "64px";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BORDER_RADIUS } from './border-radius';
|
|
2
2
|
import { SPACING } from './spacing';
|
|
3
|
-
|
|
4
3
|
export const getThemeSpacings = () => ({
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
borderRadius: BORDER_RADIUS,
|
|
5
|
+
spacings: SPACING,
|
|
7
6
|
});
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/theme/src/spacing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,CAAC;IACrC,YAAY,EAAE,aAAa;IAC3B,QAAQ,EAAE,OAAO;CAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const SPACING: {
|
|
2
|
+
readonly NONE: "0px";
|
|
3
|
+
readonly XS: "2px";
|
|
4
|
+
readonly SM: "4px";
|
|
5
|
+
readonly MD: "6px";
|
|
6
|
+
readonly LG: "8px";
|
|
7
|
+
readonly XL: "12px";
|
|
8
|
+
readonly '2XL': "16px";
|
|
9
|
+
readonly '3XL': "24px";
|
|
10
|
+
readonly '4XL': "32px";
|
|
11
|
+
readonly '5XL': "40px";
|
|
12
|
+
readonly '6XL': "48px";
|
|
13
|
+
readonly '7XL': "56px";
|
|
14
|
+
readonly '8XL': "64px";
|
|
15
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const SPACING = {
|
|
2
|
+
NONE: '0px',
|
|
3
|
+
XS: '2px',
|
|
4
|
+
SM: '4px',
|
|
5
|
+
MD: '6px',
|
|
6
|
+
LG: '8px',
|
|
7
|
+
XL: '12px',
|
|
8
|
+
'2XL': '16px',
|
|
9
|
+
'3XL': '24px',
|
|
10
|
+
'4XL': '32px',
|
|
11
|
+
'5XL': '40px',
|
|
12
|
+
'6XL': '48px',
|
|
13
|
+
'7XL': '56px',
|
|
14
|
+
'8XL': '64px',
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=spacing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spacing.js","sourceRoot":"","sources":["../../../../../packages/theme/src/spacing/spacing.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE,KAAK;IACX,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;CACL,CAAC"}
|
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
22.9.0
|
package/project.json
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "theme",
|
|
3
|
-
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"version": "0",
|
|
5
|
-
"sourceRoot": "packages/theme/src",
|
|
6
|
-
"projectType": "library",
|
|
7
|
-
"targets": {
|
|
8
|
-
"build": {
|
|
9
|
-
"executor": "@nx/js:tsc",
|
|
10
|
-
"outputs": ["{options.outputPath}"],
|
|
11
|
-
"options": {
|
|
12
|
-
"outputPath": "dist/packages/theme",
|
|
13
|
-
"main": "packages/theme/src/index.ts",
|
|
14
|
-
"tsConfig": "packages/theme/tsconfig.lib.json",
|
|
15
|
-
"assets": ["packages/theme/*.md"]
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"lint": {
|
|
19
|
-
"executor": "@nx/eslint:lint"
|
|
20
|
-
},
|
|
21
|
-
"test": {
|
|
22
|
-
"executor": "@nx/vite:test",
|
|
23
|
-
"outputs": ["{options.reportsDirectory}"],
|
|
24
|
-
"options": {
|
|
25
|
-
"reportsDirectory": "../../coverage/packages/theme"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
"typecheck": {
|
|
29
|
-
"executor": "nx:run-commands",
|
|
30
|
-
"options": {
|
|
31
|
-
"cwd": "packages/theme",
|
|
32
|
-
"commands": ["npx tsc -p tsconfig.lib.json --noEmit"],
|
|
33
|
-
"forwardAllArgs": false,
|
|
34
|
-
"description": "Type check with tsc"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
"tags": []
|
|
40
|
-
}
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { type RGBColor, adjustBrightness } from '../colors-utils';
|
|
2
|
-
|
|
3
|
-
export const ATOMIC_COLORS = {
|
|
4
|
-
// neutral colors
|
|
5
|
-
'n-00': 'rgba(255, 255, 255, 1)',
|
|
6
|
-
'n-01': 'rgba(244, 245, 248, 1)',
|
|
7
|
-
'n-02': 'rgba(173, 174, 186, 1)',
|
|
8
|
-
'n-03': 'rgba(102, 105, 117, 1)',
|
|
9
|
-
'n-04': 'rgba(52, 55, 64, 1)',
|
|
10
|
-
'n-05': 'rgba(33, 34, 41, 1)',
|
|
11
|
-
'n-opa-10': 'rgba(124, 134, 163, 0.1)',
|
|
12
|
-
'n-opa-16': 'rgba(124, 134, 163, 0.16)',
|
|
13
|
-
'n-opa-24': 'rgba(124, 134, 163, 0.24)',
|
|
14
|
-
'n-opa-32': 'rgba(125, 139, 172, 0.32)',
|
|
15
|
-
'n-00-opa-32': 'rgba(255, 255, 255, 0.32)',
|
|
16
|
-
|
|
17
|
-
// brand colors
|
|
18
|
-
brand: 'rgba(17, 164, 255, 1)',
|
|
19
|
-
'brand-hover': 'rgba(0, 132, 214, 1)',
|
|
20
|
-
'brand-opa-10': 'rgba(17, 164, 255, 0.1)',
|
|
21
|
-
'brand-opa-16': 'rgba(17, 164, 255, 0.16)',
|
|
22
|
-
'brand-opa-24': 'rgba(17, 164, 255, 0.24)',
|
|
23
|
-
'brand-opa-32': 'rgba(17, 164, 255, 0.32)',
|
|
24
|
-
|
|
25
|
-
// blue colors
|
|
26
|
-
'b-01': 'rgba(231, 246, 255, 1)',
|
|
27
|
-
'b-02': 'rgba(17, 164, 255, 1)',
|
|
28
|
-
'b-03': 'rgba(0, 132, 214, 1)',
|
|
29
|
-
'b-04': 'rgba(30, 55, 75, 1)',
|
|
30
|
-
'b-05': 'rgba(66, 183, 255, 1)',
|
|
31
|
-
'b-06': 'rgba(0, 75, 122, 1)',
|
|
32
|
-
'b-07': 'rgba(158, 218, 255, 1)',
|
|
33
|
-
'b-opa-10': 'rgba(17, 164, 255, 0.1)',
|
|
34
|
-
'b-opa-16': 'rgba(17, 164, 255, 0.16)',
|
|
35
|
-
'b-opa-24': 'rgba(17, 164, 255, 0.24)',
|
|
36
|
-
'b-opa-32': 'rgba(17, 164, 255, 0.32)',
|
|
37
|
-
|
|
38
|
-
// green colors
|
|
39
|
-
'g-01': 'rgba(233, 248, 239, 1)',
|
|
40
|
-
'g-02': 'rgba(37, 184, 97, 1)',
|
|
41
|
-
'g-03': 'rgba(28, 140, 74, 1)',
|
|
42
|
-
'g-04': 'rgba(34, 58, 50, 1)',
|
|
43
|
-
'g-05': 'rgba(55, 215, 120, 1)',
|
|
44
|
-
'g-06': 'rgba(17, 85, 44, 1)',
|
|
45
|
-
'g-07': 'rgba(136, 231, 174, 1)',
|
|
46
|
-
'g-opa-10': 'rgba(37, 184, 97, 0.1)',
|
|
47
|
-
'g-opa-16': 'rgba(37, 184, 97, 0.16)',
|
|
48
|
-
'g-opa-24': 'rgba(37, 184, 97, 0.24)',
|
|
49
|
-
'g-opa-32': 'rgba(37, 184, 97, 0.32)',
|
|
50
|
-
|
|
51
|
-
// yellow colors
|
|
52
|
-
'y-01': 'rgba(254, 246, 231, 1)',
|
|
53
|
-
'y-02': 'rgba(244, 156, 0, 1)',
|
|
54
|
-
'y-03': 'rgba(214, 138, 5, 1)',
|
|
55
|
-
'y-04': 'rgba(68, 55, 37, 1)',
|
|
56
|
-
'y-05': 'rgba(251, 185, 70, 1)',
|
|
57
|
-
'y-06': 'rgba(107, 68, 0, 1)',
|
|
58
|
-
'y-07': 'rgba(255, 210, 133, 1)',
|
|
59
|
-
'y-opa-10': 'rgba(244, 156, 0, 0.1)',
|
|
60
|
-
'y-opa-16': 'rgba(244, 156, 0, 0.16)',
|
|
61
|
-
'y-opa-24': 'rgba(244, 156, 0, 0.24)',
|
|
62
|
-
'y-opa-32': 'rgba(244, 156, 0, 0.32)',
|
|
63
|
-
|
|
64
|
-
// red colors
|
|
65
|
-
'r-01': 'rgba(254, 235, 236, 1)',
|
|
66
|
-
'r-02': 'rgba(248, 55, 67, 1)',
|
|
67
|
-
'r-03': 'rgba(197, 7, 19, 1)',
|
|
68
|
-
'r-04': 'rgba(67, 37, 45, 1)',
|
|
69
|
-
'r-05': 'rgba(249, 103, 112, 1)',
|
|
70
|
-
'r-06': 'rgba(137, 6, 14, 1)',
|
|
71
|
-
'r-07': 'rgba(248, 180, 186, 1)',
|
|
72
|
-
'r-opa-10': 'rgba(248, 55, 67, 0.1)',
|
|
73
|
-
'r-opa-16': 'rgba(248, 55, 67, 0.16)',
|
|
74
|
-
'r-opa-24': 'rgba(248, 55, 67, 0.24)',
|
|
75
|
-
'r-opa-32': 'rgba(248, 55, 67, 0.32)',
|
|
76
|
-
|
|
77
|
-
// purple colors
|
|
78
|
-
'pu-02': 'rgba(143, 101, 255, 1)',
|
|
79
|
-
'pu-06': 'rgba(58, 0, 219, 1)',
|
|
80
|
-
'pu-07': 'rgba(209, 194, 255, 1)',
|
|
81
|
-
'pu-opa-10': 'rgba(143, 101, 255, 0.1)',
|
|
82
|
-
'pu-opa-16': 'rgba(143, 101, 255, 0.16)',
|
|
83
|
-
'pu-opa-24': 'rgba(143, 101, 255, 0.24)',
|
|
84
|
-
|
|
85
|
-
// orange colors
|
|
86
|
-
'or-02': 'rgba(255, 116, 87, 1)',
|
|
87
|
-
'or-06': 'rgba(143, 24, 0, 1)',
|
|
88
|
-
'or-07': 'rgba(255, 198, 189, 1)',
|
|
89
|
-
'or-opa-10': 'rgba(255, 117, 87, 0.1)',
|
|
90
|
-
'or-opa-16': 'rgba(255, 117, 87, 0.16)',
|
|
91
|
-
'or-opa-24': 'rgba(255, 117, 87, 0.24)',
|
|
92
|
-
|
|
93
|
-
// turquoise colors
|
|
94
|
-
'tu-02': 'rgba(0, 198, 181, 1)',
|
|
95
|
-
'tu-06': 'rgba(0, 82, 72, 1)',
|
|
96
|
-
'tu-07': 'rgba(0, 245, 224, 1)',
|
|
97
|
-
'tu-opa-10': 'rgba(0, 198, 181, 0.1)',
|
|
98
|
-
'tu-opa-16': 'rgba(0, 198, 181, 0.16)',
|
|
99
|
-
'tu-opa-24': 'rgba(0, 198, 181, 0.24)',
|
|
100
|
-
|
|
101
|
-
// pink colors
|
|
102
|
-
'pi-02': 'rgba(255, 85, 138, 1)',
|
|
103
|
-
'pi-06': 'rgba(143, 0, 45, 1)',
|
|
104
|
-
'pi-07': 'rgba(255, 189, 210, 1)',
|
|
105
|
-
'pi-opa-10': 'rgba(255, 85, 138, 0.1)',
|
|
106
|
-
'pi-opa-16': 'rgba(255, 85, 138, 0.16)',
|
|
107
|
-
'pi-opa-24': 'rgba(255, 85, 138, 0.24)',
|
|
108
|
-
|
|
109
|
-
// ultramarine colors
|
|
110
|
-
'ul-02': 'rgba(84, 119, 255, 1)',
|
|
111
|
-
'ul-06': 'rgba(0, 41, 204, 1)',
|
|
112
|
-
'ul-07': 'rgba(184, 198, 255, 1)',
|
|
113
|
-
'ul-opa-10': 'rgba(84, 119, 255, 0.1)',
|
|
114
|
-
'ul-opa-16': 'rgba(84, 119, 255, 0.16)',
|
|
115
|
-
'ul-opa-24': 'rgba(84, 119, 255, 0.24)',
|
|
116
|
-
|
|
117
|
-
// peach colors
|
|
118
|
-
'pe-02': 'rgba(255, 147, 69, 1)',
|
|
119
|
-
'pe-06': 'rgba(128, 53, 0, 1)',
|
|
120
|
-
'pe-07': 'rgba(255, 209, 179, 1)',
|
|
121
|
-
'pe-opa-10': 'rgba(255, 147, 69, 0.1)',
|
|
122
|
-
'pe-opa-16': 'rgba(255, 147, 69, 0.16)',
|
|
123
|
-
'pe-opa-24': 'rgba(255, 147, 69, 0.24)',
|
|
124
|
-
|
|
125
|
-
// apple colors
|
|
126
|
-
'ap-02': 'rgba(127, 185, 81, 1)',
|
|
127
|
-
'ap-06': 'rgba(54, 81, 31, 1)',
|
|
128
|
-
'ap-07': 'rgba(198, 225, 173, 1)',
|
|
129
|
-
'ap-opa-10': 'rgba(127, 185, 81, 0.1)',
|
|
130
|
-
'ap-opa-16': 'rgba(127, 185, 81, 0.16)',
|
|
131
|
-
'ap-opa-24': 'rgba(127, 185, 81, 0.24)',
|
|
132
|
-
|
|
133
|
-
// bubblegum colors
|
|
134
|
-
'bu-02': 'rgba(238, 91, 197, 1)',
|
|
135
|
-
'bu-06': 'rgba(135, 13, 100, 1)',
|
|
136
|
-
'bu-07': 'rgba(249, 190, 234, 1)',
|
|
137
|
-
'bu-opa-10': 'rgba(238, 91, 197, 0.1)',
|
|
138
|
-
'bu-opa-16': 'rgba(238, 91, 197, 0.16)',
|
|
139
|
-
'bu-opa-24': 'rgba(238, 91, 197, 0.24)',
|
|
140
|
-
|
|
141
|
-
// ocher colors
|
|
142
|
-
'oc-02': 'rgba(251, 171, 0, 1)',
|
|
143
|
-
'oc-06': 'rgba(102, 70, 0, 1)',
|
|
144
|
-
'oc-07': 'rgba(255, 218, 138, 1)',
|
|
145
|
-
'oc-opa-10': 'rgba(251, 171, 0, 0.1)',
|
|
146
|
-
'oc-opa-16': 'rgba(251, 171, 0, 0.16)',
|
|
147
|
-
'oc-opa-24': 'rgba(251, 171, 0, 0.24)',
|
|
148
|
-
|
|
149
|
-
// bluberry colors
|
|
150
|
-
'br-02': 'rgba(101, 98, 255, 1)',
|
|
151
|
-
'br-06': 'rgba(4, 0, 230, 1)',
|
|
152
|
-
'br-07': 'rgba(95, 194, 255, 1)',
|
|
153
|
-
'br-opa-10': 'rgba(101, 98, 255, 0.1)',
|
|
154
|
-
'br-opa-16': 'rgba(101, 98, 255, 0.16)',
|
|
155
|
-
'br-opa-24': 'rgba(101, 98, 255, 0.24)',
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
const generateRgbaColor = ({ red, green, blue }: RGBColor, alpha: number) =>
|
|
159
|
-
`rgba(${red}, ${green}, ${blue}, ${alpha})`;
|
|
160
|
-
export const generateBrandColors = (rgb: RGBColor) => ({
|
|
161
|
-
brand: generateRgbaColor(rgb, 1),
|
|
162
|
-
'brand-hover': `rgba(${adjustBrightness(
|
|
163
|
-
`${rgb.red}, ${rgb.green}, ${rgb.blue}`
|
|
164
|
-
)}, 1)`,
|
|
165
|
-
'brand-opa-10': generateRgbaColor(rgb, 0.1),
|
|
166
|
-
'brand-opa-16': generateRgbaColor(rgb, 0.16),
|
|
167
|
-
'brand-opa-24': generateRgbaColor(rgb, 0.24),
|
|
168
|
-
'brand-opa-32': generateRgbaColor(rgb, 0.32),
|
|
169
|
-
});
|
package/src/colors/index.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { RGBColor } from '../colors-utils';
|
|
2
|
-
import type { LABEL_OPTIONS } from '../const';
|
|
3
|
-
import { ATOMIC_COLORS, generateBrandColors } from './atomic-colors';
|
|
4
|
-
import { COLOR_TOKEN_MAP } from './tokens/color-token-mapping';
|
|
5
|
-
|
|
6
|
-
export interface ThemeColorOptions {
|
|
7
|
-
lightMode: 'dark' | 'light';
|
|
8
|
-
label: (typeof LABEL_OPTIONS)[keyof typeof LABEL_OPTIONS];
|
|
9
|
-
primaryColor?: RGBColor;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type ColorTokenResponse = {
|
|
13
|
-
[type in keyof typeof COLOR_TOKEN_MAP]: string;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const generateColorsForTheme = (
|
|
17
|
-
themeOptions: ThemeColorOptions
|
|
18
|
-
): ColorTokenResponse => {
|
|
19
|
-
const { lightMode, label, primaryColor } = themeOptions;
|
|
20
|
-
const atomicColorsWithBrand = {
|
|
21
|
-
...ATOMIC_COLORS,
|
|
22
|
-
...(primaryColor ? generateBrandColors(primaryColor) : {}),
|
|
23
|
-
};
|
|
24
|
-
return Object.fromEntries(
|
|
25
|
-
Object.entries(COLOR_TOKEN_MAP).map(([key, value]) => {
|
|
26
|
-
const relevantAtomicColor = value[label][lightMode];
|
|
27
|
-
const rawRgbValue = atomicColorsWithBrand[relevantAtomicColor];
|
|
28
|
-
return [key, rawRgbValue];
|
|
29
|
-
})
|
|
30
|
-
) as ColorTokenResponse;
|
|
31
|
-
};
|