alouette 8.0.0 → 8.0.2
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 +15 -0
- package/dist/createAlouetteTamagui-browser.es.js +4 -22
- package/dist/createAlouetteTamagui-browser.es.js.map +1 -1
- package/dist/createAlouetteTamagui-node20.cjs +5 -23
- package/dist/createAlouetteTamagui-node20.cjs.map +1 -1
- package/dist/createAlouetteTamagui-node20.mjs +4 -22
- package/dist/createAlouetteTamagui-node20.mjs.map +1 -1
- package/dist/createAlouetteTamagui-react-native.es.js +349 -0
- package/dist/createAlouetteTamagui-react-native.es.js.map +1 -0
- package/dist/index-react-native.es.js +755 -0
- package/dist/index-react-native.es.js.map +1 -0
- package/package.json +22 -22
- package/createAlouetteTamagui.js +0 -1
|
@@ -0,0 +1,755 @@
|
|
|
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';
|
|
7
|
+
|
|
8
|
+
const fullscreenStyle = {
|
|
9
|
+
position: "absolute",
|
|
10
|
+
top: 0,
|
|
11
|
+
left: 0,
|
|
12
|
+
right: 0,
|
|
13
|
+
bottom: 0
|
|
14
|
+
};
|
|
15
|
+
const getBorderAdditionalInteraction = ({
|
|
16
|
+
internalForcedPseudoState,
|
|
17
|
+
disabled,
|
|
18
|
+
interactive
|
|
19
|
+
}) => {
|
|
20
|
+
const prefix = interactive === "text" ? "interactive.forms" : "interactive";
|
|
21
|
+
if (disabled) {
|
|
22
|
+
return {
|
|
23
|
+
borderColor: `$${prefix}.borderColor:disabled`
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
if (process.env.STORYBOOK && internalForcedPseudoState) {
|
|
27
|
+
switch (internalForcedPseudoState) {
|
|
28
|
+
case "hover":
|
|
29
|
+
return {
|
|
30
|
+
borderColor: `$${prefix}.borderColor:hover`
|
|
31
|
+
};
|
|
32
|
+
case "press":
|
|
33
|
+
return {
|
|
34
|
+
borderColor: `$${prefix}.borderColor:press`
|
|
35
|
+
};
|
|
36
|
+
case "focus":
|
|
37
|
+
return {
|
|
38
|
+
borderColor: `$${prefix}.borderColor:focus`
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
borderColor: `$${prefix}.borderColor`,
|
|
44
|
+
hoverStyle: {
|
|
45
|
+
borderColor: `$${prefix}.borderColor:hover`
|
|
46
|
+
},
|
|
47
|
+
pressStyle: {
|
|
48
|
+
borderColor: `$${prefix}.borderColor:press`
|
|
49
|
+
},
|
|
50
|
+
focusStyle: {
|
|
51
|
+
borderColor: `$${prefix}.borderColor:focus`
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
const getBackgroundAdditionalInteraction = ({
|
|
56
|
+
internalForcedPseudoState,
|
|
57
|
+
disabled,
|
|
58
|
+
interactive,
|
|
59
|
+
variant
|
|
60
|
+
}) => {
|
|
61
|
+
const prefix = interactive === "text" ? "interactive.forms" : (
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
63
|
+
`interactive.${variant || "contained"}`
|
|
64
|
+
);
|
|
65
|
+
if (disabled) {
|
|
66
|
+
return {
|
|
67
|
+
backgroundColor: `$${prefix}.backgroundColor:disabled`
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
if (process.env.STORYBOOK && internalForcedPseudoState) {
|
|
71
|
+
switch (internalForcedPseudoState) {
|
|
72
|
+
case "hover":
|
|
73
|
+
return {
|
|
74
|
+
backgroundColor: `$${prefix}.backgroundColor:hover`
|
|
75
|
+
};
|
|
76
|
+
case "press":
|
|
77
|
+
return {
|
|
78
|
+
backgroundColor: `$${prefix}.backgroundColor:press`
|
|
79
|
+
};
|
|
80
|
+
case "focus":
|
|
81
|
+
return {
|
|
82
|
+
backgroundColor: `$${prefix}.backgroundColor:focus`
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
backgroundColor: `$${prefix}.backgroundColor`,
|
|
88
|
+
hoverStyle: {
|
|
89
|
+
backgroundColor: `$${prefix}.backgroundColor:hover`
|
|
90
|
+
},
|
|
91
|
+
pressStyle: {
|
|
92
|
+
backgroundColor: `$${prefix}.backgroundColor:press`
|
|
93
|
+
},
|
|
94
|
+
focusStyle: {
|
|
95
|
+
backgroundColor: `$${prefix}.backgroundColor:focus`
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const internalForcedPseudoState = (val) => ({});
|
|
101
|
+
const withBorder = (val, { props }) => {
|
|
102
|
+
return {
|
|
103
|
+
borderWidth: typeof val === "number" ? val : 1,
|
|
104
|
+
borderColor: "$borderColor",
|
|
105
|
+
...props.interactive ? getBorderAdditionalInteraction(props) : void 0
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
const withBackground = (val, { props }) => {
|
|
109
|
+
const variant = props.interactive === "text" ? "text" : props.variant || "contained";
|
|
110
|
+
if (!val) return {};
|
|
111
|
+
if (!props.role && !props.outlineStyle && props.interactive) {
|
|
112
|
+
throw new Error("A role prop is required while using interactive");
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
backgroundColor: props.interactive ? (
|
|
116
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
117
|
+
`$interactive.${variant}.backgroundColor`
|
|
118
|
+
) : "$mainColor",
|
|
119
|
+
...props.interactive ? getBackgroundAdditionalInteraction(props) : void 0
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
const circularStyle = {
|
|
123
|
+
borderRadius: 1e5,
|
|
124
|
+
padding: 0
|
|
125
|
+
};
|
|
126
|
+
const size = (val) => {
|
|
127
|
+
return { width: val, height: val };
|
|
128
|
+
};
|
|
129
|
+
const circular = {
|
|
130
|
+
true: (val, { props, tokens }) => {
|
|
131
|
+
if (!("size" in props)) {
|
|
132
|
+
return circularStyle;
|
|
133
|
+
}
|
|
134
|
+
const sizePropValue = props.size;
|
|
135
|
+
const sizeValue = tokens.size[sizePropValue];
|
|
136
|
+
return {
|
|
137
|
+
...circularStyle,
|
|
138
|
+
width: sizeValue,
|
|
139
|
+
height: sizeValue,
|
|
140
|
+
maxWidth: sizeValue,
|
|
141
|
+
maxHeight: sizeValue,
|
|
142
|
+
minWidth: sizeValue,
|
|
143
|
+
minHeight: sizeValue
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
};
|
|
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
|
+
};
|
|
156
|
+
const centered = {
|
|
157
|
+
true: {
|
|
158
|
+
alignItems: "center",
|
|
159
|
+
justifyContent: "center"
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const variants$1 = {
|
|
164
|
+
__proto__: null,
|
|
165
|
+
centered: centered,
|
|
166
|
+
circular: circular,
|
|
167
|
+
interactive: interactive,
|
|
168
|
+
internalForcedPseudoState: internalForcedPseudoState,
|
|
169
|
+
size: size,
|
|
170
|
+
withBackground: withBackground,
|
|
171
|
+
withBorder: withBorder
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const Box = styled(View, {
|
|
175
|
+
name: "Box",
|
|
176
|
+
variants: variants$1,
|
|
177
|
+
animation: "fast"
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
const PressableBox = styled(Box, {
|
|
181
|
+
interactive: true
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
function Icon({
|
|
185
|
+
icon,
|
|
186
|
+
size = 20,
|
|
187
|
+
align = "auto",
|
|
188
|
+
contrast,
|
|
189
|
+
color = contrast ? "$contrastTextColor" : "$textColor",
|
|
190
|
+
...props
|
|
191
|
+
}) {
|
|
192
|
+
const style = useStyle({
|
|
193
|
+
color
|
|
194
|
+
// if needed for native
|
|
195
|
+
// resolveValues: Platform.OS === 'web' ? undefined: 'value',
|
|
196
|
+
});
|
|
197
|
+
return /* @__PURE__ */ jsx(Box, { ...props, centered: true, alignSelf: align, size, style, children: icon });
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const IconButtonFrame = styled(PressableBox, {
|
|
201
|
+
name: "IconButtonFrame",
|
|
202
|
+
role: "button",
|
|
203
|
+
centered: true,
|
|
204
|
+
withBorder: true,
|
|
205
|
+
withBackground: true,
|
|
206
|
+
size: 40,
|
|
207
|
+
borderWidth: 1,
|
|
208
|
+
borderRadius: 1e4
|
|
209
|
+
});
|
|
210
|
+
function IconButton({
|
|
211
|
+
icon,
|
|
212
|
+
disabled,
|
|
213
|
+
size = 40,
|
|
214
|
+
...pressableProps
|
|
215
|
+
}) {
|
|
216
|
+
return /* @__PURE__ */ jsx(IconButtonFrame, { size, disabled, ...pressableProps, children: /* @__PURE__ */ jsx(
|
|
217
|
+
Icon,
|
|
218
|
+
{
|
|
219
|
+
size: size / 2,
|
|
220
|
+
color: disabled ? "$contrastDisabled" : void 0,
|
|
221
|
+
contrast: !disabled,
|
|
222
|
+
icon
|
|
223
|
+
}
|
|
224
|
+
) });
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const variants = {
|
|
228
|
+
fullscreen: {
|
|
229
|
+
true: fullscreenStyle
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
const Stack = styled(View, {
|
|
233
|
+
name: "Stack",
|
|
234
|
+
variants: {
|
|
235
|
+
...variants,
|
|
236
|
+
type: {
|
|
237
|
+
h: { flexDirection: "row" },
|
|
238
|
+
v: { flexDirection: "column" }
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
const HStack = styled(Stack, {
|
|
243
|
+
name: "HStack",
|
|
244
|
+
flexDirection: "row",
|
|
245
|
+
variants
|
|
246
|
+
});
|
|
247
|
+
const VStack = styled(Stack, {
|
|
248
|
+
name: "VStack",
|
|
249
|
+
flexDirection: "column"
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
const Typography = styled(Text, {
|
|
253
|
+
name: "Typography",
|
|
254
|
+
fontFamily: "$body",
|
|
255
|
+
color: "$textColor",
|
|
256
|
+
fontWeight: "$regular",
|
|
257
|
+
variants: {
|
|
258
|
+
size: {
|
|
259
|
+
xl: { fontSize: "$xl", lineHeight: "$xl" },
|
|
260
|
+
lg: { fontSize: "$lg", lineHeight: "$lg" },
|
|
261
|
+
md: { fontSize: "$md", lineHeight: "$md" },
|
|
262
|
+
sm: { fontSize: "$sm", lineHeight: "$sm" },
|
|
263
|
+
xs: { fontSize: "$xs", lineHeight: "$xs" }
|
|
264
|
+
},
|
|
265
|
+
weight: {
|
|
266
|
+
regular: { fontWeight: "$regular" },
|
|
267
|
+
bold: { fontWeight: "$bold" },
|
|
268
|
+
black: { fontWeight: "$black" }
|
|
269
|
+
},
|
|
270
|
+
family: {
|
|
271
|
+
heading: { fontFamily: "$heading" },
|
|
272
|
+
body: { fontFamily: "$body" }
|
|
273
|
+
},
|
|
274
|
+
contrast: {
|
|
275
|
+
true: {
|
|
276
|
+
color: "$contrastTextColor"
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
defaultVariants: {
|
|
281
|
+
size: "md",
|
|
282
|
+
weight: "regular",
|
|
283
|
+
family: "body"
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
const TypographyParagraph = styled(Typography, {
|
|
287
|
+
name: "TypographyParagraph",
|
|
288
|
+
tag: "p",
|
|
289
|
+
userSelect: "auto",
|
|
290
|
+
family: "body"
|
|
291
|
+
});
|
|
292
|
+
const TypographySizeContext = createContext(void 0);
|
|
293
|
+
const TypographyWithContext = Typography.styleable(
|
|
294
|
+
({ size, ...props }, ref) => {
|
|
295
|
+
const ancestorSize = useContext(TypographySizeContext);
|
|
296
|
+
const sizeOrAncestorSizeOrDefaultSize = size || ancestorSize;
|
|
297
|
+
if (sizeOrAncestorSizeOrDefaultSize !== size) {
|
|
298
|
+
return /* @__PURE__ */ jsx(TypographySizeContext.Provider, { value: sizeOrAncestorSizeOrDefaultSize, children: /* @__PURE__ */ jsx(Typography, { ref, size, ...props }) });
|
|
299
|
+
}
|
|
300
|
+
return /* @__PURE__ */ jsx(Typography, { ref, size, ...props });
|
|
301
|
+
}
|
|
302
|
+
);
|
|
303
|
+
const TypographyParagraphWithContext = TypographyParagraph.styleable(
|
|
304
|
+
({ size, ...props }, ref) => {
|
|
305
|
+
const ancestorSize = useContext(TypographySizeContext);
|
|
306
|
+
const sizeOrAncestorSizeOrDefaultSize = size || ancestorSize;
|
|
307
|
+
return /* @__PURE__ */ jsx(TypographySizeContext.Provider, { value: sizeOrAncestorSizeOrDefaultSize, children: /* @__PURE__ */ jsx(Typography, { ref, size, ...props }) });
|
|
308
|
+
}
|
|
309
|
+
);
|
|
310
|
+
|
|
311
|
+
const ButtonFrame = styled(PressableBox, {
|
|
312
|
+
name: "ButtonFrame",
|
|
313
|
+
role: "button",
|
|
314
|
+
centered: true,
|
|
315
|
+
minHeight: 42,
|
|
316
|
+
variants: {
|
|
317
|
+
size: {
|
|
318
|
+
sm: {
|
|
319
|
+
paddingHorizontal: "$sm",
|
|
320
|
+
borderRadius: "$3",
|
|
321
|
+
minHeight: 32
|
|
322
|
+
},
|
|
323
|
+
md: {
|
|
324
|
+
paddingHorizontal: "$md",
|
|
325
|
+
borderRadius: "$sm",
|
|
326
|
+
minHeight: 42
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
variant: {
|
|
330
|
+
contained: {
|
|
331
|
+
withBackground: true
|
|
332
|
+
},
|
|
333
|
+
outlined: {
|
|
334
|
+
withBackground: true,
|
|
335
|
+
withBorder: true
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
defaultVariants: {
|
|
340
|
+
variant: "contained",
|
|
341
|
+
size: "md"
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
function Button({
|
|
345
|
+
icon,
|
|
346
|
+
text,
|
|
347
|
+
disabled,
|
|
348
|
+
variant = "contained",
|
|
349
|
+
size = "md",
|
|
350
|
+
...pressableProps
|
|
351
|
+
}) {
|
|
352
|
+
return /* @__PURE__ */ jsx(
|
|
353
|
+
ButtonFrame,
|
|
354
|
+
{
|
|
355
|
+
disabled,
|
|
356
|
+
variant,
|
|
357
|
+
size,
|
|
358
|
+
...pressableProps,
|
|
359
|
+
children: /* @__PURE__ */ jsxs(HStack, { gap: "$xs", alignItems: "center", children: [
|
|
360
|
+
icon && /* @__PURE__ */ jsx(
|
|
361
|
+
Icon,
|
|
362
|
+
{
|
|
363
|
+
color: disabled ? "$contrastDisabled" : void 0,
|
|
364
|
+
contrast: variant === "contained" && !disabled,
|
|
365
|
+
icon,
|
|
366
|
+
size: size === "sm" ? 16 : 20
|
|
367
|
+
}
|
|
368
|
+
),
|
|
369
|
+
/* @__PURE__ */ jsx(
|
|
370
|
+
Typography,
|
|
371
|
+
{
|
|
372
|
+
size,
|
|
373
|
+
weight: "bold",
|
|
374
|
+
paddingVertical: size === "sm" ? "$1" : "$xs",
|
|
375
|
+
color: disabled ? "$contrastDisabled" : void 0,
|
|
376
|
+
contrast: variant === "contained" && !disabled,
|
|
377
|
+
children: text
|
|
378
|
+
}
|
|
379
|
+
)
|
|
380
|
+
] })
|
|
381
|
+
}
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function FeedbackIcon({ type }) {
|
|
386
|
+
switch (type) {
|
|
387
|
+
case "warning":
|
|
388
|
+
return /* @__PURE__ */ jsx(WarningCircleRegularIcon, {});
|
|
389
|
+
case "success":
|
|
390
|
+
return /* @__PURE__ */ jsx(CheckRegularIcon, {});
|
|
391
|
+
case "danger":
|
|
392
|
+
return /* @__PURE__ */ jsx(WarningRegularIcon, {});
|
|
393
|
+
default:
|
|
394
|
+
return /* @__PURE__ */ jsx(InfoRegularIcon, {});
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
const MessageFrame = styled(Box, {
|
|
399
|
+
name: "MessageFrame",
|
|
400
|
+
alignItems: "center",
|
|
401
|
+
withBackground: true,
|
|
402
|
+
borderRadius: "$md",
|
|
403
|
+
paddingHorizontal: "$4",
|
|
404
|
+
flexDirection: "row",
|
|
405
|
+
gap: "$4"
|
|
406
|
+
});
|
|
407
|
+
const MessageText = styled(Typography, {
|
|
408
|
+
name: "MessageText",
|
|
409
|
+
contrast: true,
|
|
410
|
+
size: "md",
|
|
411
|
+
flexGrow: 1,
|
|
412
|
+
paddingVertical: "$4",
|
|
413
|
+
variants: {
|
|
414
|
+
centered: {
|
|
415
|
+
true: {
|
|
416
|
+
textAlign: "center",
|
|
417
|
+
paddingHorizontal: "$4"
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
const MessageIconContainer = styled(View, {
|
|
423
|
+
name: "MessageIconContainer",
|
|
424
|
+
alignItems: "center"
|
|
425
|
+
});
|
|
426
|
+
const MessageDismissButtonContainer = styled(View, {
|
|
427
|
+
name: "MessageDismissButtonContainer",
|
|
428
|
+
marginRight: "$2"
|
|
429
|
+
});
|
|
430
|
+
function Message({
|
|
431
|
+
theme,
|
|
432
|
+
textCentered,
|
|
433
|
+
children,
|
|
434
|
+
onDismiss
|
|
435
|
+
}) {
|
|
436
|
+
return /* @__PURE__ */ jsxs(MessageFrame, { theme, children: [
|
|
437
|
+
textCentered ? null : /* @__PURE__ */ jsx(MessageIconContainer, { children: /* @__PURE__ */ jsx(Icon, { contrast: true, icon: /* @__PURE__ */ jsx(FeedbackIcon, { type: theme }) }) }),
|
|
438
|
+
/* @__PURE__ */ jsx(MessageText, { centered: textCentered, children }),
|
|
439
|
+
onDismiss ? /* @__PURE__ */ jsx(MessageDismissButtonContainer, { children: /* @__PURE__ */ jsx(IconButton, { icon: /* @__PURE__ */ jsx(XRegularIcon, {}), size: 40 }) }) : null
|
|
440
|
+
] });
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
const StyledInputText = styled(TextInput, {
|
|
444
|
+
variants: variants$1,
|
|
445
|
+
padding: "$xs",
|
|
446
|
+
borderRadius: "$sm",
|
|
447
|
+
// @ts-expect-error missing prop but seems to work
|
|
448
|
+
color: "$forms.textColor",
|
|
449
|
+
withBorder: true,
|
|
450
|
+
withBackground: true,
|
|
451
|
+
borderWidth: 1,
|
|
452
|
+
borderBottomWidth: 3,
|
|
453
|
+
// reset browser style
|
|
454
|
+
outlineStyle: "none"
|
|
455
|
+
});
|
|
456
|
+
const InputText = styled(StyledInputText, {
|
|
457
|
+
name: "InputText",
|
|
458
|
+
interactive: "text",
|
|
459
|
+
theme: "primary"
|
|
460
|
+
// animation: "formElement", // remove all style ?
|
|
461
|
+
});
|
|
462
|
+
const TextArea = styled(InputText, {
|
|
463
|
+
multiline: true
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
const ScrollView = styled(
|
|
467
|
+
ScrollView$1,
|
|
468
|
+
{
|
|
469
|
+
name: "ScrollView",
|
|
470
|
+
scrollEnabled: true,
|
|
471
|
+
variants: {
|
|
472
|
+
fullscreen: {
|
|
473
|
+
true: fullscreenStyle
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
accept: {
|
|
479
|
+
contentContainerStyle: "style"
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
);
|
|
483
|
+
|
|
484
|
+
const StoryTitle = styled(Typography, {
|
|
485
|
+
family: "heading",
|
|
486
|
+
weight: "black",
|
|
487
|
+
variants: {
|
|
488
|
+
level: {
|
|
489
|
+
1: { size: "xl", marginBottom: "$8" },
|
|
490
|
+
2: { size: "lg", marginBottom: "$8" },
|
|
491
|
+
3: { size: "md", marginBottom: "$3" },
|
|
492
|
+
4: { size: "sm", marginBottom: "$3" }
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
defaultVariants: {
|
|
496
|
+
level: 1
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
const InternalStorySection = styled(VStack, {
|
|
501
|
+
marginBottom: "$8",
|
|
502
|
+
paddingHorizontal: "$4",
|
|
503
|
+
marginHorizontal: "$-4",
|
|
504
|
+
variants: {
|
|
505
|
+
withBackground: {
|
|
506
|
+
true: {
|
|
507
|
+
backgroundColor: "$backgroundColor"
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
function StorySection({
|
|
513
|
+
title,
|
|
514
|
+
children,
|
|
515
|
+
level = 1,
|
|
516
|
+
withBackground,
|
|
517
|
+
...props
|
|
518
|
+
}) {
|
|
519
|
+
return /* @__PURE__ */ jsxs(InternalStorySection, { withBackground, ...props, children: [
|
|
520
|
+
/* @__PURE__ */ jsx(StoryTitle, { level: level + 1, children: title }),
|
|
521
|
+
children
|
|
522
|
+
] });
|
|
523
|
+
}
|
|
524
|
+
function SubSection({
|
|
525
|
+
title,
|
|
526
|
+
children,
|
|
527
|
+
withBackground,
|
|
528
|
+
...props
|
|
529
|
+
}) {
|
|
530
|
+
return /* @__PURE__ */ jsxs(
|
|
531
|
+
InternalStorySection,
|
|
532
|
+
{
|
|
533
|
+
marginBottom: "$4",
|
|
534
|
+
withBackground,
|
|
535
|
+
...props,
|
|
536
|
+
children: [
|
|
537
|
+
/* @__PURE__ */ jsx(StoryTitle, { level: 3, children: title }),
|
|
538
|
+
children
|
|
539
|
+
]
|
|
540
|
+
}
|
|
541
|
+
);
|
|
542
|
+
}
|
|
543
|
+
function Story({ preview, children }) {
|
|
544
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
545
|
+
preview && /* @__PURE__ */ jsx(StorySection, { title: "Preview", paddingBottom: "$12", children: preview }),
|
|
546
|
+
children
|
|
547
|
+
] });
|
|
548
|
+
}
|
|
549
|
+
Story.Section = StorySection;
|
|
550
|
+
Story.SubSection = SubSection;
|
|
551
|
+
|
|
552
|
+
function StoryContainer({
|
|
553
|
+
title,
|
|
554
|
+
children
|
|
555
|
+
}) {
|
|
556
|
+
return /* @__PURE__ */ jsxs(ScrollView, { theme: "light", background: "#fff", padding: "$4", children: [
|
|
557
|
+
/* @__PURE__ */ jsx(StoryTitle, { level: 1, children: title }),
|
|
558
|
+
children
|
|
559
|
+
] });
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
const StoryDecorator = (storyFn, { name, container }) => {
|
|
563
|
+
if (container === false) return storyFn();
|
|
564
|
+
return /* @__PURE__ */ jsx(StoryContainer, { title: name, children: storyFn() });
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
function StoryGridRow({
|
|
568
|
+
children,
|
|
569
|
+
breakpoint = "small",
|
|
570
|
+
flexWrap
|
|
571
|
+
}) {
|
|
572
|
+
return /* @__PURE__ */ jsx(
|
|
573
|
+
View,
|
|
574
|
+
{
|
|
575
|
+
flexDirection: "column",
|
|
576
|
+
...{
|
|
577
|
+
[`$${breakpoint}`]: {
|
|
578
|
+
flexDirection: "row",
|
|
579
|
+
marginVertical: "$-1",
|
|
580
|
+
marginBottom: "$4",
|
|
581
|
+
flexWrap: flexWrap ? "wrap" : void 0,
|
|
582
|
+
gap: flexWrap ? "$xs" : void 0
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
children: Children.map(children, (child) => /* @__PURE__ */ jsx(
|
|
586
|
+
View,
|
|
587
|
+
{
|
|
588
|
+
paddingTop: "$2",
|
|
589
|
+
paddingBottom: "$4",
|
|
590
|
+
...{
|
|
591
|
+
[`$${breakpoint}`]: {
|
|
592
|
+
flexGrow: 1,
|
|
593
|
+
flexBasis: flexWrap ? void 0 : 0,
|
|
594
|
+
paddingTop: 0,
|
|
595
|
+
paddingBottom: 0,
|
|
596
|
+
marginVertical: "$2"
|
|
597
|
+
}
|
|
598
|
+
},
|
|
599
|
+
children: child
|
|
600
|
+
}
|
|
601
|
+
))
|
|
602
|
+
}
|
|
603
|
+
);
|
|
604
|
+
}
|
|
605
|
+
function StoryGridCol({
|
|
606
|
+
title,
|
|
607
|
+
children,
|
|
608
|
+
platform = "all"
|
|
609
|
+
}) {
|
|
610
|
+
const isNative = Platform.OS === "ios" || Platform.OS === "android";
|
|
611
|
+
if (Platform.OS === "web" && platform === "native") {
|
|
612
|
+
return null;
|
|
613
|
+
}
|
|
614
|
+
if (isNative && platform === "web") {
|
|
615
|
+
return null;
|
|
616
|
+
}
|
|
617
|
+
return title ? /* @__PURE__ */ jsxs(VStack, { children: [
|
|
618
|
+
/* @__PURE__ */ jsx(StoryTitle, { level: 4, numberOfLines: 1, children: title }),
|
|
619
|
+
children
|
|
620
|
+
] }) : children;
|
|
621
|
+
}
|
|
622
|
+
const StoryGrid = {
|
|
623
|
+
Row: StoryGridRow,
|
|
624
|
+
Col: StoryGridCol
|
|
625
|
+
};
|
|
626
|
+
|
|
627
|
+
function WithTamaguiConfig({
|
|
628
|
+
render
|
|
629
|
+
}) {
|
|
630
|
+
const config = useConfiguration();
|
|
631
|
+
return render(config);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
var BreakpointNameEnum = /* @__PURE__ */ ((BreakpointNameEnum2) => {
|
|
635
|
+
BreakpointNameEnum2["BASE"] = "base";
|
|
636
|
+
BreakpointNameEnum2["SMALL"] = "small";
|
|
637
|
+
BreakpointNameEnum2["MEDIUM"] = "medium";
|
|
638
|
+
BreakpointNameEnum2["LARGE"] = "large";
|
|
639
|
+
BreakpointNameEnum2["WIDE"] = "wide";
|
|
640
|
+
return BreakpointNameEnum2;
|
|
641
|
+
})(BreakpointNameEnum || {});
|
|
642
|
+
|
|
643
|
+
function useCurrentBreakpointName() {
|
|
644
|
+
const media = useMedia();
|
|
645
|
+
if (media.wide) return BreakpointNameEnum.WIDE;
|
|
646
|
+
if (media.large) return BreakpointNameEnum.LARGE;
|
|
647
|
+
if (media.medium) return BreakpointNameEnum.MEDIUM;
|
|
648
|
+
if (media.small) return BreakpointNameEnum.SMALL;
|
|
649
|
+
return BreakpointNameEnum.BASE;
|
|
650
|
+
}
|
|
651
|
+
function useCurrentBreakpointNameFiltered(names) {
|
|
652
|
+
const media = useMedia();
|
|
653
|
+
if (names.includes(BreakpointNameEnum.WIDE) && media.wide) {
|
|
654
|
+
return BreakpointNameEnum.WIDE;
|
|
655
|
+
}
|
|
656
|
+
if (names.includes(BreakpointNameEnum.LARGE) && media.large) {
|
|
657
|
+
return BreakpointNameEnum.LARGE;
|
|
658
|
+
}
|
|
659
|
+
if (names.includes(BreakpointNameEnum.MEDIUM) && media.medium) {
|
|
660
|
+
return BreakpointNameEnum.MEDIUM;
|
|
661
|
+
}
|
|
662
|
+
if (names.includes(BreakpointNameEnum.SMALL) && media.small) {
|
|
663
|
+
return BreakpointNameEnum.SMALL;
|
|
664
|
+
}
|
|
665
|
+
return BreakpointNameEnum.BASE;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
function SwitchBreakpointsUsingDisplayNone({
|
|
669
|
+
...breakpoints
|
|
670
|
+
}) {
|
|
671
|
+
const entries = Object.entries(breakpoints);
|
|
672
|
+
return entries.map(([name, node], index) => {
|
|
673
|
+
return /* @__PURE__ */ jsx(
|
|
674
|
+
View,
|
|
675
|
+
{
|
|
676
|
+
display: name === "base" ? "flex" : "none",
|
|
677
|
+
...name === "base" ? void 0 : {
|
|
678
|
+
display: "none",
|
|
679
|
+
[`$${name}`]: { display: "flex" }
|
|
680
|
+
},
|
|
681
|
+
...index + 1 in entries ? { [`$${entries[index + 1][0]}`]: { display: "none" } } : void 0,
|
|
682
|
+
children: node
|
|
683
|
+
},
|
|
684
|
+
name
|
|
685
|
+
);
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
function SwitchBreakpointsUsingNull({
|
|
689
|
+
children,
|
|
690
|
+
...breakpoints
|
|
691
|
+
}) {
|
|
692
|
+
const currentBreakpointName = useCurrentBreakpointNameFiltered(
|
|
693
|
+
Object.keys(breakpoints)
|
|
694
|
+
);
|
|
695
|
+
return breakpoints[currentBreakpointName] ?? null;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
function AlouetteProvider({
|
|
699
|
+
children,
|
|
700
|
+
tamaguiConfig
|
|
701
|
+
}) {
|
|
702
|
+
return /* @__PURE__ */ jsx(TamaguiProvider, { config: tamaguiConfig, defaultTheme: "light", children });
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
const AlouetteDecorator = (storyFn, context) => (
|
|
706
|
+
// eslint-disable-next-line react/destructuring-assignment
|
|
707
|
+
/* @__PURE__ */ jsx(AlouetteProvider, { tamaguiConfig: context.parameters.tamaguiConfig, children: storyFn(context) })
|
|
708
|
+
);
|
|
709
|
+
|
|
710
|
+
const Separator = styled(Stack$1, {
|
|
711
|
+
name: "Separator",
|
|
712
|
+
flexGrow: 1,
|
|
713
|
+
flexShrink: 0,
|
|
714
|
+
height: 0,
|
|
715
|
+
maxHeight: 0,
|
|
716
|
+
borderColor: "$borderColor",
|
|
717
|
+
borderWidth: 0,
|
|
718
|
+
borderBottomWidth: 1,
|
|
719
|
+
y: -0.5,
|
|
720
|
+
variants: {
|
|
721
|
+
vertical: {
|
|
722
|
+
true: {
|
|
723
|
+
height: "auto",
|
|
724
|
+
maxHeight: "auto",
|
|
725
|
+
width: 0,
|
|
726
|
+
maxWidth: 0,
|
|
727
|
+
borderBottomWidth: 0,
|
|
728
|
+
borderRightWidth: 1,
|
|
729
|
+
y: 0,
|
|
730
|
+
x: -0.5
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
});
|
|
735
|
+
|
|
736
|
+
function PressableListItem({
|
|
737
|
+
children,
|
|
738
|
+
onPress
|
|
739
|
+
}) {
|
|
740
|
+
return /* @__PURE__ */ jsx(Pressable, { onPress, children: /* @__PURE__ */ jsxs(
|
|
741
|
+
HStack,
|
|
742
|
+
{
|
|
743
|
+
justifyContent: "space-between",
|
|
744
|
+
paddingHorizontal: "$4",
|
|
745
|
+
paddingVertical: "$3",
|
|
746
|
+
children: [
|
|
747
|
+
/* @__PURE__ */ jsx(View, { children }),
|
|
748
|
+
/* @__PURE__ */ jsx(Stack, { justifyContent: "center", children: /* @__PURE__ */ jsx(Icon, { icon: /* @__PURE__ */ jsx(CaretRightRegularIcon, {}), size: 20 }) })
|
|
749
|
+
]
|
|
750
|
+
}
|
|
751
|
+
) });
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
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 };
|
|
755
|
+
//# sourceMappingURL=index-react-native.es.js.map
|