@entropix/react-native 0.3.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/accordion.cjs +26 -0
  2. package/dist/accordion.d.cts +34 -0
  3. package/dist/accordion.d.ts +34 -0
  4. package/dist/accordion.js +5 -0
  5. package/dist/button.cjs +14 -0
  6. package/dist/button.d.cts +35 -0
  7. package/dist/button.d.ts +35 -0
  8. package/dist/button.js +5 -0
  9. package/dist/checkbox.cjs +14 -0
  10. package/dist/checkbox.d.cts +41 -0
  11. package/dist/checkbox.d.ts +41 -0
  12. package/dist/checkbox.js +5 -0
  13. package/dist/chunk-2SQB7RNT.cjs +110 -0
  14. package/dist/chunk-3MHE2C74.js +143 -0
  15. package/dist/chunk-45KMMZUT.js +131 -0
  16. package/dist/chunk-64DK6YFL.js +164 -0
  17. package/dist/chunk-73BDGPZT.js +89 -0
  18. package/dist/chunk-B5YFEA66.cjs +243 -0
  19. package/dist/chunk-BOUIB4OY.cjs +56 -0
  20. package/dist/chunk-C6HF6QXK.js +154 -0
  21. package/dist/chunk-CXQNNEPC.js +249 -0
  22. package/dist/chunk-EFRYMWJB.js +86 -0
  23. package/dist/chunk-FQUZIDVS.cjs +174 -0
  24. package/dist/chunk-G7WPUTB6.cjs +258 -0
  25. package/dist/chunk-HH3CEDSH.js +122 -0
  26. package/dist/chunk-IRQWSFCZ.cjs +156 -0
  27. package/dist/chunk-KU24A5PQ.js +92 -0
  28. package/dist/chunk-OMKUPSHJ.cjs +95 -0
  29. package/dist/chunk-P5NAXMSC.cjs +91 -0
  30. package/dist/chunk-PKDXWKLO.cjs +245 -0
  31. package/dist/chunk-PVTPOJRU.js +155 -0
  32. package/dist/chunk-Q7TEJ62Q.cjs +160 -0
  33. package/dist/chunk-THX22NZW.cjs +146 -0
  34. package/dist/chunk-UHVTF2Y4.js +172 -0
  35. package/dist/chunk-UYXJHKYK.cjs +166 -0
  36. package/dist/chunk-VP567WZL.js +237 -0
  37. package/dist/chunk-XBNX4SLA.js +105 -0
  38. package/dist/chunk-XND7AIKO.cjs +133 -0
  39. package/dist/chunk-XSOLJOBG.js +238 -0
  40. package/dist/chunk-Z2MBHXUQ.cjs +127 -0
  41. package/dist/chunk-ZPAOLIIG.cjs +88 -0
  42. package/dist/chunk-ZYOTKLBG.js +52 -0
  43. package/dist/dialog.cjs +38 -0
  44. package/dist/dialog.d.cts +83 -0
  45. package/dist/dialog.d.ts +83 -0
  46. package/dist/dialog.js +5 -0
  47. package/dist/index.cjs +187 -2063
  48. package/dist/index.d.cts +21 -651
  49. package/dist/index.d.ts +21 -651
  50. package/dist/index.js +15 -2025
  51. package/dist/input.cjs +14 -0
  52. package/dist/input.d.cts +57 -0
  53. package/dist/input.d.ts +57 -0
  54. package/dist/input.js +5 -0
  55. package/dist/layout.cjs +25 -0
  56. package/dist/layout.d.cts +108 -0
  57. package/dist/layout.d.ts +108 -0
  58. package/dist/layout.js +4 -0
  59. package/dist/menu.cjs +26 -0
  60. package/dist/menu.d.cts +34 -0
  61. package/dist/menu.d.ts +34 -0
  62. package/dist/menu.js +5 -0
  63. package/dist/radio.cjs +18 -0
  64. package/dist/radio.d.cts +55 -0
  65. package/dist/radio.d.ts +55 -0
  66. package/dist/radio.js +5 -0
  67. package/dist/select.cjs +26 -0
  68. package/dist/select.d.cts +86 -0
  69. package/dist/select.d.ts +86 -0
  70. package/dist/select.js +5 -0
  71. package/dist/switch.cjs +14 -0
  72. package/dist/switch.d.cts +27 -0
  73. package/dist/switch.d.ts +27 -0
  74. package/dist/switch.js +5 -0
  75. package/dist/tabs.cjs +26 -0
  76. package/dist/tabs.d.cts +33 -0
  77. package/dist/tabs.d.ts +33 -0
  78. package/dist/tabs.js +5 -0
  79. package/dist/textarea.cjs +14 -0
  80. package/dist/textarea.d.cts +55 -0
  81. package/dist/textarea.d.ts +55 -0
  82. package/dist/textarea.js +5 -0
  83. package/dist/theme.cjs +20 -0
  84. package/dist/theme.d.cts +59 -0
  85. package/dist/theme.d.ts +59 -0
  86. package/dist/theme.js +3 -0
  87. package/dist/toggle.cjs +18 -0
  88. package/dist/toggle.d.cts +41 -0
  89. package/dist/toggle.d.ts +41 -0
  90. package/dist/toggle.js +5 -0
  91. package/package.json +146 -4
  92. package/dist/index.cjs.map +0 -1
  93. package/dist/index.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,2070 +1,194 @@
1
1
  'use strict';
2
2
 
3
- var react = require('react');
4
- var native = require('@entropix/tokens/native');
5
- var light = require('@entropix/tokens/native/light');
6
- var dark = require('@entropix/tokens/native/dark');
7
- var jsxRuntime = require('react/jsx-runtime');
8
- var reactNative = require('react-native');
9
- var core = require('@entropix/core');
3
+ var chunkFQUZIDVS_cjs = require('./chunk-FQUZIDVS.cjs');
4
+ var chunkUYXJHKYK_cjs = require('./chunk-UYXJHKYK.cjs');
5
+ var chunkIRQWSFCZ_cjs = require('./chunk-IRQWSFCZ.cjs');
6
+ var chunkTHX22NZW_cjs = require('./chunk-THX22NZW.cjs');
7
+ var chunkB5YFEA66_cjs = require('./chunk-B5YFEA66.cjs');
8
+ var chunkG7WPUTB6_cjs = require('./chunk-G7WPUTB6.cjs');
9
+ var chunkXND7AIKO_cjs = require('./chunk-XND7AIKO.cjs');
10
+ var chunkOMKUPSHJ_cjs = require('./chunk-OMKUPSHJ.cjs');
11
+ var chunkZPAOLIIG_cjs = require('./chunk-ZPAOLIIG.cjs');
12
+ var chunkPKDXWKLO_cjs = require('./chunk-PKDXWKLO.cjs');
13
+ var chunk2SQB7RNT_cjs = require('./chunk-2SQB7RNT.cjs');
14
+ var chunkQ7TEJ62Q_cjs = require('./chunk-Q7TEJ62Q.cjs');
15
+ var chunkZ2MBHXUQ_cjs = require('./chunk-Z2MBHXUQ.cjs');
16
+ var chunkP5NAXMSC_cjs = require('./chunk-P5NAXMSC.cjs');
17
+ var chunkBOUIB4OY_cjs = require('./chunk-BOUIB4OY.cjs');
10
18
 
11
- // src/theme/theme-context.tsx
12
- var ThemeContext = react.createContext({
13
- mode: "light",
14
- tokens: light.tokens,
15
- baseTokens: native.tokens
16
- });
17
- function EntropixProvider({
18
- mode = "light",
19
- children
20
- }) {
21
- const value = react.useMemo(
22
- () => ({
23
- mode,
24
- tokens: mode === "dark" ? dark.tokens : light.tokens,
25
- baseTokens: native.tokens
26
- }),
27
- [mode]
28
- );
29
- return /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value, children });
30
- }
31
- function useTheme() {
32
- return react.useContext(ThemeContext);
33
- }
34
19
 
