@fibery/ui-kit 1.40.4 → 1.42.0

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.
Files changed (143) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/eslint.config.mjs +16 -0
  3. package/package.json +10 -9
  4. package/src/a11y-color.test.ts +5 -24
  5. package/src/actions-menu/actions-menu-item.tsx +6 -9
  6. package/src/actions-menu/context-actions-menu.tsx +8 -3
  7. package/src/ai/model.tsx +0 -1
  8. package/src/ai/temperature.tsx +0 -1
  9. package/src/animated-height-container.tsx +3 -3
  10. package/src/antd/index.tsx +3 -0
  11. package/src/antd/input.tsx +0 -1
  12. package/src/antd/styles.ts +9 -9
  13. package/src/app-icon-with-fallback.tsx +5 -5
  14. package/src/app-icon-wrapper.tsx +2 -3
  15. package/src/app-icon.tsx +3 -3
  16. package/src/avatar.tsx +3 -3
  17. package/src/button/base-button.tsx +0 -1
  18. package/src/button/make-button-colors.ts +2 -2
  19. package/src/checkbox.tsx +1 -1
  20. package/src/collapsible-section.tsx +11 -1
  21. package/src/color-utils.test.ts +15 -25
  22. package/src/color-utils.ts +43 -8
  23. package/src/command-menu/index.tsx +1 -0
  24. package/src/context-menu/index.tsx +5 -5
  25. package/src/date-picker/contexts.ts +2 -2
  26. package/src/date-picker/date-range-picker-popup-content.tsx +1 -2
  27. package/src/date-picker/date-range-picker.tsx +29 -31
  28. package/src/date-picker/single-date-picker-popup-content.tsx +1 -2
  29. package/src/date-picker/single-date-picker.tsx +149 -124
  30. package/src/date-picker/types.ts +4 -4
  31. package/src/day-select/iso-week-day-select.tsx +2 -2
  32. package/src/day-select/week-day-select.tsx +2 -2
  33. package/src/delayed.tsx +0 -1
  34. package/src/design-system/alpha.test.ts +59 -0
  35. package/src/design-system/alpha.ts +41 -0
  36. package/src/design-system/animation.ts +10 -0
  37. package/src/design-system/colors-css.test.ts +39 -0
  38. package/src/design-system/colors-css.ts +25 -0
  39. package/src/design-system/colors-js.test.ts +232 -0
  40. package/src/design-system/colors-js.ts +107 -0
  41. package/src/design-system/colors.test.ts +74 -0
  42. package/src/{design-system.colors.ts → design-system/colors.ts} +133 -134
  43. package/src/design-system/date.ts +3 -0
  44. package/src/design-system/layout.ts +106 -0
  45. package/src/design-system/theme.test.ts +94 -0
  46. package/src/design-system/theme.ts +93 -0
  47. package/src/design-system/typography.ts +179 -0
  48. package/src/design-system/vars.test.ts +1679 -0
  49. package/src/design-system/vars.ts +52 -0
  50. package/src/design-system.test.ts +46 -303
  51. package/src/design-system.ts +25 -545
  52. package/src/dropdown-menu/index.tsx +5 -5
  53. package/src/emoji-picker/icon-emoji-picker.tsx +1 -1
  54. package/src/fibermoji-placeholder.tsx +3 -3
  55. package/src/field-container.tsx +11 -2
  56. package/src/file-item/file-icon.tsx +3 -3
  57. package/src/file-item-2.tsx +4 -10
  58. package/src/file-item.tsx +0 -1
  59. package/src/icons/ast/ChatBubble.ts +8 -0
  60. package/src/icons/ast/ChatFloat.ts +8 -0
  61. package/src/icons/ast/ChatSidebar.ts +8 -0
  62. package/src/icons/ast/FileOther.ts +8 -0
  63. package/src/icons/ast/NoBorder.ts +8 -0
  64. package/src/icons/ast/NoFill.ts +8 -0
  65. package/src/icons/ast/index.tsx +6 -0
  66. package/src/icons/react/ChatBubble.tsx +13 -0
  67. package/src/icons/react/ChatFloat.tsx +13 -0
  68. package/src/icons/react/ChatSidebar.tsx +13 -0
  69. package/src/icons/react/FileOther.tsx +13 -0
  70. package/src/icons/react/NoBorder.tsx +13 -0
  71. package/src/icons/react/NoFill.tsx +13 -0
  72. package/src/icons/react/index.tsx +6 -0
  73. package/src/icons/svg/chat-bubble.svg +4 -0
  74. package/src/icons/svg/chat-float.svg +4 -0
  75. package/src/icons/svg/chat-sidebar.svg +4 -0
  76. package/src/icons/svg/file-other.svg +3 -0
  77. package/src/icons/svg/no-border.svg +17 -0
  78. package/src/icons/svg/no-fill.svg +4 -0
  79. package/src/images-gallery/images-gallery.tsx +8 -6
  80. package/src/images-gallery/slide-buttons.tsx +2 -2
  81. package/src/is-iOS.ts +0 -1
  82. package/src/is-in-popup.ts +2 -1
  83. package/src/lists/actions-menu-row-surface.tsx +4 -4
  84. package/src/loading-sausage.tsx +2 -2
  85. package/src/media-query-utils.ts +1 -2
  86. package/src/mobile-keyboard-aware-popup.tsx +2 -2
  87. package/src/modal-menu/modal-menu-content.tsx +2 -2
  88. package/src/number-input/decimal.js +9 -7
  89. package/src/number-input/{number-inline-input-with-autosize.tsx → number-input-inline-with-autosize.tsx} +20 -41
  90. package/src/number-input/number-input-inline.tsx +118 -0
  91. package/src/number-input/{index.test.js → number-input.test.tsx} +38 -43
  92. package/src/number-input/number-input.tsx +63 -121
  93. package/src/number-input/types.ts +19 -0
  94. package/src/number-input/utils.ts +61 -0
  95. package/src/online-users.tsx +2 -2
  96. package/src/palette-generator.test.ts +24 -281
  97. package/src/palette-generator.ts +39 -45
  98. package/src/palettes/_.ts +72 -0
  99. package/src/palettes/slate-arch.colors-snapshot.test.ts +1689 -0
  100. package/src/palettes/slate-arch.ts +188 -0
  101. package/src/palettes/slate-user.colors-snapshot.test.ts +1689 -0
  102. package/src/palettes/slate-user.ts +187 -0
  103. package/src/palettes/warm-arch.colors-snapshot.test.ts +1689 -0
  104. package/src/palettes/warm-arch.ts +222 -0
  105. package/src/palettes/warm-user.colors-snapshot.test.ts +1689 -0
  106. package/src/palettes/warm-user.ts +222 -0
  107. package/src/popover/get-element-ref.ts +28 -0
  108. package/src/popover/index.tsx +232 -333
  109. package/src/popover/{mobile-popup-context.tsx → mobile-popover-context.tsx} +7 -7
  110. package/src/popover/mobile-popover.tsx +169 -0
  111. package/src/popover/modifiers.tsx +2 -2
  112. package/src/popover/popup-stack-context.tsx +8 -9
  113. package/src/root-theme-provider.test.tsx +114 -19
  114. package/src/scale-generator.ts +31 -22
  115. package/src/select/components/menu-list-virtualized.tsx +5 -3
  116. package/src/select/index.tsx +6 -5
  117. package/src/select/select.tsx +36 -38
  118. package/src/select/util.ts +1 -1
  119. package/src/static-palettes.ts +221 -11
  120. package/src/thematic-controls.tsx +6 -6
  121. package/src/thematic-scales.tsx +15 -15
  122. package/src/thematic-state.ts +57 -20
  123. package/src/thematic.tsx +36 -32
  124. package/src/theme-provider.test.tsx +31 -19
  125. package/src/theme-provider.tsx +41 -38
  126. package/src/theme-settings.ts +66 -11
  127. package/src/theme-styles.ts +53 -8
  128. package/src/toast/toast.tsx +1 -2
  129. package/src/toggle.tsx +2 -2
  130. package/src/tooltip.tsx +4 -3
  131. package/src/type-badge.tsx +4 -11
  132. package/src/unit/styles.ts +0 -23
  133. package/src/use-is-phone.tsx +7 -2
  134. package/src/use-on-screen-keyboard-data.tsx +2 -2
  135. package/src/with-data.tsx +4 -3
  136. package/src/workflow-progress-icon.tsx +2 -2
  137. package/.eslintignore +0 -3
  138. package/.eslintrc +0 -14
  139. package/src/__mocks__/createInlineTheme.js +0 -3
  140. package/src/__snapshots__/design-system.test.ts.snap +0 -7265
  141. package/src/create-inline-theme.ts +0 -67
  142. package/src/number-input/index.js +0 -191
  143. package/src/palette.ts +0 -253
