@retray-dev/ui-kit 1.7.0 → 1.8.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/COMPONENTS.md +181 -34
- package/README.md +6 -5
- package/dist/index.d.mts +73 -8
- package/dist/index.d.ts +73 -8
- package/dist/index.js +385 -16
- package/dist/index.mjs +380 -17
- package/package.json +1 -1
- package/src/components/Alert/Alert.tsx +22 -10
- package/src/components/Alert/index.ts +2 -2
- package/src/components/Button/Button.tsx +11 -4
- package/src/components/Chip/Chip.tsx +142 -0
- package/src/components/Chip/index.ts +2 -0
- package/src/components/ConfirmDialog/ConfirmDialog.tsx +87 -0
- package/src/components/ConfirmDialog/index.ts +2 -0
- package/src/components/CurrencyDisplay/CurrencyDisplay.tsx +4 -2
- package/src/components/EmptyState/EmptyState.tsx +40 -6
- package/src/components/LabelValue/LabelValue.tsx +47 -0
- package/src/components/LabelValue/index.ts +2 -0
- package/src/components/ListItem/ListItem.tsx +121 -0
- package/src/components/ListItem/index.ts +2 -0
- package/src/components/MonthPicker/MonthPicker.tsx +92 -0
- package/src/components/MonthPicker/index.ts +2 -0
- package/src/components/Switch/Switch.tsx +4 -2
- package/src/index.ts +5 -0
package/COMPONENTS.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @retray-dev/ui-kit — Component Reference (v1.
|
|
1
|
+
# @retray-dev/ui-kit — Component Reference (v1.8.0)
|
|
2
2
|
|
|
3
3
|
This file is the AI reference for this package. It is shipped inside the npm package so consuming projects can import it into their `CLAUDE.md` with:
|
|
4
4
|
|
|
@@ -76,6 +76,11 @@ function MyComponent() {
|
|
|
76
76
|
|
|
77
77
|
All 20 tokens are available via `useTheme().colors`.
|
|
78
78
|
|
|
79
|
+
The `ThemeColors` type (and `Theme`, `ColorScheme`) are exported directly from the package:
|
|
80
|
+
```ts
|
|
81
|
+
import type { ThemeColors } from '@retray-dev/ui-kit'
|
|
82
|
+
```
|
|
83
|
+
|
|
79
84
|
| Token | Light | Dark | Semantic Role |
|
|
80
85
|
|-------|-------|------|---------------|
|
|
81
86
|
| `background` | `#ffffff` | `#171717` | Screen / page background |
|
|
@@ -142,7 +147,7 @@ All 20 tokens are available via `useTheme().colors`.
|
|
|
142
147
|
| Prop | Type | Default | Notes |
|
|
143
148
|
|------|------|---------|-------|
|
|
144
149
|
| label | `string` | required | Button text |
|
|
145
|
-
| variant | `'primary' \| 'secondary' \| 'outline' \| 'ghost'` | `'primary'` | Visual style |
|
|
150
|
+
| variant | `'primary' \| 'secondary' \| 'outline' \| 'ghost' \| 'destructive'` | `'primary'` | Visual style |
|
|
146
151
|
| size | `'sm' \| 'md' \| 'lg'` | `'md'` | — |
|
|
147
152
|
| loading | `boolean` | `false` | Replaces label with a spinner and forces disabled state |
|
|
148
153
|
| fullWidth | `boolean` | `false` | Stretches to container width (`alignSelf: 'stretch'`) |
|
|
@@ -155,6 +160,7 @@ All 20 tokens are available via `useTheme().colors`.
|
|
|
155
160
|
- `secondary`: filled with `secondary` token — less prominent actions
|
|
156
161
|
- `outline`: transparent with `border` — alternative without fill
|
|
157
162
|
- `ghost`: fully transparent — in-context or low-emphasis actions
|
|
163
|
+
- `destructive`: filled with `destructive` token — irreversible or dangerous actions
|
|
158
164
|
|
|
159
165
|
**Animations:** Scale springs to 0.97 on `onPressIn`, back to 1.0 on `onPressOut`.
|
|
160
166
|
|
|
@@ -380,29 +386,6 @@ const [amount, setAmount] = useState(0)
|
|
|
380
386
|
|
|
381
387
|
---
|
|
382
388
|
|
|
383
|
-
### Card
|
|
384
|
-
|
|
385
|
-
**Import:** `import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from '@retray-dev/ui-kit'`
|
|
386
|
-
**When to use:** Grouped content with a surface background, border, and shadow.
|
|
387
|
-
|
|
388
|
-
All sub-components accept a `style` prop for overrides.
|
|
389
|
-
|
|
390
|
-
**Example:**
|
|
391
|
-
```tsx
|
|
392
|
-
<Card>
|
|
393
|
-
<CardHeader>
|
|
394
|
-
<CardTitle>Account</CardTitle>
|
|
395
|
-
<CardDescription>Manage your profile settings</CardDescription>
|
|
396
|
-
</CardHeader>
|
|
397
|
-
<CardContent>
|
|
398
|
-
<Input label="Name" />
|
|
399
|
-
</CardContent>
|
|
400
|
-
<CardFooter>
|
|
401
|
-
<Button label="Save" fullWidth />
|
|
402
|
-
</CardFooter>
|
|
403
|
-
|
|
404
|
-
---
|
|
405
|
-
|
|
406
389
|
### CurrencyDisplay
|
|
407
390
|
|
|
408
391
|
**Import:** `import { CurrencyDisplay } from '@retray-dev/ui-kit'`
|
|
@@ -413,6 +396,7 @@ All sub-components accept a `style` prop for overrides.
|
|
|
413
396
|
| value | `number \| string` | required | Numeric value to display |
|
|
414
397
|
| prefix | `string` | `'$'` | Symbol prepended to the formatted value |
|
|
415
398
|
| showDecimals | `boolean` | `false` | When `true`, shows two decimal places separated by a comma (e.g. `$25.000,00`) |
|
|
399
|
+
| textColor | `string` | — | Override the color of the formatted text. Defaults to the `foreground` token |
|
|
416
400
|
| style | `ViewStyle` | — | Style override for outer container |
|
|
417
401
|
|
|
418
402
|
**Example:**
|
|
@@ -493,30 +477,33 @@ All sub-components accept a `style` prop for overrides.
|
|
|
493
477
|
```
|
|
494
478
|
|
|
495
479
|
**Notes:**
|
|
496
|
-
- `CardHeader` and `CardContent` have `padding: 24`
|
|
480
|
+
- `CardHeader` and `CardContent` have `padding: 24`. Override via the `style` prop: `<CardContent style={{ padding: 16 }}>`
|
|
497
481
|
- `CardFooter` has `paddingTop: 0` so it connects naturally to `CardContent`
|
|
498
482
|
- `CardTitle`: 18px / 600 weight, `cardForeground` color
|
|
499
483
|
- `CardDescription`: 14px, `mutedForeground` color
|
|
500
484
|
|
|
501
485
|
---
|
|
502
486
|
|
|
503
|
-
###
|
|
487
|
+
### AlertBanner
|
|
488
|
+
|
|
489
|
+
**Import:** `import { AlertBanner } from '@retray-dev/ui-kit'`
|
|
490
|
+
**When to use:** Inline feedback messages (info, success, error). Not for transient toasts — use `Toast` for ephemeral feedback.
|
|
504
491
|
|
|
505
|
-
**
|
|
506
|
-
**When to use:** Inline feedback messages (info, success, warning, error). Not for transient toasts.
|
|
492
|
+
> **Note:** Named `AlertBanner` (not `Alert`) to avoid collision with React Native's built-in `Alert` module.
|
|
507
493
|
|
|
508
494
|
| Prop | Type | Default | Notes |
|
|
509
495
|
|------|------|---------|-------|
|
|
510
496
|
| title | `string` | — | Bold heading |
|
|
511
497
|
| description | `string` | — | Detail text |
|
|
512
|
-
| variant | `'default' \| 'destructive'` | `'default'` |
|
|
513
|
-
| icon | `ReactNode` | — | Icon placed to the left of the text content |
|
|
498
|
+
| variant | `'default' \| 'destructive' \| 'success'` | `'default'` | Controls border/text color |
|
|
499
|
+
| icon | `ReactNode` | — | Icon placed to the left of the text content. Defaults to a variant-appropriate symbol (`ℹ`, `⚠`, `✓`) |
|
|
514
500
|
| style | `ViewStyle` | — | — |
|
|
515
501
|
|
|
516
502
|
**Example:**
|
|
517
503
|
```tsx
|
|
518
|
-
<
|
|
519
|
-
<
|
|
504
|
+
<AlertBanner title="Info" description="Your session will expire in 5 minutes." />
|
|
505
|
+
<AlertBanner variant="destructive" title="Error" description="Failed to save. Try again." />
|
|
506
|
+
<AlertBanner variant="success" title="Done" description="Your changes have been saved." />
|
|
520
507
|
```
|
|
521
508
|
|
|
522
509
|
---
|
|
@@ -532,6 +519,7 @@ All sub-components accept a `style` prop for overrides.
|
|
|
532
519
|
| description | `string` | — | — |
|
|
533
520
|
| icon | `ReactNode` | — | Shown in a 48×48 muted square above the text |
|
|
534
521
|
| action | `ReactNode` | — | Usually a `Button`, placed below the text |
|
|
522
|
+
| size | `'default' \| 'compact'` | `'default'` | `compact` hides description/action, uses a 36×36 icon, smaller title (15px), and tighter spacing |
|
|
535
523
|
| style | `ViewStyle` | — | — |
|
|
536
524
|
|
|
537
525
|
**Example:**
|
|
@@ -577,7 +565,7 @@ const [accepted, setAccepted] = useState(false)
|
|
|
577
565
|
| disabled | `boolean` | — | Reduces opacity to 0.45 |
|
|
578
566
|
| style | `ViewStyle` | — | — |
|
|
579
567
|
|
|
580
|
-
**Dimensions:** Track
|
|
568
|
+
**Dimensions:** Track 60×36pt, Thumb 28×28pt with 4pt offset from edges (`top: 4, left: 4`). Thumb uses `position: 'absolute'` inside the track.
|
|
581
569
|
|
|
582
570
|
**Animation:** Thumb translates via spring (bounciness: 4); track color transitions via opacity timing (150ms).
|
|
583
571
|
|
|
@@ -795,6 +783,11 @@ pnpm add @gorhom/bottom-sheet react-native-reanimated react-native-gesture-handl
|
|
|
795
783
|
```
|
|
796
784
|
Add `react-native-worklets/plugin` (not `react-native-reanimated/plugin`) to your `babel.config.js` plugins.
|
|
797
785
|
|
|
786
|
+
> **Important — Expo managed workflow:** Expo's install tool may downgrade `@gorhom/bottom-sheet` to an incompatible version (v4). Pin it in `app.json` to prevent this:
|
|
787
|
+
> ```json
|
|
788
|
+
> { "expo": { "install": { "exclude": ["@gorhom/bottom-sheet"] } } }
|
|
789
|
+
> ```
|
|
790
|
+
|
|
798
791
|
| Prop | Type | Default | Notes |
|
|
799
792
|
|------|------|---------|-------|
|
|
800
793
|
| open | `boolean` | required | `true` presents the sheet, `false` dismisses it |
|
|
@@ -859,3 +852,157 @@ function MyComponent() {
|
|
|
859
852
|
- Entrance: `withTiming(120ms, Easing.out(Easing.exp))` slide-down + opacity fade — fast, sharp feel
|
|
860
853
|
- Exit: `withTiming(200ms)` slide-up + opacity fade
|
|
861
854
|
- Swipe left or right to dismiss early (threshold: 80px or 800 pt/s velocity)
|
|
855
|
+
|
|
856
|
+
---
|
|
857
|
+
|
|
858
|
+
### ListItem
|
|
859
|
+
|
|
860
|
+
**Import:** `import { ListItem } from '@retray-dev/ui-kit'`
|
|
861
|
+
**When to use:** Rows in a list or menu. Composes icon, title, subtitle, and trailing content in a standard horizontal layout.
|
|
862
|
+
|
|
863
|
+
| Prop | Type | Default | Notes |
|
|
864
|
+
|------|------|---------|-------|
|
|
865
|
+
| title | `string` | required | Primary label |
|
|
866
|
+
| subtitle | `string` | — | Secondary label below the title |
|
|
867
|
+
| icon | `ReactNode` | — | Node rendered to the left of the text content |
|
|
868
|
+
| trailing | `string \| ReactNode` | — | Content on the right edge. Strings are styled as muted caption |
|
|
869
|
+
| onPress | `() => void` | — | Makes the row pressable. Scale animation + haptics are only active when provided |
|
|
870
|
+
| disabled | `boolean` | — | Reduces opacity to 0.45 |
|
|
871
|
+
| style | `ViewStyle` | — | — |
|
|
872
|
+
|
|
873
|
+
**Example:**
|
|
874
|
+
```tsx
|
|
875
|
+
<ListItem
|
|
876
|
+
icon={<Ionicons name="receipt-outline" size={18} />}
|
|
877
|
+
title="Mercado"
|
|
878
|
+
subtitle="12 mar 2025"
|
|
879
|
+
trailing="$45.000"
|
|
880
|
+
onPress={() => navigate('detail')}
|
|
881
|
+
/>
|
|
882
|
+
|
|
883
|
+
// Non-interactive row
|
|
884
|
+
<ListItem title="Account number" trailing="**** 4321" />
|
|
885
|
+
```
|
|
886
|
+
|
|
887
|
+
---
|
|
888
|
+
|
|
889
|
+
### Chip / ChipGroup
|
|
890
|
+
|
|
891
|
+
**Import:** `import { Chip, ChipGroup } from '@retray-dev/ui-kit'`
|
|
892
|
+
**When to use:** Filter pills, single-select options displayed inline. Use `ChipGroup` for managed single-selection; use `Chip` standalone for custom logic.
|
|
893
|
+
|
|
894
|
+
**`Chip` Props:**
|
|
895
|
+
|
|
896
|
+
| Prop | Type | Default | Notes |
|
|
897
|
+
|------|------|---------|-------|
|
|
898
|
+
| label | `string` | required | — |
|
|
899
|
+
| selected | `boolean` | `false` | Controls fill color |
|
|
900
|
+
| onPress | `() => void` | — | — |
|
|
901
|
+
| style | `ViewStyle` | — | — |
|
|
902
|
+
|
|
903
|
+
**`ChipGroup` Props:**
|
|
904
|
+
|
|
905
|
+
| Prop | Type | Default | Notes |
|
|
906
|
+
|------|------|---------|-------|
|
|
907
|
+
| options | `ChipOption[]` | required | Each: `{ label: string, value: string \| number }` |
|
|
908
|
+
| value | `string \| number` | — | Currently selected value |
|
|
909
|
+
| onValueChange | `(value: string \| number) => void` | — | — |
|
|
910
|
+
| style | `ViewStyle` | — | Applied to the wrapping row |
|
|
911
|
+
|
|
912
|
+
**Animation:** Background, text, and border colors animate via `Animated.timing` (150ms) between unselected (`secondary`/`border`/`foreground`) and selected (`primary`/`primary`/`primaryForeground`) states.
|
|
913
|
+
|
|
914
|
+
**Example:**
|
|
915
|
+
```tsx
|
|
916
|
+
const [pct, setPct] = useState(50)
|
|
917
|
+
|
|
918
|
+
<ChipGroup
|
|
919
|
+
options={[
|
|
920
|
+
{ label: '40%', value: 40 },
|
|
921
|
+
{ label: '50%', value: 50 },
|
|
922
|
+
{ label: '100%', value: 100 },
|
|
923
|
+
]}
|
|
924
|
+
value={pct}
|
|
925
|
+
onValueChange={setPct}
|
|
926
|
+
/>
|
|
927
|
+
```
|
|
928
|
+
|
|
929
|
+
---
|
|
930
|
+
|
|
931
|
+
### ConfirmDialog
|
|
932
|
+
|
|
933
|
+
**Import:** `import { ConfirmDialog } from '@retray-dev/ui-kit'`
|
|
934
|
+
**When to use:** Confirmation prompts before irreversible or destructive actions (delete, send, discard).
|
|
935
|
+
|
|
936
|
+
| Prop | Type | Default | Notes |
|
|
937
|
+
|------|------|---------|-------|
|
|
938
|
+
| visible | `boolean` | required | Controls modal visibility |
|
|
939
|
+
| title | `string` | required | Dialog heading |
|
|
940
|
+
| description | `string` | — | Supporting text below the title |
|
|
941
|
+
| confirmLabel | `string` | `'Confirm'` | Label for the confirm button |
|
|
942
|
+
| cancelLabel | `string` | `'Cancel'` | Label for the cancel button |
|
|
943
|
+
| confirmVariant | `'primary' \| 'destructive'` | `'primary'` | Button variant for the confirm action |
|
|
944
|
+
| onConfirm | `() => void` | required | Called when confirm is tapped |
|
|
945
|
+
| onCancel | `() => void` | required | Called when cancel is tapped or backdrop is pressed |
|
|
946
|
+
|
|
947
|
+
**Notes:**
|
|
948
|
+
- Uses React Native `Modal` with `animationType="fade"` — no bottom-sheet dependency.
|
|
949
|
+
- Tapping outside the dialog card calls `onCancel`.
|
|
950
|
+
- The cancel and confirm buttons are full-width stacked vertically.
|
|
951
|
+
|
|
952
|
+
**Example:**
|
|
953
|
+
```tsx
|
|
954
|
+
<ConfirmDialog
|
|
955
|
+
visible={showDelete}
|
|
956
|
+
title="¿Eliminar gasto?"
|
|
957
|
+
description="$45.000 · Mercado · 12 mar"
|
|
958
|
+
confirmLabel="Eliminar"
|
|
959
|
+
confirmVariant="destructive"
|
|
960
|
+
onConfirm={handleDelete}
|
|
961
|
+
onCancel={() => setShowDelete(false)}
|
|
962
|
+
/>
|
|
963
|
+
```
|
|
964
|
+
|
|
965
|
+
---
|
|
966
|
+
|
|
967
|
+
### LabelValue
|
|
968
|
+
|
|
969
|
+
**Import:** `import { LabelValue } from '@retray-dev/ui-kit'`
|
|
970
|
+
**When to use:** Key-value display rows in receipts, summaries, and detail screens. Label on the left (muted caption), value on the right (medium weight).
|
|
971
|
+
|
|
972
|
+
| Prop | Type | Default | Notes |
|
|
973
|
+
|------|------|---------|-------|
|
|
974
|
+
| label | `string` | required | Caption text on the left |
|
|
975
|
+
| value | `string \| ReactNode` | required | Value on the right. Strings are auto-styled; pass `ReactNode` for custom rendering |
|
|
976
|
+
| style | `ViewStyle` | — | — |
|
|
977
|
+
|
|
978
|
+
**Example:**
|
|
979
|
+
```tsx
|
|
980
|
+
<LabelValue label="Fecha" value="12 mar 2025" />
|
|
981
|
+
<LabelValue label="Categoría" value="Mercado" />
|
|
982
|
+
<LabelValue label="Estado" value={<Badge label="Pendiente" variant="secondary" />} />
|
|
983
|
+
```
|
|
984
|
+
|
|
985
|
+
---
|
|
986
|
+
|
|
987
|
+
### MonthPicker
|
|
988
|
+
|
|
989
|
+
**Import:** `import { MonthPicker } from '@retray-dev/ui-kit'`
|
|
990
|
+
**When to use:** Compact month/year selector with previous/next navigation. Common in finance apps for filtering by period.
|
|
991
|
+
|
|
992
|
+
| Prop | Type | Default | Notes |
|
|
993
|
+
|------|------|---------|-------|
|
|
994
|
+
| value | `MonthPickerValue` | required | `{ month: number, year: number }` — `month` is 1–12 |
|
|
995
|
+
| onChange | `(value: MonthPickerValue) => void` | required | Called on each navigation step |
|
|
996
|
+
| style | `ViewStyle` | — | — |
|
|
997
|
+
|
|
998
|
+
**`MonthPickerValue`:** `{ month: number, year: number }` — month is 1-indexed (January = 1).
|
|
999
|
+
|
|
1000
|
+
**Navigation:** Arrows wrap correctly at year boundaries (December → January increments the year; January → December decrements it). The component is fully controlled — no internal state.
|
|
1001
|
+
|
|
1002
|
+
**Example:**
|
|
1003
|
+
```tsx
|
|
1004
|
+
const [period, setPeriod] = useState({ month: new Date().getMonth() + 1, year: new Date().getFullYear() })
|
|
1005
|
+
|
|
1006
|
+
<MonthPicker value={period} onChange={setPeriod} />
|
|
1007
|
+
// Displays: "April 2026"
|
|
1008
|
+
```
|
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A personal React Native / Expo UI component library with a built-in design system, dark mode support, haptic feedback, and smooth animations.
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
- Light/dark theme with
|
|
5
|
+
- 32 components across 6 categories
|
|
6
|
+
- Light/dark theme with 20 color tokens and full customization
|
|
7
7
|
- Apple HIG–compliant touch targets and haptic feedback
|
|
8
8
|
- Animated interactions: spring press, sliding tabs, accordion easing, animated progress
|
|
9
9
|
- Built with TypeScript — full type declarations included
|
|
@@ -93,18 +93,19 @@ import { useTheme } from '@retray-dev/ui-kit'
|
|
|
93
93
|
const { colors, colorScheme } = useTheme()
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
**Available tokens:** `background`, `foreground`, `card`, `cardForeground`, `primary`, `primaryForeground`, `secondary`, `secondaryForeground`, `muted`, `mutedForeground`, `accent`, `accentForeground`, `destructive`, `destructiveForeground`, `border`, `input`, `ring`
|
|
96
|
+
**Available tokens:** `background`, `foreground`, `card`, `cardForeground`, `primary`, `primaryForeground`, `secondary`, `secondaryForeground`, `muted`, `mutedForeground`, `accent`, `accentForeground`, `destructive`, `destructiveForeground`, `border`, `input`, `ring`, `success`, `successForeground`
|
|
97
97
|
|
|
98
98
|
## Components
|
|
99
99
|
|
|
100
100
|
| Category | Components |
|
|
101
101
|
| ----------- | ----------------------------------------------------------------------------------------------- |
|
|
102
|
-
| Display | `Text`, `Badge`, `Avatar`, `Separator`, `Spinner`, `Skeleton`, `Progress`, `CurrencyDisplay`
|
|
102
|
+
| Display | `Text`, `Badge`, `Avatar`, `Separator`, `Spinner`, `Skeleton`, `Progress`, `CurrencyDisplay` |
|
|
103
103
|
| Surfaces | `Card`, `Alert`, `EmptyState` |
|
|
104
104
|
| Form | `Button`, `Input`, `CurrencyInput`, `CurrencyInputLarge`, `Textarea`, `Checkbox`, `Switch`, `Toggle`, `RadioGroup`, `Select`, `Slider` |
|
|
105
105
|
| Composition | `Tabs`, `Accordion` |
|
|
106
|
-
| Overlays | `Sheet`
|
|
106
|
+
| Overlays | `Sheet`, `ConfirmDialog` |
|
|
107
107
|
| Feedback | `Toast` / `ToastProvider` / `useToast` |
|
|
108
|
+
| Data | `ListItem`, `Chip` / `ChipGroup`, `LabelValue`, `MonthPicker` |
|
|
108
109
|
|
|
109
110
|
### Quick examples
|
|
110
111
|
|
package/dist/index.d.mts
CHANGED
|
@@ -55,7 +55,7 @@ declare function useTheme(): ThemeContextValue;
|
|
|
55
55
|
declare const defaultLight: ThemeColors;
|
|
56
56
|
declare const defaultDark: ThemeColors;
|
|
57
57
|
|
|
58
|
-
type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost';
|
|
58
|
+
type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive';
|
|
59
59
|
type ButtonSize = 'sm' | 'md' | 'lg';
|
|
60
60
|
interface ButtonProps extends TouchableOpacityProps {
|
|
61
61
|
label: string;
|
|
@@ -170,15 +170,15 @@ interface AvatarProps {
|
|
|
170
170
|
}
|
|
171
171
|
declare function Avatar({ src, fallback, size, style }: AvatarProps): React.JSX.Element;
|
|
172
172
|
|
|
173
|
-
type
|
|
174
|
-
interface
|
|
173
|
+
type AlertBannerVariant = 'default' | 'destructive' | 'success';
|
|
174
|
+
interface AlertBannerProps {
|
|
175
175
|
title?: string;
|
|
176
176
|
description?: string;
|
|
177
|
-
variant?:
|
|
177
|
+
variant?: AlertBannerVariant;
|
|
178
178
|
icon?: React.ReactNode;
|
|
179
179
|
style?: ViewStyle;
|
|
180
180
|
}
|
|
181
|
-
declare function
|
|
181
|
+
declare function AlertBanner({ title, description, variant, icon, style }: AlertBannerProps): React.JSX.Element;
|
|
182
182
|
|
|
183
183
|
interface ProgressProps {
|
|
184
184
|
/** Current progress value. Clamped to `[0, max]`. Defaults to `0`. */
|
|
@@ -194,9 +194,11 @@ interface EmptyStateProps {
|
|
|
194
194
|
title: string;
|
|
195
195
|
description?: string;
|
|
196
196
|
action?: React.ReactNode;
|
|
197
|
+
/** `compact` hides description/action and uses tighter spacing and a smaller icon. */
|
|
198
|
+
size?: 'default' | 'compact';
|
|
197
199
|
style?: ViewStyle;
|
|
198
200
|
}
|
|
199
|
-
declare function EmptyState({ icon, title, description, action, style }: EmptyStateProps): React.JSX.Element;
|
|
201
|
+
declare function EmptyState({ icon, title, description, action, size, style }: EmptyStateProps): React.JSX.Element;
|
|
200
202
|
|
|
201
203
|
interface TextareaProps extends TextInputProps {
|
|
202
204
|
label?: string;
|
|
@@ -401,9 +403,11 @@ interface CurrencyDisplayProps {
|
|
|
401
403
|
prefix?: string;
|
|
402
404
|
/** When true, shows two decimal places separated by a comma (e.g. `$25.000,00`). Defaults to `false`. */
|
|
403
405
|
showDecimals?: boolean;
|
|
406
|
+
/** Override the color of the formatted text. Defaults to the `foreground` theme token. */
|
|
407
|
+
textColor?: string;
|
|
404
408
|
style?: ViewStyle;
|
|
405
409
|
}
|
|
406
|
-
declare function CurrencyDisplay({ value, prefix, showDecimals, style }: CurrencyDisplayProps): React.JSX.Element;
|
|
410
|
+
declare function CurrencyDisplay({ value, prefix, showDecimals, textColor, style }: CurrencyDisplayProps): React.JSX.Element;
|
|
407
411
|
|
|
408
412
|
interface CurrencyInputLargeProps {
|
|
409
413
|
value?: string;
|
|
@@ -424,4 +428,65 @@ interface CurrencyInputLargeProps {
|
|
|
424
428
|
}
|
|
425
429
|
declare function CurrencyInputLarge({ value, onChangeText, onChangeValue, prefix, thousandsSeparator, label, error, hint, placeholder, editable, containerStyle, }: CurrencyInputLargeProps): React.JSX.Element;
|
|
426
430
|
|
|
427
|
-
|
|
431
|
+
interface ListItemProps {
|
|
432
|
+
icon?: React.ReactNode;
|
|
433
|
+
title: string;
|
|
434
|
+
subtitle?: string;
|
|
435
|
+
trailing?: string | React.ReactNode;
|
|
436
|
+
onPress?: () => void;
|
|
437
|
+
disabled?: boolean;
|
|
438
|
+
style?: ViewStyle;
|
|
439
|
+
}
|
|
440
|
+
declare function ListItem({ icon, title, subtitle, trailing, onPress, disabled, style }: ListItemProps): React.JSX.Element;
|
|
441
|
+
|
|
442
|
+
interface ChipProps {
|
|
443
|
+
label: string;
|
|
444
|
+
selected?: boolean;
|
|
445
|
+
onPress?: () => void;
|
|
446
|
+
style?: ViewStyle;
|
|
447
|
+
}
|
|
448
|
+
interface ChipOption {
|
|
449
|
+
label: string;
|
|
450
|
+
value: string | number;
|
|
451
|
+
}
|
|
452
|
+
interface ChipGroupProps {
|
|
453
|
+
options: ChipOption[];
|
|
454
|
+
value?: string | number;
|
|
455
|
+
onValueChange?: (value: string | number) => void;
|
|
456
|
+
style?: ViewStyle;
|
|
457
|
+
}
|
|
458
|
+
declare function Chip({ label, selected, onPress, style }: ChipProps): React.JSX.Element;
|
|
459
|
+
declare function ChipGroup({ options, value, onValueChange, style }: ChipGroupProps): React.JSX.Element;
|
|
460
|
+
|
|
461
|
+
interface ConfirmDialogProps {
|
|
462
|
+
visible: boolean;
|
|
463
|
+
title: string;
|
|
464
|
+
description?: string;
|
|
465
|
+
confirmLabel?: string;
|
|
466
|
+
cancelLabel?: string;
|
|
467
|
+
confirmVariant?: 'primary' | 'destructive';
|
|
468
|
+
onConfirm: () => void;
|
|
469
|
+
onCancel: () => void;
|
|
470
|
+
}
|
|
471
|
+
declare function ConfirmDialog({ visible, title, description, confirmLabel, cancelLabel, confirmVariant, onConfirm, onCancel, }: ConfirmDialogProps): React.JSX.Element;
|
|
472
|
+
|
|
473
|
+
interface LabelValueProps {
|
|
474
|
+
label: string;
|
|
475
|
+
value: string | React.ReactNode;
|
|
476
|
+
style?: ViewStyle;
|
|
477
|
+
}
|
|
478
|
+
declare function LabelValue({ label, value, style }: LabelValueProps): React.JSX.Element;
|
|
479
|
+
|
|
480
|
+
interface MonthPickerValue {
|
|
481
|
+
/** Month number 1–12 */
|
|
482
|
+
month: number;
|
|
483
|
+
year: number;
|
|
484
|
+
}
|
|
485
|
+
interface MonthPickerProps {
|
|
486
|
+
value: MonthPickerValue;
|
|
487
|
+
onChange: (value: MonthPickerValue) => void;
|
|
488
|
+
style?: ViewStyle;
|
|
489
|
+
}
|
|
490
|
+
declare function MonthPicker({ value, onChange, style }: MonthPickerProps): React.JSX.Element;
|
|
491
|
+
|
|
492
|
+
export { Accordion, type AccordionItem, type AccordionProps, AlertBanner, type AlertBannerProps, type AlertBannerVariant, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, Checkbox, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipOption, type ChipProps, type ColorScheme, ConfirmDialog, type ConfirmDialogProps, CurrencyDisplay, type CurrencyDisplayProps, CurrencyInput, CurrencyInputLarge, type CurrencyInputLargeProps, type CurrencyInputProps, EmptyState, type EmptyStateProps, Input, type InputProps, LabelValue, type LabelValueProps, ListItem, type ListItemProps, MonthPicker, type MonthPickerProps, type MonthPickerValue, Progress, type ProgressProps, RadioGroup, type RadioGroupProps, type RadioOption, Select, type SelectOption, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, Skeleton, type SkeletonProps, Slider, type SliderProps, Spinner, type SpinnerProps, type SpinnerSize, Switch, type SwitchProps, type TabItem, Tabs, TabsContent, type TabsContentProps, type TabsProps, Text, type TextProps, type TextVariant, Textarea, type TextareaProps, type Theme, type ThemeColors, ThemeProvider, type ThemeProviderProps, type ToastItem, ToastProvider, type ToastProviderProps, type ToastVariant, Toggle, type ToggleProps, type ToggleSize, type ToggleVariant, defaultDark, defaultLight, useTheme, useToast };
|
package/dist/index.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ declare function useTheme(): ThemeContextValue;
|
|
|
55
55
|
declare const defaultLight: ThemeColors;
|
|
56
56
|
declare const defaultDark: ThemeColors;
|
|
57
57
|
|
|
58
|
-
type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost';
|
|
58
|
+
type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive';
|
|
59
59
|
type ButtonSize = 'sm' | 'md' | 'lg';
|
|
60
60
|
interface ButtonProps extends TouchableOpacityProps {
|
|
61
61
|
label: string;
|
|
@@ -170,15 +170,15 @@ interface AvatarProps {
|
|
|
170
170
|
}
|
|
171
171
|
declare function Avatar({ src, fallback, size, style }: AvatarProps): React.JSX.Element;
|
|
172
172
|
|
|
173
|
-
type
|
|
174
|
-
interface
|
|
173
|
+
type AlertBannerVariant = 'default' | 'destructive' | 'success';
|
|
174
|
+
interface AlertBannerProps {
|
|
175
175
|
title?: string;
|
|
176
176
|
description?: string;
|
|
177
|
-
variant?:
|
|
177
|
+
variant?: AlertBannerVariant;
|
|
178
178
|
icon?: React.ReactNode;
|
|
179
179
|
style?: ViewStyle;
|
|
180
180
|
}
|
|
181
|
-
declare function
|
|
181
|
+
declare function AlertBanner({ title, description, variant, icon, style }: AlertBannerProps): React.JSX.Element;
|
|
182
182
|
|
|
183
183
|
interface ProgressProps {
|
|
184
184
|
/** Current progress value. Clamped to `[0, max]`. Defaults to `0`. */
|
|
@@ -194,9 +194,11 @@ interface EmptyStateProps {
|
|
|
194
194
|
title: string;
|
|
195
195
|
description?: string;
|
|
196
196
|
action?: React.ReactNode;
|
|
197
|
+
/** `compact` hides description/action and uses tighter spacing and a smaller icon. */
|
|
198
|
+
size?: 'default' | 'compact';
|
|
197
199
|
style?: ViewStyle;
|
|
198
200
|
}
|
|
199
|
-
declare function EmptyState({ icon, title, description, action, style }: EmptyStateProps): React.JSX.Element;
|
|
201
|
+
declare function EmptyState({ icon, title, description, action, size, style }: EmptyStateProps): React.JSX.Element;
|
|
200
202
|
|
|
201
203
|
interface TextareaProps extends TextInputProps {
|
|
202
204
|
label?: string;
|
|
@@ -401,9 +403,11 @@ interface CurrencyDisplayProps {
|
|
|
401
403
|
prefix?: string;
|
|
402
404
|
/** When true, shows two decimal places separated by a comma (e.g. `$25.000,00`). Defaults to `false`. */
|
|
403
405
|
showDecimals?: boolean;
|
|
406
|
+
/** Override the color of the formatted text. Defaults to the `foreground` theme token. */
|
|
407
|
+
textColor?: string;
|
|
404
408
|
style?: ViewStyle;
|
|
405
409
|
}
|
|
406
|
-
declare function CurrencyDisplay({ value, prefix, showDecimals, style }: CurrencyDisplayProps): React.JSX.Element;
|
|
410
|
+
declare function CurrencyDisplay({ value, prefix, showDecimals, textColor, style }: CurrencyDisplayProps): React.JSX.Element;
|
|
407
411
|
|
|
408
412
|
interface CurrencyInputLargeProps {
|
|
409
413
|
value?: string;
|
|
@@ -424,4 +428,65 @@ interface CurrencyInputLargeProps {
|
|
|
424
428
|
}
|
|
425
429
|
declare function CurrencyInputLarge({ value, onChangeText, onChangeValue, prefix, thousandsSeparator, label, error, hint, placeholder, editable, containerStyle, }: CurrencyInputLargeProps): React.JSX.Element;
|
|
426
430
|
|
|
427
|
-
|
|
431
|
+
interface ListItemProps {
|
|
432
|
+
icon?: React.ReactNode;
|
|
433
|
+
title: string;
|
|
434
|
+
subtitle?: string;
|
|
435
|
+
trailing?: string | React.ReactNode;
|
|
436
|
+
onPress?: () => void;
|
|
437
|
+
disabled?: boolean;
|
|
438
|
+
style?: ViewStyle;
|
|
439
|
+
}
|
|
440
|
+
declare function ListItem({ icon, title, subtitle, trailing, onPress, disabled, style }: ListItemProps): React.JSX.Element;
|
|
441
|
+
|
|
442
|
+
interface ChipProps {
|
|
443
|
+
label: string;
|
|
444
|
+
selected?: boolean;
|
|
445
|
+
onPress?: () => void;
|
|
446
|
+
style?: ViewStyle;
|
|
447
|
+
}
|
|
448
|
+
interface ChipOption {
|
|
449
|
+
label: string;
|
|
450
|
+
value: string | number;
|
|
451
|
+
}
|
|
452
|
+
interface ChipGroupProps {
|
|
453
|
+
options: ChipOption[];
|
|
454
|
+
value?: string | number;
|
|
455
|
+
onValueChange?: (value: string | number) => void;
|
|
456
|
+
style?: ViewStyle;
|
|
457
|
+
}
|
|
458
|
+
declare function Chip({ label, selected, onPress, style }: ChipProps): React.JSX.Element;
|
|
459
|
+
declare function ChipGroup({ options, value, onValueChange, style }: ChipGroupProps): React.JSX.Element;
|
|
460
|
+
|
|
461
|
+
interface ConfirmDialogProps {
|
|
462
|
+
visible: boolean;
|
|
463
|
+
title: string;
|
|
464
|
+
description?: string;
|
|
465
|
+
confirmLabel?: string;
|
|
466
|
+
cancelLabel?: string;
|
|
467
|
+
confirmVariant?: 'primary' | 'destructive';
|
|
468
|
+
onConfirm: () => void;
|
|
469
|
+
onCancel: () => void;
|
|
470
|
+
}
|
|
471
|
+
declare function ConfirmDialog({ visible, title, description, confirmLabel, cancelLabel, confirmVariant, onConfirm, onCancel, }: ConfirmDialogProps): React.JSX.Element;
|
|
472
|
+
|
|
473
|
+
interface LabelValueProps {
|
|
474
|
+
label: string;
|
|
475
|
+
value: string | React.ReactNode;
|
|
476
|
+
style?: ViewStyle;
|
|
477
|
+
}
|
|
478
|
+
declare function LabelValue({ label, value, style }: LabelValueProps): React.JSX.Element;
|
|
479
|
+
|
|
480
|
+
interface MonthPickerValue {
|
|
481
|
+
/** Month number 1–12 */
|
|
482
|
+
month: number;
|
|
483
|
+
year: number;
|
|
484
|
+
}
|
|
485
|
+
interface MonthPickerProps {
|
|
486
|
+
value: MonthPickerValue;
|
|
487
|
+
onChange: (value: MonthPickerValue) => void;
|
|
488
|
+
style?: ViewStyle;
|
|
489
|
+
}
|
|
490
|
+
declare function MonthPicker({ value, onChange, style }: MonthPickerProps): React.JSX.Element;
|
|
491
|
+
|
|
492
|
+
export { Accordion, type AccordionItem, type AccordionProps, AlertBanner, type AlertBannerProps, type AlertBannerVariant, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, Checkbox, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipOption, type ChipProps, type ColorScheme, ConfirmDialog, type ConfirmDialogProps, CurrencyDisplay, type CurrencyDisplayProps, CurrencyInput, CurrencyInputLarge, type CurrencyInputLargeProps, type CurrencyInputProps, EmptyState, type EmptyStateProps, Input, type InputProps, LabelValue, type LabelValueProps, ListItem, type ListItemProps, MonthPicker, type MonthPickerProps, type MonthPickerValue, Progress, type ProgressProps, RadioGroup, type RadioGroupProps, type RadioOption, Select, type SelectOption, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, Skeleton, type SkeletonProps, Slider, type SliderProps, Spinner, type SpinnerProps, type SpinnerSize, Switch, type SwitchProps, type TabItem, Tabs, TabsContent, type TabsContentProps, type TabsProps, Text, type TextProps, type TextVariant, Textarea, type TextareaProps, type Theme, type ThemeColors, ThemeProvider, type ThemeProviderProps, type ToastItem, ToastProvider, type ToastProviderProps, type ToastVariant, Toggle, type ToggleProps, type ToggleSize, type ToggleVariant, defaultDark, defaultLight, useTheme, useToast };
|