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/dist/index-browser.es.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { styled, View, useStyle, Text, useMedia, TamaguiProvider } from '@tamagui/core';
|
|
3
|
-
export { Theme, View } from '@tamagui/core';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { styled, View, useStyle, Text, useConfiguration, useMedia, TamaguiProvider, Stack as Stack$1 } from '@tamagui/core';
|
|
3
|
+
export { Theme, View, styled, withStaticProperties } from '@tamagui/core';
|
|
4
|
+
import { createContext, useContext, Children } from 'react';
|
|
5
|
+
import { InfoRegularIcon, WarningRegularIcon, CheckRegularIcon, WarningCircleRegularIcon, XRegularIcon, CaretRightRegularIcon } from 'alouette-icons/phosphor-icons';
|
|
6
|
+
import { TextInput, ScrollView as ScrollView$1, Platform, Pressable } from 'react-native';
|
|
6
7
|
|
|
7
8
|
const fullscreenStyle = {
|
|
8
9
|
position: "absolute",
|
|
@@ -28,11 +29,11 @@ const getBorderAdditionalInteraction = ({
|
|
|
28
29
|
return {
|
|
29
30
|
borderColor: `$${prefix}.borderColor:hover`
|
|
30
31
|
};
|
|
31
|
-
case
|
|
32
|
+
case "press":
|
|
32
33
|
return {
|
|
33
34
|
borderColor: `$${prefix}.borderColor:press`
|
|
34
35
|
};
|
|
35
|
-
case
|
|
36
|
+
case "focus":
|
|
36
37
|
return {
|
|
37
38
|
borderColor: `$${prefix}.borderColor:focus`
|
|
38
39
|
};
|
|
@@ -57,7 +58,10 @@ const getBackgroundAdditionalInteraction = ({
|
|
|
57
58
|
interactive,
|
|
58
59
|
variant
|
|
59
60
|
}) => {
|
|
60
|
-
const prefix = interactive === "text" ? "interactive.forms" :
|
|
61
|
+
const prefix = interactive === "text" ? "interactive.forms" : (
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
63
|
+
`interactive.${variant || "contained"}`
|
|
64
|
+
);
|
|
61
65
|
if (disabled) {
|
|
62
66
|
return {
|
|
63
67
|
backgroundColor: `$${prefix}.backgroundColor:disabled`
|
|
@@ -69,11 +73,11 @@ const getBackgroundAdditionalInteraction = ({
|
|
|
69
73
|
return {
|
|
70
74
|
backgroundColor: `$${prefix}.backgroundColor:hover`
|
|
71
75
|
};
|
|
72
|
-
case
|
|
76
|
+
case "press":
|
|
73
77
|
return {
|
|
74
78
|
backgroundColor: `$${prefix}.backgroundColor:press`
|
|
75
79
|
};
|
|
76
|
-
case
|
|
80
|
+
case "focus":
|
|
77
81
|
return {
|
|
78
82
|
backgroundColor: `$${prefix}.backgroundColor:focus`
|
|
79
83
|
};
|
|
@@ -108,7 +112,10 @@ const withBackground = (val, { props }) => {
|
|
|
108
112
|
throw new Error("A role prop is required while using interactive");
|
|
109
113
|
}
|
|
110
114
|
return {
|
|
111
|
-
backgroundColor: props.interactive ?
|
|
115
|
+
backgroundColor: props.interactive ? (
|
|
116
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
117
|
+
`$interactive.${variant}.backgroundColor`
|
|
118
|
+
) : "$mainColor",
|
|
112
119
|
...props.interactive ? getBackgroundAdditionalInteraction(props) : void 0
|
|
113
120
|
};
|
|
114
121
|
};
|
|
@@ -137,9 +144,15 @@ const circular = {
|
|
|
137
144
|
};
|
|
138
145
|
}
|
|
139
146
|
};
|
|
140
|
-
const interactive = (isInteractiveOrInteractiveCursorType, { props }) =>
|
|
141
|
-
|
|
142
|
-
|
|
147
|
+
const interactive = (isInteractiveOrInteractiveCursorType, { props }) => {
|
|
148
|
+
if (!isInteractiveOrInteractiveCursorType) return null;
|
|
149
|
+
if (props.disabled) {
|
|
150
|
+
return { cursor: "not-allowed" };
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
cursor: isInteractiveOrInteractiveCursorType === true ? "pointer" : isInteractiveOrInteractiveCursorType
|
|
154
|
+
};
|
|
155
|
+
};
|
|
143
156
|
const centered = {
|
|
144
157
|
true: {
|
|
145
158
|
alignItems: "center",
|
|
@@ -158,12 +171,16 @@ const variants$1 = {
|
|
|
158
171
|
withBorder: withBorder
|
|
159
172
|
};
|
|
160
173
|
|
|
161
|
-
const
|
|
162
|
-
name: "
|
|
174
|
+
const Box = styled(View, {
|
|
175
|
+
name: "Box",
|
|
163
176
|
variants: variants$1,
|
|
164
177
|
animation: "fast"
|
|
165
178
|
});
|
|
166
179
|
|
|
180
|
+
const PressableBox = styled(Box, {
|
|
181
|
+
interactive: true
|
|
182
|
+
});
|
|
183
|
+
|
|
167
184
|
function Icon({
|
|
168
185
|
icon,
|
|
169
186
|
size = 20,
|
|
@@ -177,24 +194,10 @@ function Icon({
|
|
|
177
194
|
// if needed for native
|
|
178
195
|
// resolveValues: Platform.OS === 'web' ? undefined: 'value',
|
|
179
196
|
});
|
|
180
|
-
return /* @__PURE__ */ jsx(
|
|
181
|
-
Frame,
|
|
182
|
-
{
|
|
183
|
-
...props,
|
|
184
|
-
centered: true,
|
|
185
|
-
alignSelf: align,
|
|
186
|
-
size,
|
|
187
|
-
style,
|
|
188
|
-
children: icon
|
|
189
|
-
}
|
|
190
|
-
);
|
|
197
|
+
return /* @__PURE__ */ jsx(Box, { ...props, centered: true, alignSelf: align, size, style, children: icon });
|
|
191
198
|
}
|
|
192
199
|
|
|
193
|
-
const
|
|
194
|
-
interactive: true
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
const IconButtonFrame = styled(Pressable, {
|
|
200
|
+
const IconButtonFrame = styled(PressableBox, {
|
|
198
201
|
name: "IconButtonFrame",
|
|
199
202
|
role: "button",
|
|
200
203
|
centered: true,
|
|
@@ -221,24 +224,6 @@ function IconButton({
|
|
|
221
224
|
) });
|
|
222
225
|
}
|
|
223
226
|
|
|
224
|
-
const ScrollView = styled(
|
|
225
|
-
ScrollView$1,
|
|
226
|
-
{
|
|
227
|
-
name: "ScrollView",
|
|
228
|
-
scrollEnabled: true,
|
|
229
|
-
variants: {
|
|
230
|
-
fullscreen: {
|
|
231
|
-
true: fullscreenStyle
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
accept: {
|
|
237
|
-
contentContainerStyle: "style"
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
);
|
|
241
|
-
|
|
242
227
|
const variants = {
|
|
243
228
|
fullscreen: {
|
|
244
229
|
true: fullscreenStyle
|
|
@@ -249,12 +234,8 @@ const Stack = styled(View, {
|
|
|
249
234
|
variants: {
|
|
250
235
|
...variants,
|
|
251
236
|
type: {
|
|
252
|
-
h: {
|
|
253
|
-
|
|
254
|
-
},
|
|
255
|
-
v: {
|
|
256
|
-
flexDirection: "column"
|
|
257
|
-
}
|
|
237
|
+
h: { flexDirection: "row" },
|
|
238
|
+
v: { flexDirection: "column" }
|
|
258
239
|
}
|
|
259
240
|
}
|
|
260
241
|
});
|
|
@@ -309,7 +290,7 @@ const TypographyParagraph = styled(Typography, {
|
|
|
309
290
|
family: "body"
|
|
310
291
|
});
|
|
311
292
|
const TypographySizeContext = createContext(void 0);
|
|
312
|
-
Typography.styleable(
|
|
293
|
+
const TypographyWithContext = Typography.styleable(
|
|
313
294
|
({ size, ...props }, ref) => {
|
|
314
295
|
const ancestorSize = useContext(TypographySizeContext);
|
|
315
296
|
const sizeOrAncestorSizeOrDefaultSize = size || ancestorSize;
|
|
@@ -319,7 +300,7 @@ Typography.styleable(
|
|
|
319
300
|
return /* @__PURE__ */ jsx(Typography, { ref, size, ...props });
|
|
320
301
|
}
|
|
321
302
|
);
|
|
322
|
-
TypographyParagraph.styleable(
|
|
303
|
+
const TypographyParagraphWithContext = TypographyParagraph.styleable(
|
|
323
304
|
({ size, ...props }, ref) => {
|
|
324
305
|
const ancestorSize = useContext(TypographySizeContext);
|
|
325
306
|
const sizeOrAncestorSizeOrDefaultSize = size || ancestorSize;
|
|
@@ -327,6 +308,307 @@ TypographyParagraph.styleable(
|
|
|
327
308
|
}
|
|
328
309
|
);
|
|
329
310
|
|
|
311
|
+
const ButtonFrame = styled(PressableBox, {
|
|
312
|
+
name: "ButtonFrame",
|
|
313
|
+
role: "button",
|
|
314
|
+
centered: true,
|
|
315
|
+
minHeight: 42,
|
|
316
|
+
borderRadius: "$sm",
|
|
317
|
+
paddingHorizontal: "$md",
|
|
318
|
+
variants: {
|
|
319
|
+
variant: {
|
|
320
|
+
contained: {
|
|
321
|
+
withBackground: true
|
|
322
|
+
},
|
|
323
|
+
outlined: {
|
|
324
|
+
withBackground: true,
|
|
325
|
+
withBorder: true
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
defaultVariants: {
|
|
330
|
+
variant: "contained"
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
function Button({
|
|
334
|
+
icon,
|
|
335
|
+
text,
|
|
336
|
+
disabled,
|
|
337
|
+
variant,
|
|
338
|
+
...pressableProps
|
|
339
|
+
}) {
|
|
340
|
+
return /* @__PURE__ */ jsx(ButtonFrame, { disabled, variant, ...pressableProps, children: /* @__PURE__ */ jsxs(HStack, { gap: "$xs", alignItems: "center", children: [
|
|
341
|
+
icon && /* @__PURE__ */ jsx(
|
|
342
|
+
Icon,
|
|
343
|
+
{
|
|
344
|
+
color: disabled ? "$contrastDisabled" : void 0,
|
|
345
|
+
contrast: variant === "contained" && !disabled,
|
|
346
|
+
icon
|
|
347
|
+
}
|
|
348
|
+
),
|
|
349
|
+
/* @__PURE__ */ jsx(
|
|
350
|
+
Typography,
|
|
351
|
+
{
|
|
352
|
+
size: "md",
|
|
353
|
+
weight: "bold",
|
|
354
|
+
paddingVertical: "$xs",
|
|
355
|
+
color: disabled ? "$contrastDisabled" : void 0,
|
|
356
|
+
contrast: variant === "contained" && !disabled,
|
|
357
|
+
children: text
|
|
358
|
+
}
|
|
359
|
+
)
|
|
360
|
+
] }) });
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
function FeedbackIcon({ type }) {
|
|
364
|
+
switch (type) {
|
|
365
|
+
case "warning":
|
|
366
|
+
return /* @__PURE__ */ jsx(WarningCircleRegularIcon, {});
|
|
367
|
+
case "success":
|
|
368
|
+
return /* @__PURE__ */ jsx(CheckRegularIcon, {});
|
|
369
|
+
case "danger":
|
|
370
|
+
return /* @__PURE__ */ jsx(WarningRegularIcon, {});
|
|
371
|
+
default:
|
|
372
|
+
return /* @__PURE__ */ jsx(InfoRegularIcon, {});
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
const MessageFrame = styled(Box, {
|
|
377
|
+
name: "MessageFrame",
|
|
378
|
+
alignItems: "center",
|
|
379
|
+
withBackground: true,
|
|
380
|
+
borderRadius: "$md",
|
|
381
|
+
paddingHorizontal: "$4",
|
|
382
|
+
flexDirection: "row",
|
|
383
|
+
gap: "$4"
|
|
384
|
+
});
|
|
385
|
+
const MessageText = styled(Typography, {
|
|
386
|
+
name: "MessageText",
|
|
387
|
+
contrast: true,
|
|
388
|
+
size: "md",
|
|
389
|
+
flexGrow: 1,
|
|
390
|
+
paddingVertical: "$4",
|
|
391
|
+
variants: {
|
|
392
|
+
centered: {
|
|
393
|
+
true: {
|
|
394
|
+
textAlign: "center",
|
|
395
|
+
paddingHorizontal: "$4"
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
});
|
|
400
|
+
const MessageIconContainer = styled(View, {
|
|
401
|
+
name: "MessageIconContainer",
|
|
402
|
+
alignItems: "center"
|
|
403
|
+
});
|
|
404
|
+
const MessageDismissButtonContainer = styled(View, {
|
|
405
|
+
name: "MessageDismissButtonContainer",
|
|
406
|
+
marginRight: "$2"
|
|
407
|
+
});
|
|
408
|
+
function Message({
|
|
409
|
+
theme,
|
|
410
|
+
textCentered,
|
|
411
|
+
children,
|
|
412
|
+
onDismiss
|
|
413
|
+
}) {
|
|
414
|
+
return /* @__PURE__ */ jsxs(MessageFrame, { theme, children: [
|
|
415
|
+
textCentered ? null : /* @__PURE__ */ jsx(MessageIconContainer, { children: /* @__PURE__ */ jsx(Icon, { contrast: true, icon: /* @__PURE__ */ jsx(FeedbackIcon, { type: theme }) }) }),
|
|
416
|
+
/* @__PURE__ */ jsx(MessageText, { centered: textCentered, children }),
|
|
417
|
+
onDismiss ? /* @__PURE__ */ jsx(MessageDismissButtonContainer, { children: /* @__PURE__ */ jsx(IconButton, { icon: /* @__PURE__ */ jsx(XRegularIcon, {}), size: 40 }) }) : null
|
|
418
|
+
] });
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
const StyledInputText = styled(TextInput, {
|
|
422
|
+
variants: variants$1,
|
|
423
|
+
padding: "$xs",
|
|
424
|
+
borderRadius: "$sm",
|
|
425
|
+
// @ts-expect-error missing prop but seems to work
|
|
426
|
+
color: "$forms.textColor",
|
|
427
|
+
withBorder: true,
|
|
428
|
+
withBackground: true,
|
|
429
|
+
borderWidth: 1,
|
|
430
|
+
borderBottomWidth: 3,
|
|
431
|
+
// reset browser style
|
|
432
|
+
outlineStyle: "none"
|
|
433
|
+
});
|
|
434
|
+
const InputText = styled(StyledInputText, {
|
|
435
|
+
name: "InputText",
|
|
436
|
+
interactive: "text",
|
|
437
|
+
theme: "primary"
|
|
438
|
+
// animation: "formElement", // remove all style ?
|
|
439
|
+
});
|
|
440
|
+
const TextArea = styled(InputText, {
|
|
441
|
+
multiline: true
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
const ScrollView = styled(
|
|
445
|
+
ScrollView$1,
|
|
446
|
+
{
|
|
447
|
+
name: "ScrollView",
|
|
448
|
+
scrollEnabled: true,
|
|
449
|
+
variants: {
|
|
450
|
+
fullscreen: {
|
|
451
|
+
true: fullscreenStyle
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
accept: {
|
|
457
|
+
contentContainerStyle: "style"
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
);
|
|
461
|
+
|
|
462
|
+
const StoryTitle = styled(Typography, {
|
|
463
|
+
family: "heading",
|
|
464
|
+
weight: "black",
|
|
465
|
+
variants: {
|
|
466
|
+
level: {
|
|
467
|
+
1: { size: "xl", marginBottom: "$8" },
|
|
468
|
+
2: { size: "lg", marginBottom: "$8" },
|
|
469
|
+
3: { size: "md", marginBottom: "$3" },
|
|
470
|
+
4: { size: "sm", marginBottom: "$3" }
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
defaultVariants: {
|
|
474
|
+
level: 1
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
const InternalStorySection = styled(VStack, {
|
|
479
|
+
marginBottom: "$8",
|
|
480
|
+
paddingHorizontal: "$4",
|
|
481
|
+
marginHorizontal: "$-4",
|
|
482
|
+
variants: {
|
|
483
|
+
withBackground: {
|
|
484
|
+
true: {
|
|
485
|
+
backgroundColor: "$backgroundColor"
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
function StorySection({
|
|
491
|
+
title,
|
|
492
|
+
children,
|
|
493
|
+
level = 1,
|
|
494
|
+
withBackground,
|
|
495
|
+
...props
|
|
496
|
+
}) {
|
|
497
|
+
return /* @__PURE__ */ jsxs(InternalStorySection, { withBackground, ...props, children: [
|
|
498
|
+
/* @__PURE__ */ jsx(StoryTitle, { level: level + 1, children: title }),
|
|
499
|
+
children
|
|
500
|
+
] });
|
|
501
|
+
}
|
|
502
|
+
function SubSection({
|
|
503
|
+
title,
|
|
504
|
+
children,
|
|
505
|
+
withBackground,
|
|
506
|
+
...props
|
|
507
|
+
}) {
|
|
508
|
+
return /* @__PURE__ */ jsxs(
|
|
509
|
+
InternalStorySection,
|
|
510
|
+
{
|
|
511
|
+
marginBottom: "$4",
|
|
512
|
+
withBackground,
|
|
513
|
+
...props,
|
|
514
|
+
children: [
|
|
515
|
+
/* @__PURE__ */ jsx(StoryTitle, { level: 3, children: title }),
|
|
516
|
+
children
|
|
517
|
+
]
|
|
518
|
+
}
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
function Story({ preview, children }) {
|
|
522
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
523
|
+
preview && /* @__PURE__ */ jsx(StorySection, { title: "Preview", paddingBottom: "$12", children: preview }),
|
|
524
|
+
children
|
|
525
|
+
] });
|
|
526
|
+
}
|
|
527
|
+
Story.Section = StorySection;
|
|
528
|
+
Story.SubSection = SubSection;
|
|
529
|
+
|
|
530
|
+
function StoryContainer({
|
|
531
|
+
title,
|
|
532
|
+
children
|
|
533
|
+
}) {
|
|
534
|
+
return /* @__PURE__ */ jsxs(ScrollView, { theme: "light", background: "#fff", padding: "$4", children: [
|
|
535
|
+
/* @__PURE__ */ jsx(StoryTitle, { level: 1, children: title }),
|
|
536
|
+
children
|
|
537
|
+
] });
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
const StoryDecorator = (storyFn, { name, container }) => {
|
|
541
|
+
if (container === false) return storyFn();
|
|
542
|
+
return /* @__PURE__ */ jsx(StoryContainer, { title: name, children: storyFn() });
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
function StoryGridRow({
|
|
546
|
+
children,
|
|
547
|
+
breakpoint = "small",
|
|
548
|
+
flexWrap
|
|
549
|
+
}) {
|
|
550
|
+
return /* @__PURE__ */ jsx(
|
|
551
|
+
View,
|
|
552
|
+
{
|
|
553
|
+
flexDirection: "column",
|
|
554
|
+
...{
|
|
555
|
+
[`$${breakpoint}`]: {
|
|
556
|
+
flexDirection: "row",
|
|
557
|
+
marginVertical: "$-1",
|
|
558
|
+
marginBottom: "$4",
|
|
559
|
+
flexWrap: flexWrap ? "wrap" : void 0,
|
|
560
|
+
gap: flexWrap ? "$xs" : void 0
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
children: Children.map(children, (child) => /* @__PURE__ */ jsx(
|
|
564
|
+
View,
|
|
565
|
+
{
|
|
566
|
+
paddingTop: "$2",
|
|
567
|
+
paddingBottom: "$4",
|
|
568
|
+
...{
|
|
569
|
+
[`$${breakpoint}`]: {
|
|
570
|
+
flexGrow: 1,
|
|
571
|
+
flexBasis: flexWrap ? void 0 : 0,
|
|
572
|
+
paddingTop: 0,
|
|
573
|
+
paddingBottom: 0,
|
|
574
|
+
marginVertical: "$2"
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
children: child
|
|
578
|
+
}
|
|
579
|
+
))
|
|
580
|
+
}
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
function StoryGridCol({
|
|
584
|
+
title,
|
|
585
|
+
children,
|
|
586
|
+
platform = "all"
|
|
587
|
+
}) {
|
|
588
|
+
const isNative = Platform.OS === "ios" || Platform.OS === "android";
|
|
589
|
+
if (Platform.OS === "web" && platform === "native") {
|
|
590
|
+
return null;
|
|
591
|
+
}
|
|
592
|
+
if (isNative && platform === "web") {
|
|
593
|
+
return null;
|
|
594
|
+
}
|
|
595
|
+
return title ? /* @__PURE__ */ jsxs(VStack, { children: [
|
|
596
|
+
/* @__PURE__ */ jsx(StoryTitle, { level: 4, numberOfLines: 1, children: title }),
|
|
597
|
+
children
|
|
598
|
+
] }) : children;
|
|
599
|
+
}
|
|
600
|
+
const StoryGrid = {
|
|
601
|
+
Row: StoryGridRow,
|
|
602
|
+
Col: StoryGridCol
|
|
603
|
+
};
|
|
604
|
+
|
|
605
|
+
function WithTamaguiConfig({
|
|
606
|
+
render
|
|
607
|
+
}) {
|
|
608
|
+
const config = useConfiguration();
|
|
609
|
+
return render(config);
|
|
610
|
+
}
|
|
611
|
+
|
|
330
612
|
var BreakpointNameEnum = /* @__PURE__ */ ((BreakpointNameEnum2) => {
|
|
331
613
|
BreakpointNameEnum2["BASE"] = "base";
|
|
332
614
|
BreakpointNameEnum2["SMALL"] = "small";
|
|
@@ -398,7 +680,54 @@ function AlouetteProvider({
|
|
|
398
680
|
return /* @__PURE__ */ jsx(TamaguiProvider, { config: tamaguiConfig, defaultTheme: "light", children });
|
|
399
681
|
}
|
|
400
682
|
|
|
401
|
-
const AlouetteDecorator = (storyFn, context) =>
|
|
683
|
+
const AlouetteDecorator = (storyFn, context) => (
|
|
684
|
+
// eslint-disable-next-line react/destructuring-assignment
|
|
685
|
+
/* @__PURE__ */ jsx(AlouetteProvider, { tamaguiConfig: context.parameters.tamaguiConfig, children: storyFn(context) })
|
|
686
|
+
);
|
|
687
|
+
|
|
688
|
+
const Separator = styled(Stack$1, {
|
|
689
|
+
name: "Separator",
|
|
690
|
+
flexGrow: 1,
|
|
691
|
+
flexShrink: 0,
|
|
692
|
+
height: 0,
|
|
693
|
+
maxHeight: 0,
|
|
694
|
+
borderColor: "$borderColor",
|
|
695
|
+
borderWidth: 0,
|
|
696
|
+
borderBottomWidth: 1,
|
|
697
|
+
y: -0.5,
|
|
698
|
+
variants: {
|
|
699
|
+
vertical: {
|
|
700
|
+
true: {
|
|
701
|
+
height: "auto",
|
|
702
|
+
maxHeight: "auto",
|
|
703
|
+
width: 0,
|
|
704
|
+
maxWidth: 0,
|
|
705
|
+
borderBottomWidth: 0,
|
|
706
|
+
borderRightWidth: 1,
|
|
707
|
+
y: 0,
|
|
708
|
+
x: -0.5
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
});
|
|
713
|
+
|
|
714
|
+
function PressableListItem({
|
|
715
|
+
children,
|
|
716
|
+
onPress
|
|
717
|
+
}) {
|
|
718
|
+
return /* @__PURE__ */ jsx(Pressable, { onPress, children: /* @__PURE__ */ jsxs(
|
|
719
|
+
HStack,
|
|
720
|
+
{
|
|
721
|
+
justifyContent: "space-between",
|
|
722
|
+
paddingHorizontal: "$4",
|
|
723
|
+
paddingVertical: "$3",
|
|
724
|
+
children: [
|
|
725
|
+
/* @__PURE__ */ jsx(View, { children }),
|
|
726
|
+
/* @__PURE__ */ jsx(Stack, { justifyContent: "center", children: /* @__PURE__ */ jsx(Icon, { icon: /* @__PURE__ */ jsx(CaretRightRegularIcon, {}), size: 20 }) })
|
|
727
|
+
]
|
|
728
|
+
}
|
|
729
|
+
) });
|
|
730
|
+
}
|
|
402
731
|
|
|
403
|
-
export { AlouetteDecorator, AlouetteProvider,
|
|
732
|
+
export { AlouetteDecorator, AlouetteProvider, Box, Button, HStack, Icon, IconButton, InputText, Message, PressableBox, PressableListItem, ScrollView, Separator, Stack, Story, StoryContainer, StoryDecorator, StoryGrid, StoryTitle, SwitchBreakpointsUsingDisplayNone, SwitchBreakpointsUsingNull, TextArea, Typography, TypographyParagraph, TypographyParagraphWithContext, TypographyWithContext, VStack, WithTamaguiConfig, useCurrentBreakpointName };
|
|
404
733
|
//# sourceMappingURL=index-browser.es.js.map
|