@nori-ui/core 1.6.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/dist/{chunk-7UKRN73P.js → chunk-2XJCLPNH.js} +3 -3
  2. package/dist/{chunk-7UKRN73P.js.map → chunk-2XJCLPNH.js.map} +1 -1
  3. package/dist/{chunk-5PSC5HT4.js → chunk-3B345SQU.js} +5 -5
  4. package/dist/{chunk-5PSC5HT4.js.map → chunk-3B345SQU.js.map} +1 -1
  5. package/dist/{chunk-JSAG5YO7.js → chunk-3IIIHZHT.js} +3 -3
  6. package/dist/{chunk-JSAG5YO7.js.map → chunk-3IIIHZHT.js.map} +1 -1
  7. package/dist/{chunk-DDGMLLS3.js → chunk-3W3XYULK.js} +3 -3
  8. package/dist/{chunk-DDGMLLS3.js.map → chunk-3W3XYULK.js.map} +1 -1
  9. package/dist/{chunk-WYPGQVDV.js → chunk-5YHT252H.js} +3 -3
  10. package/dist/{chunk-WYPGQVDV.js.map → chunk-5YHT252H.js.map} +1 -1
  11. package/dist/{chunk-ZMSIYLSI.js → chunk-7FSFJA33.js} +3 -3
  12. package/dist/{chunk-ZMSIYLSI.js.map → chunk-7FSFJA33.js.map} +1 -1
  13. package/dist/chunk-BOMPFNM4.js +165 -0
  14. package/dist/chunk-BOMPFNM4.js.map +1 -0
  15. package/dist/chunk-BVLOX4A3.js +256 -0
  16. package/dist/chunk-BVLOX4A3.js.map +1 -0
  17. package/dist/{chunk-YZ27OS2R.js → chunk-C32XGHWO.js} +3 -3
  18. package/dist/{chunk-YZ27OS2R.js.map → chunk-C32XGHWO.js.map} +1 -1
  19. package/dist/{chunk-UJWCEGQY.js → chunk-C5HQPXRI.js} +3 -3
  20. package/dist/{chunk-UJWCEGQY.js.map → chunk-C5HQPXRI.js.map} +1 -1
  21. package/dist/{chunk-XALU6LOT.js → chunk-EN4CLDGZ.js} +3 -3
  22. package/dist/{chunk-XALU6LOT.js.map → chunk-EN4CLDGZ.js.map} +1 -1
  23. package/dist/{chunk-6AD6KCVB.js → chunk-F5UKI7XD.js} +3 -3
  24. package/dist/{chunk-6AD6KCVB.js.map → chunk-F5UKI7XD.js.map} +1 -1
  25. package/dist/chunk-GTAXVTLF.js +43 -0
  26. package/dist/chunk-GTAXVTLF.js.map +1 -0
  27. package/dist/{chunk-NNFJKRXZ.js → chunk-H2LHWJ52.js} +3 -3
  28. package/dist/{chunk-NNFJKRXZ.js.map → chunk-H2LHWJ52.js.map} +1 -1
  29. package/dist/{chunk-PZS4A4VQ.js → chunk-HXCETKCC.js} +3 -3
  30. package/dist/{chunk-PZS4A4VQ.js.map → chunk-HXCETKCC.js.map} +1 -1
  31. package/dist/chunk-IGBXSBF7.js +71 -0
  32. package/dist/chunk-IGBXSBF7.js.map +1 -0
  33. package/dist/{chunk-JXLEMBDB.js → chunk-IIVTPN62.js} +3 -3
  34. package/dist/{chunk-JXLEMBDB.js.map → chunk-IIVTPN62.js.map} +1 -1
  35. package/dist/{chunk-PNP7L4TA.js → chunk-ISCJST4P.js} +3 -3
  36. package/dist/{chunk-PNP7L4TA.js.map → chunk-ISCJST4P.js.map} +1 -1
  37. package/dist/{chunk-TLS54G6Y.js → chunk-IWM2XDXH.js} +3 -3
  38. package/dist/{chunk-TLS54G6Y.js.map → chunk-IWM2XDXH.js.map} +1 -1
  39. package/dist/chunk-J5LK2XHE.js +118 -0
  40. package/dist/chunk-J5LK2XHE.js.map +1 -0
  41. package/dist/chunk-KFFGDET3.js +27 -0
  42. package/dist/chunk-KFFGDET3.js.map +1 -0
  43. package/dist/{chunk-MRJWPRCX.js → chunk-L6VYDM7S.js} +3 -3
  44. package/dist/{chunk-MRJWPRCX.js.map → chunk-L6VYDM7S.js.map} +1 -1
  45. package/dist/chunk-M4BI63P6.js +188 -0
  46. package/dist/chunk-M4BI63P6.js.map +1 -0
  47. package/dist/{chunk-RUWD35UI.js → chunk-MK57AOTI.js} +4 -4
  48. package/dist/{chunk-RUWD35UI.js.map → chunk-MK57AOTI.js.map} +1 -1
  49. package/dist/{chunk-3BDDPFCI.js → chunk-MOAIQHR7.js} +3 -3
  50. package/dist/{chunk-3BDDPFCI.js.map → chunk-MOAIQHR7.js.map} +1 -1
  51. package/dist/{chunk-5XEGZFG5.js → chunk-MYBBBLYE.js} +3 -3
  52. package/dist/{chunk-5XEGZFG5.js.map → chunk-MYBBBLYE.js.map} +1 -1
  53. package/dist/{chunk-WP2Z2ATO.js → chunk-O6M3F7BZ.js} +5 -5
  54. package/dist/{chunk-WP2Z2ATO.js.map → chunk-O6M3F7BZ.js.map} +1 -1
  55. package/dist/{chunk-FEPTH5RV.js → chunk-OELY6K44.js} +3 -3
  56. package/dist/{chunk-FEPTH5RV.js.map → chunk-OELY6K44.js.map} +1 -1
  57. package/dist/{chunk-BZLT6R62.js → chunk-OIHX5B4R.js} +3 -3
  58. package/dist/{chunk-BZLT6R62.js.map → chunk-OIHX5B4R.js.map} +1 -1
  59. package/dist/{chunk-QJVS2VXS.js → chunk-PGYEIXCO.js} +4 -4
  60. package/dist/{chunk-QJVS2VXS.js.map → chunk-PGYEIXCO.js.map} +1 -1
  61. package/dist/{chunk-UZD77M3J.js → chunk-PJTCO76H.js} +3 -3
  62. package/dist/{chunk-UZD77M3J.js.map → chunk-PJTCO76H.js.map} +1 -1
  63. package/dist/{chunk-4PUPKWEP.js → chunk-PJXVLE24.js} +4 -4
  64. package/dist/{chunk-4PUPKWEP.js.map → chunk-PJXVLE24.js.map} +1 -1
  65. package/dist/{chunk-WGT345SV.js → chunk-PLQPBMG2.js} +3 -3
  66. package/dist/{chunk-WGT345SV.js.map → chunk-PLQPBMG2.js.map} +1 -1
  67. package/dist/{chunk-OMU4R4Y5.js → chunk-PQW5LKAI.js} +3 -3
  68. package/dist/{chunk-OMU4R4Y5.js.map → chunk-PQW5LKAI.js.map} +1 -1
  69. package/dist/{chunk-Y5TJ7CAX.js → chunk-RI4Y2C5U.js} +3 -3
  70. package/dist/{chunk-Y5TJ7CAX.js.map → chunk-RI4Y2C5U.js.map} +1 -1
  71. package/dist/{chunk-3OIWAS2P.js → chunk-SF6WPUC5.js} +3 -3
  72. package/dist/{chunk-3OIWAS2P.js.map → chunk-SF6WPUC5.js.map} +1 -1
  73. package/dist/{chunk-MKSDYRWQ.js → chunk-STX5UKYT.js} +3 -3
  74. package/dist/{chunk-MKSDYRWQ.js.map → chunk-STX5UKYT.js.map} +1 -1
  75. package/dist/{chunk-2RL6WCFC.js → chunk-TSWPHJIU.js} +4 -4
  76. package/dist/{chunk-2RL6WCFC.js.map → chunk-TSWPHJIU.js.map} +1 -1
  77. package/dist/{chunk-SFNDR6DI.js → chunk-U2ZKY2CP.js} +3 -3
  78. package/dist/{chunk-SFNDR6DI.js.map → chunk-U2ZKY2CP.js.map} +1 -1
  79. package/dist/{chunk-PABG3IJ6.js → chunk-UKDDK42K.js} +3 -3
  80. package/dist/{chunk-PABG3IJ6.js.map → chunk-UKDDK42K.js.map} +1 -1
  81. package/dist/{chunk-VYRJ7OE5.js → chunk-USFXANEU.js} +3 -3
  82. package/dist/{chunk-VYRJ7OE5.js.map → chunk-USFXANEU.js.map} +1 -1
  83. package/dist/{chunk-CCUXO2HN.js → chunk-V5QSMDZL.js} +3 -3
  84. package/dist/{chunk-CCUXO2HN.js.map → chunk-V5QSMDZL.js.map} +1 -1
  85. package/dist/{chunk-NF7XG2FG.js → chunk-V75O7QQO.js} +3 -3
  86. package/dist/{chunk-NF7XG2FG.js.map → chunk-V75O7QQO.js.map} +1 -1
  87. package/dist/chunk-VFUV6XJR.js +257 -0
  88. package/dist/chunk-VFUV6XJR.js.map +1 -0
  89. package/dist/{chunk-NRYWNOG5.js → chunk-VL2WNGPF.js} +3 -3
  90. package/dist/{chunk-NRYWNOG5.js.map → chunk-VL2WNGPF.js.map} +1 -1
  91. package/dist/{chunk-JQQ3FBN7.js → chunk-VLZANXRZ.js} +3 -3
  92. package/dist/{chunk-JQQ3FBN7.js.map → chunk-VLZANXRZ.js.map} +1 -1
  93. package/dist/{chunk-2HMQDJ22.js → chunk-VOF3S5I4.js} +3 -3
  94. package/dist/{chunk-2HMQDJ22.js.map → chunk-VOF3S5I4.js.map} +1 -1
  95. package/dist/chunk-XQNVWHMN.js +60 -0
  96. package/dist/chunk-XQNVWHMN.js.map +1 -0
  97. package/dist/{chunk-JZ774T7U.js → chunk-ZGFXKYA5.js} +3 -3
  98. package/dist/{chunk-JZ774T7U.js.map → chunk-ZGFXKYA5.js.map} +1 -1
  99. package/dist/client.cjs +1106 -7
  100. package/dist/client.cjs.map +1 -1
  101. package/dist/client.d.cts +9 -0
  102. package/dist/client.d.ts +9 -0
  103. package/dist/client.js +56 -47
  104. package/dist/client.js.map +1 -1
  105. package/dist/components/Accordion/index.js +2 -2
  106. package/dist/components/Alert/index.js +2 -2
  107. package/dist/components/AlertDialog/index.js +2 -2
  108. package/dist/components/AspectRatio/index.cjs +67 -0
  109. package/dist/components/AspectRatio/index.cjs.map +1 -0
  110. package/dist/components/AspectRatio/index.d.cts +30 -0
  111. package/dist/components/AspectRatio/index.d.ts +30 -0
  112. package/dist/components/AspectRatio/index.js +5 -0
  113. package/dist/components/AspectRatio/index.js.map +1 -0
  114. package/dist/components/Avatar/index.js +2 -2
  115. package/dist/components/Badge/index.js +2 -2
  116. package/dist/components/Box/index.js +4 -4
  117. package/dist/components/Breadcrumb/index.js +3 -3
  118. package/dist/components/Button/index.js +2 -2
  119. package/dist/components/ButtonGroup/index.cjs +83 -0
  120. package/dist/components/ButtonGroup/index.cjs.map +1 -0
  121. package/dist/components/ButtonGroup/index.d.cts +45 -0
  122. package/dist/components/ButtonGroup/index.d.ts +45 -0
  123. package/dist/components/ButtonGroup/index.js +5 -0
  124. package/dist/components/ButtonGroup/index.js.map +1 -0
  125. package/dist/components/Calendar/index.js +3 -3
  126. package/dist/components/Card/index.js +2 -2
  127. package/dist/components/Carousel/index.cjs +297 -0
  128. package/dist/components/Carousel/index.cjs.map +1 -0
  129. package/dist/components/Carousel/index.d.cts +67 -0
  130. package/dist/components/Carousel/index.d.ts +67 -0
  131. package/dist/components/Carousel/index.js +5 -0
  132. package/dist/components/Carousel/index.js.map +1 -0
  133. package/dist/components/Checkbox/index.js +2 -2
  134. package/dist/components/Collapsible/index.cjs +512 -0
  135. package/dist/components/Collapsible/index.cjs.map +1 -0
  136. package/dist/components/Collapsible/index.d.cts +50 -0
  137. package/dist/components/Collapsible/index.d.ts +50 -0
  138. package/dist/components/Collapsible/index.js +7 -0
  139. package/dist/components/Collapsible/index.js.map +1 -0
  140. package/dist/components/Combobox/index.js +3 -3
  141. package/dist/components/ContextMenu/index.js +4 -4
  142. package/dist/components/DataTable/index.js +3 -3
  143. package/dist/components/DatePicker/index.js +5 -5
  144. package/dist/components/Dialog/index.js +2 -2
  145. package/dist/components/DropdownMenu/index.js +3 -3
  146. package/dist/components/Empty/index.cjs +385 -0
  147. package/dist/components/Empty/index.cjs.map +1 -0
  148. package/dist/components/Empty/index.d.cts +32 -0
  149. package/dist/components/Empty/index.d.ts +32 -0
  150. package/dist/components/Empty/index.js +7 -0
  151. package/dist/components/Empty/index.js.map +1 -0
  152. package/dist/components/FloatButton/index.js +3 -3
  153. package/dist/components/HStack/index.js +4 -4
  154. package/dist/components/HoverCard/index.cjs +894 -0
  155. package/dist/components/HoverCard/index.cjs.map +1 -0
  156. package/dist/components/HoverCard/index.d.cts +66 -0
  157. package/dist/components/HoverCard/index.d.ts +66 -0
  158. package/dist/components/HoverCard/index.js +9 -0
  159. package/dist/components/HoverCard/index.js.map +1 -0
  160. package/dist/components/InputGroup/index.js +2 -2
  161. package/dist/components/InputOTP/index.cjs +580 -0
  162. package/dist/components/InputOTP/index.cjs.map +1 -0
  163. package/dist/components/InputOTP/index.d.cts +49 -0
  164. package/dist/components/InputOTP/index.d.ts +49 -0
  165. package/dist/components/InputOTP/index.js +7 -0
  166. package/dist/components/InputOTP/index.js.map +1 -0
  167. package/dist/components/Item/index.cjs +443 -0
  168. package/dist/components/Item/index.cjs.map +1 -0
  169. package/dist/components/Item/index.d.cts +40 -0
  170. package/dist/components/Item/index.d.ts +40 -0
  171. package/dist/components/Item/index.js +7 -0
  172. package/dist/components/Item/index.js.map +1 -0
  173. package/dist/components/Kbd/index.cjs +396 -0
  174. package/dist/components/Kbd/index.cjs.map +1 -0
  175. package/dist/components/Kbd/index.d.cts +22 -0
  176. package/dist/components/Kbd/index.d.ts +22 -0
  177. package/dist/components/Kbd/index.js +7 -0
  178. package/dist/components/Kbd/index.js.map +1 -0
  179. package/dist/components/Pagination/index.js +4 -4
  180. package/dist/components/Popover/index.js +2 -2
  181. package/dist/components/Progress/index.js +2 -2
  182. package/dist/components/Radio/index.js +2 -2
  183. package/dist/components/SegmentedControl/index.js +2 -2
  184. package/dist/components/Select/index.js +2 -2
  185. package/dist/components/Separator/index.js +2 -2
  186. package/dist/components/Sheet/index.js +2 -2
  187. package/dist/components/Skeleton/index.js +2 -2
  188. package/dist/components/Slider/index.js +2 -2
  189. package/dist/components/Switch/index.js +2 -2
  190. package/dist/components/Table/index.js +2 -2
  191. package/dist/components/Tabs/index.js +2 -2
  192. package/dist/components/Text/index.js +2 -2
  193. package/dist/components/TextArea/index.js +3 -3
  194. package/dist/components/TextInput/index.js +2 -2
  195. package/dist/components/Toggle/index.js +2 -2
  196. package/dist/components/Tooltip/index.js +2 -2
  197. package/dist/components/VStack/index.js +4 -4
  198. package/dist/index.cjs +1106 -7
  199. package/dist/index.cjs.map +1 -1
  200. package/dist/index.d.cts +9 -0
  201. package/dist/index.d.ts +9 -0
  202. package/dist/index.js +54 -45
  203. package/package.json +1 -1
