@utilitywarehouse/hearth-react-native 0.15.2 → 0.16.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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +1 -3
- package/CHANGELOG.md +75 -6
- package/build/components/BottomSheet/BottomSheetScrollView.js +2 -0
- package/build/components/Checkbox/CheckboxGroup.d.ts +1 -1
- package/build/components/Checkbox/CheckboxGroup.js +2 -2
- package/build/components/Checkbox/CheckboxGroup.props.d.ts +2 -1
- package/build/components/Checkbox/CheckboxTileRoot.js +3 -0
- package/build/components/CurrencyInput/CurrencyInput.d.ts +1 -1
- package/build/components/CurrencyInput/CurrencyInput.js +2 -6
- package/build/components/CurrencyInput/CurrencyInput.props.d.ts +6 -0
- package/build/components/DateInput/DateInputSegment.js +0 -1
- package/build/components/DatePickerInput/DatePickerInput.d.ts +1 -1
- package/build/components/DatePickerInput/DatePickerInput.js +2 -2
- package/build/components/DatePickerInput/DatePickerInput.props.d.ts +6 -0
- package/build/components/FormField/FormField.context.d.ts +8 -2
- package/build/components/FormField/FormField.d.ts +1 -1
- package/build/components/FormField/FormField.js +24 -4
- package/build/components/FormField/FormField.props.d.ts +2 -0
- package/build/components/FormField/FormFieldLabel.d.ts +1 -1
- package/build/components/FormField/FormFieldLabel.js +3 -3
- package/build/components/FormField/FormFieldValid.js +2 -2
- package/build/components/Input/Input.js +48 -10
- package/build/components/Input/Input.props.d.ts +7 -1
- package/build/components/Label/Label.d.ts +1 -1
- package/build/components/Label/Label.js +5 -1
- package/build/components/Label/Label.props.d.ts +3 -2
- package/build/components/Modal/Modal.js +9 -0
- package/build/components/Radio/RadioGroup.d.ts +1 -1
- package/build/components/Radio/RadioGroup.js +2 -2
- package/build/components/Radio/RadioGroup.props.d.ts +1 -0
- package/build/components/RadioCard/RadioCard.d.ts +1 -1
- package/build/components/RadioCard/RadioCard.js +2 -2
- package/build/components/RadioCard/RadioCard.props.d.ts +1 -0
- package/build/components/Select/Select.d.ts +1 -1
- package/build/components/Select/Select.js +2 -2
- package/build/components/Select/Select.props.d.ts +10 -0
- package/build/components/Textarea/Textarea.d.ts +1 -1
- package/build/components/Textarea/Textarea.js +43 -6
- package/build/components/Textarea/Textarea.props.d.ts +8 -0
- package/build/components/VerificationInput/VerificationInput.d.ts +1 -1
- package/build/components/VerificationInput/VerificationInput.js +2 -2
- package/build/components/VerificationInput/VerificationInput.props.d.ts +4 -0
- package/docs/components/AllComponents.web.tsx +8 -5
- package/docs/theme-tokens.mdx +390 -2
- package/package.json +2 -2
- package/src/components/BottomSheet/BottomSheetScrollView.tsx +2 -0
- package/src/components/Checkbox/Checkbox.docs.mdx +32 -31
- package/src/components/Checkbox/CheckboxGroup.props.ts +2 -1
- package/src/components/Checkbox/CheckboxGroup.tsx +6 -1
- package/src/components/Checkbox/CheckboxTileRoot.tsx +3 -0
- package/src/components/CurrencyInput/CurrencyInput.docs.mdx +52 -9
- package/src/components/CurrencyInput/CurrencyInput.props.ts +6 -0
- package/src/components/CurrencyInput/CurrencyInput.stories.tsx +30 -1
- package/src/components/CurrencyInput/CurrencyInput.tsx +16 -8
- package/src/components/DateInput/DateInputSegment.tsx +0 -1
- package/src/components/DatePickerInput/DatePickerInput.docs.mdx +22 -0
- package/src/components/DatePickerInput/DatePickerInput.props.ts +6 -0
- package/src/components/DatePickerInput/DatePickerInput.tsx +17 -3
- package/src/components/FormField/FormField.context.ts +6 -1
- package/src/components/FormField/FormField.docs.mdx +30 -30
- package/src/components/FormField/FormField.props.ts +2 -0
- package/src/components/FormField/FormField.stories.tsx +8 -2
- package/src/components/FormField/FormField.tsx +38 -4
- package/src/components/FormField/FormFieldLabel.tsx +7 -3
- package/src/components/FormField/FormFieldValid.tsx +2 -2
- package/src/components/Input/Input.docs.mdx +67 -22
- package/src/components/Input/Input.props.ts +7 -1
- package/src/components/Input/Input.stories.tsx +9 -1
- package/src/components/Input/Input.tsx +124 -59
- package/src/components/Label/Label.props.ts +3 -2
- package/src/components/Label/Label.tsx +11 -1
- package/src/components/Modal/Modal.tsx +9 -0
- package/src/components/Radio/Radio.docs.mdx +31 -30
- package/src/components/Radio/RadioGroup.props.ts +1 -0
- package/src/components/Radio/RadioGroup.stories.tsx +6 -0
- package/src/components/Radio/RadioGroup.tsx +6 -1
- package/src/components/RadioCard/RadioCard.docs.mdx +31 -30
- package/src/components/RadioCard/RadioCard.props.ts +1 -0
- package/src/components/RadioCard/RadioCard.tsx +8 -2
- package/src/components/Select/Select.props.ts +10 -0
- package/src/components/Select/Select.tsx +3 -2
- package/src/components/Textarea/Textarea.docs.mdx +65 -17
- package/src/components/Textarea/Textarea.props.ts +8 -0
- package/src/components/Textarea/Textarea.stories.tsx +23 -2
- package/src/components/Textarea/Textarea.tsx +84 -19
- package/src/components/VerificationInput/VerificationInput.docs.mdx +1 -0
- package/src/components/VerificationInput/VerificationInput.props.ts +4 -1
- package/src/components/VerificationInput/VerificationInput.tsx +2 -0
package/docs/theme-tokens.mdx
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { Meta } from '@storybook/addon-docs/blocks';
|
|
1
|
+
import { ColorItem, ColorPalette, Meta } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import { color } from '@utilitywarehouse/hearth-tokens/js';
|
|
3
|
+
import { Box, Link } from '../src/components';
|
|
2
4
|
import { BackToTopButton, NextPrevPage } from './components';
|
|
3
5
|
|
|
4
6
|
<Meta title="Theme Tokens" />
|
|
@@ -13,7 +15,10 @@ Hearth React Native provides a comprehensive set of design tokens that ensure co
|
|
|
13
15
|
- [Colors](#colors)
|
|
14
16
|
- [Brand and Service Colors](#brand-and-service-colors)
|
|
15
17
|
- [Semantic Colors](#semantic-colors)
|
|
18
|
+
- [Light Theme Colors](#light-theme-colors)
|
|
19
|
+
- [Dark Theme Colors](#dark-theme-colors)
|
|
16
20
|
- [Primitive Color Palette](#primitive-color-palette)
|
|
21
|
+
- [Color Scales](#color-scales)
|
|
17
22
|
- [Typography](#typography)
|
|
18
23
|
- [Font Family](#font-family)
|
|
19
24
|
- [Font Size](#font-size)
|
|
@@ -111,7 +116,52 @@ const styles = StyleSheet.create(theme => ({
|
|
|
111
116
|
|
|
112
117
|
The color system provides both semantic and primitive color tokens that automatically adapt to light and dark themes.
|
|
113
118
|
|
|
114
|
-
You can view the full color
|
|
119
|
+
You can view the full color scales below.
|
|
120
|
+
|
|
121
|
+
<Box
|
|
122
|
+
style={{
|
|
123
|
+
position: 'sticky',
|
|
124
|
+
top: 0,
|
|
125
|
+
width: 240,
|
|
126
|
+
padding: 8,
|
|
127
|
+
height: 16,
|
|
128
|
+
overflow: 'visible',
|
|
129
|
+
marginLeft: '-260px !important',
|
|
130
|
+
zIndex: 1,
|
|
131
|
+
}}
|
|
132
|
+
>
|
|
133
|
+
<ul
|
|
134
|
+
style={{
|
|
135
|
+
listStyleType: 'none',
|
|
136
|
+
paddingLeft: 0,
|
|
137
|
+
marginLeft: 0,
|
|
138
|
+
}}
|
|
139
|
+
>
|
|
140
|
+
<li>[Colors](#colors)</li>
|
|
141
|
+
<ul style={{ marginTop: 0, marginBottom: 0 }}>
|
|
142
|
+
<li>[Brand and Service Colors](#brand-and-service-colors)</li>
|
|
143
|
+
<li>[Semantic Colors](#semantic-colors)</li>
|
|
144
|
+
<li>[Light Theme Colors](#light-theme-colors)</li>
|
|
145
|
+
<li>[Dark Theme Colors](#dark-theme-colors)</li>
|
|
146
|
+
<li>[Primitive Color Palette](#primitive-color-palette)</li>
|
|
147
|
+
<li>[Color Scales](#color-scales)</li>
|
|
148
|
+
</ul>
|
|
149
|
+
<li>[Typography](#typography)</li>
|
|
150
|
+
<ul style={{ marginTop: 0, marginBottom: 0 }}>
|
|
151
|
+
<li>[Font Family](#font-family)</li>
|
|
152
|
+
<li>[Font Size](#font-size)</li>
|
|
153
|
+
<li>[Font Weight](#font-weight)</li>
|
|
154
|
+
<li>[Letter Spacing](#letter-spacing)</li>
|
|
155
|
+
<li>[Line Height](#line-height)</li>
|
|
156
|
+
</ul>
|
|
157
|
+
<li>[Spacing](#spacing)</li>
|
|
158
|
+
<li>[Border](#border)</li>
|
|
159
|
+
<ul style={{ marginTop: 0, marginBottom: 0 }}>
|
|
160
|
+
<li>[Border Width](#border-width)</li>
|
|
161
|
+
<li>[Border Radius](#border-radius)</li>
|
|
162
|
+
</ul>
|
|
163
|
+
</ul>
|
|
164
|
+
</Box>
|
|
115
165
|
|
|
116
166
|
### Brand and Service Colors
|
|
117
167
|
|
|
@@ -245,6 +295,296 @@ const styles = StyleSheet.create(theme => ({
|
|
|
245
295
|
}));
|
|
246
296
|
```
|
|
247
297
|
|
|
298
|
+
#### Light Theme Colors
|
|
299
|
+
|
|
300
|
+
<ColorPalette>
|
|
301
|
+
<ColorItem
|
|
302
|
+
title="Background"
|
|
303
|
+
subtitle="Background colors"
|
|
304
|
+
colors={{
|
|
305
|
+
'background.brand': color.light.background.brand,
|
|
306
|
+
'background.primary': color.light.background.primary,
|
|
307
|
+
'background.secondary': color.light.background.secondary,
|
|
308
|
+
}}
|
|
309
|
+
/>
|
|
310
|
+
<ColorItem
|
|
311
|
+
title="Text"
|
|
312
|
+
subtitle="Text colors"
|
|
313
|
+
colors={{
|
|
314
|
+
'text.primary': color.light.text.primary,
|
|
315
|
+
'text.secondary': color.light.text.secondary,
|
|
316
|
+
'text.inverted': color.light.text.inverted,
|
|
317
|
+
}}
|
|
318
|
+
/>
|
|
319
|
+
<ColorItem
|
|
320
|
+
title="Border"
|
|
321
|
+
subtitle="Border colors"
|
|
322
|
+
colors={{
|
|
323
|
+
'border.strong': color.light.border.strong,
|
|
324
|
+
'border.subtle': color.light.border.subtle,
|
|
325
|
+
}}
|
|
326
|
+
/>
|
|
327
|
+
<ColorItem
|
|
328
|
+
title="Focus"
|
|
329
|
+
subtitle="Focus indicator colors"
|
|
330
|
+
colors={{
|
|
331
|
+
'focus.primary': color.light.focus.primary,
|
|
332
|
+
'focus.inverted': color.light.focus.inverted,
|
|
333
|
+
}}
|
|
334
|
+
/>
|
|
335
|
+
<ColorItem
|
|
336
|
+
title="Feedback - Danger"
|
|
337
|
+
subtitle="Error and danger states"
|
|
338
|
+
colors={{
|
|
339
|
+
'feedback.danger.\nsurface.default': color.light.feedback.danger.surface.default,
|
|
340
|
+
'feedback.danger.\nsurface.subtle': color.light.feedback.danger.surface.subtle,
|
|
341
|
+
'feedback.danger.\nborder': color.light.feedback.danger.border,
|
|
342
|
+
}}
|
|
343
|
+
/>
|
|
344
|
+
<ColorItem
|
|
345
|
+
title="Feedback - Functional"
|
|
346
|
+
subtitle="Neutral functional states"
|
|
347
|
+
colors={{
|
|
348
|
+
'feedback.functional.\nsurface.default': color.light.feedback.functional.surface.default,
|
|
349
|
+
'feedback.functional.\nsurface.subtle': color.light.feedback.functional.surface.subtle,
|
|
350
|
+
'feedback.functional.\nborder': color.light.feedback.functional.border,
|
|
351
|
+
}}
|
|
352
|
+
/>
|
|
353
|
+
<ColorItem
|
|
354
|
+
title="Feedback - Info"
|
|
355
|
+
subtitle="Information states"
|
|
356
|
+
colors={{
|
|
357
|
+
'feedback.info.\nsurface.default': color.light.feedback.info.surface.default,
|
|
358
|
+
'feedback.info.\nsurface.subtle': color.light.feedback.info.surface.subtle,
|
|
359
|
+
'feedback.info.\nborder': color.light.feedback.info.border,
|
|
360
|
+
}}
|
|
361
|
+
/>
|
|
362
|
+
<ColorItem
|
|
363
|
+
title="Feedback - Positive"
|
|
364
|
+
subtitle="Success and positive states"
|
|
365
|
+
colors={{
|
|
366
|
+
'feedback.positive.\nsurface.default': color.light.feedback.positive.surface.default,
|
|
367
|
+
'feedback.positive.\nsurface.subtle': color.light.feedback.positive.surface.subtle,
|
|
368
|
+
'feedback.positive.\nborder': color.light.feedback.positive.border,
|
|
369
|
+
}}
|
|
370
|
+
/>
|
|
371
|
+
<ColorItem
|
|
372
|
+
title="Feedback - Warning"
|
|
373
|
+
subtitle="Warning and caution states"
|
|
374
|
+
colors={{
|
|
375
|
+
'feedback.warning.\nsurface.default': color.light.feedback.warning.surface.default,
|
|
376
|
+
'feedback.warning.\nsurface.subtle': color.light.feedback.warning.surface.subtle,
|
|
377
|
+
'feedback.warning.\nborder': color.light.feedback.warning.border,
|
|
378
|
+
}}
|
|
379
|
+
/>
|
|
380
|
+
<ColorItem
|
|
381
|
+
title="Surface - Brand"
|
|
382
|
+
subtitle="Brand surface colors"
|
|
383
|
+
colors={{
|
|
384
|
+
'surface.brand.default': color.light.surface.brand.default,
|
|
385
|
+
'surface.brand.strong': color.light.surface.brand.strong,
|
|
386
|
+
'surface.brand.subtle': color.light.surface.brand.subtle,
|
|
387
|
+
}}
|
|
388
|
+
/>
|
|
389
|
+
<ColorItem
|
|
390
|
+
title="Surface - Service Colors"
|
|
391
|
+
subtitle="Service-specific surface colors"
|
|
392
|
+
colors={{
|
|
393
|
+
'surface.\nbroadband.default': color.light.surface.broadband.default,
|
|
394
|
+
'surface.\nbroadband.subtle': color.light.surface.broadband.subtle,
|
|
395
|
+
'surface.\ncashback.default': color.light.surface.cashback.default,
|
|
396
|
+
'surface.\ncashback.subtle': color.light.surface.cashback.subtle,
|
|
397
|
+
'surface.\nenergy.default': color.light.surface.energy.default,
|
|
398
|
+
'surface.\nenergy.subtle': color.light.surface.energy.subtle,
|
|
399
|
+
}}
|
|
400
|
+
/>
|
|
401
|
+
<ColorItem
|
|
402
|
+
title="Surface - Other Services"
|
|
403
|
+
subtitle="Additional service surface colors"
|
|
404
|
+
colors={{
|
|
405
|
+
'surface.\nhighlight.default': color.light.surface.highlight.default,
|
|
406
|
+
'surface.\nhighlight.subtle': color.light.surface.highlight.subtle,
|
|
407
|
+
'surface.\ninsurance.default': color.light.surface.insurance.default,
|
|
408
|
+
'surface.\ninsurance.subtle': color.light.surface.insurance.subtle,
|
|
409
|
+
'surface.\nmobile.default': color.light.surface.mobile.default,
|
|
410
|
+
'surface.\nmobile.subtle': color.light.surface.mobile.subtle,
|
|
411
|
+
}}
|
|
412
|
+
/>
|
|
413
|
+
<ColorItem
|
|
414
|
+
title="Surface - Pig"
|
|
415
|
+
subtitle="Pig service surface colors"
|
|
416
|
+
colors={{
|
|
417
|
+
'surface.pig.default': color.light.surface.pig.default,
|
|
418
|
+
'surface.pig.subtle': color.light.surface.pig.subtle,
|
|
419
|
+
}}
|
|
420
|
+
/>
|
|
421
|
+
<ColorItem
|
|
422
|
+
title="Shadow Colors"
|
|
423
|
+
subtitle="Shadow and elevation colors"
|
|
424
|
+
colors={{
|
|
425
|
+
'shadow.default': color.light.shadow.default,
|
|
426
|
+
'shadow.brand': color.light.shadow.brand,
|
|
427
|
+
'shadow.broadband': color.light.shadow.broadband,
|
|
428
|
+
'shadow.cashback': color.light.shadow.cashback,
|
|
429
|
+
'shadow.energy': color.light.shadow.energy,
|
|
430
|
+
'shadow.insurance': color.light.shadow.insurance,
|
|
431
|
+
}}
|
|
432
|
+
/>
|
|
433
|
+
<ColorItem
|
|
434
|
+
title="Shadow Colors (Cont.)"
|
|
435
|
+
subtitle="Additional shadow colors"
|
|
436
|
+
colors={{
|
|
437
|
+
'shadow.mobile': color.light.shadow.mobile,
|
|
438
|
+
'shadow.pig': color.light.shadow.pig,
|
|
439
|
+
}}
|
|
440
|
+
/>
|
|
441
|
+
</ColorPalette>
|
|
442
|
+
|
|
443
|
+
#### Dark Theme Colors
|
|
444
|
+
|
|
445
|
+
<ColorPalette>
|
|
446
|
+
<ColorItem
|
|
447
|
+
title="Background"
|
|
448
|
+
subtitle="Background colors"
|
|
449
|
+
colors={{
|
|
450
|
+
'background.brand': color.dark.background.brand,
|
|
451
|
+
'background.primary': color.dark.background.primary,
|
|
452
|
+
'background.secondary': color.dark.background.secondary,
|
|
453
|
+
}}
|
|
454
|
+
/>
|
|
455
|
+
<ColorItem
|
|
456
|
+
title="Text"
|
|
457
|
+
subtitle="Text colors"
|
|
458
|
+
colors={{
|
|
459
|
+
'text.primary': color.dark.text.primary,
|
|
460
|
+
'text.secondary': color.dark.text.secondary,
|
|
461
|
+
'text.inverted': color.dark.text.inverted,
|
|
462
|
+
}}
|
|
463
|
+
/>
|
|
464
|
+
<ColorItem
|
|
465
|
+
title="Border"
|
|
466
|
+
subtitle="Border colors"
|
|
467
|
+
colors={{
|
|
468
|
+
'border.strong': color.dark.border.strong,
|
|
469
|
+
'border.subtle': color.dark.border.subtle,
|
|
470
|
+
}}
|
|
471
|
+
/>
|
|
472
|
+
<ColorItem
|
|
473
|
+
title="Focus"
|
|
474
|
+
subtitle="Focus indicator colors"
|
|
475
|
+
colors={{
|
|
476
|
+
'focus.primary': color.dark.focus.primary,
|
|
477
|
+
'focus.inverted': color.dark.focus.inverted,
|
|
478
|
+
}}
|
|
479
|
+
/>
|
|
480
|
+
<ColorItem
|
|
481
|
+
title="Feedback - Danger"
|
|
482
|
+
subtitle="Error and danger states"
|
|
483
|
+
colors={{
|
|
484
|
+
'feedback.danger.\nsurface.default': color.dark.feedback.danger.surface.default,
|
|
485
|
+
'feedback.danger.\nsurface.subtle': color.dark.feedback.danger.surface.subtle,
|
|
486
|
+
'feedback.danger.\nborder': color.dark.feedback.danger.border,
|
|
487
|
+
}}
|
|
488
|
+
/>
|
|
489
|
+
<ColorItem
|
|
490
|
+
title="Feedback - Functional"
|
|
491
|
+
subtitle="Neutral functional states"
|
|
492
|
+
colors={{
|
|
493
|
+
'feedback.functional.\nsurface.default': color.dark.feedback.functional.surface.default,
|
|
494
|
+
'feedback.functional.\nsurface.subtle': color.dark.feedback.functional.surface.subtle,
|
|
495
|
+
'feedback.functional.\nborder': color.dark.feedback.functional.border,
|
|
496
|
+
}}
|
|
497
|
+
/>
|
|
498
|
+
<ColorItem
|
|
499
|
+
title="Feedback - Info"
|
|
500
|
+
subtitle="Information states"
|
|
501
|
+
colors={{
|
|
502
|
+
'feedback.info.surface.\ndefault': color.dark.feedback.info.surface.default,
|
|
503
|
+
'feedback.info.surface.\nsubtle': color.dark.feedback.info.surface.subtle,
|
|
504
|
+
'feedback.info.border': color.dark.feedback.info.border,
|
|
505
|
+
}}
|
|
506
|
+
/>
|
|
507
|
+
<ColorItem
|
|
508
|
+
title="Feedback - Positive"
|
|
509
|
+
subtitle="Success and positive states"
|
|
510
|
+
colors={{
|
|
511
|
+
'feedback.positive.\nsurface.default': color.dark.feedback.positive.surface.default,
|
|
512
|
+
'feedback.positive.\nsurface.subtle': color.dark.feedback.positive.surface.subtle,
|
|
513
|
+
'feedback.positive.\nborder': color.dark.feedback.positive.border,
|
|
514
|
+
}}
|
|
515
|
+
/>
|
|
516
|
+
<ColorItem
|
|
517
|
+
title="Feedback - Warning"
|
|
518
|
+
subtitle="Warning and caution states"
|
|
519
|
+
colors={{
|
|
520
|
+
'feedback.warning.\nsurface.default': color.dark.feedback.warning.surface.default,
|
|
521
|
+
'feedback.warning.\nsurface.subtle': color.dark.feedback.warning.surface.subtle,
|
|
522
|
+
'feedback.warning.\nborder': color.dark.feedback.warning.border,
|
|
523
|
+
}}
|
|
524
|
+
/>
|
|
525
|
+
<ColorItem
|
|
526
|
+
title="Surface - Brand"
|
|
527
|
+
subtitle="Brand surface colors"
|
|
528
|
+
colors={{
|
|
529
|
+
'surface.brand.default': color.dark.surface.brand.default,
|
|
530
|
+
'surface.brand.strong': color.dark.surface.brand.strong,
|
|
531
|
+
'surface.brand.subtle': color.dark.surface.brand.subtle,
|
|
532
|
+
}}
|
|
533
|
+
/>
|
|
534
|
+
<ColorItem
|
|
535
|
+
title="Surface - Service Colors"
|
|
536
|
+
subtitle="Service-specific surface colors"
|
|
537
|
+
colors={{
|
|
538
|
+
'surface.\nbroadband.default': color.dark.surface.broadband.default,
|
|
539
|
+
'surface.\nbroadband.subtle': color.dark.surface.broadband.subtle,
|
|
540
|
+
'surface.\ncashback.default': color.dark.surface.cashback.default,
|
|
541
|
+
'surface.\ncashback.subtle': color.dark.surface.cashback.subtle,
|
|
542
|
+
'surface.\nenergy.default': color.dark.surface.energy.default,
|
|
543
|
+
'surface.\nenergy.subtle': color.dark.surface.energy.subtle,
|
|
544
|
+
}}
|
|
545
|
+
/>
|
|
546
|
+
<ColorItem
|
|
547
|
+
title="Surface - Other Services"
|
|
548
|
+
subtitle="Additional service surface colors"
|
|
549
|
+
colors={{
|
|
550
|
+
'surface.\nhighlight.default': color.dark.surface.highlight.default,
|
|
551
|
+
'surface.\nhighlight.subtle': color.dark.surface.highlight.subtle,
|
|
552
|
+
'surface.\ninsurance.default': color.dark.surface.insurance.default,
|
|
553
|
+
'surface.\ninsurance.subtle': color.dark.surface.insurance.subtle,
|
|
554
|
+
'surface.\nmobile.default': color.dark.surface.mobile.default,
|
|
555
|
+
'surface.\nmobile.subtle': color.dark.surface.mobile.subtle,
|
|
556
|
+
}}
|
|
557
|
+
/>
|
|
558
|
+
<ColorItem
|
|
559
|
+
title="Surface - Pig"
|
|
560
|
+
subtitle="Pig service surface colors"
|
|
561
|
+
colors={{
|
|
562
|
+
'surface.pig.default': color.dark.surface.pig.default,
|
|
563
|
+
'surface.pig.subtle': color.dark.surface.pig.subtle,
|
|
564
|
+
}}
|
|
565
|
+
/>
|
|
566
|
+
<ColorItem
|
|
567
|
+
title="Shadow Colors"
|
|
568
|
+
subtitle="Shadow and elevation colors"
|
|
569
|
+
colors={{
|
|
570
|
+
'shadow.default': color.dark.shadow.default,
|
|
571
|
+
'shadow.brand': color.dark.shadow.brand,
|
|
572
|
+
'shadow.broadband': color.dark.shadow.broadband,
|
|
573
|
+
'shadow.cashback': color.dark.shadow.cashback,
|
|
574
|
+
'shadow.energy': color.dark.shadow.energy,
|
|
575
|
+
'shadow.insurance': color.dark.shadow.insurance,
|
|
576
|
+
}}
|
|
577
|
+
/>
|
|
578
|
+
<ColorItem
|
|
579
|
+
title="Shadow Colors (Cont.)"
|
|
580
|
+
subtitle="Additional shadow colors"
|
|
581
|
+
colors={{
|
|
582
|
+
'shadow.mobile': color.dark.shadow.mobile,
|
|
583
|
+
'shadow.pig': color.dark.shadow.pig,
|
|
584
|
+
}}
|
|
585
|
+
/>
|
|
586
|
+
</ColorPalette>
|
|
587
|
+
|
|
248
588
|
### Primitive Color Palette
|
|
249
589
|
|
|
250
590
|
Access the full primitive color palette for custom use cases:
|
|
@@ -266,6 +606,54 @@ Available primitive colors with full scales (0-1000):
|
|
|
266
606
|
- `broadbandGreen`, `energyBlue`, `mobileRose`
|
|
267
607
|
- `insuranceOrange`, `cashbackLilac`, `piggyPink`
|
|
268
608
|
|
|
609
|
+
#### Color Scales
|
|
610
|
+
|
|
611
|
+
<ColorPalette>
|
|
612
|
+
{Object.keys(color)
|
|
613
|
+
.filter(key => !['light', 'dark'].includes(key))
|
|
614
|
+
.map(key => (
|
|
615
|
+
<>
|
|
616
|
+
<ColorItem
|
|
617
|
+
key={`${key}-1`}
|
|
618
|
+
title={key}
|
|
619
|
+
subtitle={`${key}`}
|
|
620
|
+
colors={Object.keys(color[key])
|
|
621
|
+
.slice(0, 6)
|
|
622
|
+
.reduce((acc, subKey) => {
|
|
623
|
+
acc[subKey] = color[key][subKey];
|
|
624
|
+
return acc;
|
|
625
|
+
}, {})}
|
|
626
|
+
/>
|
|
627
|
+
{Object.keys(color[key]).length > 6 && (
|
|
628
|
+
<ColorItem
|
|
629
|
+
key={`${key}-2`}
|
|
630
|
+
title=""
|
|
631
|
+
subtitle=""
|
|
632
|
+
colors={Object.keys(color[key])
|
|
633
|
+
.slice(6, 12)
|
|
634
|
+
.reduce((acc, subKey) => {
|
|
635
|
+
acc[subKey] = color[key][subKey];
|
|
636
|
+
return acc;
|
|
637
|
+
}, {})}
|
|
638
|
+
/>
|
|
639
|
+
)}
|
|
640
|
+
{Object.keys(color[key]).length > 12 && (
|
|
641
|
+
<ColorItem
|
|
642
|
+
key={`${key}-3`}
|
|
643
|
+
title=""
|
|
644
|
+
subtitle=""
|
|
645
|
+
colors={Object.keys(color[key])
|
|
646
|
+
.slice(12, 18)
|
|
647
|
+
.reduce((acc, subKey) => {
|
|
648
|
+
acc[subKey] = color[key][subKey];
|
|
649
|
+
return acc;
|
|
650
|
+
}, {})}
|
|
651
|
+
/>
|
|
652
|
+
)}
|
|
653
|
+
</>
|
|
654
|
+
))}
|
|
655
|
+
</ColorPalette>
|
|
656
|
+
|
|
269
657
|
## Typography
|
|
270
658
|
|
|
271
659
|
The typography system provides a cohesive set of font properties based on the design system.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilitywarehouse/hearth-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Utility Warehouse React Native UI library",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"react-native-gesture-handler": "^2.22.0",
|
|
70
70
|
"react-native-reanimated": "3.x || ^4.x",
|
|
71
71
|
"react-native-svg": ">=13.4.0",
|
|
72
|
-
"react-native-unistyles": "
|
|
72
|
+
"react-native-unistyles": ">=3.0.0",
|
|
73
73
|
"react-native-web": ">=0.19"
|
|
74
74
|
},
|
|
75
75
|
"scripts": {
|
|
@@ -34,6 +34,8 @@ const BottomSheetScrollView = ({
|
|
|
34
34
|
const styles = StyleSheet.create((theme, rt) => ({
|
|
35
35
|
container: {
|
|
36
36
|
backgroundColor: theme.color.surface.neutral.strong,
|
|
37
|
+
borderTopLeftRadius: theme.components.bottomSheet.borderTopLeftRadius,
|
|
38
|
+
borderTopRightRadius: theme.components.bottomSheet.borderTopRightRadius,
|
|
37
39
|
},
|
|
38
40
|
contentContainer: {
|
|
39
41
|
paddingHorizontal: theme.components.bottomSheet.padding,
|
|
@@ -76,22 +76,22 @@ const MyComponent = () => {
|
|
|
76
76
|
|
|
77
77
|
## Props
|
|
78
78
|
|
|
79
|
-
| Property | Type | Default
|
|
80
|
-
| -------------------- | ----------------------------------- |
|
|
81
|
-
| `value` | `string` | -
|
|
82
|
-
| `onChange` | `(value: boolean) => void` | -
|
|
83
|
-
| `defaultchecked` | `bool` | `false`
|
|
84
|
-
| `checked` | `bool` | `false`
|
|
85
|
-
| `validationStatus` | `'valid' \| 'invalid' \| 'initial'` | -
|
|
86
|
-
| `disabled` | `bool` | `false`
|
|
87
|
-
| `label` | `string` | -
|
|
88
|
-
| `helperText` | `string` | -
|
|
89
|
-
| `helperIcon` | `React.ComponentType` | -
|
|
90
|
-
| `invalidText` | `string` | -
|
|
91
|
-
| `validText` | `string` | -
|
|
92
|
-
| `showValidationIcon` | `boolean` | `true`
|
|
93
|
-
| `type` | `'default' \| 'tile'` | `default` | The type of the checkbox. |
|
|
94
|
-
| `image` | `ReactNode` | -
|
|
79
|
+
| Property | Type | Default | Description |
|
|
80
|
+
| -------------------- | ----------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------- |
|
|
81
|
+
| `value` | `string` | - | The value to be used in the checkbox input. This is the value that will be returned on form submission. |
|
|
82
|
+
| `onChange` | `(value: boolean) => void` | - | Function called when the state of the checkbox changes. |
|
|
83
|
+
| `defaultchecked` | `bool` | `false` | If true, the checkbox will be initially checked. |
|
|
84
|
+
| `checked` | `bool` | `false` | When true, the checkbox will be checked. You'll need to pass onChange update it's value (since it's now controlled). |
|
|
85
|
+
| `validationStatus` | `'valid' \| 'invalid' \| 'initial'` | - | The validation status of the checkbox. |
|
|
86
|
+
| `disabled` | `bool` | `false` | To manually set disable to the checkbox. |
|
|
87
|
+
| `label` | `string` | - | The label to be displayed next to the checkbox. |
|
|
88
|
+
| `helperText` | `string` | - | The helper text to be displayed below the checkbox. |
|
|
89
|
+
| `helperIcon` | `React.ComponentType` | - | The icon to be displayed next to the helper text. |
|
|
90
|
+
| `invalidText` | `string` | - | The invalid text to be displayed below the checkbox. |
|
|
91
|
+
| `validText` | `string` | - | The valid text to be displayed below the checkbox. |
|
|
92
|
+
| `showValidationIcon` | `boolean` | `true` | Whether to show the validation icon. |
|
|
93
|
+
| `type` | `'default' \| 'tile'` | `'default'` | The type of the checkbox. |
|
|
94
|
+
| `image` | `ReactNode` | - | The image to be displayed next to the label. |
|
|
95
95
|
|
|
96
96
|
## Components
|
|
97
97
|
|
|
@@ -123,21 +123,22 @@ The `CheckboxLabel` component is used to create the label for the checkbox input
|
|
|
123
123
|
|
|
124
124
|
The `CheckboxGroup` component is used to group multiple checkbox inputs together. It inherits all the properties of React Native's `View` component.
|
|
125
125
|
|
|
126
|
-
| Property | Type | Default
|
|
127
|
-
| -------------------- | ----------------------------------- |
|
|
128
|
-
| `value` | string | -
|
|
129
|
-
| `onChange` | function | -
|
|
130
|
-
| `disabled` | bool | -
|
|
131
|
-
| `validationStatus` | `'valid' \| 'invalid' \| 'initial'` | -
|
|
132
|
-
| `label` | `string` | -
|
|
133
|
-
| `
|
|
134
|
-
| `
|
|
135
|
-
| `
|
|
136
|
-
| `
|
|
137
|
-
| `
|
|
138
|
-
| `
|
|
139
|
-
| `
|
|
140
|
-
| `
|
|
126
|
+
| Property | Type | Default | Description |
|
|
127
|
+
| -------------------- | ----------------------------------- | ----------- | ---------------------------------------------------------------------- |
|
|
128
|
+
| `value` | string | - | The value of the checkbox group. |
|
|
129
|
+
| `onChange` | function | - | The callback fired when any children Checkbox is checked or unchecked. |
|
|
130
|
+
| `disabled` | bool | - | To manually set disable to the checkbox group. |
|
|
131
|
+
| `validationStatus` | `'valid' \| 'invalid' \| 'initial'` | - | The validation status of the checkbox group. |
|
|
132
|
+
| `label` | `string` | - | The label to be displayed above the checkbox group. |
|
|
133
|
+
| `labelVariant` | `'heading' \| 'body'` | `'body'` | The variant of the label text. |
|
|
134
|
+
| `helperText` | `string` | - | The helper text to be displayed below the checkbox group. |
|
|
135
|
+
| `helperIcon` | `React.ComponentType` | - | The icon to be displayed next to the helper text. |
|
|
136
|
+
| `invalidText` | `string` | - | The invalid text to be displayed below the checkbox group. |
|
|
137
|
+
| `validText` | `string` | - | The valid text to be displayed below the checkbox group. |
|
|
138
|
+
| `showValidationIcon` | `boolean` | `true` | Whether to show the validation icon. |
|
|
139
|
+
| `type` | `'default' \| 'tile'` | `'default'` | The type of the checkbox group. |
|
|
140
|
+
| `direction` | `'row' \| 'column'` | `'column'` | The direction of the checkbox group. |
|
|
141
|
+
| `gap` | `string` | - | The gap between the checkbox group items. |
|
|
141
142
|
|
|
142
143
|
<UsageWrap>
|
|
143
144
|
<Center>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
-
import { space } from '../../tokens';
|
|
3
2
|
import { ViewProps } from 'react-native';
|
|
3
|
+
import { space } from '../../tokens';
|
|
4
4
|
|
|
5
5
|
interface CheckboxGroupProps extends ViewProps {
|
|
6
6
|
disabled?: boolean;
|
|
@@ -9,6 +9,7 @@ interface CheckboxGroupProps extends ViewProps {
|
|
|
9
9
|
readonly?: boolean;
|
|
10
10
|
validationStatus?: 'valid' | 'invalid' | 'initial';
|
|
11
11
|
label?: string;
|
|
12
|
+
labelVariant?: 'heading' | 'body';
|
|
12
13
|
helperText?: string;
|
|
13
14
|
showValidationIcon?: boolean;
|
|
14
15
|
invalidText?: string;
|
|
@@ -14,6 +14,7 @@ const CheckboxGroup = ({
|
|
|
14
14
|
readonly,
|
|
15
15
|
validationStatus,
|
|
16
16
|
label,
|
|
17
|
+
labelVariant = 'body',
|
|
17
18
|
helperText,
|
|
18
19
|
invalidText,
|
|
19
20
|
validText,
|
|
@@ -50,7 +51,11 @@ const CheckboxGroup = ({
|
|
|
50
51
|
>
|
|
51
52
|
{showHeader && (
|
|
52
53
|
<CheckboxGroupTextContent>
|
|
53
|
-
{!!label &&
|
|
54
|
+
{!!label && (
|
|
55
|
+
<Label disabled={disabled} variant={labelVariant}>
|
|
56
|
+
{label}
|
|
57
|
+
</Label>
|
|
58
|
+
)}
|
|
54
59
|
{!!helperText && <Helper disabled={disabled} icon={helperIcon} text={helperText} />}
|
|
55
60
|
{validationStatus === 'invalid' && !!invalidText && (
|
|
56
61
|
<Helper
|