@studio-piot/native-ui 0.2.4 → 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/README.md +22 -18
- package/dist/components/Button/Button.d.ts +20 -4
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +34 -21
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/buttonAppearance.d.ts +20 -0
- package/dist/components/Button/buttonAppearance.d.ts.map +1 -0
- package/dist/components/Button/buttonAppearance.js +28 -0
- package/dist/components/Button/buttonAppearance.js.map +1 -0
- package/dist/components/Button/buttonThemeRoles.d.ts +6 -0
- package/dist/components/Button/buttonThemeRoles.d.ts.map +1 -0
- package/dist/components/Button/buttonThemeRoles.js +8 -0
- package/dist/components/Button/buttonThemeRoles.js.map +1 -0
- package/dist/components/Button/index.d.ts +3 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +4 -1
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Choice/Choice.d.ts +8 -0
- package/dist/components/Choice/Choice.d.ts.map +1 -0
- package/dist/components/Choice/Choice.js +60 -0
- package/dist/components/Choice/Choice.js.map +1 -0
- package/dist/components/Choice/choiceLayout.d.ts +7 -0
- package/dist/components/Choice/choiceLayout.d.ts.map +1 -0
- package/dist/components/Choice/choiceLayout.js +13 -0
- package/dist/components/Choice/choiceLayout.js.map +1 -0
- package/dist/components/Choice/choiceThemeRoles.d.ts +8 -0
- package/dist/components/Choice/choiceThemeRoles.d.ts.map +1 -0
- package/dist/components/Choice/choiceThemeRoles.js +10 -0
- package/dist/components/Choice/choiceThemeRoles.js.map +1 -0
- package/dist/components/Choice/index.d.ts +5 -0
- package/dist/components/Choice/index.d.ts.map +1 -0
- package/dist/components/Choice/index.js +10 -0
- package/dist/components/Choice/index.js.map +1 -0
- package/dist/components/Choice/types.d.ts +26 -0
- package/dist/components/Choice/types.d.ts.map +1 -0
- package/dist/components/Choice/types.js +3 -0
- package/dist/components/Choice/types.js.map +1 -0
- package/dist/components/ErrorBanner/ErrorBanner.d.ts +1 -1
- package/dist/components/ErrorBanner/ErrorBanner.d.ts.map +1 -1
- package/dist/components/ErrorBanner/ErrorBanner.js +19 -19
- package/dist/components/ErrorBanner/ErrorBanner.js.map +1 -1
- package/dist/components/ErrorBanner/errorBannerContext.d.ts +23 -3
- package/dist/components/ErrorBanner/errorBannerContext.d.ts.map +1 -1
- package/dist/components/ErrorBanner/errorBannerContext.js +9 -5
- package/dist/components/ErrorBanner/errorBannerContext.js.map +1 -1
- package/dist/components/ErrorBanner/errorBannerLayout.d.ts +18 -0
- package/dist/components/ErrorBanner/errorBannerLayout.d.ts.map +1 -0
- package/dist/components/ErrorBanner/errorBannerLayout.js +54 -0
- package/dist/components/ErrorBanner/errorBannerLayout.js.map +1 -0
- package/dist/components/ErrorBanner/icons.d.ts +7 -5
- package/dist/components/ErrorBanner/icons.d.ts.map +1 -1
- package/dist/components/ErrorBanner/icons.js +8 -4
- package/dist/components/ErrorBanner/icons.js.map +1 -1
- package/dist/components/ErrorBanner/index.d.ts +1 -1
- package/dist/components/ErrorBanner/index.d.ts.map +1 -1
- package/dist/components/ErrorBanner/index.js.map +1 -1
- package/dist/components/Form/Form.d.ts +9 -1
- package/dist/components/Form/Form.d.ts.map +1 -1
- package/dist/components/Form/Form.js +56 -78
- package/dist/components/Form/Form.js.map +1 -1
- package/dist/components/Form/FormCloseButton.d.ts +3 -1
- package/dist/components/Form/FormCloseButton.d.ts.map +1 -1
- package/dist/components/Form/FormCloseButton.js +5 -4
- package/dist/components/Form/FormCloseButton.js.map +1 -1
- package/dist/components/Form/FormErrorBanner.d.ts +15 -0
- package/dist/components/Form/FormErrorBanner.d.ts.map +1 -0
- package/dist/components/Form/FormErrorBanner.js +30 -0
- package/dist/components/Form/FormErrorBanner.js.map +1 -0
- package/dist/components/Form/FormSubmitFooter.d.ts +17 -0
- package/dist/components/Form/FormSubmitFooter.d.ts.map +1 -0
- package/dist/components/Form/FormSubmitFooter.js +32 -0
- package/dist/components/Form/FormSubmitFooter.js.map +1 -0
- package/dist/components/Form/formThemeRoles.d.ts +7 -0
- package/dist/components/Form/formThemeRoles.d.ts.map +1 -0
- package/dist/components/Form/formThemeRoles.js +9 -0
- package/dist/components/Form/formThemeRoles.js.map +1 -0
- package/dist/components/Form/index.d.ts +1 -0
- package/dist/components/Form/index.d.ts.map +1 -1
- package/dist/components/Form/index.js +3 -1
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/Form/types.d.ts +14 -10
- package/dist/components/Form/types.d.ts.map +1 -1
- package/dist/components/FormSheet/FormSheet.d.ts +10 -0
- package/dist/components/FormSheet/FormSheet.d.ts.map +1 -0
- package/dist/components/FormSheet/FormSheet.js +153 -0
- package/dist/components/FormSheet/FormSheet.js.map +1 -0
- package/dist/components/FormSheet/formSheetLayout.d.ts +32 -0
- package/dist/components/FormSheet/formSheetLayout.d.ts.map +1 -0
- package/dist/components/FormSheet/formSheetLayout.js +43 -0
- package/dist/components/FormSheet/formSheetLayout.js.map +1 -0
- package/dist/components/FormSheet/formSheetThemeRoles.d.ts +8 -0
- package/dist/components/FormSheet/formSheetThemeRoles.d.ts.map +1 -0
- package/dist/components/FormSheet/formSheetThemeRoles.js +10 -0
- package/dist/components/FormSheet/formSheetThemeRoles.js.map +1 -0
- package/dist/components/FormSheet/index.d.ts +5 -0
- package/dist/components/FormSheet/index.d.ts.map +1 -0
- package/dist/components/FormSheet/index.js +10 -0
- package/dist/components/FormSheet/index.js.map +1 -0
- package/dist/components/FormSheet/types.d.ts +64 -0
- package/dist/components/FormSheet/types.d.ts.map +1 -0
- package/dist/components/FormSheet/types.js +3 -0
- package/dist/components/FormSheet/types.js.map +1 -0
- package/dist/components/HeaderButton/HeaderCapsule.d.ts +4 -0
- package/dist/components/HeaderButton/HeaderCapsule.d.ts.map +1 -0
- package/dist/components/HeaderButton/HeaderCapsule.js +32 -0
- package/dist/components/HeaderButton/HeaderCapsule.js.map +1 -0
- package/dist/components/HeaderButton/HeaderGroup.d.ts +4 -0
- package/dist/components/HeaderButton/HeaderGroup.d.ts.map +1 -0
- package/dist/components/HeaderButton/HeaderGroup.js +23 -0
- package/dist/components/HeaderButton/HeaderGroup.js.map +1 -0
- package/dist/components/HeaderButton/HeaderIcon.d.ts +4 -0
- package/dist/components/HeaderButton/HeaderIcon.d.ts.map +1 -0
- package/dist/components/HeaderButton/HeaderIcon.js +28 -0
- package/dist/components/HeaderButton/HeaderIcon.js.map +1 -0
- package/dist/components/HeaderButton/headerButtonLayout.d.ts +21 -0
- package/dist/components/HeaderButton/headerButtonLayout.d.ts.map +1 -0
- package/dist/components/HeaderButton/headerButtonLayout.js +34 -0
- package/dist/components/HeaderButton/headerButtonLayout.js.map +1 -0
- package/dist/components/HeaderButton/headerButtonThemeRoles.d.ts +5 -0
- package/dist/components/HeaderButton/headerButtonThemeRoles.d.ts.map +1 -0
- package/dist/components/HeaderButton/headerButtonThemeRoles.js +7 -0
- package/dist/components/HeaderButton/headerButtonThemeRoles.js.map +1 -0
- package/dist/components/HeaderButton/index.d.ts +7 -0
- package/dist/components/HeaderButton/index.d.ts.map +1 -0
- package/dist/components/HeaderButton/index.js +14 -0
- package/dist/components/HeaderButton/index.js.map +1 -0
- package/dist/components/HeaderButton/types.d.ts +40 -0
- package/dist/components/HeaderButton/types.d.ts.map +1 -0
- package/dist/components/HeaderButton/types.js +3 -0
- package/dist/components/HeaderButton/types.js.map +1 -0
- package/dist/components/HeaderWash/HeaderWash.d.ts +10 -0
- package/dist/components/HeaderWash/HeaderWash.d.ts.map +1 -0
- package/dist/components/HeaderWash/HeaderWash.js +19 -0
- package/dist/components/HeaderWash/HeaderWash.js.map +1 -0
- package/dist/components/HeaderWash/headerWashGradient.d.ts +8 -0
- package/dist/components/HeaderWash/headerWashGradient.d.ts.map +1 -0
- package/dist/components/HeaderWash/headerWashGradient.js +21 -0
- package/dist/components/HeaderWash/headerWashGradient.js.map +1 -0
- package/dist/components/HeaderWash/index.d.ts +2 -0
- package/dist/components/HeaderWash/index.d.ts.map +1 -0
- package/dist/components/HeaderWash/index.js +6 -0
- package/dist/components/HeaderWash/index.js.map +1 -0
- package/dist/components/Page/Page.d.ts +13 -0
- package/dist/components/Page/Page.d.ts.map +1 -0
- package/dist/components/Page/Page.js +49 -0
- package/dist/components/Page/Page.js.map +1 -0
- package/dist/components/Page/PageBleed.d.ts +9 -0
- package/dist/components/Page/PageBleed.d.ts.map +1 -0
- package/dist/components/Page/PageBleed.js +12 -0
- package/dist/components/Page/PageBleed.js.map +1 -0
- package/dist/components/Page/index.d.ts +5 -0
- package/dist/components/Page/index.d.ts.map +1 -0
- package/dist/components/Page/index.js +10 -0
- package/dist/components/Page/index.js.map +1 -0
- package/dist/components/Page/pageContext.d.ts +4 -0
- package/dist/components/Page/pageContext.d.ts.map +1 -0
- package/dist/components/Page/pageContext.js +11 -0
- package/dist/components/Page/pageContext.js.map +1 -0
- package/dist/components/Page/pageInsets.d.ts +26 -0
- package/dist/components/Page/pageInsets.d.ts.map +1 -0
- package/dist/components/Page/pageInsets.js +37 -0
- package/dist/components/Page/pageInsets.js.map +1 -0
- package/dist/components/Page/pageLayout.d.ts +5 -0
- package/dist/components/Page/pageLayout.d.ts.map +1 -0
- package/dist/components/Page/pageLayout.js +8 -0
- package/dist/components/Page/pageLayout.js.map +1 -0
- package/dist/components/Page/pageThemeRoles.d.ts +5 -0
- package/dist/components/Page/pageThemeRoles.d.ts.map +1 -0
- package/dist/components/Page/pageThemeRoles.js +7 -0
- package/dist/components/Page/pageThemeRoles.js.map +1 -0
- package/dist/components/Page/types.d.ts +22 -0
- package/dist/components/Page/types.d.ts.map +1 -0
- package/dist/components/Page/types.js +3 -0
- package/dist/components/Page/types.js.map +1 -0
- package/dist/components/SegmentedControl/types.d.ts +0 -1
- package/dist/components/SegmentedControl/types.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +8 -9
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/selectThemeRoles.d.ts +2 -0
- package/dist/components/Select/selectThemeRoles.d.ts.map +1 -1
- package/dist/components/Select/selectThemeRoles.js +2 -0
- package/dist/components/Select/selectThemeRoles.js.map +1 -1
- package/dist/components/Select/types.d.ts +4 -0
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/components/TabAccessoryButton/TabAccessoryButton.d.ts +8 -0
- package/dist/components/TabAccessoryButton/TabAccessoryButton.d.ts.map +1 -0
- package/dist/components/TabAccessoryButton/TabAccessoryButton.js +77 -0
- package/dist/components/TabAccessoryButton/TabAccessoryButton.js.map +1 -0
- package/dist/components/TabAccessoryButton/index.d.ts +5 -0
- package/dist/components/TabAccessoryButton/index.d.ts.map +1 -0
- package/dist/components/TabAccessoryButton/index.js +11 -0
- package/dist/components/TabAccessoryButton/index.js.map +1 -0
- package/dist/components/TabAccessoryButton/tabAccessoryLayout.d.ts +27 -0
- package/dist/components/TabAccessoryButton/tabAccessoryLayout.d.ts.map +1 -0
- package/dist/components/TabAccessoryButton/tabAccessoryLayout.js +38 -0
- package/dist/components/TabAccessoryButton/tabAccessoryLayout.js.map +1 -0
- package/dist/components/TabAccessoryButton/tabAccessoryThemeRoles.d.ts +14 -0
- package/dist/components/TabAccessoryButton/tabAccessoryThemeRoles.d.ts.map +1 -0
- package/dist/components/TabAccessoryButton/tabAccessoryThemeRoles.js +19 -0
- package/dist/components/TabAccessoryButton/tabAccessoryThemeRoles.js.map +1 -0
- package/dist/components/TabAccessoryButton/types.d.ts +27 -0
- package/dist/components/TabAccessoryButton/types.d.ts.map +1 -0
- package/dist/components/TabAccessoryButton/types.js +3 -0
- package/dist/components/TabAccessoryButton/types.js.map +1 -0
- package/dist/components/index.d.ts +9 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +30 -1
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +11 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -2
- package/dist/index.js.map +1 -1
- package/dist/layout/HeaderInsetProbe.d.ts +15 -0
- package/dist/layout/HeaderInsetProbe.d.ts.map +1 -0
- package/dist/layout/HeaderInsetProbe.js +28 -0
- package/dist/layout/HeaderInsetProbe.js.map +1 -0
- package/dist/layout/headerInset.d.ts +26 -0
- package/dist/layout/headerInset.d.ts.map +1 -0
- package/dist/layout/headerInset.js +29 -0
- package/dist/layout/headerInset.js.map +1 -0
- package/dist/layout/index.d.ts +1 -0
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +3 -1
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/sheet.d.ts +3 -0
- package/dist/layout/sheet.d.ts.map +1 -0
- package/dist/layout/sheet.js +6 -0
- package/dist/layout/sheet.js.map +1 -0
- package/dist/theme/ThemeProvider.d.ts +4 -1
- package/dist/theme/ThemeProvider.d.ts.map +1 -1
- package/dist/theme/ThemeProvider.js +5 -2
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +6 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/resolveThemeSpacing.d.ts +12 -0
- package/dist/theme/resolveThemeSpacing.d.ts.map +1 -0
- package/dist/theme/resolveThemeSpacing.js +14 -0
- package/dist/theme/resolveThemeSpacing.js.map +1 -0
- package/dist/theme/types.d.ts +2 -0
- package/dist/theme/types.d.ts.map +1 -1
- package/dist/theme/useThemeSpacing.d.ts +4 -0
- package/dist/theme/useThemeSpacing.d.ts.map +1 -0
- package/dist/theme/useThemeSpacing.js +11 -0
- package/dist/theme/useThemeSpacing.js.map +1 -0
- package/docs/components/button.md +92 -38
- package/docs/components/choice.md +88 -0
- package/docs/components/error-banner.md +46 -3
- package/docs/components/form-sheet.md +140 -0
- package/docs/components/form.md +80 -45
- package/docs/components/header-button.md +310 -0
- package/docs/components/header-wash.md +40 -0
- package/docs/components/page.md +183 -0
- package/docs/components/select.md +2 -2
- package/docs/components/tab-accessory-button.md +146 -0
- package/docs/specifications/Liquid Glass header buttons in Expo Router.md +327 -0
- package/package.json +1 -1
- package/src/components/Button/Button.tsx +82 -38
- package/src/components/Button/buttonAppearance.test.ts +44 -0
- package/src/components/Button/buttonAppearance.ts +38 -0
- package/src/components/Button/buttonThemeRoles.test.ts +10 -0
- package/src/components/Button/buttonThemeRoles.ts +6 -0
- package/src/components/Button/index.ts +12 -1
- package/src/components/Choice/Choice.tsx +109 -0
- package/src/components/Choice/choiceLayout.test.ts +14 -0
- package/src/components/Choice/choiceLayout.ts +9 -0
- package/src/components/Choice/choiceThemeRoles.test.ts +14 -0
- package/src/components/Choice/choiceThemeRoles.ts +8 -0
- package/src/components/Choice/index.ts +4 -0
- package/src/components/Choice/types.ts +26 -0
- package/src/components/ErrorBanner/ErrorBanner.tsx +32 -22
- package/src/components/ErrorBanner/errorBannerContext.tsx +31 -6
- package/src/components/ErrorBanner/errorBannerLayout.test.ts +49 -0
- package/src/components/ErrorBanner/errorBannerLayout.ts +59 -0
- package/src/components/ErrorBanner/icons.tsx +25 -6
- package/src/components/ErrorBanner/index.ts +1 -0
- package/src/components/Form/Form.tsx +77 -173
- package/src/components/Form/FormCloseButton.tsx +12 -4
- package/src/components/Form/FormErrorBanner.tsx +57 -0
- package/src/components/Form/FormSubmitFooter.tsx +70 -0
- package/src/components/Form/formThemeRoles.test.ts +13 -0
- package/src/components/Form/formThemeRoles.ts +7 -0
- package/src/components/Form/index.ts +1 -0
- package/src/components/Form/types.ts +14 -10
- package/src/components/FormSheet/FormSheet.tsx +279 -0
- package/src/components/FormSheet/formSheetLayout.test.ts +66 -0
- package/src/components/FormSheet/formSheetLayout.ts +55 -0
- package/src/components/FormSheet/formSheetThemeRoles.test.ts +14 -0
- package/src/components/FormSheet/formSheetThemeRoles.ts +8 -0
- package/src/components/FormSheet/index.ts +7 -0
- package/src/components/FormSheet/types.ts +66 -0
- package/src/components/HeaderButton/HeaderCapsule.tsx +63 -0
- package/src/components/HeaderButton/HeaderGroup.tsx +36 -0
- package/src/components/HeaderButton/HeaderIcon.tsx +56 -0
- package/src/components/HeaderButton/headerButtonLayout.test.ts +47 -0
- package/src/components/HeaderButton/headerButtonLayout.ts +36 -0
- package/src/components/HeaderButton/headerButtonThemeRoles.test.ts +9 -0
- package/src/components/HeaderButton/headerButtonThemeRoles.ts +5 -0
- package/src/components/HeaderButton/index.ts +14 -0
- package/src/components/HeaderButton/types.ts +40 -0
- package/src/components/HeaderWash/HeaderWash.tsx +20 -0
- package/src/components/HeaderWash/headerWashGradient.test.ts +22 -0
- package/src/components/{Form/withAlpha.ts → HeaderWash/headerWashGradient.ts} +9 -0
- package/src/components/HeaderWash/index.ts +1 -0
- package/src/components/Page/Page.tsx +80 -0
- package/src/components/Page/PageBleed.tsx +14 -0
- package/src/components/Page/index.ts +4 -0
- package/src/components/Page/pageContext.ts +8 -0
- package/src/components/Page/pageInsets.test.ts +73 -0
- package/src/components/Page/pageInsets.ts +52 -0
- package/src/components/Page/pageThemeRoles.test.ts +9 -0
- package/src/components/Page/pageThemeRoles.ts +5 -0
- package/src/components/Page/types.ts +26 -0
- package/src/components/SegmentedControl/types.ts +0 -1
- package/src/components/Select/Select.tsx +11 -4
- package/src/components/Select/selectThemeRoles.test.ts +5 -0
- package/src/components/Select/selectThemeRoles.ts +2 -0
- package/src/components/Select/types.ts +4 -0
- package/src/components/TabAccessoryButton/TabAccessoryButton.tsx +150 -0
- package/src/components/TabAccessoryButton/index.ts +12 -0
- package/src/components/TabAccessoryButton/tabAccessoryLayout.test.ts +42 -0
- package/src/components/TabAccessoryButton/tabAccessoryLayout.ts +43 -0
- package/src/components/TabAccessoryButton/tabAccessoryThemeRoles.test.ts +28 -0
- package/src/components/TabAccessoryButton/tabAccessoryThemeRoles.ts +22 -0
- package/src/components/TabAccessoryButton/types.ts +27 -0
- package/src/components/index.ts +64 -2
- package/src/index.ts +61 -2
- package/src/layout/headerInset.test.ts +60 -0
- package/src/layout/headerInset.ts +41 -0
- package/src/layout/index.ts +1 -0
- package/src/layout/sheet.ts +2 -0
- package/src/theme/ThemeProvider.tsx +9 -1
- package/src/theme/index.ts +6 -0
- package/src/theme/resolveThemeSpacing.test.ts +29 -0
- package/src/theme/resolveThemeSpacing.ts +21 -0
- package/src/theme/types.ts +3 -0
- package/src/theme/useThemeSpacing.ts +8 -0
- package/src/components/Form/withAlpha.test.ts +0 -13
package/README.md
CHANGED
|
@@ -10,19 +10,38 @@ The package is the native counterpart of `@studio-piot/ui`. Apps own their palet
|
|
|
10
10
|
npm install @studio-piot/native-ui
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
`Select` peers `@gorhom/bottom-sheet`, `react-native-reanimated`, `react-native-gesture-handler`, and `react-native-screens` (iOS `FullWindowOverlay` so the sheet appears above React Navigation modals). `SegmentedControl` uses that same `react-native-reanimated` peer to slide the selection fill. `Slider` peers `@react-native-community/slider`. `ErrorBanner` peers `react-native-svg` for the megaphone and row arrow.
|
|
13
|
+
`Select` peers `@gorhom/bottom-sheet`, `react-native-reanimated`, `react-native-gesture-handler`, and `react-native-screens` (iOS `FullWindowOverlay` so the sheet appears above React Navigation modals). `SegmentedControl` uses that same `react-native-reanimated` peer to slide the selection fill. `Slider` peers `@react-native-community/slider`. `ErrorBanner` peers `react-native-svg` for the megaphone and row arrow. `HeaderIcon` and `HeaderCapsule` take an icon render function, so they add no peer; pass `expo-symbols` `SymbolView` or any icon component.
|
|
14
|
+
|
|
15
|
+
## Theme roles
|
|
16
|
+
|
|
17
|
+
The package never reads your app's own colour names (`background`, `text`, `primary`, …). Every component reads roles with its own prefix (`buttonBackground`, `formBackground`, `pageBackground`, `segmentLabel`, …), and each one has a matching optional prop. Map those roles to your palette in the `ThemeProvider` colours:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
const Colors = {
|
|
21
|
+
light: { pageBackground: palette.paper, buttonBackground: palette.brand, /* … */ },
|
|
22
|
+
dark: { pageBackground: palette.ink, buttonBackground: palette.brand, /* … */ },
|
|
23
|
+
};
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Each component doc lists its roles.
|
|
14
27
|
|
|
15
28
|
## Docs
|
|
16
29
|
|
|
17
30
|
- [Theme provider and Button usage](./docs/components/button.md)
|
|
18
31
|
- [LinkBlocks usage](./docs/components/link-blocks.md)
|
|
19
32
|
- [Field usage](./docs/components/field.md)
|
|
33
|
+
- [Choice usage](./docs/components/choice.md)
|
|
20
34
|
- [Form usage](./docs/components/form.md)
|
|
35
|
+
- [HeaderWash usage](./docs/components/header-wash.md)
|
|
36
|
+
- [FormSheet usage](./docs/components/form-sheet.md)
|
|
21
37
|
- [ErrorBanner usage](./docs/components/error-banner.md)
|
|
22
38
|
- [RadioField usage](./docs/components/radio-field.md)
|
|
23
39
|
- [Select usage](./docs/components/select.md)
|
|
24
40
|
- [SegmentedControl usage](./docs/components/segmented-control.md)
|
|
25
41
|
- [Slider usage](./docs/components/slider.md)
|
|
42
|
+
- [Header buttons (Liquid Glass) usage](./docs/components/header-button.md)
|
|
43
|
+
- [TabAccessoryButton (Liquid Glass) usage](./docs/components/tab-accessory-button.md)
|
|
44
|
+
- [Page usage](./docs/components/page.md)
|
|
26
45
|
- [Design: theme provider and Button](./docs/superpowers/specs/2026-09-24-theme-provider-button-design.md)
|
|
27
46
|
- [Design: LinkBlocks](./docs/superpowers/specs/2026-09-24-link-blocks-design.md)
|
|
28
47
|
- [Design: Field](./docs/superpowers/specs/2026-09-24-field-design.md)
|
|
@@ -33,32 +52,17 @@ npm install @studio-piot/native-ui
|
|
|
33
52
|
## Quick start
|
|
34
53
|
|
|
35
54
|
```tsx
|
|
36
|
-
import {
|
|
37
|
-
Button,
|
|
38
|
-
ThemeProvider,
|
|
39
|
-
useThemeColor,
|
|
40
|
-
} from "@studio-piot/native-ui";
|
|
55
|
+
import { Button, ThemeProvider } from "@studio-piot/native-ui";
|
|
41
56
|
|
|
42
57
|
const Colors = {
|
|
43
58
|
light: { buttonBackground: "#111", buttonLabel: "#fff" },
|
|
44
59
|
dark: { buttonBackground: "#eee", buttonLabel: "#111" },
|
|
45
60
|
};
|
|
46
61
|
|
|
47
|
-
function SaveButton({ onPress }: { onPress: () => void }) {
|
|
48
|
-
return (
|
|
49
|
-
<Button
|
|
50
|
-
label="Save"
|
|
51
|
-
onPress={onPress}
|
|
52
|
-
backgroundColor={useThemeColor("buttonBackground")}
|
|
53
|
-
labelColor={useThemeColor("buttonLabel")}
|
|
54
|
-
/>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
62
|
export function App() {
|
|
59
63
|
return (
|
|
60
64
|
<ThemeProvider colors={Colors}>
|
|
61
|
-
<
|
|
65
|
+
<Button label="Save" onPress={() => undefined} />
|
|
62
66
|
</ThemeProvider>
|
|
63
67
|
);
|
|
64
68
|
}
|
|
@@ -1,16 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
1
2
|
import { type StyleProp, type TextStyle, type ViewStyle } from "react-native";
|
|
3
|
+
import { type ButtonVariant } from "./buttonAppearance";
|
|
2
4
|
import { type ButtonRadius } from "./buttonRadius";
|
|
5
|
+
export declare const BUTTON_ICON_SIZE = 20;
|
|
6
|
+
/** Renders the icon in the button's content colour, e.g. an expo-symbols `SymbolView`. */
|
|
7
|
+
export type ButtonIcon = (props: {
|
|
8
|
+
color: string;
|
|
9
|
+
size: number;
|
|
10
|
+
}) => ReactNode;
|
|
11
|
+
export type ButtonIconPosition = "start" | "end" | "only";
|
|
3
12
|
export type ButtonProps = {
|
|
13
|
+
/** Shown text, and the accessibility label (also when `iconPosition="only"`). */
|
|
4
14
|
label: string;
|
|
5
15
|
onPress: () => void;
|
|
6
|
-
|
|
7
|
-
|
|
16
|
+
/** Filled: fill. Outline: border, label and icon. Defaults to theme role `buttonBackground`. */
|
|
17
|
+
backgroundColor?: string;
|
|
18
|
+
/** Filled: label, icon and spinner. Defaults to theme role `buttonLabel`. */
|
|
19
|
+
labelColor?: string;
|
|
8
20
|
disabled?: boolean;
|
|
9
21
|
loading?: boolean;
|
|
10
|
-
variant?:
|
|
22
|
+
variant?: ButtonVariant;
|
|
11
23
|
radius?: ButtonRadius;
|
|
24
|
+
icon?: ButtonIcon;
|
|
25
|
+
/** Default `"start"`. `"only"` hides the label text; `label` stays the accessibility name. */
|
|
26
|
+
iconPosition?: ButtonIconPosition;
|
|
27
|
+
iconSize?: number;
|
|
12
28
|
style?: StyleProp<ViewStyle>;
|
|
13
29
|
labelStyle?: StyleProp<TextStyle>;
|
|
14
30
|
};
|
|
15
|
-
export declare function Button({ label, onPress, backgroundColor, labelColor, disabled, loading, variant, radius, style, labelStyle, }: ButtonProps): import("react").JSX.Element;
|
|
31
|
+
export declare function Button({ label, onPress, backgroundColor: backgroundColorProp, labelColor: labelColorProp, disabled, loading, variant, radius, icon, iconPosition, iconSize, style, labelStyle, }: ButtonProps): import("react").JSX.Element;
|
|
16
32
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAML,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGtE,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,0FAA0F;AAC1F,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,KAAK,SAAS,CAAC;AAE/E,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;AAE1D,MAAM,MAAM,WAAW,GAAG;IACxB,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gGAAgG;IAChG,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,8FAA8F;IAC9F,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACnC,CAAC;AAEF,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,OAAO,EACP,eAAe,EAAE,mBAAmB,EACpC,UAAU,EAAE,cAAc,EAC1B,QAAgB,EAChB,OAAe,EACf,OAAkB,EAClB,MAAa,EACb,IAAI,EACJ,YAAsB,EACtB,QAA2B,EAC3B,KAAK,EACL,UAAU,GACX,EAAE,WAAW,+BAqDb"}
|
|
@@ -1,44 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BUTTON_ICON_SIZE = void 0;
|
|
3
4
|
exports.Button = Button;
|
|
4
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
6
|
const react_native_1 = require("react-native");
|
|
7
|
+
const useResolvedFieldColor_1 = require("../Field/useResolvedFieldColor");
|
|
8
|
+
const buttonAppearance_1 = require("./buttonAppearance");
|
|
6
9
|
const buttonRadius_1 = require("./buttonRadius");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
10
|
+
const buttonThemeRoles_1 = require("./buttonThemeRoles");
|
|
11
|
+
exports.BUTTON_ICON_SIZE = 20;
|
|
12
|
+
function Button({ label, onPress, backgroundColor: backgroundColorProp, labelColor: labelColorProp, disabled = false, loading = false, variant = "filled", radius = "xl", icon, iconPosition = "start", iconSize = exports.BUTTON_ICON_SIZE, style, labelStyle, }) {
|
|
13
|
+
const backgroundColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(backgroundColorProp, buttonThemeRoles_1.BUTTON_THEME_ROLES.backgroundColor);
|
|
14
|
+
const labelColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(labelColorProp, buttonThemeRoles_1.BUTTON_THEME_ROLES.labelColor);
|
|
15
|
+
const colors = (0, buttonAppearance_1.buttonColors)(variant, backgroundColor, labelColor);
|
|
16
|
+
const iconNode = icon?.({ color: colors.content, size: iconSize });
|
|
17
|
+
const showLabel = !(icon && iconPosition === "only");
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.Pressable, { accessibilityLabel: label, accessibilityRole: "button", accessibilityState: { disabled: disabled || loading, busy: loading }, disabled: disabled || loading, onPress: onPress, style: ({ pressed }) => [
|
|
12
19
|
styles.shell,
|
|
13
|
-
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
:
|
|
21
|
-
|
|
20
|
+
{
|
|
21
|
+
borderRadius: (0, buttonRadius_1.buttonRadiusValue)(radius),
|
|
22
|
+
backgroundColor: colors.fill,
|
|
23
|
+
opacity: (0, buttonAppearance_1.buttonOpacity)({ disabled, loading, pressed }),
|
|
24
|
+
},
|
|
25
|
+
colors.border != null && {
|
|
26
|
+
borderWidth: 1,
|
|
27
|
+
borderColor: colors.border,
|
|
28
|
+
},
|
|
22
29
|
style,
|
|
23
|
-
], children: loading ? ((0, jsx_runtime_1.jsx)(react_native_1.
|
|
24
|
-
styles.label,
|
|
25
|
-
{ color: isOutline ? backgroundColor : labelColor },
|
|
26
|
-
labelStyle,
|
|
27
|
-
], children: label })) }));
|
|
30
|
+
], children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [styles.content, loading && styles.hidden], children: [iconPosition !== "end" ? iconNode : null, showLabel ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.label, { color: colors.content }, labelStyle], children: label })) : null, iconPosition === "end" ? iconNode : null] }), loading ? ((0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { color: colors.content, size: "small", style: react_native_1.StyleSheet.absoluteFill })) : null] }));
|
|
28
31
|
}
|
|
29
32
|
const styles = react_native_1.StyleSheet.create({
|
|
30
33
|
shell: {
|
|
31
34
|
width: "100%",
|
|
32
35
|
minHeight: 52,
|
|
36
|
+
paddingHorizontal: 20,
|
|
37
|
+
paddingVertical: 12,
|
|
33
38
|
alignItems: "center",
|
|
34
39
|
justifyContent: "center",
|
|
35
40
|
},
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
content: {
|
|
42
|
+
flexDirection: "row",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
justifyContent: "center",
|
|
45
|
+
gap: 8,
|
|
46
|
+
},
|
|
47
|
+
hidden: {
|
|
48
|
+
opacity: 0,
|
|
38
49
|
},
|
|
39
50
|
label: {
|
|
51
|
+
flexShrink: 1,
|
|
40
52
|
fontSize: 17,
|
|
41
53
|
fontWeight: "600",
|
|
54
|
+
textAlign: "center",
|
|
42
55
|
},
|
|
43
56
|
});
|
|
44
57
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ButtonVariant = "filled" | "outline";
|
|
2
|
+
/**
|
|
3
|
+
* Fill, border and content (label, icon, spinner) colours for a variant.
|
|
4
|
+
* Outline draws everything in `background`; `label` is unused there.
|
|
5
|
+
*/
|
|
6
|
+
export declare function buttonColors(variant: ButtonVariant, background: string, label: string): {
|
|
7
|
+
fill: string;
|
|
8
|
+
border: string | undefined;
|
|
9
|
+
content: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Disabled fades the button. Loading only blocks presses: a spinner on a
|
|
13
|
+
* faded button reads as broken, not busy.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buttonOpacity({ disabled, loading, pressed, }: {
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
loading: boolean;
|
|
18
|
+
pressed: boolean;
|
|
19
|
+
}): number;
|
|
20
|
+
//# sourceMappingURL=buttonAppearance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttonAppearance.d.ts","sourceRoot":"","sources":["../../../src/components/Button/buttonAppearance.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEjD;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,aAAa,EACtB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,GACZ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAK/D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,OAAO,EACP,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,MAAM,CAQT"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buttonColors = buttonColors;
|
|
4
|
+
exports.buttonOpacity = buttonOpacity;
|
|
5
|
+
/**
|
|
6
|
+
* Fill, border and content (label, icon, spinner) colours for a variant.
|
|
7
|
+
* Outline draws everything in `background`; `label` is unused there.
|
|
8
|
+
*/
|
|
9
|
+
function buttonColors(variant, background, label) {
|
|
10
|
+
if (variant === "outline") {
|
|
11
|
+
return { fill: "transparent", border: background, content: background };
|
|
12
|
+
}
|
|
13
|
+
return { fill: background, border: undefined, content: label };
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Disabled fades the button. Loading only blocks presses: a spinner on a
|
|
17
|
+
* faded button reads as broken, not busy.
|
|
18
|
+
*/
|
|
19
|
+
function buttonOpacity({ disabled, loading, pressed, }) {
|
|
20
|
+
if (disabled) {
|
|
21
|
+
return 0.4;
|
|
22
|
+
}
|
|
23
|
+
if (pressed && !loading) {
|
|
24
|
+
return 0.75;
|
|
25
|
+
}
|
|
26
|
+
return 1;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=buttonAppearance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttonAppearance.js","sourceRoot":"","sources":["../../../src/components/Button/buttonAppearance.ts"],"names":[],"mappings":";;AAMA,oCASC;AAMD,sCAgBC;AAnCD;;;GAGG;AACH,SAAgB,YAAY,CAC1B,OAAsB,EACtB,UAAkB,EAClB,KAAa;IAEb,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IAC1E,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACjE,CAAC;AAED;;;GAGG;AACH,SAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,OAAO,EACP,OAAO,GAKR;IACC,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,GAAG,CAAC;IACb,CAAC;IACD,IAAI,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttonThemeRoles.d.ts","sourceRoot":"","sources":["../../../src/components/Button/buttonThemeRoles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BUTTON_THEME_ROLES = void 0;
|
|
4
|
+
exports.BUTTON_THEME_ROLES = {
|
|
5
|
+
backgroundColor: "buttonBackground",
|
|
6
|
+
labelColor: "buttonLabel",
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=buttonThemeRoles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttonThemeRoles.js","sourceRoot":"","sources":["../../../src/components/Button/buttonThemeRoles.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;IAChC,eAAe,EAAE,kBAAkB;IACnC,UAAU,EAAE,aAAa;CACjB,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export { Button, type ButtonProps } from "./Button";
|
|
1
|
+
export { Button, BUTTON_ICON_SIZE, type ButtonIcon, type ButtonIconPosition, type ButtonProps, } from "./Button";
|
|
2
|
+
export type { ButtonVariant } from "./buttonAppearance";
|
|
2
3
|
export { buttonRadiusValue, type ButtonRadius } from "./buttonRadius";
|
|
4
|
+
export { BUTTON_THEME_ROLES, type ButtonThemeColorProp, } from "./buttonThemeRoles";
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,WAAW,GACjB,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EACL,kBAAkB,EAClB,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buttonRadiusValue = exports.Button = void 0;
|
|
3
|
+
exports.BUTTON_THEME_ROLES = exports.buttonRadiusValue = exports.BUTTON_ICON_SIZE = exports.Button = void 0;
|
|
4
4
|
var Button_1 = require("./Button");
|
|
5
5
|
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return Button_1.Button; } });
|
|
6
|
+
Object.defineProperty(exports, "BUTTON_ICON_SIZE", { enumerable: true, get: function () { return Button_1.BUTTON_ICON_SIZE; } });
|
|
6
7
|
var buttonRadius_1 = require("./buttonRadius");
|
|
7
8
|
Object.defineProperty(exports, "buttonRadiusValue", { enumerable: true, get: function () { return buttonRadius_1.buttonRadiusValue; } });
|
|
9
|
+
var buttonThemeRoles_1 = require("./buttonThemeRoles");
|
|
10
|
+
Object.defineProperty(exports, "BUTTON_THEME_ROLES", { enumerable: true, get: function () { return buttonThemeRoles_1.BUTTON_THEME_ROLES; } });
|
|
8
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":";;;AAAA,mCAMkB;AALhB,gGAAA,MAAM,OAAA;AACN,0GAAA,gBAAgB,OAAA;AAMlB,+CAAsE;AAA7D,iHAAA,iBAAiB,OAAA;AAC1B,uDAG4B;AAF1B,sHAAA,kBAAkB,OAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ChoiceProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* One option in a list of next steps: an icon, a title and an optional
|
|
4
|
+
* description, in a filled row. Tapping it acts straight away, usually to
|
|
5
|
+
* open the next screen. For picking a value, use RadioField or Select.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Choice({ title, description, icon, onPress, disabled, iconSize, radius, backgroundColor: backgroundColorProp, titleColor: titleColorProp, descriptionColor: descriptionColorProp, iconColor: iconColorProp, style, }: ChoiceProps): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=Choice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Choice.d.ts","sourceRoot":"","sources":["../../../src/components/Choice/Choice.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,WAAW,EACX,IAAI,EACJ,OAAO,EACP,QAAgB,EAChB,QAA2B,EAC3B,MAAa,EACb,eAAe,EAAE,mBAAmB,EACpC,UAAU,EAAE,cAAc,EAC1B,gBAAgB,EAAE,oBAAoB,EACtC,SAAS,EAAE,aAAa,EACxB,KAAK,GACN,EAAE,WAAW,+BAwDb"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Choice = Choice;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
const buttonAppearance_1 = require("../Button/buttonAppearance");
|
|
7
|
+
const buttonRadius_1 = require("../Button/buttonRadius");
|
|
8
|
+
const useResolvedFieldColor_1 = require("../Field/useResolvedFieldColor");
|
|
9
|
+
const choiceLayout_1 = require("./choiceLayout");
|
|
10
|
+
const choiceThemeRoles_1 = require("./choiceThemeRoles");
|
|
11
|
+
/**
|
|
12
|
+
* One option in a list of next steps: an icon, a title and an optional
|
|
13
|
+
* description, in a filled row. Tapping it acts straight away, usually to
|
|
14
|
+
* open the next screen. For picking a value, use RadioField or Select.
|
|
15
|
+
*/
|
|
16
|
+
function Choice({ title, description, icon, onPress, disabled = false, iconSize = choiceLayout_1.CHOICE_ICON_SIZE, radius = "xl", backgroundColor: backgroundColorProp, titleColor: titleColorProp, descriptionColor: descriptionColorProp, iconColor: iconColorProp, style, }) {
|
|
17
|
+
const backgroundColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(backgroundColorProp, choiceThemeRoles_1.CHOICE_THEME_ROLES.backgroundColor);
|
|
18
|
+
const titleColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(titleColorProp, choiceThemeRoles_1.CHOICE_THEME_ROLES.titleColor);
|
|
19
|
+
const descriptionColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(descriptionColorProp, choiceThemeRoles_1.CHOICE_THEME_ROLES.descriptionColor);
|
|
20
|
+
const iconColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(iconColorProp, choiceThemeRoles_1.CHOICE_THEME_ROLES.iconColor);
|
|
21
|
+
const slot = (0, choiceLayout_1.choiceIconSlot)(iconSize);
|
|
22
|
+
return (
|
|
23
|
+
// No explicit label: the row groups its text, so VoiceOver reads the
|
|
24
|
+
// title and description together ("Running, Outdoors, with GPS, button").
|
|
25
|
+
(0, jsx_runtime_1.jsxs)(react_native_1.Pressable, { accessibilityRole: "button", accessibilityState: { disabled }, disabled: disabled, onPress: onPress, style: ({ pressed }) => [
|
|
26
|
+
styles.row,
|
|
27
|
+
{
|
|
28
|
+
backgroundColor,
|
|
29
|
+
borderRadius: (0, buttonRadius_1.buttonRadiusValue)(radius),
|
|
30
|
+
opacity: (0, buttonAppearance_1.buttonOpacity)({ disabled, loading: false, pressed }),
|
|
31
|
+
},
|
|
32
|
+
style,
|
|
33
|
+
], children: [icon ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { importantForAccessibility: "no-hide-descendants", accessibilityElementsHidden: true, style: [styles.icon, { width: slot, height: slot }], children: icon({ color: iconColor, size: iconSize }) })) : null, (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.copy, children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.title, { color: titleColor }], children: title }), description ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.description, { color: descriptionColor }], children: description })) : null] })] }));
|
|
34
|
+
}
|
|
35
|
+
const styles = react_native_1.StyleSheet.create({
|
|
36
|
+
row: {
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
flexDirection: "row",
|
|
39
|
+
gap: 12,
|
|
40
|
+
minHeight: 72,
|
|
41
|
+
paddingHorizontal: 16,
|
|
42
|
+
paddingVertical: 14,
|
|
43
|
+
},
|
|
44
|
+
icon: {
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
justifyContent: "center",
|
|
47
|
+
},
|
|
48
|
+
copy: {
|
|
49
|
+
flex: 1,
|
|
50
|
+
gap: 2,
|
|
51
|
+
},
|
|
52
|
+
title: {
|
|
53
|
+
fontSize: 17,
|
|
54
|
+
fontWeight: "600",
|
|
55
|
+
},
|
|
56
|
+
description: {
|
|
57
|
+
fontSize: 13,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=Choice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Choice.js","sourceRoot":"","sources":["../../../src/components/Choice/Choice.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Default icon box, sized for an SF Symbol next to a two-line label. */
|
|
2
|
+
export declare const CHOICE_ICON_SIZE = 28;
|
|
3
|
+
/** Icon column width, so titles line up across a list of choices. */
|
|
4
|
+
export declare const CHOICE_ICON_SLOT = 32;
|
|
5
|
+
/** The icon column: the steady slot, or the icon itself when it is larger. Pure so it can be unit-tested. */
|
|
6
|
+
export declare function choiceIconSlot(iconSize: number): number;
|
|
7
|
+
//# sourceMappingURL=choiceLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choiceLayout.d.ts","sourceRoot":"","sources":["../../../src/components/Choice/choiceLayout.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,qEAAqE;AACrE,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,6GAA6G;AAC7G,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEvD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CHOICE_ICON_SLOT = exports.CHOICE_ICON_SIZE = void 0;
|
|
4
|
+
exports.choiceIconSlot = choiceIconSlot;
|
|
5
|
+
/** Default icon box, sized for an SF Symbol next to a two-line label. */
|
|
6
|
+
exports.CHOICE_ICON_SIZE = 28;
|
|
7
|
+
/** Icon column width, so titles line up across a list of choices. */
|
|
8
|
+
exports.CHOICE_ICON_SLOT = 32;
|
|
9
|
+
/** The icon column: the steady slot, or the icon itself when it is larger. Pure so it can be unit-tested. */
|
|
10
|
+
function choiceIconSlot(iconSize) {
|
|
11
|
+
return Math.max(exports.CHOICE_ICON_SLOT, iconSize);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=choiceLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choiceLayout.js","sourceRoot":"","sources":["../../../src/components/Choice/choiceLayout.ts"],"names":[],"mappings":";;;AAMA,wCAEC;AARD,yEAAyE;AAC5D,QAAA,gBAAgB,GAAG,EAAE,CAAC;AACnC,qEAAqE;AACxD,QAAA,gBAAgB,GAAG,EAAE,CAAC;AAEnC,6GAA6G;AAC7G,SAAgB,cAAc,CAAC,QAAgB;IAC7C,OAAO,IAAI,CAAC,GAAG,CAAC,wBAAgB,EAAE,QAAQ,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const CHOICE_THEME_ROLES: {
|
|
2
|
+
readonly backgroundColor: "choiceBackground";
|
|
3
|
+
readonly titleColor: "choiceTitle";
|
|
4
|
+
readonly descriptionColor: "choiceDescription";
|
|
5
|
+
readonly iconColor: "choiceIcon";
|
|
6
|
+
};
|
|
7
|
+
export type ChoiceThemeColorProp = keyof typeof CHOICE_THEME_ROLES;
|
|
8
|
+
//# sourceMappingURL=choiceThemeRoles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choiceThemeRoles.d.ts","sourceRoot":"","sources":["../../../src/components/Choice/choiceThemeRoles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;CAKrB,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CHOICE_THEME_ROLES = void 0;
|
|
4
|
+
exports.CHOICE_THEME_ROLES = {
|
|
5
|
+
backgroundColor: "choiceBackground",
|
|
6
|
+
titleColor: "choiceTitle",
|
|
7
|
+
descriptionColor: "choiceDescription",
|
|
8
|
+
iconColor: "choiceIcon",
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=choiceThemeRoles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choiceThemeRoles.js","sourceRoot":"","sources":["../../../src/components/Choice/choiceThemeRoles.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;IAChC,eAAe,EAAE,kBAAkB;IACnC,UAAU,EAAE,aAAa;IACzB,gBAAgB,EAAE,mBAAmB;IACrC,SAAS,EAAE,YAAY;CACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Choice/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACnF,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CHOICE_THEME_ROLES = exports.CHOICE_ICON_SIZE = exports.Choice = void 0;
|
|
4
|
+
var Choice_1 = require("./Choice");
|
|
5
|
+
Object.defineProperty(exports, "Choice", { enumerable: true, get: function () { return Choice_1.Choice; } });
|
|
6
|
+
var choiceLayout_1 = require("./choiceLayout");
|
|
7
|
+
Object.defineProperty(exports, "CHOICE_ICON_SIZE", { enumerable: true, get: function () { return choiceLayout_1.CHOICE_ICON_SIZE; } });
|
|
8
|
+
var choiceThemeRoles_1 = require("./choiceThemeRoles");
|
|
9
|
+
Object.defineProperty(exports, "CHOICE_THEME_ROLES", { enumerable: true, get: function () { return choiceThemeRoles_1.CHOICE_THEME_ROLES; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Choice/index.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,+CAAkD;AAAzC,gHAAA,gBAAgB,OAAA;AACzB,uDAAmF;AAA1E,sHAAA,kBAAkB,OAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
import type { ButtonIcon } from "../Button";
|
|
3
|
+
import type { ButtonRadius } from "../Button/buttonRadius";
|
|
4
|
+
export type ChoiceProps = {
|
|
5
|
+
title: string;
|
|
6
|
+
/** Second line under the title. */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** `({ color, size }) => ReactNode`, e.g. an expo-symbols `SymbolView`. */
|
|
9
|
+
icon?: ButtonIcon;
|
|
10
|
+
onPress: () => void;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Icon box. Default 28. */
|
|
13
|
+
iconSize?: number;
|
|
14
|
+
/** Default `"xl"` (12), the same scale as `Button`. */
|
|
15
|
+
radius?: ButtonRadius;
|
|
16
|
+
/** Row fill. Defaults to theme role `choiceBackground`. */
|
|
17
|
+
backgroundColor?: string;
|
|
18
|
+
/** Defaults to theme role `choiceTitle`. */
|
|
19
|
+
titleColor?: string;
|
|
20
|
+
/** Defaults to theme role `choiceDescription`. */
|
|
21
|
+
descriptionColor?: string;
|
|
22
|
+
/** Defaults to theme role `choiceIcon`. */
|
|
23
|
+
iconColor?: string;
|
|
24
|
+
style?: StyleProp<ViewStyle>;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Choice/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,2DAA2D;IAC3D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/Choice/types.ts"],"names":[],"mappings":""}
|
|
@@ -4,5 +4,5 @@ import type { ErrorBannerProps } from "./types";
|
|
|
4
4
|
* exit animation can play. It is not tied to a form shell: pass `errors`,
|
|
5
5
|
* `onJump`, and `onDismiss`. `Form` does that by default.
|
|
6
6
|
*/
|
|
7
|
-
export declare function ErrorBanner({ open, errors, onJump, onDismiss, onHeightChange, safeAreaTop, paddingHorizontal, backgroundColor: backgroundColorProp, textColor: textColorProp, secondaryColor: secondaryColorProp, dividerColor: dividerColorProp, accentColor: accentColorProp, }: ErrorBannerProps): import("react").JSX.Element;
|
|
7
|
+
export declare function ErrorBanner({ open, errors, onJump, onDismiss, onHeightChange, safeAreaTop, paddingHorizontal: paddingHorizontalProp, backgroundColor: backgroundColorProp, textColor: textColorProp, secondaryColor: secondaryColorProp, dividerColor: dividerColorProp, accentColor: accentColorProp, }: ErrorBannerProps): import("react").JSX.Element;
|
|
8
8
|
//# sourceMappingURL=ErrorBanner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBanner.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorBanner/ErrorBanner.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorBanner.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorBanner/ErrorBanner.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAIhD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,MAAM,EACN,MAAM,EACN,SAAS,EACT,cAAc,EACd,WAAW,EACX,iBAAiB,EAAE,qBAAqB,EACxC,eAAe,EAAE,mBAAmB,EACpC,SAAS,EAAE,aAAa,EACxB,cAAc,EAAE,kBAAkB,EAClC,YAAY,EAAE,gBAAgB,EAC9B,WAAW,EAAE,eAAe,GAC7B,EAAE,gBAAgB,+BAwIlB"}
|