@12min/ds 0.1.0 → 3.0.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.
- package/README.md +84 -51
- package/dist/Checkbox.styles-DPyXzxFJ.d.mts +90 -0
- package/dist/Checkbox.styles-DPyXzxFJ.d.ts +90 -0
- package/dist/chunk-ZK7NW4WW.mjs +247 -0
- package/dist/chunk-ZK7NW4WW.mjs.map +1 -0
- package/dist/chunk-ZKPOS2PD.mjs +192 -0
- package/dist/chunk-ZKPOS2PD.mjs.map +1 -0
- package/dist/index.native.d.mts +184 -2
- package/dist/index.native.d.ts +184 -2
- package/dist/index.native.js +1160 -62
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +742 -5
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.web.d.mts +182 -22
- package/dist/index.web.d.ts +182 -22
- package/dist/index.web.js +1052 -62
- package/dist/index.web.js.map +1 -1
- package/dist/index.web.mjs +644 -4
- package/dist/index.web.mjs.map +1 -1
- package/dist/tailwind/theme.css +300 -38
- package/dist/tokens/index.d.mts +385 -37
- package/dist/tokens/index.d.ts +385 -37
- package/dist/tokens/index.js +242 -33
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/index.mjs +17 -3
- package/package.json +28 -5
- package/dist/chunk-E2C4G6H4.mjs +0 -45
- package/dist/chunk-E2C4G6H4.mjs.map +0 -1
- package/dist/chunk-QIJRSFZB.mjs +0 -41
- package/dist/chunk-QIJRSFZB.mjs.map +0 -1
package/dist/index.native.js
CHANGED
|
@@ -20,88 +20,1186 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// index.native.ts
|
|
21
21
|
var index_native_exports = {};
|
|
22
22
|
__export(index_native_exports, {
|
|
23
|
+
Alert: () => Alert,
|
|
24
|
+
Button: () => Button,
|
|
25
|
+
ButtonIcon: () => ButtonIcon,
|
|
26
|
+
Checkbox: () => Checkbox,
|
|
27
|
+
Chip: () => Chip,
|
|
28
|
+
ChoiceCard: () => ChoiceCard,
|
|
29
|
+
DSThemeProvider: () => DSThemeProvider,
|
|
30
|
+
DismissButton: () => DismissButton,
|
|
31
|
+
Input: () => Input,
|
|
32
|
+
InputField: () => InputField,
|
|
33
|
+
ListItem: () => ListItem,
|
|
34
|
+
ProgressBar: () => ProgressBar,
|
|
35
|
+
RadioGroup: () => RadioGroup,
|
|
36
|
+
RatingScale: () => RatingScale,
|
|
37
|
+
Stepper: () => Stepper,
|
|
38
|
+
ToggleSwitch: () => ToggleSwitch,
|
|
39
|
+
borderWidth: () => borderWidth,
|
|
23
40
|
colors: () => colors,
|
|
24
41
|
darkTheme: () => darkTheme,
|
|
25
|
-
|
|
42
|
+
grid: () => grid,
|
|
43
|
+
lightTheme: () => lightTheme,
|
|
44
|
+
opacity: () => opacity,
|
|
45
|
+
radius: () => radius,
|
|
46
|
+
shadow: () => shadow,
|
|
47
|
+
spacing: () => spacing,
|
|
48
|
+
typography: () => typography,
|
|
49
|
+
useTheme: () => useTheme
|
|
26
50
|
});
|
|
27
51
|
module.exports = __toCommonJS(index_native_exports);
|
|
28
52
|
|
|
29
53
|
// src/tokens/colors.ts
|
|
30
54
|
var colors = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
marianBlue: {
|
|
56
|
+
50: "#FAFBFF",
|
|
57
|
+
100: "#F6F8FF",
|
|
58
|
+
200: "#E1E7FF",
|
|
59
|
+
300: "#C3CCF7",
|
|
60
|
+
400: "#94A5F2",
|
|
61
|
+
500: "#697DD6",
|
|
62
|
+
600: "#4357AD",
|
|
63
|
+
700: "#31428B",
|
|
64
|
+
800: "#25326A",
|
|
65
|
+
900: "#131937"
|
|
66
|
+
},
|
|
67
|
+
midnight: {
|
|
68
|
+
50: "#707070",
|
|
69
|
+
100: "#5C5C5C",
|
|
70
|
+
200: "#525252",
|
|
71
|
+
300: "#474747",
|
|
72
|
+
400: "#3D3D3D",
|
|
73
|
+
500: "#333333",
|
|
74
|
+
600: "#292929",
|
|
75
|
+
700: "#161616",
|
|
76
|
+
800: "#141414",
|
|
77
|
+
900: "#0A0A0A"
|
|
78
|
+
},
|
|
79
|
+
gray: {
|
|
80
|
+
15: "#F4F5F8",
|
|
81
|
+
25: "#EDEEF1",
|
|
82
|
+
35: "#DDE0E6",
|
|
83
|
+
50: "#B1B5BE",
|
|
84
|
+
100: "#A6ABB5",
|
|
85
|
+
200: "#9BA0AB",
|
|
86
|
+
300: "#9095A2",
|
|
87
|
+
400: "#858B99",
|
|
88
|
+
500: "#7A8190",
|
|
89
|
+
600: "#6F7685",
|
|
90
|
+
700: "#5E6471",
|
|
91
|
+
800: "#5D636F",
|
|
92
|
+
900: "#545964"
|
|
93
|
+
},
|
|
94
|
+
amber: {
|
|
95
|
+
50: "#FFFBEB",
|
|
96
|
+
100: "#FEF3C7",
|
|
97
|
+
200: "#FDE68A",
|
|
98
|
+
300: "#FCD34D",
|
|
99
|
+
400: "#FBBF24",
|
|
100
|
+
500: "#F59E0B",
|
|
101
|
+
600: "#D97706",
|
|
102
|
+
700: "#B45309",
|
|
103
|
+
800: "#92400E",
|
|
104
|
+
900: "#78350F",
|
|
105
|
+
text: "#BA5C0A"
|
|
106
|
+
},
|
|
107
|
+
yellow: {
|
|
108
|
+
50: "#FFF2D6",
|
|
109
|
+
100: "#FFECC2",
|
|
110
|
+
200: "#FFE5AD",
|
|
111
|
+
300: "#FFDF99",
|
|
112
|
+
400: "#FFD885",
|
|
113
|
+
500: "#FFD270",
|
|
114
|
+
600: "#FFCB5C",
|
|
115
|
+
700: "#FFC140",
|
|
116
|
+
800: "#FFBE33",
|
|
117
|
+
900: "#FFB81F"
|
|
118
|
+
},
|
|
119
|
+
ketchup: {
|
|
120
|
+
50: "#FEF2F2",
|
|
121
|
+
100: "#FEE2E2",
|
|
122
|
+
200: "#FECACA",
|
|
123
|
+
300: "#FCA5A5",
|
|
124
|
+
400: "#F87171",
|
|
125
|
+
500: "#EF4444",
|
|
126
|
+
600: "#DC2626",
|
|
127
|
+
700: "#B91C1C",
|
|
128
|
+
800: "#991B1B",
|
|
129
|
+
900: "#7F1D1D",
|
|
130
|
+
text: "#D91F3C"
|
|
131
|
+
},
|
|
132
|
+
green: {
|
|
133
|
+
50: "#F2FDF4",
|
|
134
|
+
100: "#E5FBE9",
|
|
135
|
+
200: "#C7F4D0",
|
|
136
|
+
300: "#99E5AC",
|
|
137
|
+
400: "#5FCD80",
|
|
138
|
+
500: "#36B260",
|
|
139
|
+
600: "#258F4B",
|
|
140
|
+
700: "#1B6F3B",
|
|
141
|
+
800: "#145430",
|
|
142
|
+
900: "#0E3622",
|
|
143
|
+
text: "#0E8745"
|
|
144
|
+
},
|
|
145
|
+
blue: {
|
|
146
|
+
50: "#EFF6FF",
|
|
147
|
+
100: "#DBEAFE",
|
|
148
|
+
200: "#BFDBFE",
|
|
149
|
+
300: "#93C5FD",
|
|
150
|
+
400: "#60A5FA",
|
|
151
|
+
500: "#3B82F6",
|
|
152
|
+
600: "#2563EB",
|
|
153
|
+
700: "#1D4ED8",
|
|
154
|
+
800: "#1E40AF",
|
|
155
|
+
900: "#1E3A8A",
|
|
156
|
+
text: "#1E40AF"
|
|
157
|
+
},
|
|
158
|
+
// Single brand accent green — the vibrant tone that was previously green/300
|
|
159
|
+
// before the green scale was retuned to muted values in the Figma v2 palette.
|
|
160
|
+
brandGreen: "#6DFFB4",
|
|
161
|
+
overlayBlack: {
|
|
162
|
+
5: "#0000000D",
|
|
163
|
+
8: "#00000014",
|
|
164
|
+
12: "#0000001F",
|
|
165
|
+
16: "#00000029"
|
|
166
|
+
},
|
|
167
|
+
overlayWhite: {
|
|
168
|
+
5: "#FFFFFF0D",
|
|
169
|
+
8: "#FFFFFF14",
|
|
170
|
+
12: "#FFFFFF1F",
|
|
171
|
+
16: "#FFFFFF29"
|
|
172
|
+
},
|
|
173
|
+
white: "#FFFFFF",
|
|
174
|
+
black: "#000000"
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
// src/tokens/typography.ts
|
|
178
|
+
var typography = {
|
|
179
|
+
display1: { fontFamily: "Poppins", fontSize: 32, fontWeight: "700", lineHeight: 40, letterSpacing: -1, textTransform: "none" },
|
|
180
|
+
display2: { fontFamily: "Poppins", fontSize: 32, fontWeight: "700", lineHeight: 40, letterSpacing: -1, textTransform: "none" },
|
|
181
|
+
h1: { fontFamily: "Poppins", fontSize: 24, fontWeight: "700", lineHeight: 32, letterSpacing: -1, textTransform: "none" },
|
|
182
|
+
h2: { fontFamily: "Poppins", fontSize: 20, fontWeight: "700", lineHeight: 28, letterSpacing: 0, textTransform: "none" },
|
|
183
|
+
h3: { fontFamily: "Poppins", fontSize: 16, fontWeight: "600", lineHeight: 24, letterSpacing: 0, textTransform: "none" },
|
|
184
|
+
bodyLarge: { fontFamily: "Inter", fontSize: 16, fontWeight: "500", lineHeight: 24, letterSpacing: 0, textTransform: "none" },
|
|
185
|
+
bodyDefault: { fontFamily: "Inter", fontSize: 14, fontWeight: "500", lineHeight: 20, letterSpacing: 0, textTransform: "none" },
|
|
186
|
+
bodySmall: { fontFamily: "Inter", fontSize: 12, fontWeight: "400", lineHeight: 16, letterSpacing: 0.2, textTransform: "none" },
|
|
187
|
+
labelLarge: { fontFamily: "Inter", fontSize: 16, fontWeight: "600", lineHeight: 20, letterSpacing: 0, textTransform: "none" },
|
|
188
|
+
labelDefault: { fontFamily: "Inter", fontSize: 14, fontWeight: "600", lineHeight: 20, letterSpacing: 0, textTransform: "none" },
|
|
189
|
+
labelSmall: { fontFamily: "Inter", fontSize: 12, fontWeight: "600", lineHeight: 16, letterSpacing: 0.2, textTransform: "none" },
|
|
190
|
+
labelTiny: { fontFamily: "Inter", fontSize: 10, fontWeight: "600", lineHeight: 14, letterSpacing: 0, textTransform: "none" },
|
|
191
|
+
caption: { fontFamily: "Inter", fontSize: 12, fontWeight: "500", lineHeight: 16, letterSpacing: 0.5, textTransform: "none" },
|
|
192
|
+
captionUppercase: { fontFamily: "Inter", fontSize: 12, fontWeight: "500", lineHeight: 16, letterSpacing: 0.5, textTransform: "uppercase" },
|
|
193
|
+
overline: { fontFamily: "Inter", fontSize: 10, fontWeight: "600", lineHeight: 16, letterSpacing: 8, textTransform: "uppercase" },
|
|
194
|
+
buttonLarge: { fontFamily: "Inter", fontSize: 16, fontWeight: "600", lineHeight: 20, letterSpacing: 0, textTransform: "none" },
|
|
195
|
+
buttonDefault: { fontFamily: "Inter", fontSize: 14, fontWeight: "600", lineHeight: 20, letterSpacing: 0, textTransform: "none" },
|
|
196
|
+
buttonSmall: { fontFamily: "Inter", fontSize: 12, fontWeight: "600", lineHeight: 16, letterSpacing: 0, textTransform: "none" }
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
// src/tokens/spacing.ts
|
|
200
|
+
var spacing = {
|
|
201
|
+
unit: 4,
|
|
202
|
+
gap: {
|
|
203
|
+
"0.5": 2,
|
|
204
|
+
"1": 4,
|
|
205
|
+
"2": 8,
|
|
206
|
+
"3": 12,
|
|
207
|
+
"4": 16,
|
|
208
|
+
"5": 20,
|
|
209
|
+
"6": 24,
|
|
210
|
+
"8": 32,
|
|
211
|
+
"10": 40,
|
|
212
|
+
"12": 48,
|
|
213
|
+
"14": 56,
|
|
214
|
+
"16": 64,
|
|
215
|
+
"18": 72,
|
|
216
|
+
"20": 80,
|
|
217
|
+
"22": 88,
|
|
218
|
+
"24": 96
|
|
219
|
+
},
|
|
220
|
+
screen: {
|
|
221
|
+
x: 16,
|
|
222
|
+
y: 24
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
// src/tokens/grid.ts
|
|
227
|
+
var grid = {
|
|
228
|
+
// 8px square baseline — line-height/* steps 16/24/32/40 snap; 20 and 28 land on a half-cell
|
|
229
|
+
baseline: 8,
|
|
230
|
+
breakpoints: {
|
|
231
|
+
mobile: 0,
|
|
232
|
+
tablet: 768,
|
|
233
|
+
desktop: 1024
|
|
234
|
+
},
|
|
235
|
+
columns: {
|
|
236
|
+
mobile: 4,
|
|
237
|
+
tablet: 8,
|
|
238
|
+
desktop: 12
|
|
239
|
+
},
|
|
240
|
+
gutter: {
|
|
241
|
+
mobile: 8,
|
|
242
|
+
tablet: 16,
|
|
243
|
+
desktop: 24
|
|
244
|
+
},
|
|
245
|
+
margin: {
|
|
246
|
+
mobile: 20,
|
|
247
|
+
tablet: 24,
|
|
248
|
+
desktop: 32
|
|
67
249
|
}
|
|
68
250
|
};
|
|
69
251
|
|
|
252
|
+
// src/tokens/radius.ts
|
|
253
|
+
var radius = {
|
|
254
|
+
none: 0,
|
|
255
|
+
sm: 8,
|
|
256
|
+
md: 12,
|
|
257
|
+
lg: 16,
|
|
258
|
+
xl: 20,
|
|
259
|
+
"2xl": 24,
|
|
260
|
+
full: 9999,
|
|
261
|
+
button: 16,
|
|
262
|
+
card: 20,
|
|
263
|
+
input: 12,
|
|
264
|
+
chip: 9999,
|
|
265
|
+
badge: 8
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
// src/tokens/borderWidth.ts
|
|
269
|
+
var borderWidth = {
|
|
270
|
+
default: 1,
|
|
271
|
+
strong: 1.5,
|
|
272
|
+
heavy: 2
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
// src/tokens/shadow.ts
|
|
276
|
+
var shadow = {
|
|
277
|
+
sm: { offsetX: 0, offsetY: 1, blur: 3, spread: 0, color: "#000000", opacity: { light: 0.08, dark: 0.4 } },
|
|
278
|
+
md: { offsetX: 0, offsetY: 4, blur: 12, spread: 0, color: "#000000", opacity: { light: 0.1, dark: 0.5 } },
|
|
279
|
+
lg: { offsetX: 0, offsetY: 8, blur: 24, spread: -4, color: "#000000", opacity: { light: 0.12, dark: 0.6 } }
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
// src/tokens/opacity.ts
|
|
283
|
+
var opacity = {
|
|
284
|
+
disabled: 0.4,
|
|
285
|
+
hover: 0.08,
|
|
286
|
+
pressed: 0.12
|
|
287
|
+
};
|
|
288
|
+
|
|
70
289
|
// src/themes/lightTheme.ts
|
|
71
290
|
var lightTheme = {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
291
|
+
bg: {
|
|
292
|
+
primary: colors.marianBlue[600],
|
|
293
|
+
primaryHover: colors.marianBlue[700],
|
|
294
|
+
primaryPressed: colors.marianBlue[800],
|
|
295
|
+
primarySubtle: colors.marianBlue[200],
|
|
296
|
+
primarySubtleHover: colors.marianBlue[300],
|
|
297
|
+
primarySubtlePressed: colors.marianBlue[400],
|
|
298
|
+
surface: colors.white,
|
|
299
|
+
surfaceRaised: colors.marianBlue[50],
|
|
300
|
+
surfaceHover: colors.gray[15],
|
|
301
|
+
surfacePressed: colors.gray[35],
|
|
302
|
+
overlay: colors.marianBlue[900],
|
|
303
|
+
overlaySubtle: colors.overlayBlack[8],
|
|
304
|
+
overlaySubtleHover: colors.overlayBlack[12],
|
|
305
|
+
overlaySubtlePressed: colors.overlayBlack[16],
|
|
306
|
+
success: colors.green[600],
|
|
307
|
+
successSubtle: colors.green[100],
|
|
308
|
+
error: colors.ketchup[600],
|
|
309
|
+
errorSubtle: colors.ketchup[100],
|
|
310
|
+
warning: colors.amber[500],
|
|
311
|
+
warningSubtle: colors.amber[100],
|
|
312
|
+
info: colors.blue[500],
|
|
313
|
+
infoSubtle: colors.blue[100],
|
|
314
|
+
highlight: colors.brandGreen,
|
|
315
|
+
accent: colors.amber[500],
|
|
316
|
+
accentSubtle: colors.amber[100],
|
|
317
|
+
disabled: colors.gray[25]
|
|
318
|
+
},
|
|
319
|
+
text: {
|
|
320
|
+
primary: colors.marianBlue[900],
|
|
321
|
+
secondary: colors.gray[700],
|
|
322
|
+
inverse: colors.white,
|
|
323
|
+
brand: colors.marianBlue[600],
|
|
324
|
+
link: colors.marianBlue[600],
|
|
325
|
+
placeholder: colors.gray[400],
|
|
326
|
+
success: colors.green.text,
|
|
327
|
+
error: colors.ketchup.text,
|
|
328
|
+
warning: colors.amber.text,
|
|
329
|
+
info: colors.blue.text,
|
|
330
|
+
highlight: colors.marianBlue[900],
|
|
331
|
+
accent: colors.amber.text,
|
|
332
|
+
disabled: colors.gray[400],
|
|
333
|
+
onSuccess: colors.white,
|
|
334
|
+
onError: colors.white,
|
|
335
|
+
onWarning: colors.midnight[900],
|
|
336
|
+
onHighlight: colors.midnight[900]
|
|
337
|
+
},
|
|
338
|
+
border: {
|
|
339
|
+
default: colors.marianBlue[200],
|
|
340
|
+
strong: colors.marianBlue[600],
|
|
341
|
+
subtle: colors.overlayBlack[5],
|
|
342
|
+
focus: colors.black,
|
|
343
|
+
accent: colors.amber[700],
|
|
344
|
+
success: colors.green.text,
|
|
345
|
+
error: colors.ketchup[600],
|
|
346
|
+
warning: colors.amber[700],
|
|
347
|
+
info: colors.blue[600],
|
|
348
|
+
disabled: colors.gray[50]
|
|
349
|
+
},
|
|
350
|
+
icon: {
|
|
351
|
+
primary: colors.marianBlue[900],
|
|
352
|
+
secondary: colors.gray[600],
|
|
353
|
+
inverse: colors.white,
|
|
354
|
+
brand: colors.marianBlue[600],
|
|
355
|
+
accent: colors.amber[700],
|
|
356
|
+
success: colors.green.text,
|
|
357
|
+
error: colors.ketchup[600],
|
|
358
|
+
warning: colors.amber[600],
|
|
359
|
+
info: colors.blue[600],
|
|
360
|
+
highlight: colors.marianBlue[900],
|
|
361
|
+
disabled: colors.gray[400]
|
|
362
|
+
},
|
|
363
|
+
interactive: {
|
|
364
|
+
hover: colors.overlayBlack[8],
|
|
365
|
+
pressed: colors.overlayBlack[12],
|
|
366
|
+
selected: colors.marianBlue[700],
|
|
367
|
+
selectedSubtle: colors.marianBlue[200]
|
|
368
|
+
}
|
|
84
369
|
};
|
|
85
370
|
|
|
86
371
|
// src/themes/darkTheme.ts
|
|
87
372
|
var darkTheme = {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
373
|
+
bg: {
|
|
374
|
+
primary: colors.marianBlue[600],
|
|
375
|
+
primaryHover: colors.marianBlue[500],
|
|
376
|
+
primaryPressed: colors.marianBlue[600],
|
|
377
|
+
primarySubtle: colors.marianBlue[900],
|
|
378
|
+
primarySubtleHover: colors.marianBlue[800],
|
|
379
|
+
primarySubtlePressed: colors.marianBlue[700],
|
|
380
|
+
surface: colors.midnight[900],
|
|
381
|
+
surfaceRaised: colors.midnight[800],
|
|
382
|
+
surfaceHover: colors.midnight[800],
|
|
383
|
+
surfacePressed: colors.midnight[600],
|
|
384
|
+
overlay: colors.black,
|
|
385
|
+
overlaySubtle: colors.overlayWhite[8],
|
|
386
|
+
overlaySubtleHover: colors.overlayWhite[12],
|
|
387
|
+
overlaySubtlePressed: colors.overlayWhite[16],
|
|
388
|
+
success: colors.green[300],
|
|
389
|
+
successSubtle: colors.green[800],
|
|
390
|
+
error: colors.ketchup[900],
|
|
391
|
+
errorSubtle: colors.ketchup[800],
|
|
392
|
+
warning: colors.amber[900],
|
|
393
|
+
warningSubtle: colors.amber[800],
|
|
394
|
+
info: colors.blue[600],
|
|
395
|
+
infoSubtle: colors.blue[700],
|
|
396
|
+
highlight: colors.brandGreen,
|
|
397
|
+
accent: colors.amber[900],
|
|
398
|
+
accentSubtle: colors.amber[900],
|
|
399
|
+
disabled: colors.midnight[700]
|
|
400
|
+
},
|
|
401
|
+
text: {
|
|
402
|
+
primary: colors.white,
|
|
403
|
+
secondary: colors.gray[300],
|
|
404
|
+
inverse: colors.midnight[900],
|
|
405
|
+
brand: colors.marianBlue[300],
|
|
406
|
+
link: colors.marianBlue[300],
|
|
407
|
+
placeholder: colors.gray[400],
|
|
408
|
+
success: colors.green[500],
|
|
409
|
+
error: colors.ketchup[600],
|
|
410
|
+
warning: colors.amber[500],
|
|
411
|
+
info: colors.blue[100],
|
|
412
|
+
highlight: colors.marianBlue[900],
|
|
413
|
+
accent: colors.amber.text,
|
|
414
|
+
disabled: colors.gray[600],
|
|
415
|
+
onSuccess: colors.white,
|
|
416
|
+
onError: colors.white,
|
|
417
|
+
onWarning: colors.midnight[900],
|
|
418
|
+
onHighlight: colors.midnight[900]
|
|
419
|
+
},
|
|
420
|
+
border: {
|
|
421
|
+
default: colors.midnight[50],
|
|
422
|
+
strong: colors.marianBlue[300],
|
|
423
|
+
subtle: colors.overlayWhite[5],
|
|
424
|
+
focus: colors.white,
|
|
425
|
+
accent: colors.amber.text,
|
|
426
|
+
success: colors.green.text,
|
|
427
|
+
error: colors.ketchup[500],
|
|
428
|
+
warning: colors.amber[600],
|
|
429
|
+
info: colors.blue[500],
|
|
430
|
+
disabled: colors.midnight[700]
|
|
431
|
+
},
|
|
432
|
+
icon: {
|
|
433
|
+
primary: colors.white,
|
|
434
|
+
secondary: colors.gray[400],
|
|
435
|
+
inverse: colors.midnight[900],
|
|
436
|
+
brand: colors.marianBlue[300],
|
|
437
|
+
accent: colors.amber[700],
|
|
438
|
+
success: colors.green.text,
|
|
439
|
+
error: colors.ketchup.text,
|
|
440
|
+
warning: colors.amber[100],
|
|
441
|
+
info: colors.blue[100],
|
|
442
|
+
highlight: colors.marianBlue[900],
|
|
443
|
+
disabled: colors.gray[600]
|
|
444
|
+
},
|
|
445
|
+
interactive: {
|
|
446
|
+
hover: colors.overlayWhite[8],
|
|
447
|
+
pressed: colors.overlayWhite[12],
|
|
448
|
+
selected: colors.marianBlue[800],
|
|
449
|
+
selectedSubtle: colors.marianBlue[900]
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
// src/context/ThemeProvider.tsx
|
|
454
|
+
var import_react = require("react");
|
|
455
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
456
|
+
var DSThemeContext = (0, import_react.createContext)({ theme: lightTheme, colorScheme: "light" });
|
|
457
|
+
function DSThemeProvider({
|
|
458
|
+
colorScheme = "light",
|
|
459
|
+
children
|
|
460
|
+
}) {
|
|
461
|
+
const value = (0, import_react.useMemo)(
|
|
462
|
+
() => ({ theme: colorScheme === "dark" ? darkTheme : lightTheme, colorScheme }),
|
|
463
|
+
[colorScheme]
|
|
464
|
+
);
|
|
465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DSThemeContext.Provider, { value, children });
|
|
466
|
+
}
|
|
467
|
+
function useTheme() {
|
|
468
|
+
return (0, import_react.useContext)(DSThemeContext);
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// src/components/Button/Button.native.tsx
|
|
472
|
+
var import_react_native = require("react-native");
|
|
473
|
+
|
|
474
|
+
// src/components/Button/Button.styles.ts
|
|
475
|
+
var buttonTokens = {
|
|
476
|
+
sizes: {
|
|
477
|
+
sm: { height: 32, paddingHorizontal: 12 },
|
|
478
|
+
md: { height: 40, paddingHorizontal: 16 },
|
|
479
|
+
lg: { height: 48, paddingHorizontal: 24 }
|
|
480
|
+
},
|
|
481
|
+
borderRadius: radius.full
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
// src/components/Button/Button.native.tsx
|
|
485
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
486
|
+
var textStyleBySize = {
|
|
487
|
+
sm: typography.buttonSmall,
|
|
488
|
+
md: typography.buttonDefault,
|
|
489
|
+
lg: typography.buttonLarge
|
|
490
|
+
};
|
|
491
|
+
function Button({ variant = "primary", size = "lg", disabled = false, children, onPress }) {
|
|
492
|
+
const { theme } = useTheme();
|
|
493
|
+
const { sizes: sizes2, borderRadius } = buttonTokens;
|
|
494
|
+
const sizeStyle = sizes2[size];
|
|
495
|
+
const textStyle = textStyleBySize[size];
|
|
496
|
+
const bgColor = disabled ? variant === "ghost" ? "transparent" : theme.bg.disabled : variant === "primary" ? theme.bg.primary : variant === "secondary" ? theme.bg.primarySubtle : "transparent";
|
|
497
|
+
const textColor = disabled ? theme.text.disabled : variant === "primary" ? theme.text.inverse : variant === "secondary" ? theme.text.primary : theme.text.brand;
|
|
498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
499
|
+
import_react_native.Pressable,
|
|
500
|
+
{
|
|
501
|
+
onPress: disabled ? void 0 : onPress,
|
|
502
|
+
disabled,
|
|
503
|
+
style: ({ pressed }) => [
|
|
504
|
+
styles.base,
|
|
505
|
+
{
|
|
506
|
+
height: sizeStyle.height,
|
|
507
|
+
paddingHorizontal: sizeStyle.paddingHorizontal,
|
|
508
|
+
borderRadius,
|
|
509
|
+
backgroundColor: bgColor,
|
|
510
|
+
opacity: !disabled && pressed ? 1 - opacity.pressed : 1
|
|
511
|
+
}
|
|
512
|
+
],
|
|
513
|
+
accessibilityRole: "button",
|
|
514
|
+
accessibilityState: { disabled },
|
|
515
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native.Text, { style: [textStyle, { color: textColor }], children })
|
|
516
|
+
}
|
|
517
|
+
);
|
|
518
|
+
}
|
|
519
|
+
var styles = import_react_native.StyleSheet.create({
|
|
520
|
+
base: { flexDirection: "row", alignItems: "center", justifyContent: "center", gap: 8 }
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
// src/components/ButtonIcon/ButtonIcon.native.tsx
|
|
524
|
+
var import_react_native2 = require("react-native");
|
|
525
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
526
|
+
var sizeBySize = {
|
|
527
|
+
sm: 40,
|
|
528
|
+
md: 48,
|
|
529
|
+
lg: 64
|
|
100
530
|
};
|
|
531
|
+
function ButtonIcon({ icon, accessibilityLabel, variant = "primary", size = "md", disabled = false, onPress }) {
|
|
532
|
+
const { theme, colorScheme } = useTheme();
|
|
533
|
+
const dimension = sizeBySize[size];
|
|
534
|
+
const bgColor = disabled ? variant === "ghost" ? "transparent" : theme.bg.disabled : variant === "primary" ? theme.bg.primary : variant === "secondary" ? theme.bg.primarySubtle : variant === "overlay" ? colorScheme === "dark" ? colors.overlayWhite[8] : colors.overlayBlack[8] : "transparent";
|
|
535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
536
|
+
import_react_native2.Pressable,
|
|
537
|
+
{
|
|
538
|
+
onPress: disabled ? void 0 : onPress,
|
|
539
|
+
disabled,
|
|
540
|
+
style: ({ pressed }) => [
|
|
541
|
+
styles2.base,
|
|
542
|
+
{
|
|
543
|
+
width: dimension,
|
|
544
|
+
height: dimension,
|
|
545
|
+
borderRadius: radius.full,
|
|
546
|
+
backgroundColor: bgColor,
|
|
547
|
+
opacity: !disabled && pressed ? 1 - opacity.pressed : 1
|
|
548
|
+
}
|
|
549
|
+
],
|
|
550
|
+
accessibilityRole: "button",
|
|
551
|
+
accessibilityLabel,
|
|
552
|
+
accessibilityState: { disabled },
|
|
553
|
+
children: icon
|
|
554
|
+
}
|
|
555
|
+
);
|
|
556
|
+
}
|
|
557
|
+
var styles2 = import_react_native2.StyleSheet.create({
|
|
558
|
+
base: { alignItems: "center", justifyContent: "center" }
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
// src/components/DismissButton/DismissButton.native.tsx
|
|
562
|
+
var import_react_native3 = require("react-native");
|
|
563
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
564
|
+
var containerSize = { xs: 20, sm: 32, md: 40 };
|
|
565
|
+
var glyphSize = { xs: 12, sm: 16, md: 20 };
|
|
566
|
+
function DismissButton({ accessibilityLabel = "Fechar", variant = "subtle", size = "sm", disabled = false, onPress }) {
|
|
567
|
+
const { theme, colorScheme } = useTheme();
|
|
568
|
+
const dimension = containerSize[size];
|
|
569
|
+
const glyph2 = glyphSize[size];
|
|
570
|
+
const bgColor = disabled ? variant === "ghost" ? "transparent" : theme.bg.disabled : variant === "subtle" ? colorScheme === "dark" ? colors.overlayWhite[8] : colors.overlayBlack[8] : "transparent";
|
|
571
|
+
const glyphColor = disabled ? theme.text.disabled : theme.icon.primary;
|
|
572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
573
|
+
import_react_native3.Pressable,
|
|
574
|
+
{
|
|
575
|
+
onPress: disabled ? void 0 : onPress,
|
|
576
|
+
disabled,
|
|
577
|
+
style: ({ pressed }) => [
|
|
578
|
+
styles3.base,
|
|
579
|
+
{
|
|
580
|
+
width: dimension,
|
|
581
|
+
height: dimension,
|
|
582
|
+
borderRadius: radius.full,
|
|
583
|
+
backgroundColor: bgColor,
|
|
584
|
+
opacity: !disabled && pressed ? 1 - opacity.pressed : 1
|
|
585
|
+
}
|
|
586
|
+
],
|
|
587
|
+
accessibilityRole: "button",
|
|
588
|
+
accessibilityLabel,
|
|
589
|
+
accessibilityState: { disabled },
|
|
590
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native3.View, { style: { width: glyph2, height: glyph2, alignItems: "center", justifyContent: "center" }, children: [
|
|
591
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native3.View, { style: [styles3.line, { width: glyph2, backgroundColor: glyphColor, transform: [{ rotate: "45deg" }] }] }),
|
|
592
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native3.View, { style: [styles3.line, { width: glyph2, backgroundColor: glyphColor, transform: [{ rotate: "-45deg" }] }] })
|
|
593
|
+
] })
|
|
594
|
+
}
|
|
595
|
+
);
|
|
596
|
+
}
|
|
597
|
+
var styles3 = import_react_native3.StyleSheet.create({
|
|
598
|
+
base: { alignItems: "center", justifyContent: "center" },
|
|
599
|
+
line: { position: "absolute", height: 2, borderRadius: 1 }
|
|
600
|
+
});
|
|
601
|
+
|
|
602
|
+
// src/components/Chip/Chip.native.tsx
|
|
603
|
+
var import_react_native4 = require("react-native");
|
|
604
|
+
|
|
605
|
+
// src/components/Chip/Chip.styles.ts
|
|
606
|
+
var chipSizes = {
|
|
607
|
+
sm: { height: 32, paddingHorizontal: 12 },
|
|
608
|
+
md: { height: 44, paddingHorizontal: 16 }
|
|
609
|
+
};
|
|
610
|
+
var chipRadius = radius.chip;
|
|
611
|
+
|
|
612
|
+
// src/components/Chip/Chip.native.tsx
|
|
613
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
614
|
+
function Chip({ children, checked = false, disabled = false, size = "md", leading, trailing, onPress, style }) {
|
|
615
|
+
const { theme } = useTheme();
|
|
616
|
+
const { height, paddingHorizontal } = chipSizes[size];
|
|
617
|
+
const bg = disabled ? theme.bg.disabled : checked ? theme.interactive.selected : "transparent";
|
|
618
|
+
const borderColor = disabled ? theme.border.disabled : checked ? theme.interactive.selected : theme.border.default;
|
|
619
|
+
const textColor = disabled ? theme.text.disabled : checked ? theme.text.inverse : theme.text.primary;
|
|
620
|
+
const baseText = size === "sm" ? typography.caption : typography.bodyDefault;
|
|
621
|
+
const textStyle = { ...baseText, fontWeight: checked ? "600" : baseText.fontWeight };
|
|
622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
623
|
+
import_react_native4.Pressable,
|
|
624
|
+
{
|
|
625
|
+
onPress: disabled ? void 0 : onPress,
|
|
626
|
+
disabled,
|
|
627
|
+
style: ({ pressed }) => [
|
|
628
|
+
styles4.base,
|
|
629
|
+
{
|
|
630
|
+
height,
|
|
631
|
+
paddingHorizontal,
|
|
632
|
+
borderRadius: chipRadius,
|
|
633
|
+
backgroundColor: bg,
|
|
634
|
+
borderColor,
|
|
635
|
+
borderWidth: borderWidth.default,
|
|
636
|
+
opacity: !disabled && pressed ? 1 - opacity.pressed : 1
|
|
637
|
+
},
|
|
638
|
+
style
|
|
639
|
+
],
|
|
640
|
+
accessibilityRole: "button",
|
|
641
|
+
accessibilityState: { selected: checked, disabled },
|
|
642
|
+
children: [
|
|
643
|
+
leading,
|
|
644
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native4.Text, { style: [textStyle, { color: textColor }], children }),
|
|
645
|
+
trailing
|
|
646
|
+
]
|
|
647
|
+
}
|
|
648
|
+
);
|
|
649
|
+
}
|
|
650
|
+
var styles4 = import_react_native4.StyleSheet.create({
|
|
651
|
+
base: { flexDirection: "row", alignItems: "center", justifyContent: "center", gap: 8, borderStyle: "solid" }
|
|
652
|
+
});
|
|
653
|
+
|
|
654
|
+
// src/components/Alert/Alert.native.tsx
|
|
655
|
+
var import_react_native5 = require("react-native");
|
|
656
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
657
|
+
var glyph = { success: "\u2713", info: "i", warning: "!", error: "\u2715" };
|
|
658
|
+
function Alert({ variant = "info", size = "default", layout = "stacked", title, description, onDismiss }) {
|
|
659
|
+
const { theme } = useTheme();
|
|
660
|
+
const bg = { success: theme.bg.successSubtle, info: theme.bg.infoSubtle, warning: theme.bg.warningSubtle, error: theme.bg.errorSubtle }[variant];
|
|
661
|
+
const iconColor = { success: theme.icon.success, info: theme.icon.info, warning: theme.icon.warning, error: theme.icon.error }[variant];
|
|
662
|
+
const borderColor = theme.border.subtle;
|
|
663
|
+
const padding = size === "compact" ? 12 : 20;
|
|
664
|
+
const outerGap = size === "compact" ? 8 : 12;
|
|
665
|
+
const iconEl = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native5.View, { style: [styles5.icon, { borderColor: iconColor }], children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native5.Text, { style: { color: iconColor, fontSize: 13, fontWeight: "700", lineHeight: 16 }, children: glyph[variant] }) });
|
|
666
|
+
const bodyEl = description ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native5.Text, { style: [typography.bodyDefault, { color: theme.text.secondary, flex: layout === "inline" ? 1 : void 0 }], children: description }) : null;
|
|
667
|
+
const closeEl = onDismiss ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native5.Pressable, { onPress: onDismiss, accessibilityRole: "button", accessibilityLabel: "Fechar", style: styles5.close, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native5.Text, { style: { color: theme.text.primary, fontSize: 16, lineHeight: 20 }, children: "\u2715" }) }) : null;
|
|
668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
669
|
+
import_react_native5.View,
|
|
670
|
+
{
|
|
671
|
+
style: [styles5.container, { backgroundColor: bg, borderColor, padding, gap: outerGap }],
|
|
672
|
+
accessibilityRole: variant === "error" ? "alert" : void 0,
|
|
673
|
+
accessibilityLiveRegion: variant === "error" ? "assertive" : "polite",
|
|
674
|
+
children: [
|
|
675
|
+
layout === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
676
|
+
iconEl,
|
|
677
|
+
bodyEl
|
|
678
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_native5.View, { style: styles5.content, children: [
|
|
679
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_native5.View, { style: styles5.header, children: [
|
|
680
|
+
iconEl,
|
|
681
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native5.Text, { style: [typography.h3, styles5.title, { color: theme.text.primary }], children: title }) : null
|
|
682
|
+
] }),
|
|
683
|
+
bodyEl
|
|
684
|
+
] }),
|
|
685
|
+
closeEl
|
|
686
|
+
]
|
|
687
|
+
}
|
|
688
|
+
);
|
|
689
|
+
}
|
|
690
|
+
var styles5 = import_react_native5.StyleSheet.create({
|
|
691
|
+
container: {
|
|
692
|
+
width: "100%",
|
|
693
|
+
flexDirection: "row",
|
|
694
|
+
alignItems: "flex-start",
|
|
695
|
+
borderWidth: borderWidth.default,
|
|
696
|
+
borderStyle: "solid",
|
|
697
|
+
borderTopLeftRadius: 24,
|
|
698
|
+
borderTopRightRadius: 24,
|
|
699
|
+
borderBottomRightRadius: 24,
|
|
700
|
+
borderBottomLeftRadius: 0
|
|
701
|
+
},
|
|
702
|
+
content: { flex: 1, flexDirection: "column", gap: 8 },
|
|
703
|
+
header: { flexDirection: "row", alignItems: "center", gap: 12 },
|
|
704
|
+
title: { flex: 1 },
|
|
705
|
+
icon: { width: 24, height: 24, borderRadius: 12, borderWidth: 2, alignItems: "center", justifyContent: "center" },
|
|
706
|
+
close: {}
|
|
707
|
+
});
|
|
708
|
+
|
|
709
|
+
// src/components/ProgressBar/ProgressBar.native.tsx
|
|
710
|
+
var import_react_native6 = require("react-native");
|
|
711
|
+
|
|
712
|
+
// src/components/ProgressBar/ProgressBar.styles.ts
|
|
713
|
+
var progressBarTokens = {
|
|
714
|
+
height: 8,
|
|
715
|
+
borderRadius: radius.full,
|
|
716
|
+
fillBorderRadius: radius.full
|
|
717
|
+
};
|
|
718
|
+
|
|
719
|
+
// src/components/ProgressBar/ProgressBar.native.tsx
|
|
720
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
721
|
+
function ProgressBar({ value }) {
|
|
722
|
+
const { theme } = useTheme();
|
|
723
|
+
const { height, borderRadius, fillBorderRadius } = progressBarTokens;
|
|
724
|
+
const pct = Math.min(100, Math.max(0, value));
|
|
725
|
+
const trackColor = theme.bg.surfaceHover;
|
|
726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
727
|
+
import_react_native6.View,
|
|
728
|
+
{
|
|
729
|
+
style: [styles6.track, { height, borderRadius, backgroundColor: trackColor }],
|
|
730
|
+
accessibilityRole: "progressbar",
|
|
731
|
+
accessibilityValue: { min: 0, max: 100, now: pct },
|
|
732
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native6.View, { style: { height, width: `${pct}%`, borderRadius: fillBorderRadius, backgroundColor: theme.bg.primary } })
|
|
733
|
+
}
|
|
734
|
+
);
|
|
735
|
+
}
|
|
736
|
+
var styles6 = import_react_native6.StyleSheet.create({
|
|
737
|
+
track: { width: "100%", overflow: "hidden" }
|
|
738
|
+
});
|
|
739
|
+
|
|
740
|
+
// src/components/Input/Input.native.tsx
|
|
741
|
+
var import_react2 = require("react");
|
|
742
|
+
var import_react_native7 = require("react-native");
|
|
743
|
+
|
|
744
|
+
// src/components/Input/Input.styles.ts
|
|
745
|
+
var inputTokens = {
|
|
746
|
+
height: 48,
|
|
747
|
+
padding: 12,
|
|
748
|
+
gap: 8,
|
|
749
|
+
borderRadius: radius.input
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
// src/components/Input/Input.native.tsx
|
|
753
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
754
|
+
function Input({ value, placeholder = "exemplo@email.com", state = "default", leadingIcon, trailingIcon, onChangeText, onFocus, onBlur, style }) {
|
|
755
|
+
const { theme } = useTheme();
|
|
756
|
+
const { height, padding, gap, borderRadius } = inputTokens;
|
|
757
|
+
const [isFocused, setIsFocused] = (0, import_react2.useState)(false);
|
|
758
|
+
const isDisabled = state === "disabled";
|
|
759
|
+
const isError = state === "error";
|
|
760
|
+
const isFilled = state === "filled";
|
|
761
|
+
const bg = isDisabled ? theme.bg.disabled : theme.bg.surface;
|
|
762
|
+
const borderColor = isDisabled ? theme.border.disabled : isError ? theme.border.error : isFocused ? theme.border.focus : theme.border.default;
|
|
763
|
+
const inputBorderWidth = isFocused ? borderWidth.heavy : borderWidth.default;
|
|
764
|
+
const textColor = isDisabled ? theme.text.disabled : isError ? theme.text.error : isFilled || isFocused ? theme.text.primary : theme.text.secondary;
|
|
765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native7.View, { style: [styles7.container, { height, padding, gap, borderRadius, backgroundColor: bg, borderColor, borderWidth: inputBorderWidth }, style], children: [
|
|
766
|
+
leadingIcon,
|
|
767
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
768
|
+
import_react_native7.TextInput,
|
|
769
|
+
{
|
|
770
|
+
value,
|
|
771
|
+
placeholder,
|
|
772
|
+
placeholderTextColor: textColor,
|
|
773
|
+
editable: !isDisabled,
|
|
774
|
+
onChangeText,
|
|
775
|
+
onFocus: () => {
|
|
776
|
+
setIsFocused(true);
|
|
777
|
+
onFocus?.();
|
|
778
|
+
},
|
|
779
|
+
onBlur: () => {
|
|
780
|
+
setIsFocused(false);
|
|
781
|
+
onBlur?.();
|
|
782
|
+
},
|
|
783
|
+
style: [typography.bodyDefault, styles7.input, { color: textColor }]
|
|
784
|
+
}
|
|
785
|
+
),
|
|
786
|
+
trailingIcon
|
|
787
|
+
] });
|
|
788
|
+
}
|
|
789
|
+
var styles7 = import_react_native7.StyleSheet.create({
|
|
790
|
+
container: { flexDirection: "row", alignItems: "center", borderStyle: "solid" },
|
|
791
|
+
input: { flex: 1, padding: 0 }
|
|
792
|
+
});
|
|
793
|
+
|
|
794
|
+
// src/components/InputField/InputField.native.tsx
|
|
795
|
+
var import_react_native8 = require("react-native");
|
|
796
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
797
|
+
function InputField({
|
|
798
|
+
label,
|
|
799
|
+
required,
|
|
800
|
+
helperText,
|
|
801
|
+
error,
|
|
802
|
+
value,
|
|
803
|
+
placeholder,
|
|
804
|
+
disabled,
|
|
805
|
+
leadingIcon,
|
|
806
|
+
trailingIcon,
|
|
807
|
+
onChangeText,
|
|
808
|
+
onFocus,
|
|
809
|
+
onBlur
|
|
810
|
+
}) {
|
|
811
|
+
const { theme } = useTheme();
|
|
812
|
+
const state = disabled ? "disabled" : error ? "error" : "default";
|
|
813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native8.View, { style: { gap: 8, width: "100%" }, children: [
|
|
814
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native8.Text, { style: [typography.labelDefault, { color: theme.text.primary }], children: [
|
|
815
|
+
label,
|
|
816
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native8.Text, { style: { color: theme.text.error }, children: " *" })
|
|
817
|
+
] }),
|
|
818
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
819
|
+
Input,
|
|
820
|
+
{
|
|
821
|
+
state,
|
|
822
|
+
value,
|
|
823
|
+
placeholder,
|
|
824
|
+
leadingIcon,
|
|
825
|
+
trailingIcon,
|
|
826
|
+
onChangeText,
|
|
827
|
+
onFocus,
|
|
828
|
+
onBlur
|
|
829
|
+
}
|
|
830
|
+
),
|
|
831
|
+
helperText && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native8.Text, { style: [typography.caption, { color: error ? theme.text.error : theme.text.secondary }], children: helperText })
|
|
832
|
+
] });
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
// src/components/Checkbox/Checkbox.native.tsx
|
|
836
|
+
var import_react_native9 = require("react-native");
|
|
837
|
+
|
|
838
|
+
// src/components/Checkbox/Checkbox.styles.ts
|
|
839
|
+
var checkboxSizes = {
|
|
840
|
+
xs: { box: 16, radius: 4 },
|
|
841
|
+
sm: { box: 20, radius: 5 },
|
|
842
|
+
md: { box: 24, radius: 6 }
|
|
843
|
+
};
|
|
844
|
+
|
|
845
|
+
// src/components/Checkbox/Checkbox.native.tsx
|
|
846
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
847
|
+
function Checkbox({ checked = false, onChange, disabled = false, size = "sm" }) {
|
|
848
|
+
const { theme } = useTheme();
|
|
849
|
+
const { box, radius: radius2 } = checkboxSizes[size];
|
|
850
|
+
const boxBg = checked ? disabled ? theme.bg.disabled : theme.interactive.selected : "transparent";
|
|
851
|
+
const boxBorder = checked ? boxBg : disabled ? theme.text.disabled : theme.icon.secondary;
|
|
852
|
+
const checkColor = disabled ? theme.text.disabled : colors.white;
|
|
853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
854
|
+
import_react_native9.Pressable,
|
|
855
|
+
{
|
|
856
|
+
onPress: disabled ? void 0 : () => onChange?.(!checked),
|
|
857
|
+
disabled,
|
|
858
|
+
style: ({ pressed }) => [
|
|
859
|
+
styles8.wrapper,
|
|
860
|
+
// state layer: interactive/selected at ~12% (8-digit hex alpha).
|
|
861
|
+
{ backgroundColor: !disabled && pressed ? `${theme.interactive.selected}1F` : "transparent" }
|
|
862
|
+
],
|
|
863
|
+
accessibilityRole: "checkbox",
|
|
864
|
+
accessibilityState: { checked, disabled },
|
|
865
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
866
|
+
import_react_native9.View,
|
|
867
|
+
{
|
|
868
|
+
style: [
|
|
869
|
+
styles8.box,
|
|
870
|
+
{
|
|
871
|
+
width: box,
|
|
872
|
+
height: box,
|
|
873
|
+
borderRadius: radius2,
|
|
874
|
+
backgroundColor: boxBg,
|
|
875
|
+
borderColor: boxBorder,
|
|
876
|
+
borderWidth: checked ? 0 : borderWidth.heavy
|
|
877
|
+
}
|
|
878
|
+
],
|
|
879
|
+
children: checked && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
880
|
+
import_react_native9.View,
|
|
881
|
+
{
|
|
882
|
+
style: {
|
|
883
|
+
width: box * 0.5,
|
|
884
|
+
height: box * 0.4,
|
|
885
|
+
borderLeftWidth: 1.5,
|
|
886
|
+
borderBottomWidth: 1.5,
|
|
887
|
+
borderColor: checkColor,
|
|
888
|
+
transform: [{ rotate: "-45deg" }, { translateY: -box * 0.1 }]
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
)
|
|
892
|
+
}
|
|
893
|
+
)
|
|
894
|
+
}
|
|
895
|
+
);
|
|
896
|
+
}
|
|
897
|
+
var styles8 = import_react_native9.StyleSheet.create({
|
|
898
|
+
wrapper: { padding: 4, borderRadius: 9999, alignItems: "center", justifyContent: "center" },
|
|
899
|
+
box: { alignItems: "center", justifyContent: "center" }
|
|
900
|
+
});
|
|
901
|
+
|
|
902
|
+
// src/components/ToggleSwitch/ToggleSwitch.native.tsx
|
|
903
|
+
var import_react3 = require("react");
|
|
904
|
+
var import_react_native10 = require("react-native");
|
|
905
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
906
|
+
var sizes = {
|
|
907
|
+
xs: { w: 32, h: 20, knob: 16 },
|
|
908
|
+
sm: { w: 40, h: 24, knob: 20 },
|
|
909
|
+
md: { w: 52, h: 32, knob: 28 }
|
|
910
|
+
};
|
|
911
|
+
function ToggleSwitch({ value = false, onChange, disabled = false, size = "sm", accessibilityLabel }) {
|
|
912
|
+
const { theme } = useTheme();
|
|
913
|
+
const { w, h, knob } = sizes[size];
|
|
914
|
+
const travel = w - knob - 4;
|
|
915
|
+
const anim = (0, import_react3.useRef)(new import_react_native10.Animated.Value(value ? 1 : 0)).current;
|
|
916
|
+
(0, import_react3.useEffect)(() => {
|
|
917
|
+
import_react_native10.Animated.timing(anim, { toValue: value ? 1 : 0, duration: 150, useNativeDriver: true }).start();
|
|
918
|
+
}, [value, anim]);
|
|
919
|
+
const translateX = anim.interpolate({ inputRange: [0, 1], outputRange: [0, travel] });
|
|
920
|
+
const trackColor = disabled ? theme.bg.disabled : value ? theme.interactive.selected : theme.bg.disabled;
|
|
921
|
+
const knobColor = disabled ? theme.text.disabled : theme.text.inverse;
|
|
922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
923
|
+
import_react_native10.Pressable,
|
|
924
|
+
{
|
|
925
|
+
onPress: disabled ? void 0 : () => onChange?.(!value),
|
|
926
|
+
disabled,
|
|
927
|
+
style: { width: w, height: h, borderRadius: radius.full, backgroundColor: trackColor, padding: 2, justifyContent: "center" },
|
|
928
|
+
accessibilityRole: "switch",
|
|
929
|
+
accessibilityState: { checked: value, disabled },
|
|
930
|
+
accessibilityLabel,
|
|
931
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
932
|
+
import_react_native10.Animated.View,
|
|
933
|
+
{
|
|
934
|
+
style: { width: knob, height: knob, borderRadius: radius.full, backgroundColor: knobColor, transform: [{ translateX }] }
|
|
935
|
+
}
|
|
936
|
+
)
|
|
937
|
+
}
|
|
938
|
+
);
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
// src/components/RadioGroup/RadioGroup.native.tsx
|
|
942
|
+
var import_react_native11 = require("react-native");
|
|
943
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
944
|
+
function RadioGroup({ children, label, style }) {
|
|
945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native11.View, { accessibilityRole: "radiogroup", accessibilityLabel: label, style: [{ gap: 8 }, style], children });
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
// src/components/ChoiceCard/ChoiceCard.native.tsx
|
|
949
|
+
var import_react_native12 = require("react-native");
|
|
950
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
951
|
+
function Trailing({ type, selected, disabled }) {
|
|
952
|
+
const { theme } = useTheme();
|
|
953
|
+
const offColor = disabled ? theme.text.disabled : theme.icon.secondary;
|
|
954
|
+
const onColor = theme.interactive.selected;
|
|
955
|
+
if (type === "action") {
|
|
956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.View, { style: [styles9.caret, { borderColor: disabled ? theme.text.disabled : theme.icon.secondary }] });
|
|
957
|
+
}
|
|
958
|
+
if (type === "checkbox") {
|
|
959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.View, { style: [styles9.indicator, styles9.checkbox, { borderColor: selected ? onColor : offColor, backgroundColor: selected ? onColor : "transparent" }], children: selected && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.View, { style: [styles9.check, { borderColor: colors.white }] }) });
|
|
960
|
+
}
|
|
961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.View, { style: [styles9.indicator, styles9.radio, { borderColor: selected ? onColor : offColor }], children: selected && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.View, { style: [styles9.dot, { backgroundColor: onColor }] }) });
|
|
962
|
+
}
|
|
963
|
+
function ChoiceCard({ type = "radio", label, description, selected = false, disabled = false, leading, showTrailing = true, onPress }) {
|
|
964
|
+
const { theme } = useTheme();
|
|
965
|
+
const isSelected = type === "action" ? false : selected;
|
|
966
|
+
const baseBg = disabled ? theme.bg.surface : isSelected ? theme.bg.primarySubtle : theme.bg.surface;
|
|
967
|
+
const pressedBg = isSelected ? theme.bg.primarySubtlePressed : theme.bg.surfacePressed;
|
|
968
|
+
const borderColor = disabled ? theme.border.disabled : isSelected ? theme.border.strong : theme.border.default;
|
|
969
|
+
const textColor = disabled ? theme.text.disabled : theme.text.primary;
|
|
970
|
+
const descColor = disabled ? theme.text.disabled : theme.text.secondary;
|
|
971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
972
|
+
import_react_native12.Pressable,
|
|
973
|
+
{
|
|
974
|
+
onPress: disabled ? void 0 : onPress,
|
|
975
|
+
disabled,
|
|
976
|
+
accessibilityRole: type === "radio" ? "radio" : type === "checkbox" ? "checkbox" : "button",
|
|
977
|
+
accessibilityState: { selected: isSelected, checked: isSelected, disabled },
|
|
978
|
+
style: ({ pressed }) => [
|
|
979
|
+
styles9.card,
|
|
980
|
+
{
|
|
981
|
+
backgroundColor: !disabled && pressed ? pressedBg : baseBg,
|
|
982
|
+
borderColor,
|
|
983
|
+
borderWidth: isSelected ? borderWidth.heavy : borderWidth.default
|
|
984
|
+
}
|
|
985
|
+
],
|
|
986
|
+
children: [
|
|
987
|
+
leading && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.View, { style: styles9.leading, children: leading }),
|
|
988
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native12.View, { style: styles9.text, children: [
|
|
989
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.Text, { style: [description ? typography.labelDefault : typography.bodyDefault, { color: textColor }], children: label }),
|
|
990
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native12.Text, { style: [typography.bodyDefault, { color: descColor }], children: description }) : null
|
|
991
|
+
] }),
|
|
992
|
+
showTrailing && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Trailing, { type, selected: isSelected, disabled })
|
|
993
|
+
]
|
|
994
|
+
}
|
|
995
|
+
);
|
|
996
|
+
}
|
|
997
|
+
var styles9 = import_react_native12.StyleSheet.create({
|
|
998
|
+
card: { width: "100%", flexDirection: "row", alignItems: "center", gap: 12, padding: 16, borderRadius: 20, borderStyle: "solid" },
|
|
999
|
+
leading: { width: 24, height: 24, alignItems: "center", justifyContent: "center" },
|
|
1000
|
+
text: { flex: 1, flexDirection: "column", gap: 4 },
|
|
1001
|
+
indicator: { width: 24, height: 24, alignItems: "center", justifyContent: "center", borderWidth: 2 },
|
|
1002
|
+
checkbox: { borderRadius: 6 },
|
|
1003
|
+
radio: { borderRadius: 12 },
|
|
1004
|
+
dot: { width: 12, height: 12, borderRadius: 6 },
|
|
1005
|
+
check: { width: 12, height: 8, borderLeftWidth: 2, borderBottomWidth: 2, transform: [{ rotate: "-45deg" }, { translateY: -1 }] },
|
|
1006
|
+
caret: { width: 10, height: 10, borderTopWidth: 2, borderRightWidth: 2, transform: [{ rotate: "45deg" }] }
|
|
1007
|
+
});
|
|
1008
|
+
|
|
1009
|
+
// src/components/ListItem/ListItem.native.tsx
|
|
1010
|
+
var import_react_native13 = require("react-native");
|
|
1011
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1012
|
+
function TrailingVisual({ trailing, selected, disabled }) {
|
|
1013
|
+
const { theme } = useTheme();
|
|
1014
|
+
const offColor = disabled ? theme.text.disabled : theme.icon.secondary;
|
|
1015
|
+
const onColor = theme.interactive.selected;
|
|
1016
|
+
if (trailing === "action") {
|
|
1017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native13.View, { style: [styles10.caret, { borderColor: disabled ? theme.text.disabled : theme.icon.secondary }] });
|
|
1018
|
+
}
|
|
1019
|
+
if (trailing === "checkbox") {
|
|
1020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native13.View, { style: [styles10.indicator, styles10.checkbox, { borderColor: selected ? onColor : offColor, backgroundColor: selected ? onColor : "transparent" }], children: selected && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native13.View, { style: [styles10.check, { borderColor: colors.white }] }) });
|
|
1021
|
+
}
|
|
1022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native13.View, { style: [styles10.indicator, styles10.radio, { borderColor: selected ? onColor : offColor }], children: selected && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native13.View, { style: [styles10.dot, { backgroundColor: onColor }] }) });
|
|
1023
|
+
}
|
|
1024
|
+
function ListItem({ trailing = "none", label, description, selected = false, disabled = false, leading, switchValue = false, onSwitchChange, onPress }) {
|
|
1025
|
+
const { theme } = useTheme();
|
|
1026
|
+
const isSelected = trailing === "radio" || trailing === "checkbox" ? selected : false;
|
|
1027
|
+
const textColor = disabled ? theme.text.disabled : theme.text.primary;
|
|
1028
|
+
const descColor = disabled ? theme.text.disabled : theme.text.secondary;
|
|
1029
|
+
const selectedBg = theme.bg.primarySubtle;
|
|
1030
|
+
const selectedPressedBg = theme.bg.primarySubtlePressed;
|
|
1031
|
+
const neutralPressedBg = theme.bg.surfacePressed;
|
|
1032
|
+
const rowStyle = (pressed) => [
|
|
1033
|
+
styles10.row,
|
|
1034
|
+
{ padding: description ? 16 : 10 },
|
|
1035
|
+
isSelected ? { backgroundColor: !disabled && pressed ? selectedPressedBg : selectedBg } : { backgroundColor: !disabled && pressed ? neutralPressedBg : "transparent" }
|
|
1036
|
+
];
|
|
1037
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1038
|
+
leading && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native13.View, { style: styles10.leading, children: leading }),
|
|
1039
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native13.View, { style: styles10.text, children: [
|
|
1040
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native13.Text, { style: [description ? typography.labelDefault : typography.bodyDefault, { color: textColor }], children: label }),
|
|
1041
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native13.Text, { style: [typography.bodyDefault, { color: descColor }], children: description }) : null
|
|
1042
|
+
] }),
|
|
1043
|
+
trailing === "switch" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ToggleSwitch, { size: "sm", value: switchValue, onChange: onSwitchChange, disabled, accessibilityLabel: label }) : trailing !== "none" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TrailingVisual, { trailing, selected: isSelected, disabled }) : null
|
|
1044
|
+
] });
|
|
1045
|
+
if (trailing === "switch" || trailing === "none") {
|
|
1046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native13.View, { style: rowStyle(false), children: content });
|
|
1047
|
+
}
|
|
1048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1049
|
+
import_react_native13.Pressable,
|
|
1050
|
+
{
|
|
1051
|
+
onPress: disabled ? void 0 : onPress,
|
|
1052
|
+
disabled,
|
|
1053
|
+
accessibilityRole: trailing === "radio" ? "radio" : trailing === "checkbox" ? "checkbox" : "button",
|
|
1054
|
+
accessibilityState: { selected: isSelected, checked: isSelected, disabled },
|
|
1055
|
+
style: ({ pressed }) => rowStyle(pressed),
|
|
1056
|
+
children: content
|
|
1057
|
+
}
|
|
1058
|
+
);
|
|
1059
|
+
}
|
|
1060
|
+
var styles10 = import_react_native13.StyleSheet.create({
|
|
1061
|
+
row: { width: "100%", flexDirection: "row", alignItems: "center", gap: 12 },
|
|
1062
|
+
leading: { width: 24, height: 24, alignItems: "center", justifyContent: "center" },
|
|
1063
|
+
text: { flex: 1, flexDirection: "column", gap: 4 },
|
|
1064
|
+
indicator: { width: 24, height: 24, alignItems: "center", justifyContent: "center", borderWidth: 2 },
|
|
1065
|
+
checkbox: { borderRadius: 6 },
|
|
1066
|
+
radio: { borderRadius: 12 },
|
|
1067
|
+
dot: { width: 12, height: 12, borderRadius: 6 },
|
|
1068
|
+
check: { width: 12, height: 8, borderLeftWidth: 2, borderBottomWidth: 2, transform: [{ rotate: "-45deg" }, { translateY: -1 }] },
|
|
1069
|
+
caret: { width: 10, height: 10, borderTopWidth: 2, borderRightWidth: 2, transform: [{ rotate: "45deg" }] }
|
|
1070
|
+
});
|
|
1071
|
+
|
|
1072
|
+
// src/components/Stepper/Stepper.native.tsx
|
|
1073
|
+
var import_react_native14 = require("react-native");
|
|
1074
|
+
|
|
1075
|
+
// src/components/Stepper/Stepper.styles.ts
|
|
1076
|
+
var stepperTokens = {
|
|
1077
|
+
segmentHeight: 4,
|
|
1078
|
+
segmentRadius: radius.full,
|
|
1079
|
+
gap: 4
|
|
1080
|
+
};
|
|
1081
|
+
|
|
1082
|
+
// src/components/Stepper/Stepper.native.tsx
|
|
1083
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1084
|
+
function Stepper({ totalSteps, currentStep, style }) {
|
|
1085
|
+
const { theme } = useTheme();
|
|
1086
|
+
const { segmentHeight, segmentRadius, gap } = stepperTokens;
|
|
1087
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1088
|
+
import_react_native14.View,
|
|
1089
|
+
{
|
|
1090
|
+
style: [{ flexDirection: "row", alignItems: "flex-start", width: "100%", gap }, style],
|
|
1091
|
+
accessibilityRole: "progressbar",
|
|
1092
|
+
accessibilityValue: { min: 1, max: totalSteps, now: currentStep },
|
|
1093
|
+
accessibilityLabel: `Etapa ${currentStep} de ${totalSteps}`,
|
|
1094
|
+
children: Array.from({ length: totalSteps }, (_, i) => {
|
|
1095
|
+
const color = i < currentStep - 1 ? theme.bg.primary : i === currentStep - 1 ? theme.bg.primarySubtle : theme.bg.disabled;
|
|
1096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native14.View, { style: { flex: 1, height: segmentHeight, borderRadius: segmentRadius, backgroundColor: color } }, i);
|
|
1097
|
+
})
|
|
1098
|
+
}
|
|
1099
|
+
);
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
// src/components/RatingScale/RatingScale.native.tsx
|
|
1103
|
+
var import_react_native15 = require("react-native");
|
|
1104
|
+
|
|
1105
|
+
// src/components/RatingScale/RatingScale.styles.ts
|
|
1106
|
+
var ratingScaleTokens = {
|
|
1107
|
+
itemWidth: 60,
|
|
1108
|
+
circleSize: 60,
|
|
1109
|
+
circleRadius: 30,
|
|
1110
|
+
emojiFontSize: 28,
|
|
1111
|
+
emojiLineHeight: 34,
|
|
1112
|
+
itemGap: 6
|
|
1113
|
+
};
|
|
1114
|
+
var DEFAULT_OPTIONS = [
|
|
1115
|
+
{ emoji: "\u{1F621}", label: "P\xE9ssimo" },
|
|
1116
|
+
{ emoji: "\u{1F615}", label: "Ruim" },
|
|
1117
|
+
{ emoji: "\u{1F610}", label: "Neutro" },
|
|
1118
|
+
{ emoji: "\u{1F60A}", label: "Bom" },
|
|
1119
|
+
{ emoji: "\u{1F60D}", label: "\xD3timo" }
|
|
1120
|
+
];
|
|
1121
|
+
|
|
1122
|
+
// src/components/RatingScale/RatingScale.native.tsx
|
|
1123
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1124
|
+
function RatingScale({ value = null, onChange, options = DEFAULT_OPTIONS, disabled = false, style }) {
|
|
1125
|
+
const { theme } = useTheme();
|
|
1126
|
+
const { circleSize, circleRadius, emojiFontSize, emojiLineHeight, itemGap } = ratingScaleTokens;
|
|
1127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native15.View, { style: [styles11.container, style], children: options.map((option, index) => {
|
|
1128
|
+
const itemValue = index + 1;
|
|
1129
|
+
const selected = value === itemValue;
|
|
1130
|
+
const circleBg = disabled ? theme.bg.disabled : selected ? theme.bg.primarySubtle : theme.bg.surface;
|
|
1131
|
+
const circleBorderColor = disabled ? theme.border.disabled : selected ? theme.border.strong : theme.border.default;
|
|
1132
|
+
const labelColor = disabled ? theme.text.disabled : theme.text.primary;
|
|
1133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1134
|
+
import_react_native15.Pressable,
|
|
1135
|
+
{
|
|
1136
|
+
onPress: disabled ? void 0 : () => onChange?.(itemValue),
|
|
1137
|
+
disabled,
|
|
1138
|
+
style: [styles11.item, { gap: itemGap }],
|
|
1139
|
+
accessibilityRole: "radio",
|
|
1140
|
+
accessibilityState: { selected, disabled },
|
|
1141
|
+
children: [
|
|
1142
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1143
|
+
import_react_native15.View,
|
|
1144
|
+
{
|
|
1145
|
+
style: [
|
|
1146
|
+
styles11.circle,
|
|
1147
|
+
{
|
|
1148
|
+
width: circleSize,
|
|
1149
|
+
height: circleSize,
|
|
1150
|
+
borderRadius: circleRadius,
|
|
1151
|
+
backgroundColor: circleBg,
|
|
1152
|
+
borderWidth: selected ? borderWidth.heavy : borderWidth.default,
|
|
1153
|
+
borderColor: circleBorderColor
|
|
1154
|
+
}
|
|
1155
|
+
],
|
|
1156
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native15.Text, { style: [styles11.emoji, { fontSize: emojiFontSize, lineHeight: emojiLineHeight, opacity: disabled ? 0.4 : 1 }], children: option.emoji })
|
|
1157
|
+
}
|
|
1158
|
+
),
|
|
1159
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native15.Text, { style: [typography.caption, styles11.label, { color: labelColor }], children: option.label }),
|
|
1160
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native15.Text, { style: [styles11.number, { color: theme.text.disabled }], children: itemValue })
|
|
1161
|
+
]
|
|
1162
|
+
},
|
|
1163
|
+
itemValue
|
|
1164
|
+
);
|
|
1165
|
+
}) });
|
|
1166
|
+
}
|
|
1167
|
+
var styles11 = import_react_native15.StyleSheet.create({
|
|
1168
|
+
container: { flexDirection: "row", alignItems: "center", justifyContent: "center", gap: 8, padding: 16 },
|
|
1169
|
+
item: { flex: 1, alignItems: "center" },
|
|
1170
|
+
circle: { alignItems: "center", justifyContent: "center", overflow: "hidden" },
|
|
1171
|
+
emoji: { textAlign: "center" },
|
|
1172
|
+
label: { textAlign: "center" },
|
|
1173
|
+
number: { textAlign: "center", fontFamily: "Inter", fontSize: 10, fontWeight: "600", letterSpacing: 0.8 }
|
|
1174
|
+
});
|
|
101
1175
|
// Annotate the CommonJS export names for ESM import in node:
|
|
102
1176
|
0 && (module.exports = {
|
|
1177
|
+
Alert,
|
|
1178
|
+
Button,
|
|
1179
|
+
ButtonIcon,
|
|
1180
|
+
Checkbox,
|
|
1181
|
+
Chip,
|
|
1182
|
+
ChoiceCard,
|
|
1183
|
+
DSThemeProvider,
|
|
1184
|
+
DismissButton,
|
|
1185
|
+
Input,
|
|
1186
|
+
InputField,
|
|
1187
|
+
ListItem,
|
|
1188
|
+
ProgressBar,
|
|
1189
|
+
RadioGroup,
|
|
1190
|
+
RatingScale,
|
|
1191
|
+
Stepper,
|
|
1192
|
+
ToggleSwitch,
|
|
1193
|
+
borderWidth,
|
|
103
1194
|
colors,
|
|
104
1195
|
darkTheme,
|
|
105
|
-
|
|
1196
|
+
grid,
|
|
1197
|
+
lightTheme,
|
|
1198
|
+
opacity,
|
|
1199
|
+
radius,
|
|
1200
|
+
shadow,
|
|
1201
|
+
spacing,
|
|
1202
|
+
typography,
|
|
1203
|
+
useTheme
|
|
106
1204
|
});
|
|
107
1205
|
//# sourceMappingURL=index.native.js.map
|