@@ -0,0 +1,580 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+ var reactNative = require('react-native');
5
+ var jsxRuntime = require('nativewind/jsx-runtime');
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
+
10
+ // src/theme/px.ts
11
+ function px(value) {
12
+ if (typeof value === "number") {
13
+ return value;
14
+ }
15
+ const n = Number.parseFloat(value);
16
+ return Number.isFinite(n) ? n : 0;
17
+ }
18
+ __name(px, "px");
19
+
20
+ // ../tokens/build/theme.ts
21
+ var theme = {
22
+ color: {
23
+ danger: "#ef4444",
24
+ info: "#3b82f6",
25
+ neutral: {
26
+ "100": "#f4f4f5",
27
+ "200": "#e4e4e7",
28
+ "300": "#d4d4d8",
29
+ "400": "#a1a1aa",
30
+ "50": "#fafafa",
31
+ "500": "#71717a",
32
+ "600": "#52525b",
33
+ "700": "#3f3f46",
34
+ "800": "#27272a",
35
+ "900": "#18181b"
36
+ },
37
+ primary: {
38
+ "100": "#ccfbf1",
39
+ "200": "#99f6e4",
40
+ "300": "#5eead4",
41
+ "400": "#2dd4bf",
42
+ "50": "#f0fdfa",
43
+ "500": "#14b8a6",
44
+ "600": "#0d9488",
45
+ "700": "#0f766e",
46
+ "800": "#115e59",
47
+ "900": "#134e4a"
48
+ },
49
+ success: "#22c55e",
50
+ warning: "#f59e0b"
51
+ },
52
+ fontFamily: {
53
+ body: "system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",
54
+ display: "ui-serif, Georgia, 'Times New Roman', serif",
55
+ mono: "ui-monospace, 'SF Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace"
56
+ },
57
+ fontSize: {
58
+ "2xl": "24px",
59
+ "3xl": "30px",
60
+ "4xl": "36px",
61
+ lg: "18px",
62
+ md: "16px",
63
+ sm: "14px",
64
+ xl: "20px",
65
+ xs: "12px"
66
+ },
67
+ fontWeight: {
68
+ bold: "700",
69
+ medium: "500",
70
+ regular: "400",
71
+ semibold: "600"
72
+ },
73
+ lineHeight: {
74
+ normal: "1.4",
75
+ relaxed: "1.6",
76
+ tight: "1.2"
77
+ },
78
+ radius: {
79
+ "2xl": "16px",
80
+ full: "9999px",
81
+ lg: "8px",
82
+ md: "6px",
83
+ none: "0px",
84
+ sm: "4px",
85
+ xl: "12px"
86
+ },
87
+ semantic: {
88
+ background: {
89
+ default: "#fafafa",
90
+ elevated: "#ffffff",
91
+ subtle: "#f4f4f5"
92
+ },
93
+ border: {
94
+ default: "#e4e4e7",
95
+ strong: "#d4d4d8"
96
+ },
97
+ interactive: {
98
+ destructive: "#ef4444",
99
+ primary: "#0d9488",
100
+ primaryHover: "#0f766e",
101
+ primaryPressed: "#115e59"
102
+ },
103
+ text: {
104
+ default: "#18181b",
105
+ inverted: "#fafafa",
106
+ muted: "#52525b"
107
+ }
108
+ },
109
+ shadow: {
110
+ lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",
111
+ md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",
112
+ sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)"
113
+ },
114
+ spacing: {
115
+ "0": "0px",
116
+ "1": "4px",
117
+ "10": "40px",
118
+ "12": "48px",
119
+ "16": "64px",
120
+ "2": "8px",
121
+ "20": "80px",
122
+ "24": "96px",
123
+ "3": "12px",
124
+ "4": "16px",
125
+ "5": "20px",
126
+ "6": "24px",
127
+ "8": "32px"
128
+ }
129
+ };
130
+ var themeDark = {
131
+ color: {
132
+ danger: "#ef4444",
133
+ info: "#3b82f6",
134
+ neutral: {
135
+ "100": "#f4f4f5",
136
+ "200": "#e4e4e7",
137
+ "300": "#d4d4d8",
138
+ "400": "#a1a1aa",
139
+ "50": "#fafafa",
140
+ "500": "#71717a",
141
+ "600": "#52525b",
142
+ "700": "#3f3f46",
143
+ "800": "#27272a",
144
+ "900": "#18181b"
145
+ },
146
+ primary: {
147
+ "100": "#ccfbf1",
148
+ "200": "#99f6e4",
149
+ "300": "#5eead4",
150
+ "400": "#2dd4bf",
151
+ "50": "#f0fdfa",
152
+ "500": "#14b8a6",
153
+ "600": "#0d9488",
154
+ "700": "#0f766e",
155
+ "800": "#115e59",
156
+ "900": "#134e4a"
157
+ },
158
+ success: "#22c55e",
159
+ warning: "#f59e0b"
160
+ },
161
+ fontFamily: {
162
+ body: "system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",
163
+ display: "ui-serif, Georgia, 'Times New Roman', serif",
164
+ mono: "ui-monospace, 'SF Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace"
165
+ },
166
+ fontSize: {
167
+ "2xl": "24px",
168
+ "3xl": "30px",
169
+ "4xl": "36px",
170
+ lg: "18px",
171
+ md: "16px",
172
+ sm: "14px",
173
+ xl: "20px",
174
+ xs: "12px"
175
+ },
176
+ fontWeight: {
177
+ bold: "700",
178
+ medium: "500",
179
+ regular: "400",
180
+ semibold: "600"
181
+ },
182
+ lineHeight: {
183
+ normal: "1.4",
184
+ relaxed: "1.6",
185
+ tight: "1.2"
186
+ },
187
+ radius: {
188
+ "2xl": "16px",
189
+ full: "9999px",
190
+ lg: "8px",
191
+ md: "6px",
192
+ none: "0px",
193
+ sm: "4px",
194
+ xl: "12px"
195
+ },
196
+ semantic: {
197
+ background: {
198
+ default: "#18181b",
199
+ elevated: "#3f3f46",
200
+ subtle: "#27272a"
201
+ },
202
+ border: {
203
+ default: "#3f3f46",
204
+ strong: "#52525b"
205
+ },
206
+ interactive: {
207
+ destructive: "#ef4444",
208
+ primary: "#2dd4bf",
209
+ primaryHover: "#5eead4",
210
+ primaryPressed: "#99f6e4"
211
+ },
212
+ text: {
213
+ default: "#fafafa",
214
+ inverted: "#18181b",
215
+ muted: "#a1a1aa"
216
+ }
217
+ },
218
+ shadow: {
219
+ lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",
220
+ md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",
221
+ sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)"
222
+ },
223
+ spacing: {
224
+ "0": "0px",
225
+ "1": "4px",
226
+ "10": "40px",
227
+ "12": "48px",
228
+ "16": "64px",
229
+ "2": "8px",
230
+ "20": "80px",
231
+ "24": "96px",
232
+ "3": "12px",
233
+ "4": "16px",
234
+ "5": "20px",
235
+ "6": "24px",
236
+ "8": "32px"
237
+ }
238
+ };
239
+ var defaultTheme = {
240
+ light: theme,
241
+ dark: themeDark
242
+ };
243
+ var ThemeContext = react.createContext(defaultTheme);
244
+ ThemeContext.displayName = "ThemeContext";
245
+ var ColorSchemeOverrideContext = react.createContext(null);
246
+ ColorSchemeOverrideContext.displayName = "ColorSchemeOverrideContext";
247
+ var isWeb = reactNative.Platform.OS === "web";
248
+ function readWebScheme() {
249
+ if (typeof document === "undefined") {
250
+ return "light";
251
+ }
252
+ const root = document.documentElement;
253
+ if (root.classList.contains("dark")) {
254
+ return "dark";
255
+ }
256
+ if (root.getAttribute("data-theme") === "dark") {
257
+ return "dark";
258
+ }
259
+ return "light";
260
+ }
261
+ __name(readWebScheme, "readWebScheme");
262
+ function useColorScheme() {
263
+ const override = react.useContext(ColorSchemeOverrideContext);
264
+ const [scheme, setScheme] = react.useState(() => {
265
+ if (isWeb) {
266
+ return readWebScheme();
267
+ }
268
+ return reactNative.Appearance.getColorScheme() ?? "light";
269
+ });
270
+ react.useEffect(() => {
271
+ if (isWeb) {
272
+ const root = document.documentElement;
273
+ const update = /* @__PURE__ */ __name(() => setScheme(readWebScheme()), "update");
274
+ const observer = new MutationObserver(update);
275
+ observer.observe(root, { attributes: true, attributeFilter: ["class", "data-theme"] });
276
+ update();
277
+ return () => observer.disconnect();
278
+ }
279
+ const sub = reactNative.Appearance.addChangeListener(({ colorScheme }) => {
280
+ setScheme(colorScheme ?? "light");
281
+ });
282
+ return () => sub.remove();
283
+ }, []);
284
+ return override ?? scheme;
285
+ }
286
+ __name(useColorScheme, "useColorScheme");
287
+
288
+ // src/theme/use-theme-colors.ts
289
+ function useThemeColors() {
290
+ const scheme = useColorScheme();
291
+ const themePair = react.useContext(ThemeContext);
292
+ return scheme === "dark" ? themePair.dark : themePair.light;
293
+ }
294
+ __name(useThemeColors, "useThemeColors");
295
+
296
+ // src/utils/cn.ts
297
+ function cn(...inputs) {
298
+ const out = [];
299
+ for (const input of inputs) {
300
+ append(out, input);
301
+ }
302
+ return out.join(" ");
303
+ }
304
+ __name(cn, "cn");
305
+ function append(out, input) {
306
+ if (!input) {
307
+ return;
308
+ }
309
+ if (typeof input === "string") {
310
+ if (input.length > 0) {
311
+ out.push(input);
312
+ }
313
+ return;
314
+ }
315
+ if (typeof input === "number") {
316
+ return;
317
+ }
318
+ if (Array.isArray(input)) {
319
+ for (const inner of input) {
320
+ append(out, inner);
321
+ }
322
+ return;
323
+ }
324
+ if (typeof input === "object") {
325
+ for (const key of Object.keys(input)) {
326
+ if (input[key]) {
327
+ out.push(key);
328
+ }
329
+ }
330
+ }
331
+ }
332
+ __name(append, "append");
333
+ function isAllowed(char, pattern) {
334
+ if (pattern === "numeric") {
335
+ return /^\d$/.test(char);
336
+ }
337
+ return /^[a-zA-Z0-9]$/.test(char);
338
+ }
339
+ __name(isAllowed, "isAllowed");
340
+ function filterValue(value, pattern, length) {
341
+ return value.split("").filter((c) => isAllowed(c, pattern)).slice(0, length).join("");
342
+ }
343
+ __name(filterValue, "filterValue");
344
+ var InputOTP = /* @__PURE__ */ __name(({
345
+ value = "",
346
+ onChange,
347
+ onComplete,
348
+ length = 6,
349
+ placeholder = "\xB7",
350
+ pattern = "numeric",
351
+ disabled = false,
352
+ autoFocus = false,
353
+ id,
354
+ name,
355
+ "aria-label": ariaLabel = "One-time code",
356
+ "aria-labelledby": ariaLabelledBy,
357
+ "aria-describedby": ariaDescribedBy,
358
+ "aria-invalid": ariaInvalid,
359
+ className,
360
+ testID
361
+ }) => {
362
+ const colors = useThemeColors();
363
+ const [cells, setCells] = react.useState(() => {
364
+ const filtered = filterValue(value, pattern, length);
365
+ return Array.from({ length }, (_, i) => filtered[i] ?? "");
366
+ });
367
+ const prevValue = react.useRef(value);
368
+ react.useEffect(() => {
369
+ if (value !== prevValue.current) {
370
+ prevValue.current = value;
371
+ const filtered = filterValue(value, pattern, length);
372
+ setCells(Array.from({ length }, (_, i) => filtered[i] ?? ""));
373
+ }
374
+ }, [value, pattern, length]);
375
+ const inputRefs = react.useRef([]);
376
+ const focusCell = react.useCallback(
377
+ (idx) => {
378
+ if (idx >= 0 && idx < length) {
379
+ inputRefs.current[idx]?.focus();
380
+ }
381
+ },
382
+ [length]
383
+ );
384
+ const updateCells = react.useCallback(
385
+ (next) => {
386
+ setCells(next);
387
+ const joined = next.join("");
388
+ onChange?.(joined);
389
+ if (joined.length === length && !next.includes("")) {
390
+ onComplete?.(joined);
391
+ }
392
+ },
393
+ [onChange, onComplete, length]
394
+ );
395
+ const onContainerPaste = react.useCallback(
396
+ (e) => {
397
+ e.preventDefault();
398
+ const text = e.clipboardData.getData("text/plain") ?? "";
399
+ const filtered = filterValue(text, pattern, length);
400
+ const next = Array.from({ length }, (_, i) => filtered[i] ?? "");
401
+ updateCells(next);
402
+ const nextEmpty = next.indexOf("");
403
+ focusCell(nextEmpty === -1 ? length - 1 : nextEmpty);
404
+ },
405
+ [pattern, length, updateCells, focusCell]
406
+ );
407
+ const handleChangeText = react.useCallback(
408
+ (text, idx) => {
409
+ if (text.length > 1) {
410
+ const filtered = filterValue(text, pattern, length);
411
+ const next2 = Array.from({ length }, (_, i) => filtered[i] ?? "");
412
+ updateCells(next2);
413
+ const nextEmpty = next2.indexOf("");
414
+ focusCell(nextEmpty === -1 ? length - 1 : nextEmpty);
415
+ return;
416
+ }
417
+ const char = text.slice(-1);
418
+ if (char && !isAllowed(char, pattern)) {
419
+ return;
420
+ }
421
+ const next = [...cells];
422
+ next[idx] = char;
423
+ updateCells(next);
424
+ if (char) {
425
+ focusCell(idx + 1);
426
+ }
427
+ },
428
+ [cells, pattern, length, updateCells, focusCell]
429
+ );
430
+ const handleWebKeyDown = react.useCallback(
431
+ (e, idx) => {
432
+ if (e.key === "Backspace") {
433
+ if (cells[idx] !== "") {
434
+ const next = [...cells];
435
+ next[idx] = "";
436
+ updateCells(next);
437
+ } else {
438
+ focusCell(idx - 1);
439
+ }
440
+ e.preventDefault();
441
+ } else if (e.key === "ArrowLeft") {
442
+ focusCell(idx - 1);
443
+ e.preventDefault();
444
+ } else if (e.key === "ArrowRight") {
445
+ focusCell(idx + 1);
446
+ e.preventDefault();
447
+ } else if (e.key.length === 1 && isAllowed(e.key, pattern)) {
448
+ const next = [...cells];
449
+ next[idx] = e.key;
450
+ updateCells(next);
451
+ focusCell(idx + 1);
452
+ e.preventDefault();
453
+ }
454
+ },
455
+ [cells, pattern, focusCell, updateCells]
456
+ );
457
+ const handleNativeKeyPress = react.useCallback(
458
+ (e, idx) => {
459
+ if (e.nativeEvent.key === "Backspace") {
460
+ if (cells[idx] !== "") {
461
+ const next = [...cells];
462
+ next[idx] = "";
463
+ updateCells(next);
464
+ } else {
465
+ focusCell(idx - 1);
466
+ }
467
+ }
468
+ },
469
+ [cells, focusCell, updateCells]
470
+ );
471
+ const cellStyle = [
472
+ styles.cell,
473
+ {
474
+ width: px(48),
475
+ height: px(56),
476
+ borderRadius: px(colors.radius.md),
477
+ borderColor: colors.semantic.border.default,
478
+ backgroundColor: colors.semantic.background.elevated,
479
+ color: colors.semantic.text.default,
480
+ fontSize: px(colors.fontSize.xl),
481
+ fontFamily: colors.fontFamily.body
482
+ },
483
+ disabled ? styles.disabled : null,
484
+ ariaInvalid === true || ariaInvalid === "true" ? { borderColor: colors.color.danger } : null
485
+ ];
486
+ const isWeb2 = reactNative.Platform.OS === "web";
487
+ const containerProps = isWeb2 ? {
488
+ onPaste: onContainerPaste,
489
+ role: "group",
490
+ "aria-label": ariaLabel,
491
+ "aria-labelledby": ariaLabelledBy,
492
+ "aria-describedby": ariaDescribedBy
493
+ } : {};
494
+ return /* @__PURE__ */ jsxRuntime.jsxs(
495
+ reactNative.View,
496
+ {
497
+ testID,
498
+ ...isWeb2 ? {} : { accessible: true, accessibilityLabel: ariaLabel },
499
+ ...containerProps,
500
+ className: cn("flex-row items-center gap-2", className),
501
+ style: styles.container,
502
+ children: [
503
+ Array.from({ length }, (_, idx) => {
504
+ const cellValue = cells[idx] ?? "";
505
+ const cellRef = /* @__PURE__ */ __name((el) => {
506
+ inputRefs.current[idx] = el;
507
+ }, "cellRef");
508
+ const webProps = isWeb2 ? {
509
+ onKeyDown: /* @__PURE__ */ __name((e) => handleWebKeyDown(e, idx), "onKeyDown"),
510
+ // id only on the first cell
511
+ ...idx === 0 && id ? { id, nativeID: id } : {},
512
+ ...idx === 0 && name ? { name } : {},
513
+ ...idx === 0 && ariaLabelledBy ? { "aria-labelledby": ariaLabelledBy } : {},
514
+ ...idx === 0 && ariaDescribedBy ? { "aria-describedby": ariaDescribedBy } : {},
515
+ ...idx === 0 && ariaInvalid !== void 0 ? { "aria-invalid": ariaInvalid } : {},
516
+ inputMode: pattern === "numeric" ? "numeric" : "text"
517
+ } : {};
518
+ const nativeOnlyProps = isWeb2 ? {} : {
519
+ keyboardType: pattern === "numeric" ? "number-pad" : "default",
520
+ textAlign: "center",
521
+ selectTextOnFocus: true,
522
+ onKeyPress: /* @__PURE__ */ __name((e) => handleNativeKeyPress(e, idx), "onKeyPress")
523
+ };
524
+ return /* @__PURE__ */ jsxRuntime.jsx(
525
+ reactNative.TextInput,
526
+ {
527
+ ref: cellRef,
528
+ value: cellValue,
529
+ placeholder: placeholder,
530
+ maxLength: 1,
531
+ editable: !disabled,
532
+ autoFocus: autoFocus && idx === 0,
533
+ testID: testID ? `${testID}-cell-${idx}` : void 0,
534
+ onChangeText: (text) => handleChangeText(text, idx),
535
+ accessibilityLabel: `Digit ${idx + 1} of ${length}`,
536
+ ...nativeOnlyProps,
537
+ ...webProps,
538
+ style: cellStyle
539
+ },
540
+ idx
541
+ );
542
+ }),
543
+ isWeb2 && name ? /* @__PURE__ */ jsxRuntime.jsx(
544
+ reactNative.TextInput,
545
+ {
546
+ style: styles.hidden,
547
+ value: cells.join(""),
548
+ "aria-hidden": true,
549
+ tabIndex: -1,
550
+ ...{ name }
551
+ }
552
+ ) : null
553
+ ]
554
+ }
555
+ );
556
+ }, "InputOTP");
557
+ var styles = reactNative.StyleSheet.create({
558
+ container: {
559
+ flexDirection: "row",
560
+ alignItems: "center",
561
+ gap: 8
562
+ },
563
+ cell: {
564
+ borderWidth: 1,
565
+ textAlign: "center"
566
+ },
567
+ disabled: {
568
+ opacity: 0.6
569
+ },
570
+ hidden: {
571
+ position: "absolute",
572
+ width: 0,
573
+ height: 0,
574
+ opacity: 0
575
+ }
576
+ });
577
+
578
+ exports.InputOTP = InputOTP;
579
+ //# sourceMappingURL=index.cjs.map
580
+ //# sourceMappingURL=index.cjs.map