alouette 10.2.0 → 11.0.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.
- package/CHANGELOG.md +27 -0
- package/dist/createAlouetteTamagui-browser.es.js +85 -10
- package/dist/createAlouetteTamagui-browser.es.js.map +1 -1
- package/dist/createAlouetteTamagui-node20.cjs +92 -12
- package/dist/createAlouetteTamagui-node20.cjs.map +1 -1
- package/dist/createAlouetteTamagui-node20.mjs +90 -12
- package/dist/createAlouetteTamagui-node20.mjs.map +1 -1
- package/dist/createAlouetteTamagui-react-native.cjs.js +92 -12
- package/dist/createAlouetteTamagui-react-native.cjs.js.map +1 -1
- package/dist/createAlouetteTamagui-react-native.es.js +90 -12
- package/dist/createAlouetteTamagui-react-native.es.js.map +1 -1
- package/dist/definitions/components/actions/Button.d.ts +2 -2
- package/dist/definitions/components/actions/Button.d.ts.map +1 -1
- package/dist/definitions/components/actions/Button.stories.d.ts +62 -2
- package/dist/definitions/components/actions/Button.stories.d.ts.map +1 -1
- package/dist/definitions/components/actions/IconButton.d.ts +3 -2
- package/dist/definitions/components/actions/IconButton.d.ts.map +1 -1
- package/dist/definitions/components/actions/IconButton.stories.d.ts +60 -2
- package/dist/definitions/components/actions/IconButton.stories.d.ts.map +1 -1
- package/dist/definitions/components/containers/Box.d.ts +1 -1
- package/dist/definitions/components/containers/Box.stories.d.ts +61 -3
- package/dist/definitions/components/containers/Box.stories.d.ts.map +1 -1
- package/dist/definitions/components/containers/PressableBox.d.ts +1 -1
- package/dist/definitions/components/containers/PressableBox.stories.d.ts +12 -3
- package/dist/definitions/components/containers/PressableBox.stories.d.ts.map +1 -1
- package/dist/definitions/components/containers/variants.d.ts +82 -13
- package/dist/definitions/components/containers/variants.d.ts.map +1 -1
- package/dist/definitions/components/feedback/Message.d.ts +6 -4
- package/dist/definitions/components/feedback/Message.d.ts.map +1 -1
- package/dist/definitions/components/feedback/Message.stories.d.ts +40 -2
- package/dist/definitions/components/feedback/Message.stories.d.ts.map +1 -1
- package/dist/definitions/components/forms/InputText.d.ts +2 -2
- package/dist/definitions/components/forms/InputText.stories.d.ts +42 -3
- package/dist/definitions/components/forms/InputText.stories.d.ts.map +1 -1
- package/dist/definitions/components/layout/Separator.stories.d.ts +11 -2
- package/dist/definitions/components/layout/Separator.stories.d.ts.map +1 -1
- package/dist/definitions/components/layout/list.stories.d.ts +13 -2
- package/dist/definitions/components/layout/list.stories.d.ts.map +1 -1
- package/dist/definitions/components/primitives/Icon.stories.d.ts +25 -2
- package/dist/definitions/components/primitives/Icon.stories.d.ts.map +1 -1
- package/dist/definitions/components/primitives/Link.d.ts +26 -0
- package/dist/definitions/components/primitives/Link.d.ts.map +1 -0
- package/dist/definitions/components/primitives/Link.stories.d.ts +49 -0
- package/dist/definitions/components/primitives/Link.stories.d.ts.map +1 -0
- package/dist/definitions/components/primitives/View.stories.d.ts +9 -1
- package/dist/definitions/components/primitives/View.stories.d.ts.map +1 -1
- package/dist/definitions/components/primitives/createVariants.d.ts +14 -28
- package/dist/definitions/components/primitives/createVariants.d.ts.map +1 -1
- package/dist/definitions/components/primitives/stacks.stories.d.ts +60 -6
- package/dist/definitions/components/primitives/stacks.stories.d.ts.map +1 -1
- package/dist/definitions/components/story-components/Story.d.ts +2 -2
- package/dist/definitions/components/story-components/Story.d.ts.map +1 -1
- package/dist/definitions/components/story-components/StoryDecorator.d.ts +1 -1
- package/dist/definitions/components/story-components/StoryDecorator.d.ts.map +1 -1
- package/dist/definitions/components/story-components/StoryTitle.d.ts +6 -4
- package/dist/definitions/components/story-components/StoryTitle.d.ts.map +1 -1
- package/dist/definitions/components/typography/Typography.d.ts +10 -28
- package/dist/definitions/components/typography/Typography.d.ts.map +1 -1
- package/dist/definitions/components/typography/Typography.stories.d.ts +14 -4
- package/dist/definitions/components/typography/Typography.stories.d.ts.map +1 -1
- package/dist/definitions/components/windowSize/SwitchBreakpoints.stories.d.ts +11 -2
- package/dist/definitions/components/windowSize/SwitchBreakpoints.stories.d.ts.map +1 -1
- package/dist/definitions/config/animations.d.ts.map +1 -1
- package/dist/definitions/config/colorScales.d.ts.map +1 -1
- package/dist/definitions/config/createAlouetteFonts.d.ts.map +1 -1
- package/dist/definitions/config/createAlouetteTokens.d.ts +10 -10
- package/dist/definitions/config/createAlouetteTokens.d.ts.map +1 -1
- package/dist/definitions/config/themes.d.ts +386 -92
- package/dist/definitions/config/themes.d.ts.map +1 -1
- package/dist/definitions/config/themes.stories.d.ts +12 -5
- package/dist/definitions/config/themes.stories.d.ts.map +1 -1
- package/dist/definitions/config/tokens.stories.d.ts +12 -5
- package/dist/definitions/config/tokens.stories.d.ts.map +1 -1
- package/dist/definitions/config/utils/colorContrast.d.ts +18 -0
- package/dist/definitions/config/utils/colorContrast.d.ts.map +1 -0
- package/dist/definitions/config/utils/colorContrast.test.d.ts +2 -0
- package/dist/definitions/config/utils/colorContrast.test.d.ts.map +1 -0
- package/dist/definitions/config/utils/groupTokens.d.ts.map +1 -1
- package/dist/definitions/core/AlouetteDecorator.d.ts +1 -1
- package/dist/definitions/core/AlouetteDecorator.d.ts.map +1 -1
- package/dist/definitions/createAlouetteTamagui.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +1 -1
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/index-browser.es.js +153 -162
- package/dist/index-browser.es.js.map +1 -1
- package/dist/index-node20.cjs +154 -163
- package/dist/index-node20.cjs.map +1 -1
- package/dist/index-node20.mjs +153 -162
- package/dist/index-node20.mjs.map +1 -1
- package/dist/index-react-native.cjs.js +154 -163
- package/dist/index-react-native.cjs.js.map +1 -1
- package/dist/index-react-native.es.js +153 -162
- package/dist/index-react-native.es.js.map +1 -1
- package/package.json +17 -16
- package/src/components/actions/Button.stories.tsx +170 -41
- package/src/components/actions/Button.tsx +32 -6
- package/src/components/actions/IconButton.stories.tsx +120 -20
- package/src/components/actions/IconButton.tsx +53 -6
- package/src/components/containers/Box.stories.tsx +111 -61
- package/src/components/containers/PressableBox.stories.tsx +56 -11
- package/src/components/containers/variants.ts +27 -19
- package/src/components/feedback/Message.stories.tsx +76 -10
- package/src/components/feedback/Message.tsx +6 -2
- package/src/components/forms/InputText.stories.tsx +71 -11
- package/src/components/layout/Separator.stories.tsx +46 -5
- package/src/components/layout/list.stories.tsx +58 -9
- package/src/components/primitives/Icon.stories.tsx +57 -10
- package/src/components/primitives/Link.stories.tsx +108 -0
- package/src/components/primitives/Link.tsx +38 -0
- package/src/components/primitives/View.stories.tsx +47 -2
- package/src/components/primitives/createVariants.ts +14 -86
- package/src/components/primitives/stacks.stories.tsx +168 -40
- package/src/components/story-components/Story.tsx +14 -7
- package/src/components/story-components/StoryDecorator.tsx +1 -1
- package/src/components/story-components/StoryTitle.tsx +6 -6
- package/src/components/typography/Typography.stories.tsx +49 -16
- package/src/components/typography/Typography.tsx +24 -45
- package/src/components/windowSize/SwitchBreakpoints.stories.tsx +57 -3
- package/src/config/animations.ts +3 -1
- package/src/config/colorScales.ts +1 -1
- package/src/config/themes.stories.tsx +30 -6
- package/src/config/themes.ts +69 -11
- package/src/config/tokens.stories.tsx +35 -7
- package/src/config/utils/colorContrast.test.ts +41 -0
- package/src/config/utils/colorContrast.ts +85 -0
- package/src/core/AlouetteDecorator.tsx +1 -1
- package/src/index.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [11.0.0](https://github.com/christophehurpeau/alouette/compare/alouette@10.3.0...alouette@11.0.0) (2025-06-29)
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* update to react 19, typography changes and add native storybook
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **deps:** update dependency type-fest to v4.35.0 ([#166](https://github.com/christophehurpeau/alouette/issues/166)) ([c0e667e](https://github.com/christophehurpeau/alouette/commit/c0e667e21a56da7a8d3d9d441781718a528bf117))
|
|
15
|
+
* update dependencies ([27d1465](https://github.com/christophehurpeau/alouette/commit/27d146549419358385e1a5d6bab79c426269e542))
|
|
16
|
+
* update tamagui ([9880238](https://github.com/christophehurpeau/alouette/commit/98802387b506755124bef6dc7c1ea660b20d8737))
|
|
17
|
+
* update to react 19, typography changes and add native storybook ([87cc3a9](https://github.com/christophehurpeau/alouette/commit/87cc3a99e295d7a47e90c04d68dfb2aecc79430f))
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* animation import ([90dc596](https://github.com/christophehurpeau/alouette/commit/90dc596b36be08439ecf520856324f005a091059))
|
|
22
|
+
* **deps:** update tamagui to v1.125.23 ([#138](https://github.com/christophehurpeau/alouette/issues/138)) ([5f695d7](https://github.com/christophehurpeau/alouette/commit/5f695d7358bbab15052ca89dc3144e07499eb3b7))
|
|
23
|
+
|
|
24
|
+
Version bump for dependency: alouette-icons
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## [10.3.0](https://github.com/christophehurpeau/alouette/compare/alouette@10.2.0...alouette@10.3.0) (2025-02-15)
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* add variants elevated and ghosts ([983aa49](https://github.com/christophehurpeau/alouette/commit/983aa49e883ba3bd2aa050c4d8c284611fa5ba37))
|
|
32
|
+
|
|
6
33
|
## [10.2.0](https://github.com/christophehurpeau/alouette/compare/alouette@10.1.1...alouette@10.2.0) (2025-02-15)
|
|
7
34
|
|
|
8
35
|
### Features
|
|
@@ -61,10 +61,6 @@ const createAlouetteFonts = ({
|
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
const Breakpoints = {
|
|
64
|
-
/**
|
|
65
|
-
* min-width: 0
|
|
66
|
-
*/
|
|
67
|
-
BASE: 0,
|
|
68
64
|
/**
|
|
69
65
|
* min-width: 480px
|
|
70
66
|
*/
|
|
@@ -137,6 +133,55 @@ const createAlouetteTokens = (colorScales, { spacing = 4 } = {}) => {
|
|
|
137
133
|
});
|
|
138
134
|
};
|
|
139
135
|
|
|
136
|
+
const getLuminance = (r, g, b) => {
|
|
137
|
+
const values = [r, g, b].map((c) => {
|
|
138
|
+
const s = c / 255;
|
|
139
|
+
return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
|
|
140
|
+
});
|
|
141
|
+
return 0.2126 * values[0] + 0.7152 * values[1] + 0.0722 * values[2];
|
|
142
|
+
};
|
|
143
|
+
const hexToRgb = (hex) => {
|
|
144
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
145
|
+
if (!result?.[1] || !result[2] || !result[3]) return null;
|
|
146
|
+
return {
|
|
147
|
+
r: parseInt(result[1], 16),
|
|
148
|
+
g: parseInt(result[2], 16),
|
|
149
|
+
b: parseInt(result[3], 16)
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
const getContrastRatio = (color1, color2) => {
|
|
153
|
+
const rgb1 = hexToRgb(color1);
|
|
154
|
+
const rgb2 = hexToRgb(color2);
|
|
155
|
+
if (!rgb1 || !rgb2) return 0;
|
|
156
|
+
const l1 = getLuminance(rgb1.r, rgb1.g, rgb1.b);
|
|
157
|
+
const l2 = getLuminance(rgb2.r, rgb2.g, rgb2.b);
|
|
158
|
+
const lighter = Math.max(l1, l2);
|
|
159
|
+
const darker = Math.min(l1, l2);
|
|
160
|
+
return (lighter + 0.05) / (darker + 0.05);
|
|
161
|
+
};
|
|
162
|
+
const checkContrast = (foreground, background, level = "AA") => {
|
|
163
|
+
const ratio = getContrastRatio(foreground, background);
|
|
164
|
+
const minimumRatio = level === "AA" ? 4.5 : 7;
|
|
165
|
+
return {
|
|
166
|
+
ratio,
|
|
167
|
+
passes: ratio >= minimumRatio,
|
|
168
|
+
minimumRatio
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
const warnOnContrastIssues = (themeName, textColor, backgroundColor) => {
|
|
172
|
+
if (process.env.NODE_ENV !== "development") return;
|
|
173
|
+
const result = checkContrast(textColor, backgroundColor);
|
|
174
|
+
if (!result.passes) {
|
|
175
|
+
console.warn(
|
|
176
|
+
`[Alouette] Contrast warning in theme "${themeName}":
|
|
177
|
+
Text color ${textColor} on background ${backgroundColor}
|
|
178
|
+
has contrast ratio of ${result.ratio.toFixed(2)}.
|
|
179
|
+
Minimum required: ${result.minimumRatio}
|
|
180
|
+
This may cause accessibility issues.`
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
|
|
140
185
|
const darkModeScaleNumbers = {
|
|
141
186
|
1: 10,
|
|
142
187
|
2: 9,
|
|
@@ -168,28 +213,50 @@ const createColorTheme = (tokens, colorScaleName, mode = "light", backgroundColo
|
|
|
168
213
|
const scaleNumber = mode === "dark" ? darkModeScaleNumbers[lightScaleNumber] : lightScaleNumber;
|
|
169
214
|
return tokens.color[`${forceScaleNumber}.${scaleNumber}`];
|
|
170
215
|
};
|
|
171
|
-
|
|
216
|
+
const contrastBorderColor = contrastTextColor;
|
|
217
|
+
const theme = {
|
|
172
218
|
backgroundColor,
|
|
173
219
|
textColor,
|
|
174
220
|
mainColor: getColor(6),
|
|
175
221
|
mainTextColor: getColor(9),
|
|
176
222
|
contrastTextColor,
|
|
177
223
|
borderColor: getColor(8),
|
|
224
|
+
contrastBorderColor,
|
|
225
|
+
shadowColor: getColor(9),
|
|
178
226
|
"textColor:disabled": getColor(3, "grayscale"),
|
|
179
227
|
"contrastTextColor:disabled": getColor(7, "grayscale"),
|
|
228
|
+
"interactive.linkTextColor": getColor(9),
|
|
229
|
+
"interactive.linkTextColor:hover": getColor(7),
|
|
230
|
+
"interactive.linkTextColor:focus": getColor(7),
|
|
231
|
+
"interactive.linkTextColor:press": getColor(7),
|
|
232
|
+
"interactive.linkTextColor:disabled": getColor(3, "grayscale"),
|
|
180
233
|
"interactive.contained.backgroundColor": getColor(5),
|
|
181
|
-
"interactive.
|
|
234
|
+
"interactive.elevated.backgroundColor": backgroundColor,
|
|
235
|
+
"interactive.elevated.shadowColor": getColor(9),
|
|
236
|
+
"interactive.elevated.borderColor": contrastBorderColor,
|
|
237
|
+
"interactive.outlined.backgroundColor": backgroundColor,
|
|
238
|
+
"interactive.outlined.borderColor": getColor(mode === "dark" ? 5 : 8),
|
|
182
239
|
"interactive.contained.backgroundColor:hover": getColor(4),
|
|
240
|
+
"interactive.elevated.backgroundColor:hover": getColor(1),
|
|
241
|
+
"interactive.elevated.borderColor:hover": contrastBorderColor,
|
|
183
242
|
"interactive.outlined.backgroundColor:hover": getColor(1),
|
|
184
|
-
"interactive.borderColor:hover": getColor(mode === "dark" ? 5 : 7),
|
|
243
|
+
"interactive.outlined.borderColor:hover": getColor(mode === "dark" ? 5 : 7),
|
|
185
244
|
"interactive.contained.backgroundColor:focus": getColor(4),
|
|
245
|
+
"interactive.elevated.backgroundColor:focus": getColor(1),
|
|
246
|
+
"interactive.elevated.borderColor:focus": contrastBorderColor,
|
|
186
247
|
"interactive.outlined.backgroundColor:focus": getColor(1),
|
|
187
|
-
"interactive.borderColor:focus": getColor(7),
|
|
248
|
+
"interactive.outlined.borderColor:focus": getColor(7),
|
|
188
249
|
"interactive.contained.backgroundColor:press": getColor(2),
|
|
250
|
+
"interactive.elevated.backgroundColor:press": getColor(3),
|
|
251
|
+
"interactive.elevated.borderColor:press": contrastBorderColor,
|
|
189
252
|
"interactive.outlined.backgroundColor:press": getColor(3),
|
|
190
|
-
"interactive.borderColor:press": getColor(7),
|
|
253
|
+
"interactive.outlined.borderColor:press": getColor(7),
|
|
191
254
|
"interactive.contained.backgroundColor:disabled": getColor(3, "grayscale"),
|
|
192
|
-
"interactive.
|
|
255
|
+
"interactive.elevated.backgroundColor:disabled": backgroundColor,
|
|
256
|
+
"interactive.elevated.shadowColor:disabled": getColor(9, "grayscale"),
|
|
257
|
+
"interactive.elevated.borderColor:disabled": getColor(3, "grayscale"),
|
|
258
|
+
"interactive.outlined.backgroundColor:disabled": backgroundColor,
|
|
259
|
+
"interactive.outlined.borderColor:disabled": getColor(3, "grayscale"),
|
|
193
260
|
"interactive.textColor:disabled": getColor(7, "grayscale"),
|
|
194
261
|
"interactive.forms.textColor": textColor,
|
|
195
262
|
"interactive.forms.placeholderTextColor": getColor(3, "grayscale"),
|
|
@@ -203,6 +270,14 @@ const createColorTheme = (tokens, colorScaleName, mode = "light", backgroundColo
|
|
|
203
270
|
"interactive.forms.borderColor:press": getColor(7),
|
|
204
271
|
"interactive.forms.borderColor:disabled": getColor(3, "grayscale")
|
|
205
272
|
};
|
|
273
|
+
if (process.env.NODE_ENV === "development") {
|
|
274
|
+
warnOnContrastIssues(
|
|
275
|
+
colorScaleName,
|
|
276
|
+
theme.textColor.val,
|
|
277
|
+
theme.backgroundColor.val
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
return theme;
|
|
206
281
|
};
|
|
207
282
|
const createAlouetteThemes = (tokens) => {
|
|
208
283
|
const alouetteTokens = tokens;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAlouetteTamagui-browser.es.js","sources":["../src/config/animations.web.ts","../src/config/createAlouetteFonts.ts","../src/config/Breakpoints.ts","../src/config/media.ts","../src/config/createAlouetteTokens.ts","../src/config/themes.ts","../src/config/colorScales.ts","../src/createAlouetteTamagui.ts"],"sourcesContent":["import { createAnimations } from \"@tamagui/animations-css\";\n\nexport const animations = createAnimations({\n fast: \"ease-in 150ms\",\n formElement: \"ease-in 600ms\",\n});\nconsole.log(\"animations: web\");\n","import { createFont } from \"@tamagui/core\";\n\nconst defaultHeadingFontSizes = { xl: 48, lg: 40, md: 32, sm: 24, xs: 18 };\nconst defaultBodyFontSizes = { xl: 24, lg: 18, md: 16, sm: 14, xs: 12 };\n\nconst roundWith1Precision = (value: number): number =>\n Math.round(value * 10) / 10;\n\nexport interface AlouetteFontsOptions {\n headingFontFamily?: string;\n headingFontSizes?: typeof defaultHeadingFontSizes;\n bodyFontFamily?: string;\n bodyFontSizes?: typeof defaultBodyFontSizes;\n}\n\nexport const createAlouetteFonts = ({\n headingFontFamily = \"Inter\",\n headingFontSizes = defaultHeadingFontSizes,\n bodyFontFamily = \"Inter\",\n bodyFontSizes = defaultBodyFontSizes,\n}: AlouetteFontsOptions = {}) => ({\n heading: createFont({\n family: headingFontFamily,\n weight: {\n regular: \"400\",\n bold: \"700\",\n black: \"900\",\n },\n face: {\n 400: { normal: `${headingFontFamily}Regular` },\n 700: { normal: `${headingFontFamily}Bold` },\n 900: { normal: `${headingFontFamily}Black` },\n },\n size: headingFontSizes,\n lineHeight: {\n xl: roundWith1Precision(1.1 * headingFontSizes.xl),\n lg: roundWith1Precision(1.1 * headingFontSizes.lg),\n md: roundWith1Precision(1.2 * headingFontSizes.md),\n sm: roundWith1Precision(1.3 * headingFontSizes.sm),\n xs: roundWith1Precision(1.3 * headingFontSizes.xs),\n },\n }),\n body: createFont({\n family: bodyFontFamily,\n weight: {\n regular: \"400\",\n bold: \"700\",\n black: \"900\",\n },\n face: {\n 400: { normal: `${bodyFontFamily}Regular` },\n 700: { normal: `${bodyFontFamily}Bold` },\n 900: { normal: `${bodyFontFamily}Black` },\n },\n size: bodyFontSizes,\n lineHeight: {\n xl: roundWith1Precision(1.4 * bodyFontSizes.xl),\n lg: roundWith1Precision(1.4 * bodyFontSizes.lg),\n md: roundWith1Precision(1.4 * bodyFontSizes.md),\n sm: roundWith1Precision(1.4 * bodyFontSizes.sm),\n xs: roundWith1Precision(1.4 * bodyFontSizes.xs),\n },\n }),\n});\n","export const Breakpoints = {\n /**\n * min-width: 0\n */\n BASE: 0,\n /**\n * min-width: 480px\n */\n SMALL: 480,\n /**\n * min-width: 768px\n */\n MEDIUM: 768,\n /**\n * min-width: 1024px\n */\n LARGE: 1024,\n /**\n * min-width: 1280px\n */\n WIDE: 1280,\n} as const;\n\nexport type Breakpoint = (typeof Breakpoints)[keyof typeof Breakpoints];\nexport type BreakpointNames = \"base\" | \"large\" | \"medium\" | \"small\" | \"wide\";\n\nexport enum BreakpointNameEnum {\n BASE = \"base\",\n SMALL = \"small\",\n MEDIUM = \"medium\",\n LARGE = \"large\",\n WIDE = \"wide\",\n}\n","import { Breakpoints } from \"./Breakpoints\";\n\nexport const media = {\n small: { minWidth: Breakpoints.SMALL },\n medium: { minWidth: Breakpoints.MEDIUM },\n large: { minWidth: Breakpoints.LARGE },\n wide: { minWidth: Breakpoints.WIDE },\n} as const;\n","import { createTokens } from \"@tamagui/core\";\nimport type { IntRange } from \"type-fest\";\nimport type {\n AlouetteColorScaleNumber,\n AlouetteColorScales,\n} from \"./colorScales\";\n\ntype AlouetteSize = IntRange<0, 64>;\ntype NegativeAlouetteSize = `-${AlouetteSize}`;\ntype AlouetteSizeRecord = Record<AlouetteSize, number>;\ntype NegativeAlouetteSizeRecord = Record<NegativeAlouetteSize, number>;\n\nconst createAlouetteSizes = <const N extends boolean>(\n spacing: number,\n negative: N,\n): N extends true ? NegativeAlouetteSizeRecord : AlouetteSizeRecord => {\n const MAX_SIZE = 64;\n const sizes: Partial<\n N extends true ? NegativeAlouetteSizeRecord : AlouetteSizeRecord\n > = {};\n for (let size = 0; size <= MAX_SIZE; size++) {\n (sizes as any)[negative ? `-${size}` : `${size}`] = size * spacing;\n }\n return sizes as N extends true\n ? NegativeAlouetteSizeRecord\n : AlouetteSizeRecord;\n};\n\ntype ColorScaleTokens<ColorScales extends AlouetteColorScales> = {\n [K in string &\n keyof ColorScales as `${K}.${AlouetteColorScaleNumber}`]: string; //(typeof colorScales)[K][AlouetteColorScaleNumber];\n};\n\nconst transformColorScalesToTokens = <ColorScales extends AlouetteColorScales>(\n colorScales: ColorScales,\n): ColorScaleTokens<ColorScales> => {\n return Object.fromEntries(\n Object.entries(colorScales).flatMap(([colorName, colorScale]) => {\n return Object.entries(colorScale).map(([scaleNumber, colorValue]) => {\n return [`${colorName}.${scaleNumber}`, colorValue];\n });\n }),\n ) as ColorScaleTokens<ColorScales>;\n};\n\nexport interface AlouetteTokensOptions {\n spacing?: number;\n}\n\nexport const createAlouetteTokens = <\n const ColorScales extends AlouetteColorScales,\n>(\n colorScales: ColorScales,\n { spacing = 4 }: AlouetteTokensOptions = {},\n) => {\n const sizes: AlouetteSizeRecord = createAlouetteSizes(spacing, false);\n const negativeSizes: NegativeAlouetteSizeRecord = createAlouetteSizes(\n -spacing,\n true,\n );\n\n return createTokens({\n color: {\n black: \"#000000\",\n white: \"#ffffff\",\n ...transformColorScalesToTokens(colorScales),\n },\n radius: {\n ...sizes,\n xs: spacing * 2,\n sm: spacing * 4,\n md: spacing * 8,\n },\n space: {\n ...sizes,\n ...negativeSizes,\n xs: spacing * 2,\n sm: spacing * 4,\n md: spacing * 8,\n },\n size: { ...sizes },\n zIndex: {},\n } as const);\n};\n","/* eslint-disable camelcase */\nimport type { Variable } from \"@tamagui/core\";\nimport type {\n AlouetteColorScaleNumber,\n AlouetteColorScales,\n} from \"./colorScales\";\nimport type { createAlouetteTokens } from \"./createAlouetteTokens\";\n\n// export interface MinimalRootTheme {\n// backgroundColor: Variable<string>;\n// textColor: Variable<string>;\n// }\n\n// export interface RootTheme {\n// backgroundColor: Variable<string>;\n// textColor: Variable<string>;\n// }\n\nexport interface ColorTheme {\n backgroundColor: Variable<string>;\n textColor: Variable<string>;\n contrastTextColor: Variable<string>;\n \"textColor:disabled\": Variable<string>;\n \"contrastTextColor:disabled\": Variable<string>;\n mainColor: Variable<string>;\n mainTextColor: Variable<string>;\n borderColor: Variable<string>;\n\n \"interactive.contained.backgroundColor\": Variable<string>;\n \"interactive.borderColor\": Variable<string>;\n\n \"interactive.contained.backgroundColor:hover\": Variable<string>;\n \"interactive.outlined.backgroundColor:hover\": Variable<string>;\n \"interactive.borderColor:hover\": Variable<string>;\n\n \"interactive.contained.backgroundColor:focus\": Variable<string>;\n \"interactive.outlined.backgroundColor:focus\": Variable<string>;\n \"interactive.borderColor:focus\": Variable<string>;\n\n \"interactive.contained.backgroundColor:press\": Variable<string>;\n \"interactive.outlined.backgroundColor:press\": Variable<string>;\n \"interactive.borderColor:press\": Variable<string>;\n\n \"interactive.contained.backgroundColor:disabled\": Variable<string>;\n \"interactive.borderColor:disabled\": Variable<string>;\n \"interactive.textColor:disabled\": Variable<string>;\n\n \"interactive.forms.textColor\": Variable<string>;\n \"interactive.forms.placeholderTextColor\": Variable<string>;\n // \"interactive.forms.backgroundColor\": Variable<string>,\n // \"interactive.forms.backgroundColor:hover\": Variable<string>,\n \"interactive.forms.backgroundColor:focus\": Variable<string>;\n \"interactive.forms.backgroundColor:press\": Variable<string>;\n \"interactive.forms.borderColor\": Variable<string>;\n \"interactive.forms.borderColor:hover\": Variable<string>;\n \"interactive.forms.borderColor:focus\": Variable<string>;\n \"interactive.forms.borderColor:press\": Variable<string>;\n \"interactive.forms.borderColor:disabled\": Variable<string>;\n}\n\n// export interface FullTheme extends ColorTheme, RootTheme {}\nexport type FullTheme = ColorTheme;\n\n// export const createRootTheme = <T extends MinimalRootTheme>(\n// theme: T,\n// ): FullTheme => {\n// return theme satisfies RootTheme as unknown as FullTheme;\n// };\n\nconst darkModeScaleNumbers: Record<\n AlouetteColorScaleNumber,\n AlouetteColorScaleNumber\n> = {\n 1: 10,\n 2: 9,\n 3: 8,\n 4: 7,\n 5: 6,\n 6: 5,\n 7: 4,\n 8: 3,\n 9: 2,\n 10: 1,\n};\n\nexport const createColorTheme = <const ColorScales extends AlouetteColorScales>(\n tokens: ReturnType<typeof createAlouetteTokens<ColorScales>>,\n colorScaleName: string & keyof ColorScales,\n mode: \"dark\" | \"light\" = \"light\",\n backgroundColor?: Variable<string>,\n textColor?: Variable<string>,\n contrastTextColor?: Variable<string>,\n) => {\n const alouetteTokens: ReturnType<\n typeof createAlouetteTokens<AlouetteColorScales>\n > = tokens;\n if (!backgroundColor) {\n backgroundColor =\n mode === \"dark\" ? alouetteTokens.color.black : alouetteTokens.color.white;\n }\n if (!textColor) {\n textColor =\n mode === \"dark\" ? alouetteTokens.color.white : alouetteTokens.color.black;\n }\n if (!contrastTextColor) {\n if (colorScaleName === \"grayscale\") {\n contrastTextColor =\n mode === \"dark\"\n ? alouetteTokens.color.white\n : alouetteTokens.color.black;\n } else {\n contrastTextColor =\n mode === \"dark\"\n ? alouetteTokens.color.black\n : alouetteTokens.color.white;\n }\n }\n\n const getColor = (\n lightScaleNumber: AlouetteColorScaleNumber,\n forceScaleNumber = colorScaleName,\n ) => {\n // Invert scale for dark mode\n const scaleNumber =\n mode === \"dark\"\n ? darkModeScaleNumbers[lightScaleNumber]\n : lightScaleNumber;\n\n return tokens.color[\n `${forceScaleNumber}.${scaleNumber}` as keyof typeof tokens.color\n ];\n };\n\n return {\n backgroundColor,\n textColor,\n mainColor: getColor(6),\n mainTextColor: getColor(9),\n contrastTextColor,\n borderColor: getColor(8),\n \"textColor:disabled\": getColor(3, \"grayscale\"),\n \"contrastTextColor:disabled\": getColor(7, \"grayscale\"),\n\n \"interactive.contained.backgroundColor\": getColor(5),\n \"interactive.borderColor\": getColor(mode === \"dark\" ? 5 : 8),\n\n \"interactive.contained.backgroundColor:hover\": getColor(4),\n \"interactive.outlined.backgroundColor:hover\": getColor(1),\n \"interactive.borderColor:hover\": getColor(mode === \"dark\" ? 5 : 7),\n\n \"interactive.contained.backgroundColor:focus\": getColor(4),\n \"interactive.outlined.backgroundColor:focus\": getColor(1),\n \"interactive.borderColor:focus\": getColor(7),\n\n \"interactive.contained.backgroundColor:press\": getColor(2),\n \"interactive.outlined.backgroundColor:press\": getColor(3),\n \"interactive.borderColor:press\": getColor(7),\n\n \"interactive.contained.backgroundColor:disabled\": getColor(3, \"grayscale\"),\n \"interactive.borderColor:disabled\": getColor(3, \"grayscale\"),\n \"interactive.textColor:disabled\": getColor(7, \"grayscale\"),\n\n \"interactive.forms.textColor\": textColor,\n \"interactive.forms.placeholderTextColor\": getColor(3, \"grayscale\"),\n\n // \"interactive.forms.backgroundColor\": undefined,\n // \"interactive.forms.backgroundColor:hover\": undefined,\n \"interactive.forms.backgroundColor:focus\": getColor(1),\n \"interactive.forms.backgroundColor:press\": getColor(3),\n \"interactive.forms.borderColor\": getColor(10),\n \"interactive.forms.borderColor:hover\": getColor(7),\n \"interactive.forms.borderColor:focus\": getColor(7),\n \"interactive.forms.borderColor:press\": getColor(7),\n \"interactive.forms.borderColor:disabled\": getColor(3, \"grayscale\"),\n } satisfies FullTheme;\n};\n\nexport const createAlouetteThemes = <\n const ColorScales extends AlouetteColorScales,\n>(\n tokens: ReturnType<typeof createAlouetteTokens<ColorScales>>,\n) => {\n const alouetteTokens: ReturnType<\n typeof createAlouetteTokens<AlouetteColorScales>\n > = tokens;\n return {\n light: createColorTheme(alouetteTokens, \"grayscale\", \"light\"),\n light_info: createColorTheme(alouetteTokens, \"info\", \"light\"),\n light_success: createColorTheme(alouetteTokens, \"success\", \"light\"),\n light_warning: createColorTheme(alouetteTokens, \"warning\", \"light\"),\n light_danger: createColorTheme(alouetteTokens, \"danger\", \"light\"),\n light_primary: createColorTheme(alouetteTokens, \"primary\", \"light\"),\n\n dark: createColorTheme(alouetteTokens, \"grayscale\", \"dark\"),\n dark_info: createColorTheme(alouetteTokens, \"info\", \"dark\"),\n dark_success: createColorTheme(alouetteTokens, \"success\", \"dark\"),\n dark_warning: createColorTheme(alouetteTokens, \"warning\", \"dark\"),\n dark_danger: createColorTheme(alouetteTokens, \"danger\", \"dark\"),\n dark_primary: createColorTheme(alouetteTokens, \"primary\", \"dark\"),\n } as const;\n};\n","import type { IntRange } from \"type-fest\";\n\n// scale inspired by https://www.radix-ui.com/colors/docs/palette-composition/understanding-the-scale\n// 1: interactive outlined background hover/focus color\n// 2: interactive contained background press color\n// 3: interactive outlined background press color\n// 4: interactive contained background hover/focus color\n// 5: interactive contained background color\n// 6: main color\n// 7: border hover/focus color\n// 8: border color\n// 9: text color\n// 10: form border color (default)\n\nexport type AlouetteColorScaleNumber = IntRange<1, 11>;\n\nexport type AlouetteColorScale = Record<AlouetteColorScaleNumber, string>;\n\nexport const createColorScale = <const T extends AlouetteColorScale>(\n colorScale: T,\n): T => colorScale;\n\nexport type AlouetteColorScaleNames =\n | \"danger\"\n | \"grayscale\"\n | \"info\"\n | \"primary\"\n | \"success\"\n | \"warning\";\n\nexport type ColorScaleTokens = {\n [K in AlouetteColorScaleNames as `${K}.${AlouetteColorScaleNumber}`]: string; //(typeof colorScales)[K][AlouetteColorScaleNumber];\n};\n\nexport type AlouetteColorScales = Record<\n AlouetteColorScaleNames,\n AlouetteColorScale\n>;\n\n// Tool: https://m2.material.io/inline-tools/color/\n\nexport const defaultColorScales: AlouetteColorScales = {\n grayscale: createColorScale({\n 1: \"#faf9f8\",\n 2: \"#f4f3ef\",\n 3: \"#ebe9e5\",\n 4: \"#dedad2\",\n 5: \"#d1cdc5\",\n 6: \"#bab8ae\",\n 7: \"#aeaba3\",\n 8: \"#9c9a92\",\n 9: \"#8e8c83\",\n 10: \"#74726a\",\n }),\n success: createColorScale({\n 1: \"#f0f9f3\",\n 2: \"#d4f0d4\",\n 3: \"#a8e6a8\",\n 4: \"#7edc7e\",\n 5: \"#54d254\",\n 6: \"#2ac82a\",\n 7: \"#00be00\",\n 8: \"#00b400\",\n 9: \"#00aa00\",\n 10: \"#009200\",\n }),\n info: createColorScale({\n 1: \"#f0f9ff\",\n 2: \"#d4f0ff\",\n 3: \"#a8e6ff\",\n 4: \"#7edcff\",\n 5: \"#54d2ff\",\n 6: \"#2ac8ff\",\n 7: \"#00beff\",\n 8: \"#00b4ff\",\n 9: \"#00aaff\",\n 10: \"#0092ff\",\n }),\n warning: createColorScale({\n 1: \"#fff9f0\",\n 2: \"#fff0d4\",\n 3: \"#ffe6a8\",\n 4: \"#ffdc7e\",\n 5: \"#ffd254\",\n 6: \"#ffc82a\",\n 7: \"#ffbe00\",\n 8: \"#ffb400\",\n 9: \"#ffaa00\",\n 10: \"#ff9200\",\n }),\n danger: createColorScale({\n 1: \"#fff0f0\",\n 2: \"#ffd4d4\",\n 3: \"#ffaaaa\",\n 4: \"#ff7e7e\",\n 5: \"#ff5454\",\n 6: \"#ff2a2a\",\n 7: \"#ff0000\",\n 8: \"#f40000\",\n 9: \"#ea0000\",\n 10: \"#d20000\",\n }),\n primary: createColorScale({\n 1: \"#e1f4f6\",\n 2: \"#b4e2e9\",\n 3: \"#86cfdc\",\n 4: \"#60bcd0\",\n 5: \"#46aeca\",\n 6: \"#31a1c4\",\n 7: \"#2994b7\",\n 8: \"#1e82a6\",\n 9: \"#1c7193\",\n 10: \"#125272\",\n }),\n} as const;\n","import { createTamagui } from \"@tamagui/core\";\nimport { animations } from \"./config/animations\";\nimport type { AlouetteColorScales } from \"./config/colorScales\";\nimport type { AlouetteFontsOptions } from \"./config/createAlouetteFonts\";\nimport { createAlouetteFonts } from \"./config/createAlouetteFonts\";\nimport type { createAlouetteTokens } from \"./config/createAlouetteTokens\";\nimport { media } from \"./config/media\";\nimport type { createAlouetteThemes } from \"./config/themes\";\n\nexport { createAlouetteTokens } from \"./config/createAlouetteTokens\";\n\nexport interface AlouetteTamaguiOptions {\n fonts?: AlouetteFontsOptions;\n}\n\nexport {\n createColorTheme,\n createAlouetteThemes,\n type FullTheme,\n} from \"./config/themes\";\n\nexport {\n defaultColorScales,\n createColorScale,\n type AlouetteColorScales,\n type AlouetteColorScale,\n} from \"./config/colorScales\";\n\nexport const createAlouetteTamagui = <\n const ColorScales extends AlouetteColorScales,\n const Tokens extends ReturnType<typeof createAlouetteTokens<ColorScales>>,\n const Themes extends ReturnType<typeof createAlouetteThemes<ColorScales>>,\n>(\n tokens: Tokens,\n themes: Themes,\n options: AlouetteTamaguiOptions = {},\n) => {\n return createTamagui({\n fonts: createAlouetteFonts(options.fonts),\n tokens,\n themes,\n media,\n animations,\n settings: {\n allowedStyleValues: \"somewhat-strict-web\",\n autocompleteSpecificTokens: \"except-special\",\n },\n components: [\"alouette\"],\n } as const);\n};\n"],"names":[],"mappings":";;;AAEO,MAAM,aAAa,gBAAiB,CAAA;AAAA,EACzC,IAAM,EAAA,eAAA;AAAA,EACN,WA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-browser.es.js","sources":["../src/config/animations.web.ts","../src/config/createAlouetteFonts.ts","../src/config/Breakpoints.ts","../src/config/media.ts","../src/config/createAlouetteTokens.ts","../src/config/utils/colorContrast.ts","../src/config/themes.ts","../src/config/colorScales.ts","../src/createAlouetteTamagui.ts"],"sourcesContent":["import { createAnimations } from \"@tamagui/animations-css\";\n\nexport const animations = createAnimations({\n fast: \"ease-in 150ms\",\n formElement: \"ease-in 600ms\",\n});\nconsole.log(\"animations: web\");\n","import { createFont } from \"@tamagui/core\";\n\nconst defaultHeadingFontSizes = { xl: 48, lg: 40, md: 32, sm: 24, xs: 18 };\nconst defaultBodyFontSizes = { xl: 24, lg: 18, md: 16, sm: 14, xs: 12 };\n\nconst roundWith1Precision = (value: number): number =>\n Math.round(value * 10) / 10;\n\nexport interface AlouetteFontsOptions {\n headingFontFamily?: string;\n headingFontSizes?: typeof defaultHeadingFontSizes;\n bodyFontFamily?: string;\n bodyFontSizes?: typeof defaultBodyFontSizes;\n}\n\nexport const createAlouetteFonts = ({\n headingFontFamily = \"Inter\",\n headingFontSizes = defaultHeadingFontSizes,\n bodyFontFamily = \"Inter\",\n bodyFontSizes = defaultBodyFontSizes,\n}: AlouetteFontsOptions = {}) => ({\n heading: createFont({\n family: headingFontFamily,\n weight: {\n regular: \"400\",\n bold: \"700\",\n black: \"900\",\n },\n face: {\n 400: { normal: `${headingFontFamily}Regular` },\n 700: { normal: `${headingFontFamily}Bold` },\n 900: { normal: `${headingFontFamily}Black` },\n },\n size: headingFontSizes,\n lineHeight: {\n xl: roundWith1Precision(1.1 * headingFontSizes.xl),\n lg: roundWith1Precision(1.1 * headingFontSizes.lg),\n md: roundWith1Precision(1.2 * headingFontSizes.md),\n sm: roundWith1Precision(1.3 * headingFontSizes.sm),\n xs: roundWith1Precision(1.3 * headingFontSizes.xs),\n },\n }),\n body: createFont({\n family: bodyFontFamily,\n weight: {\n regular: \"400\",\n bold: \"700\",\n black: \"900\",\n },\n face: {\n 400: { normal: `${bodyFontFamily}Regular` },\n 700: { normal: `${bodyFontFamily}Bold` },\n 900: { normal: `${bodyFontFamily}Black` },\n },\n size: bodyFontSizes,\n lineHeight: {\n xl: roundWith1Precision(1.4 * bodyFontSizes.xl),\n lg: roundWith1Precision(1.4 * bodyFontSizes.lg),\n md: roundWith1Precision(1.4 * bodyFontSizes.md),\n sm: roundWith1Precision(1.4 * bodyFontSizes.sm),\n xs: roundWith1Precision(1.4 * bodyFontSizes.xs),\n },\n }),\n});\n","export const Breakpoints = {\n /**\n * min-width: 0\n */\n BASE: 0,\n /**\n * min-width: 480px\n */\n SMALL: 480,\n /**\n * min-width: 768px\n */\n MEDIUM: 768,\n /**\n * min-width: 1024px\n */\n LARGE: 1024,\n /**\n * min-width: 1280px\n */\n WIDE: 1280,\n} as const;\n\nexport type Breakpoint = (typeof Breakpoints)[keyof typeof Breakpoints];\nexport type BreakpointNames = \"base\" | \"large\" | \"medium\" | \"small\" | \"wide\";\n\nexport enum BreakpointNameEnum {\n BASE = \"base\",\n SMALL = \"small\",\n MEDIUM = \"medium\",\n LARGE = \"large\",\n WIDE = \"wide\",\n}\n","import { Breakpoints } from \"./Breakpoints\";\n\nexport const media = {\n small: { minWidth: Breakpoints.SMALL },\n medium: { minWidth: Breakpoints.MEDIUM },\n large: { minWidth: Breakpoints.LARGE },\n wide: { minWidth: Breakpoints.WIDE },\n} as const;\n","import { createTokens } from \"@tamagui/core\";\nimport type { IntRange } from \"type-fest\";\nimport type {\n AlouetteColorScaleNumber,\n AlouetteColorScales,\n} from \"./colorScales\";\n\ntype AlouetteSize = IntRange<0, 64>;\ntype NegativeAlouetteSize = `-${AlouetteSize}`;\ntype AlouetteSizeRecord = Record<AlouetteSize, number>;\ntype NegativeAlouetteSizeRecord = Record<NegativeAlouetteSize, number>;\n\nconst createAlouetteSizes = <const N extends boolean>(\n spacing: number,\n negative: N,\n): N extends true ? NegativeAlouetteSizeRecord : AlouetteSizeRecord => {\n const MAX_SIZE = 64;\n const sizes: Partial<\n N extends true ? NegativeAlouetteSizeRecord : AlouetteSizeRecord\n > = {};\n for (let size = 0; size <= MAX_SIZE; size++) {\n (sizes as any)[negative ? `-${size}` : `${size}`] = size * spacing;\n }\n return sizes as N extends true\n ? NegativeAlouetteSizeRecord\n : AlouetteSizeRecord;\n};\n\ntype ColorScaleTokens<ColorScales extends AlouetteColorScales> = {\n [K in string &\n keyof ColorScales as `${K}.${AlouetteColorScaleNumber}`]: string; //(typeof colorScales)[K][AlouetteColorScaleNumber];\n};\n\nconst transformColorScalesToTokens = <ColorScales extends AlouetteColorScales>(\n colorScales: ColorScales,\n): ColorScaleTokens<ColorScales> => {\n return Object.fromEntries(\n Object.entries(colorScales).flatMap(([colorName, colorScale]) => {\n return Object.entries(colorScale).map(([scaleNumber, colorValue]) => {\n return [`${colorName}.${scaleNumber}`, colorValue];\n });\n }),\n ) as ColorScaleTokens<ColorScales>;\n};\n\nexport interface AlouetteTokensOptions {\n spacing?: number;\n}\n\nexport const createAlouetteTokens = <\n const ColorScales extends AlouetteColorScales,\n>(\n colorScales: ColorScales,\n { spacing = 4 }: AlouetteTokensOptions = {},\n) => {\n const sizes: AlouetteSizeRecord = createAlouetteSizes(spacing, false);\n const negativeSizes: NegativeAlouetteSizeRecord = createAlouetteSizes(\n -spacing,\n true,\n );\n\n return createTokens({\n color: {\n black: \"#000000\",\n white: \"#ffffff\",\n ...transformColorScalesToTokens(colorScales),\n },\n radius: {\n ...sizes,\n xs: spacing * 2,\n sm: spacing * 4,\n md: spacing * 8,\n },\n space: {\n ...sizes,\n ...negativeSizes,\n xs: spacing * 2,\n sm: spacing * 4,\n md: spacing * 8,\n },\n size: { ...sizes },\n zIndex: {},\n } as const);\n};\n","/**\n * Calculates relative luminance of a color\n * Based on WCAG 2.0 formula: https://www.w3.org/TR/WCAG20/#relativeluminancedef\n */\nconst getLuminance = (r: number, g: number, b: number) => {\n const values: [number, number, number] = [r, g, b].map((c) => {\n const s = c / 255;\n return s <= 0.039_28 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;\n }) as [number, number, number];\n\n return 0.2126 * values[0] + 0.7152 * values[1] + 0.0722 * values[2];\n};\n\n/**\n * Converts hex color to RGB values\n */\nconst hexToRgb = (hex: string) => {\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n if (!result?.[1] || !result[2] || !result[3]) return null;\n return {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16),\n };\n};\n\n/**\n * Calculates contrast ratio between two colors\n * Returns ratio between 1 and 21\n */\nexport const getContrastRatio = (color1: string, color2: string) => {\n const rgb1 = hexToRgb(color1);\n const rgb2 = hexToRgb(color2);\n\n if (!rgb1 || !rgb2) return 0;\n\n const l1 = getLuminance(rgb1.r, rgb1.g, rgb1.b);\n const l2 = getLuminance(rgb2.r, rgb2.g, rgb2.b);\n\n const lighter = Math.max(l1, l2);\n const darker = Math.min(l1, l2);\n\n return (lighter + 0.05) / (darker + 0.05);\n};\n\n/**\n * Checks if contrast ratio meets WCAG requirements\n */\nexport const checkContrast = (\n foreground: string,\n background: string,\n level: \"AA\" | \"AAA\" = \"AA\",\n) => {\n const ratio = getContrastRatio(foreground, background);\n const minimumRatio = level === \"AA\" ? 4.5 : 7;\n\n return {\n ratio,\n passes: ratio >= minimumRatio,\n minimumRatio,\n };\n};\n\n/**\n * Development warning for contrast issues\n */\nexport const warnOnContrastIssues = (\n themeName: string,\n textColor: string,\n backgroundColor: string,\n) => {\n if (process.env.NODE_ENV !== \"development\") return;\n\n const result = checkContrast(textColor, backgroundColor);\n\n if (!result.passes) {\n console.warn(\n `[Alouette] Contrast warning in theme \"${themeName}\":\n Text color ${textColor} on background ${backgroundColor}\n has contrast ratio of ${result.ratio.toFixed(2)}.\n Minimum required: ${result.minimumRatio}\n This may cause accessibility issues.`,\n );\n }\n};\n","/* eslint-disable camelcase */\nimport type { Variable } from \"@tamagui/core\";\nimport type {\n AlouetteColorScaleNumber,\n AlouetteColorScales,\n} from \"./colorScales\";\nimport type { createAlouetteTokens } from \"./createAlouetteTokens\";\nimport { warnOnContrastIssues } from \"./utils/colorContrast\";\n\n// export interface MinimalRootTheme {\n// backgroundColor: Variable<string>;\n// textColor: Variable<string>;\n// }\n\n// export interface RootTheme {\n// backgroundColor: Variable<string>;\n// textColor: Variable<string>;\n// }\n\nexport interface ColorTheme {\n backgroundColor: Variable<string>;\n textColor: Variable<string>;\n contrastTextColor: Variable<string>;\n \"textColor:disabled\": Variable<string>;\n \"contrastTextColor:disabled\": Variable<string>;\n mainColor: Variable<string>;\n mainTextColor: Variable<string>;\n borderColor: Variable<string>;\n contrastBorderColor: Variable<string>;\n shadowColor: Variable<string>;\n\n \"interactive.linkTextColor\": Variable<string>;\n \"interactive.linkTextColor:hover\": Variable<string>;\n \"interactive.linkTextColor:focus\": Variable<string>;\n \"interactive.linkTextColor:press\": Variable<string>;\n \"interactive.linkTextColor:disabled\": Variable<string>;\n\n \"interactive.contained.backgroundColor\": Variable<string>;\n \"interactive.elevated.backgroundColor\": Variable<string>;\n \"interactive.elevated.shadowColor\": Variable<string>;\n \"interactive.elevated.borderColor\": Variable<string>;\n \"interactive.outlined.backgroundColor\": Variable<string>;\n \"interactive.outlined.borderColor\": Variable<string>;\n\n \"interactive.contained.backgroundColor:hover\": Variable<string>;\n \"interactive.elevated.backgroundColor:hover\": Variable<string>;\n \"interactive.elevated.borderColor:hover\": Variable<string>;\n \"interactive.outlined.backgroundColor:hover\": Variable<string>;\n \"interactive.outlined.borderColor:hover\": Variable<string>;\n\n \"interactive.contained.backgroundColor:focus\": Variable<string>;\n \"interactive.elevated.backgroundColor:focus\": Variable<string>;\n \"interactive.elevated.borderColor:focus\": Variable<string>;\n \"interactive.outlined.backgroundColor:focus\": Variable<string>;\n \"interactive.outlined.borderColor:focus\": Variable<string>;\n\n \"interactive.contained.backgroundColor:press\": Variable<string>;\n \"interactive.elevated.backgroundColor:press\": Variable<string>;\n \"interactive.elevated.borderColor:press\": Variable<string>;\n \"interactive.outlined.backgroundColor:press\": Variable<string>;\n \"interactive.outlined.borderColor:press\": Variable<string>;\n\n \"interactive.contained.backgroundColor:disabled\": Variable<string>;\n \"interactive.elevated.backgroundColor:disabled\": Variable<string>;\n \"interactive.elevated.shadowColor:disabled\": Variable<string>;\n \"interactive.elevated.borderColor:disabled\": Variable<string>;\n \"interactive.outlined.backgroundColor:disabled\": Variable<string>;\n \"interactive.outlined.borderColor:disabled\": Variable<string>;\n \"interactive.textColor:disabled\": Variable<string>;\n\n \"interactive.forms.textColor\": Variable<string>;\n \"interactive.forms.placeholderTextColor\": Variable<string>;\n // \"interactive.forms.backgroundColor\": Variable<string>,\n // \"interactive.forms.backgroundColor:hover\": Variable<string>,\n \"interactive.forms.backgroundColor:focus\": Variable<string>;\n \"interactive.forms.backgroundColor:press\": Variable<string>;\n \"interactive.forms.borderColor\": Variable<string>;\n \"interactive.forms.borderColor:hover\": Variable<string>;\n \"interactive.forms.borderColor:focus\": Variable<string>;\n \"interactive.forms.borderColor:press\": Variable<string>;\n \"interactive.forms.borderColor:disabled\": Variable<string>;\n}\n\n// export interface FullTheme extends ColorTheme, RootTheme {}\nexport type FullTheme = ColorTheme;\n\n// export const createRootTheme = <T extends MinimalRootTheme>(\n// theme: T,\n// ): FullTheme => {\n// return theme satisfies RootTheme as unknown as FullTheme;\n// };\n\nconst darkModeScaleNumbers: Record<\n AlouetteColorScaleNumber,\n AlouetteColorScaleNumber\n> = {\n 1: 10,\n 2: 9,\n 3: 8,\n 4: 7,\n 5: 6,\n 6: 5,\n 7: 4,\n 8: 3,\n 9: 2,\n 10: 1,\n};\n\nexport const createColorTheme = <const ColorScales extends AlouetteColorScales>(\n tokens: ReturnType<typeof createAlouetteTokens<ColorScales>>,\n colorScaleName: string & keyof ColorScales,\n mode: \"dark\" | \"light\" = \"light\",\n backgroundColor?: Variable<string>,\n textColor?: Variable<string>,\n contrastTextColor?: Variable<string>,\n) => {\n const alouetteTokens: ReturnType<\n typeof createAlouetteTokens<AlouetteColorScales>\n > = tokens;\n if (!backgroundColor) {\n backgroundColor =\n mode === \"dark\" ? alouetteTokens.color.black : alouetteTokens.color.white;\n }\n if (!textColor) {\n textColor =\n mode === \"dark\" ? alouetteTokens.color.white : alouetteTokens.color.black;\n }\n if (!contrastTextColor) {\n if (colorScaleName === \"grayscale\") {\n contrastTextColor =\n mode === \"dark\"\n ? alouetteTokens.color.white\n : alouetteTokens.color.black;\n } else {\n contrastTextColor =\n mode === \"dark\"\n ? alouetteTokens.color.black\n : alouetteTokens.color.white;\n }\n }\n\n const getColor = (\n lightScaleNumber: AlouetteColorScaleNumber,\n forceScaleNumber = colorScaleName,\n ) => {\n // Invert scale for dark mode\n const scaleNumber =\n mode === \"dark\"\n ? darkModeScaleNumbers[lightScaleNumber]\n : lightScaleNumber;\n\n return tokens.color[\n `${forceScaleNumber}.${scaleNumber}` as keyof typeof tokens.color\n ];\n };\n\n const contrastBorderColor = contrastTextColor;\n\n const theme = {\n backgroundColor,\n textColor,\n mainColor: getColor(6),\n mainTextColor: getColor(9),\n contrastTextColor,\n borderColor: getColor(8),\n contrastBorderColor,\n shadowColor: getColor(9),\n \"textColor:disabled\": getColor(3, \"grayscale\"),\n \"contrastTextColor:disabled\": getColor(7, \"grayscale\"),\n\n \"interactive.linkTextColor\": getColor(9),\n \"interactive.linkTextColor:hover\": getColor(7),\n \"interactive.linkTextColor:focus\": getColor(7),\n \"interactive.linkTextColor:press\": getColor(7),\n \"interactive.linkTextColor:disabled\": getColor(3, \"grayscale\"),\n\n \"interactive.contained.backgroundColor\": getColor(5),\n \"interactive.elevated.backgroundColor\": backgroundColor,\n \"interactive.elevated.shadowColor\": getColor(9),\n \"interactive.elevated.borderColor\": contrastBorderColor,\n \"interactive.outlined.backgroundColor\": backgroundColor,\n \"interactive.outlined.borderColor\": getColor(mode === \"dark\" ? 5 : 8),\n\n \"interactive.contained.backgroundColor:hover\": getColor(4),\n \"interactive.elevated.backgroundColor:hover\": getColor(1),\n \"interactive.elevated.borderColor:hover\": contrastBorderColor,\n \"interactive.outlined.backgroundColor:hover\": getColor(1),\n \"interactive.outlined.borderColor:hover\": getColor(mode === \"dark\" ? 5 : 7),\n\n \"interactive.contained.backgroundColor:focus\": getColor(4),\n \"interactive.elevated.backgroundColor:focus\": getColor(1),\n \"interactive.elevated.borderColor:focus\": contrastBorderColor,\n \"interactive.outlined.backgroundColor:focus\": getColor(1),\n \"interactive.outlined.borderColor:focus\": getColor(7),\n\n \"interactive.contained.backgroundColor:press\": getColor(2),\n \"interactive.elevated.backgroundColor:press\": getColor(3),\n \"interactive.elevated.borderColor:press\": contrastBorderColor,\n \"interactive.outlined.backgroundColor:press\": getColor(3),\n \"interactive.outlined.borderColor:press\": getColor(7),\n\n \"interactive.contained.backgroundColor:disabled\": getColor(3, \"grayscale\"),\n \"interactive.elevated.backgroundColor:disabled\": backgroundColor,\n \"interactive.elevated.shadowColor:disabled\": getColor(9, \"grayscale\"),\n \"interactive.elevated.borderColor:disabled\": getColor(3, \"grayscale\"),\n \"interactive.outlined.backgroundColor:disabled\": backgroundColor,\n \"interactive.outlined.borderColor:disabled\": getColor(3, \"grayscale\"),\n \"interactive.textColor:disabled\": getColor(7, \"grayscale\"),\n\n \"interactive.forms.textColor\": textColor,\n \"interactive.forms.placeholderTextColor\": getColor(3, \"grayscale\"),\n\n // \"interactive.forms.backgroundColor\": undefined,\n // \"interactive.forms.backgroundColor:hover\": undefined,\n \"interactive.forms.backgroundColor:focus\": getColor(1),\n \"interactive.forms.backgroundColor:press\": getColor(3),\n \"interactive.forms.borderColor\": getColor(10),\n \"interactive.forms.borderColor:hover\": getColor(7),\n \"interactive.forms.borderColor:focus\": getColor(7),\n \"interactive.forms.borderColor:press\": getColor(7),\n \"interactive.forms.borderColor:disabled\": getColor(3, \"grayscale\"),\n } satisfies FullTheme;\n\n if (process.env.NODE_ENV === \"development\") {\n // Check main text contrast\n warnOnContrastIssues(\n colorScaleName,\n theme.textColor.val,\n theme.backgroundColor.val,\n );\n }\n\n return theme;\n};\n\nexport const createAlouetteThemes = <\n const ColorScales extends AlouetteColorScales,\n>(\n tokens: ReturnType<typeof createAlouetteTokens<ColorScales>>,\n) => {\n const alouetteTokens: ReturnType<\n typeof createAlouetteTokens<AlouetteColorScales>\n > = tokens;\n return {\n light: createColorTheme(alouetteTokens, \"grayscale\", \"light\"),\n light_info: createColorTheme(alouetteTokens, \"info\", \"light\"),\n light_success: createColorTheme(alouetteTokens, \"success\", \"light\"),\n light_warning: createColorTheme(alouetteTokens, \"warning\", \"light\"),\n light_danger: createColorTheme(alouetteTokens, \"danger\", \"light\"),\n light_primary: createColorTheme(alouetteTokens, \"primary\", \"light\"),\n\n dark: createColorTheme(alouetteTokens, \"grayscale\", \"dark\"),\n dark_info: createColorTheme(alouetteTokens, \"info\", \"dark\"),\n dark_success: createColorTheme(alouetteTokens, \"success\", \"dark\"),\n dark_warning: createColorTheme(alouetteTokens, \"warning\", \"dark\"),\n dark_danger: createColorTheme(alouetteTokens, \"danger\", \"dark\"),\n dark_primary: createColorTheme(alouetteTokens, \"primary\", \"dark\"),\n } as const;\n};\n","import type { IntRange } from \"type-fest\";\n\n// scale inspired by https://www.radix-ui.com/colors/docs/palette-composition/understanding-the-scale\n// 1: interactive outlined background hover/focus color\n// 2: interactive contained background press color\n// 3: interactive outlined background press color\n// 4: interactive contained background hover/focus color\n// 5: interactive contained background color\n// 6: main color\n// 7: border hover/focus color\n// 8: border color\n// 9: text color / shadow color\n// 10: form border color (default)\n\nexport type AlouetteColorScaleNumber = IntRange<1, 11>;\n\nexport type AlouetteColorScale = Record<AlouetteColorScaleNumber, string>;\n\nexport const createColorScale = <const T extends AlouetteColorScale>(\n colorScale: T,\n): T => colorScale;\n\nexport type AlouetteColorScaleNames =\n | \"danger\"\n | \"grayscale\"\n | \"info\"\n | \"primary\"\n | \"success\"\n | \"warning\";\n\nexport type ColorScaleTokens = {\n [K in AlouetteColorScaleNames as `${K}.${AlouetteColorScaleNumber}`]: string; //(typeof colorScales)[K][AlouetteColorScaleNumber];\n};\n\nexport type AlouetteColorScales = Record<\n AlouetteColorScaleNames,\n AlouetteColorScale\n>;\n\n// Tool: https://m2.material.io/inline-tools/color/\n\nexport const defaultColorScales: AlouetteColorScales = {\n grayscale: createColorScale({\n 1: \"#faf9f8\",\n 2: \"#f4f3ef\",\n 3: \"#ebe9e5\",\n 4: \"#dedad2\",\n 5: \"#d1cdc5\",\n 6: \"#bab8ae\",\n 7: \"#aeaba3\",\n 8: \"#9c9a92\",\n 9: \"#8e8c83\",\n 10: \"#74726a\",\n }),\n success: createColorScale({\n 1: \"#f0f9f3\",\n 2: \"#d4f0d4\",\n 3: \"#a8e6a8\",\n 4: \"#7edc7e\",\n 5: \"#54d254\",\n 6: \"#2ac82a\",\n 7: \"#00be00\",\n 8: \"#00b400\",\n 9: \"#00aa00\",\n 10: \"#009200\",\n }),\n info: createColorScale({\n 1: \"#f0f9ff\",\n 2: \"#d4f0ff\",\n 3: \"#a8e6ff\",\n 4: \"#7edcff\",\n 5: \"#54d2ff\",\n 6: \"#2ac8ff\",\n 7: \"#00beff\",\n 8: \"#00b4ff\",\n 9: \"#00aaff\",\n 10: \"#0092ff\",\n }),\n warning: createColorScale({\n 1: \"#fff9f0\",\n 2: \"#fff0d4\",\n 3: \"#ffe6a8\",\n 4: \"#ffdc7e\",\n 5: \"#ffd254\",\n 6: \"#ffc82a\",\n 7: \"#ffbe00\",\n 8: \"#ffb400\",\n 9: \"#ffaa00\",\n 10: \"#ff9200\",\n }),\n danger: createColorScale({\n 1: \"#fff0f0\",\n 2: \"#ffd4d4\",\n 3: \"#ffaaaa\",\n 4: \"#ff7e7e\",\n 5: \"#ff5454\",\n 6: \"#ff2a2a\",\n 7: \"#ff0000\",\n 8: \"#f40000\",\n 9: \"#ea0000\",\n 10: \"#d20000\",\n }),\n primary: createColorScale({\n 1: \"#e1f4f6\",\n 2: \"#b4e2e9\",\n 3: \"#86cfdc\",\n 4: \"#60bcd0\",\n 5: \"#46aeca\",\n 6: \"#31a1c4\",\n 7: \"#2994b7\",\n 8: \"#1e82a6\",\n 9: \"#1c7193\",\n 10: \"#125272\",\n }),\n} as const;\n","import { createTamagui } from \"@tamagui/core\";\nimport { animations } from \"./config/animations\";\nimport type { AlouetteColorScales } from \"./config/colorScales\";\nimport type { AlouetteFontsOptions } from \"./config/createAlouetteFonts\";\nimport { createAlouetteFonts } from \"./config/createAlouetteFonts\";\nimport type { createAlouetteTokens } from \"./config/createAlouetteTokens\";\nimport { media } from \"./config/media\";\nimport type { createAlouetteThemes } from \"./config/themes\";\n\nexport { createAlouetteTokens } from \"./config/createAlouetteTokens\";\n\nexport interface AlouetteTamaguiOptions {\n fonts?: AlouetteFontsOptions;\n}\n\nexport {\n createColorTheme,\n createAlouetteThemes,\n type FullTheme,\n} from \"./config/themes\";\n\nexport {\n defaultColorScales,\n createColorScale,\n type AlouetteColorScales,\n type AlouetteColorScale,\n} from \"./config/colorScales\";\n\nexport const createAlouetteTamagui = <\n const ColorScales extends AlouetteColorScales,\n const Tokens extends ReturnType<typeof createAlouetteTokens<ColorScales>>,\n const Themes extends ReturnType<typeof createAlouetteThemes<ColorScales>>,\n>(\n tokens: Tokens,\n themes: Themes,\n options: AlouetteTamaguiOptions = {},\n) => {\n return createTamagui({\n fonts: createAlouetteFonts(options.fonts),\n tokens,\n themes,\n media,\n animations,\n settings: {\n allowedStyleValues: \"somewhat-strict-web\",\n autocompleteSpecificTokens: \"except-special\",\n },\n components: [\"alouette\"],\n } as const);\n};\n"],"names":[],"mappings":";;;AAEO,MAAM,aAAa,gBAAA,CAAiB;AAAA,EACzC,IAAA,EAAM,eAAA;AAAA,EACN,WAAA,EAAa;AACf,CAAC,CAAA;AACD,OAAA,CAAQ,IAAI,iBAAiB,CAAA;;ACJ7B,MAAM,uBAAA,GAA0B,EAAE,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAA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A,EAAG,SAAA;AAAA,IACH,CAAA,EAAG,SAAA;AAAA,IACH,CAAA,EAAG,SAAA;AAAA,IACH,CAAA,EAAG,SAAA;AAAA,IACH,EAAA,EAAI;AAAA,GACL,CAAA;AAAA,EACD,SAAS,gBAAA,CAAiB;AAAA,IACxB,CAAA,EAAG,SAAA;AAAA,IACH,CAAA,EAAG,SAAA;AAAA,IACH,CAAA,EAAG,SAAA;AAAA,IACH,CAAA,EAAG,SAAA;AAAA,IACH,CAAA,EAAG,SAAA;AAAA,IACH,CAAA,EAAG,SAAA;AAAA,IACH,CAAA,EAAG,SAAA;AAAA,IACH,CAAA,EAAG,SAAA;AAAA,IACH,CAAA,EAAG,SAAA;AAAA,IACH,EAAA,EAAI;AAAA,GACL;AACH;;ACtFO,MAAM,wBAAwB,CAKnC,MAAA,EACA,MAAA,EACA,OAAA,GAAkC,EAAC,KAChC;AACH,EAAA,OAAO,aAAA,CAAc;AAAA,IACnB,KAAA,EAAO,mBAAA,CAAoB,OAAA,CAAQ,KAAK,CAAA;AAAA,IACxC,MAAA;AAAA,IACA,MAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA,EAAU;AAAA,MACR,kBAAA,EAAoB,qBAAA;AAAA,MACpB,0BAAA,EAA4B;AAAA,KAC9B;AAAA,IACA,UAAA,EAAY,CAAC,UAAU;AAAA,GACf,CAAA;AACZ;;;;"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
3
5
|
const core = require('@tamagui/core');
|
|
4
6
|
const animationsReactNative = require('@tamagui/animations-react-native');
|
|
5
7
|
|
|
@@ -19,9 +21,12 @@ const animations = animationsReactNative.createAnimations({
|
|
|
19
21
|
});
|
|
20
22
|
if ("navigator" in global) {
|
|
21
23
|
const navigator = global.navigator;
|
|
22
|
-
if (
|
|
24
|
+
if (
|
|
25
|
+
// eslint-disable-next-line n/no-unsupported-features/node-builtins
|
|
26
|
+
!navigator.userAgent?.startsWith("Node.js") && navigator.product !== "ReactNative"
|
|
27
|
+
) {
|
|
23
28
|
throw new Error(
|
|
24
|
-
`animations native is loaded in web: ${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
29
|
+
`animations native is loaded in web: ${// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, n/no-unsupported-features/node-builtins
|
|
25
30
|
navigator.appName || navigator.product || navigator.userAgent}`
|
|
26
31
|
);
|
|
27
32
|
}
|
|
@@ -81,10 +86,6 @@ const createAlouetteFonts = ({
|
|
|
81
86
|
});
|
|
82
87
|
|
|
83
88
|
const Breakpoints = {
|
|
84
|
-
/**
|
|
85
|
-
* min-width: 0
|
|
86
|
-
*/
|
|
87
|
-
BASE: 0,
|
|
88
89
|
/**
|
|
89
90
|
* min-width: 480px
|
|
90
91
|
*/
|
|
@@ -157,6 +158,55 @@ const createAlouetteTokens = (colorScales, { spacing = 4 } = {}) => {
|
|
|
157
158
|
});
|
|
158
159
|
};
|
|
159
160
|
|
|
161
|
+
const getLuminance = (r, g, b) => {
|
|
162
|
+
const values = [r, g, b].map((c) => {
|
|
163
|
+
const s = c / 255;
|
|
164
|
+
return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
|
|
165
|
+
});
|
|
166
|
+
return 0.2126 * values[0] + 0.7152 * values[1] + 0.0722 * values[2];
|
|
167
|
+
};
|
|
168
|
+
const hexToRgb = (hex) => {
|
|
169
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
170
|
+
if (!result?.[1] || !result[2] || !result[3]) return null;
|
|
171
|
+
return {
|
|
172
|
+
r: parseInt(result[1], 16),
|
|
173
|
+
g: parseInt(result[2], 16),
|
|
174
|
+
b: parseInt(result[3], 16)
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
const getContrastRatio = (color1, color2) => {
|
|
178
|
+
const rgb1 = hexToRgb(color1);
|
|
179
|
+
const rgb2 = hexToRgb(color2);
|
|
180
|
+
if (!rgb1 || !rgb2) return 0;
|
|
181
|
+
const l1 = getLuminance(rgb1.r, rgb1.g, rgb1.b);
|
|
182
|
+
const l2 = getLuminance(rgb2.r, rgb2.g, rgb2.b);
|
|
183
|
+
const lighter = Math.max(l1, l2);
|
|
184
|
+
const darker = Math.min(l1, l2);
|
|
185
|
+
return (lighter + 0.05) / (darker + 0.05);
|
|
186
|
+
};
|
|
187
|
+
const checkContrast = (foreground, background, level = "AA") => {
|
|
188
|
+
const ratio = getContrastRatio(foreground, background);
|
|
189
|
+
const minimumRatio = level === "AA" ? 4.5 : 7;
|
|
190
|
+
return {
|
|
191
|
+
ratio,
|
|
192
|
+
passes: ratio >= minimumRatio,
|
|
193
|
+
minimumRatio
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
const warnOnContrastIssues = (themeName, textColor, backgroundColor) => {
|
|
197
|
+
if (process.env.NODE_ENV !== "development") return;
|
|
198
|
+
const result = checkContrast(textColor, backgroundColor);
|
|
199
|
+
if (!result.passes) {
|
|
200
|
+
console.warn(
|
|
201
|
+
`[Alouette] Contrast warning in theme "${themeName}":
|
|
202
|
+
Text color ${textColor} on background ${backgroundColor}
|
|
203
|
+
has contrast ratio of ${result.ratio.toFixed(2)}.
|
|
204
|
+
Minimum required: ${result.minimumRatio}
|
|
205
|
+
This may cause accessibility issues.`
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
|
|
160
210
|
const darkModeScaleNumbers = {
|
|
161
211
|
1: 10,
|
|
162
212
|
2: 9,
|
|
@@ -188,28 +238,50 @@ const createColorTheme = (tokens, colorScaleName, mode = "light", backgroundColo
|
|
|
188
238
|
const scaleNumber = mode === "dark" ? darkModeScaleNumbers[lightScaleNumber] : lightScaleNumber;
|
|
189
239
|
return tokens.color[`${forceScaleNumber}.${scaleNumber}`];
|
|
190
240
|
};
|
|
191
|
-
|
|
241
|
+
const contrastBorderColor = contrastTextColor;
|
|
242
|
+
const theme = {
|
|
192
243
|
backgroundColor,
|
|
193
244
|
textColor,
|
|
194
245
|
mainColor: getColor(6),
|
|
195
246
|
mainTextColor: getColor(9),
|
|
196
247
|
contrastTextColor,
|
|
197
248
|
borderColor: getColor(8),
|
|
249
|
+
contrastBorderColor,
|
|
250
|
+
shadowColor: getColor(9),
|
|
198
251
|
"textColor:disabled": getColor(3, "grayscale"),
|
|
199
252
|
"contrastTextColor:disabled": getColor(7, "grayscale"),
|
|
253
|
+
"interactive.linkTextColor": getColor(9),
|
|
254
|
+
"interactive.linkTextColor:hover": getColor(7),
|
|
255
|
+
"interactive.linkTextColor:focus": getColor(7),
|
|
256
|
+
"interactive.linkTextColor:press": getColor(7),
|
|
257
|
+
"interactive.linkTextColor:disabled": getColor(3, "grayscale"),
|
|
200
258
|
"interactive.contained.backgroundColor": getColor(5),
|
|
201
|
-
"interactive.
|
|
259
|
+
"interactive.elevated.backgroundColor": backgroundColor,
|
|
260
|
+
"interactive.elevated.shadowColor": getColor(9),
|
|
261
|
+
"interactive.elevated.borderColor": contrastBorderColor,
|
|
262
|
+
"interactive.outlined.backgroundColor": backgroundColor,
|
|
263
|
+
"interactive.outlined.borderColor": getColor(mode === "dark" ? 5 : 8),
|
|
202
264
|
"interactive.contained.backgroundColor:hover": getColor(4),
|
|
265
|
+
"interactive.elevated.backgroundColor:hover": getColor(1),
|
|
266
|
+
"interactive.elevated.borderColor:hover": contrastBorderColor,
|
|
203
267
|
"interactive.outlined.backgroundColor:hover": getColor(1),
|
|
204
|
-
"interactive.borderColor:hover": getColor(mode === "dark" ? 5 : 7),
|
|
268
|
+
"interactive.outlined.borderColor:hover": getColor(mode === "dark" ? 5 : 7),
|
|
205
269
|
"interactive.contained.backgroundColor:focus": getColor(4),
|
|
270
|
+
"interactive.elevated.backgroundColor:focus": getColor(1),
|
|
271
|
+
"interactive.elevated.borderColor:focus": contrastBorderColor,
|
|
206
272
|
"interactive.outlined.backgroundColor:focus": getColor(1),
|
|
207
|
-
"interactive.borderColor:focus": getColor(7),
|
|
273
|
+
"interactive.outlined.borderColor:focus": getColor(7),
|
|
208
274
|
"interactive.contained.backgroundColor:press": getColor(2),
|
|
275
|
+
"interactive.elevated.backgroundColor:press": getColor(3),
|
|
276
|
+
"interactive.elevated.borderColor:press": contrastBorderColor,
|
|
209
277
|
"interactive.outlined.backgroundColor:press": getColor(3),
|
|
210
|
-
"interactive.borderColor:press": getColor(7),
|
|
278
|
+
"interactive.outlined.borderColor:press": getColor(7),
|
|
211
279
|
"interactive.contained.backgroundColor:disabled": getColor(3, "grayscale"),
|
|
212
|
-
"interactive.
|
|
280
|
+
"interactive.elevated.backgroundColor:disabled": backgroundColor,
|
|
281
|
+
"interactive.elevated.shadowColor:disabled": getColor(9, "grayscale"),
|
|
282
|
+
"interactive.elevated.borderColor:disabled": getColor(3, "grayscale"),
|
|
283
|
+
"interactive.outlined.backgroundColor:disabled": backgroundColor,
|
|
284
|
+
"interactive.outlined.borderColor:disabled": getColor(3, "grayscale"),
|
|
213
285
|
"interactive.textColor:disabled": getColor(7, "grayscale"),
|
|
214
286
|
"interactive.forms.textColor": textColor,
|
|
215
287
|
"interactive.forms.placeholderTextColor": getColor(3, "grayscale"),
|
|
@@ -223,6 +295,14 @@ const createColorTheme = (tokens, colorScaleName, mode = "light", backgroundColo
|
|
|
223
295
|
"interactive.forms.borderColor:press": getColor(7),
|
|
224
296
|
"interactive.forms.borderColor:disabled": getColor(3, "grayscale")
|
|
225
297
|
};
|
|
298
|
+
if (process.env.NODE_ENV === "development") {
|
|
299
|
+
warnOnContrastIssues(
|
|
300
|
+
colorScaleName,
|
|
301
|
+
theme.textColor.val,
|
|
302
|
+
theme.backgroundColor.val
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
return theme;
|
|
226
306
|
};
|
|
227
307
|
const createAlouetteThemes = (tokens) => {
|
|
228
308
|
const alouetteTokens = tokens;
|