alouette 7.0.0-beta.2 → 7.0.0-beta.21
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/README.md +7 -1
- package/dist/createAlouetteTamagui-browser.es.js +105 -95
- package/dist/createAlouetteTamagui-browser.es.js.map +1 -1
- package/dist/createAlouetteTamagui-node18.mjs +105 -95
- package/dist/createAlouetteTamagui-node18.mjs.map +1 -1
- package/dist/createAlouetteTamagui-react-native.cjs.js +107 -94
- package/dist/createAlouetteTamagui-react-native.cjs.js.map +1 -1
- package/dist/definitions/components/actions/Button.d.ts +20 -0
- package/dist/definitions/components/actions/Button.d.ts.map +1 -0
- package/dist/definitions/components/actions/Button.stories.d.ts +10 -0
- package/dist/definitions/components/actions/Button.stories.d.ts.map +1 -0
- package/dist/definitions/components/actions/IconButton.d.ts +18 -0
- package/dist/definitions/components/actions/IconButton.d.ts.map +1 -0
- package/dist/definitions/components/actions/IconButton.stories.d.ts +10 -0
- package/dist/definitions/components/actions/IconButton.stories.d.ts.map +1 -0
- package/dist/definitions/components/containers/Box.d.ts +13 -0
- package/dist/definitions/components/containers/Box.d.ts.map +1 -0
- package/dist/definitions/components/containers/Box.stories.d.ts +18 -0
- package/dist/definitions/components/containers/Box.stories.d.ts.map +1 -0
- package/dist/definitions/components/containers/PressableBox.d.ts +12 -0
- package/dist/definitions/components/containers/PressableBox.d.ts.map +1 -0
- package/dist/definitions/components/containers/PressableBox.stories.d.ts +18 -0
- package/dist/definitions/components/containers/PressableBox.stories.d.ts.map +1 -0
- package/dist/definitions/components/containers/variants.d.ts +61 -0
- package/dist/definitions/components/containers/variants.d.ts.map +1 -0
- package/dist/definitions/components/feedback/FeedbackIcon.d.ts +8 -0
- package/dist/definitions/components/feedback/FeedbackIcon.d.ts.map +1 -0
- package/dist/definitions/components/feedback/Message.d.ts +25 -0
- package/dist/definitions/components/feedback/Message.d.ts.map +1 -0
- package/dist/definitions/components/feedback/Message.stories.d.ts +10 -0
- package/dist/definitions/components/feedback/Message.stories.d.ts.map +1 -0
- package/dist/definitions/components/forms/InputText.d.ts +23 -0
- package/dist/definitions/components/forms/InputText.d.ts.map +1 -0
- package/dist/definitions/components/forms/InputText.stories.d.ts +16 -0
- package/dist/definitions/components/forms/InputText.stories.d.ts.map +1 -0
- package/dist/definitions/components/layout/Separator.d.ts +6 -0
- package/dist/definitions/components/layout/Separator.d.ts.map +1 -0
- package/dist/definitions/components/layout/Separator.stories.d.ts +10 -0
- package/dist/definitions/components/layout/Separator.stories.d.ts.map +1 -0
- package/dist/definitions/components/layout/list.d.ts +7 -0
- package/dist/definitions/components/layout/list.d.ts.map +1 -0
- package/dist/definitions/components/layout/list.stories.d.ts +7 -0
- package/dist/definitions/components/layout/list.stories.d.ts.map +1 -0
- package/dist/definitions/components/primitives/Icon.d.ts +14 -0
- package/dist/definitions/components/primitives/Icon.d.ts.map +1 -0
- package/dist/definitions/components/primitives/Icon.stories.d.ts +9 -0
- package/dist/definitions/components/primitives/Icon.stories.d.ts.map +1 -0
- package/dist/definitions/components/primitives/ScrollView.d.ts +14 -0
- package/dist/definitions/components/primitives/ScrollView.d.ts.map +1 -0
- package/dist/definitions/components/primitives/View.d.ts +5 -0
- package/dist/definitions/components/primitives/View.d.ts.map +1 -0
- package/dist/definitions/components/primitives/View.stories.d.ts +10 -0
- package/dist/definitions/components/primitives/View.stories.d.ts.map +1 -0
- package/dist/definitions/components/primitives/createVariants.d.ts +54 -0
- package/dist/definitions/components/primitives/createVariants.d.ts.map +1 -0
- package/dist/definitions/components/primitives/stacks.d.ts +17 -0
- package/dist/definitions/components/primitives/stacks.d.ts.map +1 -0
- package/dist/definitions/components/primitives/stacks.stories.d.ts +10 -0
- package/dist/definitions/components/primitives/stacks.stories.d.ts.map +1 -0
- package/dist/definitions/components/story-components/Story.d.ts +21 -0
- package/dist/definitions/components/story-components/Story.d.ts.map +1 -0
- package/dist/definitions/components/story-components/StoryContainer.d.ts +7 -0
- package/dist/definitions/components/story-components/StoryContainer.d.ts.map +1 -0
- package/dist/definitions/components/story-components/StoryDecorator.d.ts +3 -0
- package/dist/definitions/components/story-components/StoryDecorator.d.ts.map +1 -0
- package/dist/definitions/components/story-components/StoryGrid.d.ts +19 -0
- package/dist/definitions/components/story-components/StoryGrid.d.ts.map +1 -0
- package/dist/definitions/components/story-components/StoryTitle.d.ts +10 -0
- package/dist/definitions/components/story-components/StoryTitle.d.ts.map +1 -0
- package/dist/definitions/components/story-components/WithTamaguiConfig.d.ts +7 -0
- package/dist/definitions/components/story-components/WithTamaguiConfig.d.ts.map +1 -0
- package/dist/definitions/components/typography/Typography.d.ts +38 -0
- package/dist/definitions/components/typography/Typography.d.ts.map +1 -0
- package/dist/definitions/components/typography/Typography.stories.d.ts +15 -0
- package/dist/definitions/components/typography/Typography.stories.d.ts.map +1 -0
- package/dist/definitions/components/windowSize/SwitchBreakpoints.d.ts +20 -0
- package/dist/definitions/components/windowSize/SwitchBreakpoints.d.ts.map +1 -0
- package/dist/definitions/components/windowSize/SwitchBreakpoints.stories.d.ts +10 -0
- package/dist/definitions/components/windowSize/SwitchBreakpoints.stories.d.ts.map +1 -0
- package/dist/definitions/components/windowSize/useCurrentBreakpointName.d.ts +5 -0
- package/dist/definitions/components/windowSize/useCurrentBreakpointName.d.ts.map +1 -0
- package/dist/definitions/config/Breakpoints.d.ts +32 -0
- package/dist/definitions/config/Breakpoints.d.ts.map +1 -0
- package/dist/definitions/config/animations.d.ts +15 -0
- package/dist/definitions/config/animations.d.ts.map +1 -0
- package/dist/definitions/config/animations.web.d.ts +5 -0
- package/dist/definitions/config/animations.web.d.ts.map +1 -0
- package/dist/definitions/config/colorScales.d.ts +13 -0
- package/dist/definitions/config/colorScales.d.ts.map +1 -0
- package/dist/definitions/config/createAlouetteFonts.d.ts +90 -0
- package/dist/definitions/config/createAlouetteFonts.d.ts.map +1 -0
- package/dist/definitions/config/createAlouetteTokens.d.ts +557 -0
- package/dist/definitions/config/createAlouetteTokens.d.ts.map +1 -0
- package/dist/definitions/config/media.d.ts +15 -0
- package/dist/definitions/config/media.d.ts.map +1 -0
- package/dist/definitions/config/themes.d.ts +247 -0
- package/dist/definitions/config/themes.d.ts.map +1 -0
- package/dist/definitions/config/themes.stories.d.ts +8 -0
- package/dist/definitions/config/themes.stories.d.ts.map +1 -0
- package/dist/definitions/config/tokens.stories.d.ts +8 -0
- package/dist/definitions/config/tokens.stories.d.ts.map +1 -0
- package/dist/definitions/config/utils/groupTokens.d.ts +7 -0
- package/dist/definitions/config/utils/groupTokens.d.ts.map +1 -0
- package/dist/definitions/core/AlouetteDecorator.d.ts +3 -0
- package/dist/definitions/core/AlouetteDecorator.d.ts.map +1 -0
- package/dist/definitions/core/AlouetteProvider.d.ts +8 -0
- package/dist/definitions/core/AlouetteProvider.d.ts.map +1 -0
- package/dist/definitions/createAlouetteTamagui.d.ts +136 -0
- package/dist/definitions/createAlouetteTamagui.d.ts.map +1 -0
- package/dist/definitions/index.d.ts +42 -0
- package/dist/definitions/index.d.ts.map +1 -0
- package/dist/index-browser.es.js +389 -60
- package/dist/index-browser.es.js.map +1 -1
- package/dist/index-node18.mjs +389 -60
- package/dist/index-node18.mjs.map +1 -1
- package/dist/index-react-native.cjs.js +403 -56
- package/dist/index-react-native.cjs.js.map +1 -1
- package/package.json +31 -24
- package/src/components/actions/Button.stories.tsx +4 -5
- package/src/components/actions/Button.tsx +3 -4
- package/src/components/actions/IconButton.stories.tsx +2 -3
- package/src/components/actions/IconButton.tsx +4 -4
- package/src/components/containers/{Frame.stories.tsx → Box.stories.tsx} +21 -21
- package/src/components/containers/{Frame.tsx → Box.tsx} +3 -3
- package/src/components/containers/{Pressable.stories.tsx → PressableBox.stories.tsx} +8 -8
- package/src/components/containers/PressableBox.tsx +9 -0
- package/src/components/containers/variants.ts +15 -12
- package/src/components/feedback/FeedbackIcon.tsx +2 -2
- package/src/components/feedback/Message.stories.tsx +2 -2
- package/src/components/feedback/Message.tsx +4 -4
- package/src/components/forms/InputText.stories.tsx +2 -2
- package/src/components/forms/InputText.tsx +5 -0
- package/src/components/layout/Separator.stories.tsx +39 -0
- package/src/components/layout/Separator.tsx +31 -0
- package/src/components/layout/list.stories.tsx +24 -0
- package/src/components/layout/list.tsx +30 -0
- package/src/components/primitives/Icon.stories.tsx +1 -1
- package/src/components/primitives/Icon.tsx +6 -12
- package/src/components/primitives/ScrollView.ts +2 -1
- package/src/components/primitives/createVariants.ts +7 -5
- package/src/components/primitives/stacks.stories.tsx +14 -14
- package/src/components/primitives/stacks.ts +2 -6
- package/src/components/story-components/Story.tsx +1 -1
- package/src/components/story-components/StoryGrid.tsx +0 -1
- package/src/components/story-components/StoryTitle.tsx +3 -0
- package/src/components/typography/Typography.tsx +2 -0
- package/src/components/windowSize/SwitchBreakpoints.stories.tsx +1 -1
- package/src/config/animations.ts +4 -0
- package/src/config/animations.web.ts +1 -0
- package/src/config/colorScales.ts +4 -4
- package/src/config/createAlouetteFonts.ts +6 -6
- package/src/config/createAlouetteTokens.ts +23 -18
- package/src/config/themes.stories.tsx +5 -9
- package/src/config/themes.ts +139 -68
- package/src/config/tokens.stories.tsx +7 -7
- package/src/core/AlouetteDecorator.tsx +1 -0
- package/src/createAlouetteTamagui.ts +32 -19
- package/src/index.ts +50 -3
- package/.editorconfig +0 -13
- package/.eslintrc.json +0 -5
- package/.yo-rc.json +0 -11
- package/dist/phosphor-icons-browser.es.js +0 -2497
- package/dist/phosphor-icons-browser.es.js.map +0 -1
- package/dist/phosphor-icons-node18.mjs +0 -2497
- package/dist/phosphor-icons-node18.mjs.map +0 -1
- package/dist/phosphor-icons-react-native.cjs.js +0 -4998
- package/dist/phosphor-icons-react-native.cjs.js.map +0 -1
- package/phosphor-icons.js +0 -1
- package/rollup.config.mjs +0 -8
- package/scripts/generate-phosphor-icons-legacy-withcopy.mjs +0 -64
- package/scripts/generate-phosphor-icons.mjs +0 -51
- package/src/.eslintrc.json +0 -32
- package/src/components/containers/Pressable.tsx +0 -9
- package/src/components/windowSize/__snapshots__/SwitchBreakpoints.stories.tsx.snap +0 -1032
- package/src/components/windowSize/__snapshots_web__/SwitchBreakpoints.stories.tsx.snap +0 -402
- package/src/phosphor-icons.cjs +0 -1254
- package/src/phosphor-icons.d.ts +0 -2501
- package/src/phosphor-icons.ts +0 -2499
- package/src/typings/bundler.d.ts +0 -10
- package/tsconfig.json +0 -20
package/src/config/themes.ts
CHANGED
|
@@ -1,27 +1,89 @@
|
|
|
1
|
+
/* eslint-disable camelcase */
|
|
1
2
|
import type { Variable } from "@tamagui/core";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
3
|
+
import type { AlouetteColorScales } from "./colorScales";
|
|
4
|
+
import type { createAlouetteTokens } from "./createAlouetteTokens";
|
|
4
5
|
|
|
5
|
-
interface
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
// export interface MinimalRootTheme {
|
|
7
|
+
// backgroundColor: Variable<string>;
|
|
8
|
+
// textColor: Variable<string>;
|
|
9
|
+
// }
|
|
10
|
+
|
|
11
|
+
// export interface RootTheme {
|
|
12
|
+
// backgroundColor: Variable<string>;
|
|
13
|
+
// textColor: Variable<string>;
|
|
14
|
+
// }
|
|
15
|
+
|
|
16
|
+
export interface ColorTheme {
|
|
17
|
+
backgroundColor: Variable<string>;
|
|
18
|
+
textColor: Variable<string>;
|
|
19
|
+
mainColor: Variable<string>;
|
|
20
|
+
mainTextColor: Variable<string>;
|
|
21
|
+
contrastTextColor: Variable<string>;
|
|
22
|
+
borderColor: Variable<string>;
|
|
23
|
+
|
|
24
|
+
"interactive.contained.backgroundColor": Variable<string>;
|
|
25
|
+
"interactive.borderColor": Variable<string>;
|
|
26
|
+
|
|
27
|
+
"interactive.contained.backgroundColor:hover": Variable<string>;
|
|
28
|
+
"interactive.outlined.backgroundColor:hover": Variable<string>;
|
|
29
|
+
"interactive.borderColor:hover": Variable<string>;
|
|
30
|
+
|
|
31
|
+
"interactive.contained.backgroundColor:focus": Variable<string>;
|
|
32
|
+
"interactive.outlined.backgroundColor:focus": Variable<string>;
|
|
33
|
+
"interactive.borderColor:focus": Variable<string>;
|
|
34
|
+
|
|
35
|
+
"interactive.contained.backgroundColor:press": Variable<string>;
|
|
36
|
+
"interactive.outlined.backgroundColor:press": Variable<string>;
|
|
37
|
+
"interactive.borderColor:press": Variable<string>;
|
|
38
|
+
|
|
39
|
+
"interactive.contained.backgroundColor:disabled": Variable<string>;
|
|
40
|
+
"interactive.borderColor:disabled": Variable<string>;
|
|
41
|
+
"interactive.textColor:disabled": Variable<string>;
|
|
42
|
+
|
|
43
|
+
"interactive.forms.textColor": Variable<string>;
|
|
44
|
+
// "interactive.forms.backgroundColor": Variable<string>,
|
|
45
|
+
// "interactive.forms.backgroundColor:hover": Variable<string>,
|
|
46
|
+
"interactive.forms.backgroundColor:focus": Variable<string>;
|
|
47
|
+
"interactive.forms.backgroundColor:press": Variable<string>;
|
|
48
|
+
"interactive.forms.borderColor": Variable<string>;
|
|
49
|
+
"interactive.forms.borderColor:hover": Variable<string>;
|
|
50
|
+
"interactive.forms.borderColor:focus": Variable<string>;
|
|
51
|
+
"interactive.forms.borderColor:press": Variable<string>;
|
|
52
|
+
"interactive.forms.borderColor:disabled": Variable<string>;
|
|
8
53
|
}
|
|
9
54
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
55
|
+
// export interface FullTheme extends ColorTheme, RootTheme {}
|
|
56
|
+
export type FullTheme = ColorTheme;
|
|
13
57
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
58
|
+
// export const createRootTheme = <T extends MinimalRootTheme>(
|
|
59
|
+
// theme: T,
|
|
60
|
+
// ): FullTheme => {
|
|
61
|
+
// return theme satisfies RootTheme as unknown as FullTheme;
|
|
62
|
+
// };
|
|
63
|
+
|
|
64
|
+
export const createColorTheme = <const ColorScales extends AlouetteColorScales>(
|
|
65
|
+
tokens: ReturnType<typeof createAlouetteTokens<ColorScales>>,
|
|
66
|
+
colorScaleName: string & keyof ColorScales,
|
|
67
|
+
backgroundColor?: Variable<string>,
|
|
68
|
+
textColor?: Variable<string>,
|
|
69
|
+
contrastTextColor?: Variable<string>,
|
|
70
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
19
71
|
) => {
|
|
72
|
+
const alouetteTokens: ReturnType<
|
|
73
|
+
typeof createAlouetteTokens<AlouetteColorScales>
|
|
74
|
+
> = tokens;
|
|
75
|
+
if (!backgroundColor) backgroundColor = alouetteTokens.color.white;
|
|
76
|
+
if (!textColor) textColor = alouetteTokens.color.black;
|
|
77
|
+
if (!contrastTextColor) contrastTextColor = alouetteTokens.color.white;
|
|
78
|
+
|
|
20
79
|
const getColor = (scaleNumber: number) =>
|
|
21
80
|
tokens.color[
|
|
22
|
-
|
|
81
|
+
`${colorScaleName}.${scaleNumber}` as keyof typeof tokens.color
|
|
23
82
|
];
|
|
83
|
+
|
|
24
84
|
return {
|
|
85
|
+
backgroundColor,
|
|
86
|
+
textColor,
|
|
25
87
|
mainColor: getColor(6),
|
|
26
88
|
mainTextColor: getColor(9),
|
|
27
89
|
contrastTextColor,
|
|
@@ -42,9 +104,10 @@ const createColorTheme = (
|
|
|
42
104
|
"interactive.outlined.backgroundColor:press": getColor(3),
|
|
43
105
|
"interactive.borderColor:press": getColor(7),
|
|
44
106
|
|
|
45
|
-
"interactive.contained.backgroundColor:disabled":
|
|
46
|
-
|
|
47
|
-
"interactive.
|
|
107
|
+
"interactive.contained.backgroundColor:disabled":
|
|
108
|
+
alouetteTokens.color.disabled,
|
|
109
|
+
"interactive.borderColor:disabled": alouetteTokens.color.disabled,
|
|
110
|
+
"interactive.textColor:disabled": alouetteTokens.color.contrastDisabled,
|
|
48
111
|
|
|
49
112
|
"interactive.forms.textColor": textColor,
|
|
50
113
|
// "interactive.forms.backgroundColor": undefined,
|
|
@@ -55,57 +118,65 @@ const createColorTheme = (
|
|
|
55
118
|
"interactive.forms.borderColor:hover": getColor(7),
|
|
56
119
|
"interactive.forms.borderColor:focus": getColor(7),
|
|
57
120
|
"interactive.forms.borderColor:press": getColor(7),
|
|
58
|
-
"interactive.forms.borderColor:disabled":
|
|
59
|
-
};
|
|
121
|
+
"interactive.forms.borderColor:disabled": alouetteTokens.color.disabled,
|
|
122
|
+
} satisfies FullTheme;
|
|
60
123
|
};
|
|
61
124
|
|
|
62
|
-
export const createAlouetteThemes =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
dark: createTheme({
|
|
77
|
-
backgroundColor: tokens.color.black,
|
|
78
|
-
textColor: tokens.color.white,
|
|
79
|
-
}),
|
|
80
|
-
|
|
81
|
-
dark_info: createColorTheme(
|
|
82
|
-
tokens,
|
|
83
|
-
"info",
|
|
84
|
-
tokens.color.black,
|
|
85
|
-
tokens.color.white,
|
|
86
|
-
),
|
|
87
|
-
dark_success: createColorTheme(
|
|
88
|
-
tokens,
|
|
89
|
-
"success",
|
|
90
|
-
tokens.color.black,
|
|
91
|
-
tokens.color.white,
|
|
92
|
-
),
|
|
93
|
-
dark_warning: createColorTheme(
|
|
94
|
-
tokens,
|
|
95
|
-
"warning",
|
|
96
|
-
tokens.color.black,
|
|
97
|
-
tokens.color.white,
|
|
98
|
-
),
|
|
99
|
-
dark_danger: createColorTheme(
|
|
100
|
-
tokens,
|
|
101
|
-
"danger",
|
|
102
|
-
tokens.color.black,
|
|
103
|
-
tokens.color.white,
|
|
104
|
-
),
|
|
105
|
-
dark_primary: createColorTheme(
|
|
106
|
-
tokens,
|
|
107
|
-
"primary",
|
|
108
|
-
tokens.color.black,
|
|
109
|
-
tokens.color.white,
|
|
125
|
+
export const createAlouetteThemes = <
|
|
126
|
+
const ColorScales extends AlouetteColorScales,
|
|
127
|
+
>(
|
|
128
|
+
tokens: ReturnType<typeof createAlouetteTokens<ColorScales>>,
|
|
129
|
+
) => {
|
|
130
|
+
const alouetteTokens: ReturnType<
|
|
131
|
+
typeof createAlouetteTokens<AlouetteColorScales>
|
|
132
|
+
> = tokens;
|
|
133
|
+
return {
|
|
134
|
+
light: createColorTheme(
|
|
135
|
+
alouetteTokens,
|
|
136
|
+
"grayscale",
|
|
137
|
+
alouetteTokens.color.white,
|
|
138
|
+
alouetteTokens.color.black,
|
|
110
139
|
),
|
|
111
|
-
|
|
140
|
+
light_info: createColorTheme(alouetteTokens, "info"),
|
|
141
|
+
light_success: createColorTheme(alouetteTokens, "success"),
|
|
142
|
+
light_warning: createColorTheme(alouetteTokens, "warning"),
|
|
143
|
+
light_danger: createColorTheme(alouetteTokens, "danger"),
|
|
144
|
+
light_primary: createColorTheme(alouetteTokens, "primary"),
|
|
145
|
+
|
|
146
|
+
// dark: createRootTheme({
|
|
147
|
+
// backgroundColor: alouetteTokens.color.black,
|
|
148
|
+
// textColor: alouetteTokens.color.white,
|
|
149
|
+
// }),
|
|
150
|
+
|
|
151
|
+
// dark_info: createColorTheme(
|
|
152
|
+
// alouetteTokens,
|
|
153
|
+
// "info",
|
|
154
|
+
// alouetteTokens.color.black,
|
|
155
|
+
// alouetteTokens.color.white,
|
|
156
|
+
// ),
|
|
157
|
+
// dark_success: createColorTheme(
|
|
158
|
+
// alouetteTokens,
|
|
159
|
+
// "success",
|
|
160
|
+
// alouetteTokens.color.black,
|
|
161
|
+
// alouetteTokens.color.white,
|
|
162
|
+
// ),
|
|
163
|
+
// dark_warning: createColorTheme(
|
|
164
|
+
// alouetteTokens,
|
|
165
|
+
// "warning",
|
|
166
|
+
// alouetteTokens.color.black,
|
|
167
|
+
// alouetteTokens.color.white,
|
|
168
|
+
// ),
|
|
169
|
+
// dark_danger: createColorTheme(
|
|
170
|
+
// alouetteTokens,
|
|
171
|
+
// "danger",
|
|
172
|
+
// alouetteTokens.color.black,
|
|
173
|
+
// alouetteTokens.color.white,
|
|
174
|
+
// ),
|
|
175
|
+
// dark_primary: createColorTheme(
|
|
176
|
+
// alouetteTokens,
|
|
177
|
+
// "primary",
|
|
178
|
+
// alouetteTokens.color.black,
|
|
179
|
+
// alouetteTokens.color.white,
|
|
180
|
+
// ),
|
|
181
|
+
} as const;
|
|
182
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Box } from "../components/containers/Box";
|
|
2
3
|
import { View } from "../components/primitives/View";
|
|
3
4
|
import { HStack, VStack } from "../components/primitives/stacks";
|
|
4
5
|
import { Story } from "../components/story-components/Story";
|
|
5
|
-
import {
|
|
6
|
+
import { WithTamaguiConfig } from "../components/story-components/WithTamaguiConfig";
|
|
6
7
|
import { Typography } from "../components/typography/Typography";
|
|
7
8
|
import { groupTokens } from "./utils/groupTokens";
|
|
8
|
-
import { WithTamaguiConfig } from "../components/story-components/WithTamaguiConfig";
|
|
9
9
|
|
|
10
10
|
type ThisStory = StoryObj<unknown>;
|
|
11
11
|
|
|
@@ -44,9 +44,9 @@ export const TokensStory: ThisStory = {
|
|
|
44
44
|
<Story.Section title="Radius">
|
|
45
45
|
<HStack gap="$xs" flexWrap="wrap">
|
|
46
46
|
{(["$sm", "$md"] as const).map((proportion) => (
|
|
47
|
-
<
|
|
48
|
-
centered
|
|
47
|
+
<Box
|
|
49
48
|
key={proportion}
|
|
49
|
+
centered
|
|
50
50
|
withBackground
|
|
51
51
|
borderRadius={proportion}
|
|
52
52
|
size={50}
|
|
@@ -54,7 +54,7 @@ export const TokensStory: ThisStory = {
|
|
|
54
54
|
margin="$4"
|
|
55
55
|
>
|
|
56
56
|
<Typography>{proportion}</Typography>
|
|
57
|
-
</
|
|
57
|
+
</Box>
|
|
58
58
|
))}
|
|
59
59
|
</HStack>
|
|
60
60
|
</Story.Section>
|
|
@@ -62,7 +62,7 @@ export const TokensStory: ThisStory = {
|
|
|
62
62
|
<Story.Section title="Spacings">
|
|
63
63
|
<HStack gap="$xs" flexWrap="wrap" alignItems="flex-start">
|
|
64
64
|
{Object.entries(tokens.space).map(([key, value]) => (
|
|
65
|
-
<
|
|
65
|
+
<Box
|
|
66
66
|
key={key}
|
|
67
67
|
centered
|
|
68
68
|
withBackground
|
|
@@ -74,7 +74,7 @@ export const TokensStory: ThisStory = {
|
|
|
74
74
|
<Typography size="xs">${key}</Typography>
|
|
75
75
|
<Typography size="xs">{value.val}</Typography>
|
|
76
76
|
</VStack>
|
|
77
|
-
</
|
|
77
|
+
</Box>
|
|
78
78
|
))}
|
|
79
79
|
</HStack>
|
|
80
80
|
</Story.Section>
|
|
@@ -3,6 +3,7 @@ import { AlouetteProvider } from "./AlouetteProvider";
|
|
|
3
3
|
|
|
4
4
|
// eslint-disable-next-line react/function-component-definition -- not a component
|
|
5
5
|
export const AlouetteDecorator: Decorator = (storyFn, context) => (
|
|
6
|
+
// eslint-disable-next-line react/destructuring-assignment
|
|
6
7
|
<AlouetteProvider tamaguiConfig={context.parameters.tamaguiConfig}>
|
|
7
8
|
{storyFn(context)}
|
|
8
9
|
</AlouetteProvider>
|
|
@@ -1,36 +1,49 @@
|
|
|
1
1
|
import { createTamagui } from "@tamagui/core";
|
|
2
2
|
import { animations } from "./config/animations";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "./config/
|
|
3
|
+
import type { AlouetteColorScales } from "./config/colorScales";
|
|
4
|
+
import type { AlouetteFontsOptions } from "./config/createAlouetteFonts";
|
|
5
|
+
import { createAlouetteFonts } from "./config/createAlouetteFonts";
|
|
6
|
+
import type { createAlouetteTokens } from "./config/createAlouetteTokens";
|
|
7
7
|
import { media } from "./config/media";
|
|
8
|
-
import { createAlouetteThemes } from "./config/themes";
|
|
9
|
-
import {
|
|
10
|
-
createAlouetteTokens,
|
|
11
|
-
AlouetteTokensOptions,
|
|
12
|
-
} from "./config/createAlouetteTokens";
|
|
13
|
-
import { AlouetteColorScales } from "./config/colorScales";
|
|
8
|
+
import type { createAlouetteThemes } from "./config/themes";
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
export { createAlouetteTokens } from "./config/createAlouetteTokens";
|
|
11
|
+
|
|
12
|
+
export interface AlouetteTamaguiOptions {
|
|
17
13
|
fonts?: AlouetteFontsOptions;
|
|
18
|
-
tokens?: AlouetteTokensOptions;
|
|
19
14
|
}
|
|
20
15
|
|
|
21
|
-
export {
|
|
16
|
+
export {
|
|
17
|
+
createColorTheme,
|
|
18
|
+
createAlouetteThemes,
|
|
19
|
+
type FullTheme,
|
|
20
|
+
} from "./config/themes";
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
defaultColorScales,
|
|
24
|
+
createColorScale,
|
|
25
|
+
type AlouetteColorScales,
|
|
26
|
+
type AlouetteColorScale,
|
|
27
|
+
} from "./config/colorScales";
|
|
22
28
|
|
|
23
|
-
export const createAlouetteTamagui =
|
|
24
|
-
const
|
|
29
|
+
export const createAlouetteTamagui = <
|
|
30
|
+
const ColorScales extends AlouetteColorScales,
|
|
31
|
+
const Tokens extends ReturnType<typeof createAlouetteTokens<ColorScales>>,
|
|
32
|
+
const Themes extends ReturnType<typeof createAlouetteThemes<ColorScales>>,
|
|
33
|
+
>(
|
|
34
|
+
tokens: Tokens,
|
|
35
|
+
themes: Themes,
|
|
36
|
+
options: AlouetteTamaguiOptions = {},
|
|
37
|
+
) => {
|
|
25
38
|
return createTamagui({
|
|
26
39
|
fonts: createAlouetteFonts(options.fonts),
|
|
27
40
|
tokens,
|
|
28
|
-
themes
|
|
41
|
+
themes,
|
|
29
42
|
media,
|
|
30
43
|
animations,
|
|
31
44
|
settings: {
|
|
32
|
-
allowedStyleValues: "strict",
|
|
33
|
-
autocompleteSpecificTokens:
|
|
45
|
+
allowedStyleValues: "somewhat-strict-web",
|
|
46
|
+
autocompleteSpecificTokens: "except-special",
|
|
34
47
|
},
|
|
35
48
|
components: ["alouette"],
|
|
36
49
|
} as const);
|
package/src/index.ts
CHANGED
|
@@ -1,10 +1,53 @@
|
|
|
1
|
+
export type { IconButtonProps } from "./components/actions/IconButton";
|
|
1
2
|
export { IconButton } from "./components/actions/IconButton";
|
|
3
|
+
export type { ButtonProps } from "./components/actions/Button";
|
|
4
|
+
export { Button } from "./components/actions/Button";
|
|
5
|
+
export type { BoxProps } from "./components/containers/Box";
|
|
6
|
+
export { Box } from "./components/containers/Box";
|
|
7
|
+
export type { PressableBoxProps } from "./components/containers/PressableBox";
|
|
8
|
+
export { PressableBox } from "./components/containers/PressableBox";
|
|
9
|
+
export type { MessageProps } from "./components/feedback/Message";
|
|
10
|
+
export { Message } from "./components/feedback/Message";
|
|
11
|
+
export type {
|
|
12
|
+
InputTextProps,
|
|
13
|
+
TextAreaProps,
|
|
14
|
+
} from "./components/forms/InputText";
|
|
15
|
+
export { InputText, TextArea } from "./components/forms/InputText";
|
|
16
|
+
export type { IconProps } from "./components/primitives/Icon";
|
|
2
17
|
export { Icon } from "./components/primitives/Icon";
|
|
18
|
+
export type { ScrollViewProps } from "./components/primitives/ScrollView";
|
|
3
19
|
export { ScrollView } from "./components/primitives/ScrollView";
|
|
20
|
+
export type { ViewProps } from "./components/primitives/View";
|
|
4
21
|
export { View } from "./components/primitives/View";
|
|
22
|
+
export type {
|
|
23
|
+
HStackProps,
|
|
24
|
+
VStackProps,
|
|
25
|
+
StackProps,
|
|
26
|
+
} from "./components/primitives/stacks";
|
|
5
27
|
export { Stack, HStack, VStack } from "./components/primitives/stacks";
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
28
|
+
export type { StoryProps } from "./components/story-components/Story";
|
|
29
|
+
export { Story } from "./components/story-components/Story";
|
|
30
|
+
export type { StoryContainerProps } from "./components/story-components/StoryContainer";
|
|
31
|
+
export { StoryContainer } from "./components/story-components/StoryContainer";
|
|
32
|
+
export { StoryDecorator } from "./components/story-components/StoryDecorator";
|
|
33
|
+
export type {
|
|
34
|
+
StoryGridColProps,
|
|
35
|
+
StoryGridRowProps,
|
|
36
|
+
} from "./components/story-components/StoryGrid";
|
|
37
|
+
export { StoryGrid } from "./components/story-components/StoryGrid";
|
|
38
|
+
export type { StoryTitleProps } from "./components/story-components/StoryTitle";
|
|
39
|
+
export { StoryTitle } from "./components/story-components/StoryTitle";
|
|
40
|
+
export { WithTamaguiConfig } from "./components/story-components/WithTamaguiConfig";
|
|
41
|
+
export type {
|
|
42
|
+
TypographyProps,
|
|
43
|
+
TypographyParagraphProps,
|
|
44
|
+
} from "./components/typography/Typography";
|
|
45
|
+
export {
|
|
46
|
+
Typography,
|
|
47
|
+
TypographyWithContext,
|
|
48
|
+
TypographyParagraph,
|
|
49
|
+
TypographyParagraphWithContext,
|
|
50
|
+
} from "./components/typography/Typography";
|
|
8
51
|
export {
|
|
9
52
|
SwitchBreakpointsUsingDisplayNone,
|
|
10
53
|
SwitchBreakpointsUsingNull,
|
|
@@ -12,4 +55,8 @@ export {
|
|
|
12
55
|
export { useCurrentBreakpointName } from "./components/windowSize/useCurrentBreakpointName";
|
|
13
56
|
export { AlouetteDecorator } from "./core/AlouetteDecorator";
|
|
14
57
|
export { AlouetteProvider } from "./core/AlouetteProvider";
|
|
15
|
-
export {
|
|
58
|
+
export type { GetProps, ThemeProps } from "@tamagui/core";
|
|
59
|
+
export { Theme, styled, withStaticProperties } from "@tamagui/core";
|
|
60
|
+
export type { SeparatorProps } from "./components/layout/Separator";
|
|
61
|
+
export { Separator } from "./components/layout/Separator";
|
|
62
|
+
export { PressableListItem } from "./components/layout/list";
|
package/.editorconfig
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# EditorConfig helps developers define and maintain consistent
|
|
2
|
-
# coding styles between different editors and IDEs
|
|
3
|
-
# http://editorconfig.org
|
|
4
|
-
|
|
5
|
-
root = true
|
|
6
|
-
|
|
7
|
-
[*]
|
|
8
|
-
indent_style = space
|
|
9
|
-
indent_size = 2
|
|
10
|
-
end_of_line = lf
|
|
11
|
-
charset = utf-8
|
|
12
|
-
trim_trailing_whitespace = true
|
|
13
|
-
insert_final_newline = true
|
package/.eslintrc.json
DELETED