35
- // src/utils/map-accessibility-to-rn.ts
36
- var RN_ROLE_MAP = {
37
- button: "button",
38
- checkbox: "checkbox",
39
- switch: "switch",
40
- dialog: "none",
41
- // Modal component handles dialog semantics
42
- alertdialog: "alert",
43
- link: "link",
44
- tab: "tab",
45
- tablist: "tablist",
46
- menu: "menu",
47
- menuitem: "menuitem",
48
- radio: "radio",
49
- radiogroup: "radiogroup",
50
- slider: "adjustable",
51
- spinbutton: "spinbutton",
52
- textbox: "text",
53
- combobox: "combobox",
54
- progressbar: "progressbar",
55
- alert: "alert",
56
- status: "text",
57
- tooltip: "text",
58
- none: "none",
59
- presentation: "none"
60
- };
61
- function mapAccessibilityToRN(props) {
62
- const result = { accessible: true };
63
- if (props.role) {
64
- result.accessibilityRole = RN_ROLE_MAP[props.role] ?? props.role;
65
- }
66
- if (props.label) {
67
- result.accessibilityLabel = props.label;
68
- }
69
- if (props.describedBy) {
70
- result.accessibilityHint = props.describedBy;
71
- }
72
- if (props.labelledBy) {
73
- result.accessibilityLabelledBy = props.labelledBy;
74
- }
75
- const state = {};
76
- let hasState = false;
77
- if (props.disabled !== void 0) {
78
- state.disabled = props.disabled;
79
- hasState = true;
80
- }
81
- if (props.expanded !== void 0) {
82
- state.expanded = props.expanded;
83
- hasState = true;
84
- }
85
- if (props.selected !== void 0) {
86
- state.selected = props.selected;
87
- hasState = true;
88
- }
89
- if (props.checked !== void 0) {
90
- state.checked = props.checked;
91
- hasState = true;
92
- }
93
- if (props.busy !== void 0) {
94
- state.busy = props.busy;
95
- hasState = true;
96
- }
97
- if (hasState) {
98
- result.accessibilityState = state;
99
- }
100
- if (props.valueNow !== void 0 || props.valueMin !== void 0 || props.valueMax !== void 0 || props.valueText !== void 0) {
101
- result.accessibilityValue = {};
102
- if (props.valueNow !== void 0)
103
- result.accessibilityValue.now = props.valueNow;
104
- if (props.valueMin !== void 0)
105
- result.accessibilityValue.min = props.valueMin;
106
- if (props.valueMax !== void 0)
107
- result.accessibilityValue.max = props.valueMax;
108
- if (props.valueText !== void 0)
109
- result.accessibilityValue.text = props.valueText;
110
- }
111
- if (props.live) {
112
- result.accessibilityLiveRegion = props.live === "off" ? "none" : props.live;
113
- }
114
- if (props.hidden) {
115
- result.accessibilityElementsHidden = true;
116
- result.importantForAccessibility = "no-hide-descendants";
117
- }
118
- return result;
119
- }
120
- function Button({
121
- onPress,
122
- disabled,
123
- loading,
124
- variant = "primary",
125
- size = "md",
126
- style,
127
- textStyle,
128
- children,
129
- ...rest
130
- }) {
131
- const { tokens: t, baseTokens: bt } = useTheme();
132
- const { isDisabled, isLoading, getButtonProps } = core.useButton({
133
- disabled,
134
- loading,
135
- onPress,
136
- elementType: "div"
137
- });
138
- const propGetterReturn = getButtonProps();
139
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
140
- const handlePress = react.useCallback(() => {
141
- propGetterReturn.onAction?.();
142
- }, [propGetterReturn.onAction]);
143
- const sizeStyles = getSizeStyle(size, bt);
144
- const variantStyles = getVariantStyle(variant, t);
145
- const labelColor = getVariantTextColor(variant, t);
146
- const isInactive = isDisabled || isLoading;
147
- return /* @__PURE__ */ jsxRuntime.jsx(
148
- reactNative.Pressable,
149
- {
150
- ...rnAccessibility,
151
- ...rest,
152
- disabled: isInactive,
153
- onPress: isInactive ? void 0 : handlePress,
154
- style: [
155
- baseStyle,
156
- sizeStyles.container,
157
- variantStyles,
158
- isInactive && { opacity: 0.5 },
159
- style
160
- ],
161
- children: typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
162
- reactNative.Text,
163
- {
164
- style: [
165
- { color: labelColor, fontSize: sizeStyles.fontSize, fontWeight: "500" },
166
- textStyle
167
- ],
168
- children
169
- }
170
- ) : children
171
- }
172
- );
173
- }
174
- var baseStyle = {
175
- flexDirection: "row",
176
- alignItems: "center",
177
- justifyContent: "center"
178
- };
179
- function getSizeStyle(size, bt) {
180
- switch (size) {
181
- case "sm":
182
- return {
183
- container: {
184
- paddingVertical: bt.entropixSpacing1,
185
- paddingHorizontal: bt.entropixSpacing3,
186
- borderRadius: bt.entropixRadiusSm,
187
- gap: bt.entropixButtonGap
188
- },
189
- fontSize: bt.entropixFontSizeXs
190
- };
191
- case "lg":
192
- return {
193
- container: {
194
- paddingVertical: bt.entropixSpacing3,
195
- paddingHorizontal: bt.entropixSpacing6,
196
- borderRadius: bt.entropixRadiusLg,
197
- gap: bt.entropixButtonGap
198
- },
199
- fontSize: bt.entropixFontSizeBase
200
- };
201
- default:
202
- return {
203
- container: {
204
- paddingVertical: bt.entropixButtonPaddingY,
205
- paddingHorizontal: bt.entropixButtonPaddingX,
206
- borderRadius: bt.entropixButtonBorderRadius,
207
- gap: bt.entropixButtonGap
208
- },
209
- fontSize: bt.entropixButtonFontSize
210
- };
211
- }
212
- }
213
- function getVariantStyle(variant, t) {
214
- switch (variant) {
215
- case "primary":
216
- return { backgroundColor: t.entropixButtonPrimaryBg, borderWidth: 1, borderColor: t.entropixButtonPrimaryBorder };
217
- case "secondary":
218
- return { backgroundColor: t.entropixButtonSecondaryBg, borderWidth: 1, borderColor: t.entropixButtonSecondaryBorder };
219
- case "outline":
220
- return { backgroundColor: "transparent", borderWidth: 1, borderColor: t.entropixColorBorderDefault };
221
- case "ghost":
222
- return { backgroundColor: "transparent", borderWidth: 1, borderColor: "transparent" };
223
- case "danger":
224
- return { backgroundColor: t.entropixButtonDangerBg, borderWidth: 1, borderColor: t.entropixButtonDangerBorder };
225
- }
226
- }
227
- function getVariantTextColor(variant, t) {
228
- switch (variant) {
229
- case "primary":
230
- return t.entropixButtonPrimaryText;
231
- case "secondary":
232
- return t.entropixButtonSecondaryText;
233
- case "outline":
234
- case "ghost":
235
- return t.entropixColorTextPrimary;
236
- case "danger":
237
- return t.entropixButtonDangerText;
238
- }
239
- }
240
- function Toggle(props) {
241
- return /* @__PURE__ */ jsxRuntime.jsx(ToggleInner, { ...props, role: "checkbox" });
242
- }
243
- function ToggleInner({
244
- checked,
245
- defaultChecked,
246
- onChange,
247
- disabled,
248
- label,
249
- role = "checkbox",
250
- style,
251
- textStyle,
252
- children,
253
- ...rest
254
- }) {
255
- const { tokens: t, baseTokens: bt } = useTheme();
256
- const { isDisabled, getToggleProps } = core.useToggle({
257
- checked,
258
- defaultChecked,
259
- onChange,
260
- disabled,
261
- role
262
- });
263
- const propGetterReturn = getToggleProps();
264
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
265
- const isChecked = propGetterReturn.accessibility.checked === true;
266
- if (label) {
267
- rnAccessibility.accessibilityLabel = label;
268
- }
269
- const handlePress = react.useCallback(() => {
270
- propGetterReturn.onAction?.();
271
- }, [propGetterReturn.onAction]);
272
- return /* @__PURE__ */ jsxRuntime.jsx(
273
- reactNative.Pressable,
274
- {
275
- ...rnAccessibility,
276
- ...rest,
277
- disabled: isDisabled,
278
- onPress: isDisabled ? void 0 : handlePress,
279
- style: [
280
- {
281
- flexDirection: "row",
282
- alignItems: "center",
283
- justifyContent: "center",
284
- paddingVertical: bt.entropixSpacing2,
285
- paddingHorizontal: bt.entropixSpacing3,
286
- borderWidth: 1,
287
- borderColor: isChecked ? "transparent" : t.entropixColorBorderDefault,
288
- borderRadius: bt.entropixRadiusMd,
289
- backgroundColor: isChecked ? t.entropixColorActionPrimaryDefault : t.entropixColorBgPrimary
290
- },
291
- isDisabled && { opacity: 0.5 },
292
- style
293
- ],
294
- children: typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
295
- reactNative.Text,
296
- {
297
- style: [
298
- {
299
- fontSize: bt.entropixFontSizeSm,
300
- fontWeight: "500",
301
- color: isChecked ? t.entropixColorTextInverse : t.entropixColorTextPrimary
302
- },
303
- textStyle
304
- ],
305
- children
306
- }
307
- ) : children != null ? children : /* @__PURE__ */ jsxRuntime.jsx(
308
- reactNative.Text,
309
- {
310
- style: {
311
- fontSize: bt.entropixFontSizeSm,
312
- fontWeight: "500",
313
- color: isChecked ? t.entropixColorTextInverse : t.entropixColorTextPrimary
314
- },
315
- children: isChecked ? "On" : "Off"
316
- }
317
- )
318
- }
319
- );
320
- }
321
- var TRACK_WIDTH = 44;
322
- var TRACK_HEIGHT = 24;
323
- var TRACK_PADDING = 2;
324
- var THUMB_SIZE = TRACK_HEIGHT - TRACK_PADDING * 2;
325
- var THUMB_TRAVEL = TRACK_WIDTH - TRACK_PADDING * 2 - THUMB_SIZE;
326
- function Switch({
327
- checked,
328
- defaultChecked,
329
- onChange,
330
- disabled,
331
- label,
332
- style,
333
- ...rest
334
- }) {
335
- const { tokens: t, baseTokens: bt } = useTheme();
336
- const { isDisabled, getToggleProps } = core.useToggle({
337
- checked,
338
- defaultChecked,
339
- onChange,
340
- disabled,
341
- role: "switch"
342
- });
343
- const propGetterReturn = getToggleProps();
344
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
345
- const isChecked = propGetterReturn.accessibility.checked === true;
346
- if (label) {
347
- rnAccessibility.accessibilityLabel = label;
348
- }
349
- const handlePress = react.useCallback(() => {
350
- propGetterReturn.onAction?.();
351
- }, [propGetterReturn.onAction]);
352
- const thumbAnim = react.useRef(
353
- new reactNative.Animated.Value(defaultChecked || checked ? THUMB_TRAVEL : 0)
354
- ).current;
355
- react.useEffect(() => {
356
- reactNative.Animated.timing(thumbAnim, {
357
- toValue: isChecked ? THUMB_TRAVEL : 0,
358
- duration: 150,
359
- useNativeDriver: false
360
- }).start();
361
- }, [isChecked, thumbAnim]);
362
- return /* @__PURE__ */ jsxRuntime.jsx(
363
- reactNative.Pressable,
364
- {
365
- ...rnAccessibility,
366
- ...rest,
367
- disabled: isDisabled,
368
- onPress: isDisabled ? void 0 : handlePress,
369
- style: [
370
- {
371
- width: TRACK_WIDTH,
372
- height: TRACK_HEIGHT,
373
- borderRadius: bt.entropixRadiusFull,
374
- backgroundColor: isChecked ? t.entropixColorActionPrimaryDefault : t.entropixColorGray300,
375
- padding: TRACK_PADDING,
376
- justifyContent: "center"
377
- },
378
- isDisabled && { opacity: 0.5 },
379
- style
380
- ],
381
- children: /* @__PURE__ */ jsxRuntime.jsx(
382
- reactNative.Animated.View,
383
- {
384
- style: {
385
- width: THUMB_SIZE,
386
- height: THUMB_SIZE,
387
- borderRadius: bt.entropixRadiusFull,
388
- backgroundColor: t.entropixColorWhite,
389
- transform: [{ translateX: thumbAnim }]
390
- }
391
- }
392
- )
393
- }
394
- );
395
- }
396
- var DialogContext = react.createContext(null);
397
- function useDialogContext() {
398
- const context = react.useContext(DialogContext);
399
- if (!context) {
400
- throw new Error(
401
- "Dialog compound components must be used within a <Dialog> provider."
402
- );
403
- }
404
- return context;
405
- }
406
- function Dialog({
407
- children,
408
- isOpen,
409
- defaultOpen,
410
- onOpenChange,
411
- closeOnOverlayPress,
412
- closeOnEscape,
413
- modal,
414
- role
415
- }) {
416
- const dialog = core.useDialog({
417
- isOpen,
418
- defaultOpen,
419
- onOpenChange,
420
- closeOnOverlayPress,
421
- closeOnEscape,
422
- modal,
423
- role
424
- });
425
- return /* @__PURE__ */ jsxRuntime.jsx(DialogContext.Provider, { value: dialog, children });
426
- }
427
- function DialogTrigger({
428
- children,
429
- style,
430
- ...rest
431
- }) {
432
- const { getTriggerProps } = useDialogContext();
433
- const propGetterReturn = getTriggerProps();
434
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
435
- const handlePress = react.useCallback(() => {
436
- propGetterReturn.onAction?.();
437
- }, [propGetterReturn.onAction]);
438
- return /* @__PURE__ */ jsxRuntime.jsx(
439
- reactNative.Pressable,
440
- {
441
- ...rnAccessibility,
442
- ...rest,
443
- onPress: handlePress,
444
- style,
445
- children
446
- }
447
- );
448
- }
449
- function DialogContent({
450
- children,
451
- style,
452
- cardStyle,
453
- animationType = "fade",
454
- transparent = true,
455
- ...rest
456
- }) {
457
- const { tokens: t, baseTokens: bt } = useTheme();
458
- const { isOpen, close, ids, getContentProps } = useDialogContext();
459
- const propGetterReturn = getContentProps();
460
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
461
- return /* @__PURE__ */ jsxRuntime.jsx(
462
- reactNative.Modal,
463
- {
464
- visible: isOpen,
465
- transparent,
466
- animationType,
467
- onRequestClose: close,
468
- supportedOrientations: ["portrait", "landscape"],
469
- children: /* @__PURE__ */ jsxRuntime.jsx(
470
- reactNative.View,
471
- {
472
- ...rest,
473
- style: [
474
- {
475
- flex: 1,
476
- justifyContent: "center",
477
- alignItems: "center",
478
- backgroundColor: "rgba(0, 0, 0, 0.5)"
479
- },
480
- style
481
- ],
482
- children: /* @__PURE__ */ jsxRuntime.jsx(
483
- reactNative.View,
484
- {
485
- ...rnAccessibility,
486
- nativeID: ids.content,
487
- style: [
488
- {
489
- backgroundColor: t.entropixColorBgPrimary,
490
- borderRadius: bt.entropixRadiusLg,
491
- padding: bt.entropixSpacing6,
492
- width: "90%",
493
- maxWidth: 480,
494
- shadowColor: "#000",
495
- shadowOffset: { width: 0, height: 4 },
496
- shadowOpacity: 0.15,
497
- shadowRadius: 12,
498
- elevation: 8
499
- },
500
- cardStyle
501
- ],
502
- children
503
- }
504
- )
505
- }
506
- )
507
- }
508
- );
509
- }
510
- function DialogTitle({ children, style, ...rest }) {
511
- const { tokens: t, baseTokens: bt } = useTheme();
512
- const { ids } = useDialogContext();
513
- return /* @__PURE__ */ jsxRuntime.jsx(
514
- reactNative.Text,
515
- {
516
- ...rest,
517
- nativeID: ids.title,
518
- style: [
519
- {
520
- fontSize: 18,
521
- fontWeight: "600",
522
- color: t.entropixColorTextPrimary,
523
- marginBottom: bt.entropixSpacing2
524
- },
525
- style
526
- ],
527
- accessibilityRole: "header",
528
- children
529
- }
530
- );
531
- }
532
- function DialogDescription({
533
- children,
534
- style,
535
- ...rest
536
- }) {
537
- const { tokens: t, baseTokens: bt } = useTheme();
538
- const { ids } = useDialogContext();
539
- return /* @__PURE__ */ jsxRuntime.jsx(
540
- reactNative.Text,
541
- {
542
- ...rest,
543
- nativeID: ids.description,
544
- style: [
545
- {
546
- fontSize: bt.entropixFontSizeSm,
547
- color: t.entropixColorTextSecondary,
548
- lineHeight: 20,
549
- marginBottom: bt.entropixSpacing4
550
- },
551
- style
552
- ],
553
- children
554
- }
555
- );
556
- }
557
- function DialogClose({ children, style, ...rest }) {
558
- const { tokens: t, baseTokens: bt } = useTheme();
559
- const { getCloseProps } = useDialogContext();
560
- const propGetterReturn = getCloseProps();
561
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
562
- const handlePress = react.useCallback(() => {
563
- propGetterReturn.onAction?.();
564
- }, [propGetterReturn.onAction]);
565
- return /* @__PURE__ */ jsxRuntime.jsx(
566
- reactNative.Pressable,
567
- {
568
- ...rnAccessibility,
569
- ...rest,
570
- onPress: handlePress,
571
- style: [
572
- {
573
- position: "absolute",
574
- top: bt.entropixSpacing3,
575
- right: bt.entropixSpacing3,
576
- width: 32,
577
- height: 32,
578
- alignItems: "center",
579
- justifyContent: "center",
580
- borderRadius: bt.entropixRadiusSm
581
- },
582
- style
583
- ],
584
- accessibilityRole: "button",
585
- children: children ?? /* @__PURE__ */ jsxRuntime.jsx(
586
- reactNative.Text,
587
- {
588
- style: {
589
- fontSize: 16,
590
- color: t.entropixColorTextSecondary
591
- },
592
- children: "\u2715"
593
- }
594
- )
595
- }
596
- );
597
- }
598
- function DialogOverlay({ style, testID }) {
599
- const { isOpen, getOverlayProps } = useDialogContext();
600
- const propGetterReturn = getOverlayProps();
601
- const handlePress = react.useCallback(() => {
602
- propGetterReturn.onAction?.();
603
- }, [propGetterReturn.onAction]);
604
- if (!isOpen) return null;
605
- return /* @__PURE__ */ jsxRuntime.jsx(
606
- reactNative.Pressable,
607
- {
608
- testID,
609
- accessible: false,
610
- importantForAccessibility: "no",
611
- onPress: propGetterReturn.onAction ? handlePress : void 0,
612
- style: [
613
- {
614
- ...reactNative.StyleSheet.absoluteFillObject,
615
- backgroundColor: "rgba(0, 0, 0, 0.5)"
616
- },
617
- style
618
- ]
619
- }
620
- );
621
- }
622
- var TabsContext = react.createContext(null);
623
- function useTabsContext() {
624
- const context = react.useContext(TabsContext);
625
- if (!context) {
626
- throw new Error(
627
- "Tabs compound components must be used within a <Tabs> provider."
628
- );
629
- }
630
- return context;
631
- }
632
- function Tabs({ children, style, ...options }) {
633
- const tabs = core.useTabs(options);
634
- return /* @__PURE__ */ jsxRuntime.jsx(TabsContext.Provider, { value: tabs, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style, children }) });
635
- }
636
- function TabList({ children, style }) {
637
- const { tokens: t, baseTokens: bt } = useTheme();
638
- const { getTabListProps } = useTabsContext();
639
- const propGetterReturn = getTabListProps();
640
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
641
- return /* @__PURE__ */ jsxRuntime.jsx(
642
- reactNative.View,
643
- {
644
- ...rnAccessibility,
645
- style: [
646
- {
647
- flexDirection: "row",
648
- gap: bt.entropixSpacing1,
649
- borderBottomWidth: 1,
650
- borderBottomColor: t.entropixColorBorderDefault
651
- },
652
- style
653
- ],
654
- children
655
- }
656
- );
657
- }
658
- function Tab({ value, children, style, textStyle, ...rest }) {
659
- const { tokens: t, baseTokens: bt } = useTheme();
660
- const { getTabProps, selectedKey } = useTabsContext();
661
- const propGetterReturn = getTabProps(value);
662
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
663
- const isActive = selectedKey === value;
664
- const isDisabled = propGetterReturn.accessibility.disabled === true;
665
- const handlePress = react.useCallback(() => {
666
- propGetterReturn.onAction?.();
667
- }, [propGetterReturn.onAction]);
668
- return /* @__PURE__ */ jsxRuntime.jsx(
669
- reactNative.Pressable,
670
- {
671
- ...rnAccessibility,
672
- ...rest,
673
- onPress: propGetterReturn.onAction ? handlePress : void 0,
674
- style: [
675
- {
676
- paddingVertical: bt.entropixSpacing2,
677
- paddingHorizontal: bt.entropixSpacing4,
678
- borderBottomWidth: 2,
679
- borderBottomColor: isActive ? t.entropixColorActionPrimaryDefault : "transparent"
680
- },
681
- isDisabled && { opacity: 0.5 },
682
- style
683
- ],
684
- children: typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
685
- reactNative.Text,
686
- {
687
- style: [
688
- {
689
- fontSize: bt.entropixFontSizeSm,
690
- fontWeight: "500",
691
- color: isActive ? t.entropixColorActionPrimaryDefault : t.entropixColorTextSecondary
692
- },
693
- textStyle
694
- ],
695
- children
696
- }
697
- ) : children
698
- }
699
- );
700
- }
701
- function TabPanel({ value, children, style }) {
702
- const { baseTokens: bt } = useTheme();
703
- const { getTabPanelProps, selectedKey } = useTabsContext();
704
- const propGetterReturn = getTabPanelProps(value);
705
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
706
- if (selectedKey !== value) return null;
707
- return /* @__PURE__ */ jsxRuntime.jsx(
708
- reactNative.View,
709
- {
710
- ...rnAccessibility,
711
- style: [{ padding: bt.entropixSpacing4 }, style],
712
- children
713
- }
714
- );
715
- }
716
- var AccordionContext = react.createContext(null);
717
- function useAccordionContext() {
718
- const context = react.useContext(AccordionContext);
719
- if (!context) {
720
- throw new Error(
721
- "Accordion compound components must be used within an <Accordion> provider."
722
- );
723
- }
724
- return context;
725
- }
726
- var AccordionItemContext = react.createContext(null);
727
- function useAccordionItemContext() {
728
- const context = react.useContext(AccordionItemContext);
729
- if (context === null) {
730
- throw new Error(
731
- "AccordionTrigger and AccordionPanel must be used within an <AccordionItem>."
732
- );
733
- }
734
- return context;
735
- }
736
- function Accordion({ children, style, ...options }) {
737
- const { tokens: t, baseTokens: bt } = useTheme();
738
- const accordion = core.useAccordion(options);
739
- return /* @__PURE__ */ jsxRuntime.jsx(AccordionContext.Provider, { value: accordion, children: /* @__PURE__ */ jsxRuntime.jsx(
740
- reactNative.View,
741
- {
742
- style: [
743
- {
744
- borderWidth: 1,
745
- borderColor: t.entropixColorBorderDefault,
746
- borderRadius: bt.entropixRadiusLg,
747
- overflow: "hidden"
748
- },
749
- style
750
- ],
751
- children
752
- }
753
- ) });
754
- }
755
- function AccordionItem({
756
- value,
757
- isLast = false,
758
- children,
759
- style
760
- }) {
761
- const { tokens: t } = useTheme();
762
- return /* @__PURE__ */ jsxRuntime.jsx(AccordionItemContext.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsx(
763
- reactNative.View,
764
- {
765
- style: [
766
- {
767
- borderBottomWidth: isLast ? 0 : 1,
768
- borderBottomColor: t.entropixColorBorderDefault
769
- },
770
- style
771
- ],
772
- children
773
- }
774
- ) });
775
- }
776
- function AccordionTrigger({
777
- children,
778
- style,
779
- textStyle,
780
- ...rest
781
- }) {
782
- const { tokens: t, baseTokens: bt } = useTheme();
783
- const itemKey = useAccordionItemContext();
784
- const { getItemTriggerProps, isExpanded } = useAccordionContext();
785
- const propGetterReturn = getItemTriggerProps(itemKey);
786
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
787
- const expanded = isExpanded(itemKey);
788
- const handlePress = react.useCallback(() => {
789
- propGetterReturn.onAction?.();
790
- }, [propGetterReturn.onAction]);
791
- return /* @__PURE__ */ jsxRuntime.jsxs(
792
- reactNative.Pressable,
793
- {
794
- ...rnAccessibility,
795
- ...rest,
796
- onPress: propGetterReturn.onAction ? handlePress : void 0,
797
- style: [
798
- {
799
- flexDirection: "row",
800
- alignItems: "center",
801
- justifyContent: "space-between",
802
- paddingVertical: bt.entropixSpacing4,
803
- paddingHorizontal: bt.entropixSpacing4
804
- },
805
- style
806
- ],
807
- children: [
808
- typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
809
- reactNative.Text,
810
- {
811
- style: [
812
- {
813
- fontSize: bt.entropixFontSizeSm,
814
- fontWeight: "500",
815
- color: t.entropixColorTextPrimary,
816
- flex: 1
817
- },
818
- textStyle
819
- ],
820
- children
821
- }
822
- ) : children,
823
- /* @__PURE__ */ jsxRuntime.jsx(
824
- reactNative.Text,
825
- {
826
- style: {
827
- fontSize: 12,
828
- color: t.entropixColorTextSecondary,
829
- marginLeft: bt.entropixSpacing2
830
- },
831
- children: expanded ? "\u2212" : "+"
832
- }
833
- )
834
- ]
835
- }
836
- );
837
- }
838
- function AccordionPanel({ children, style }) {
839
- const { baseTokens: bt } = useTheme();
840
- const itemKey = useAccordionItemContext();
841
- const { getItemPanelProps, isExpanded } = useAccordionContext();
842
- const propGetterReturn = getItemPanelProps(itemKey);
843
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
844
- if (!isExpanded(itemKey)) return null;
845
- return /* @__PURE__ */ jsxRuntime.jsx(
846
- reactNative.View,
847
- {
848
- ...rnAccessibility,
849
- style: [
850
- {
851
- paddingHorizontal: bt.entropixSpacing4,
852
- paddingBottom: bt.entropixSpacing4
853
- },
854
- style
855
- ],
856
- children
857
- }
858
- );
859
- }
860
- var MenuContext = react.createContext(null);
861
- function useMenuContext() {
862
- const context = react.useContext(MenuContext);
863
- if (!context) {
864
- throw new Error(
865
- "Menu compound components must be used within a <Menu> provider."
866
- );
867
- }
868
- return context;
869
- }
870
- function Menu({ children, ...options }) {
871
- const menu = core.useMenu(options);
872
- return /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value: menu, children });
873
- }
874
- function MenuTrigger({ children, style, ...rest }) {
875
- const { getTriggerProps } = useMenuContext();
876
- const propGetterReturn = getTriggerProps();
877
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
878
- const handlePress = react.useCallback(() => {
879
- propGetterReturn.onAction?.();
880
- }, [propGetterReturn.onAction]);
881
- return /* @__PURE__ */ jsxRuntime.jsx(
882
- reactNative.Pressable,
883
- {
884
- ...rnAccessibility,
885
- ...rest,
886
- onPress: handlePress,
887
- style,
888
- children
889
- }
890
- );
891
- }
892
- function MenuContent({ children, style, testID }) {
893
- const { tokens: t, baseTokens: bt } = useTheme();
894
- const { isOpen, getMenuProps } = useMenuContext();
895
- const propGetterReturn = getMenuProps();
896
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
897
- if (!isOpen) return null;
898
- return /* @__PURE__ */ jsxRuntime.jsx(
899
- reactNative.View,
900
- {
901
- ...rnAccessibility,
902
- testID,
903
- style: [
904
- {
905
- minWidth: 160,
906
- padding: bt.entropixSpacing1,
907
- backgroundColor: t.entropixColorBgPrimary,
908
- borderWidth: 1,
909
- borderColor: t.entropixColorBorderDefault,
910
- borderRadius: bt.entropixRadiusMd,
911
- shadowColor: "#000",
912
- shadowOffset: { width: 0, height: 2 },
913
- shadowOpacity: 0.1,
914
- shadowRadius: 8,
915
- elevation: 4
916
- },
917
- style
918
- ],
919
- children
920
- }
921
- );
922
- }
923
- function wrapStringChildren(children, style) {
924
- if (typeof children === "string" || typeof children === "number") {
925
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style, children });
926
- }
927
- return children;
928
- }
929
- function MenuItem({
930
- index,
931
- onSelect,
932
- disabled,
933
- children,
934
- style,
935
- textStyle,
936
- ...rest
937
- }) {
938
- const { tokens: t, baseTokens: bt } = useTheme();
939
- const { getItemProps } = useMenuContext();
940
- const propGetterReturn = getItemProps(index, { onSelect, disabled });
941
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
942
- const handlePress = react.useCallback(() => {
943
- propGetterReturn.onAction?.();
944
- }, [propGetterReturn.onAction]);
945
- return /* @__PURE__ */ jsxRuntime.jsx(
946
- reactNative.Pressable,
947
- {
948
- ...rnAccessibility,
949
- ...rest,
950
- disabled,
951
- onPress: propGetterReturn.onAction ? handlePress : void 0,
952
- style: [
953
- {
954
- flexDirection: "row",
955
- alignItems: "center",
956
- paddingVertical: bt.entropixSpacing2,
957
- paddingHorizontal: bt.entropixSpacing3,
958
- borderRadius: bt.entropixRadiusSm,
959
- opacity: disabled ? 0.5 : 1
960
- },
961
- style
962
- ],
963
- children: wrapStringChildren(children, {
964
- fontSize: bt.entropixFontSizeSm,
965
- color: t.entropixColorTextPrimary,
966
- ...textStyle
967
- })
968
- }
969
- );
970
- }
971
- var KEYBOARD_TYPE_MAP = {
972
- text: "default",
973
- email: "email-address",
974
- password: "default",
975
- number: "numeric",
976
- tel: "phone-pad",
977
- url: "url",
978
- search: "default"
979
- };
980
- function Input({
981
- value,
982
- defaultValue,
983
- onChange,
984
- disabled,
985
- readOnly,
986
- required,
987
- invalid,
988
- label,
989
- helperText,
990
- errorMessage,
991
- placeholder,
992
- type = "text",
993
- size = "md",
994
- style,
995
- inputStyle,
996
- textStyle,
997
- testID
998
- }) {
999
- const { tokens: t, baseTokens: bt } = useTheme();
1000
- const {
1001
- value: inputValue,
1002
- isDisabled,
1003
- isReadOnly,
1004
- isInvalid,
1005
- setValue,
1006
- getInputProps
1007
- } = core.useInput({
1008
- value,
1009
- defaultValue,
1010
- onChange,
1011
- disabled,
1012
- readOnly,
1013
- required,
1014
- invalid,
1015
- type,
1016
- placeholder
1017
- });
1018
- const propGetterReturn = getInputProps();
1019
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
1020
- const handleChangeText = react.useCallback(
1021
- (text) => {
1022
- setValue(text);
1023
- },
1024
- [setValue]
1025
- );
1026
- const sizeStyles = getSizeStyles(size, bt);
1027
- const showError = isInvalid && errorMessage;
1028
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [{ gap: bt.entropixSpacing1 }, style], children: [
1029
- label ? /* @__PURE__ */ jsxRuntime.jsxs(
1030
- reactNative.Text,
1031
- {
1032
- style: [
1033
- {
1034
- fontSize: sizeStyles.labelFontSize,
1035
- fontWeight: "500",
1036
- color: t.entropixColorTextPrimary
1037
- },
1038
- textStyle
1039
- ],
1040
- children: [
1041
- label,
1042
- required ? " *" : ""
1043
- ]
1044
- }
1045
- ) : null,
1046
- /* @__PURE__ */ jsxRuntime.jsx(
1047
- reactNative.TextInput,
1048
- {
1049
- ...rnAccessibility,
1050
- testID,
1051
- value: inputValue,
1052
- onChangeText: handleChangeText,
1053
- placeholder,
1054
- placeholderTextColor: t.entropixColorTextTertiary,
1055
- editable: !isDisabled && !isReadOnly,
1056
- secureTextEntry: type === "password",
1057
- keyboardType: KEYBOARD_TYPE_MAP[type] ?? "default",
1058
- style: [
1059
- {
1060
- paddingVertical: sizeStyles.paddingVertical,
1061
- paddingHorizontal: sizeStyles.paddingHorizontal,
1062
- fontSize: sizeStyles.fontSize,
1063
- borderWidth: 1,
1064
- borderColor: showError ? t.entropixColorBorderDanger : t.entropixColorBorderDefault,
1065
- borderRadius: bt.entropixRadiusMd,
1066
- backgroundColor: t.entropixColorBgPrimary,
1067
- color: t.entropixColorTextPrimary
1068
- },
1069
- isDisabled && { opacity: 0.5 },
1070
- inputStyle
1071
- ]
1072
- }
1073
- ),
1074
- showError ? /* @__PURE__ */ jsxRuntime.jsx(
1075
- reactNative.Text,
1076
- {
1077
- style: [
1078
- {
1079
- fontSize: sizeStyles.helperFontSize,
1080
- color: t.entropixColorTextDanger
1081
- },
1082
- textStyle
1083
- ],
1084
- accessibilityRole: "alert",
1085
- accessibilityLiveRegion: "polite",
1086
- children: errorMessage
1087
- }
1088
- ) : helperText ? /* @__PURE__ */ jsxRuntime.jsx(
1089
- reactNative.Text,
1090
- {
1091
- style: [
1092
- {
1093
- fontSize: sizeStyles.helperFontSize,
1094
- color: t.entropixColorTextSecondary
1095
- },
1096
- textStyle
1097
- ],
1098
- children: helperText
1099
- }
1100
- ) : null
1101
- ] });
1102
- }
1103
- function getSizeStyles(size, bt) {
1104
- switch (size) {
1105
- case "sm":
1106
- return {
1107
- paddingVertical: bt.entropixSpacing1,
1108
- paddingHorizontal: bt.entropixSpacing2,
1109
- fontSize: bt.entropixFontSizeXs,
1110
- labelFontSize: bt.entropixFontSizeXs,
1111
- helperFontSize: bt.entropixFontSizeXs - 1
1112
- };
1113
- case "lg":
1114
- return {
1115
- paddingVertical: bt.entropixSpacing3,
1116
- paddingHorizontal: bt.entropixSpacing4,
1117
- fontSize: bt.entropixFontSizeBase,
1118
- labelFontSize: bt.entropixFontSizeBase,
1119
- helperFontSize: bt.entropixFontSizeSm
1120
- };
1121
- default:
1122
- return {
1123
- paddingVertical: bt.entropixSpacing2,
1124
- paddingHorizontal: bt.entropixSpacing3,
1125
- fontSize: bt.entropixFontSizeSm,
1126
- labelFontSize: bt.entropixFontSizeSm,
1127
- helperFontSize: bt.entropixFontSizeXs
1128
- };
1129
- }
1130
- }
1131
- function Textarea({
1132
- value,
1133
- defaultValue,
1134
- onChange,
1135
- disabled,
1136
- readOnly,
1137
- required,
1138
- invalid,
1139
- label,
1140
- helperText,
1141
- errorMessage,
1142
- placeholder,
1143
- numberOfLines = 4,
1144
- size = "md",
1145
- style,
1146
- inputStyle,
1147
- textStyle,
1148
- testID
1149
- }) {
1150
- const { tokens: t, baseTokens: bt } = useTheme();
1151
- const {
1152
- value: inputValue,
1153
- isDisabled,
1154
- isReadOnly,
1155
- isInvalid,
1156
- setValue,
1157
- getInputProps
1158
- } = core.useInput({
1159
- value,
1160
- defaultValue,
1161
- onChange,
1162
- disabled,
1163
- readOnly,
1164
- required,
1165
- invalid,
1166
- type: "text",
1167
- placeholder
1168
- });
1169
- const propGetterReturn = getInputProps();
1170
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
1171
- const handleChangeText = react.useCallback(
1172
- (text) => {
1173
- setValue(text);
1174
- },
1175
- [setValue]
1176
- );
1177
- const sizeStyles = getSizeStyles2(size, bt);
1178
- const showError = isInvalid && errorMessage;
1179
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [{ gap: bt.entropixSpacing1 }, style], children: [
1180
- label ? /* @__PURE__ */ jsxRuntime.jsxs(
1181
- reactNative.Text,
1182
- {
1183
- style: [
1184
- {
1185
- fontSize: sizeStyles.labelFontSize,
1186
- fontWeight: "500",
1187
- color: t.entropixColorTextPrimary
1188
- },
1189
- textStyle
1190
- ],
1191
- children: [
1192
- label,
1193
- required ? " *" : ""
1194
- ]
1195
- }
1196
- ) : null,
1197
- /* @__PURE__ */ jsxRuntime.jsx(
1198
- reactNative.TextInput,
1199
- {
1200
- ...rnAccessibility,
1201
- testID,
1202
- value: inputValue,
1203
- onChangeText: handleChangeText,
1204
- placeholder,
1205
- placeholderTextColor: t.entropixColorTextTertiary,
1206
- editable: !isDisabled && !isReadOnly,
1207
- multiline: true,
1208
- numberOfLines,
1209
- textAlignVertical: "top",
1210
- style: [
1211
- {
1212
- paddingVertical: sizeStyles.paddingVertical,
1213
- paddingHorizontal: sizeStyles.paddingHorizontal,
1214
- fontSize: sizeStyles.fontSize,
1215
- borderWidth: 1,
1216
- borderColor: showError ? t.entropixColorBorderDanger : t.entropixColorBorderDefault,
1217
- borderRadius: bt.entropixRadiusMd,
1218
- backgroundColor: t.entropixColorBgPrimary,
1219
- color: t.entropixColorTextPrimary,
1220
- minHeight: numberOfLines * (sizeStyles.fontSize + 8)
1221
- },
1222
- isDisabled && { opacity: 0.5 },
1223
- inputStyle
1224
- ]
1225
- }
1226
- ),
1227
- showError ? /* @__PURE__ */ jsxRuntime.jsx(
1228
- reactNative.Text,
1229
- {
1230
- style: [
1231
- {
1232
- fontSize: sizeStyles.helperFontSize,
1233
- color: t.entropixColorTextDanger
1234
- },
1235
- textStyle
1236
- ],
1237
- accessibilityRole: "alert",
1238
- accessibilityLiveRegion: "polite",
1239
- children: errorMessage
1240
- }
1241
- ) : helperText ? /* @__PURE__ */ jsxRuntime.jsx(
1242
- reactNative.Text,
1243
- {
1244
- style: [
1245
- {
1246
- fontSize: sizeStyles.helperFontSize,
1247
- color: t.entropixColorTextSecondary
1248
- },
1249
- textStyle
1250
- ],
1251
- children: helperText
1252
- }
1253
- ) : null
1254
- ] });
1255
- }
1256
- function getSizeStyles2(size, bt) {
1257
- switch (size) {
1258
- case "sm":
1259
- return {
1260
- paddingVertical: bt.entropixSpacing1,
1261
- paddingHorizontal: bt.entropixSpacing2,
1262
- fontSize: bt.entropixFontSizeXs,
1263
- labelFontSize: bt.entropixFontSizeXs,
1264
- helperFontSize: bt.entropixFontSizeXs - 1
1265
- };
1266
- case "lg":
1267
- return {
1268
- paddingVertical: bt.entropixSpacing3,
1269
- paddingHorizontal: bt.entropixSpacing4,
1270
- fontSize: bt.entropixFontSizeBase,
1271
- labelFontSize: bt.entropixFontSizeBase,
1272
- helperFontSize: bt.entropixFontSizeSm
1273
- };
1274
- default:
1275
- return {
1276
- paddingVertical: bt.entropixSpacing2,
1277
- paddingHorizontal: bt.entropixSpacing3,
1278
- fontSize: bt.entropixFontSizeSm,
1279
- labelFontSize: bt.entropixFontSizeSm,
1280
- helperFontSize: bt.entropixFontSizeXs
1281
- };
1282
- }
1283
- }
1284
- function Checkbox({
1285
- checked,
1286
- defaultChecked,
1287
- onChange,
1288
- disabled,
1289
- indeterminate,
1290
- label,
1291
- size = "md",
1292
- style,
1293
- textStyle,
1294
- children,
1295
- ...rest
1296
- }) {
1297
- const { tokens: t, baseTokens: bt } = useTheme();
1298
- const { isChecked, isDisabled, getToggleProps } = core.useToggle({
1299
- checked,
1300
- defaultChecked,
1301
- onChange,
1302
- disabled,
1303
- role: "checkbox"
1304
- });
1305
- const propGetterReturn = getToggleProps();
1306
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
1307
- if (indeterminate) {
1308
- rnAccessibility.accessibilityState = {
1309
- ...rnAccessibility.accessibilityState,
1310
- checked: "mixed"
1311
- };
1312
- }
1313
- if (label) {
1314
- rnAccessibility.accessibilityLabel = label;
1315
- }
1316
- const handlePress = react.useCallback(() => {
1317
- propGetterReturn.onAction?.();
1318
- }, [propGetterReturn.onAction]);
1319
- const sizeStyles = getSizeStyles3(size, bt);
1320
- const isActive = indeterminate || isChecked;
1321
- return /* @__PURE__ */ jsxRuntime.jsxs(
1322
- reactNative.Pressable,
1323
- {
1324
- ...rnAccessibility,
1325
- ...rest,
1326
- disabled: isDisabled,
1327
- onPress: isDisabled ? void 0 : handlePress,
1328
- style: [
1329
- {
1330
- flexDirection: "row",
1331
- alignItems: "center",
1332
- gap: bt.entropixSpacing2
1333
- },
1334
- isDisabled && { opacity: 0.5 },
1335
- style
1336
- ],
1337
- children: [
1338
- /* @__PURE__ */ jsxRuntime.jsx(
1339
- reactNative.View,
1340
- {
1341
- style: {
1342
- width: sizeStyles.boxSize,
1343
- height: sizeStyles.boxSize,
1344
- borderWidth: 2,
1345
- borderColor: isActive ? t.entropixColorActionPrimaryDefault : t.entropixColorBorderDefault,
1346
- borderRadius: bt.entropixRadiusSm,
1347
- backgroundColor: isActive ? t.entropixColorActionPrimaryDefault : "transparent",
1348
- alignItems: "center",
1349
- justifyContent: "center"
1350
- },
1351
- children: indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(
1352
- reactNative.Text,
1353
- {
1354
- style: {
1355
- fontSize: sizeStyles.indicatorFontSize,
1356
- fontWeight: "700",
1357
- color: t.entropixColorTextInverse,
1358
- lineHeight: sizeStyles.boxSize - 2
1359
- },
1360
- children: "\u2013"
1361
- }
1362
- ) : isChecked ? /* @__PURE__ */ jsxRuntime.jsx(
1363
- reactNative.Text,
1364
- {
1365
- style: {
1366
- fontSize: sizeStyles.indicatorFontSize,
1367
- fontWeight: "700",
1368
- color: t.entropixColorTextInverse,
1369
- lineHeight: sizeStyles.boxSize - 2
1370
- },
1371
- children: "\u2713"
1372
- }
1373
- ) : null
1374
- }
1375
- ),
1376
- typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1377
- reactNative.Text,
1378
- {
1379
- style: [
1380
- {
1381
- fontSize: sizeStyles.fontSize,
1382
- color: t.entropixColorTextPrimary
1383
- },
1384
- textStyle
1385
- ],
1386
- children
1387
- }
1388
- ) : children != null ? children : label ? /* @__PURE__ */ jsxRuntime.jsx(
1389
- reactNative.Text,
1390
- {
1391
- style: [
1392
- {
1393
- fontSize: sizeStyles.fontSize,
1394
- color: t.entropixColorTextPrimary
1395
- },
1396
- textStyle
1397
- ],
1398
- children: label
1399
- }
1400
- ) : null
1401
- ]
1402
- }
1403
- );
1404
- }
1405
- function getSizeStyles3(size, bt) {
1406
- switch (size) {
1407
- case "sm":
1408
- return {
1409
- boxSize: 16,
1410
- indicatorFontSize: 10,
1411
- fontSize: bt.entropixFontSizeXs
1412
- };
1413
- case "lg":
1414
- return {
1415
- boxSize: 24,
1416
- indicatorFontSize: 16,
1417
- fontSize: bt.entropixFontSizeBase
1418
- };
1419
- default:
1420
- return {
1421
- boxSize: 20,
1422
- indicatorFontSize: 13,
1423
- fontSize: bt.entropixFontSizeSm
1424
- };
1425
- }
1426
- }
1427
- var RadioGroupContext = react.createContext(null);
1428
- function useRadioGroupContext() {
1429
- const context = react.useContext(RadioGroupContext);
1430
- if (!context) {
1431
- throw new Error(
1432
- "Radio compound components must be used within a <RadioGroup> provider."
1433
- );
1434
- }
1435
- return context;
1436
- }
1437
- function RadioGroup({
1438
- label,
1439
- style,
1440
- textStyle,
1441
- children,
1442
- testID,
1443
- ...options
1444
- }) {
1445
- const { tokens: t, baseTokens: bt } = useTheme();
1446
- const radioGroup = core.useRadioGroup(options);
1447
- const propGetterReturn = radioGroup.getRadioGroupProps();
1448
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
1449
- if (label) {
1450
- rnAccessibility.accessibilityLabel = label;
1451
- }
1452
- return /* @__PURE__ */ jsxRuntime.jsx(RadioGroupContext.Provider, { value: radioGroup, children: /* @__PURE__ */ jsxRuntime.jsxs(
1453
- reactNative.View,
1454
- {
1455
- ...rnAccessibility,
1456
- testID,
1457
- style: [
1458
- {
1459
- gap: bt.entropixSpacing2
1460
- },
1461
- style
1462
- ],
1463
- children: [
1464
- label ? /* @__PURE__ */ jsxRuntime.jsx(
1465
- reactNative.Text,
1466
- {
1467
- style: [
1468
- {
1469
- fontSize: bt.entropixFontSizeSm,
1470
- fontWeight: "500",
1471
- color: t.entropixColorTextPrimary
1472
- },
1473
- textStyle
1474
- ],
1475
- children: label
1476
- }
1477
- ) : null,
1478
- children
1479
- ]
1480
- }
1481
- ) });
1482
- }
1483
- function RadioItem({
1484
- value,
1485
- disabled,
1486
- style,
1487
- textStyle,
1488
- children,
1489
- ...rest
1490
- }) {
1491
- const { tokens: t, baseTokens: bt } = useTheme();
1492
- const { getRadioProps } = useRadioGroupContext();
1493
- const propGetterReturn = getRadioProps(value, { disabled });
1494
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
1495
- const isChecked = propGetterReturn.accessibility.checked === true;
1496
- const isDisabled = propGetterReturn.accessibility.disabled === true;
1497
- const handlePress = react.useCallback(() => {
1498
- propGetterReturn.onAction?.();
1499
- }, [propGetterReturn.onAction]);
1500
- return /* @__PURE__ */ jsxRuntime.jsxs(
1501
- reactNative.Pressable,
1502
- {
1503
- ...rnAccessibility,
1504
- ...rest,
1505
- disabled: isDisabled,
1506
- onPress: isDisabled ? void 0 : handlePress,
1507
- style: [
1508
- {
1509
- flexDirection: "row",
1510
- alignItems: "center",
1511
- gap: bt.entropixSpacing2
1512
- },
1513
- isDisabled && { opacity: 0.5 },
1514
- style
1515
- ],
1516
- children: [
1517
- /* @__PURE__ */ jsxRuntime.jsx(
1518
- reactNative.View,
1519
- {
1520
- style: {
1521
- width: 20,
1522
- height: 20,
1523
- borderRadius: 10,
1524
- borderWidth: 2,
1525
- borderColor: isChecked ? t.entropixColorActionPrimaryDefault : t.entropixColorBorderDefault,
1526
- alignItems: "center",
1527
- justifyContent: "center"
1528
- },
1529
- children: isChecked ? /* @__PURE__ */ jsxRuntime.jsx(
1530
- reactNative.View,
1531
- {
1532
- style: {
1533
- width: 10,
1534
- height: 10,
1535
- borderRadius: 5,
1536
- backgroundColor: t.entropixColorActionPrimaryDefault
1537
- }
1538
- }
1539
- ) : null
1540
- }
1541
- ),
1542
- typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1543
- reactNative.Text,
1544
- {
1545
- style: [
1546
- {
1547
- fontSize: bt.entropixFontSizeSm,
1548
- color: t.entropixColorTextPrimary
1549
- },
1550
- textStyle
1551
- ],
1552
- children
1553
- }
1554
- ) : children
1555
- ]
1556
- }
1557
- );
1558
- }
1559
- var SelectContext = react.createContext(null);
1560
- function useSelectContext() {
1561
- const context = react.useContext(SelectContext);
1562
- if (!context) {
1563
- throw new Error(
1564
- "Select compound components must be used within a <Select> provider."
1565
- );
1566
- }
1567
- return context;
1568
- }
1569
- function Select({
1570
- label,
1571
- style,
1572
- textStyle,
1573
- children,
1574
- testID,
1575
- ...options
1576
- }) {
1577
- const { tokens: t, baseTokens: bt } = useTheme();
1578
- const select = core.useSelect(options);
1579
- return /* @__PURE__ */ jsxRuntime.jsx(SelectContext.Provider, { value: select, children: /* @__PURE__ */ jsxRuntime.jsxs(
1580
- reactNative.View,
1581
- {
1582
- testID,
1583
- style: [{ gap: bt.entropixSpacing1 }, style],
1584
- children: [
1585
- label ? /* @__PURE__ */ jsxRuntime.jsx(
1586
- reactNative.Text,
1587
- {
1588
- style: [
1589
- {
1590
- fontSize: bt.entropixFontSizeSm,
1591
- fontWeight: "500",
1592
- color: t.entropixColorTextPrimary
1593
- },
1594
- textStyle
1595
- ],
1596
- children: label
1597
- }
1598
- ) : null,
1599
- children
1600
- ]
1601
- }
1602
- ) });
1603
- }
1604
- function SelectTrigger({
1605
- placeholder = "Select...",
1606
- displayValue,
1607
- style,
1608
- textStyle,
1609
- ...rest
1610
- }) {
1611
- const { tokens: t, baseTokens: bt } = useTheme();
1612
- const { selectedValue, isDisabled, isOpen, getTriggerProps } = useSelectContext();
1613
- const propGetterReturn = getTriggerProps();
1614
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
1615
- const handlePress = react.useCallback(() => {
1616
- propGetterReturn.onAction?.();
1617
- }, [propGetterReturn.onAction]);
1618
- const hasValue = selectedValue !== "";
1619
- const label = displayValue ?? (hasValue ? selectedValue : placeholder);
1620
- return /* @__PURE__ */ jsxRuntime.jsxs(
1621
- reactNative.Pressable,
1622
- {
1623
- ...rnAccessibility,
1624
- ...rest,
1625
- disabled: isDisabled,
1626
- onPress: isDisabled ? void 0 : handlePress,
1627
- style: [
1628
- {
1629
- flexDirection: "row",
1630
- alignItems: "center",
1631
- justifyContent: "space-between",
1632
- paddingVertical: bt.entropixSpacing2,
1633
- paddingHorizontal: bt.entropixSpacing3,
1634
- borderWidth: 1,
1635
- borderColor: isOpen ? t.entropixColorActionPrimaryDefault : t.entropixColorBorderDefault,
1636
- borderRadius: bt.entropixRadiusMd,
1637
- backgroundColor: t.entropixColorBgPrimary
1638
- },
1639
- isDisabled && { opacity: 0.5 },
1640
- style
1641
- ],
1642
- children: [
1643
- /* @__PURE__ */ jsxRuntime.jsx(
1644
- reactNative.Text,
1645
- {
1646
- style: [
1647
- {
1648
- fontSize: bt.entropixFontSizeSm,
1649
- color: hasValue ? t.entropixColorTextPrimary : t.entropixColorTextTertiary,
1650
- flex: 1
1651
- },
1652
- textStyle
1653
- ],
1654
- numberOfLines: 1,
1655
- children: label
1656
- }
1657
- ),
1658
- /* @__PURE__ */ jsxRuntime.jsx(
1659
- reactNative.Text,
1660
- {
1661
- style: {
1662
- fontSize: bt.entropixFontSizeXs,
1663
- color: t.entropixColorTextSecondary,
1664
- marginLeft: bt.entropixSpacing2
1665
- },
1666
- children: "\u25BC"
1667
- }
1668
- )
1669
- ]
1670
- }
1671
- );
1672
- }
1673
- function SelectContent({ children, style, testID }) {
1674
- const { tokens: t, baseTokens: bt } = useTheme();
1675
- const { isOpen, close, getListboxProps } = useSelectContext();
1676
- const propGetterReturn = getListboxProps();
1677
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
1678
- if (!isOpen) return null;
1679
- return /* @__PURE__ */ jsxRuntime.jsx(
1680
- reactNative.Modal,
1681
- {
1682
- visible: isOpen,
1683
- transparent: true,
1684
- animationType: "fade",
1685
- onRequestClose: close,
1686
- children: /* @__PURE__ */ jsxRuntime.jsx(
1687
- reactNative.Pressable,
1688
- {
1689
- style: {
1690
- flex: 1,
1691
- justifyContent: "center",
1692
- alignItems: "center",
1693
- backgroundColor: "rgba(0,0,0,0.3)"
1694
- },
1695
- onPress: close,
1696
- children: /* @__PURE__ */ jsxRuntime.jsx(
1697
- reactNative.Pressable,
1698
- {
1699
- onPress: () => {
1700
- },
1701
- children: /* @__PURE__ */ jsxRuntime.jsx(
1702
- reactNative.View,
1703
- {
1704
- ...rnAccessibility,
1705
- testID,
1706
- style: [
1707
- {
1708
- minWidth: 240,
1709
- maxHeight: 300,
1710
- padding: bt.entropixSpacing1,
1711
- backgroundColor: t.entropixColorBgPrimary,
1712
- borderWidth: 1,
1713
- borderColor: t.entropixColorBorderDefault,
1714
- borderRadius: bt.entropixRadiusMd,
1715
- shadowColor: "#000",
1716
- shadowOffset: { width: 0, height: 4 },
1717
- shadowOpacity: 0.15,
1718
- shadowRadius: 12,
1719
- elevation: 8
1720
- },
1721
- style
1722
- ],
1723
- children
1724
- }
1725
- )
1726
- }
1727
- )
1728
- }
1729
- )
1730
- }
1731
- );
1732
- }
1733
- function SelectOption({
1734
- value,
1735
- index,
1736
- disabled,
1737
- style,
1738
- textStyle,
1739
- children,
1740
- ...rest
1741
- }) {
1742
- const { tokens: t, baseTokens: bt } = useTheme();
1743
- const { getOptionProps } = useSelectContext();
1744
- const propGetterReturn = getOptionProps(value, index ?? 0, { disabled });
1745
- const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
1746
- const isSelected = propGetterReturn.accessibility.selected === true;
1747
- const handlePress = react.useCallback(() => {
1748
- propGetterReturn.onAction?.();
1749
- }, [propGetterReturn.onAction]);
1750
- return /* @__PURE__ */ jsxRuntime.jsx(
1751
- reactNative.Pressable,
1752
- {
1753
- ...rnAccessibility,
1754
- ...rest,
1755
- disabled,
1756
- onPress: propGetterReturn.onAction ? handlePress : void 0,
1757
- style: [
1758
- {
1759
- flexDirection: "row",
1760
- alignItems: "center",
1761
- paddingVertical: bt.entropixSpacing2,
1762
- paddingHorizontal: bt.entropixSpacing3,
1763
- borderRadius: bt.entropixRadiusSm,
1764
- backgroundColor: isSelected ? t.entropixColorBgSecondary : "transparent"
1765
- },
1766
- disabled && { opacity: 0.5 },
1767
- style
1768
- ],
1769
- children: typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1770
- reactNative.Text,
1771
- {
1772
- style: [
1773
- {
1774
- fontSize: bt.entropixFontSizeSm,
1775
- fontWeight: isSelected ? "600" : "400",
1776
- color: t.entropixColorTextPrimary
1777
- },
1778
- textStyle
1779
- ],
1780
- children
1781
- }
1782
- ) : children
1783
- }
1784
- );
1785
- }
1786
- var BREAKPOINTS = {
1787
- sm: 640,
1788
- md: 768,
1789
- lg: 1024,
1790
- xl: 1280,
1791
- "2xl": 1536
1792
- };
1793
- var BREAKPOINT_ORDER = ["base", "sm", "md", "lg", "xl", "2xl"];
1794
- function useBreakpoint() {
1795
- const getBreakpoint = react.useCallback(() => {
1796
- const { width } = reactNative.Dimensions.get("window");
1797
- if (width >= BREAKPOINTS["2xl"]) return "2xl";
1798
- if (width >= BREAKPOINTS.xl) return "xl";
1799
- if (width >= BREAKPOINTS.lg) return "lg";
1800
- if (width >= BREAKPOINTS.md) return "md";
1801
- if (width >= BREAKPOINTS.sm) return "sm";
1802
- return "base";
1803
- }, []);
1804
- const [breakpoint, setBreakpoint] = react.useState(getBreakpoint);
1805
- react.useEffect(() => {
1806
- const subscription = reactNative.Dimensions.addEventListener("change", ({ window }) => {
1807
- const width = window.width;
1808
- let next = "base";
1809
- if (width >= BREAKPOINTS["2xl"]) next = "2xl";
1810
- else if (width >= BREAKPOINTS.xl) next = "xl";
1811
- else if (width >= BREAKPOINTS.lg) next = "lg";
1812
- else if (width >= BREAKPOINTS.md) next = "md";
1813
- else if (width >= BREAKPOINTS.sm) next = "sm";
1814
- setBreakpoint((prev) => prev !== next ? next : prev);
1815
- });
1816
- return () => subscription.remove();
1817
- }, []);
1818
- return breakpoint;
1819
- }
1820
- function useBreakpointValue(breakpoint) {
1821
- const current = useBreakpoint();
1822
- const currentIndex = BREAKPOINT_ORDER.indexOf(current);
1823
- const targetIndex = BREAKPOINT_ORDER.indexOf(breakpoint);
1824
- return currentIndex >= targetIndex;
1825
- }
1826
- function useScreenDimensions() {
1827
- const [dimensions, setDimensions] = react.useState(() => reactNative.Dimensions.get("window"));
1828
- react.useEffect(() => {
1829
- const subscription = reactNative.Dimensions.addEventListener("change", ({ window }) => {
1830
- setDimensions(window);
1831
- });
1832
- return () => subscription.remove();
1833
- }, []);
1834
- return { width: dimensions.width, height: dimensions.height };
1835
- }
1836
- function Stack({
1837
- gap,
1838
- align,
1839
- fullWidth,
1840
- style,
1841
- children,
1842
- ...rest
1843
- }) {
1844
- const { baseTokens: bt } = useTheme();
1845
- const gapValue = getGapValue(gap, bt);
1846
- const alignMap = {
1847
- start: "flex-start",
1848
- center: "center",
1849
- end: "flex-end",
1850
- stretch: "stretch"
1851
- };
1852
- return /* @__PURE__ */ jsxRuntime.jsx(
1853
- reactNative.View,
1854
- {
1855
- style: [
1856
- { flexDirection: "column" },
1857
- gapValue !== void 0 && { gap: gapValue },
1858
- gapValue === void 0 && { gap: bt.entropixSpaceLayoutStack },
1859
- align && { alignItems: alignMap[align] },
1860
- fullWidth && { width: "100%" },
1861
- style
1862
- ],
1863
- ...rest,
1864
- children
1865
- }
1866
- );
1867
- }
1868
- function getGapValue(gap, bt) {
1869
- if (!gap) return void 0;
1870
- switch (gap) {
1871
- case "none":
1872
- return 0;
1873
- case "xs":
1874
- return bt.entropixSpacing1;
1875
- case "sm":
1876
- return bt.entropixSpacing2;
1877
- case "md":
1878
- return bt.entropixSpacing4;
1879
- case "lg":
1880
- return bt.entropixSpacing6;
1881
- case "xl":
1882
- return bt.entropixSpacing8;
1883
- case "2xl":
1884
- return bt.entropixSpacing12;
1885
- }
1886
- }
1887
- function Inline({
1888
- gap,
1889
- align,
1890
- justify,
1891
- wrap,
1892
- style,
1893
- children,
1894
- ...rest
1895
- }) {
1896
- const { baseTokens: bt } = useTheme();
1897
- const gapValue = getGapValue2(gap, bt);
1898
- const alignMap = {
1899
- start: "flex-start",
1900
- center: "center",
1901
- end: "flex-end",
1902
- stretch: "stretch",
1903
- baseline: "baseline"
1904
- };
1905
- const justifyMap = {
1906
- start: "flex-start",
1907
- center: "center",
1908
- end: "flex-end",
1909
- between: "space-between",
1910
- around: "space-around"
1911
- };
1912
- return /* @__PURE__ */ jsxRuntime.jsx(
1913
- reactNative.View,
1914
- {
1915
- style: [
1916
- {
1917
- flexDirection: "row",
1918
- alignItems: "center"
1919
- },
1920
- gapValue !== void 0 && { gap: gapValue },
1921
- gapValue === void 0 && { gap: bt.entropixSpaceLayoutInline },
1922
- align && { alignItems: alignMap[align] },
1923
- justify && { justifyContent: justifyMap[justify] },
1924
- wrap && { flexWrap: "wrap" },
1925
- style
1926
- ],
1927
- ...rest,
1928
- children
1929
- }
1930
- );
1931
- }
1932
- function getGapValue2(gap, bt) {
1933
- if (!gap) return void 0;
1934
- switch (gap) {
1935
- case "none":
1936
- return 0;
1937
- case "xs":
1938
- return bt.entropixSpacing1;
1939
- case "sm":
1940
- return bt.entropixSpacing2;
1941
- case "md":
1942
- return bt.entropixSpacing4;
1943
- case "lg":
1944
- return bt.entropixSpacing6;
1945
- case "xl":
1946
- return bt.entropixSpacing8;
1947
- case "2xl":
1948
- return bt.entropixSpacing12;
1949
- }
1950
- }
1951
- var maxWidthMap = {
1952
- xs: 480,
1953
- sm: 640,
1954
- md: 768,
1955
- lg: 1024,
1956
- xl: 1280,
1957
- full: void 0
1958
- };
1959
- function Container({
1960
- maxWidth = "lg",
1961
- center,
1962
- style,
1963
- children,
1964
- ...rest
1965
- }) {
1966
- const { baseTokens: bt } = useTheme();
1967
- const breakpoint = useBreakpoint();
1968
- const maxW = maxWidthMap[maxWidth];
1969
- let pageMargin = bt.entropixSpaceLayoutPageMargin;
1970
- if (breakpoint === "lg" || breakpoint === "xl" || breakpoint === "2xl") {
1971
- pageMargin = bt.entropixSpaceLayoutPageMarginLg;
1972
- } else if (breakpoint === "md") {
1973
- pageMargin = bt.entropixSpaceLayoutPageMarginMd;
1974
- }
1975
- return /* @__PURE__ */ jsxRuntime.jsx(
1976
- reactNative.View,
1977
- {
1978
- style: [
1979
- {
1980
- width: "100%",
1981
- paddingHorizontal: pageMargin
1982
- },
1983
- maxW !== void 0 && { maxWidth: maxW, alignSelf: "center" },
1984
- center && { alignItems: "center" },
1985
- style
1986
- ],
1987
- ...rest,
1988
- children
1989
- }
1990
- );
1991
- }
1992
- function Divider({
1993
- orientation = "horizontal",
1994
- spacing,
1995
- style,
1996
- ...rest
1997
- }) {
1998
- const { tokens: t, baseTokens: bt } = useTheme();
1999
- const spacingMap = {
2000
- sm: bt.entropixSpacing2,
2001
- md: bt.entropixSpacing4,
2002
- lg: bt.entropixSpacing6
2003
- };
2004
- const spacingValue = spacing ? spacingMap[spacing] : 0;
2005
- const isVertical = orientation === "vertical";
2006
- const dividerStyle = isVertical ? {
2007
- width: 1,
2008
- alignSelf: "stretch",
2009
- backgroundColor: t.entropixColorBorderDefault,
2010
- marginHorizontal: spacingValue
2011
- } : {
2012
- height: 1,
2013
- width: "100%",
2014
- backgroundColor: t.entropixColorBorderDefault,
2015
- marginVertical: spacingValue
2016
- };
2017
- return /* @__PURE__ */ jsxRuntime.jsx(
2018
- reactNative.View,
2019
- {
2020
- accessibilityRole: isVertical ? "none" : void 0,
2021
- style: [dividerStyle, style],
2022
- ...rest
2023
- }
2024
- );
2025
- }
2026
20
 
