@kivid/native-components 1.0.0-alpha.1 → 1.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/components/Button/assets/class-variants.js +0 -5
- package/dist/commonjs/components/Button/assets/class-variants.js.map +1 -1
- package/dist/commonjs/components/Button/index.js +11 -5
- package/dist/commonjs/components/Button/index.js.map +1 -1
- package/dist/commonjs/components/Chip/index.js +8 -4
- package/dist/commonjs/components/Chip/index.js.map +1 -1
- package/dist/commonjs/components/HighlightedText/index.js +20 -16
- package/dist/commonjs/components/HighlightedText/index.js.map +1 -1
- package/dist/commonjs/components/InformationStatus/index.js +1 -1
- package/dist/commonjs/components/InputOTP/components/InformationStatus/index.js +4 -4
- package/dist/commonjs/components/InputOTP/components/InformationStatus/index.js.map +1 -1
- package/dist/commonjs/components/InputOTP/enums/index.js +9 -11
- package/dist/commonjs/components/InputOTP/enums/index.js.map +1 -1
- package/dist/commonjs/components/InputOTP/index.js +1 -1
- package/dist/commonjs/components/Seal/index.js +1 -1
- package/dist/commonjs/components/Title/index.js +1 -1
- package/dist/commonjs/components/Toggle/enums/variant.js +8 -8
- package/dist/commonjs/components/Toggle/enums/variant.js.map +1 -1
- package/dist/commonjs/components/Toggle/index.js +2 -2
- package/dist/commonjs/components/Toggle/index.js.map +1 -1
- package/dist/commonjs/components/Typography/assets/class-variants.js +59 -0
- package/dist/commonjs/components/Typography/assets/class-variants.js.map +1 -0
- package/dist/commonjs/components/Typography/index.js +10 -6
- package/dist/commonjs/components/Typography/index.js.map +1 -1
- package/dist/commonjs/components/index.js +97 -9
- package/dist/commonjs/components/index.js.map +1 -1
- package/dist/commonjs/hooks/use-fonts.js +8 -0
- package/dist/commonjs/hooks/use-fonts.js.map +1 -1
- package/dist/commonjs/iconography/Icons/index.js +7 -8
- package/dist/commonjs/iconography/Icons/index.js.map +1 -1
- package/dist/module/components/Button/assets/class-variants.js +0 -5
- package/dist/module/components/Button/assets/class-variants.js.map +1 -1
- package/dist/module/components/Button/index.js +12 -5
- package/dist/module/components/Button/index.js.map +1 -1
- package/dist/module/components/Chip/index.js +9 -5
- package/dist/module/components/Chip/index.js.map +1 -1
- package/dist/module/components/HighlightedText/index.js +20 -16
- package/dist/module/components/HighlightedText/index.js.map +1 -1
- package/dist/module/components/InformationStatus/index.js +1 -1
- package/dist/module/components/InformationStatus/index.js.map +1 -1
- package/dist/module/components/InputOTP/components/InformationStatus/index.js +2 -2
- package/dist/module/components/InputOTP/components/InformationStatus/index.js.map +1 -1
- package/dist/module/components/InputOTP/enums/index.js +8 -1
- package/dist/module/components/InputOTP/enums/index.js.map +1 -1
- package/dist/module/components/InputOTP/index.js +1 -1
- package/dist/module/components/InputOTP/index.js.map +1 -1
- package/dist/module/components/Seal/index.js +1 -1
- package/dist/module/components/Seal/index.js.map +1 -1
- package/dist/module/components/Title/index.js +1 -1
- package/dist/module/components/Title/index.js.map +1 -1
- package/dist/module/components/Toggle/enums/variant.js +7 -7
- package/dist/module/components/Toggle/enums/variant.js.map +1 -1
- package/dist/module/components/Toggle/index.js +3 -3
- package/dist/module/components/Toggle/index.js.map +1 -1
- package/dist/module/components/Typography/assets/class-variants.js +55 -0
- package/dist/module/components/Typography/assets/class-variants.js.map +1 -0
- package/dist/module/components/Typography/index.js +10 -6
- package/dist/module/components/Typography/index.js.map +1 -1
- package/dist/module/components/index.js +8 -0
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/hooks/use-fonts.js +8 -0
- package/dist/module/hooks/use-fonts.js.map +1 -1
- package/dist/module/iconography/Icons/index.js +9 -10
- package/dist/module/iconography/Icons/index.js.map +1 -1
- package/dist/package.json +3 -4
- package/dist/typescript/components/Button/assets/class-variants.d.ts +0 -1
- package/dist/typescript/components/Button/index.d.ts +2 -2
- package/dist/typescript/components/Chip/index.d.ts +2 -1
- package/dist/typescript/components/HighlightedText/index.d.ts +1 -0
- package/dist/typescript/components/HighlightedText/types.d.ts +9 -3
- package/dist/typescript/components/InputOTP/enums/index.d.ts +7 -1
- package/dist/typescript/components/Toggle/enums/variant.d.ts +1 -1
- package/dist/typescript/components/Toggle/types.d.ts +2 -2
- package/dist/typescript/components/Typography/assets/class-variants.d.ts +4 -0
- package/dist/typescript/components/Typography/index.d.ts +3 -3
- package/dist/typescript/components/Typography/types.d.ts +3 -3
- package/dist/typescript/components/index.d.ts +17 -0
- package/dist/typescript/iconography/Icons/index.d.ts +1 -1
- package/package.json +12 -14
- package/src/components/Button/assets/class-variants.ts +0 -5
- package/src/components/Button/index.tsx +25 -7
- package/src/components/Chip/index.tsx +17 -9
- package/src/components/HighlightedText/index.stories.tsx +117 -18
- package/src/components/HighlightedText/index.tsx +36 -16
- package/src/components/HighlightedText/types.ts +9 -3
- package/src/components/InformationStatus/index.tsx +1 -1
- package/src/components/InputOTP/components/InformationStatus/index.tsx +2 -2
- package/src/components/InputOTP/enums/index.ts +7 -1
- package/src/components/InputOTP/index.stories.tsx +13 -4
- package/src/components/InputOTP/index.tsx +1 -1
- package/src/components/Seal/index.tsx +1 -1
- package/src/components/Title/index.stories.tsx +186 -76
- package/src/components/Title/index.tsx +1 -1
- package/src/components/Toggle/enums/variant.ts +1 -1
- package/src/components/Toggle/index.stories.tsx +19 -19
- package/src/components/Toggle/index.tsx +3 -3
- package/src/components/Toggle/types.ts +2 -2
- package/src/components/Typography/assets/class-variants.ts +56 -0
- package/src/components/Typography/index.stories.tsx +117 -159
- package/src/components/Typography/index.tsx +10 -6
- package/src/components/Typography/types.ts +5 -3
- package/src/components/index.ts +27 -0
- package/src/hooks/use-fonts.ts +8 -0
- package/src/iconography/Icons/index.tsx +21 -15
- package/assets/adaptive-icon.png +0 -0
- package/assets/favicon.png +0 -0
- package/assets/fonts/Nunito-Bold.ttf +0 -0
- package/assets/fonts/Nunito-BoldItalic.ttf +0 -0
- package/assets/fonts/Nunito-Italic.ttf +0 -0
- package/assets/fonts/Nunito-Medium.ttf +0 -0
- package/assets/fonts/Nunito-MediumItalic.ttf +0 -0
- package/assets/fonts/Nunito-Regular.ttf +0 -0
- package/assets/fonts/Nunito-SemiBold.ttf +0 -0
- package/assets/fonts/Nunito-SemiBoldItalic.ttf +0 -0
- package/assets/icon.png +0 -0
- package/assets/splash.png +0 -0
- package/dist/commonjs/components/InputOTP/enums/information-status.js +0 -15
- package/dist/commonjs/components/InputOTP/enums/information-status.js.map +0 -1
- package/dist/module/components/InputOTP/enums/information-status.js +0 -11
- package/dist/module/components/InputOTP/enums/information-status.js.map +0 -1
- package/dist/typescript/components/InputOTP/enums/information-status.d.ts +0 -7
- package/src/components/InputOTP/enums/information-status.ts +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react-native";
|
|
2
2
|
import { Title } from "./index";
|
|
3
|
-
import { GradientDocLab200BasicPink } from "@
|
|
3
|
+
import { GradientDocLab200BasicPink } from "@kivid/icons/native";
|
|
4
4
|
|
|
5
5
|
import { View } from "react-native";
|
|
6
6
|
import { HighlightedText } from "../HighlightedText";
|
|
@@ -78,8 +78,12 @@ export const WithCustomIcon: Story = {
|
|
|
78
78
|
<HighlightedText
|
|
79
79
|
text="Custom"
|
|
80
80
|
highlightText="icon"
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
variant="headline_large"
|
|
82
|
+
weight="400"
|
|
83
|
+
highlightedTextProps={{
|
|
84
|
+
variant: "headline_large",
|
|
85
|
+
weight: "700",
|
|
86
|
+
}}
|
|
83
87
|
/>
|
|
84
88
|
</Title>
|
|
85
89
|
</View>
|
|
@@ -102,14 +106,22 @@ export const Large2X: Story = {
|
|
|
102
106
|
<HighlightedText
|
|
103
107
|
text="Sub"
|
|
104
108
|
highlightText="highlight"
|
|
105
|
-
|
|
106
|
-
|
|
109
|
+
variant="headline_large"
|
|
110
|
+
weight="400"
|
|
111
|
+
highlightedTextProps={{
|
|
112
|
+
variant: "headline_large",
|
|
113
|
+
weight: "700",
|
|
114
|
+
}}
|
|
107
115
|
/>
|
|
108
116
|
<HighlightedText
|
|
109
117
|
text="Sub"
|
|
110
118
|
highlightText="highlight"
|
|
111
|
-
|
|
112
|
-
|
|
119
|
+
variant="headline_large"
|
|
120
|
+
weight="400"
|
|
121
|
+
highlightedTextProps={{
|
|
122
|
+
variant: "headline_large",
|
|
123
|
+
weight: "700",
|
|
124
|
+
}}
|
|
113
125
|
/>
|
|
114
126
|
<HighlightedText
|
|
115
127
|
text="Curabitur blandit tempus porttitor."
|
|
@@ -144,7 +156,7 @@ export const Large2X: Story = {
|
|
|
144
156
|
parameters: {
|
|
145
157
|
docs: {
|
|
146
158
|
description: {
|
|
147
|
-
story: "Title 2x large with
|
|
159
|
+
story: "Title 2x large with Heading, subtitle and multiples texts",
|
|
148
160
|
},
|
|
149
161
|
},
|
|
150
162
|
},
|
|
@@ -158,22 +170,34 @@ export const LargeX: Story = {
|
|
|
158
170
|
<HighlightedText
|
|
159
171
|
text="Sub"
|
|
160
172
|
highlightText="highlight"
|
|
161
|
-
|
|
162
|
-
|
|
173
|
+
variant="headline_medium"
|
|
174
|
+
weight="400"
|
|
175
|
+
highlightedTextProps={{
|
|
176
|
+
variant: "headline_medium",
|
|
177
|
+
weight: "700",
|
|
178
|
+
}}
|
|
163
179
|
/>
|
|
164
180
|
<HighlightedText
|
|
165
181
|
text="Sub"
|
|
166
182
|
highlightText="highlight"
|
|
167
|
-
|
|
168
|
-
|
|
183
|
+
variant="headline_medium"
|
|
184
|
+
weight="400"
|
|
185
|
+
highlightedTextProps={{
|
|
186
|
+
variant: "headline_medium",
|
|
187
|
+
weight: "700",
|
|
188
|
+
}}
|
|
169
189
|
/>
|
|
170
190
|
<HighlightedText
|
|
171
191
|
text="Curabitur blandit tempus porttitor."
|
|
172
|
-
|
|
192
|
+
variant="body_medium"
|
|
193
|
+
weight="500"
|
|
194
|
+
className="mt-400"
|
|
173
195
|
/>
|
|
174
196
|
<HighlightedText
|
|
175
197
|
text="Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis."
|
|
176
|
-
|
|
198
|
+
variant="body_medium"
|
|
199
|
+
weight="500"
|
|
200
|
+
className="mt-400"
|
|
177
201
|
/>
|
|
178
202
|
</>
|
|
179
203
|
);
|
|
@@ -200,7 +224,7 @@ export const LargeX: Story = {
|
|
|
200
224
|
parameters: {
|
|
201
225
|
docs: {
|
|
202
226
|
description: {
|
|
203
|
-
story: "Title x large with
|
|
227
|
+
story: "Title x large with Heading, subtitle and multiples texts",
|
|
204
228
|
},
|
|
205
229
|
},
|
|
206
230
|
},
|
|
@@ -214,22 +238,34 @@ export const Large: Story = {
|
|
|
214
238
|
<HighlightedText
|
|
215
239
|
text="Sub"
|
|
216
240
|
highlightText="highlight"
|
|
217
|
-
|
|
218
|
-
|
|
241
|
+
variant="headline_small"
|
|
242
|
+
weight="400"
|
|
243
|
+
highlightedTextProps={{
|
|
244
|
+
variant: "headline_small",
|
|
245
|
+
weight: "700",
|
|
246
|
+
}}
|
|
219
247
|
/>
|
|
220
248
|
<HighlightedText
|
|
221
249
|
text="Sub"
|
|
222
250
|
highlightText="highlight"
|
|
223
|
-
|
|
224
|
-
|
|
251
|
+
variant="headline_small"
|
|
252
|
+
weight="400"
|
|
253
|
+
highlightedTextProps={{
|
|
254
|
+
variant: "headline_small",
|
|
255
|
+
weight: "700",
|
|
256
|
+
}}
|
|
225
257
|
/>
|
|
226
258
|
<HighlightedText
|
|
227
259
|
text="Curabitur blandit tempus porttitor."
|
|
228
|
-
|
|
260
|
+
variant="body_medium"
|
|
261
|
+
weight="500"
|
|
262
|
+
className="mt-400"
|
|
229
263
|
/>
|
|
230
264
|
<HighlightedText
|
|
231
265
|
text="Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis."
|
|
232
|
-
|
|
266
|
+
variant="body_medium"
|
|
267
|
+
weight="500"
|
|
268
|
+
className="mt-400"
|
|
233
269
|
/>
|
|
234
270
|
</>
|
|
235
271
|
);
|
|
@@ -253,7 +289,7 @@ export const Large: Story = {
|
|
|
253
289
|
parameters: {
|
|
254
290
|
docs: {
|
|
255
291
|
description: {
|
|
256
|
-
story: "Title large with
|
|
292
|
+
story: "Title large with Heading, subtitle and multiples texts",
|
|
257
293
|
},
|
|
258
294
|
},
|
|
259
295
|
},
|
|
@@ -267,22 +303,34 @@ export const Medium: Story = {
|
|
|
267
303
|
<HighlightedText
|
|
268
304
|
text="Sub"
|
|
269
305
|
highlightText="highlight"
|
|
270
|
-
|
|
271
|
-
|
|
306
|
+
variant="title_large"
|
|
307
|
+
weight="400"
|
|
308
|
+
highlightedTextProps={{
|
|
309
|
+
variant: "title_large",
|
|
310
|
+
weight: "700",
|
|
311
|
+
}}
|
|
272
312
|
/>
|
|
273
313
|
<HighlightedText
|
|
274
314
|
text="Sub"
|
|
275
315
|
highlightText="highlight"
|
|
276
|
-
|
|
277
|
-
|
|
316
|
+
variant="title_large"
|
|
317
|
+
weight="400"
|
|
318
|
+
highlightedTextProps={{
|
|
319
|
+
variant: "title_large",
|
|
320
|
+
weight: "700",
|
|
321
|
+
}}
|
|
278
322
|
/>
|
|
279
323
|
<HighlightedText
|
|
280
324
|
text="Curabitur blandit tempus porttitor."
|
|
281
|
-
|
|
325
|
+
variant="body_medium"
|
|
326
|
+
weight="500"
|
|
327
|
+
className="mt-400"
|
|
282
328
|
/>
|
|
283
329
|
<HighlightedText
|
|
284
330
|
text="Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis."
|
|
285
|
-
|
|
331
|
+
variant="body_medium"
|
|
332
|
+
weight="500"
|
|
333
|
+
className="mt-400"
|
|
286
334
|
/>
|
|
287
335
|
</>
|
|
288
336
|
);
|
|
@@ -306,7 +354,7 @@ export const Medium: Story = {
|
|
|
306
354
|
parameters: {
|
|
307
355
|
docs: {
|
|
308
356
|
description: {
|
|
309
|
-
story: "Title medium with
|
|
357
|
+
story: "Title medium with Heading, subtitle and multiples texts",
|
|
310
358
|
},
|
|
311
359
|
},
|
|
312
360
|
},
|
|
@@ -320,22 +368,34 @@ export const Small: Story = {
|
|
|
320
368
|
<HighlightedText
|
|
321
369
|
text="Sub"
|
|
322
370
|
highlightText="highlight"
|
|
323
|
-
|
|
324
|
-
|
|
371
|
+
variant="title_medium"
|
|
372
|
+
weight="400"
|
|
373
|
+
highlightedTextProps={{
|
|
374
|
+
variant: "title_medium",
|
|
375
|
+
weight: "700",
|
|
376
|
+
}}
|
|
325
377
|
/>
|
|
326
378
|
<HighlightedText
|
|
327
379
|
text="Sub"
|
|
328
380
|
highlightText="highlight"
|
|
329
|
-
|
|
330
|
-
|
|
381
|
+
variant="title_medium"
|
|
382
|
+
weight="400"
|
|
383
|
+
highlightedTextProps={{
|
|
384
|
+
variant: "title_medium",
|
|
385
|
+
weight: "700",
|
|
386
|
+
}}
|
|
331
387
|
/>
|
|
332
388
|
<HighlightedText
|
|
333
389
|
text="Curabitur blandit tempus porttitor."
|
|
334
|
-
|
|
390
|
+
variant="body_small"
|
|
391
|
+
weight="500"
|
|
392
|
+
className="mt-400"
|
|
335
393
|
/>
|
|
336
394
|
<HighlightedText
|
|
337
395
|
text="Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis."
|
|
338
|
-
|
|
396
|
+
variant="body_small"
|
|
397
|
+
weight="500"
|
|
398
|
+
className="mt-400"
|
|
339
399
|
/>
|
|
340
400
|
</>
|
|
341
401
|
);
|
|
@@ -359,7 +419,7 @@ export const Small: Story = {
|
|
|
359
419
|
parameters: {
|
|
360
420
|
docs: {
|
|
361
421
|
description: {
|
|
362
|
-
story: "Title small with
|
|
422
|
+
story: "Title small with Heading, subtitle and multiples texts",
|
|
363
423
|
},
|
|
364
424
|
},
|
|
365
425
|
},
|
|
@@ -373,22 +433,34 @@ export const XSmall: Story = {
|
|
|
373
433
|
<HighlightedText
|
|
374
434
|
text="Sub"
|
|
375
435
|
highlightText="highlight"
|
|
376
|
-
|
|
377
|
-
|
|
436
|
+
variant="title_small"
|
|
437
|
+
weight="400"
|
|
438
|
+
highlightedTextProps={{
|
|
439
|
+
variant: "title_small",
|
|
440
|
+
weight: "700",
|
|
441
|
+
}}
|
|
378
442
|
/>
|
|
379
443
|
<HighlightedText
|
|
380
444
|
text="Sub"
|
|
381
445
|
highlightText="highlight"
|
|
382
|
-
|
|
383
|
-
|
|
446
|
+
variant="title_small"
|
|
447
|
+
weight="400"
|
|
448
|
+
highlightedTextProps={{
|
|
449
|
+
variant: "title_small",
|
|
450
|
+
weight: "700",
|
|
451
|
+
}}
|
|
384
452
|
/>
|
|
385
453
|
<HighlightedText
|
|
386
454
|
text="Curabitur blandit tempus porttitor."
|
|
387
|
-
|
|
455
|
+
variant="body_small"
|
|
456
|
+
weight="500"
|
|
457
|
+
className="mt-400"
|
|
388
458
|
/>
|
|
389
459
|
<HighlightedText
|
|
390
460
|
text="Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis."
|
|
391
|
-
|
|
461
|
+
variant="body_small"
|
|
462
|
+
weight="500"
|
|
463
|
+
className="mt-400"
|
|
392
464
|
/>
|
|
393
465
|
</>
|
|
394
466
|
);
|
|
@@ -412,7 +484,7 @@ export const XSmall: Story = {
|
|
|
412
484
|
parameters: {
|
|
413
485
|
docs: {
|
|
414
486
|
description: {
|
|
415
|
-
story: "Title x small with
|
|
487
|
+
story: "Title x small with Heading, subtitle and multiples texts",
|
|
416
488
|
},
|
|
417
489
|
},
|
|
418
490
|
},
|
|
@@ -424,42 +496,46 @@ export const MarkerSizesAndVariants: Story = {
|
|
|
424
496
|
<View className="flex flex-column gap-400 mb-700">
|
|
425
497
|
<HighlightedText
|
|
426
498
|
text="Small"
|
|
427
|
-
|
|
499
|
+
variant="label_small"
|
|
500
|
+
weight="700"
|
|
501
|
+
className="text-center"
|
|
428
502
|
/>
|
|
429
503
|
|
|
430
504
|
<View className="flex flex-row gap-300 justify-center">
|
|
431
505
|
<Title head={<Title.Marker color="blackberry" size="small" />}>
|
|
432
506
|
<HighlightedText
|
|
433
507
|
text="Blackberry"
|
|
434
|
-
|
|
508
|
+
variant="label_small"
|
|
509
|
+
weight="700"
|
|
435
510
|
/>
|
|
436
511
|
</Title>
|
|
437
512
|
<Title head={<Title.Marker color="chia" size="small" />}>
|
|
438
|
-
<HighlightedText text="Chia"
|
|
513
|
+
<HighlightedText text="Chia" variant="label_small" weight="700" />
|
|
439
514
|
</Title>
|
|
440
515
|
<Title head={<Title.Marker color="java" size="small" />}>
|
|
441
|
-
<HighlightedText text="Java"
|
|
516
|
+
<HighlightedText text="Java" variant="label_small" weight="700" />
|
|
442
517
|
</Title>
|
|
443
518
|
<Title head={<Title.Marker color="grape" size="small" />}>
|
|
444
|
-
<HighlightedText text="Grape"
|
|
519
|
+
<HighlightedText text="Grape" variant="label_small" weight="700" />
|
|
445
520
|
</Title>
|
|
446
521
|
</View>
|
|
447
522
|
|
|
448
523
|
<View className="flex flex-row gap-300 justify-center">
|
|
449
524
|
<Title head={<Title.Marker color="mango" size="small" />}>
|
|
450
|
-
<HighlightedText text="Mango"
|
|
525
|
+
<HighlightedText text="Mango" variant="label_small" weight="700" />
|
|
451
526
|
</Title>
|
|
452
527
|
<Title head={<Title.Marker color="tangerine" size="small" />}>
|
|
453
528
|
<HighlightedText
|
|
454
529
|
text="Tangerine"
|
|
455
|
-
|
|
530
|
+
variant="label_small"
|
|
531
|
+
weight="700"
|
|
456
532
|
/>
|
|
457
533
|
</Title>
|
|
458
534
|
<Title head={<Title.Marker color="pear" size="small" />}>
|
|
459
|
-
<HighlightedText text="Pear"
|
|
535
|
+
<HighlightedText text="Pear" variant="label_small" weight="700" />
|
|
460
536
|
</Title>
|
|
461
537
|
<Title head={<Title.Marker color="ghost" size="small" />}>
|
|
462
|
-
<HighlightedText text="Ghost"
|
|
538
|
+
<HighlightedText text="Ghost" variant="label_small" weight="700" />
|
|
463
539
|
</Title>
|
|
464
540
|
</View>
|
|
465
541
|
</View>
|
|
@@ -467,42 +543,46 @@ export const MarkerSizesAndVariants: Story = {
|
|
|
467
543
|
<View className="flex flex-column gap-400">
|
|
468
544
|
<HighlightedText
|
|
469
545
|
text="Medium"
|
|
470
|
-
|
|
546
|
+
variant="label_medium"
|
|
547
|
+
weight="700"
|
|
548
|
+
className="text-center"
|
|
471
549
|
/>
|
|
472
550
|
|
|
473
551
|
<View className="flex flex-row gap-300 justify-center">
|
|
474
552
|
<Title head={<Title.Marker color="blackberry" />}>
|
|
475
553
|
<HighlightedText
|
|
476
554
|
text="Blackberry"
|
|
477
|
-
|
|
555
|
+
variant="label_medium"
|
|
556
|
+
weight="700"
|
|
478
557
|
/>
|
|
479
558
|
</Title>
|
|
480
559
|
<Title head={<Title.Marker color="chia" />}>
|
|
481
|
-
<HighlightedText text="Chia"
|
|
560
|
+
<HighlightedText text="Chia" variant="label_medium" weight="700" />
|
|
482
561
|
</Title>
|
|
483
562
|
<Title head={<Title.Marker color="java" />}>
|
|
484
|
-
<HighlightedText text="Java"
|
|
563
|
+
<HighlightedText text="Java" variant="label_medium" weight="700" />
|
|
485
564
|
</Title>
|
|
486
565
|
<Title head={<Title.Marker color="grape" />}>
|
|
487
|
-
<HighlightedText text="Grape"
|
|
566
|
+
<HighlightedText text="Grape" variant="label_medium" weight="700" />
|
|
488
567
|
</Title>
|
|
489
568
|
</View>
|
|
490
569
|
|
|
491
570
|
<View className="flex flex-row gap-300 justify-center">
|
|
492
571
|
<Title head={<Title.Marker color="mango" />}>
|
|
493
|
-
<HighlightedText text="Mango"
|
|
572
|
+
<HighlightedText text="Mango" variant="label_medium" weight="700" />
|
|
494
573
|
</Title>
|
|
495
574
|
<Title head={<Title.Marker color="tangerine" />}>
|
|
496
575
|
<HighlightedText
|
|
497
576
|
text="Tangerine"
|
|
498
|
-
|
|
577
|
+
variant="label_medium"
|
|
578
|
+
weight="700"
|
|
499
579
|
/>
|
|
500
580
|
</Title>
|
|
501
581
|
<Title head={<Title.Marker color="pear" />}>
|
|
502
|
-
<HighlightedText text="Pear"
|
|
582
|
+
<HighlightedText text="Pear" variant="label_medium" weight="700" />
|
|
503
583
|
</Title>
|
|
504
584
|
<Title head={<Title.Marker color="ghost" />}>
|
|
505
|
-
<HighlightedText text="Ghost"
|
|
585
|
+
<HighlightedText text="Ghost" variant="label_medium" weight="700" />
|
|
506
586
|
</Title>
|
|
507
587
|
</View>
|
|
508
588
|
</View>
|
|
@@ -524,27 +604,37 @@ export const IconSizesAndVariants: Story = {
|
|
|
524
604
|
<View className="flex flex-column gap-300 mb-500">
|
|
525
605
|
<HighlightedText
|
|
526
606
|
text="Small"
|
|
527
|
-
|
|
607
|
+
variant="label_small"
|
|
608
|
+
weight="700"
|
|
609
|
+
className="text-center"
|
|
528
610
|
/>
|
|
529
611
|
|
|
530
612
|
<View className="flex flex-row gap-300">
|
|
531
613
|
<Title head={<Title.Icon size="small" variants={IconVariants.ADD} />}>
|
|
532
|
-
<HighlightedText text="add"
|
|
614
|
+
<HighlightedText text="add" variant="label_small" weight="700" />
|
|
533
615
|
</Title>
|
|
534
616
|
<Title
|
|
535
617
|
head={<Title.Icon size="small" variants={IconVariants.WARNING} />}
|
|
536
618
|
>
|
|
537
|
-
<HighlightedText
|
|
619
|
+
<HighlightedText
|
|
620
|
+
text="warning"
|
|
621
|
+
variant="label_small"
|
|
622
|
+
weight="700"
|
|
623
|
+
/>
|
|
538
624
|
</Title>
|
|
539
625
|
<Title
|
|
540
626
|
head={<Title.Icon size="small" variants={IconVariants.ERROR} />}
|
|
541
627
|
>
|
|
542
|
-
<HighlightedText text="error"
|
|
628
|
+
<HighlightedText text="error" variant="label_small" weight="700" />
|
|
543
629
|
</Title>
|
|
544
630
|
<Title
|
|
545
631
|
head={<Title.Icon size="small" variants={IconVariants.SUCCESS} />}
|
|
546
632
|
>
|
|
547
|
-
<HighlightedText
|
|
633
|
+
<HighlightedText
|
|
634
|
+
text="success"
|
|
635
|
+
variant="label_small"
|
|
636
|
+
weight="700"
|
|
637
|
+
/>
|
|
548
638
|
</Title>
|
|
549
639
|
</View>
|
|
550
640
|
</View>
|
|
@@ -552,29 +642,39 @@ export const IconSizesAndVariants: Story = {
|
|
|
552
642
|
<View className="flex flex-column gap-300 mb-500">
|
|
553
643
|
<HighlightedText
|
|
554
644
|
text="Medium"
|
|
555
|
-
|
|
645
|
+
variant="label_medium"
|
|
646
|
+
weight="700"
|
|
647
|
+
className="text-center"
|
|
556
648
|
/>
|
|
557
649
|
|
|
558
650
|
<View className="flex flex-row gap-300">
|
|
559
651
|
<Title
|
|
560
652
|
head={<Title.Icon size="medium" variants={IconVariants.ADD} />}
|
|
561
653
|
>
|
|
562
|
-
<HighlightedText text="add"
|
|
654
|
+
<HighlightedText text="add" variant="label_medium" weight="700" />
|
|
563
655
|
</Title>
|
|
564
656
|
<Title
|
|
565
657
|
head={<Title.Icon size="medium" variants={IconVariants.WARNING} />}
|
|
566
658
|
>
|
|
567
|
-
<HighlightedText
|
|
659
|
+
<HighlightedText
|
|
660
|
+
text="warning"
|
|
661
|
+
variant="label_medium"
|
|
662
|
+
weight="700"
|
|
663
|
+
/>
|
|
568
664
|
</Title>
|
|
569
665
|
<Title
|
|
570
666
|
head={<Title.Icon size="medium" variants={IconVariants.ERROR} />}
|
|
571
667
|
>
|
|
572
|
-
<HighlightedText text="error"
|
|
668
|
+
<HighlightedText text="error" variant="label_medium" weight="700" />
|
|
573
669
|
</Title>
|
|
574
670
|
<Title
|
|
575
671
|
head={<Title.Icon size="medium" variants={IconVariants.SUCCESS} />}
|
|
576
672
|
>
|
|
577
|
-
<HighlightedText
|
|
673
|
+
<HighlightedText
|
|
674
|
+
text="success"
|
|
675
|
+
variant="label_medium"
|
|
676
|
+
weight="700"
|
|
677
|
+
/>
|
|
578
678
|
</Title>
|
|
579
679
|
</View>
|
|
580
680
|
</View>
|
|
@@ -582,27 +682,37 @@ export const IconSizesAndVariants: Story = {
|
|
|
582
682
|
<View className="flex flex-column gap-300 mb-500">
|
|
583
683
|
<HighlightedText
|
|
584
684
|
text="Large"
|
|
585
|
-
|
|
685
|
+
variant="label_large"
|
|
686
|
+
weight="700"
|
|
687
|
+
className="text-center"
|
|
586
688
|
/>
|
|
587
689
|
|
|
588
690
|
<View className="flex flex-row gap-300">
|
|
589
691
|
<Title head={<Title.Icon size="large" variants={IconVariants.ADD} />}>
|
|
590
|
-
<HighlightedText text="add"
|
|
692
|
+
<HighlightedText text="add" variant="label_large" weight="700" />
|
|
591
693
|
</Title>
|
|
592
694
|
<Title
|
|
593
695
|
head={<Title.Icon size="large" variants={IconVariants.WARNING} />}
|
|
594
696
|
>
|
|
595
|
-
<HighlightedText
|
|
697
|
+
<HighlightedText
|
|
698
|
+
text="warning"
|
|
699
|
+
variant="label_large"
|
|
700
|
+
weight="700"
|
|
701
|
+
/>
|
|
596
702
|
</Title>
|
|
597
703
|
<Title
|
|
598
704
|
head={<Title.Icon size="large" variants={IconVariants.ERROR} />}
|
|
599
705
|
>
|
|
600
|
-
<HighlightedText text="error"
|
|
706
|
+
<HighlightedText text="error" variant="label_large" weight="700" />
|
|
601
707
|
</Title>
|
|
602
708
|
<Title
|
|
603
709
|
head={<Title.Icon size="large" variants={IconVariants.SUCCESS} />}
|
|
604
710
|
>
|
|
605
|
-
<HighlightedText
|
|
711
|
+
<HighlightedText
|
|
712
|
+
text="success"
|
|
713
|
+
variant="label_large"
|
|
714
|
+
weight="700"
|
|
715
|
+
/>
|
|
606
716
|
</Title>
|
|
607
717
|
</View>
|
|
608
718
|
</View>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { View } from "react-native";
|
|
2
2
|
import { Icon, Marker } from "./components";
|
|
3
3
|
import type { TitleProps } from "./types";
|
|
4
|
-
import { merge } from "@
|
|
4
|
+
import { merge } from "@kivid/tailwind-preset";
|
|
5
5
|
import { cva } from "class-variance-authority";
|
|
6
6
|
|
|
7
7
|
function Title(props: TitleProps) {
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from
|
|
2
|
-
import { Toggle } from
|
|
3
|
-
import type { ToggleProps } from
|
|
4
|
-
import { useState } from
|
|
5
|
-
import {
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-native";
|
|
2
|
+
import { Toggle } from "./index";
|
|
3
|
+
import type { ToggleProps } from "./types";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { ToggleVariantEnum } from "./enums";
|
|
6
6
|
|
|
7
7
|
const meta: Meta<ToggleProps> = {
|
|
8
|
-
title:
|
|
8
|
+
title: "Components/Toggle",
|
|
9
9
|
component: Toggle,
|
|
10
10
|
parameters: {
|
|
11
|
-
layout:
|
|
11
|
+
layout: "centered",
|
|
12
12
|
},
|
|
13
|
-
tags: [
|
|
13
|
+
tags: ["autodocs"],
|
|
14
14
|
argTypes: {
|
|
15
15
|
checked: {
|
|
16
|
-
control:
|
|
17
|
-
description:
|
|
16
|
+
control: "boolean",
|
|
17
|
+
description: "Whether the toggle is checked",
|
|
18
18
|
},
|
|
19
19
|
disabled: {
|
|
20
|
-
control:
|
|
21
|
-
description:
|
|
20
|
+
control: "boolean",
|
|
21
|
+
description: "Whether the toggle is disabled",
|
|
22
22
|
},
|
|
23
23
|
onChange: {
|
|
24
|
-
action:
|
|
25
|
-
description:
|
|
24
|
+
action: "changed",
|
|
25
|
+
description: "Callback fired when the toggle state changes",
|
|
26
26
|
},
|
|
27
27
|
variant: {
|
|
28
|
-
control:
|
|
29
|
-
options: Object.values(
|
|
30
|
-
description:
|
|
28
|
+
control: "select",
|
|
29
|
+
options: Object.values(ToggleVariantEnum),
|
|
30
|
+
description: "The variant of the toggle",
|
|
31
31
|
table: {
|
|
32
|
-
type: { summary: Object.values(
|
|
32
|
+
type: { summary: Object.values(ToggleVariantEnum).join(" | ") },
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
},
|
|
@@ -85,4 +85,4 @@ export const Interactive: Story = {
|
|
|
85
85
|
/>
|
|
86
86
|
);
|
|
87
87
|
},
|
|
88
|
-
};
|
|
88
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { ToggleProps } from "./types";
|
|
2
2
|
import { Pressable, View } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import { merge } from "@
|
|
3
|
+
import { ToggleVariantEnum } from "./enums";
|
|
4
|
+
import { merge } from "@kivid/tailwind-preset";
|
|
5
5
|
import { toggleVariants } from "./assets/class-variants";
|
|
6
6
|
|
|
7
7
|
export function Toggle(props: ToggleProps) {
|
|
8
8
|
const {
|
|
9
9
|
checked,
|
|
10
10
|
disabled = false,
|
|
11
|
-
variant =
|
|
11
|
+
variant = ToggleVariantEnum.JAVA,
|
|
12
12
|
onChange,
|
|
13
13
|
} = props;
|
|
14
14
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ToggleVariantEnum } from "./enums";
|
|
2
2
|
|
|
3
3
|
export interface ToggleProps {
|
|
4
4
|
checked: boolean;
|
|
5
5
|
disabled?: boolean;
|
|
6
|
-
variant?:
|
|
6
|
+
variant?: ToggleVariantEnum;
|
|
7
7
|
onChange: (checked: boolean) => void;
|
|
8
8
|
}
|