@nori-ui/core 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-JGH6Z5LM.js → chunk-6OABNXBY.js} +2 -2
- package/dist/{chunk-JGH6Z5LM.js.map → chunk-6OABNXBY.js.map} +1 -1
- package/dist/chunk-UAKFCMWK.js +3 -0
- package/dist/chunk-UAKFCMWK.js.map +1 -0
- package/dist/{chunk-6NDARMPP.js → chunk-X3AJNNF6.js} +167 -17
- package/dist/chunk-X3AJNNF6.js.map +1 -0
- package/dist/client.cjs +374 -225
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +5 -4
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +374 -225
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -2
- package/dist/stories/story-registry.cjs +179 -15
- package/dist/stories/story-registry.cjs.map +1 -1
- package/dist/stories/story-registry.js +2 -1
- package/dist/stories/story-registry.js.map +1 -1
- package/dist/theme/index.js +2 -1
- package/package.json +1 -2
- package/dist/chunk-6NDARMPP.js.map +0 -1
package/dist/client.cjs
CHANGED
|
@@ -157,6 +157,216 @@ function Box({ className, children, ...rest }) {
|
|
|
157
157
|
}
|
|
158
158
|
__name(Box, "Box");
|
|
159
159
|
|
|
160
|
+
// ../tokens/build/theme.ts
|
|
161
|
+
var theme = {
|
|
162
|
+
color: {
|
|
163
|
+
danger: "#ef4444",
|
|
164
|
+
info: "#3b82f6",
|
|
165
|
+
neutral: {
|
|
166
|
+
"100": "#f4f4f5",
|
|
167
|
+
"200": "#e4e4e7",
|
|
168
|
+
"300": "#d4d4d8",
|
|
169
|
+
"400": "#a1a1aa",
|
|
170
|
+
"50": "#fafafa",
|
|
171
|
+
"500": "#71717a",
|
|
172
|
+
"600": "#52525b",
|
|
173
|
+
"700": "#3f3f46",
|
|
174
|
+
"800": "#27272a",
|
|
175
|
+
"900": "#18181b"
|
|
176
|
+
},
|
|
177
|
+
primary: {
|
|
178
|
+
"100": "#dbeafe",
|
|
179
|
+
"200": "#bfdbfe",
|
|
180
|
+
"300": "#93c5fd",
|
|
181
|
+
"400": "#60a5fa",
|
|
182
|
+
"50": "#f0f7ff",
|
|
183
|
+
"500": "#3b82f6",
|
|
184
|
+
"600": "#2563eb",
|
|
185
|
+
"700": "#1d4ed8",
|
|
186
|
+
"800": "#1e40af",
|
|
187
|
+
"900": "#1e3a8a"
|
|
188
|
+
},
|
|
189
|
+
success: "#22c55e",
|
|
190
|
+
warning: "#f59e0b"
|
|
191
|
+
},
|
|
192
|
+
fontSize: {
|
|
193
|
+
"2xl": "24px",
|
|
194
|
+
"3xl": "30px",
|
|
195
|
+
"4xl": "36px",
|
|
196
|
+
lg: "18px",
|
|
197
|
+
md: "16px",
|
|
198
|
+
sm: "14px",
|
|
199
|
+
xl: "20px",
|
|
200
|
+
xs: "12px"
|
|
201
|
+
},
|
|
202
|
+
fontWeight: {
|
|
203
|
+
bold: "700",
|
|
204
|
+
medium: "500",
|
|
205
|
+
regular: "400",
|
|
206
|
+
semibold: "600"
|
|
207
|
+
},
|
|
208
|
+
lineHeight: {
|
|
209
|
+
normal: "1.4",
|
|
210
|
+
relaxed: "1.6",
|
|
211
|
+
tight: "1.2"
|
|
212
|
+
},
|
|
213
|
+
radius: {
|
|
214
|
+
"2xl": "16px",
|
|
215
|
+
full: "9999px",
|
|
216
|
+
lg: "8px",
|
|
217
|
+
md: "6px",
|
|
218
|
+
none: "0px",
|
|
219
|
+
sm: "4px",
|
|
220
|
+
xl: "12px"
|
|
221
|
+
},
|
|
222
|
+
semantic: {
|
|
223
|
+
background: {
|
|
224
|
+
default: "#fafafa",
|
|
225
|
+
elevated: "#ffffff",
|
|
226
|
+
subtle: "#f4f4f5"
|
|
227
|
+
},
|
|
228
|
+
border: {
|
|
229
|
+
default: "#e4e4e7",
|
|
230
|
+
strong: "#d4d4d8"
|
|
231
|
+
},
|
|
232
|
+
interactive: {
|
|
233
|
+
destructive: "#ef4444",
|
|
234
|
+
primary: "#2563eb",
|
|
235
|
+
primaryHover: "#1d4ed8",
|
|
236
|
+
primaryPressed: "#1e40af"
|
|
237
|
+
},
|
|
238
|
+
text: {
|
|
239
|
+
default: "#18181b",
|
|
240
|
+
inverted: "#fafafa",
|
|
241
|
+
muted: "#52525b"
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
shadow: {
|
|
245
|
+
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",
|
|
246
|
+
md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",
|
|
247
|
+
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)"
|
|
248
|
+
},
|
|
249
|
+
spacing: {
|
|
250
|
+
"0": "0px",
|
|
251
|
+
"1": "4px",
|
|
252
|
+
"10": "40px",
|
|
253
|
+
"12": "48px",
|
|
254
|
+
"16": "64px",
|
|
255
|
+
"2": "8px",
|
|
256
|
+
"20": "80px",
|
|
257
|
+
"24": "96px",
|
|
258
|
+
"3": "12px",
|
|
259
|
+
"4": "16px",
|
|
260
|
+
"5": "20px",
|
|
261
|
+
"6": "24px",
|
|
262
|
+
"8": "32px"
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
var themeDark = {
|
|
266
|
+
color: {
|
|
267
|
+
danger: "#ef4444",
|
|
268
|
+
info: "#3b82f6",
|
|
269
|
+
neutral: {
|
|
270
|
+
"100": "#f4f4f5",
|
|
271
|
+
"200": "#e4e4e7",
|
|
272
|
+
"300": "#d4d4d8",
|
|
273
|
+
"400": "#a1a1aa",
|
|
274
|
+
"50": "#fafafa",
|
|
275
|
+
"500": "#71717a",
|
|
276
|
+
"600": "#52525b",
|
|
277
|
+
"700": "#3f3f46",
|
|
278
|
+
"800": "#27272a",
|
|
279
|
+
"900": "#18181b"
|
|
280
|
+
},
|
|
281
|
+
primary: {
|
|
282
|
+
"100": "#dbeafe",
|
|
283
|
+
"200": "#bfdbfe",
|
|
284
|
+
"300": "#93c5fd",
|
|
285
|
+
"400": "#60a5fa",
|
|
286
|
+
"50": "#f0f7ff",
|
|
287
|
+
"500": "#3b82f6",
|
|
288
|
+
"600": "#2563eb",
|
|
289
|
+
"700": "#1d4ed8",
|
|
290
|
+
"800": "#1e40af",
|
|
291
|
+
"900": "#1e3a8a"
|
|
292
|
+
},
|
|
293
|
+
success: "#22c55e",
|
|
294
|
+
warning: "#f59e0b"
|
|
295
|
+
},
|
|
296
|
+
fontSize: {
|
|
297
|
+
"2xl": "24px",
|
|
298
|
+
"3xl": "30px",
|
|
299
|
+
"4xl": "36px",
|
|
300
|
+
lg: "18px",
|
|
301
|
+
md: "16px",
|
|
302
|
+
sm: "14px",
|
|
303
|
+
xl: "20px",
|
|
304
|
+
xs: "12px"
|
|
305
|
+
},
|
|
306
|
+
fontWeight: {
|
|
307
|
+
bold: "700",
|
|
308
|
+
medium: "500",
|
|
309
|
+
regular: "400",
|
|
310
|
+
semibold: "600"
|
|
311
|
+
},
|
|
312
|
+
lineHeight: {
|
|
313
|
+
normal: "1.4",
|
|
314
|
+
relaxed: "1.6",
|
|
315
|
+
tight: "1.2"
|
|
316
|
+
},
|
|
317
|
+
radius: {
|
|
318
|
+
"2xl": "16px",
|
|
319
|
+
full: "9999px",
|
|
320
|
+
lg: "8px",
|
|
321
|
+
md: "6px",
|
|
322
|
+
none: "0px",
|
|
323
|
+
sm: "4px",
|
|
324
|
+
xl: "12px"
|
|
325
|
+
},
|
|
326
|
+
semantic: {
|
|
327
|
+
background: {
|
|
328
|
+
default: "#18181b",
|
|
329
|
+
elevated: "#3f3f46",
|
|
330
|
+
subtle: "#27272a"
|
|
331
|
+
},
|
|
332
|
+
border: {
|
|
333
|
+
default: "#3f3f46",
|
|
334
|
+
strong: "#52525b"
|
|
335
|
+
},
|
|
336
|
+
interactive: {
|
|
337
|
+
destructive: "#ef4444",
|
|
338
|
+
primary: "#60a5fa",
|
|
339
|
+
primaryHover: "#93c5fd",
|
|
340
|
+
primaryPressed: "#bfdbfe"
|
|
341
|
+
},
|
|
342
|
+
text: {
|
|
343
|
+
default: "#fafafa",
|
|
344
|
+
inverted: "#18181b",
|
|
345
|
+
muted: "#a1a1aa"
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
shadow: {
|
|
349
|
+
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",
|
|
350
|
+
md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",
|
|
351
|
+
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)"
|
|
352
|
+
},
|
|
353
|
+
spacing: {
|
|
354
|
+
"0": "0px",
|
|
355
|
+
"1": "4px",
|
|
356
|
+
"10": "40px",
|
|
357
|
+
"12": "48px",
|
|
358
|
+
"16": "64px",
|
|
359
|
+
"2": "8px",
|
|
360
|
+
"20": "80px",
|
|
361
|
+
"24": "96px",
|
|
362
|
+
"3": "12px",
|
|
363
|
+
"4": "16px",
|
|
364
|
+
"5": "20px",
|
|
365
|
+
"6": "24px",
|
|
366
|
+
"8": "32px"
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
|
|
160
370
|
// src/slot/compose-refs.ts
|
|
161
371
|
function composeRefs(...refs) {
|
|
162
372
|
return (node) => {
|
|
@@ -265,6 +475,30 @@ var SIZE_CLASSES = {
|
|
|
265
475
|
};
|
|
266
476
|
var ICON_SIZE = { sm: 14, md: 16, lg: 20 };
|
|
267
477
|
var BASE_CLASSES = "inline-flex flex-row items-center justify-center gap-2 rounded-md select-none";
|
|
478
|
+
var VARIANT_STYLES = {
|
|
479
|
+
primary: { backgroundColor: theme.color.primary["600"] },
|
|
480
|
+
secondary: { backgroundColor: theme.color.neutral["100"] },
|
|
481
|
+
ghost: { backgroundColor: "transparent" },
|
|
482
|
+
destructive: { backgroundColor: theme.color.danger }
|
|
483
|
+
};
|
|
484
|
+
var VARIANT_TEXT_COLOR = {
|
|
485
|
+
primary: "#ffffff",
|
|
486
|
+
secondary: theme.color.neutral["900"],
|
|
487
|
+
ghost: theme.color.neutral["900"],
|
|
488
|
+
destructive: "#ffffff"
|
|
489
|
+
};
|
|
490
|
+
var SIZE_STYLES = {
|
|
491
|
+
sm: { container: { height: 32, paddingHorizontal: 12 }, text: { fontSize: 14 } },
|
|
492
|
+
md: { container: { height: 40, paddingHorizontal: 16 }, text: { fontSize: 16 } },
|
|
493
|
+
lg: { container: { height: 48, paddingHorizontal: 20 }, text: { fontSize: 18 } }
|
|
494
|
+
};
|
|
495
|
+
var BASE_STYLE = {
|
|
496
|
+
flexDirection: "row",
|
|
497
|
+
alignItems: "center",
|
|
498
|
+
justifyContent: "center",
|
|
499
|
+
gap: 8,
|
|
500
|
+
borderRadius: 6
|
|
501
|
+
};
|
|
268
502
|
var Button = react.forwardRef(/* @__PURE__ */ __name(function Button2({
|
|
269
503
|
children,
|
|
270
504
|
variant = "primary",
|
|
@@ -277,6 +511,7 @@ var Button = react.forwardRef(/* @__PURE__ */ __name(function Button2({
|
|
|
277
511
|
className,
|
|
278
512
|
onPress,
|
|
279
513
|
testID,
|
|
514
|
+
style,
|
|
280
515
|
...rest
|
|
281
516
|
}, forwardedRef) {
|
|
282
517
|
const isInoperative = Boolean(disabled) || Boolean(loading);
|
|
@@ -287,6 +522,16 @@ var Button = react.forwardRef(/* @__PURE__ */ __name(function Button2({
|
|
|
287
522
|
isInoperative ? "opacity-60" : void 0,
|
|
288
523
|
className
|
|
289
524
|
);
|
|
525
|
+
const baseInlineStyle = [
|
|
526
|
+
BASE_STYLE,
|
|
527
|
+
VARIANT_STYLES[variant],
|
|
528
|
+
SIZE_STYLES[size].container,
|
|
529
|
+
isInoperative ? { opacity: 0.6 } : null
|
|
530
|
+
];
|
|
531
|
+
const pressableStyle = typeof style === "function" ? (state) => [baseInlineStyle, style(state)] : [baseInlineStyle, style];
|
|
532
|
+
const slotStyle = [baseInlineStyle, typeof style === "function" ? null : style];
|
|
533
|
+
const textColor = VARIANT_TEXT_COLOR[variant];
|
|
534
|
+
const textStyle = { color: textColor, fontSize: SIZE_STYLES[size].text.fontSize, fontWeight: "500" };
|
|
290
535
|
const handlePress = /* @__PURE__ */ __name((ev) => {
|
|
291
536
|
if (isInoperative) return;
|
|
292
537
|
onPress?.(ev);
|
|
@@ -295,6 +540,7 @@ var Button = react.forwardRef(/* @__PURE__ */ __name(function Button2({
|
|
|
295
540
|
const slotProps = {
|
|
296
541
|
ref: forwardedRef,
|
|
297
542
|
className: classes,
|
|
543
|
+
style: slotStyle,
|
|
298
544
|
onClick: handlePress,
|
|
299
545
|
...rest
|
|
300
546
|
};
|
|
@@ -317,17 +563,40 @@ var Button = react.forwardRef(/* @__PURE__ */ __name(function Button2({
|
|
|
317
563
|
disabled: isInoperative,
|
|
318
564
|
onPress: handlePress,
|
|
319
565
|
className: classes,
|
|
566
|
+
style: pressableStyle,
|
|
320
567
|
...pressableExtra,
|
|
321
568
|
...rest,
|
|
322
569
|
children: [
|
|
323
|
-
loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: ICON_SIZE[size], label: "Loading" }) : LeadingIcon ? /* @__PURE__ */ jsxRuntime.jsx(LeadingIcon, { size: ICON_SIZE[size] }) : null,
|
|
324
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
325
|
-
|
|
570
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: ICON_SIZE[size], label: "Loading", color: textColor }) : LeadingIcon ? /* @__PURE__ */ jsxRuntime.jsx(LeadingIcon, { size: ICON_SIZE[size], color: textColor }) : null,
|
|
571
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
572
|
+
reactNative.Text,
|
|
573
|
+
{
|
|
574
|
+
className: cn("font-medium", SIZE_CLASSES[size].includes("text-") ? void 0 : "text-md"),
|
|
575
|
+
style: textStyle,
|
|
576
|
+
children
|
|
577
|
+
}
|
|
578
|
+
),
|
|
579
|
+
TrailingIcon ? /* @__PURE__ */ jsxRuntime.jsx(TrailingIcon, { size: ICON_SIZE[size], color: textColor }) : null
|
|
326
580
|
]
|
|
327
581
|
}
|
|
328
582
|
);
|
|
329
583
|
}, "Button"));
|
|
330
584
|
Button.displayName = "Button";
|
|
585
|
+
var ROW_STYLE = { flexDirection: "row", alignItems: "center", gap: 8 };
|
|
586
|
+
var BOX_STYLE = {
|
|
587
|
+
width: 20,
|
|
588
|
+
height: 20,
|
|
589
|
+
borderRadius: 4,
|
|
590
|
+
borderWidth: 1,
|
|
591
|
+
borderColor: theme.color.neutral["300"],
|
|
592
|
+
backgroundColor: "#ffffff",
|
|
593
|
+
alignItems: "center",
|
|
594
|
+
justifyContent: "center"
|
|
595
|
+
};
|
|
596
|
+
var BOX_STYLE_CHECKED = {
|
|
597
|
+
backgroundColor: theme.color.primary["600"],
|
|
598
|
+
borderColor: theme.color.primary["600"]
|
|
599
|
+
};
|
|
331
600
|
function Checkbox({
|
|
332
601
|
checked,
|
|
333
602
|
defaultChecked = false,
|
|
@@ -344,6 +613,7 @@ function Checkbox({
|
|
|
344
613
|
const isControlled = checked !== void 0;
|
|
345
614
|
const value = isControlled ? Boolean(checked) : inner;
|
|
346
615
|
const ariaChecked = indeterminate ? "mixed" : value ? "true" : "false";
|
|
616
|
+
const isMarked = value || Boolean(indeterminate);
|
|
347
617
|
const toggle = react.useCallback(() => {
|
|
348
618
|
if (disabled) return;
|
|
349
619
|
const next = !value;
|
|
@@ -376,10 +646,26 @@ function Checkbox({
|
|
|
376
646
|
return /* @__PURE__ */ jsxRuntime.jsx(Slot, { ...slotProps, children });
|
|
377
647
|
}
|
|
378
648
|
const boxClasses = cn("w-5 h-5 rounded-sm border border-semantic-border-strong items-center justify-center");
|
|
379
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
649
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
650
|
+
reactNative.View,
|
|
651
|
+
{
|
|
652
|
+
className: cn("flex-row items-center gap-2", disabled ? "opacity-60" : void 0, className),
|
|
653
|
+
style: [ROW_STYLE, disabled ? { opacity: 0.6 } : null],
|
|
654
|
+
children: [
|
|
655
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
656
|
+
reactNative.Pressable,
|
|
657
|
+
{
|
|
658
|
+
onPress: toggle,
|
|
659
|
+
...commonProps,
|
|
660
|
+
className: boxClasses,
|
|
661
|
+
style: [BOX_STYLE, isMarked && !disabled ? BOX_STYLE_CHECKED : null],
|
|
662
|
+
children: isMarked && !disabled ? /* @__PURE__ */ jsxRuntime.jsx(Check, { size: 14, color: "#ffffff" }) : null
|
|
663
|
+
}
|
|
664
|
+
),
|
|
665
|
+
children ?? (label !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { color: theme.color.neutral["900"], fontSize: 16 }, children: label }) : null)
|
|
666
|
+
]
|
|
667
|
+
}
|
|
668
|
+
);
|
|
383
669
|
}
|
|
384
670
|
__name(Checkbox, "Checkbox");
|
|
385
671
|
var ALIGN_CLASS = {
|
|
@@ -414,6 +700,25 @@ function HStack({ gap, align, justify, className, children, ...rest }) {
|
|
|
414
700
|
);
|
|
415
701
|
}
|
|
416
702
|
__name(HStack, "HStack");
|
|
703
|
+
var ROW_STYLE2 = { flexDirection: "row", alignItems: "center", gap: 8 };
|
|
704
|
+
var TRACK_BASE = {
|
|
705
|
+
width: 40,
|
|
706
|
+
height: 24,
|
|
707
|
+
borderRadius: 12,
|
|
708
|
+
justifyContent: "center",
|
|
709
|
+
paddingHorizontal: 2
|
|
710
|
+
};
|
|
711
|
+
var THUMB_STYLE = {
|
|
712
|
+
width: 20,
|
|
713
|
+
height: 20,
|
|
714
|
+
borderRadius: 10,
|
|
715
|
+
backgroundColor: "#ffffff",
|
|
716
|
+
shadowColor: "#000",
|
|
717
|
+
shadowOpacity: 0.15,
|
|
718
|
+
shadowRadius: 2,
|
|
719
|
+
shadowOffset: { width: 0, height: 1 },
|
|
720
|
+
elevation: 2
|
|
721
|
+
};
|
|
417
722
|
function Switch({
|
|
418
723
|
checked,
|
|
419
724
|
defaultChecked = false,
|
|
@@ -465,9 +770,22 @@ function Switch({
|
|
|
465
770
|
disabled ? "opacity-60" : void 0
|
|
466
771
|
);
|
|
467
772
|
const thumbClasses = cn("w-5 h-5 rounded-full bg-white shadow-sm", value ? "self-end" : "self-start");
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
773
|
+
const trackStyle = [
|
|
774
|
+
TRACK_BASE,
|
|
775
|
+
{ backgroundColor: value ? theme.color.primary["600"] : theme.color.neutral["300"] },
|
|
776
|
+
disabled ? { opacity: 0.6 } : null
|
|
777
|
+
];
|
|
778
|
+
const thumbStyle = [THUMB_STYLE, { alignSelf: value ? "flex-end" : "flex-start" }];
|
|
779
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { className: cn("flex-row items-center gap-2", className), style: ROW_STYLE2, children: [
|
|
780
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: toggle, ...commonProps, className: trackClasses, style: trackStyle, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { className: thumbClasses, style: thumbStyle }) }),
|
|
781
|
+
label ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
782
|
+
reactNative.Text,
|
|
783
|
+
{
|
|
784
|
+
className: "text-md text-semantic-text-default",
|
|
785
|
+
style: { color: theme.color.neutral["900"], fontSize: 16 },
|
|
786
|
+
children: label
|
|
787
|
+
}
|
|
788
|
+
) : null,
|
|
471
789
|
children
|
|
472
790
|
] });
|
|
473
791
|
}
|
|
@@ -497,6 +815,23 @@ function Text({ variant = "body-md", className, testID, children, ...rest }) {
|
|
|
497
815
|
);
|
|
498
816
|
}
|
|
499
817
|
__name(Text, "Text");
|
|
818
|
+
var CONTAINER_STYLE = { flexDirection: "column", gap: 4 };
|
|
819
|
+
var LABEL_STYLE = { fontSize: 14, fontWeight: "500", color: theme.color.neutral["900"] };
|
|
820
|
+
var FIELD_BASE_STYLE = {
|
|
821
|
+
flexDirection: "row",
|
|
822
|
+
alignItems: "center",
|
|
823
|
+
borderRadius: 6,
|
|
824
|
+
borderWidth: 1,
|
|
825
|
+
paddingHorizontal: 12
|
|
826
|
+
};
|
|
827
|
+
var INPUT_STYLE = {
|
|
828
|
+
flex: 1,
|
|
829
|
+
paddingVertical: 8,
|
|
830
|
+
fontSize: 16,
|
|
831
|
+
color: theme.color.neutral["900"]
|
|
832
|
+
};
|
|
833
|
+
var HELPER_STYLE = { fontSize: 14, color: theme.color.neutral["500"] };
|
|
834
|
+
var ERROR_STYLE = { fontSize: 14, color: theme.color.danger };
|
|
500
835
|
function TextInput({
|
|
501
836
|
label,
|
|
502
837
|
helperText,
|
|
@@ -525,8 +860,21 @@ function TextInput({
|
|
|
525
860
|
if (multiline !== void 0) inputExtras.multiline = multiline;
|
|
526
861
|
if (numberOfLines !== void 0) inputExtras.numberOfLines = numberOfLines;
|
|
527
862
|
if (onChangeText !== void 0) inputExtras.onChangeText = onChangeText;
|
|
528
|
-
|
|
529
|
-
|
|
863
|
+
const fieldStyle = [
|
|
864
|
+
FIELD_BASE_STYLE,
|
|
865
|
+
{ borderColor: hasError ? theme.color.danger : theme.color.neutral["200"] },
|
|
866
|
+
disabled ? { opacity: 0.6 } : null
|
|
867
|
+
];
|
|
868
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { className: cn("flex flex-col gap-1", containerClassName), style: CONTAINER_STYLE, children: [
|
|
869
|
+
label !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
870
|
+
"label",
|
|
871
|
+
{
|
|
872
|
+
htmlFor: inputId,
|
|
873
|
+
className: "text-sm font-medium text-semantic-text-default",
|
|
874
|
+
style: LABEL_STYLE,
|
|
875
|
+
children: label
|
|
876
|
+
}
|
|
877
|
+
) : null,
|
|
530
878
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
531
879
|
reactNative.View,
|
|
532
880
|
{
|
|
@@ -535,23 +883,34 @@ function TextInput({
|
|
|
535
883
|
hasError ? "border-semantic-interactive-destructive" : "border-semantic-border-default",
|
|
536
884
|
disabled ? "opacity-60" : void 0
|
|
537
885
|
),
|
|
886
|
+
style: fieldStyle,
|
|
538
887
|
children: [
|
|
539
|
-
leading ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { className: "mr-2", children: leading }) : null,
|
|
888
|
+
leading ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { className: "mr-2", style: { marginRight: 8 }, children: leading }) : null,
|
|
540
889
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
541
890
|
reactNative.TextInput,
|
|
542
891
|
{
|
|
543
892
|
nativeID: inputId,
|
|
544
893
|
editable: !disabled,
|
|
545
894
|
className: cn("flex-1 py-2 text-md text-semantic-text-default outline-none", className),
|
|
895
|
+
style: INPUT_STYLE,
|
|
896
|
+
placeholderTextColor: theme.color.neutral["400"],
|
|
546
897
|
...inputExtras,
|
|
547
898
|
...rest
|
|
548
899
|
}
|
|
549
900
|
),
|
|
550
|
-
trailing ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { className: "ml-2", children: trailing }) : null
|
|
901
|
+
trailing ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { className: "ml-2", style: { marginLeft: 8 }, children: trailing }) : null
|
|
551
902
|
]
|
|
552
903
|
}
|
|
553
904
|
),
|
|
554
|
-
error ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
905
|
+
error ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
906
|
+
reactNative.Text,
|
|
907
|
+
{
|
|
908
|
+
nativeID: describeId,
|
|
909
|
+
className: "text-sm text-semantic-interactive-destructive",
|
|
910
|
+
style: ERROR_STYLE,
|
|
911
|
+
children: error
|
|
912
|
+
}
|
|
913
|
+
) : helperText ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { nativeID: describeId, className: "text-sm text-semantic-text-muted", style: HELPER_STYLE, children: helperText }) : null
|
|
555
914
|
] });
|
|
556
915
|
}
|
|
557
916
|
__name(TextInput, "TextInput");
|
|
@@ -603,216 +962,6 @@ function Icon({ as: IconComponent, size = "md", color }) {
|
|
|
603
962
|
return /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { size: numericSize, ...colorProps });
|
|
604
963
|
}
|
|
605
964
|
__name(Icon, "Icon");
|
|
606
|
-
|
|
607
|
-
// ../tokens/build/theme.ts
|
|
608
|
-
var theme = {
|
|
609
|
-
color: {
|
|
610
|
-
danger: "#ef4444",
|
|
611
|
-
info: "#3b82f6",
|
|
612
|
-
neutral: {
|
|
613
|
-
"100": "#f4f4f5",
|
|
614
|
-
"200": "#e4e4e7",
|
|
615
|
-
"300": "#d4d4d8",
|
|
616
|
-
"400": "#a1a1aa",
|
|
617
|
-
"50": "#fafafa",
|
|
618
|
-
"500": "#71717a",
|
|
619
|
-
"600": "#52525b",
|
|
620
|
-
"700": "#3f3f46",
|
|
621
|
-
"800": "#27272a",
|
|
622
|
-
"900": "#18181b"
|
|
623
|
-
},
|
|
624
|
-
primary: {
|
|
625
|
-
"100": "#dbeafe",
|
|
626
|
-
"200": "#bfdbfe",
|
|
627
|
-
"300": "#93c5fd",
|
|
628
|
-
"400": "#60a5fa",
|
|
629
|
-
"50": "#f0f7ff",
|
|
630
|
-
"500": "#3b82f6",
|
|
631
|
-
"600": "#2563eb",
|
|
632
|
-
"700": "#1d4ed8",
|
|
633
|
-
"800": "#1e40af",
|
|
634
|
-
"900": "#1e3a8a"
|
|
635
|
-
},
|
|
636
|
-
success: "#22c55e",
|
|
637
|
-
warning: "#f59e0b"
|
|
638
|
-
},
|
|
639
|
-
fontSize: {
|
|
640
|
-
"2xl": "24px",
|
|
641
|
-
"3xl": "30px",
|
|
642
|
-
"4xl": "36px",
|
|
643
|
-
lg: "18px",
|
|
644
|
-
md: "16px",
|
|
645
|
-
sm: "14px",
|
|
646
|
-
xl: "20px",
|
|
647
|
-
xs: "12px"
|
|
648
|
-
},
|
|
649
|
-
fontWeight: {
|
|
650
|
-
bold: "700",
|
|
651
|
-
medium: "500",
|
|
652
|
-
regular: "400",
|
|
653
|
-
semibold: "600"
|
|
654
|
-
},
|
|
655
|
-
lineHeight: {
|
|
656
|
-
normal: "1.4",
|
|
657
|
-
relaxed: "1.6",
|
|
658
|
-
tight: "1.2"
|
|
659
|
-
},
|
|
660
|
-
radius: {
|
|
661
|
-
"2xl": "16px",
|
|
662
|
-
full: "9999px",
|
|
663
|
-
lg: "8px",
|
|
664
|
-
md: "6px",
|
|
665
|
-
none: "0px",
|
|
666
|
-
sm: "4px",
|
|
667
|
-
xl: "12px"
|
|
668
|
-
},
|
|
669
|
-
semantic: {
|
|
670
|
-
background: {
|
|
671
|
-
default: "#fafafa",
|
|
672
|
-
elevated: "#ffffff",
|
|
673
|
-
subtle: "#f4f4f5"
|
|
674
|
-
},
|
|
675
|
-
border: {
|
|
676
|
-
default: "#e4e4e7",
|
|
677
|
-
strong: "#d4d4d8"
|
|
678
|
-
},
|
|
679
|
-
interactive: {
|
|
680
|
-
destructive: "#ef4444",
|
|
681
|
-
primary: "#2563eb",
|
|
682
|
-
primaryHover: "#1d4ed8",
|
|
683
|
-
primaryPressed: "#1e40af"
|
|
684
|
-
},
|
|
685
|
-
text: {
|
|
686
|
-
default: "#18181b",
|
|
687
|
-
inverted: "#fafafa",
|
|
688
|
-
muted: "#52525b"
|
|
689
|
-
}
|
|
690
|
-
},
|
|
691
|
-
shadow: {
|
|
692
|
-
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",
|
|
693
|
-
md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",
|
|
694
|
-
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)"
|
|
695
|
-
},
|
|
696
|
-
spacing: {
|
|
697
|
-
"0": "0px",
|
|
698
|
-
"1": "4px",
|
|
699
|
-
"10": "40px",
|
|
700
|
-
"12": "48px",
|
|
701
|
-
"16": "64px",
|
|
702
|
-
"2": "8px",
|
|
703
|
-
"20": "80px",
|
|
704
|
-
"24": "96px",
|
|
705
|
-
"3": "12px",
|
|
706
|
-
"4": "16px",
|
|
707
|
-
"5": "20px",
|
|
708
|
-
"6": "24px",
|
|
709
|
-
"8": "32px"
|
|
710
|
-
}
|
|
711
|
-
};
|
|
712
|
-
var themeDark = {
|
|
713
|
-
color: {
|
|
714
|
-
danger: "#ef4444",
|
|
715
|
-
info: "#3b82f6",
|
|
716
|
-
neutral: {
|
|
717
|
-
"100": "#f4f4f5",
|
|
718
|
-
"200": "#e4e4e7",
|
|
719
|
-
"300": "#d4d4d8",
|
|
720
|
-
"400": "#a1a1aa",
|
|
721
|
-
"50": "#fafafa",
|
|
722
|
-
"500": "#71717a",
|
|
723
|
-
"600": "#52525b",
|
|
724
|
-
"700": "#3f3f46",
|
|
725
|
-
"800": "#27272a",
|
|
726
|
-
"900": "#18181b"
|
|
727
|
-
},
|
|
728
|
-
primary: {
|
|
729
|
-
"100": "#dbeafe",
|
|
730
|
-
"200": "#bfdbfe",
|
|
731
|
-
"300": "#93c5fd",
|
|
732
|
-
"400": "#60a5fa",
|
|
733
|
-
"50": "#f0f7ff",
|
|
734
|
-
"500": "#3b82f6",
|
|
735
|
-
"600": "#2563eb",
|
|
736
|
-
"700": "#1d4ed8",
|
|
737
|
-
"800": "#1e40af",
|
|
738
|
-
"900": "#1e3a8a"
|
|
739
|
-
},
|
|
740
|
-
success: "#22c55e",
|
|
741
|
-
warning: "#f59e0b"
|
|
742
|
-
},
|
|
743
|
-
fontSize: {
|
|
744
|
-
"2xl": "24px",
|
|
745
|
-
"3xl": "30px",
|
|
746
|
-
"4xl": "36px",
|
|
747
|
-
lg: "18px",
|
|
748
|
-
md: "16px",
|
|
749
|
-
sm: "14px",
|
|
750
|
-
xl: "20px",
|
|
751
|
-
xs: "12px"
|
|
752
|
-
},
|
|
753
|
-
fontWeight: {
|
|
754
|
-
bold: "700",
|
|
755
|
-
medium: "500",
|
|
756
|
-
regular: "400",
|
|
757
|
-
semibold: "600"
|
|
758
|
-
},
|
|
759
|
-
lineHeight: {
|
|
760
|
-
normal: "1.4",
|
|
761
|
-
relaxed: "1.6",
|
|
762
|
-
tight: "1.2"
|
|
763
|
-
},
|
|
764
|
-
radius: {
|
|
765
|
-
"2xl": "16px",
|
|
766
|
-
full: "9999px",
|
|
767
|
-
lg: "8px",
|
|
768
|
-
md: "6px",
|
|
769
|
-
none: "0px",
|
|
770
|
-
sm: "4px",
|
|
771
|
-
xl: "12px"
|
|
772
|
-
},
|
|
773
|
-
semantic: {
|
|
774
|
-
background: {
|
|
775
|
-
default: "#18181b",
|
|
776
|
-
elevated: "#3f3f46",
|
|
777
|
-
subtle: "#27272a"
|
|
778
|
-
},
|
|
779
|
-
border: {
|
|
780
|
-
default: "#3f3f46",
|
|
781
|
-
strong: "#52525b"
|
|
782
|
-
},
|
|
783
|
-
interactive: {
|
|
784
|
-
destructive: "#ef4444",
|
|
785
|
-
primary: "#60a5fa",
|
|
786
|
-
primaryHover: "#93c5fd",
|
|
787
|
-
primaryPressed: "#bfdbfe"
|
|
788
|
-
},
|
|
789
|
-
text: {
|
|
790
|
-
default: "#fafafa",
|
|
791
|
-
inverted: "#18181b",
|
|
792
|
-
muted: "#a1a1aa"
|
|
793
|
-
}
|
|
794
|
-
},
|
|
795
|
-
shadow: {
|
|
796
|
-
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",
|
|
797
|
-
md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",
|
|
798
|
-
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)"
|
|
799
|
-
},
|
|
800
|
-
spacing: {
|
|
801
|
-
"0": "0px",
|
|
802
|
-
"1": "4px",
|
|
803
|
-
"10": "40px",
|
|
804
|
-
"12": "48px",
|
|
805
|
-
"16": "64px",
|
|
806
|
-
"2": "8px",
|
|
807
|
-
"20": "80px",
|
|
808
|
-
"24": "96px",
|
|
809
|
-
"3": "12px",
|
|
810
|
-
"4": "16px",
|
|
811
|
-
"5": "20px",
|
|
812
|
-
"6": "24px",
|
|
813
|
-
"8": "32px"
|
|
814
|
-
}
|
|
815
|
-
};
|
|
816
965
|
var ThemeContext = react.createContext(theme);
|
|
817
966
|
ThemeContext.displayName = "ThemeContext";
|
|
818
967
|
function ThemeProvider({ theme: theme2 = theme, children }) {
|