@pega/cosmos-react-core 9.0.0-build.11.3 → 9.0.0-build.11.5
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/lib/components/Badges/Count.d.ts +2 -0
- package/lib/components/Badges/Count.d.ts.map +1 -1
- package/lib/components/Badges/Count.js +2 -2
- package/lib/components/Badges/Count.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.js +1 -1
- package/lib/components/ComboBox/ComboBox.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.js +1 -3
- package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
- package/lib/components/CreditCard/CreditCard.types.d.ts +4 -0
- package/lib/components/CreditCard/CreditCard.types.d.ts.map +1 -1
- package/lib/components/CreditCard/CreditCard.types.js.map +1 -1
- package/lib/components/CreditCard/CreditCardInput.d.ts +1 -0
- package/lib/components/CreditCard/CreditCardInput.d.ts.map +1 -1
- package/lib/components/CreditCard/CreditCardInput.js +1 -1
- package/lib/components/CreditCard/CreditCardInput.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.js +1 -1
- package/lib/components/Currency/CurrencyInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts +3 -0
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +11 -5
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.js +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.js +1 -3
- package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.js +1 -1
- package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
- package/lib/components/DateTime/Input/PartInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/PartInput.js +1 -1
- package/lib/components/DateTime/Input/PartInput.js.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.js +1 -1
- package/lib/components/DateTime/Input/QuarterInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +1 -1
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.js +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.js +1 -1
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/File/FileInput.d.ts.map +1 -1
- package/lib/components/File/FileInput.js +1 -2
- package/lib/components/File/FileInput.js.map +1 -1
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/Icon/Icon.js +1 -0
- package/lib/components/Icon/Icon.js.map +1 -1
- package/lib/components/Icon/index.d.ts +1 -1
- package/lib/components/Icon/index.d.ts.map +1 -1
- package/lib/components/Icon/index.js +1 -1
- package/lib/components/Icon/index.js.map +1 -1
- package/lib/components/Input/Input.js +1 -1
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +2 -0
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/Location/LocationInput.js +1 -1
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +1 -1
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.types.d.ts +7 -2
- package/lib/components/Modal/Modal.types.d.ts.map +1 -1
- package/lib/components/Modal/Modal.types.js.map +1 -1
- package/lib/components/Number/NumberInput.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.js +1 -3
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/NumberRangeInput.d.ts.map +1 -1
- package/lib/components/Number/NumberRangeInput.js +1 -3
- package/lib/components/Number/NumberRangeInput.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts +1 -0
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +7 -1
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/Phone/PhoneInput.d.ts +3 -0
- package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
- package/lib/components/Phone/PhoneInput.js +6 -2
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js +1 -1
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +1 -1
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/Select/Select.d.ts.map +1 -1
- package/lib/components/Select/Select.js +1 -1
- package/lib/components/Select/Select.js.map +1 -1
- package/lib/components/SummaryList/SummaryList.d.ts +2 -1
- package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
- package/lib/components/SummaryList/SummaryList.js +3 -3
- package/lib/components/SummaryList/SummaryList.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +1 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/i18n/default.d.ts +1 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +1 -0
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +1 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/styles/animations.d.ts.map +1 -1
- package/lib/styles/animations.js +51 -53
- package/lib/styles/animations.js.map +1 -1
- package/lib/styles/constants.d.ts +2 -0
- package/lib/styles/constants.d.ts.map +1 -1
- package/lib/styles/constants.js +10 -0
- package/lib/styles/constants.js.map +1 -1
- package/lib/styles/gradients.js +1 -1
- package/lib/styles/gradients.js.map +1 -1
- package/lib/styles/utils.d.ts +3 -3
- package/lib/styles/utils.d.ts.map +1 -1
- package/lib/styles/utils.js +21 -10
- package/lib/styles/utils.js.map +1 -1
- package/lib/theme/themes/studioDarkTheme.json +4 -3
- package/lib/theme/themes/studioTheme.json +5 -5
- package/package.json +1 -1
package/lib/i18n/i18n.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/i18n/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,WAAW,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAClE,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE7D,QAAA,MAAM,MAAM,GAAI,eAAe,WAAW,KAAG,QAAQ,CAAC,eAAe,CAEpE,CAAC;AACF,eAAe,MAAM,CAAC;AAEtB,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/i18n/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,WAAW,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAClE,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE7D,QAAA,MAAM,MAAM,GAAI,eAAe,WAAW,KAAG,QAAQ,CAAC,eAAe,CAEpE,CAAC;AACF,eAAe,MAAM,CAAC;AAEtB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAW,CAAC;AAiB3C,eAAO,MAAM,SAAS,GAAI,WAAW,MAAM,KAAG,KAAK,GAAG,KAErD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animations.d.ts","sourceRoot":"","sources":["../../src/styles/animations.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,uCAQlB,CAAC;AAEF,eAAO,MAAM,aAAa,uCAQzB,CAAC;AAEF,eAAO,MAAM,WAAW,uCAQvB,CAAC;AAEF,eAAO,MAAM,aAAa,uCAQzB,CAAC;AAEF,eAAO,MAAM,WAAW,uCAQvB,CAAC;AAEF,eAAO,MAAM,OAAO,uCAQnB,CAAC;AAEF,eAAO,MAAM,QAAQ,uCAQpB,CAAC;AAEF,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"animations.d.ts","sourceRoot":"","sources":["../../src/styles/animations.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,uCAQlB,CAAC;AAEF,eAAO,MAAM,aAAa,uCAQzB,CAAC;AAEF,eAAO,MAAM,WAAW,uCAQvB,CAAC;AAEF,eAAO,MAAM,aAAa,uCAQzB,CAAC;AAEF,eAAO,MAAM,WAAW,uCAQvB,CAAC;AAEF,eAAO,MAAM,OAAO,uCAQnB,CAAC;AAEF,eAAO,MAAM,QAAQ,uCAQpB,CAAC;AAEF,eAAO,MAAM,aAAa,oIAUzB,CAAC"}
|
package/lib/styles/animations.js
CHANGED
|
@@ -1,78 +1,76 @@
|
|
|
1
1
|
import { css, keyframes } from 'styled-components';
|
|
2
2
|
export const reveal = keyframes `
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
from {
|
|
4
|
+
opacity: 0;
|
|
5
|
+
}
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
to {
|
|
8
|
+
opacity: 1;
|
|
9
|
+
}
|
|
10
10
|
`;
|
|
11
11
|
export const slideInXStart = keyframes `
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
from {
|
|
13
|
+
translate: var(--slide-in-x-start-offset, -1rem) 0;
|
|
14
|
+
}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
to {
|
|
17
|
+
translate: 0 0;
|
|
18
|
+
}
|
|
19
19
|
`;
|
|
20
20
|
export const slideInXEnd = keyframes `
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
from {
|
|
22
|
+
translate: var(--slide-in-x-end-offset, 1rem) 0;
|
|
23
|
+
}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
to {
|
|
26
|
+
translate: 0 0;
|
|
27
|
+
}
|
|
28
28
|
`;
|
|
29
29
|
export const slideInYStart = keyframes `
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
from {
|
|
31
|
+
translate: 0 var(--slide-in-y-start-offset, -1rem);
|
|
32
|
+
}
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
to {
|
|
35
|
+
translate: 0 0;
|
|
36
|
+
}
|
|
37
37
|
`;
|
|
38
38
|
export const slideInYEnd = keyframes `
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
from {
|
|
40
|
+
translate: 0 var(--slide-in-y-end-offset, 1rem);
|
|
41
|
+
}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
to {
|
|
44
|
+
translate: 0 0;
|
|
45
|
+
}
|
|
46
46
|
`;
|
|
47
47
|
export const scaleIn = keyframes `
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
from {
|
|
49
|
+
scale: var(--scale-in-size, 0);
|
|
50
|
+
}
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
to {
|
|
53
|
+
scale: 1;
|
|
54
|
+
}
|
|
55
55
|
`;
|
|
56
56
|
export const scaleOut = keyframes `
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
from {
|
|
58
|
+
scale: 1;
|
|
59
|
+
}
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
to {
|
|
62
|
+
scale: var(--scale-out-size, 0);
|
|
63
|
+
}
|
|
64
64
|
`;
|
|
65
65
|
export const subProperties = css `
|
|
66
|
-
${({ theme }) =>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
animation-timing-function
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
`;
|
|
76
|
-
}}
|
|
66
|
+
${({ theme }) => css `
|
|
67
|
+
animation-duration: var(--animation-duration, ${theme.base.animation.speed});
|
|
68
|
+
animation-delay: var(--animation-delay, 0);
|
|
69
|
+
animation-fill-mode: var(--animation-fill-mode, none);
|
|
70
|
+
animation-timing-function: var(
|
|
71
|
+
--animation-timing-function,
|
|
72
|
+
${theme.base.animation.timing.ease}
|
|
73
|
+
);
|
|
74
|
+
`}
|
|
77
75
|
`;
|
|
78
76
|
//# sourceMappingURL=animations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animations.js","sourceRoot":"","sources":["../../src/styles/animations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAA;;;;;;;;CAQ9B,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAA;;;;;;;;CAQrC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAA;;;;;;;;CAQnC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAA;;;;;;;;CAQrC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAA;;;;;;;;CAQnC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAA;;;;;;;;CAQ/B,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAA;;;;;;;;CAQhC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;IAC5B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"animations.js","sourceRoot":"","sources":["../../src/styles/animations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAA;;;;;;;;CAQ9B,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAA;;;;;;;;CAQrC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAA;;;;;;;;CAQnC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAA;;;;;;;;CAQrC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAA;;;;;;;;CAQnC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAA;;;;;;;;CAQ/B,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAA;;;;;;;;CAQhC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;IAC5B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;oDAC8B,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;;;;;QAKtE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;;GAErC;CACF,CAAC","sourcesContent":["import { css, keyframes } from 'styled-components';\n\nexport const reveal = keyframes`\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n`;\n\nexport const slideInXStart = keyframes`\n from {\n translate: var(--slide-in-x-start-offset, -1rem) 0;\n }\n\n to {\n translate: 0 0;\n }\n`;\n\nexport const slideInXEnd = keyframes`\n from {\n translate: var(--slide-in-x-end-offset, 1rem) 0;\n }\n\n to {\n translate: 0 0;\n }\n`;\n\nexport const slideInYStart = keyframes`\n from {\n translate: 0 var(--slide-in-y-start-offset, -1rem);\n }\n\n to {\n translate: 0 0;\n }\n`;\n\nexport const slideInYEnd = keyframes`\n from {\n translate: 0 var(--slide-in-y-end-offset, 1rem);\n }\n\n to {\n translate: 0 0;\n }\n`;\n\nexport const scaleIn = keyframes`\n from {\n scale: var(--scale-in-size, 0);\n }\n\n to {\n scale: 1;\n }\n`;\n\nexport const scaleOut = keyframes`\n from {\n scale: 1;\n }\n\n to {\n scale: var(--scale-out-size, 0);\n }\n`;\n\nexport const subProperties = css`\n ${({ theme }) => css`\n animation-duration: var(--animation-duration, ${theme.base.animation.speed});\n animation-delay: var(--animation-delay, 0);\n animation-fill-mode: var(--animation-fill-mode, none);\n animation-timing-function: var(\n --animation-timing-function,\n ${theme.base.animation.timing.ease}\n );\n `}\n`;\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { ContrastScores } from 'polished/lib/types/color';
|
|
1
2
|
export declare const resizeDrawerMinWidth = "21.875rem";
|
|
2
3
|
export declare const resizeDrawerMaxWidth = "calc(100vw - 20rem)";
|
|
3
4
|
export declare const resizeDrawerDefaultWidth = "clamp(21.875rem, (100vw - 31.25rem) / 10 + 21.875rem, 31.25rem)";
|
|
4
5
|
export declare const resizeDrawerKeyboardStep = 0.05;
|
|
6
|
+
export declare const wcagContrast: Record<keyof ContrastScores | 'AANonText', number>;
|
|
5
7
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/styles/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,cAAc,CAAC;AAChD,eAAO,MAAM,oBAAoB,wBAAwB,CAAC;AAC1D,eAAO,MAAM,wBAAwB,oEAC8B,CAAC;AACpE,eAAO,MAAM,wBAAwB,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/styles/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,eAAO,MAAM,oBAAoB,cAAc,CAAC;AAChD,eAAO,MAAM,oBAAoB,wBAAwB,CAAC;AAC1D,eAAO,MAAM,wBAAwB,oEAC8B,CAAC;AACpE,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,EAAE,MAAM,CAS3E,CAAC"}
|
package/lib/styles/constants.js
CHANGED
|
@@ -2,4 +2,14 @@ export const resizeDrawerMinWidth = '21.875rem';
|
|
|
2
2
|
export const resizeDrawerMaxWidth = 'calc(100vw - 20rem)';
|
|
3
3
|
export const resizeDrawerDefaultWidth = 'clamp(21.875rem, (100vw - 31.25rem) / 10 + 21.875rem, 31.25rem)';
|
|
4
4
|
export const resizeDrawerKeyboardStep = 0.05;
|
|
5
|
+
export const wcagContrast = {
|
|
6
|
+
// https://www.w3.org/TR/WCAG21/#contrast-minimum
|
|
7
|
+
AA: 4.5,
|
|
8
|
+
AALarge: 3,
|
|
9
|
+
// https://www.w3.org/TR/WCAG21/#contrast-enhanced
|
|
10
|
+
AAA: 7,
|
|
11
|
+
AAALarge: 4.5,
|
|
12
|
+
// https://www.w3.org/TR/WCAG21/#non-text-contrast
|
|
13
|
+
AANonText: 3
|
|
14
|
+
};
|
|
5
15
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/styles/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/styles/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAChD,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AAC1D,MAAM,CAAC,MAAM,wBAAwB,GACnC,iEAAiE,CAAC;AACpE,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAE7C,MAAM,CAAC,MAAM,YAAY,GAAuD;IAC9E,iDAAiD;IACjD,EAAE,EAAE,GAAG;IACP,OAAO,EAAE,CAAC;IACV,kDAAkD;IAClD,GAAG,EAAE,CAAC;IACN,QAAQ,EAAE,GAAG;IACb,kDAAkD;IAClD,SAAS,EAAE,CAAC;CACb,CAAC","sourcesContent":["import type { ContrastScores } from 'polished/lib/types/color';\n\nexport const resizeDrawerMinWidth = '21.875rem';\nexport const resizeDrawerMaxWidth = 'calc(100vw - 20rem)';\nexport const resizeDrawerDefaultWidth =\n 'clamp(21.875rem, (100vw - 31.25rem) / 10 + 21.875rem, 31.25rem)';\nexport const resizeDrawerKeyboardStep = 0.05;\n\nexport const wcagContrast: Record<keyof ContrastScores | 'AANonText', number> = {\n // https://www.w3.org/TR/WCAG21/#contrast-minimum\n AA: 4.5,\n AALarge: 3,\n // https://www.w3.org/TR/WCAG21/#contrast-enhanced\n AAA: 7,\n AAALarge: 4.5,\n // https://www.w3.org/TR/WCAG21/#non-text-contrast\n AANonText: 3\n};\n"]}
|
package/lib/styles/gradients.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gradients.js","sourceRoot":"","sources":["../../src/styles/gradients.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAWvC,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,SAAS,EAAE;QACT,EAAE,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,CAAC,EAAE;QAC5C,EAAE,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,CAAC,EAAE;KAC3C;IACD,cAAc,EAAE;QACd,EAAE,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,CAAC,EAAE;QAC5C,EAAE,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE;QAChD,EAAE,KAAK,EAAE,qBAAqB,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE;QACjD,EAAE,KAAK,EAAE,qBAAqB,EAAE,QAAQ,EAAE,CAAC,EAAE;KAC9C;IACD,eAAe,EAAE;QACf,EAAE,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,CAAC,EAAE;QAC5C,EAAE,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE;QAChD,EAAE,KAAK,EAAE,qBAAqB,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,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,QAAQ,GAAG,GAAG,GAAG,CAAC;SAC3D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AACnB,CAAC,CAAC","sourcesContent":["// cspell:words deutan\nimport { getContrast, mix } from 'polished';\n\nimport { wcagContrast } from './utils';\n\ninterface ColorStop {\n /** CSS color string. */\n color: string;\n /** Position along the gradient expressed as a number from 0 to 1. */\n position: number;\n}\n\ntype LinearGradient = ColorStop[];\n\nexport const gradientMap = {\n grayscale: [\n { color: 'hsl(0, 100%, 100%)', position: 0 },\n { color: 'hsl(0, 100%, 0%)', position: 1 }\n ],\n 'persian-blue': [\n { color: 'hsl(210, 50%, 94%)', position: 0 },\n { color: 'hsl(210, 46%, 63%)', position: 1 / 3 },\n { color: 'hsl(206, 100%, 33%)', position: 2 / 3 },\n { color: 'hsl(210, 100%, 27%)', position: 1 }\n ],\n 'persian-green': [\n { color: 'hsl(175, 35%, 94%)', position: 0 },\n { color: 'hsl(175, 42%, 65%)', position: 1 / 3 },\n { color: 'hsl(175, 100%, 33%)', position: 2 / 3 },\n { color: 'hsl(175, 100%, 27%)', position: 1 }\n ],\n 'pastel-orange': [\n { color: 'hsl(36, 100%, 97%)', position: 0 },\n { color: 'hsl(36, 100%, 79%)', position: 1 / 3 },\n { color: 'hsl(36, 100%, 64%)', position: 2 / 3 },\n { color: 'hsl(36, 99%, 61%)', position: 1 }\n ],\n 'japanese-laurel': [\n { color: 'hsl(135, 21%, 94%)', position: 0 },\n { color: 'hsl(135, 24%, 61%)', position: 1 / 3 },\n { color: 'hsl(135, 54%, 33%)', position: 2 / 3 },\n { color: 'hsl(135, 60%, 26%)', position: 1 }\n ],\n 'mango-tango': [\n { color: 'hsl(23, 100%, 96%)', position: 0 },\n { color: 'hsl(23, 100%, 78%)', position: 1 / 3 },\n { color: 'hsl(23, 100%, 62%)', position: 2 / 3 },\n { color: 'hsl(23, 100%, 53%)', position: 1 }\n ],\n valencia: [\n { color: 'hsl(1, 87%, 96%)', position: 0 },\n { color: 'hsl(1, 72%, 75%)', position: 1 / 3 },\n { color: 'hsl(1, 67%, 56%)', position: 2 / 3 },\n { color: 'hsl(1, 82%, 41%)', position: 1 }\n ],\n 'fuchsia-blue': [\n { color: 'hsl(259, 45%, 96%)', position: 0 },\n { color: 'hsl(259, 45%, 78%)', position: 1 / 3 },\n { color: 'hsl(259, 43%, 56%)', position: 2 / 3 },\n { color: 'hsl(259, 40%, 49%)', position: 1 }\n ],\n 'faded-red': [\n { color: 'hsl(360, 100%, 95%)', position: 0 },\n { color: 'hsl(360, 100%, 85%)', position: 1 / 3 },\n { color: 'hsl(360, 100%, 75%)', position: 2 / 3 },\n { color: 'hsl(360, 100%, 70%)', position: 1 }\n ],\n rope: [\n { color: 'hsl(25, 31%, 93%)', position: 0 },\n { color: 'hsl(25, 32%, 62%)', position: 1 / 3 },\n { color: 'hsl(25, 59%, 35%)', position: 2 / 3 },\n { color: 'hsl(25, 64%, 30%)', position: 1 }\n ],\n silver: [\n { color: 'hsl(15, 18%, 97%)', position: 0 },\n { color: 'hsl(15, 9%, 79%)', position: 1 / 3 },\n { color: 'hsl(15, 11%, 65%)', position: 2 / 3 },\n { color: 'hsl(15, 9%, 58%)', position: 1 }\n ],\n 'blue-yellow': [\n { color: 'hsl(56, 100%, 93%)', position: 0 },\n { color: 'hsl(144, 46%, 79%)', position: 2 / 10 },\n { color: 'hsl(185, 53%, 58%)', position: 4 / 10 },\n { color: 'hsl(191, 56%, 52%)', position: 5 / 10 },\n { color: 'hsl(195, 62%, 48%)', position: 6 / 10 },\n { color: 'hsl(206, 67%, 37%)', position: 8 / 10 },\n { color: 'hsl(215, 62%, 30%)', position: 1 }\n ],\n 'green-yellow': [\n { color: 'hsl(56, 100%, 93%)', position: 0 },\n { color: 'hsl(88, 61%, 85%)', position: 2 / 10 },\n { color: 'hsl(125, 47%, 78%)', position: 4 / 10 },\n { color: 'hsl(148, 45%, 65%)', position: 5 / 10 },\n { color: 'hsl(159, 47%, 50%)', position: 6 / 10 },\n { color: 'hsl(173, 80%, 30%)', position: 8 / 10 },\n { color: 'hsl(178, 73%, 22%)', position: 1 }\n ],\n 'ruby-yellow': [\n { color: 'hsl(56, 100%, 93%)', position: 0 },\n { color: 'hsl(40, 100%, 83%)', position: 2 / 10 },\n { color: 'hsl(19, 100%, 75%)', position: 4 / 10 },\n { color: 'hsl(3, 100%, 73%)', position: 5 / 10 },\n { color: 'hsl(350, 81%, 62%)', position: 6 / 10 },\n { color: 'hsl(343, 54%, 55%)', position: 8 / 10 },\n { color: 'hsl(330, 40%, 36%)', position: 1 }\n ],\n 'purple-blue': [\n { color: 'hsl(190, 42%, 97%)', position: 0 },\n { color: 'hsl(205, 51%, 84%)', position: 2 / 10 },\n { color: 'hsl(212, 47%, 73%)', position: 4 / 10 },\n { color: 'hsl(219, 41%, 70%)', position: 5 / 10 },\n { color: 'hsl(253, 32%, 66%)', position: 6 / 10 },\n { color: 'hsl(272, 27%, 49%)', position: 8 / 10 },\n { color: 'hsl(272, 37%, 32%)', position: 1 }\n ],\n 'violet-rose': [\n { color: 'hsl(18, 100%, 98%)', position: 0 },\n { color: 'hsl(359, 100%, 91%)', position: 2 / 10 },\n { color: 'hsl(336, 96%, 77%)', position: 4 / 10 },\n { color: 'hsl(325, 73%, 65%)', position: 5 / 10 },\n { color: 'hsl(319, 58%, 58%)', position: 6 / 10 },\n { color: 'hsl(287, 38%, 45%)', position: 8 / 10 },\n { color: 'hsl(259, 43%, 35%)', position: 1 }\n ],\n 'negative-attention-positive': [\n { color: 'hsl(2, 67%, 56%)', position: 0 },\n { color: 'hsl(21, 87%, 60%)', position: 2 / 10 },\n { color: 'hsl(36, 100%, 64%)', position: 4 / 10 },\n { color: 'hsl(50, 95%, 75%)', position: 5 / 10 },\n { color: 'hsl(85, 72%, 67%)', position: 6 / 10 },\n { color: 'hsl(120, 49%, 60%)', position: 8 / 10 },\n { color: 'hsl(135, 53%, 33%)', position: 1 }\n ],\n 'negative-attention-positive-protan': [\n { color: 'hsl(344, 67%, 44%)', position: 0 },\n { color: 'hsl(351, 66%, 59%)', position: 2 / 10 },\n { color: 'hsl(360, 100%, 84%)', position: 4 / 10 },\n { color: 'hsl(0, 0%, 89%)', position: 5 / 10 },\n { color: 'hsl(110, 46%, 80%)', position: 6 / 10 },\n { color: 'hsl(120, 49%, 60%)', position: 8 / 10 },\n { color: 'hsl(135, 53%, 33%)', position: 1 }\n ],\n 'negative-attention-positive-deutan': [\n { color: 'hsl(315, 64%, 45%)', position: 0 },\n { color: 'hsl(313, 83%, 62%)', position: 2 / 10 },\n { color: 'hsl(313, 100%, 80%)', position: 4 / 10 },\n { color: 'hsl(0, 0%, 89%)', position: 5 / 10 },\n { color: 'hsl(110, 46%, 80%)', position: 6 / 10 },\n { color: 'hsl(120, 49%, 60%)', position: 8 / 10 },\n { color: 'hsl(135, 53%, 33%)', position: 1 }\n ],\n 'hot-cold': [\n { color: 'hsl(212, 100%, 27%)', position: 0 },\n { color: 'hsl(213, 40%, 49%)', position: 2 / 10 },\n { color: 'hsl(210, 45%, 69%)', position: 4 / 10 },\n { color: 'hsl(0, 0%, 89%)', position: 5 / 10 },\n { color: 'hsl(360, 100%, 84%)', position: 6 / 10 },\n { color: 'hsl(351, 66%, 59%)', position: 8 / 10 },\n { color: 'hsl(344, 67%, 44%)', position: 1 }\n ],\n 'two-extremes': [\n { color: 'hsl(240, 30%, 39%)', position: 0 },\n { color: 'hsl(271, 27%, 63%)', position: 2 / 10 },\n { color: 'hsl(293, 25%, 87%)', position: 4 / 10 },\n { color: 'hsl(0, 0%, 89%)', position: 5 / 10 },\n { color: 'hsl(171, 37%, 86%)', position: 6 / 10 },\n { color: 'hsl(167, 41%, 51%)', position: 8 / 10 },\n { color: 'hsl(163, 44%, 16%)', position: 1 }\n ]\n};\n\nexport const colorInGradient = ([...gradient]: LinearGradient, targetPosition: number): string => {\n // Return transparent for an empty gradient.\n if (gradient.length === 0) return 'transparent';\n\n // Return the color for single element gradient.\n if (gradient.length === 1) return gradient[0].color;\n\n // Clamp position to interval from 0 to 1.\n targetPosition = Math.min(Math.max(targetPosition, 0), 1);\n\n // Extend the the start of the gradient to 0 if necessary.\n if (gradient[0].position !== 0) gradient.unshift({ color: gradient[0].color, position: 0 });\n\n // Extend the the end of the gradient to 1 if necessary.\n if (gradient[gradient.length - 1].position !== 1)\n gradient.push({ color: gradient[gradient.length - 1].color, position: 1 });\n\n for (let i = 0; i < gradient.length; i += 1) {\n const current = gradient[i];\n\n // If target position is the same as the current position, return the color at the current position.\n if (targetPosition === current.position) return current.color;\n\n // If target position is less than the current position, it must be between the previous position and current position.\n if (targetPosition < current.position) {\n const previous = gradient[i - 1];\n\n // Calculate how far the targetPosition is between the previousPosition and the currentPosition.\n const percentage =\n (targetPosition - previous.position) / (current.position - previous.position);\n\n try {\n return mix(percentage, current.color, previous.color);\n } catch {\n // Polished mix throws on invalid color.\n return 'transparent';\n }\n }\n }\n\n // Failsafe return.\n return 'transparent';\n};\n\nexport const colorInGradientByName = (\n name: keyof typeof gradientMap,\n targetPosition: number\n): string => {\n return colorInGradient(gradientMap[name] ?? [], targetPosition);\n};\n\nexport const colorsForCategories = (\n count: number,\n {\n gradients = (\n [\n 'persian-blue',\n 'persian-green',\n 'pastel-orange',\n 'japanese-laurel',\n 'mango-tango',\n 'valencia',\n 'fuchsia-blue',\n 'faded-red',\n 'rope',\n 'silver'\n ] as const\n ).map(name => gradientMap[name]),\n steps = [2 / 3, 1 / 3, 1, 0, 1 / 2]\n }: { gradients?: LinearGradient[]; steps?: number[] } = {}\n): string[] => {\n // Colors per gradient\n const perGradient = Math.floor(count / gradients.length);\n\n // Number of gradients with 1 extra color\n const extra = count % gradients.length;\n\n const colors: string[] = [];\n\n for (let i = 0; i < gradients.length; i += 1) {\n for (let j = 0; j < (i < extra ? perGradient + 1 : perGradient); j += 1) {\n colors.push(colorInGradient(gradients[i], steps[j % steps.length]));\n }\n }\n\n return colors;\n};\n\nexport const nlpColors = (\n [\n ['persian-blue', 1],\n ['persian-green', 1],\n ['pastel-orange', 1],\n ['japanese-laurel', 1],\n ['mango-tango', 1],\n ['valencia', 1],\n ['fuchsia-blue', 1],\n ['faded-red', 1],\n ['rope', 1],\n ['silver', 1],\n ['blue-yellow', 1],\n ['blue-yellow', 5 / 10],\n ['green-yellow', 1],\n ['blue-yellow', 3 / 10],\n ['green-yellow', 7 / 10],\n ['ruby-yellow', 1],\n ['ruby-yellow', 6 / 10],\n ['purple-blue', 1],\n ['two-extremes', 9 / 10],\n ['persian-blue', 1 / 2],\n ['hot-cold', 1],\n ['persian-green', 1 / 2],\n ['pastel-orange', 1 / 2],\n ['japanese-laurel', 1 / 2],\n ['mango-tango', 1 / 2],\n ['valencia', 1 / 2],\n ['fuchsia-blue', 1 / 2],\n ['faded-red', 1 / 2],\n ['rope', 1 / 2],\n ['silver', 1 / 2],\n ['blue-yellow', 7 / 10],\n ['blue-yellow', 4 / 10],\n ['green-yellow', 5 / 10],\n ['ruby-yellow', 5 / 10],\n ['purple-blue', 7 / 10],\n ['purple-blue', 5 / 10],\n ['violet-rose', 5 / 10],\n ['two-extremes', 8 / 10],\n ['ruby-yellow', 4 / 10],\n ['violet-rose', 7 / 10],\n ['negative-attention-positive-deutan', 8 / 10]\n ] as const\n).map(([gradient, position]) => colorInGradient(gradientMap[gradient], position));\n\nexport const whiteCompatibleNLPColors = nlpColors.filter(\n color => getContrast(color, '#ffffff') >= wcagContrast.AANonText\n);\n\nexport const blackCompatibleNLPColors = nlpColors.filter(\n color => getContrast(color, '#000000') >= wcagContrast.AANonText\n);\n\nexport const toLinearGradient = (\n gradient: LinearGradient,\n { direction = '180deg' }: { direction?: string } = {}\n): string => {\n if (gradient.length === 0) return 'transparent';\n if (gradient.length === 1) return gradient[0].color;\n\n return `linear-gradient(${direction}, ${gradient\n .map(({ color, position }) => `${color} ${position * 100}%`)\n .join(', ')})`;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"gradients.js","source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AAE,CAAC,GAAG,EAAE,CAAC;CAEjD,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;AAElF,MAAM,CAAC,MAAM,wBAAwB,GAAG,SAAS,CAAC,MAAM,CACtD,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,YAAY,CAAC,SAAS,CACjE,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,SAAS,CAAC,MAAM,CACtD,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,YAAY,CAAC,SAAS,CACjE,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,QAAwB,EACxB,EAAE,SAAS,GAAG,QAAQ,KAA6B,EAAE,EAC7C,EAAE;IACV,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,aAAa,CAAC;IAChD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAEpD,OAAO,mBAAmB,SAAS,KAAK,QAAQ;SAC7C,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,QAAQ,GAAG,GAAG,GAAG,CAAC;SAC3D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AACnB,CAAC,CAAC","sourcesContent":["// cspell:words deutan\nimport { getContrast, mix } from 'polished';\n\nimport { wcagContrast } from './constants';\n\ninterface ColorStop {\n /** CSS color string. */\n color: string;\n /** Position along the gradient expressed as a number from 0 to 1. */\n position: number;\n}\n\ntype LinearGradient = ColorStop[];\n\nexport const gradientMap = {\n grayscale: [\n { color: 'hsl(0, 100%, 100%)', position: 0 },\n { color: 'hsl(0, 100%, 0%)', position: 1 }\n ],\n 'persian-blue': [\n { color: 'hsl(210, 50%, 94%)', position: 0 },\n { color: 'hsl(210, 46%, 63%)', position: 1 / 3 },\n { color: 'hsl(206, 100%, 33%)', position: 2 / 3 },\n { color: 'hsl(210, 100%, 27%)', position: 1 }\n ],\n 'persian-green': [\n { color: 'hsl(175, 35%, 94%)', position: 0 },\n { color: 'hsl(175, 42%, 65%)', position: 1 / 3 },\n { color: 'hsl(175, 100%, 33%)', position: 2 / 3 },\n { color: 'hsl(175, 100%, 27%)', position: 1 }\n ],\n 'pastel-orange': [\n { color: 'hsl(36, 100%, 97%)', position: 0 },\n { color: 'hsl(36, 100%, 79%)', position: 1 / 3 },\n { color: 'hsl(36, 100%, 64%)', position: 2 / 3 },\n { color: 'hsl(36, 99%, 61%)', position: 1 }\n ],\n 'japanese-laurel': [\n { color: 'hsl(135, 21%, 94%)', position: 0 },\n { color: 'hsl(135, 24%, 61%)', position: 1 / 3 },\n { color: 'hsl(135, 54%, 33%)', position: 2 / 3 },\n { color: 'hsl(135, 60%, 26%)', position: 1 }\n ],\n 'mango-tango': [\n { color: 'hsl(23, 100%, 96%)', position: 0 },\n { color: 'hsl(23, 100%, 78%)', position: 1 / 3 },\n { color: 'hsl(23, 100%, 62%)', position: 2 / 3 },\n { color: 'hsl(23, 100%, 53%)', position: 1 }\n ],\n valencia: [\n { color: 'hsl(1, 87%, 96%)', position: 0 },\n { color: 'hsl(1, 72%, 75%)', position: 1 / 3 },\n { color: 'hsl(1, 67%, 56%)', position: 2 / 3 },\n { color: 'hsl(1, 82%, 41%)', position: 1 }\n ],\n 'fuchsia-blue': [\n { color: 'hsl(259, 45%, 96%)', position: 0 },\n { color: 'hsl(259, 45%, 78%)', position: 1 / 3 },\n { color: 'hsl(259, 43%, 56%)', position: 2 / 3 },\n { color: 'hsl(259, 40%, 49%)', position: 1 }\n ],\n 'faded-red': [\n { color: 'hsl(360, 100%, 95%)', position: 0 },\n { color: 'hsl(360, 100%, 85%)', position: 1 / 3 },\n { color: 'hsl(360, 100%, 75%)', position: 2 / 3 },\n { color: 'hsl(360, 100%, 70%)', position: 1 }\n ],\n rope: [\n { color: 'hsl(25, 31%, 93%)', position: 0 },\n { color: 'hsl(25, 32%, 62%)', position: 1 / 3 },\n { color: 'hsl(25, 59%, 35%)', position: 2 / 3 },\n { color: 'hsl(25, 64%, 30%)', position: 1 }\n ],\n silver: [\n { color: 'hsl(15, 18%, 97%)', position: 0 },\n { color: 'hsl(15, 9%, 79%)', position: 1 / 3 },\n { color: 'hsl(15, 11%, 65%)', position: 2 / 3 },\n { color: 'hsl(15, 9%, 58%)', position: 1 }\n ],\n 'blue-yellow': [\n { color: 'hsl(56, 100%, 93%)', position: 0 },\n { color: 'hsl(144, 46%, 79%)', position: 2 / 10 },\n { color: 'hsl(185, 53%, 58%)', position: 4 / 10 },\n { color: 'hsl(191, 56%, 52%)', position: 5 / 10 },\n { color: 'hsl(195, 62%, 48%)', position: 6 / 10 },\n { color: 'hsl(206, 67%, 37%)', position: 8 / 10 },\n { color: 'hsl(215, 62%, 30%)', position: 1 }\n ],\n 'green-yellow': [\n { color: 'hsl(56, 100%, 93%)', position: 0 },\n { color: 'hsl(88, 61%, 85%)', position: 2 / 10 },\n { color: 'hsl(125, 47%, 78%)', position: 4 / 10 },\n { color: 'hsl(148, 45%, 65%)', position: 5 / 10 },\n { color: 'hsl(159, 47%, 50%)', position: 6 / 10 },\n { color: 'hsl(173, 80%, 30%)', position: 8 / 10 },\n { color: 'hsl(178, 73%, 22%)', position: 1 }\n ],\n 'ruby-yellow': [\n { color: 'hsl(56, 100%, 93%)', position: 0 },\n { color: 'hsl(40, 100%, 83%)', position: 2 / 10 },\n { color: 'hsl(19, 100%, 75%)', position: 4 / 10 },\n { color: 'hsl(3, 100%, 73%)', position: 5 / 10 },\n { color: 'hsl(350, 81%, 62%)', position: 6 / 10 },\n { color: 'hsl(343, 54%, 55%)', position: 8 / 10 },\n { color: 'hsl(330, 40%, 36%)', position: 1 }\n ],\n 'purple-blue': [\n { color: 'hsl(190, 42%, 97%)', position: 0 },\n { color: 'hsl(205, 51%, 84%)', position: 2 / 10 },\n { color: 'hsl(212, 47%, 73%)', position: 4 / 10 },\n { color: 'hsl(219, 41%, 70%)', position: 5 / 10 },\n { color: 'hsl(253, 32%, 66%)', position: 6 / 10 },\n { color: 'hsl(272, 27%, 49%)', position: 8 / 10 },\n { color: 'hsl(272, 37%, 32%)', position: 1 }\n ],\n 'violet-rose': [\n { color: 'hsl(18, 100%, 98%)', position: 0 },\n { color: 'hsl(359, 100%, 91%)', position: 2 / 10 },\n { color: 'hsl(336, 96%, 77%)', position: 4 / 10 },\n { color: 'hsl(325, 73%, 65%)', position: 5 / 10 },\n { color: 'hsl(319, 58%, 58%)', position: 6 / 10 },\n { color: 'hsl(287, 38%, 45%)', position: 8 / 10 },\n { color: 'hsl(259, 43%, 35%)', position: 1 }\n ],\n 'negative-attention-positive': [\n { color: 'hsl(2, 67%, 56%)', position: 0 },\n { color: 'hsl(21, 87%, 60%)', position: 2 / 10 },\n { color: 'hsl(36, 100%, 64%)', position: 4 / 10 },\n { color: 'hsl(50, 95%, 75%)', position: 5 / 10 },\n { color: 'hsl(85, 72%, 67%)', position: 6 / 10 },\n { color: 'hsl(120, 49%, 60%)', position: 8 / 10 },\n { color: 'hsl(135, 53%, 33%)', position: 1 }\n ],\n 'negative-attention-positive-protan': [\n { color: 'hsl(344, 67%, 44%)', position: 0 },\n { color: 'hsl(351, 66%, 59%)', position: 2 / 10 },\n { color: 'hsl(360, 100%, 84%)', position: 4 / 10 },\n { color: 'hsl(0, 0%, 89%)', position: 5 / 10 },\n { color: 'hsl(110, 46%, 80%)', position: 6 / 10 },\n { color: 'hsl(120, 49%, 60%)', position: 8 / 10 },\n { color: 'hsl(135, 53%, 33%)', position: 1 }\n ],\n 'negative-attention-positive-deutan': [\n { color: 'hsl(315, 64%, 45%)', position: 0 },\n { color: 'hsl(313, 83%, 62%)', position: 2 / 10 },\n { color: 'hsl(313, 100%, 80%)', position: 4 / 10 },\n { color: 'hsl(0, 0%, 89%)', position: 5 / 10 },\n { color: 'hsl(110, 46%, 80%)', position: 6 / 10 },\n { color: 'hsl(120, 49%, 60%)', position: 8 / 10 },\n { color: 'hsl(135, 53%, 33%)', position: 1 }\n ],\n 'hot-cold': [\n { color: 'hsl(212, 100%, 27%)', position: 0 },\n { color: 'hsl(213, 40%, 49%)', position: 2 / 10 },\n { color: 'hsl(210, 45%, 69%)', position: 4 / 10 },\n { color: 'hsl(0, 0%, 89%)', position: 5 / 10 },\n { color: 'hsl(360, 100%, 84%)', position: 6 / 10 },\n { color: 'hsl(351, 66%, 59%)', position: 8 / 10 },\n { color: 'hsl(344, 67%, 44%)', position: 1 }\n ],\n 'two-extremes': [\n { color: 'hsl(240, 30%, 39%)', position: 0 },\n { color: 'hsl(271, 27%, 63%)', position: 2 / 10 },\n { color: 'hsl(293, 25%, 87%)', position: 4 / 10 },\n { color: 'hsl(0, 0%, 89%)', position: 5 / 10 },\n { color: 'hsl(171, 37%, 86%)', position: 6 / 10 },\n { color: 'hsl(167, 41%, 51%)', position: 8 / 10 },\n { color: 'hsl(163, 44%, 16%)', position: 1 }\n ]\n};\n\nexport const colorInGradient = ([...gradient]: LinearGradient, targetPosition: number): string => {\n // Return transparent for an empty gradient.\n if (gradient.length === 0) return 'transparent';\n\n // Return the color for single element gradient.\n if (gradient.length === 1) return gradient[0].color;\n\n // Clamp position to interval from 0 to 1.\n targetPosition = Math.min(Math.max(targetPosition, 0), 1);\n\n // Extend the the start of the gradient to 0 if necessary.\n if (gradient[0].position !== 0) gradient.unshift({ color: gradient[0].color, position: 0 });\n\n // Extend the the end of the gradient to 1 if necessary.\n if (gradient[gradient.length - 1].position !== 1)\n gradient.push({ color: gradient[gradient.length - 1].color, position: 1 });\n\n for (let i = 0; i < gradient.length; i += 1) {\n const current = gradient[i];\n\n // If target position is the same as the current position, return the color at the current position.\n if (targetPosition === current.position) return current.color;\n\n // If target position is less than the current position, it must be between the previous position and current position.\n if (targetPosition < current.position) {\n const previous = gradient[i - 1];\n\n // Calculate how far the targetPosition is between the previousPosition and the currentPosition.\n const percentage =\n (targetPosition - previous.position) / (current.position - previous.position);\n\n try {\n return mix(percentage, current.color, previous.color);\n } catch {\n // Polished mix throws on invalid color.\n return 'transparent';\n }\n }\n }\n\n // Failsafe return.\n return 'transparent';\n};\n\nexport const colorInGradientByName = (\n name: keyof typeof gradientMap,\n targetPosition: number\n): string => {\n return colorInGradient(gradientMap[name] ?? [], targetPosition);\n};\n\nexport const colorsForCategories = (\n count: number,\n {\n gradients = (\n [\n 'persian-blue',\n 'persian-green',\n 'pastel-orange',\n 'japanese-laurel',\n 'mango-tango',\n 'valencia',\n 'fuchsia-blue',\n 'faded-red',\n 'rope',\n 'silver'\n ] as const\n ).map(name => gradientMap[name]),\n steps = [2 / 3, 1 / 3, 1, 0, 1 / 2]\n }: { gradients?: LinearGradient[]; steps?: number[] } = {}\n): string[] => {\n // Colors per gradient\n const perGradient = Math.floor(count / gradients.length);\n\n // Number of gradients with 1 extra color\n const extra = count % gradients.length;\n\n const colors: string[] = [];\n\n for (let i = 0; i < gradients.length; i += 1) {\n for (let j = 0; j < (i < extra ? perGradient + 1 : perGradient); j += 1) {\n colors.push(colorInGradient(gradients[i], steps[j % steps.length]));\n }\n }\n\n return colors;\n};\n\nexport const nlpColors = (\n [\n ['persian-blue', 1],\n ['persian-green', 1],\n ['pastel-orange', 1],\n ['japanese-laurel', 1],\n ['mango-tango', 1],\n ['valencia', 1],\n ['fuchsia-blue', 1],\n ['faded-red', 1],\n ['rope', 1],\n ['silver', 1],\n ['blue-yellow', 1],\n ['blue-yellow', 5 / 10],\n ['green-yellow', 1],\n ['blue-yellow', 3 / 10],\n ['green-yellow', 7 / 10],\n ['ruby-yellow', 1],\n ['ruby-yellow', 6 / 10],\n ['purple-blue', 1],\n ['two-extremes', 9 / 10],\n ['persian-blue', 1 / 2],\n ['hot-cold', 1],\n ['persian-green', 1 / 2],\n ['pastel-orange', 1 / 2],\n ['japanese-laurel', 1 / 2],\n ['mango-tango', 1 / 2],\n ['valencia', 1 / 2],\n ['fuchsia-blue', 1 / 2],\n ['faded-red', 1 / 2],\n ['rope', 1 / 2],\n ['silver', 1 / 2],\n ['blue-yellow', 7 / 10],\n ['blue-yellow', 4 / 10],\n ['green-yellow', 5 / 10],\n ['ruby-yellow', 5 / 10],\n ['purple-blue', 7 / 10],\n ['purple-blue', 5 / 10],\n ['violet-rose', 5 / 10],\n ['two-extremes', 8 / 10],\n ['ruby-yellow', 4 / 10],\n ['violet-rose', 7 / 10],\n ['negative-attention-positive-deutan', 8 / 10]\n ] as const\n).map(([gradient, position]) => colorInGradient(gradientMap[gradient], position));\n\nexport const whiteCompatibleNLPColors = nlpColors.filter(\n color => getContrast(color, '#ffffff') >= wcagContrast.AANonText\n);\n\nexport const blackCompatibleNLPColors = nlpColors.filter(\n color => getContrast(color, '#000000') >= wcagContrast.AANonText\n);\n\nexport const toLinearGradient = (\n gradient: LinearGradient,\n { direction = '180deg' }: { direction?: string } = {}\n): string => {\n if (gradient.length === 0) return 'transparent';\n if (gradient.length === 1) return gradient[0].color;\n\n return `linear-gradient(${direction}, ${gradient\n .map(({ color, position }) => `${color} ${position * 100}%`)\n .join(', ')})`;\n};\n"]}
|
package/lib/styles/utils.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { StyledConfig } from 'styled-components';
|
|
2
|
-
import
|
|
3
|
-
export declare const wcagContrast: Record<keyof ContrastScores | 'AANonText', number>;
|
|
1
|
+
import type { DefaultTheme, StyledConfig } from 'styled-components';
|
|
2
|
+
import { wcagContrast } from './constants';
|
|
4
3
|
interface ContrastOptions {
|
|
5
4
|
mode?: 'light' | 'dark' | 'both';
|
|
6
5
|
level?: keyof typeof wcagContrast | number;
|
|
@@ -18,6 +17,7 @@ export declare const getActiveColors: (color: string) => {
|
|
|
18
17
|
export declare const readableHue: (color1: string, color2: string, { mode, level }?: ContrastOptions) => string;
|
|
19
18
|
export declare const omitProps: <O extends object = Record<PropertyKey, unknown>>(...props: [prop: keyof O, ...props: (keyof O)[]]) => StyledConfig<O>;
|
|
20
19
|
export type FontSize = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
|
|
20
|
+
export declare const colorIconMapping: (theme: DefaultTheme, iconName: string) => string;
|
|
21
21
|
export declare const calculateFontSize: (baseFontSize: string, baseFontScale: string | number) => Record<FontSize, string>;
|
|
22
22
|
export declare const calculateForegroundColor: (background: string, foregroundColor: string) => string;
|
|
23
23
|
export declare const calculateBackgroundAndContrastColor: (background: string, foregroundColor: string) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/styles/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/styles/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAoBpE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,OAAO,YAAY,GAAG,MAAM,CAAC;CAC5C;AAED,eAAO,MAAM,YAAY,GAAI,YAAY,MAAM,wBAO9C,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,OAAO,MAAM,EACb,kBAAkC,eAAoB,KACrD,MAYF,CAAC;AAiBF,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM;;;CAE3C,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM;;;CAE5C,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,kBAAiC,eAAoB,KACpD,MAmEF,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EACvE,GAAG,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAC/C,YAAY,CAAC,CAAC,CAEf,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,KAAK,CAAC;AAWrE,eAAO,MAAM,gBAAgB,GAAI,OAAO,YAAY,EAAE,UAAU,MAAM,WAkBrE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,cAAc,MAAM,EAAE,eAAe,MAAM,GAAG,MAAM,KAiB/E,MAAM,CAAC,QAAQ,EAAE,MAAM,CAC7B,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,YAAY,MAAM,EAAE,iBAAiB,MAAM,WAMnF,CAAC;AAEF,eAAO,MAAM,mCAAmC,GAC9C,YAAY,MAAM,EAClB,iBAAiB,MAAM,KACtB;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAiBlD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,OAAO,MAAM,KAAG,MAUnD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,GAAI,MAAM,MAAM,GAAG,MAAM,GAAG,SAAS,KAAG,MAU5E,CAAC"}
|
package/lib/styles/utils.js
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { parseToHsl, lighten, readableColor as polishedReadableColor, darken, getContrast, hsl, modularScale, stripUnit, math, getValueAndUnit, transparentize, parseToRgb } from 'polished';
|
|
2
2
|
import { tryCatch } from '../utils';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
AA: 4.5,
|
|
6
|
-
AALarge: 3,
|
|
7
|
-
// https://www.w3.org/TR/WCAG21/#contrast-enhanced
|
|
8
|
-
AAA: 7,
|
|
9
|
-
AAALarge: 4.5,
|
|
10
|
-
// https://www.w3.org/TR/WCAG21/#non-text-contrast
|
|
11
|
-
AANonText: 3
|
|
12
|
-
};
|
|
3
|
+
import { wcagContrast } from './constants';
|
|
4
|
+
import { nlpColors } from './gradients';
|
|
13
5
|
export const isSolidColor = (background) => {
|
|
14
6
|
const rgb = tryCatch(() => parseToRgb(background));
|
|
15
7
|
return (rgb &&
|
|
@@ -112,6 +104,25 @@ const stepsMap = {
|
|
|
112
104
|
xl: 3,
|
|
113
105
|
xxl: 4
|
|
114
106
|
};
|
|
107
|
+
export const colorIconMapping = (theme, iconName) => {
|
|
108
|
+
switch (iconName) {
|
|
109
|
+
case 'polaris':
|
|
110
|
+
case 'polaris-solid':
|
|
111
|
+
return theme.base.palette.ai;
|
|
112
|
+
case 'paper-clip':
|
|
113
|
+
return nlpColors[1];
|
|
114
|
+
case 'person':
|
|
115
|
+
return nlpColors[2];
|
|
116
|
+
case 'tag':
|
|
117
|
+
return nlpColors[3];
|
|
118
|
+
case 'user-star':
|
|
119
|
+
return nlpColors[10];
|
|
120
|
+
case 'folder-nested':
|
|
121
|
+
return nlpColors[19];
|
|
122
|
+
default:
|
|
123
|
+
return theme.base.colors.gray.medium;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
115
126
|
export const calculateFontSize = (baseFontSize, baseFontScale) => {
|
|
116
127
|
return Object.fromEntries(Object.entries(stepsMap).map(([size, steps]) => {
|
|
117
128
|
const calculation = tryCatch(() => baseFontScale === 'linear'
|
package/lib/styles/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/styles/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,OAAO,EACP,aAAa,IAAI,qBAAqB,EACtC,MAAM,EACN,WAAW,EACX,GAAG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AC;IAE1C,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAE5C,IAAI,IAAI,KAAK,GAAG;QAAE,OAAO,KAAK,GAAG,IAAI,CAAC;IACtC,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAEhC,OAAO,CAAC,CAAC;AACX,CAAC,CAAC","sourcesContent":["import type { StyledConfig } from 'styled-components';\nimport {\n parseToHsl,\n lighten,\n readableColor as polishedReadableColor,\n darken,\n getContrast,\n hsl,\n modularScale,\n stripUnit,\n math,\n getValueAndUnit,\n transparentize,\n parseToRgb\n} from 'polished';\nimport type { ContrastScores, RgbaColor } from 'polished/lib/types/color';\nimport type { ModularScaleRatio } from 'polished/lib/types/modularScaleRatio';\n\nimport { tryCatch } from '../utils';\n\nexport const wcagContrast: Record<keyof ContrastScores | 'AANonText', number> = {\n // https://www.w3.org/TR/WCAG21/#contrast-minimum\n AA: 4.5,\n AALarge: 3,\n // https://www.w3.org/TR/WCAG21/#contrast-enhanced\n AAA: 7,\n AAALarge: 4.5,\n // https://www.w3.org/TR/WCAG21/#non-text-contrast\n AANonText: 3\n};\n\ninterface ContrastOptions {\n mode?: 'light' | 'dark' | 'both';\n level?: keyof typeof wcagContrast | number;\n}\n\nexport const isSolidColor = (background: string) => {\n const rgb = tryCatch(() => parseToRgb(background));\n return (\n rgb &&\n ((rgb as RgbaColor).alpha === undefined ||\n ((rgb as RgbaColor).alpha !== undefined && (rgb as RgbaColor).alpha === 1))\n );\n};\n\nexport const readableColor = (\n color: string,\n { mode = 'light', level = 'AA' }: ContrastOptions = {}\n): string => {\n const minContrast = typeof level === 'string' ? wcagContrast[level] : level;\n\n if (mode === 'light' && getContrast('#fff', color) >= minContrast) {\n return '#fff';\n }\n\n if (mode === 'dark' && getContrast('#000', color) >= minContrast) {\n return '#000';\n }\n\n return polishedReadableColor(color);\n};\n\nconst getBackgroundForegroundColors = (color: string, delta: number) => {\n const backgroundLightness = tryCatch(\n () => parseToHsl(color).lightness,\n () => 1\n );\n let background = tryCatch(() => lighten(delta, color));\n let foreground = tryCatch(() => readableColor(lighten(delta, color)));\n if (backgroundLightness > 0.35) {\n background = tryCatch(() => darken(delta, color));\n foreground = tryCatch(() => readableColor(darken(delta, color)));\n }\n\n return { background, foreground };\n};\n\nexport const getHoverColors = (color: string) => {\n return getBackgroundForegroundColors(color, 0.1);\n};\n\nexport const getActiveColors = (color: string) => {\n return getBackgroundForegroundColors(color, 0.2);\n};\n\nexport const readableHue = (\n color1: string,\n color2: string,\n { mode = 'both', level = 'AA' }: ContrastOptions = {}\n): string => {\n // if both the color are not solid, return black as fallback\n if (!isSolidColor(color1) && !isSolidColor(color2)) {\n return '#000000';\n }\n\n // if one of the color is not solid, return the other color\n if (!isSolidColor(color2)) {\n return color1;\n }\n\n if (!isSolidColor(color1)) {\n return color2;\n }\n\n const minContrast = typeof level === 'string' ? wcagContrast[level] : level;\n\n if (getContrast(color1, color2) >= minContrast) return color1;\n\n const { lightness, ...hueSaturation } = parseToHsl(color1);\n\n let shouldLighten = true;\n let shouldDarken = true;\n\n let lightEnough = '';\n let darkEnough = '';\n\n for (let i = 0; i <= 1; i += 0.01) {\n if (shouldLighten) {\n const lightented = hsl({\n ...hueSaturation,\n lightness: Math.min(lightness + i, 1)\n });\n\n if (getContrast(lightented, color2) >= minContrast) {\n if (mode !== 'dark') return lightented;\n\n shouldLighten = false;\n lightEnough = lightented;\n }\n\n if (lightness + i >= 1) shouldLighten = false;\n }\n\n if (shouldDarken) {\n const darkened = hsl({\n ...hueSaturation,\n lightness: Math.max(lightness - i, 0)\n });\n\n if (getContrast(darkened, color2) >= minContrast) {\n if (mode !== 'light') return darkened;\n\n shouldDarken = false;\n darkEnough = darkened;\n }\n\n if (lightness - i <= 0) shouldDarken = false;\n }\n\n if (!shouldLighten && !shouldDarken) break;\n }\n\n if (lightEnough) return lightEnough;\n if (darkEnough) return darkEnough;\n\n return readableColor(color2, { mode, level });\n};\n\nexport const omitProps = <O extends object = Record<PropertyKey, unknown>>(\n ...props: [prop: keyof O, ...props: (keyof O)[]]\n): StyledConfig<O> => ({\n shouldForwardProp: (prop, defaultValidatorFn) => !props.includes(prop) && defaultValidatorFn(prop)\n});\n\nexport type FontSize = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\nconst stepsMap = {\n xxs: -2,\n xs: -1,\n s: 0,\n m: 1,\n l: 2,\n xl: 3,\n xxl: 4\n};\n\nexport const calculateFontSize = (baseFontSize: string, baseFontScale: string | number) => {\n return Object.fromEntries(\n Object.entries(stepsMap).map(([size, steps]) => {\n const calculation = tryCatch(\n () =>\n baseFontScale === 'linear'\n ? math(`${baseFontSize} + (${steps} * 0.0625rem)`)\n : modularScale(steps, baseFontSize, baseFontScale as ModularScaleRatio),\n () => baseFontSize\n );\n\n if (size === 'xs' && Number.parseFloat(`${stripUnit(calculation)}`) < 0.75) {\n return [size, `max(calc((${baseFontSize} + 12px) / 2), 12px)`];\n }\n\n return [size, `max(${calculation}, 12px)`];\n })\n ) as Record<FontSize, string>;\n};\n\nexport const calculateForegroundColor = (background: string, foregroundColor: string) => {\n if (foregroundColor !== 'auto') {\n return foregroundColor;\n }\n\n return isSolidColor(background) ? readableColor(background) : '#000000';\n};\n\nexport const calculateBackgroundAndContrastColor = (\n background: string,\n foregroundColor: string\n): { contrastColor: string; backgroundColor: string } => {\n const isGradientBackground = !isSolidColor(background);\n const computedFgColor = calculateForegroundColor(background, foregroundColor);\n const computedBgColor = isGradientBackground ? readableColor(computedFgColor) : background;\n\n let contrastColor = darken(0.05, computedBgColor);\n if (getContrast(computedBgColor, contrastColor) === 1) {\n contrastColor = lighten(0.15, computedBgColor);\n }\n if (isGradientBackground) {\n contrastColor = transparentize(0.9, computedFgColor);\n }\n\n return {\n contrastColor,\n backgroundColor: computedBgColor\n };\n};\n\nexport const getTranslucentColor = (color: string): string => {\n const fallbackColor = isSolidColor(color) ? color : '#000000';\n const luminance = tryCatch(\n () => parseToHsl(fallbackColor).lightness,\n () => 1\n );\n if (luminance > 0.5) {\n return transparentize(0.5, '#ffffff');\n }\n return transparentize(0.95, '#ffffff');\n};\n\n/**\n * Converts a CSS time value to a number in milliseconds.\n *\n * @param time - The CSS time value as a string (e.g: \"2s\", \"500ms\") or a number. If undefined, returns 0.\n * @returns The time value in milliseconds.\n * If the input is a number, it is returned as is.\n * If the input is a string, it is parsed and converted to milliseconds.\n */\nexport const getCSSTimeInMilliseconds = (time: string | number | undefined): number => {\n if (time === undefined) return 0;\n if (typeof time === 'number') return time;\n\n const [value, unit] = getValueAndUnit(time);\n\n if (unit === 's') return value * 1000;\n if (unit === 'ms') return value;\n\n return 0;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/styles/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,OAAO,EACP,aAAa,IAAI,qBAAqB,EACtC,MAAM,EACN,WAAW,EACX,GAAG,EACH,YAAY,EACZ,SAAS,EACT,IAAI,EACJ,eAAe,EACf,cAAc,EACd,UAAU,EACX,MAAM,UAAU,CAAC;AAIlB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAOxC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,UAAkB,EAAE,EAAE;IACjD,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IACnD,OAAO,CACL,GAAG;QACH,CAAE,GAAiB,CAAC,KAAK,KAAK,SAAS;YACrC,CAAE,GAAiB,CAAC,KAAK,KAAK,SAAS,IAAK,GAAiB,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAC9E,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CA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E,OAAO,KAAK,GAAG,IAAI,CAAC;IACtC,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAEhC,OAAO,CAAC,CAAC;AACX,CAAC,CAAC","sourcesContent":["import type { DefaultTheme, StyledConfig } from 'styled-components';\nimport {\n parseToHsl,\n lighten,\n readableColor as polishedReadableColor,\n darken,\n getContrast,\n hsl,\n modularScale,\n stripUnit,\n math,\n getValueAndUnit,\n transparentize,\n parseToRgb\n} from 'polished';\nimport type { RgbaColor } from 'polished/lib/types/color';\nimport type { ModularScaleRatio } from 'polished/lib/types/modularScaleRatio';\n\nimport { tryCatch } from '../utils';\n\nimport { wcagContrast } from './constants';\nimport { nlpColors } from './gradients';\n\ninterface ContrastOptions {\n mode?: 'light' | 'dark' | 'both';\n level?: keyof typeof wcagContrast | number;\n}\n\nexport const isSolidColor = (background: string) => {\n const rgb = tryCatch(() => parseToRgb(background));\n return (\n rgb &&\n ((rgb as RgbaColor).alpha === undefined ||\n ((rgb as RgbaColor).alpha !== undefined && (rgb as RgbaColor).alpha === 1))\n );\n};\n\nexport const readableColor = (\n color: string,\n { mode = 'light', level = 'AA' }: ContrastOptions = {}\n): string => {\n const minContrast = typeof level === 'string' ? wcagContrast[level] : level;\n\n if (mode === 'light' && getContrast('#fff', color) >= minContrast) {\n return '#fff';\n }\n\n if (mode === 'dark' && getContrast('#000', color) >= minContrast) {\n return '#000';\n }\n\n return polishedReadableColor(color);\n};\n\nconst getBackgroundForegroundColors = (color: string, delta: number) => {\n const backgroundLightness = tryCatch(\n () => parseToHsl(color).lightness,\n () => 1\n );\n let background = tryCatch(() => lighten(delta, color));\n let foreground = tryCatch(() => readableColor(lighten(delta, color)));\n if (backgroundLightness > 0.35) {\n background = tryCatch(() => darken(delta, color));\n foreground = tryCatch(() => readableColor(darken(delta, color)));\n }\n\n return { background, foreground };\n};\n\nexport const getHoverColors = (color: string) => {\n return getBackgroundForegroundColors(color, 0.1);\n};\n\nexport const getActiveColors = (color: string) => {\n return getBackgroundForegroundColors(color, 0.2);\n};\n\nexport const readableHue = (\n color1: string,\n color2: string,\n { mode = 'both', level = 'AA' }: ContrastOptions = {}\n): string => {\n // if both the color are not solid, return black as fallback\n if (!isSolidColor(color1) && !isSolidColor(color2)) {\n return '#000000';\n }\n\n // if one of the color is not solid, return the other color\n if (!isSolidColor(color2)) {\n return color1;\n }\n\n if (!isSolidColor(color1)) {\n return color2;\n }\n\n const minContrast = typeof level === 'string' ? wcagContrast[level] : level;\n\n if (getContrast(color1, color2) >= minContrast) return color1;\n\n const { lightness, ...hueSaturation } = parseToHsl(color1);\n\n let shouldLighten = true;\n let shouldDarken = true;\n\n let lightEnough = '';\n let darkEnough = '';\n\n for (let i = 0; i <= 1; i += 0.01) {\n if (shouldLighten) {\n const lightented = hsl({\n ...hueSaturation,\n lightness: Math.min(lightness + i, 1)\n });\n\n if (getContrast(lightented, color2) >= minContrast) {\n if (mode !== 'dark') return lightented;\n\n shouldLighten = false;\n lightEnough = lightented;\n }\n\n if (lightness + i >= 1) shouldLighten = false;\n }\n\n if (shouldDarken) {\n const darkened = hsl({\n ...hueSaturation,\n lightness: Math.max(lightness - i, 0)\n });\n\n if (getContrast(darkened, color2) >= minContrast) {\n if (mode !== 'light') return darkened;\n\n shouldDarken = false;\n darkEnough = darkened;\n }\n\n if (lightness - i <= 0) shouldDarken = false;\n }\n\n if (!shouldLighten && !shouldDarken) break;\n }\n\n if (lightEnough) return lightEnough;\n if (darkEnough) return darkEnough;\n\n return readableColor(color2, { mode, level });\n};\n\nexport const omitProps = <O extends object = Record<PropertyKey, unknown>>(\n ...props: [prop: keyof O, ...props: (keyof O)[]]\n): StyledConfig<O> => ({\n shouldForwardProp: (prop, defaultValidatorFn) => !props.includes(prop) && defaultValidatorFn(prop)\n});\n\nexport type FontSize = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\nconst stepsMap = {\n xxs: -2,\n xs: -1,\n s: 0,\n m: 1,\n l: 2,\n xl: 3,\n xxl: 4\n};\n\nexport const colorIconMapping = (theme: DefaultTheme, iconName: string) => {\n switch (iconName) {\n case 'polaris':\n case 'polaris-solid':\n return theme.base.palette.ai;\n case 'paper-clip':\n return nlpColors[1];\n case 'person':\n return nlpColors[2];\n case 'tag':\n return nlpColors[3];\n case 'user-star':\n return nlpColors[10];\n case 'folder-nested':\n return nlpColors[19];\n default:\n return theme.base.colors.gray.medium;\n }\n};\n\nexport const calculateFontSize = (baseFontSize: string, baseFontScale: string | number) => {\n return Object.fromEntries(\n Object.entries(stepsMap).map(([size, steps]) => {\n const calculation = tryCatch(\n () =>\n baseFontScale === 'linear'\n ? math(`${baseFontSize} + (${steps} * 0.0625rem)`)\n : modularScale(steps, baseFontSize, baseFontScale as ModularScaleRatio),\n () => baseFontSize\n );\n\n if (size === 'xs' && Number.parseFloat(`${stripUnit(calculation)}`) < 0.75) {\n return [size, `max(calc((${baseFontSize} + 12px) / 2), 12px)`];\n }\n\n return [size, `max(${calculation}, 12px)`];\n })\n ) as Record<FontSize, string>;\n};\n\nexport const calculateForegroundColor = (background: string, foregroundColor: string) => {\n if (foregroundColor !== 'auto') {\n return foregroundColor;\n }\n\n return isSolidColor(background) ? readableColor(background) : '#000000';\n};\n\nexport const calculateBackgroundAndContrastColor = (\n background: string,\n foregroundColor: string\n): { contrastColor: string; backgroundColor: string } => {\n const isGradientBackground = !isSolidColor(background);\n const computedFgColor = calculateForegroundColor(background, foregroundColor);\n const computedBgColor = isGradientBackground ? readableColor(computedFgColor) : background;\n\n let contrastColor = darken(0.05, computedBgColor);\n if (getContrast(computedBgColor, contrastColor) === 1) {\n contrastColor = lighten(0.15, computedBgColor);\n }\n if (isGradientBackground) {\n contrastColor = transparentize(0.9, computedFgColor);\n }\n\n return {\n contrastColor,\n backgroundColor: computedBgColor\n };\n};\n\nexport const getTranslucentColor = (color: string): string => {\n const fallbackColor = isSolidColor(color) ? color : '#000000';\n const luminance = tryCatch(\n () => parseToHsl(fallbackColor).lightness,\n () => 1\n );\n if (luminance > 0.5) {\n return transparentize(0.5, '#ffffff');\n }\n return transparentize(0.95, '#ffffff');\n};\n\n/**\n * Converts a CSS time value to a number in milliseconds.\n *\n * @param time - The CSS time value as a string (e.g: \"2s\", \"500ms\") or a number. If undefined, returns 0.\n * @returns The time value in milliseconds.\n * If the input is a number, it is returned as is.\n * If the input is a string, it is parsed and converted to milliseconds.\n */\nexport const getCSSTimeInMilliseconds = (time: string | number | undefined): number => {\n if (time === undefined) return 0;\n if (typeof time === 'number') return time;\n\n const [value, unit] = getValueAndUnit(time);\n\n if (unit === 's') return value * 1000;\n if (unit === 'ms') return value;\n\n return 0;\n};\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"base": {
|
|
3
3
|
"palette": {
|
|
4
4
|
"ai": "#993CF0",
|
|
5
|
-
"app-background": "url(https://
|
|
5
|
+
"app-background": "url(https://launchpad.io/sites/default/files/media/images/2025-11/studio-bg-dark.jpg) no-repeat center / cover",
|
|
6
6
|
"primary-background": "#161E33",
|
|
7
7
|
"secondary-background": "#283B67",
|
|
8
8
|
"foreground-color": "#F5F7FA",
|
|
@@ -47,8 +47,9 @@
|
|
|
47
47
|
"detached": false
|
|
48
48
|
},
|
|
49
49
|
"header": {
|
|
50
|
-
"background": "#
|
|
51
|
-
"border-color": "transparent"
|
|
50
|
+
"background": "#00000088",
|
|
51
|
+
"border-color": "transparent",
|
|
52
|
+
"foreground-color": "#ffffff"
|
|
52
53
|
}
|
|
53
54
|
},
|
|
54
55
|
"button": {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"base": {
|
|
3
3
|
"palette": {
|
|
4
4
|
"ai": "#8C2EEB",
|
|
5
|
-
"app-background": "
|
|
5
|
+
"app-background": "url(https://launchpad.io/sites/default/files/media/images/2025-11/studio-bg-light.jpg) no-repeat center / cover",
|
|
6
6
|
"primary-background": "#FFFFFF",
|
|
7
7
|
"secondary-background": "#F4F6FA",
|
|
8
8
|
"foreground-color": "#333333",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"detached": false
|
|
48
48
|
},
|
|
49
49
|
"header": {
|
|
50
|
-
"background": "#
|
|
50
|
+
"background": "#ffffff88",
|
|
51
51
|
"foreground-color": "#24292f",
|
|
52
52
|
"border-color": "transparent"
|
|
53
53
|
}
|
|
@@ -127,8 +127,8 @@
|
|
|
127
127
|
},
|
|
128
128
|
"case-view": {
|
|
129
129
|
"header": {
|
|
130
|
-
"background": "
|
|
131
|
-
"foreground-color": "#
|
|
130
|
+
"background": "#c7e5f9",
|
|
131
|
+
"foreground-color": "#333333"
|
|
132
132
|
},
|
|
133
133
|
"summary": {
|
|
134
134
|
"detached": true
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"stages": {
|
|
146
146
|
"status": {
|
|
147
147
|
"completed": {
|
|
148
|
-
"background": "#
|
|
148
|
+
"background": "#DBF2E3",
|
|
149
149
|
"foreground-color": "#0f4823"
|
|
150
150
|
},
|
|
151
151
|
"current": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-core",
|
|
3
|
-
"version": "9.0.0-build.11.
|
|
3
|
+
"version": "9.0.0-build.11.5",
|
|
4
4
|
"description": "Cosmos is a visual design system and UI component collection. Its goal is to empower application developers in their pursuit to create engaging and rewarding user experiences.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Pegasystems",
|