@nori-ui/core 0.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.
- package/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/chunk-6NDARMPP.js +389 -0
- package/dist/chunk-6NDARMPP.js.map +1 -0
- package/dist/chunk-7QVYU63E.js +6 -0
- package/dist/chunk-7QVYU63E.js.map +1 -0
- package/dist/chunk-BRCCWMGJ.js +3 -0
- package/dist/chunk-BRCCWMGJ.js.map +1 -0
- package/dist/chunk-FXKIWONG.js +80 -0
- package/dist/chunk-FXKIWONG.js.map +1 -0
- package/dist/chunk-JGH6Z5LM.js +213 -0
- package/dist/chunk-JGH6Z5LM.js.map +1 -0
- package/dist/chunk-NDEDMCHT.js +40 -0
- package/dist/chunk-NDEDMCHT.js.map +1 -0
- package/dist/chunk-RX7UULY3.js +19 -0
- package/dist/chunk-RX7UULY3.js.map +1 -0
- package/dist/chunk-SSTXLK5I.js +66 -0
- package/dist/chunk-SSTXLK5I.js.map +1 -0
- package/dist/chunk-XGM2K4TT.js +31 -0
- package/dist/chunk-XGM2K4TT.js.map +1 -0
- package/dist/client.cjs +861 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.cts +157 -0
- package/dist/client.d.ts +157 -0
- package/dist/client.js +50 -0
- package/dist/client.js.map +1 -0
- package/dist/i18n/index.cjs +70 -0
- package/dist/i18n/index.cjs.map +1 -0
- package/dist/i18n/index.d.cts +60 -0
- package/dist/i18n/index.d.ts +60 -0
- package/dist/i18n/index.js +4 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/icons/index.cjs +56 -0
- package/dist/icons/index.cjs.map +1 -0
- package/dist/icons/index.d.cts +38 -0
- package/dist/icons/index.d.ts +38 -0
- package/dist/icons/index.js +5 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.cjs +820 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +187 -0
- package/dist/index.d.ts +187 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/slot/index.cjs +85 -0
- package/dist/slot/index.cjs.map +1 -0
- package/dist/slot/index.d.cts +13 -0
- package/dist/slot/index.d.ts +13 -0
- package/dist/slot/index.js +4 -0
- package/dist/slot/index.js.map +1 -0
- package/dist/stories/story-registry.cjs +612 -0
- package/dist/stories/story-registry.cjs.map +1 -0
- package/dist/stories/story-registry.d.cts +13 -0
- package/dist/stories/story-registry.d.ts +13 -0
- package/dist/stories/story-registry.js +105 -0
- package/dist/stories/story-registry.js.map +1 -0
- package/dist/theme/index.cjs +216 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/index.d.cts +1 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.js +4 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/utils/cn.cjs +34 -0
- package/dist/utils/cn.cjs.map +1 -0
- package/dist/utils/cn.d.cts +4 -0
- package/dist/utils/cn.d.ts +4 -0
- package/dist/utils/cn.js +4 -0
- package/dist/utils/cn.js.map +1 -0
- package/package.json +122 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/slot/compose-refs.ts","../../src/slot/slot.tsx"],"names":["forwardRef","Slot","isValidElement","Children","cloneElement"],"mappings":";;;;;;;;AAOO,SAAS,eAAkB,IAAA,EAA6C;AAC3E,EAAA,OAAO,CAAC,IAAA,KAAmB;AACvB,IAAA,KAAA,MAAW,OAAO,IAAA,EAAM;AACpB,MAAA,IAAI,OAAO,IAAA,EAAM;AACjB,MAAA,IAAI,OAAO,QAAQ,UAAA,EAAY;AAC3B,QAAA,GAAA,CAAI,IAAI,CAAA;AAAA,MACZ,CAAA,MAAO;AAEH,QAAC,IAAmC,OAAA,GAAU,IAAA;AAAA,MAClD;AAAA,IACJ;AAAA,EACJ,CAAA;AACJ;AAZgB,MAAA,CAAA,WAAA,EAAA,aAAA,CAAA;ACGT,IAAM,IAAA,GAAOA,gBAAA,iBAA+B,MAAA,CAAA,SAASC,KAAAA,CAAK,OAAO,YAAA,EAAc;AAClF,EAAA,MAAM,EAAE,QAAA,EAAU,GAAG,SAAA,EAAU,GAAI,KAAA;AAEnC,EAAA,IAAI,CAACC,oBAAA,CAAe,QAAQ,CAAA,EAAG;AAC3B,IAAA,OAAO,IAAA;AAAA,EACX;AAGA,EAAA,MAAM,KAAA,GAAQC,cAAA,CAAS,IAAA,CAAK,QAAQ,CAAA;AACpC,EAAA,MAAM,MAAA,GAAS,UAAA,CAAW,SAAA,EAAW,KAAA,CAAM,KAAK,CAAA;AAGhD,EAAA,MAAM,WAAY,KAAA,CAA4C,GAAA;AAC9D,EAAA,IAAI,gBAAgB,QAAA,EAAU;AAC1B,IAAC,MAAA,CAAoB,GAAA,GAAM,WAAA,CAAY,YAAA,EAAc,QAAQ,CAAA;AAAA,EACjE;AAEA,EAAA,OAAOC,kBAAA,CAAa,OAAO,MAAM,CAAA;AACrC,CAAA,EAlBmD,MAAA,CAkBlD;AACD,IAAA,CAAK,WAAA,GAAc,MAAA;AAEnB,SAAS,UAAA,CAAW,OAAiB,KAAA,EAA2B;AAG5D,EAAA,MAAM,MAAA,GAAmB,EAAE,GAAG,KAAA,EAAM;AAEpC,EAAA,KAAA,MAAW,GAAA,IAAO,MAAA,CAAO,IAAA,CAAK,KAAK,CAAA,EAAG;AAClC,IAAA,MAAM,UAAA,GAAa,MAAM,GAAG,CAAA;AAC5B,IAAA,MAAM,UAAA,GAAa,MAAM,GAAG,CAAA;AAE5B,IAAA,IAAI,GAAA,KAAQ,WAAA,IAAe,GAAA,KAAQ,OAAA,EAAS;AACxC,MAAA,MAAA,CAAO,GAAG,CAAA,GAAI,SAAA,CAAU,UAAA,EAAY,UAAU,CAAA;AAC9C,MAAA;AAAA,IACJ;AAEA,IAAA,IAAI,QAAQ,OAAA,EAAS;AACjB,MAAA,MAAA,CAAO,GAAG,CAAA,GAAI;AAAA,QACV,GAAI,UAAA;AAAA,QACJ,GAAI;AAAA,OACR;AACA,MAAA;AAAA,IACJ;AAEA,IAAA,IAAI,cAAA,CAAe,GAAA,EAAK,UAAA,EAAY,UAAU,CAAA,EAAG;AAC7C,MAAA,MAAA,CAAO,GAAG,CAAA,GAAI,eAAA,CAAgB,UAAA,EAAkB,UAAgB,CAAA;AAChE,MAAA;AAAA,IACJ;AAEA,IAAA,MAAA,CAAO,GAAG,CAAA,GAAI,UAAA;AAAA,EAClB;AAEA,EAAA,OAAO,MAAA;AACX;AA/BS,MAAA,CAAA,UAAA,EAAA,YAAA,CAAA;AAiCT,SAAS,SAAA,CAAU,OAAgB,KAAA,EAAoC;AACnE,EAAA,MAAM,CAAA,GAAI,OAAO,KAAA,KAAU,QAAA,GAAW,KAAA,GAAQ,EAAA;AAC9C,EAAA,MAAM,CAAA,GAAI,OAAO,KAAA,KAAU,QAAA,GAAW,KAAA,GAAQ,EAAA;AAC9C,EAAA,MAAM,MAAA,GAAS,CAAC,CAAA,EAAG,CAAC,EAAE,MAAA,CAAO,OAAO,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA;AAC9C,EAAA,OAAO,MAAA,CAAO,MAAA,GAAS,CAAA,GAAI,MAAA,GAAS,MAAA;AACxC;AALS,MAAA,CAAA,SAAA,EAAA,WAAA,CAAA;AAST,SAAS,cAAA,CAAe,GAAA,EAAa,KAAA,EAAgB,KAAA,EAAyB;AAC1E,EAAA,IAAI,CAAC,IAAI,UAAA,CAAW,IAAI,KAAK,GAAA,CAAI,MAAA,GAAS,GAAG,OAAO,KAAA;AACpD,EAAA,IAAI,GAAA,CAAI,CAAC,CAAA,KAAM,GAAA,CAAI,CAAC,CAAA,EAAG,WAAA,IAAe,OAAO,KAAA;AAC7C,EAAA,OAAO,OAAO,KAAA,KAAU,UAAA,IAAc,OAAO,KAAA,KAAU,UAAA;AAC3D;AAJS,MAAA,CAAA,cAAA,EAAA,gBAAA,CAAA;AAMT,SAAS,eAAA,CAAgB,OAAW,KAAA,EAAe;AAC/C,EAAA,OAAO,IAAI,IAAA,KAAoB;AAC3B,IAAA,KAAA,CAAM,GAAG,IAAI,CAAA;AACb,IAAA,KAAA,CAAM,GAAG,IAAI,CAAA;AAAA,EACjB,CAAA;AACJ;AALS,MAAA,CAAA,eAAA,EAAA,iBAAA,CAAA","file":"index.cjs","sourcesContent":["// composeRefs — merges multiple React refs (callback or object) into a single callback.\n// Derived from Radix UI's approach; reimplemented here so we don't take a Radix dependency.\n\nimport type { MutableRefObject, Ref, RefCallback } from 'react';\n\ntype PossibleRef<T> = Ref<T> | undefined;\n\nexport function composeRefs<T>(...refs: Array<PossibleRef<T>>): RefCallback<T> {\n return (node: T | null) => {\n for (const ref of refs) {\n if (ref == null) continue;\n if (typeof ref === 'function') {\n ref(node);\n } else {\n // React's MutableRefObject typing — we assign .current directly.\n (ref as MutableRefObject<T | null>).current = node;\n }\n }\n };\n}\n","import type { CSSProperties, ReactElement, Ref } from 'react';\nimport { Children, cloneElement, forwardRef, isValidElement } from 'react';\nimport { composeRefs } from './compose-refs';\n\ntype AnyProps = Record<string, unknown>;\n\nexport type SlotProps = {\n children?: React.ReactNode;\n} & AnyProps;\n\nexport const Slot = forwardRef<unknown, SlotProps>(function Slot(props, forwardedRef) {\n const { children, ...slotProps } = props;\n\n if (!isValidElement(children)) {\n return null;\n }\n\n // Assert that children is a single React element with props — we've narrowed above.\n const child = Children.only(children) as ReactElement<AnyProps> & { ref?: Ref<unknown> };\n const merged = mergeProps(slotProps, child.props);\n\n // Merge refs: Slot's forwarded ref + the child's own ref (if any).\n const childRef = (child as unknown as { ref?: Ref<unknown> }).ref;\n if (forwardedRef || childRef) {\n (merged as AnyProps).ref = composeRefs(forwardedRef, childRef);\n }\n\n return cloneElement(child, merged);\n});\nSlot.displayName = 'Slot';\n\nfunction mergeProps(outer: AnyProps, inner: AnyProps): AnyProps {\n // Inner (child) wins for everything except: className (concatenated), style (merged), and\n // event handlers (composed — outer runs first, then inner).\n const merged: AnyProps = { ...outer };\n\n for (const key of Object.keys(inner)) {\n const outerValue = outer[key];\n const innerValue = inner[key];\n\n if (key === 'className' || key === 'class') {\n merged[key] = joinClass(outerValue, innerValue);\n continue;\n }\n\n if (key === 'style') {\n merged[key] = {\n ...(outerValue as CSSProperties | undefined),\n ...(innerValue as CSSProperties | undefined),\n };\n continue;\n }\n\n if (isEventHandler(key, outerValue, innerValue)) {\n merged[key] = composeHandlers(outerValue as Fn, innerValue as Fn);\n continue;\n }\n\n merged[key] = innerValue;\n }\n\n return merged;\n}\n\nfunction joinClass(outer: unknown, inner: unknown): string | undefined {\n const a = typeof outer === 'string' ? outer : '';\n const b = typeof inner === 'string' ? inner : '';\n const joined = [a, b].filter(Boolean).join(' ');\n return joined.length > 0 ? joined : undefined;\n}\n\ntype Fn = (...args: unknown[]) => unknown;\n\nfunction isEventHandler(key: string, outer: unknown, inner: unknown): boolean {\n if (!key.startsWith('on') || key.length < 3) return false;\n if (key[2] !== key[2]?.toUpperCase()) return false;\n return typeof outer === 'function' && typeof inner === 'function';\n}\n\nfunction composeHandlers(outer: Fn, inner: Fn): Fn {\n return (...args: unknown[]) => {\n outer(...args);\n inner(...args);\n };\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { Ref, RefCallback } from 'react';
|
|
3
|
+
|
|
4
|
+
type PossibleRef<T> = Ref<T> | undefined;
|
|
5
|
+
declare function composeRefs<T>(...refs: Array<PossibleRef<T>>): RefCallback<T>;
|
|
6
|
+
|
|
7
|
+
type AnyProps = Record<string, unknown>;
|
|
8
|
+
type SlotProps = {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
} & AnyProps;
|
|
11
|
+
declare const Slot: react.ForwardRefExoticComponent<Omit<SlotProps, "ref"> & react.RefAttributes<unknown>>;
|
|
12
|
+
|
|
13
|
+
export { Slot, type SlotProps, composeRefs };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { Ref, RefCallback } from 'react';
|
|
3
|
+
|
|
4
|
+
type PossibleRef<T> = Ref<T> | undefined;
|
|
5
|
+
declare function composeRefs<T>(...refs: Array<PossibleRef<T>>): RefCallback<T>;
|
|
6
|
+
|
|
7
|
+
type AnyProps = Record<string, unknown>;
|
|
8
|
+
type SlotProps = {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
} & AnyProps;
|
|
11
|
+
declare const Slot: react.ForwardRefExoticComponent<Omit<SlotProps, "ref"> & react.RefAttributes<unknown>>;
|
|
12
|
+
|
|
13
|
+
export { Slot, type SlotProps, composeRefs };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,612 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var reactNative = require('react-native');
|
|
4
|
+
var jsxRuntime = require('nativewind/jsx-runtime');
|
|
5
|
+
var react = require('react');
|
|
6
|
+
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
+
|
|
10
|
+
// src/utils/cn.ts
|
|
11
|
+
function cn(...inputs) {
|
|
12
|
+
const out = [];
|
|
13
|
+
for (const input of inputs) append(out, input);
|
|
14
|
+
return out.join(" ");
|
|
15
|
+
}
|
|
16
|
+
__name(cn, "cn");
|
|
17
|
+
function append(out, input) {
|
|
18
|
+
if (!input) return;
|
|
19
|
+
if (typeof input === "string") {
|
|
20
|
+
if (input.length > 0) out.push(input);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (typeof input === "number") return;
|
|
24
|
+
if (Array.isArray(input)) {
|
|
25
|
+
for (const inner of input) append(out, inner);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (typeof input === "object") {
|
|
29
|
+
for (const key of Object.keys(input)) {
|
|
30
|
+
if (input[key]) out.push(key);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
__name(append, "append");
|
|
35
|
+
function Box({ className, children, ...rest }) {
|
|
36
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { ...rest, className: cn(className), children });
|
|
37
|
+
}
|
|
38
|
+
__name(Box, "Box");
|
|
39
|
+
|
|
40
|
+
// src/slot/compose-refs.ts
|
|
41
|
+
function composeRefs(...refs) {
|
|
42
|
+
return (node) => {
|
|
43
|
+
for (const ref of refs) {
|
|
44
|
+
if (ref == null) continue;
|
|
45
|
+
if (typeof ref === "function") {
|
|
46
|
+
ref(node);
|
|
47
|
+
} else {
|
|
48
|
+
ref.current = node;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
__name(composeRefs, "composeRefs");
|
|
54
|
+
var Slot = react.forwardRef(/* @__PURE__ */ __name(function Slot2(props, forwardedRef) {
|
|
55
|
+
const { children, ...slotProps } = props;
|
|
56
|
+
if (!react.isValidElement(children)) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
const child = react.Children.only(children);
|
|
60
|
+
const merged = mergeProps(slotProps, child.props);
|
|
61
|
+
const childRef = child.ref;
|
|
62
|
+
if (forwardedRef || childRef) {
|
|
63
|
+
merged.ref = composeRefs(forwardedRef, childRef);
|
|
64
|
+
}
|
|
65
|
+
return react.cloneElement(child, merged);
|
|
66
|
+
}, "Slot"));
|
|
67
|
+
Slot.displayName = "Slot";
|
|
68
|
+
function mergeProps(outer, inner) {
|
|
69
|
+
const merged = { ...outer };
|
|
70
|
+
for (const key of Object.keys(inner)) {
|
|
71
|
+
const outerValue = outer[key];
|
|
72
|
+
const innerValue = inner[key];
|
|
73
|
+
if (key === "className" || key === "class") {
|
|
74
|
+
merged[key] = joinClass(outerValue, innerValue);
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
if (key === "style") {
|
|
78
|
+
merged[key] = {
|
|
79
|
+
...outerValue,
|
|
80
|
+
...innerValue
|
|
81
|
+
};
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
if (isEventHandler(key, outerValue, innerValue)) {
|
|
85
|
+
merged[key] = composeHandlers(outerValue, innerValue);
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
merged[key] = innerValue;
|
|
89
|
+
}
|
|
90
|
+
return merged;
|
|
91
|
+
}
|
|
92
|
+
__name(mergeProps, "mergeProps");
|
|
93
|
+
function joinClass(outer, inner) {
|
|
94
|
+
const a = typeof outer === "string" ? outer : "";
|
|
95
|
+
const b = typeof inner === "string" ? inner : "";
|
|
96
|
+
const joined = [a, b].filter(Boolean).join(" ");
|
|
97
|
+
return joined.length > 0 ? joined : void 0;
|
|
98
|
+
}
|
|
99
|
+
__name(joinClass, "joinClass");
|
|
100
|
+
function isEventHandler(key, outer, inner) {
|
|
101
|
+
if (!key.startsWith("on") || key.length < 3) return false;
|
|
102
|
+
if (key[2] !== key[2]?.toUpperCase()) return false;
|
|
103
|
+
return typeof outer === "function" && typeof inner === "function";
|
|
104
|
+
}
|
|
105
|
+
__name(isEventHandler, "isEventHandler");
|
|
106
|
+
function composeHandlers(outer, inner) {
|
|
107
|
+
return (...args) => {
|
|
108
|
+
outer(...args);
|
|
109
|
+
inner(...args);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
__name(composeHandlers, "composeHandlers");
|
|
113
|
+
var SIZE_MAP = {
|
|
114
|
+
sm: 12,
|
|
115
|
+
md: 16,
|
|
116
|
+
lg: 24,
|
|
117
|
+
xl: 32
|
|
118
|
+
};
|
|
119
|
+
function Spinner({ label = "Loading", size = "md", testID, color, style, ...rest }) {
|
|
120
|
+
const px = typeof size === "number" ? size : SIZE_MAP[size];
|
|
121
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
122
|
+
reactNative.ActivityIndicator,
|
|
123
|
+
{
|
|
124
|
+
...rest,
|
|
125
|
+
...testID !== void 0 ? { testID } : {},
|
|
126
|
+
accessibilityRole: "progressbar",
|
|
127
|
+
accessibilityLabel: label,
|
|
128
|
+
...color !== void 0 ? { color } : {},
|
|
129
|
+
size: px,
|
|
130
|
+
style: [{ width: px, height: px }, style]
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
__name(Spinner, "Spinner");
|
|
135
|
+
var VARIANT_CLASSES = {
|
|
136
|
+
primary: "bg-semantic-interactive-primary hover:bg-semantic-interactive-primaryHover active:bg-semantic-interactive-primaryPressed",
|
|
137
|
+
secondary: "bg-neutral-100 hover:bg-neutral-200 active:bg-neutral-300",
|
|
138
|
+
ghost: "bg-transparent hover:bg-neutral-100 active:bg-neutral-200",
|
|
139
|
+
destructive: "bg-semantic-interactive-destructive hover:opacity-90 active:opacity-80"
|
|
140
|
+
};
|
|
141
|
+
var SIZE_CLASSES = {
|
|
142
|
+
sm: "h-8 px-3 text-sm",
|
|
143
|
+
md: "h-10 px-4 text-md",
|
|
144
|
+
lg: "h-12 px-5 text-lg"
|
|
145
|
+
};
|
|
146
|
+
var ICON_SIZE = { sm: 14, md: 16, lg: 20 };
|
|
147
|
+
var BASE_CLASSES = "inline-flex flex-row items-center justify-center gap-2 rounded-md select-none";
|
|
148
|
+
var Button = react.forwardRef(/* @__PURE__ */ __name(function Button2({
|
|
149
|
+
children,
|
|
150
|
+
variant = "primary",
|
|
151
|
+
size = "md",
|
|
152
|
+
disabled,
|
|
153
|
+
loading,
|
|
154
|
+
leadingIcon: LeadingIcon,
|
|
155
|
+
trailingIcon: TrailingIcon,
|
|
156
|
+
asChild,
|
|
157
|
+
className,
|
|
158
|
+
onPress,
|
|
159
|
+
testID,
|
|
160
|
+
...rest
|
|
161
|
+
}, forwardedRef) {
|
|
162
|
+
const isInoperative = Boolean(disabled) || Boolean(loading);
|
|
163
|
+
const classes = cn(
|
|
164
|
+
BASE_CLASSES,
|
|
165
|
+
VARIANT_CLASSES[variant],
|
|
166
|
+
SIZE_CLASSES[size],
|
|
167
|
+
isInoperative ? "opacity-60" : void 0,
|
|
168
|
+
className
|
|
169
|
+
);
|
|
170
|
+
const handlePress = /* @__PURE__ */ __name((ev) => {
|
|
171
|
+
if (isInoperative) return;
|
|
172
|
+
onPress?.(ev);
|
|
173
|
+
}, "handlePress");
|
|
174
|
+
if (asChild) {
|
|
175
|
+
const slotProps = {
|
|
176
|
+
ref: forwardedRef,
|
|
177
|
+
className: classes,
|
|
178
|
+
onClick: handlePress,
|
|
179
|
+
...rest
|
|
180
|
+
};
|
|
181
|
+
if (isInoperative) slotProps["aria-disabled"] = true;
|
|
182
|
+
if (loading) slotProps["aria-busy"] = true;
|
|
183
|
+
if (testID !== void 0) slotProps["data-testid"] = testID;
|
|
184
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Slot, { ...slotProps, children });
|
|
185
|
+
}
|
|
186
|
+
const pressableExtra = {};
|
|
187
|
+
if (isInoperative) pressableExtra["aria-disabled"] = true;
|
|
188
|
+
if (loading) pressableExtra["aria-busy"] = true;
|
|
189
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
190
|
+
reactNative.Pressable,
|
|
191
|
+
{
|
|
192
|
+
ref: forwardedRef,
|
|
193
|
+
...testID !== void 0 ? { testID } : {},
|
|
194
|
+
role: "button",
|
|
195
|
+
accessibilityRole: "button",
|
|
196
|
+
accessibilityState: { disabled: isInoperative, busy: Boolean(loading) },
|
|
197
|
+
disabled: isInoperative,
|
|
198
|
+
onPress: handlePress,
|
|
199
|
+
className: classes,
|
|
200
|
+
...pressableExtra,
|
|
201
|
+
...rest,
|
|
202
|
+
children: [
|
|
203
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: ICON_SIZE[size], label: "Loading" }) : LeadingIcon ? /* @__PURE__ */ jsxRuntime.jsx(LeadingIcon, { size: ICON_SIZE[size] }) : null,
|
|
204
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { className: cn("font-medium", SIZE_CLASSES[size].includes("text-") ? void 0 : "text-md"), children }),
|
|
205
|
+
TrailingIcon ? /* @__PURE__ */ jsxRuntime.jsx(TrailingIcon, { size: ICON_SIZE[size] }) : null
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
}, "Button"));
|
|
210
|
+
Button.displayName = "Button";
|
|
211
|
+
var make = /* @__PURE__ */ __name((path) => /* @__PURE__ */ __name(function PlaceholderIcon({ size = 20, color = "currentColor" }) {
|
|
212
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
213
|
+
"svg",
|
|
214
|
+
{
|
|
215
|
+
width: size,
|
|
216
|
+
height: size,
|
|
217
|
+
viewBox: "0 0 24 24",
|
|
218
|
+
fill: "none",
|
|
219
|
+
stroke: color,
|
|
220
|
+
strokeWidth: "2",
|
|
221
|
+
strokeLinecap: "round",
|
|
222
|
+
strokeLinejoin: "round",
|
|
223
|
+
"aria-hidden": "true",
|
|
224
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: path })
|
|
225
|
+
}
|
|
226
|
+
);
|
|
227
|
+
}, "PlaceholderIcon"), "make");
|
|
228
|
+
var defaultSemanticIcons = {
|
|
229
|
+
checkmark: make("M20 6 9 17l-5-5"),
|
|
230
|
+
close: make("M18 6 6 18 M6 6l12 12"),
|
|
231
|
+
eye: make("M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6z"),
|
|
232
|
+
eyeOff: make("M17.94 17.94A10 10 0 0 1 2 12s3.5-7 10-7c2 0 3.8.6 5.4 1.5 M1 1l22 22"),
|
|
233
|
+
chevronDown: make("m6 9 6 6 6-6"),
|
|
234
|
+
chevronUp: make("m18 15-6-6-6 6"),
|
|
235
|
+
alertTriangle: make(
|
|
236
|
+
"M12 9v4 M12 17h.01 M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"
|
|
237
|
+
),
|
|
238
|
+
info: make(
|
|
239
|
+
"M12 8h.01 M11 12h1v4h1 M12 22C6.48 22 2 17.52 2 12 2 6.48 6.48 2 12 2c5.52 0 10 4.48 10 10 0 5.52-4.48 10-10 10z"
|
|
240
|
+
),
|
|
241
|
+
check: make("M20 6 9 17l-5-5"),
|
|
242
|
+
x: make("M18 6 6 18 M6 6l12 12")
|
|
243
|
+
};
|
|
244
|
+
var SemanticIconsContext = react.createContext(defaultSemanticIcons);
|
|
245
|
+
SemanticIconsContext.displayName = "SemanticIconsContext";
|
|
246
|
+
|
|
247
|
+
// src/icons/use-semantic-icon.ts
|
|
248
|
+
function useSemanticIcon(name) {
|
|
249
|
+
const icons = react.useContext(SemanticIconsContext);
|
|
250
|
+
return icons[name];
|
|
251
|
+
}
|
|
252
|
+
__name(useSemanticIcon, "useSemanticIcon");
|
|
253
|
+
function Checkbox({
|
|
254
|
+
checked,
|
|
255
|
+
defaultChecked = false,
|
|
256
|
+
indeterminate,
|
|
257
|
+
disabled,
|
|
258
|
+
onChange,
|
|
259
|
+
label,
|
|
260
|
+
className,
|
|
261
|
+
testID,
|
|
262
|
+
asChild,
|
|
263
|
+
children
|
|
264
|
+
}) {
|
|
265
|
+
const [inner, setInner] = react.useState(defaultChecked);
|
|
266
|
+
const isControlled = checked !== void 0;
|
|
267
|
+
const value = isControlled ? Boolean(checked) : inner;
|
|
268
|
+
const ariaChecked = indeterminate ? "mixed" : value ? "true" : "false";
|
|
269
|
+
const toggle = react.useCallback(() => {
|
|
270
|
+
if (disabled) return;
|
|
271
|
+
const next = !value;
|
|
272
|
+
if (!isControlled) setInner(next);
|
|
273
|
+
onChange?.(next);
|
|
274
|
+
}, [disabled, value, isControlled, onChange]);
|
|
275
|
+
const Check = useSemanticIcon("checkmark");
|
|
276
|
+
const commonProps = {
|
|
277
|
+
role: "checkbox",
|
|
278
|
+
"aria-checked": ariaChecked,
|
|
279
|
+
accessibilityRole: "checkbox",
|
|
280
|
+
accessibilityState: { checked: value, disabled: Boolean(disabled) },
|
|
281
|
+
testID
|
|
282
|
+
};
|
|
283
|
+
if (disabled) commonProps["aria-disabled"] = true;
|
|
284
|
+
if (label !== void 0) {
|
|
285
|
+
commonProps["aria-label"] = label;
|
|
286
|
+
commonProps.accessibilityLabel = label;
|
|
287
|
+
}
|
|
288
|
+
if (asChild) {
|
|
289
|
+
const slotProps = {
|
|
290
|
+
role: "checkbox",
|
|
291
|
+
"aria-checked": ariaChecked,
|
|
292
|
+
onClick: toggle
|
|
293
|
+
};
|
|
294
|
+
if (disabled) slotProps["aria-disabled"] = true;
|
|
295
|
+
if (label !== void 0) slotProps["aria-label"] = label;
|
|
296
|
+
if (testID !== void 0) slotProps["data-testid"] = testID;
|
|
297
|
+
if (className !== void 0) slotProps.className = className;
|
|
298
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Slot, { ...slotProps, children });
|
|
299
|
+
}
|
|
300
|
+
const boxClasses = cn("w-5 h-5 rounded-sm border border-semantic-border-strong items-center justify-center");
|
|
301
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { className: cn("flex-row items-center gap-2", disabled ? "opacity-60" : void 0, className), children: [
|
|
302
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: toggle, ...commonProps, className: boxClasses, children: (value || indeterminate) && !disabled ? /* @__PURE__ */ jsxRuntime.jsx(Check, { size: 14, color: "currentColor" }) : null }),
|
|
303
|
+
children ?? (label !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { children: label }) : null)
|
|
304
|
+
] });
|
|
305
|
+
}
|
|
306
|
+
__name(Checkbox, "Checkbox");
|
|
307
|
+
var ALIGN_CLASS = {
|
|
308
|
+
start: "items-start",
|
|
309
|
+
center: "items-center",
|
|
310
|
+
end: "items-end",
|
|
311
|
+
stretch: "items-stretch",
|
|
312
|
+
baseline: "items-baseline"
|
|
313
|
+
};
|
|
314
|
+
var JUSTIFY_CLASS = {
|
|
315
|
+
start: "justify-start",
|
|
316
|
+
center: "justify-center",
|
|
317
|
+
end: "justify-end",
|
|
318
|
+
between: "justify-between",
|
|
319
|
+
around: "justify-around",
|
|
320
|
+
evenly: "justify-evenly"
|
|
321
|
+
};
|
|
322
|
+
function HStack({ gap, align, justify, className, children, ...rest }) {
|
|
323
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
324
|
+
reactNative.View,
|
|
325
|
+
{
|
|
326
|
+
...rest,
|
|
327
|
+
className: cn(
|
|
328
|
+
"flex-row",
|
|
329
|
+
gap !== void 0 && gap !== 0 ? `gap-${gap}` : void 0,
|
|
330
|
+
align !== void 0 ? ALIGN_CLASS[align] : void 0,
|
|
331
|
+
justify !== void 0 ? JUSTIFY_CLASS[justify] : void 0,
|
|
332
|
+
className
|
|
333
|
+
),
|
|
334
|
+
children
|
|
335
|
+
}
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
__name(HStack, "HStack");
|
|
339
|
+
function Switch({
|
|
340
|
+
checked,
|
|
341
|
+
defaultChecked = false,
|
|
342
|
+
disabled,
|
|
343
|
+
onChange,
|
|
344
|
+
label,
|
|
345
|
+
className,
|
|
346
|
+
testID,
|
|
347
|
+
asChild,
|
|
348
|
+
children
|
|
349
|
+
}) {
|
|
350
|
+
const [inner, setInner] = react.useState(defaultChecked);
|
|
351
|
+
const isControlled = checked !== void 0;
|
|
352
|
+
const value = isControlled ? Boolean(checked) : inner;
|
|
353
|
+
const toggle = react.useCallback(() => {
|
|
354
|
+
if (disabled) return;
|
|
355
|
+
const next = !value;
|
|
356
|
+
if (!isControlled) setInner(next);
|
|
357
|
+
onChange?.(next);
|
|
358
|
+
}, [disabled, value, isControlled, onChange]);
|
|
359
|
+
const ariaChecked = value ? "true" : "false";
|
|
360
|
+
const commonProps = {
|
|
361
|
+
role: "switch",
|
|
362
|
+
"aria-checked": ariaChecked,
|
|
363
|
+
accessibilityRole: "switch",
|
|
364
|
+
accessibilityState: { checked: value, disabled: Boolean(disabled) },
|
|
365
|
+
testID
|
|
366
|
+
};
|
|
367
|
+
if (disabled) commonProps["aria-disabled"] = true;
|
|
368
|
+
if (label !== void 0) {
|
|
369
|
+
commonProps["aria-label"] = label;
|
|
370
|
+
commonProps.accessibilityLabel = label;
|
|
371
|
+
}
|
|
372
|
+
if (asChild) {
|
|
373
|
+
const slotProps = {
|
|
374
|
+
role: "switch",
|
|
375
|
+
"aria-checked": ariaChecked,
|
|
376
|
+
onClick: toggle
|
|
377
|
+
};
|
|
378
|
+
if (disabled) slotProps["aria-disabled"] = true;
|
|
379
|
+
if (label !== void 0) slotProps["aria-label"] = label;
|
|
380
|
+
if (testID !== void 0) slotProps["data-testid"] = testID;
|
|
381
|
+
if (className !== void 0) slotProps.className = className;
|
|
382
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Slot, { ...slotProps, children });
|
|
383
|
+
}
|
|
384
|
+
const trackClasses = cn(
|
|
385
|
+
"w-10 h-6 rounded-full justify-center px-0.5 transition-colors",
|
|
386
|
+
value ? "bg-semantic-interactive-primary" : "bg-neutral-300",
|
|
387
|
+
disabled ? "opacity-60" : void 0
|
|
388
|
+
);
|
|
389
|
+
const thumbClasses = cn("w-5 h-5 rounded-full bg-white shadow-sm", value ? "self-end" : "self-start");
|
|
390
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { className: cn("flex-row items-center gap-2", className), children: [
|
|
391
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { onPress: toggle, ...commonProps, className: trackClasses, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { className: thumbClasses }) }),
|
|
392
|
+
label ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { className: "text-md text-semantic-text-default", children: label }) : null,
|
|
393
|
+
children
|
|
394
|
+
] });
|
|
395
|
+
}
|
|
396
|
+
__name(Switch, "Switch");
|
|
397
|
+
var VARIANT_CLASSES2 = {
|
|
398
|
+
"body-xs": "text-xs leading-normal",
|
|
399
|
+
"body-sm": "text-sm leading-normal",
|
|
400
|
+
"body-md": "text-md leading-normal",
|
|
401
|
+
"body-lg": "text-lg leading-relaxed",
|
|
402
|
+
"heading-1": "text-4xl leading-tight font-bold",
|
|
403
|
+
"heading-2": "text-3xl leading-tight font-semibold",
|
|
404
|
+
"heading-3": "text-2xl leading-tight font-semibold"
|
|
405
|
+
};
|
|
406
|
+
var HEADING_VARIANTS = /* @__PURE__ */ new Set(["heading-1", "heading-2", "heading-3"]);
|
|
407
|
+
function Text({ variant = "body-md", className, testID, children, ...rest }) {
|
|
408
|
+
const isHeading = HEADING_VARIANTS.has(variant);
|
|
409
|
+
const role = isHeading ? "header" : rest.accessibilityRole;
|
|
410
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
411
|
+
reactNative.Text,
|
|
412
|
+
{
|
|
413
|
+
testID,
|
|
414
|
+
...rest,
|
|
415
|
+
...role !== void 0 ? { accessibilityRole: role } : {},
|
|
416
|
+
className: cn(VARIANT_CLASSES2[variant], className),
|
|
417
|
+
children
|
|
418
|
+
}
|
|
419
|
+
);
|
|
420
|
+
}
|
|
421
|
+
__name(Text, "Text");
|
|
422
|
+
function TextInput({
|
|
423
|
+
label,
|
|
424
|
+
helperText,
|
|
425
|
+
error,
|
|
426
|
+
disabled,
|
|
427
|
+
leading,
|
|
428
|
+
trailing,
|
|
429
|
+
containerClassName,
|
|
430
|
+
className,
|
|
431
|
+
testID,
|
|
432
|
+
onChangeText,
|
|
433
|
+
multiline,
|
|
434
|
+
numberOfLines,
|
|
435
|
+
...rest
|
|
436
|
+
}) {
|
|
437
|
+
const reactId = react.useId();
|
|
438
|
+
const inputId = testID ?? `nori-ui-input-${reactId}`;
|
|
439
|
+
const describeId = `${inputId}-describe`;
|
|
440
|
+
const hasError = Boolean(error);
|
|
441
|
+
const describedBy = error || helperText ? describeId : void 0;
|
|
442
|
+
const inputExtras = {};
|
|
443
|
+
if (testID !== void 0) inputExtras.testID = testID;
|
|
444
|
+
if (label !== void 0) inputExtras.accessibilityLabel = label;
|
|
445
|
+
if (hasError) inputExtras["aria-invalid"] = true;
|
|
446
|
+
if (describedBy !== void 0) inputExtras["aria-describedby"] = describedBy;
|
|
447
|
+
if (multiline !== void 0) inputExtras.multiline = multiline;
|
|
448
|
+
if (numberOfLines !== void 0) inputExtras.numberOfLines = numberOfLines;
|
|
449
|
+
if (onChangeText !== void 0) inputExtras.onChangeText = onChangeText;
|
|
450
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { className: cn("flex flex-col gap-1", containerClassName), children: [
|
|
451
|
+
label !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: inputId, className: "text-sm font-medium text-semantic-text-default", children: label }) : null,
|
|
452
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
453
|
+
reactNative.View,
|
|
454
|
+
{
|
|
455
|
+
className: cn(
|
|
456
|
+
"flex-row items-center rounded-md border px-3",
|
|
457
|
+
hasError ? "border-semantic-interactive-destructive" : "border-semantic-border-default",
|
|
458
|
+
disabled ? "opacity-60" : void 0
|
|
459
|
+
),
|
|
460
|
+
children: [
|
|
461
|
+
leading ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { className: "mr-2", children: leading }) : null,
|
|
462
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
463
|
+
reactNative.TextInput,
|
|
464
|
+
{
|
|
465
|
+
nativeID: inputId,
|
|
466
|
+
editable: !disabled,
|
|
467
|
+
className: cn("flex-1 py-2 text-md text-semantic-text-default outline-none", className),
|
|
468
|
+
...inputExtras,
|
|
469
|
+
...rest
|
|
470
|
+
}
|
|
471
|
+
),
|
|
472
|
+
trailing ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { className: "ml-2", children: trailing }) : null
|
|
473
|
+
]
|
|
474
|
+
}
|
|
475
|
+
),
|
|
476
|
+
error ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { nativeID: describeId, className: "text-sm text-semantic-interactive-destructive", children: error }) : helperText ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { nativeID: describeId, className: "text-sm text-semantic-text-muted", children: helperText }) : null
|
|
477
|
+
] });
|
|
478
|
+
}
|
|
479
|
+
__name(TextInput, "TextInput");
|
|
480
|
+
function TextArea({ numberOfLines = 4, ...rest }) {
|
|
481
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TextInput, { multiline: true, numberOfLines, ...rest });
|
|
482
|
+
}
|
|
483
|
+
__name(TextArea, "TextArea");
|
|
484
|
+
var ALIGN_CLASS2 = {
|
|
485
|
+
start: "items-start",
|
|
486
|
+
center: "items-center",
|
|
487
|
+
end: "items-end",
|
|
488
|
+
stretch: "items-stretch",
|
|
489
|
+
baseline: "items-baseline"
|
|
490
|
+
};
|
|
491
|
+
var JUSTIFY_CLASS2 = {
|
|
492
|
+
start: "justify-start",
|
|
493
|
+
center: "justify-center",
|
|
494
|
+
end: "justify-end",
|
|
495
|
+
between: "justify-between",
|
|
496
|
+
around: "justify-around",
|
|
497
|
+
evenly: "justify-evenly"
|
|
498
|
+
};
|
|
499
|
+
function VStack({ gap, align, justify, className, children, ...rest }) {
|
|
500
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
501
|
+
reactNative.View,
|
|
502
|
+
{
|
|
503
|
+
...rest,
|
|
504
|
+
className: cn(
|
|
505
|
+
"flex-col",
|
|
506
|
+
gap !== void 0 && gap !== 0 ? `gap-${gap}` : void 0,
|
|
507
|
+
align !== void 0 ? ALIGN_CLASS2[align] : void 0,
|
|
508
|
+
justify !== void 0 ? JUSTIFY_CLASS2[justify] : void 0,
|
|
509
|
+
className
|
|
510
|
+
),
|
|
511
|
+
children
|
|
512
|
+
}
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
__name(VStack, "VStack");
|
|
516
|
+
var stories = [
|
|
517
|
+
{
|
|
518
|
+
id: "text.body-md",
|
|
519
|
+
title: "Text \xB7 body-md",
|
|
520
|
+
render: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsx(Text, { testID: "story-text-body-md", children: "Hello world" }), "render")
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
id: "text.heading-1",
|
|
524
|
+
title: "Text \xB7 heading-1",
|
|
525
|
+
render: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsx(Text, { variant: "heading-1", testID: "story-text-heading-1", children: "Heading" }), "render")
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
id: "box.default",
|
|
529
|
+
title: "Box \xB7 default",
|
|
530
|
+
render: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsx(Box, { testID: "story-box-default", className: "p-4 bg-primary-50 rounded-md", children: /* @__PURE__ */ jsxRuntime.jsx(Text, { children: "Box content" }) }), "render")
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
id: "hstack.gap-4",
|
|
534
|
+
title: "HStack \xB7 gap 4",
|
|
535
|
+
render: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsxs(HStack, { testID: "story-hstack-gap-4", gap: 4, children: [
|
|
536
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { testID: "story-hstack-a", style: { padding: 8, backgroundColor: "#dbeafe" }, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { children: "A" }) }),
|
|
537
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { testID: "story-hstack-b", style: { padding: 8, backgroundColor: "#bfdbfe" }, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { children: "B" }) })
|
|
538
|
+
] }), "render")
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
id: "vstack.gap-4",
|
|
542
|
+
title: "VStack \xB7 gap 4",
|
|
543
|
+
render: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsxs(VStack, { testID: "story-vstack-gap-4", gap: 4, children: [
|
|
544
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { testID: "story-vstack-a", style: { padding: 8, backgroundColor: "#dbeafe" }, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { children: "A" }) }),
|
|
545
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { testID: "story-vstack-b", style: { padding: 8, backgroundColor: "#bfdbfe" }, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { children: "B" }) })
|
|
546
|
+
] }), "render")
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
id: "spinner.md",
|
|
550
|
+
title: "Spinner \xB7 md",
|
|
551
|
+
render: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsx(Spinner, { testID: "story-spinner-md", size: "md" }), "render")
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
id: "spinner.lg",
|
|
555
|
+
title: "Spinner \xB7 lg",
|
|
556
|
+
render: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsx(Spinner, { testID: "story-spinner-lg", size: "lg" }), "render")
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
id: "button.primary",
|
|
560
|
+
title: "Button \xB7 primary",
|
|
561
|
+
render: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsx(Button, { testID: "story-button-primary", children: "Click me" }), "render")
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
id: "button.destructive",
|
|
565
|
+
title: "Button \xB7 destructive",
|
|
566
|
+
render: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsx(Button, { testID: "story-button-destructive", variant: "destructive", children: "Delete" }), "render")
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
id: "button.loading",
|
|
570
|
+
title: "Button \xB7 loading",
|
|
571
|
+
render: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsx(Button, { testID: "story-button-loading", loading: true, children: "Saving" }), "render")
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
id: "text-input.default",
|
|
575
|
+
title: "TextInput \xB7 default",
|
|
576
|
+
render: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsx(TextInput, { testID: "story-text-input-default", label: "Email", placeholder: "you@example.com" }), "render")
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
id: "text-input.error",
|
|
580
|
+
title: "TextInput \xB7 error",
|
|
581
|
+
render: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsx(TextInput, { testID: "story-text-input-error", label: "Email", error: "Required" }), "render")
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
id: "text-area.default",
|
|
585
|
+
title: "TextArea \xB7 default",
|
|
586
|
+
render: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsx(TextArea, { testID: "story-text-area-default", label: "Bio", numberOfLines: 3 }), "render")
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
id: "checkbox.default",
|
|
590
|
+
title: "Checkbox \xB7 default",
|
|
591
|
+
render: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { testID: "story-checkbox-default", label: "Accept" }), "render")
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
id: "checkbox.checked",
|
|
595
|
+
title: "Checkbox \xB7 checked",
|
|
596
|
+
render: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { testID: "story-checkbox-checked", label: "Accept", defaultChecked: true }), "render")
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
id: "switch.default",
|
|
600
|
+
title: "Switch \xB7 default",
|
|
601
|
+
render: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsx(Switch, { testID: "story-switch-default", label: "Dark mode" }), "render")
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
id: "switch.on",
|
|
605
|
+
title: "Switch \xB7 on",
|
|
606
|
+
render: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntime.jsx(Switch, { testID: "story-switch-on", label: "Dark mode", defaultChecked: true }), "render")
|
|
607
|
+
}
|
|
608
|
+
];
|
|
609
|
+
|
|
610
|
+
exports.stories = stories;
|
|
611
|
+
//# sourceMappingURL=story-registry.cjs.map
|
|
612
|
+
//# sourceMappingURL=story-registry.cjs.map
|