2027
- exports.Accordion = Accordion;
2028
- exports.AccordionItem = AccordionItem;
2029
- exports.AccordionPanel = AccordionPanel;
2030
- exports.AccordionTrigger = AccordionTrigger;
2031
- exports.BREAKPOINTS = BREAKPOINTS;
2032
- exports.Button = Button;
2033
- exports.Checkbox = Checkbox;
2034
- exports.Container = Container;
2035
- exports.Dialog = Dialog;
2036
- exports.DialogClose = DialogClose;
2037
- exports.DialogContent = DialogContent;
2038
- exports.DialogDescription = DialogDescription;
2039
- exports.DialogOverlay = DialogOverlay;
2040
- exports.DialogTitle = DialogTitle;
2041
- exports.DialogTrigger = DialogTrigger;
2042
- exports.Divider = Divider;
2043
- exports.EntropixProvider = EntropixProvider;
2044
- exports.Inline = Inline;
2045
- exports.Input = Input;
2046
- exports.Menu = Menu;
2047
- exports.MenuContent = MenuContent;
2048
- exports.MenuItem = MenuItem;
2049
- exports.MenuTrigger = MenuTrigger;
2050
- exports.RadioGroup = RadioGroup;
2051
- exports.RadioItem = RadioItem;
2052
- exports.Select = Select;
2053
- exports.SelectContent = SelectContent;
2054
- exports.SelectOption = SelectOption;
2055
- exports.SelectTrigger = SelectTrigger;
2056
- exports.Stack = Stack;
2057
- exports.Switch = Switch;
2058
- exports.Tab = Tab;
2059
- exports.TabList = TabList;
2060
- exports.TabPanel = TabPanel;
2061
- exports.Tabs = Tabs;
2062
- exports.Textarea = Textarea;
2063
- exports.Toggle = Toggle;
2064
- exports.mapAccessibilityToRN = mapAccessibilityToRN;
2065
- exports.useBreakpoint = useBreakpoint;
2066
- exports.useBreakpointValue = useBreakpointValue;
2067
- exports.useScreenDimensions = useScreenDimensions;
2068
- exports.useTheme = useTheme;
21
+ Object.defineProperty(exports, "Input", {
22
+ enumerable: true,
23
+ get: function () { return chunkFQUZIDVS_cjs.Input; }
24
+ });
25
+ Object.defineProperty(exports, "Textarea", {
26
+ enumerable: true,
27
+ get: function () { return chunkUYXJHKYK_cjs.Textarea; }
28
+ });
29
+ Object.defineProperty(exports, "Checkbox", {
30
+ enumerable: true,
31
+ get: function () { return chunkIRQWSFCZ_cjs.Checkbox; }
32
+ });
33
+ Object.defineProperty(exports, "RadioGroup", {
34
+ enumerable: true,
35
+ get: function () { return chunkTHX22NZW_cjs.RadioGroup; }
36
+ });
37
+ Object.defineProperty(exports, "RadioItem", {
38
+ enumerable: true,
39
+ get: function () { return chunkTHX22NZW_cjs.RadioItem; }
40
+ });
41
+ Object.defineProperty(exports, "Select", {
42
+ enumerable: true,
43
+ get: function () { return chunkB5YFEA66_cjs.Select; }
44
+ });
45
+ Object.defineProperty(exports, "SelectContent", {
46
+ enumerable: true,
47
+ get: function () { return chunkB5YFEA66_cjs.SelectContent; }
48
+ });
49
+ Object.defineProperty(exports, "SelectOption", {
50
+ enumerable: true,
51
+ get: function () { return chunkB5YFEA66_cjs.SelectOption; }
52
+ });
53
+ Object.defineProperty(exports, "SelectTrigger", {
54
+ enumerable: true,
55
+ get: function () { return chunkB5YFEA66_cjs.SelectTrigger; }
56
+ });
57
+ Object.defineProperty(exports, "BREAKPOINTS", {
58
+ enumerable: true,
59
+ get: function () { return chunkG7WPUTB6_cjs.BREAKPOINTS; }
60
+ });
61
+ Object.defineProperty(exports, "Container", {
62
+ enumerable: true,
63
+ get: function () { return chunkG7WPUTB6_cjs.Container; }
64
+ });
65
+ Object.defineProperty(exports, "Divider", {
66
+ enumerable: true,
67
+ get: function () { return chunkG7WPUTB6_cjs.Divider; }
68
+ });
69
+ Object.defineProperty(exports, "Inline", {
70
+ enumerable: true,
71
+ get: function () { return chunkG7WPUTB6_cjs.Inline; }
72
+ });
73
+ Object.defineProperty(exports, "Stack", {
74
+ enumerable: true,
75
+ get: function () { return chunkG7WPUTB6_cjs.Stack; }
76
+ });
77
+ Object.defineProperty(exports, "useBreakpoint", {
78
+ enumerable: true,
79
+ get: function () { return chunkG7WPUTB6_cjs.useBreakpoint; }
80
+ });
81
+ Object.defineProperty(exports, "useBreakpointValue", {
82
+ enumerable: true,
83
+ get: function () { return chunkG7WPUTB6_cjs.useBreakpointValue; }
84
+ });
85
+ Object.defineProperty(exports, "useScreenDimensions", {
86
+ enumerable: true,
87
+ get: function () { return chunkG7WPUTB6_cjs.useScreenDimensions; }
88
+ });
89
+ Object.defineProperty(exports, "Button", {
90
+ enumerable: true,
91
+ get: function () { return chunkXND7AIKO_cjs.Button; }
92
+ });
93
+ Object.defineProperty(exports, "Toggle", {
94
+ enumerable: true,
95
+ get: function () { return chunkOMKUPSHJ_cjs.Toggle; }
96
+ });
97
+ Object.defineProperty(exports, "Switch", {
98
+ enumerable: true,
99
+ get: function () { return chunkZPAOLIIG_cjs.Switch; }
100
+ });
101
+ Object.defineProperty(exports, "Dialog", {
102
+ enumerable: true,
103
+ get: function () { return chunkPKDXWKLO_cjs.Dialog; }
104
+ });
105
+ Object.defineProperty(exports, "DialogClose", {
106
+ enumerable: true,
107
+ get: function () { return chunkPKDXWKLO_cjs.DialogClose; }
108
+ });
109
+ Object.defineProperty(exports, "DialogContent", {
110
+ enumerable: true,
111
+ get: function () { return chunkPKDXWKLO_cjs.DialogContent; }
112
+ });
113
+ Object.defineProperty(exports, "DialogDescription", {
114
+ enumerable: true,
115
+ get: function () { return chunkPKDXWKLO_cjs.DialogDescription; }
116
+ });
117
+ Object.defineProperty(exports, "DialogOverlay", {
118
+ enumerable: true,
119
+ get: function () { return chunkPKDXWKLO_cjs.DialogOverlay; }
120
+ });
121
+ Object.defineProperty(exports, "DialogTitle", {
122
+ enumerable: true,
123
+ get: function () { return chunkPKDXWKLO_cjs.DialogTitle; }
124
+ });
125
+ Object.defineProperty(exports, "DialogTrigger", {
126
+ enumerable: true,
127
+ get: function () { return chunkPKDXWKLO_cjs.DialogTrigger; }
128
+ });
129
+ Object.defineProperty(exports, "Tab", {
130
+ enumerable: true,
131
+ get: function () { return chunk2SQB7RNT_cjs.Tab; }
132
+ });
133
+ Object.defineProperty(exports, "TabList", {
134
+ enumerable: true,
135
+ get: function () { return chunk2SQB7RNT_cjs.TabList; }
136
+ });
137
+ Object.defineProperty(exports, "TabPanel", {
138
+ enumerable: true,
139
+ get: function () { return chunk2SQB7RNT_cjs.TabPanel; }
140
+ });
141
+ Object.defineProperty(exports, "Tabs", {
142
+ enumerable: true,
143
+ get: function () { return chunk2SQB7RNT_cjs.Tabs; }
144
+ });
145
+ Object.defineProperty(exports, "Accordion", {
146
+ enumerable: true,
147
+ get: function () { return chunkQ7TEJ62Q_cjs.Accordion; }
148
+ });
149
+ Object.defineProperty(exports, "AccordionItem", {
150
+ enumerable: true,
151
+ get: function () { return chunkQ7TEJ62Q_cjs.AccordionItem; }
152
+ });
153
+ Object.defineProperty(exports, "AccordionPanel", {
154
+ enumerable: true,
155
+ get: function () { return chunkQ7TEJ62Q_cjs.AccordionPanel; }
156
+ });
157
+ Object.defineProperty(exports, "AccordionTrigger", {
158
+ enumerable: true,
159
+ get: function () { return chunkQ7TEJ62Q_cjs.AccordionTrigger; }
160
+ });
161
+ Object.defineProperty(exports, "Menu", {
162
+ enumerable: true,
163
+ get: function () { return chunkZ2MBHXUQ_cjs.Menu; }
164
+ });
165
+ Object.defineProperty(exports, "MenuContent", {
166
+ enumerable: true,
167
+ get: function () { return chunkZ2MBHXUQ_cjs.MenuContent; }
168
+ });
169
+ Object.defineProperty(exports, "MenuItem", {
170
+ enumerable: true,
171
+ get: function () { return chunkZ2MBHXUQ_cjs.MenuItem; }
172
+ });
173
+ Object.defineProperty(exports, "MenuTrigger", {
174
+ enumerable: true,
175
+ get: function () { return chunkZ2MBHXUQ_cjs.MenuTrigger; }
176
+ });
177
+ Object.defineProperty(exports, "mapAccessibilityToRN", {
178
+ enumerable: true,
179
+ get: function () { return chunkP5NAXMSC_cjs.mapAccessibilityToRN; }
180
+ });
181
+ Object.defineProperty(exports, "EntropixProvider", {
182
+ enumerable: true,
183
+ get: function () { return chunkBOUIB4OY_cjs.EntropixProvider; }
184
+ });
185
+ Object.defineProperty(exports, "registerBrand", {
186
+ enumerable: true,
187
+ get: function () { return chunkBOUIB4OY_cjs.registerBrand; }
188
+ });
189
+ Object.defineProperty(exports, "useTheme", {
190
+ enumerable: true,
191
+ get: function () { return chunkBOUIB4OY_cjs.useTheme; }
192
+ });
2069
193
  //# sourceMappingURL=index.cjs.map
2070
194
  //# sourceMappingURL=index.cjs.map