@@ -1,67 +0,0 @@
1
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
- // @ts-ignore
3
- export const varPrefix = process.env.VAR_THEME_PREFIX || "fibery";
4
-
5
- export type ThemeStyles = Record<string, string>;
6
-
7
- export function createInlineTheme<T extends Record<string, unknown>>(
8
- themes: T,
9
- rejectKeys: Array<string>
10
- ): ThemeStyles {
11
- return Object.entries(themes).reduce<Record<string, string>>((inlineTheme, [key, value]) => {
12
- if (key === "key") {
13
- return inlineTheme;
14
- }
15
- if (key === "fns") {
16
- return inlineTheme;
17
- }
18
- if (rejectKeys.includes(key)) {
19
- return inlineTheme;
20
- }
21
-
22
- if (key === "opacity") {
23
- Object.entries(themes.opacity as Record<string, string>).forEach(([opacityKey, opacityValue]) => {
24
- inlineTheme[`--${varPrefix}-opacity-${opacityKey}`] = opacityValue;
25
- }, "");
26
-
27
- return inlineTheme;
28
- }
29
- if (key === "brandColors") {
30
- Object.entries(themes.brandColors as Record<string, string>).forEach(([brandColorKey, brandColorValue]) => {
31
- inlineTheme[`--${varPrefix}-brand-colors-${brandColorKey}`] = brandColorValue;
32
- }, "");
33
-
34
- return inlineTheme;
35
- }
36
- if (key === "shades") {
37
- Object.entries(themes.shades as Record<string, string>).forEach(([shadeKey, shadeValue]) => {
38
- inlineTheme[`--${varPrefix}-shades-${shadeKey}`] = shadeValue;
39
- }, "");
40
-
41
- return inlineTheme;
42
- }
43
- if (key === "lights") {
44
- Object.entries(themes.lights as Record<string, string>).forEach(([lightKey, lightValue]) => {
45
- inlineTheme[`--${varPrefix}-lights-${lightKey}`] = lightValue;
46
- }, "");
47
-
48
- return inlineTheme;
49
- }
50
- if (key === "separators") {
51
- Object.entries(themes.separators as Record<string, string>).forEach(([separatorKey, separatorValue]) => {
52
- inlineTheme[`--${varPrefix}-separator-${separatorKey}`] = separatorValue;
53
- }, "");
54
-
55
- return inlineTheme;
56
- }
57
- if (key === "inversedSeparators") {
58
- Object.entries(themes.inversedSeparators as Record<string, string>).forEach(([separatorKey, separatorValue]) => {
59
- inlineTheme[`--${varPrefix}-inversed-separators-${separatorKey}`] = separatorValue;
60
- }, "");
61
-
62
- return inlineTheme;
63
- }
64
- inlineTheme[`--${varPrefix}-color-${key}`] = value as string;
65
- return inlineTheme;
66
- }, {});
67
- }
@@ -1,191 +0,0 @@
1
- import _ from "lodash";
2
- import {bool, func, number, object, oneOf, oneOfType, string} from "prop-types";
3
- import {useCallback, useMemo, useState, useEffect} from "react";
4
- import {AntInputNumber} from "../antd/input-number";
5
- import {Tooltip} from "../tooltip";
6
- import {add, divideByHundred, multiplyByHundred, sub} from "./decimal";
7
-
8
- const isEmpty = (value) => _.isNil(value) || value === "";
9
-
10
- export const getStep = (numberFormat) => {
11
- if (numberFormat === "Percent") {
12
- return 0.01;
13
- }
14
- return 1;
15
- };
16
-
17
- export const formatValue = (value, isEditing, numberFormat, format) => {
18
- const externalizeNumber = (numberFormat, value) => {
19
- if (numberFormat === "Percent") {
20
- return multiplyByHundred(value);
21
- }
22
- return value;
23
- };
24
-
25
- const externalizeValue = (value) => {
26
- return isEditing ? externalizeNumber(numberFormat, value) : value;
27
- };
28
-
29
- const maybeFormat = (value) => {
30
- return isEditing ? value : format(value);
31
- };
32
-
33
- if (isEmpty(value)) {
34
- return value;
35
- }
36
- return _.flow([externalizeValue, maybeFormat])(value);
37
- };
38
-
39
- export const parseValue = (value, numberFormat, numberPrecision) => {
40
- const parse = (value) => {
41
- const parseInteger = (x) => {
42
- const parsed = parseInt(x);
43
- return isNaN(parsed) ? null : parsed;
44
- };
45
- const parseDecimal = (x) => {
46
- const parsed = parseFloat(x);
47
- return isNaN(parsed) ? null : parsed;
48
- };
49
-
50
- const parseStrategy = numberPrecision === 0 ? parseInteger : parseDecimal;
51
- return parseStrategy(value);
52
- };
53
-
54
- const internalizeNumber = (value) => {
55
- if (isEmpty(value)) {
56
- return value;
57
- }
58
- if (numberFormat === "Percent") {
59
- return divideByHundred(value);
60
- }
61
- return value;
62
- };
63
-
64
- const toString = (value) => {
65
- return isEmpty(value) ? value : String(value);
66
- };
67
-
68
- if (isEmpty(value)) {
69
- return null;
70
- }
71
- return _.flow([parse, internalizeNumber, toString])(value);
72
- };
73
-
74
- const propTypes = {
75
- value: oneOfType([string, number]),
76
- numberFormat: oneOf(["Number", "Money", "Percent"]),
77
- numberPrecision: number,
78
- decimalSeparator: string,
79
- format: func,
80
- onFocus: func,
81
- onBlur: func,
82
- onChange: func,
83
- onKeyDown: func,
84
- autoFocus: bool,
85
- placeholder: string,
86
- style: object,
87
- disabled: bool,
88
- showTooltip: bool,
89
- controls: bool,
90
- };
91
-
92
- const defaultProps = {
93
- format: _.identity,
94
- };
95
-
96
- export const InputNumber = (props) => {
97
- const {value, numberFormat, numberPrecision, format, onFocus, onBlur, onChange, showTooltip = true, ...rest} = props;
98
-
99
- const [isEditing, setIsEditing] = useState(false);
100
- const [tooltipVisible, setTooltipVisible] = useState(false);
101
- const handleFocus = useCallback(
102
- (e) => {
103
- if (onFocus) {
104
- onFocus(e);
105
- }
106
- setIsEditing(true);
107
- },
108
- [onFocus, setIsEditing]
109
- );
110
-
111
- const handleBlur = useCallback(
112
- (e) => {
113
- if (onBlur) {
114
- onBlur(e);
115
- }
116
- setIsEditing(false);
117
- },
118
- [onBlur, setIsEditing]
119
- );
120
-
121
- const handleChange = useCallback(
122
- (value) => {
123
- if (onChange) {
124
- onChange(parseValue(value, numberFormat, numberPrecision));
125
- }
126
- },
127
- [onChange, numberFormat, numberPrecision]
128
- );
129
-
130
- const handleStep = useCallback(
131
- (newValue, {type}) => {
132
- const step = getStep(numberFormat);
133
-
134
- if (type === "up") {
135
- onChange(add(value, step));
136
- } else {
137
- onChange(sub(value, step));
138
- }
139
- },
140
- [value, numberFormat, onChange]
141
- );
142
-
143
- let formattedValue = useMemo(() => {
144
- return formatValue(value, isEditing, numberFormat, format);
145
- }, [value, isEditing, numberFormat, format]);
146
-
147
- const onTooltipVisibleChange = useCallback(
148
- (visible) => {
149
- if (!showTooltip || isEditing || !formattedValue) {
150
- return setTooltipVisible(false);
151
- }
152
- return setTooltipVisible(visible);
153
- },
154
- [isEditing, showTooltip, formattedValue]
155
- );
156
- useEffect(() => {
157
- if (tooltipVisible && (!showTooltip || isEditing || !formattedValue)) {
158
- setTooltipVisible(false);
159
- }
160
- }, [formattedValue, isEditing, showTooltip, tooltipVisible]);
161
-
162
- return (
163
- <Tooltip title={formattedValue} onVisibleChange={onTooltipVisibleChange} visible={tooltipVisible}>
164
- <span>
165
- <AntInputNumber
166
- className={rest.className}
167
- value={formattedValue}
168
- onFocus={handleFocus}
169
- onBlur={handleBlur}
170
- onChange={handleChange}
171
- onStep={handleStep}
172
- {...rest}
173
- />
174
- </span>
175
- </Tooltip>
176
- );
177
- };
178
-
179
- InputNumber.propTypes = propTypes;
180
- InputNumber.defaultProps = defaultProps;
181
-
182
- export const InputNumberField = (props) => {
183
- const {input, ...rest} = props;
184
- const {value, onBlur, ...inputRest} = input;
185
-
186
- const handleBlur = useCallback(() => {
187
- onBlur(isEmpty(value) ? null : value);
188
- }, [onBlur, value]);
189
-
190
- return <InputNumber value={value} onBlur={handleBlur} {...inputRest} {...rest} />;
191
- };
package/src/palette.ts DELETED
@@ -1,253 +0,0 @@
1
- import type {ColorScale} from "./palette-generator";
2
- import {throwError} from "./errors";
3
-
4
- const base = "hsl(0, 0%, 100%)";
5
-
6
- const slate = {
7
- slateBase: base,
8
- slate1: "hsl(206, 0%, 99%)",
9
- slate2: "hsl(210, 0%, 97%)",
10
- slate3: "hsl(209, 0%, 96%)",
11
- slate4: "hsl(209, 0%, 93%)",
12
- slate5: "hsl(208, 0%, 91%)",
13
- slate6: "hsl(208, 0%, 89%)",
14
- slate7: "hsl(207, 0%, 86%)",
15
- slate8: "hsl(205, 0%, 78%)",
16
- slate9: "hsl(205, 0%, 62%)",
17
- slate10: "hsl(205, 0%, 47%)",
18
- slate11: "hsl(204, 0%, 37%)",
19
- slate12: "hsl(200, 0%, 9%)",
20
- } as const;
21
-
22
- /**
23
- * @deprecated use themeVars
24
- */
25
- export const slateDark = {
26
- slateBase: "hsl(0, 0%, 5%)",
27
- slate1: "hsl(200, 0%, 9%)",
28
- slate2: "hsl(195, 0%, 11%)",
29
- slate3: "hsl(197, 0%, 14%)",
30
- slate4: "hsl(198, 0%, 16%)",
31
- slate5: "hsl(199, 0%, 18%)",
32
- slate6: "hsl(201, 0%, 20%)",
33
- slate7: "hsl(203, 0%, 24%)",
34
- slate8: "hsl(207, 0%, 32%)",
35
- slate9: "hsl(206, 0%, 44%)",
36
- slate10: "hsl(206, 0%, 50%)",
37
- slate11: "hsl(206, 0%, 63%)",
38
- slate12: "hsl(210, 0%, 93%)",
39
- } as const;
40
-
41
- /**
42
- * @deprecated use themeVars
43
- */
44
- export const teal = {
45
- teal1: "hsl(165, 60%, 99%)",
46
- teal2: "hsl(169, 65%, 97%)",
47
- teal3: "hsl(169, 60%, 94%)",
48
- teal4: "hsl(169, 53%, 90%)",
49
- teal5: "hsl(170, 47%, 85%)",
50
- teal6: "hsl(170, 43%, 78%)",
51
- teal7: "hsl(170, 40%, 68%)",
52
- teal8: "hsl(172, 42%, 52%)",
53
- teal9: "hsl(173, 80%, 36%)",
54
- teal10: "hsl(173, 83%, 33%)",
55
- teal11: "hsl(174, 90%, 25%)",
56
- teal12: "hsl(170, 50%, 13%)",
57
- } as const;
58
-
59
- /**
60
- * @deprecated use themeVars
61
- */
62
- export const tealDark = {
63
- teal1: "hsl(168, 48%, 6%)",
64
- teal2: "hsl(169, 78%, 7%)",
65
- teal3: "hsl(170, 76%, 9%)",
66
- teal4: "hsl(171, 76%, 11%)",
67
- teal5: "hsl(171, 76%, 13%)",
68
- teal6: "hsl(172, 76%, 15%)",
69
- teal7: "hsl(172, 77%, 19%)",
70
- teal8: "hsl(173, 80%, 24%)",
71
- teal9: "hsl(173, 80%, 36%)",
72
- teal10: "hsl(174, 84%, 38%)",
73
- teal11: "hsl(174, 90%, 41%)",
74
- teal12: "hsl(166, 73%, 93%)",
75
- } as const;
76
-
77
- /**
78
- * @deprecated use themeVars
79
- */
80
- export const indigo = {
81
- indigo1: "hsl(220, 60%, 99%)",
82
- indigo2: "hsl(220, 90%, 99%)",
83
- indigo3: "hsl(220, 88%, 97%)",
84
- indigo4: "hsl(220, 83%, 95%)",
85
- indigo5: "hsl(220, 77%, 92%)",
86
- indigo6: "hsl(220, 72%, 88%)",
87
- indigo7: "hsl(220, 67%, 82%)",
88
- indigo8: "hsl(220, 65%, 75%)",
89
- indigo9: "hsl(220, 62%, 56%)",
90
- indigo10: "hsl(220, 59%, 51%)",
91
- indigo11: "hsl(220, 55%, 45%)",
92
- indigo12: "hsl(220, 62%, 17%)",
93
- } as const;
94
-
95
- /**
96
- * @deprecated use themeVars
97
- */
98
- export const indigoDark = {
99
- indigo1: "hsl(222, 24%, 10%)",
100
- indigo2: "hsl(222, 36%, 13%)",
101
- indigo3: "hsl(222, 43%, 18%)",
102
- indigo4: "hsl(222, 47%, 21%)",
103
- indigo5: "hsl(222, 45%, 24%)",
104
- indigo6: "hsl(222, 43%, 28%)",
105
- indigo7: "hsl(222, 50%, 35%)",
106
- indigo8: "hsl(222, 55%, 44%)",
107
- indigo9: "hsl(222, 60%, 56%)",
108
- indigo10: "hsl(222, 65%, 62%)",
109
- indigo11: "hsl(222, 70%, 76%)",
110
- indigo12: "hsl(222, 83%, 96%)",
111
- } as const;
112
-
113
- /**
114
- * @deprecated use themeVars
115
- */
116
- export const red = {
117
- red1: "hsl(359, 100%, 99%)",
118
- red2: "hsl(359, 100%, 99%)",
119
- red3: "hsl(360, 100%, 97%)",
120
- red4: "hsl(360, 98%, 95%)",
121
- red5: "hsl(360, 90%, 92%)",
122
- red6: "hsl(360, 82%, 88%)",
123
- red7: "hsl(359, 74%, 82%)",
124
- red8: "hsl(359, 69%, 74%)",
125
- red9: "hsl(358, 75%, 59%)",
126
- red10: "hsl(358, 69%, 55%)",
127
- red11: "hsl(358, 65%, 49%)",
128
- red12: "hsl(354, 50%, 15%)",
129
- } as const;
130
-
131
- /**
132
- * @deprecated use themeVars
133
- */
134
- export const redDark = {
135
- red1: "hsl(353, 23%, 10%)",
136
- red2: "hsl(357, 34%, 12%)",
137
- red3: "hsl(356, 43%, 16%)",
138
- red4: "hsl(356, 48%, 19%)",
139
- red5: "hsl(356, 51%, 22%)",
140
- red6: "hsl(356, 55%, 26%)",
141
- red7: "hsl(357, 60%, 32%)",
142
- red8: "hsl(358, 65%, 40%)",
143
- red9: "hsl(358, 75%, 59%)",
144
- red10: "hsl(358, 85%, 64%)",
145
- red11: "hsl(358, 100%, 70%)",
146
- red12: "hsl(351, 89%, 96%)",
147
- } as const;
148
-
149
- export const yellow = {
150
- yellow1: "hsl(60, 54%, 98%)",
151
- yellow2: "hsl(52, 100%, 95%)",
152
- yellow3: "hsl(55, 100%, 91%)",
153
- yellow4: "hsl(54, 100%, 87%)",
154
- yellow5: "hsl(52, 98%, 82%)",
155
- yellow6: "hsl(50, 89%, 76%)",
156
- yellow7: "hsl(47, 80%, 68%)",
157
- yellow8: "hsl(48, 100%, 46%)",
158
- yellow9: "hsl(53, 92%, 50%)",
159
- yellow10: "hsl(50, 100%, 48%)",
160
- yellow11: "hsl(42, 100%, 29%)",
161
- yellow12: "hsl(40, 55%, 13%)",
162
- } as const;
163
-
164
- /**
165
- * @deprecated use themeVars
166
- */
167
- export const yellowDark = {
168
- yellow1: "hsl(45, 100%, 5%)",
169
- yellow2: "hsl(46, 100%, 7%)",
170
- yellow3: "hsl(45, 100%, 9%)",
171
- yellow4: "hsl(45, 100%, 10%)",
172
- yellow5: "hsl(47, 100%, 12%)",
173
- yellow6: "hsl(49, 100%, 14%)",
174
- yellow7: "hsl(49, 90%, 18%)",
175
- yellow8: "hsl(50, 100%, 22%)",
176
- yellow9: "hsl(53, 92%, 50%)",
177
- yellow10: "hsl(54, 100%, 68%)",
178
- yellow11: "hsl(48, 100%, 47%)",
179
- yellow12: "hsl(53, 100%, 91%)",
180
- } as const;
181
-
182
- /**
183
- * @deprecated use themeVars
184
- */
185
- export const blackA = {
186
- blackA0: "#000000",
187
- blackA1: "hsla(0, 0%, 0%, 0.01)",
188
- blackA2: "hsla(0, 0%, 0%, 0.03)",
189
- blackA3: "hsla(0, 0%, 0%, 0.05)",
190
- blackA4: "hsla(0, 0%, 0%, 0.07)",
191
- blackA5: "hsla(0, 0%, 0%, 0.09)",
192
- blackA6: "hsla(0, 0%, 0%, 0.11)",
193
- blackA7: "hsla(0, 0%, 0%, 0.14)",
194
- blackA8: "hsla(0, 0%, 0%, 0.22)",
195
- blackA9: "hsla(0, 0%, 0%, 0.44)",
196
- blackA10: "hsla(0, 0%, 0%, 0.48)",
197
- blackA11: "hsla(0, 0%, 0%, 0.57)",
198
- blackA12: "hsla(0, 0%, 0%, 0.91)",
199
- } as const;
200
-
201
- /**
202
- * @deprecated use themeVars
203
- */
204
- export const whiteA = {
205
- whiteA0: "#FFFFFF",
206
- whiteA1: "hsla(0, 0%, 100%, 0)",
207
- whiteA2: "hsla(0, 0%, 100%, 0.01)",
208
- whiteA3: "hsla(0, 0%, 100%, 0.03)",
209
- whiteA4: "hsla(0, 0%, 100%, 0.06)",
210
- whiteA5: "hsla(0, 0%, 100%, 0.09)",
211
- whiteA6: "hsla(0, 0%, 100%, 0.12)",
212
- whiteA7: "hsla(0, 0%, 100%, 0.18)",
213
- whiteA8: "hsla(0, 0%, 100%, 0.25)",
214
- whiteA9: "hsla(0, 0%, 100%, 0.39)",
215
- whiteA10: "hsla(0, 0%, 100%, 0.45)",
216
- whiteA11: "hsla(0, 0%, 100%, 0.59)",
217
- whiteA12: "hsla(0, 0%, 100%, 0.92)",
218
- } as const;
219
-
220
- /**
221
- * Converts a Radix color object ({prefix1, prefix2, ...}) to a ColorScale array.
222
- * Index 0 uses prefixBase if available, otherwise prefixStep1.
223
- */
224
- export function toColorScale<K extends string>(radixScale: Record<string, string>, prefix: K): ColorScale {
225
- return [
226
- radixScale[`${prefix}0`] ?? radixScale[`${prefix}Base`] ?? base,
227
- radixScale[`${prefix}1`],
228
- radixScale[`${prefix}2`],
229
- radixScale[`${prefix}3`],
230
- radixScale[`${prefix}4`],
231
- radixScale[`${prefix}5`],
232
- radixScale[`${prefix}6`],
233
- radixScale[`${prefix}7`],
234
- radixScale[`${prefix}8`],
235
- radixScale[`${prefix}9`],
236
- radixScale[`${prefix}10`],
237
- radixScale[`${prefix}11`],
238
- radixScale[`${prefix}12`],
239
- ].map((x, i) => x ?? throwError(prefix + i)) as unknown as ColorScale;
240
- }
241
-
242
- export const whiteAScale = toColorScale(whiteA, "whiteA");
243
- export const blackAScale = toColorScale(blackA, "blackA");
244
- export const slateScale = toColorScale(slate, "slate");
245
- export const slateDarkScale = toColorScale(slateDark, "slate");
246
- export const indigoScale = toColorScale(indigo, "indigo");
247
- export const indigoDarkScale = toColorScale(indigoDark, "indigo");
248
- export const redScale = toColorScale(red, "red");
249
- export const redDarkScale = toColorScale(redDark, "red");
250
- export const tealScale = toColorScale(teal, "teal");
251
- export const tealDarkScale = toColorScale(tealDark, "teal");
252
- export const yellowScale = toColorScale(yellow, "yellow");
253
- export const yellowDarkScale = toColorScale(yellowDark, "yellow");