@hzblj/kara-components 0.6.0 → 0.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/CHANGELOG.md +91 -0
- package/README.md +31 -3
- package/lib/module/atoms/activity-indicator/activity-indicator.android.js +42 -0
- package/lib/module/atoms/activity-indicator/activity-indicator.android.js.map +1 -0
- package/lib/module/atoms/activity-indicator/activity-indicator.ios.js +19 -0
- package/lib/module/atoms/activity-indicator/activity-indicator.ios.js.map +1 -0
- package/lib/module/atoms/activity-indicator/activity-indicator.types.js +4 -0
- package/lib/module/atoms/activity-indicator/activity-indicator.types.js.map +1 -0
- package/lib/module/atoms/activity-indicator/index.js +2 -1
- package/lib/module/atoms/activity-indicator/index.js.map +1 -1
- package/lib/module/atoms/avatar/avatar.js +2 -4
- package/lib/module/atoms/avatar/avatar.js.map +1 -1
- package/lib/module/atoms/blur-view/blur-view.android.js +100 -0
- package/lib/module/atoms/blur-view/blur-view.android.js.map +1 -0
- package/lib/module/atoms/blur-view/blur-view.ios.js +43 -0
- package/lib/module/atoms/blur-view/blur-view.ios.js.map +1 -0
- package/lib/module/atoms/blur-view/blur-view.types.js +4 -0
- package/lib/module/atoms/blur-view/blur-view.types.js.map +1 -0
- package/lib/module/atoms/blur-view/index.js +5 -0
- package/lib/module/atoms/blur-view/index.js.map +1 -0
- package/lib/module/atoms/checkbox/checkbox.android.js +7 -3
- package/lib/module/atoms/checkbox/checkbox.android.js.map +1 -1
- package/lib/module/atoms/date-picker/date-picker.ios.js +32 -11
- package/lib/module/atoms/date-picker/date-picker.ios.js.map +1 -1
- package/lib/module/atoms/glass-view/glass-view.android.js +36 -5
- package/lib/module/atoms/glass-view/glass-view.android.js.map +1 -1
- package/lib/module/atoms/image/image.js +13 -6
- package/lib/module/atoms/image/image.js.map +1 -1
- package/lib/module/atoms/image/image.types.js +4 -0
- package/lib/module/atoms/image/image.types.js.map +1 -0
- package/lib/module/atoms/image/index.js +1 -0
- package/lib/module/atoms/image/index.js.map +1 -1
- package/lib/module/atoms/index.js +1 -1
- package/lib/module/atoms/index.js.map +1 -1
- package/lib/module/atoms/island/island.android.js +6 -2
- package/lib/module/atoms/island/island.android.js.map +1 -1
- package/lib/module/atoms/island/island.ios.js +5 -2
- package/lib/module/atoms/island/island.ios.js.map +1 -1
- package/lib/module/atoms/pressable/pressable.js +38 -6
- package/lib/module/atoms/pressable/pressable.js.map +1 -1
- package/lib/module/atoms/rn-flat-list/rn-flat-list.js +10 -9
- package/lib/module/atoms/rn-flat-list/rn-flat-list.js.map +1 -1
- package/lib/module/atoms/rn-section-list/rn-section-list.js +5 -8
- package/lib/module/atoms/rn-section-list/rn-section-list.js.map +1 -1
- package/lib/module/atoms/rn-text/rn-text.js +5 -2
- package/lib/module/atoms/rn-text/rn-text.js.map +1 -1
- package/lib/module/atoms/segmented-control/index.js +1 -1
- package/lib/module/atoms/segmented-control/index.js.map +1 -1
- package/lib/module/atoms/segmented-control/segmented-control.android.js +74 -0
- package/lib/module/atoms/segmented-control/segmented-control.android.js.map +1 -0
- package/lib/module/atoms/segmented-control/segmented-control.ios.js +44 -0
- package/lib/module/atoms/segmented-control/segmented-control.ios.js.map +1 -0
- package/lib/module/atoms/skeleton/skeleton.js +5 -5
- package/lib/module/atoms/skeleton/skeleton.js.map +1 -1
- package/lib/module/atoms/switch/switch.android.js +4 -1
- package/lib/module/atoms/switch/switch.android.js.map +1 -1
- package/lib/module/atoms/text/text.android.js +5 -2
- package/lib/module/atoms/text/text.android.js.map +1 -1
- package/lib/module/atoms/text/text.ios.js +14 -3
- package/lib/module/atoms/text/text.ios.js.map +1 -1
- package/lib/module/molecules/collapsible/collapsible.android.js +37 -7
- package/lib/module/molecules/collapsible/collapsible.android.js.map +1 -1
- package/lib/module/molecules/navigation-bar/navigation-bar.android.js +2 -8
- package/lib/module/molecules/navigation-bar/navigation-bar.android.js.map +1 -1
- package/lib/module/molecules/pager/pager.android.js +5 -4
- package/lib/module/molecules/pager/pager.android.js.map +1 -1
- package/lib/module/molecules/scroll-edge-container/scroll-edge-container.android.js +114 -11
- package/lib/module/molecules/scroll-edge-container/scroll-edge-container.android.js.map +1 -1
- package/lib/module/molecules/search-bar/search-bar.js +15 -2
- package/lib/module/molecules/search-bar/search-bar.js.map +1 -1
- package/lib/module/molecules/stepper/stepper.ios.js +45 -8
- package/lib/module/molecules/stepper/stepper.ios.js.map +1 -1
- package/lib/module/molecules/tooltip/tooltip.android.js +16 -5
- package/lib/module/molecules/tooltip/tooltip.android.js.map +1 -1
- package/lib/module/organisms/action-sheet/action-sheet.android.js +41 -20
- package/lib/module/organisms/action-sheet/action-sheet.android.js.map +1 -1
- package/lib/module/organisms/action-sheet/action-sheet.ios.js +24 -8
- package/lib/module/organisms/action-sheet/action-sheet.ios.js.map +1 -1
- package/lib/module/organisms/alert/alert.ios.js +15 -2
- package/lib/module/organisms/alert/alert.ios.js.map +1 -1
- package/lib/module/organisms/form/form.android.js +22 -9
- package/lib/module/organisms/form/form.android.js.map +1 -1
- package/lib/module/organisms/swipe-actions/swipe-actions.android.js +125 -11
- package/lib/module/organisms/swipe-actions/swipe-actions.android.js.map +1 -1
- package/lib/module/organisms/swipe-actions/swipe-actions.ios.js +46 -18
- package/lib/module/organisms/swipe-actions/swipe-actions.ios.js.map +1 -1
- package/lib/module/ripple-clip.js +9 -1
- package/lib/module/ripple-clip.js.map +1 -1
- package/lib/module/templates/screen/screen.android.js +31 -10
- package/lib/module/templates/screen/screen.android.js.map +1 -1
- package/lib/typescript/atoms/activity-indicator/activity-indicator.d.ts +1 -3
- package/lib/typescript/atoms/activity-indicator/activity-indicator.ios.d.ts +3 -0
- package/lib/typescript/atoms/activity-indicator/activity-indicator.types.d.ts +17 -0
- package/lib/typescript/atoms/activity-indicator/index.d.ts +1 -0
- package/lib/typescript/atoms/avatar/avatar.types.d.ts +5 -0
- package/lib/typescript/atoms/badge/badge.types.d.ts +3 -0
- package/lib/typescript/atoms/blur-view/blur-view.d.ts +1 -0
- package/lib/typescript/atoms/blur-view/blur-view.ios.d.ts +3 -0
- package/lib/typescript/atoms/blur-view/blur-view.types.d.ts +31 -0
- package/lib/typescript/atoms/blur-view/index.d.ts +2 -0
- package/lib/typescript/atoms/box/a-box.d.ts +1 -1
- package/lib/typescript/atoms/button/button.types.d.ts +12 -0
- package/lib/typescript/atoms/card/card.types.d.ts +6 -0
- package/lib/typescript/atoms/checkbox/checkbox.types.d.ts +5 -0
- package/lib/typescript/atoms/chip/chip.types.d.ts +5 -0
- package/lib/typescript/atoms/color-picker/color-picker.types.d.ts +4 -0
- package/lib/typescript/atoms/date-picker/date-picker.ios.d.ts +6 -1
- package/lib/typescript/atoms/date-picker/date-picker.types.d.ts +14 -0
- package/lib/typescript/atoms/divider/divider.types.d.ts +3 -0
- package/lib/typescript/atoms/fab/fab.types.d.ts +7 -0
- package/lib/typescript/atoms/glass-view/glass-view.types.d.ts +13 -5
- package/lib/typescript/atoms/h-stack/h-stack.types.d.ts +6 -0
- package/lib/typescript/atoms/icon/icon.types.d.ts +8 -0
- package/lib/typescript/atoms/icon-button/icon-button.types.d.ts +5 -0
- package/lib/typescript/atoms/image/image.d.ts +12 -4
- package/lib/typescript/atoms/image/image.types.d.ts +4 -0
- package/lib/typescript/atoms/image/index.d.ts +1 -0
- package/lib/typescript/atoms/index.d.ts +1 -1
- package/lib/typescript/atoms/island/island.types.d.ts +10 -2
- package/lib/typescript/atoms/list/list.types.d.ts +2 -0
- package/lib/typescript/atoms/picker/picker.types.d.ts +12 -0
- package/lib/typescript/atoms/pressable/pressable.types.d.ts +10 -0
- package/lib/typescript/atoms/progress/progress.types.d.ts +6 -0
- package/lib/typescript/atoms/rn-flat-list/rn-flat-list.d.ts +5 -8
- package/lib/typescript/atoms/rn-flat-list/rn-flat-list.types.d.ts +3 -1
- package/lib/typescript/atoms/rn-scroll-view/rn-scroll-view.types.d.ts +4 -0
- package/lib/typescript/atoms/rn-section-list/rn-section-list.d.ts +2 -8
- package/lib/typescript/atoms/rn-section-list/rn-section-list.types.d.ts +3 -1
- package/lib/typescript/atoms/rn-text/rn-text.types.d.ts +10 -1
- package/lib/typescript/atoms/rn-view/rn-view.types.d.ts +2 -0
- package/lib/typescript/atoms/scroll-view/scroll-view.types.d.ts +4 -0
- package/lib/typescript/atoms/segmented-control/segmented-control.d.ts +1 -6
- package/lib/typescript/atoms/segmented-control/segmented-control.ios.d.ts +7 -0
- package/lib/typescript/atoms/segmented-control/segmented-control.types.d.ts +13 -0
- package/lib/typescript/atoms/skeleton/skeleton.types.d.ts +11 -2
- package/lib/typescript/atoms/slider/slider.types.d.ts +7 -0
- package/lib/typescript/atoms/spacer/spacer.types.d.ts +3 -0
- package/lib/typescript/atoms/surface/surface.types.d.ts +7 -0
- package/lib/typescript/atoms/switch/switch.types.d.ts +8 -0
- package/lib/typescript/atoms/text/text.types.d.ts +18 -1
- package/lib/typescript/atoms/text-field/text-field.types.d.ts +12 -0
- package/lib/typescript/atoms/v-stack/v-stack.types.d.ts +9 -0
- package/lib/typescript/atoms/z-stack/z-stack.types.d.ts +8 -0
- package/lib/typescript/molecules/collapsible/collapsible.types.d.ts +8 -0
- package/lib/typescript/molecules/empty-state/empty-state.types.d.ts +5 -0
- package/lib/typescript/molecules/label/label.types.d.ts +6 -0
- package/lib/typescript/molecules/labeled-content/labeled-content.types.d.ts +6 -0
- package/lib/typescript/molecules/link/link.types.d.ts +6 -0
- package/lib/typescript/molecules/list-item/list-item.types.d.ts +9 -0
- package/lib/typescript/molecules/navigation-bar/navigation-bar.types.d.ts +8 -0
- package/lib/typescript/molecules/pager/pager.types.d.ts +2 -0
- package/lib/typescript/molecules/radio-group/radio-group.types.d.ts +10 -0
- package/lib/typescript/molecules/rn-list-item/rn-list-item.types.d.ts +1 -1
- package/lib/typescript/molecules/rn-tooltip/rn-tooltip.types.d.ts +11 -0
- package/lib/typescript/molecules/scroll-edge-container/scroll-edge-container.types.d.ts +7 -2
- package/lib/typescript/molecules/search-bar/search-bar.types.d.ts +8 -0
- package/lib/typescript/molecules/stepper/stepper.ios.d.ts +5 -0
- package/lib/typescript/molecules/stepper/stepper.types.d.ts +10 -0
- package/lib/typescript/molecules/tooltip/tooltip.types.d.ts +12 -0
- package/lib/typescript/organisms/action-sheet/action-sheet.types.d.ts +8 -0
- package/lib/typescript/organisms/alert/alert.types.d.ts +11 -0
- package/lib/typescript/organisms/context-menu/context-menu.types.d.ts +4 -0
- package/lib/typescript/organisms/fab-menu/fab-menu.types.d.ts +2 -0
- package/lib/typescript/organisms/form/form.types.d.ts +6 -0
- package/lib/typescript/organisms/menu/menu.types.d.ts +17 -0
- package/lib/typescript/organisms/sheet/sheet.types.d.ts +19 -0
- package/lib/typescript/organisms/snackbar/snackbar.types.d.ts +8 -0
- package/lib/typescript/organisms/swipe-actions/swipe-actions.types.d.ts +36 -13
- package/lib/typescript/templates/screen/screen.types.d.ts +9 -0
- package/package.json +5 -7
- package/src/atoms/activity-indicator/activity-indicator.android.tsx +32 -0
- package/src/atoms/activity-indicator/activity-indicator.ios.tsx +15 -0
- package/src/atoms/activity-indicator/activity-indicator.types.ts +20 -0
- package/src/atoms/activity-indicator/index.ts +1 -0
- package/src/atoms/avatar/avatar.tsx +1 -1
- package/src/atoms/avatar/avatar.types.ts +5 -0
- package/src/atoms/badge/badge.types.ts +3 -0
- package/src/atoms/blur-view/blur-view.android.tsx +68 -0
- package/src/atoms/blur-view/blur-view.ios.tsx +37 -0
- package/src/atoms/blur-view/blur-view.types.ts +34 -0
- package/src/atoms/blur-view/index.ts +2 -0
- package/src/atoms/button/button.types.ts +12 -0
- package/src/atoms/card/card.types.ts +6 -0
- package/src/atoms/checkbox/checkbox.android.tsx +7 -3
- package/src/atoms/checkbox/checkbox.types.ts +5 -0
- package/src/atoms/chip/chip.types.ts +5 -0
- package/src/atoms/color-picker/color-picker.types.ts +4 -0
- package/src/atoms/date-picker/date-picker.ios.tsx +33 -13
- package/src/atoms/date-picker/date-picker.types.ts +14 -0
- package/src/atoms/divider/divider.types.ts +3 -0
- package/src/atoms/fab/fab.types.ts +7 -0
- package/src/atoms/glass-view/glass-view.android.tsx +41 -3
- package/src/atoms/glass-view/glass-view.types.ts +13 -5
- package/src/atoms/h-stack/h-stack.types.ts +6 -0
- package/src/atoms/icon/icon.types.ts +8 -0
- package/src/atoms/icon-button/icon-button.types.ts +5 -0
- package/src/atoms/image/image.tsx +11 -12
- package/src/atoms/image/image.types.ts +6 -0
- package/src/atoms/image/index.ts +1 -0
- package/src/atoms/index.ts +1 -1
- package/src/atoms/island/island.android.tsx +10 -2
- package/src/atoms/island/island.ios.tsx +4 -2
- package/src/atoms/island/island.types.ts +10 -2
- package/src/atoms/list/list.types.ts +2 -0
- package/src/atoms/picker/picker.types.ts +12 -0
- package/src/atoms/pressable/pressable.tsx +46 -6
- package/src/atoms/pressable/pressable.types.ts +10 -0
- package/src/atoms/progress/progress.types.ts +6 -0
- package/src/atoms/rn-flat-list/rn-flat-list.tsx +8 -8
- package/src/atoms/rn-flat-list/rn-flat-list.types.ts +3 -1
- package/src/atoms/rn-scroll-view/rn-scroll-view.types.ts +4 -0
- package/src/atoms/rn-section-list/rn-section-list.tsx +5 -8
- package/src/atoms/rn-section-list/rn-section-list.types.ts +3 -1
- package/src/atoms/rn-text/rn-text.tsx +6 -3
- package/src/atoms/rn-text/rn-text.types.ts +15 -5
- package/src/atoms/rn-view/rn-view.types.ts +2 -0
- package/src/atoms/scroll-view/scroll-view.types.ts +4 -0
- package/src/atoms/segmented-control/segmented-control.android.tsx +79 -0
- package/src/atoms/segmented-control/segmented-control.ios.tsx +47 -0
- package/src/atoms/segmented-control/segmented-control.types.ts +13 -0
- package/src/atoms/skeleton/skeleton.tsx +4 -4
- package/src/atoms/skeleton/skeleton.types.ts +11 -2
- package/src/atoms/slider/slider.types.ts +7 -0
- package/src/atoms/spacer/spacer.types.ts +3 -0
- package/src/atoms/surface/surface.types.ts +7 -0
- package/src/atoms/switch/switch.android.tsx +4 -1
- package/src/atoms/switch/switch.types.ts +8 -0
- package/src/atoms/text/text.android.tsx +7 -1
- package/src/atoms/text/text.ios.tsx +14 -3
- package/src/atoms/text/text.types.ts +18 -1
- package/src/atoms/text-field/text-field.types.ts +12 -0
- package/src/atoms/v-stack/v-stack.types.ts +9 -0
- package/src/atoms/z-stack/z-stack.types.ts +8 -0
- package/src/molecules/collapsible/collapsible.android.tsx +47 -7
- package/src/molecules/collapsible/collapsible.types.ts +8 -0
- package/src/molecules/empty-state/empty-state.types.ts +5 -0
- package/src/molecules/label/label.types.ts +6 -0
- package/src/molecules/labeled-content/labeled-content.types.ts +6 -0
- package/src/molecules/link/link.types.ts +6 -0
- package/src/molecules/list-item/list-item.types.ts +9 -0
- package/src/molecules/navigation-bar/navigation-bar.android.tsx +1 -6
- package/src/molecules/navigation-bar/navigation-bar.types.ts +8 -0
- package/src/molecules/pager/pager.android.tsx +4 -1
- package/src/molecules/pager/pager.types.ts +2 -0
- package/src/molecules/radio-group/radio-group.types.ts +10 -0
- package/src/molecules/rn-list-item/rn-list-item.types.ts +1 -1
- package/src/molecules/rn-tooltip/rn-tooltip.types.ts +11 -0
- package/src/molecules/scroll-edge-container/scroll-edge-container.android.tsx +103 -10
- package/src/molecules/scroll-edge-container/scroll-edge-container.types.ts +7 -2
- package/src/molecules/search-bar/search-bar.tsx +9 -2
- package/src/molecules/search-bar/search-bar.types.ts +8 -0
- package/src/molecules/stepper/stepper.ios.tsx +37 -1
- package/src/molecules/stepper/stepper.types.ts +10 -0
- package/src/molecules/tooltip/tooltip.android.tsx +17 -9
- package/src/molecules/tooltip/tooltip.types.ts +12 -0
- package/src/organisms/action-sheet/action-sheet.android.tsx +37 -19
- package/src/organisms/action-sheet/action-sheet.ios.tsx +22 -9
- package/src/organisms/action-sheet/action-sheet.types.ts +8 -0
- package/src/organisms/alert/alert.ios.tsx +11 -1
- package/src/organisms/alert/alert.types.ts +11 -0
- package/src/organisms/context-menu/context-menu.types.ts +4 -0
- package/src/organisms/fab-menu/fab-menu.types.ts +2 -0
- package/src/organisms/form/form.android.tsx +15 -7
- package/src/organisms/form/form.types.ts +6 -0
- package/src/organisms/menu/menu.types.ts +17 -0
- package/src/organisms/sheet/sheet.types.ts +19 -0
- package/src/organisms/snackbar/snackbar.types.ts +8 -0
- package/src/organisms/swipe-actions/swipe-actions.android.tsx +129 -9
- package/src/organisms/swipe-actions/swipe-actions.ios.tsx +45 -11
- package/src/organisms/swipe-actions/swipe-actions.types.ts +37 -14
- package/src/ripple-clip.ts +10 -1
- package/src/templates/screen/screen.android.tsx +33 -12
- package/src/templates/screen/screen.types.ts +9 -0
- package/lib/module/atoms/activity-indicator/activity-indicator.js +0 -14
- package/lib/module/atoms/activity-indicator/activity-indicator.js.map +0 -1
- package/lib/module/atoms/flash-list/flash-list.js +0 -31
- package/lib/module/atoms/flash-list/flash-list.js.map +0 -1
- package/lib/module/atoms/flash-list/flash-list.types.js +0 -4
- package/lib/module/atoms/flash-list/flash-list.types.js.map +0 -1
- package/lib/module/atoms/flash-list/index.js +0 -5
- package/lib/module/atoms/flash-list/index.js.map +0 -1
- package/lib/module/atoms/segmented-control/segmented-control.js +0 -40
- package/lib/module/atoms/segmented-control/segmented-control.js.map +0 -1
- package/lib/typescript/atoms/flash-list/flash-list.d.ts +0 -8
- package/lib/typescript/atoms/flash-list/flash-list.types.d.ts +0 -18
- package/lib/typescript/atoms/flash-list/index.d.ts +0 -2
- package/src/atoms/activity-indicator/activity-indicator.tsx +0 -9
- package/src/atoms/flash-list/flash-list.tsx +0 -28
- package/src/atoms/flash-list/flash-list.types.ts +0 -20
- package/src/atoms/flash-list/index.ts +0 -2
- package/src/atoms/segmented-control/segmented-control.tsx +0 -47
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,96 @@
|
|
|
1
1
|
# @hzblj/kara-components
|
|
2
2
|
|
|
3
|
+
## 0.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#17](https://github.com/hzblj/kara-ui/pull/17) [`4c7eaa0`](https://github.com/hzblj/kara-ui/commit/4c7eaa021ee4a4b0475e1dfb420fa5803c21ba29) Thanks [@hzblj](https://github.com/hzblj)! - `ActivityIndicator` plays Material 3's expressive `LoadingIndicator` on Android — its shapes morph as it turns — in a host of its own, so it still renders anywhere; iOS keeps UIKit's spinner. It takes the design system's props now, not React Native's: `color` is a token (`fill.accent.primary` by default), `size` is `small` or `large`.
|
|
8
|
+
|
|
9
|
+
`Collapsible` on Android spans its parent, the chevron at the far end, and its row is never shorter than Material's 48dp touch target; the chevron sat right after the label. `Pager`'s dots on Android are centred under the pages.
|
|
10
|
+
|
|
11
|
+
- [#17](https://github.com/hzblj/kara-ui/pull/17) [`4c7eaa0`](https://github.com/hzblj/kara-ui/commit/4c7eaa021ee4a4b0475e1dfb420fa5803c21ba29) Thanks [@hzblj](https://github.com/hzblj)! - Android gets glass and a scroll edge of its own.
|
|
12
|
+
|
|
13
|
+
- `GlassView` is frosted glass on Android: what lies behind the capsule, blurred (Android 12+), under a translucent tonal surface — or its `tint` — and a light hairline, the blurred surfaces Android 16 gives its own system UI. It was an almost clear capsule that left its content unreadable over a photo. Below Android 12 the same colours are drawn near-opaque. kara-native's new `BackdropBlurView` (`/jetpack-compose`) does the blur — blurred, then saturated, as iOS lifts the colour under its materials: a plain view, no host, and an idle screen draws no frames.
|
|
14
|
+
- `ScrollEdgeContainer` on Android behaves like a Material top app bar on scroll: the bars stay transparent at rest and fill with the scrolled container colour once content scrolls under the top one, the bottom one while there is more below. Its scroll view also takes the room between the bars now — it grew to its content's height, ran under the bottom bar and could not scroll.
|
|
15
|
+
- New token `surface.secondary`: Material's `surfaceContainer` on Android, `tertiarySystemGroupedBackgroundColor` on iOS — a step above `surface.primary`.
|
|
16
|
+
|
|
17
|
+
- [#17](https://github.com/hzblj/kara-ui/pull/17) [`4c7eaa0`](https://github.com/hzblj/kara-ui/commit/4c7eaa021ee4a4b0475e1dfb420fa5803c21ba29) Thanks [@hzblj](https://github.com/hzblj)! - `Pressable` on Android presses the Material way: a ripple over the content — the pressed state layer — clipped to the pressable's shape, and nothing scales. iOS keeps its spring to 96%. Give the `Pressable` the `borderRadius` of what it wraps (`full` around a `GlassView`) and the ripple follows it.
|
|
18
|
+
|
|
19
|
+
`Collapsible` on Android expands down from its row with a fade, and its chevron turns toward the content; it grew from a corner and the chevron jumped.
|
|
20
|
+
|
|
21
|
+
- [#17](https://github.com/hzblj/kara-ui/pull/17) [`4c7eaa0`](https://github.com/hzblj/kara-ui/commit/4c7eaa021ee4a4b0475e1dfb420fa5803c21ba29) Thanks [@hzblj](https://github.com/hzblj)! - New `BlurView`: the system materials, by SwiftUI's names — `ultraThin`, `thin`, `regular`, `thick`, `ultraThick`.
|
|
22
|
+
|
|
23
|
+
- iOS: UIKit's `system*Material` blur as a plain view — no SwiftUI host, cheap enough for a list cell — with `vibrancy` (`primary` to `quaternary`, `fill`, `separator`) to draw the content the way iOS draws its own on a material.
|
|
24
|
+
- Android: what lies behind, blurred and saturated (Android 12+), under a Material tonal surface that rises from `surface` to `surfaceContainerHighest` as the material thickens; below Android 12 the surface alone.
|
|
25
|
+
- `appearance` pins a material to light or dark whatever the app's; `borderRadius` shapes it and clips the content.
|
|
26
|
+
|
|
27
|
+
kara-native adds `BlurView` (`/swift-ui`).
|
|
28
|
+
|
|
29
|
+
- [#17](https://github.com/hzblj/kara-ui/pull/17) [`4c7eaa0`](https://github.com/hzblj/kara-ui/commit/4c7eaa021ee4a4b0475e1dfb420fa5803c21ba29) Thanks [@hzblj](https://github.com/hzblj)! - `sx` reaches the components that still took raw styles or none:
|
|
30
|
+
|
|
31
|
+
- `Text` takes the native `sx` surface — padding, a background, a frame (`wide` puts the text on the side `align` names) and the `ios` bucket. `ios.contentTransition` with the new `ios.animation` rolls a number to its next value, and `ios.monospacedDigit` keeps it from shifting what follows. `Stepper` on iOS is built on it.
|
|
32
|
+
- `RnText` takes `Box`'s `sx` props for its own box — margins, `flex`, padding — all but `align`, which still aligns its lines.
|
|
33
|
+
- `Image` is `sx(expo-image)`, the way `Box` is `sx(View)`: `w`, `h`, `aspectRatio`, `borderRadius`, `position`… instead of a `style` object. Its props are exported as `ImageProps`.
|
|
34
|
+
- `Island` takes the same `sx` props for where it sits in React Native layout: `<Island h={240} matchContents={false}>`. An explicit `style` still wins.
|
|
35
|
+
- `Skeleton` is sized with the `sx` names, `h` and `w` (was `height` and `width`), and `w` takes a percentage: `<Skeleton h={12} w="60%" />` for a line that ends early.
|
|
36
|
+
- The React Native surface gains `inset`, all four edges at once: `position="absolute" inset={0}` fills the parent.
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- Updated dependencies [[`4c7eaa0`](https://github.com/hzblj/kara-ui/commit/4c7eaa021ee4a4b0475e1dfb420fa5803c21ba29), [`4c7eaa0`](https://github.com/hzblj/kara-ui/commit/4c7eaa021ee4a4b0475e1dfb420fa5803c21ba29), [`bf2e70c`](https://github.com/hzblj/kara-ui/commit/bf2e70c8ae5a07fffb6433bd2ce08e371695ec50), [`4c7eaa0`](https://github.com/hzblj/kara-ui/commit/4c7eaa021ee4a4b0475e1dfb420fa5803c21ba29)]:
|
|
41
|
+
- @hzblj/kara-native@0.8.0
|
|
42
|
+
- @hzblj/kara-theme@0.8.0
|
|
43
|
+
- @hzblj/kara-sx@0.8.0
|
|
44
|
+
|
|
45
|
+
## 0.7.0
|
|
46
|
+
|
|
47
|
+
### Minor Changes
|
|
48
|
+
|
|
49
|
+
- [#12](https://github.com/hzblj/kara-ui/pull/12) [`2a6595f`](https://github.com/hzblj/kara-ui/commit/2a6595f79176a3450610d361a02001aac9530490) Thanks [@hzblj](https://github.com/hzblj)! - `SwipeActions` works on Android, and takes its buttons as data. **Breaking:** `SwipeActions.Actions` and its `Button` children are gone — pass `leading` and/or `trailing`, each a list of `{icon, label, onPress, destructive?, tint?}`, and `allowsFullSwipe` on the row:
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
<SwipeActions
|
|
53
|
+
trailing={[
|
|
54
|
+
{ destructive: true, icon: "trash", label: "Delete", onPress: remove },
|
|
55
|
+
]}
|
|
56
|
+
>
|
|
57
|
+
<ListItem title="Order [#1024](https://github.com/hzblj/kara-ui/issues/1024)" />
|
|
58
|
+
</SwipeActions>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
iOS renders SwiftUI's `swipeActions`, each action its icon on a button in its tint — round, with the label under it, on iOS 26. Android, where Compose has no swipe actions, gets kara's own `SwipeActionsBox` (`@hzblj/kara-native/jetpack-compose`): the row slides on an anchored drag, and filled icon buttons with their labels show in the strip it leaves. One row is open at a time on both, and a tap on an open row closes it.
|
|
62
|
+
|
|
63
|
+
- [#12](https://github.com/hzblj/kara-ui/pull/12) [`2a6595f`](https://github.com/hzblj/kara-ui/commit/2a6595f79176a3450610d361a02001aac9530490) Thanks [@hzblj](https://github.com/hzblj)! - **Breaking:** `FlashList` is gone, and `@shopify/flash-list` is no longer a peer dependency. kara's list for React Native content is `RnFlatList` (and `RnSectionList`): React Native's own virtualized lists, whose cells stay in normal flow, so rows that host native views keep them in place — a recycling list moves its cells, which an `@expo/ui` host does not survive. An app that wants FlashList for plain data rows installs and imports it itself.
|
|
64
|
+
|
|
65
|
+
- [#12](https://github.com/hzblj/kara-ui/pull/12) [`2a6595f`](https://github.com/hzblj/kara-ui/commit/2a6595f79176a3450610d361a02001aac9530490) Thanks [@hzblj](https://github.com/hzblj)! - `Tooltip` is controlled on Android too: `visible` shows Material's plain tooltip, centred above the anchor and kept inside the window, and `onDismiss` reports a touch outside it or the anchor scrolling away. It used to open only on a long press and hide itself, ignoring both props — and Material's own placement let it run off the edge of the screen. Nothing opens it on a long press any more; wire one to `visible` if you want it.
|
|
66
|
+
|
|
67
|
+
`TooltipBox` (`@hzblj/kara-native/jetpack-compose`) takes `plain` for that style, and hides when `isPresented` turns false.
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- [#12](https://github.com/hzblj/kara-ui/pull/12) [`2a6595f`](https://github.com/hzblj/kara-ui/commit/2a6595f79176a3450610d361a02001aac9530490) Thanks [@hzblj](https://github.com/hzblj)! - `ActionSheet` on Android renders its rows in a host of its own — they were Compose views straight inside the sheet, which has none, and threw "must be rendered inside a Host". The rows are Material's bottom-sheet menu now: full width, with each action's `icon` before its label.
|
|
72
|
+
|
|
73
|
+
`SearchBar` on iOS centres its text beside the magnifier. The type scale's line height sat the text at the bottom of a taller line in a single-line `UITextField`.
|
|
74
|
+
|
|
75
|
+
- [#12](https://github.com/hzblj/kara-ui/pull/12) [`2a6595f`](https://github.com/hzblj/kara-ui/commit/2a6595f79176a3450610d361a02001aac9530490) Thanks [@hzblj](https://github.com/hzblj)! - Android layout fixes:
|
|
76
|
+
|
|
77
|
+
- `Screen` keeps its content clear of the status bar when nothing sits above it, as a SwiftUI host keeps to the safe area — it drew under it. Under a navigation bar nothing changes; the background still runs to the edges.
|
|
78
|
+
- `Form` is inset from its container on every side, with section titles and footers indented to the cards' content, like SwiftUI's grouped form — in a `Screen` its cards ran into the screen's edges.
|
|
79
|
+
- A disabled or read-only `Checkbox` or `Switch` keeps Material's 48dp touch target, so it lines up with the enabled ones instead of shifting toward the edge.
|
|
80
|
+
|
|
81
|
+
- [#12](https://github.com/hzblj/kara-ui/pull/12) [`2a6595f`](https://github.com/hzblj/kara-ui/commit/2a6595f79176a3450610d361a02001aac9530490) Thanks [@hzblj](https://github.com/hzblj)! - `DatePicker` on iOS sizes itself to its value. Its host took the width it was given and laid the compact field out against the far edge of it — past its container's, in a row. The calendar is in the accent now.
|
|
82
|
+
|
|
83
|
+
- [#12](https://github.com/hzblj/kara-ui/pull/12) [`2a6595f`](https://github.com/hzblj/kara-ui/commit/2a6595f79176a3450610d361a02001aac9530490) Thanks [@hzblj](https://github.com/hzblj)! - `Alert` and `ActionSheet` appear on iOS. Both hung their SwiftUI presentation on an `EmptyView` — `@expo/ui` uses one when there is no trigger, and SwiftUI never presents from it — so `visible` changed nothing. Each now has a trigger that takes no room, and `ActionSheet` passes its buttons through the dialog's `Actions` slot.
|
|
84
|
+
|
|
85
|
+
- [#12](https://github.com/hzblj/kara-ui/pull/12) [`2a6595f`](https://github.com/hzblj/kara-ui/commit/2a6595f79176a3450610d361a02001aac9530490) Thanks [@hzblj](https://github.com/hzblj)! - `RnFlatList` and `RnSectionList` keep rows that host native views on Android. React Native's Android default, `removeClippedSubviews`, detached a host measured at zero height before its first layout, and the row stayed empty; it is off unless you turn it on.
|
|
86
|
+
|
|
87
|
+
- [#12](https://github.com/hzblj/kara-ui/pull/12) [`2a6595f`](https://github.com/hzblj/kara-ui/commit/2a6595f79176a3450610d361a02001aac9530490) Thanks [@hzblj](https://github.com/hzblj)! - `SegmentedControl` draws its selected segment in the accent on both platforms. iOS renders kara's own `UISegmentedControl` (`SegmentedControl` in `@hzblj/kara-native/swift-ui`), whose pill, labels and track take colours — the system control tints only the pill, SwiftUI's segmented picker not even that. Android colours Material's segmented buttons, equal widths. `onChange` now fires for a new segment only on Android too.
|
|
88
|
+
|
|
89
|
+
- Updated dependencies [[`2a6595f`](https://github.com/hzblj/kara-ui/commit/2a6595f79176a3450610d361a02001aac9530490), [`2a6595f`](https://github.com/hzblj/kara-ui/commit/2a6595f79176a3450610d361a02001aac9530490), [`2a6595f`](https://github.com/hzblj/kara-ui/commit/2a6595f79176a3450610d361a02001aac9530490), [`2a6595f`](https://github.com/hzblj/kara-ui/commit/2a6595f79176a3450610d361a02001aac9530490), [`2a6595f`](https://github.com/hzblj/kara-ui/commit/2a6595f79176a3450610d361a02001aac9530490)]:
|
|
90
|
+
- @hzblj/kara-native@0.7.0
|
|
91
|
+
- @hzblj/kara-sx@0.7.0
|
|
92
|
+
- @hzblj/kara-theme@0.7.0
|
|
93
|
+
|
|
3
94
|
## 0.6.0
|
|
4
95
|
|
|
5
96
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1,7 +1,35 @@
|
|
|
1
1
|
# @hzblj/kara-components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[![npm version][npm-badge]][npm-url]
|
|
4
|
+
[![License: MIT][license-badge]][license-url]
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
[npm-badge]: https://img.shields.io/npm/v/@hzblj/kara-components?labelColor=27272a&color=ff5700&label=%40hzblj%2Fkara-components
|
|
7
|
+
[npm-url]: https://www.npmjs.com/package/@hzblj/kara-components
|
|
8
|
+
[license-badge]: https://img.shields.io/badge/license-MIT-ff5700?labelColor=27272a
|
|
9
|
+
[license-url]: https://github.com/hzblj/kara-ui/blob/main/LICENSE
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
<a href="https://www.kara.janblazej.dev"><img src="https://www.kara.janblazej.dev/og.png" alt="Kara — native UI for Expo: real SwiftUI and Jetpack Compose views" width="720"></a>
|
|
12
|
+
|
|
13
|
+
The components of [Kara UI](https://www.kara.janblazej.dev) — a native-first design system for Expo.
|
|
14
|
+
|
|
15
|
+
> **Install [`@hzblj/kara-ui`](https://www.npmjs.com/package/@hzblj/kara-ui) instead.** This package is one of its
|
|
16
|
+
> building blocks, published so its types resolve; everything here is re-exported from `@hzblj/kara-ui`.
|
|
17
|
+
|
|
18
|
+
## What's inside
|
|
19
|
+
|
|
20
|
+
- **Native components** — real SwiftUI views on iOS and Jetpack Compose on Android, through `@expo/ui`: a `Switch` is
|
|
21
|
+
a SwiftUI `Toggle` on one and a Material `Switch` on the other.
|
|
22
|
+
- **`Screen` and `Island`** — the hosts native views render in.
|
|
23
|
+
- **The React Native tier** — `RnView`, `RnText`, `RnScrollView` and the rest: plain React Native views with the same
|
|
24
|
+
`sx` props, for long lists and for content around the native islands.
|
|
25
|
+
- **Haptics** — the platform's own feedback, named for what happened.
|
|
26
|
+
|
|
27
|
+
## Documentation
|
|
28
|
+
|
|
29
|
+
- [Components](https://www.kara.janblazej.dev/docs/components) — every one photographed on iOS and Android, with its props
|
|
30
|
+
- [Screen and Island](https://www.kara.janblazej.dev/docs/hosts)
|
|
31
|
+
- [Haptics](https://www.kara.janblazej.dev/docs/haptics)
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
MIT © Jan Blazej
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Host, LoadingIndicator } from '@expo/ui/jetpack-compose';
|
|
4
|
+
import { fillMaxSize, testID as testIdModifier } from '@expo/ui/jetpack-compose/modifiers';
|
|
5
|
+
import { useAppTheme } from '@hzblj/kara-theme';
|
|
6
|
+
import { useMemo } from 'react';
|
|
7
|
+
import { StyleSheet } from 'react-native';
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
/** Material's 48dp for a screen; half of it in a row, about where React Native's small spinner sat. */
|
|
10
|
+
const styles = StyleSheet.create({
|
|
11
|
+
large: {
|
|
12
|
+
height: 48,
|
|
13
|
+
width: 48
|
|
14
|
+
},
|
|
15
|
+
small: {
|
|
16
|
+
height: 24,
|
|
17
|
+
width: 24
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Material 3's expressive `LoadingIndicator` in a host of its own, sized here rather than measured, so it renders
|
|
23
|
+
* anywhere and takes its place in the first frame.
|
|
24
|
+
*/
|
|
25
|
+
export const ActivityIndicator = ({
|
|
26
|
+
color = 'fill.accent.primary',
|
|
27
|
+
size = 'small',
|
|
28
|
+
testID
|
|
29
|
+
}) => {
|
|
30
|
+
const theme = useAppTheme();
|
|
31
|
+
const modifiers = useMemo(() => testID ? [fillMaxSize(), testIdModifier(testID)] : [fillMaxSize()], [testID]);
|
|
32
|
+
return /*#__PURE__*/_jsx(Host, {
|
|
33
|
+
colorScheme: theme.dark ? 'dark' : 'light',
|
|
34
|
+
seedColor: theme.materialSeed,
|
|
35
|
+
style: styles[size],
|
|
36
|
+
children: /*#__PURE__*/_jsx(LoadingIndicator, {
|
|
37
|
+
color: theme.color(color),
|
|
38
|
+
modifiers: modifiers
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=activity-indicator.android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Host","LoadingIndicator","fillMaxSize","testID","testIdModifier","useAppTheme","useMemo","StyleSheet","jsx","_jsx","styles","create","large","height","width","small","ActivityIndicator","color","size","theme","modifiers","colorScheme","dark","seedColor","materialSeed","style","children"],"sourceRoot":"../../../../src","sources":["atoms/activity-indicator/activity-indicator.android.tsx"],"mappings":";;AAAA,SAAQA,IAAI,EAAEC,gBAAgB,QAAO,0BAA0B;AAC/D,SAAQC,WAAW,EAAEC,MAAM,IAAIC,cAAc,QAAO,oCAAoC;AACxF,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,OAAO,QAAO,OAAO;AAC7B,SAAQC,UAAU,QAAO,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAIvC;AACA,MAAMC,MAAM,GAAGH,UAAU,CAACI,MAAM,CAAC;EAC/BC,KAAK,EAAE;IAACC,MAAM,EAAE,EAAE;IAAEC,KAAK,EAAE;EAAE,CAAC;EAC9BC,KAAK,EAAE;IAACF,MAAM,EAAE,EAAE;IAAEC,KAAK,EAAE;EAAE;AAC/B,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA,OAAO,MAAME,iBAA6C,GAAGA,CAAC;EAC5DC,KAAK,GAAG,qBAAqB;EAC7BC,IAAI,GAAG,OAAO;EACdf;AACsB,CAAC,KAAK;EAC5B,MAAMgB,KAAK,GAAGd,WAAW,CAAC,CAAC;EAC3B,MAAMe,SAAS,GAAGd,OAAO,CAAC,MAAOH,MAAM,GAAG,CAACD,WAAW,CAAC,CAAC,EAAEE,cAAc,CAACD,MAAM,CAAC,CAAC,GAAG,CAACD,WAAW,CAAC,CAAC,CAAE,EAAE,CAACC,MAAM,CAAC,CAAC;EAE/G,oBACEM,IAAA,CAACT,IAAI;IAACqB,WAAW,EAAEF,KAAK,CAACG,IAAI,GAAG,MAAM,GAAG,OAAQ;IAACC,SAAS,EAAEJ,KAAK,CAACK,YAAa;IAACC,KAAK,EAAEf,MAAM,CAACQ,IAAI,CAAE;IAAAQ,QAAA,eACnGjB,IAAA,CAACR,gBAAgB;MAACgB,KAAK,EAAEE,KAAK,CAACF,KAAK,CAACA,KAAK,CAAE;MAACG,SAAS,EAAEA;IAAU,CAAE;EAAC,CACjE,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useAppTheme } from '@hzblj/kara-theme';
|
|
4
|
+
import { ActivityIndicator as RNActivityIndicator } from 'react-native';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
/** React Native's spinner, which on iOS is UIKit's own `UIActivityIndicatorView`. */
|
|
7
|
+
export const ActivityIndicator = ({
|
|
8
|
+
color = 'fill.accent.primary',
|
|
9
|
+
size = 'small',
|
|
10
|
+
testID
|
|
11
|
+
}) => {
|
|
12
|
+
const theme = useAppTheme();
|
|
13
|
+
return /*#__PURE__*/_jsx(RNActivityIndicator, {
|
|
14
|
+
color: theme.color(color),
|
|
15
|
+
size: size,
|
|
16
|
+
testID: testID
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=activity-indicator.ios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useAppTheme","ActivityIndicator","RNActivityIndicator","jsx","_jsx","color","size","testID","theme"],"sourceRoot":"../../../../src","sources":["atoms/activity-indicator/activity-indicator.ios.tsx"],"mappings":";;AAAA,SAAQA,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,iBAAiB,IAAIC,mBAAmB,QAAO,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAIrE;AACA,OAAO,MAAMH,iBAA6C,GAAGA,CAAC;EAC5DI,KAAK,GAAG,qBAAqB;EAC7BC,IAAI,GAAG,OAAO;EACdC;AACsB,CAAC,KAAK;EAC5B,MAAMC,KAAK,GAAGR,WAAW,CAAC,CAAC;EAE3B,oBAAOI,IAAA,CAACF,mBAAmB;IAACG,KAAK,EAAEG,KAAK,CAACH,KAAK,CAACA,KAAK,CAAE;IAACC,IAAI,EAAEA,IAAK;IAACC,MAAM,EAAEA;EAAO,CAAE,CAAC;AACvF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["atoms/activity-indicator/activity-indicator.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["atoms/activity-indicator/index.ts"],"mappings":";;AAAA,cAAc,
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["atoms/activity-indicator/index.ts"],"mappings":";;AAAA,cAAc,sBAAsB;AACpC,cAAc,+BAA4B","ignoreList":[]}
|
|
@@ -32,11 +32,9 @@ export const Avatar = ({
|
|
|
32
32
|
testID: testID,
|
|
33
33
|
w: diameter,
|
|
34
34
|
children: source ? /*#__PURE__*/_jsx(Image, {
|
|
35
|
+
h: diameter,
|
|
35
36
|
source: source,
|
|
36
|
-
|
|
37
|
-
height: diameter,
|
|
38
|
-
width: diameter
|
|
39
|
-
}
|
|
37
|
+
w: diameter
|
|
40
38
|
}) : /*#__PURE__*/_jsx(RnText, {
|
|
41
39
|
color: "content.secondary",
|
|
42
40
|
variant: VARIANT[size],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["spacing","Box","Image","RnText","jsx","_jsx","DIAMETER","lg","s64","md","s40","sm","s24","VARIANT","Avatar","initials","size","source","testID","diameter","align","bg","borderRadius","h","justify","overflow","w","children","
|
|
1
|
+
{"version":3,"names":["spacing","Box","Image","RnText","jsx","_jsx","DIAMETER","lg","s64","md","s40","sm","s24","VARIANT","Avatar","initials","size","source","testID","diameter","align","bg","borderRadius","h","justify","overflow","w","children","color","variant"],"sourceRoot":"../../../../src","sources":["atoms/avatar/avatar.tsx"],"mappings":";;AAAA,SAAQA,OAAO,QAAO,mBAAmB;AAEzC,SAAQC,GAAG,QAAO,iBAAQ;AAC1B,SAAQC,KAAK,QAAO,mBAAU;AAC9B,SAAQC,MAAM,QAAO,qBAAY;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGjC,MAAMC,QAAQ,GAAG;EACfC,EAAE,EAAEP,OAAO,CAACQ,GAAG;EACfC,EAAE,EAAET,OAAO,CAACU,GAAG;EACfC,EAAE,EAAEX,OAAO,CAACY;AACd,CAA+C;AAE/C,MAAMC,OAAO,GAAG;EACdN,EAAE,EAAE,WAAW;EACfE,EAAE,EAAE,aAAa;EACjBE,EAAE,EAAE;AACN,CAAU;AAEV,OAAO,MAAMG,MAAuB,GAAGA,CAAC;EAACC,QAAQ;EAAEC,IAAI,GAAG,IAAI;EAAEC,MAAM;EAAEC;AAAmB,CAAC,KAAK;EAC/F,MAAMC,QAAQ,GAAGb,QAAQ,CAACU,IAAI,CAAC;EAE/B,oBACEX,IAAA,CAACJ,GAAG;IACFmB,KAAK,EAAC,QAAQ;IACdC,EAAE,EAAC,eAAe;IAClBC,YAAY,EAAC,MAAM;IACnBC,CAAC,EAAEJ,QAAS;IACZK,OAAO,EAAC,QAAQ;IAChBC,QAAQ,EAAC,QAAQ;IACjBP,MAAM,EAAEA,MAAO;IACfQ,CAAC,EAAEP,QAAS;IAAAQ,QAAA,EAEXV,MAAM,gBACLZ,IAAA,CAACH,KAAK;MAACqB,CAAC,EAAEJ,QAAS;MAACF,MAAM,EAAEA,MAAO;MAACS,CAAC,EAAEP;IAAS,CAAE,CAAC,gBAEnDd,IAAA,CAACF,MAAM;MAACyB,KAAK,EAAC,mBAAmB;MAACC,OAAO,EAAEhB,OAAO,CAACG,IAAI,CAAE;MAAAW,QAAA,EACtDZ,QAAQ,IAAI;IAAE,CACT;EACT,CACE,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { BackdropBlurView } from '@hzblj/kara-native/jetpack-compose';
|
|
4
|
+
import { useSx } from '@hzblj/kara-sx';
|
|
5
|
+
import { useAppTheme, withOpacity } from '@hzblj/kara-theme';
|
|
6
|
+
import { useMemo } from 'react';
|
|
7
|
+
import { StyleSheet } from 'react-native';
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
const MATERIALS = {
|
|
10
|
+
regular: {
|
|
11
|
+
blur: 28,
|
|
12
|
+
fill: 'surface.secondary',
|
|
13
|
+
opacity: {
|
|
14
|
+
dark: 'o75',
|
|
15
|
+
light: 'o60'
|
|
16
|
+
},
|
|
17
|
+
saturation: 1.6
|
|
18
|
+
},
|
|
19
|
+
thick: {
|
|
20
|
+
blur: 30,
|
|
21
|
+
fill: 'surface.secondary',
|
|
22
|
+
opacity: {
|
|
23
|
+
dark: 'o85',
|
|
24
|
+
light: 'o80'
|
|
25
|
+
},
|
|
26
|
+
saturation: 1.4
|
|
27
|
+
},
|
|
28
|
+
thin: {
|
|
29
|
+
blur: 24,
|
|
30
|
+
fill: 'surface.primary',
|
|
31
|
+
opacity: {
|
|
32
|
+
dark: 'o60',
|
|
33
|
+
light: 'o40'
|
|
34
|
+
},
|
|
35
|
+
saturation: 1.7
|
|
36
|
+
},
|
|
37
|
+
ultraThick: {
|
|
38
|
+
blur: 32,
|
|
39
|
+
fill: 'fill.quaternary',
|
|
40
|
+
opacity: {
|
|
41
|
+
dark: 'o90',
|
|
42
|
+
light: 'o90'
|
|
43
|
+
},
|
|
44
|
+
saturation: 1.2
|
|
45
|
+
},
|
|
46
|
+
ultraThin: {
|
|
47
|
+
blur: 20,
|
|
48
|
+
fill: 'surface.base',
|
|
49
|
+
opacity: {
|
|
50
|
+
dark: 'o50',
|
|
51
|
+
light: 'o25'
|
|
52
|
+
},
|
|
53
|
+
saturation: 1.8
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The materials in Android's terms: kara's `BackdropBlurView` — what lies behind, blurred and saturated — under a
|
|
59
|
+
* Material tonal surface that gets higher and more opaque as the material thickens. Pinned to the appearance the app
|
|
60
|
+
* is not in, the surface is Material's inverse one. `vibrancy` has no Android counterpart and is left out.
|
|
61
|
+
*/
|
|
62
|
+
export const BlurView = ({
|
|
63
|
+
appearance,
|
|
64
|
+
children,
|
|
65
|
+
material = 'regular',
|
|
66
|
+
testID,
|
|
67
|
+
vibrancy: _vibrancy,
|
|
68
|
+
...sx
|
|
69
|
+
}) => {
|
|
70
|
+
const theme = useAppTheme();
|
|
71
|
+
const resolved = useSx(sx);
|
|
72
|
+
const spec = MATERIALS[material];
|
|
73
|
+
const inverted = appearance !== undefined && appearance === 'dark' !== theme.dark;
|
|
74
|
+
const dark = appearance ? appearance === 'dark' : theme.dark;
|
|
75
|
+
const base = String(theme.color(inverted ? 'surface.high.contrast' : spec.fill));
|
|
76
|
+
const {
|
|
77
|
+
cornerRadius,
|
|
78
|
+
style
|
|
79
|
+
} = useMemo(() => {
|
|
80
|
+
const {
|
|
81
|
+
borderRadius,
|
|
82
|
+
...rest
|
|
83
|
+
} = StyleSheet.flatten(resolved) ?? {};
|
|
84
|
+
return {
|
|
85
|
+
cornerRadius: typeof borderRadius === 'number' ? borderRadius : 0,
|
|
86
|
+
style: rest
|
|
87
|
+
};
|
|
88
|
+
}, [resolved]);
|
|
89
|
+
return /*#__PURE__*/_jsx(BackdropBlurView, {
|
|
90
|
+
blurRadius: spec.blur,
|
|
91
|
+
cornerRadius: cornerRadius,
|
|
92
|
+
fallbackTint: withOpacity(base, 'o95'),
|
|
93
|
+
glassTint: withOpacity(base, spec.opacity[dark ? 'dark' : 'light']),
|
|
94
|
+
saturation: spec.saturation,
|
|
95
|
+
style: style,
|
|
96
|
+
testID: testID,
|
|
97
|
+
children: children
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=blur-view.android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BackdropBlurView","useSx","useAppTheme","withOpacity","useMemo","StyleSheet","jsx","_jsx","MATERIALS","regular","blur","fill","opacity","dark","light","saturation","thick","thin","ultraThick","ultraThin","BlurView","appearance","children","material","testID","vibrancy","_vibrancy","sx","theme","resolved","spec","inverted","undefined","base","String","color","cornerRadius","style","borderRadius","rest","flatten","blurRadius","fallbackTint","glassTint"],"sourceRoot":"../../../../src","sources":["atoms/blur-view/blur-view.android.tsx"],"mappings":";;AAAA,SAAQA,gBAAgB,QAAO,oCAAoC;AACnE,SAAQC,KAAK,QAAO,gBAAgB;AACpC,SAA2CC,WAAW,EAAEC,WAAW,QAAO,mBAAmB;AAC7F,SAAQC,OAAO,QAAO,OAAO;AAC7B,SAAQC,UAAU,QAAO,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAkBvC,MAAMC,SAA6C,GAAG;EACpDC,OAAO,EAAE;IAACC,IAAI,EAAE,EAAE;IAAEC,IAAI,EAAE,mBAAmB;IAAEC,OAAO,EAAE;MAACC,IAAI,EAAE,KAAK;MAAEC,KAAK,EAAE;IAAK,CAAC;IAAEC,UAAU,EAAE;EAAG,CAAC;EACrGC,KAAK,EAAE;IAACN,IAAI,EAAE,EAAE;IAAEC,IAAI,EAAE,mBAAmB;IAAEC,OAAO,EAAE;MAACC,IAAI,EAAE,KAAK;MAAEC,KAAK,EAAE;IAAK,CAAC;IAAEC,UAAU,EAAE;EAAG,CAAC;EACnGE,IAAI,EAAE;IAACP,IAAI,EAAE,EAAE;IAAEC,IAAI,EAAE,iBAAiB;IAAEC,OAAO,EAAE;MAACC,IAAI,EAAE,KAAK;MAAEC,KAAK,EAAE;IAAK,CAAC;IAAEC,UAAU,EAAE;EAAG,CAAC;EAChGG,UAAU,EAAE;IAACR,IAAI,EAAE,EAAE;IAAEC,IAAI,EAAE,iBAAiB;IAAEC,OAAO,EAAE;MAACC,IAAI,EAAE,KAAK;MAAEC,KAAK,EAAE;IAAK,CAAC;IAAEC,UAAU,EAAE;EAAG,CAAC;EACtGI,SAAS,EAAE;IAACT,IAAI,EAAE,EAAE;IAAEC,IAAI,EAAE,cAAc;IAAEC,OAAO,EAAE;MAACC,IAAI,EAAE,KAAK;MAAEC,KAAK,EAAE;IAAK,CAAC;IAAEC,UAAU,EAAE;EAAG;AACnG,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,QAA2B,GAAGA,CAAC;EAC1CC,UAAU;EACVC,QAAQ;EACRC,QAAQ,GAAG,SAAS;EACpBC,MAAM;EACNC,QAAQ,EAAEC,SAAS;EACnB,GAAGC;AACU,CAAC,KAAK;EACnB,MAAMC,KAAK,GAAG1B,WAAW,CAAC,CAAC;EAC3B,MAAM2B,QAAQ,GAAG5B,KAAK,CAAC0B,EAAE,CAAC;EAC1B,MAAMG,IAAI,GAAGtB,SAAS,CAACe,QAAQ,CAAC;EAChC,MAAMQ,QAAQ,GAAGV,UAAU,KAAKW,SAAS,IAAKX,UAAU,KAAK,MAAM,KAAMO,KAAK,CAACf,IAAI;EACnF,MAAMA,IAAI,GAAGQ,UAAU,GAAGA,UAAU,KAAK,MAAM,GAAGO,KAAK,CAACf,IAAI;EAC5D,MAAMoB,IAAI,GAAGC,MAAM,CAACN,KAAK,CAACO,KAAK,CAACJ,QAAQ,GAAG,uBAAuB,GAAGD,IAAI,CAACnB,IAAI,CAAC,CAAC;EAChF,MAAM;IAACyB,YAAY;IAAEC;EAAK,CAAC,GAAGjC,OAAO,CAAC,MAAM;IAC1C,MAAM;MAACkC,YAAY;MAAE,GAAGC;IAAI,CAAC,GAAGlC,UAAU,CAACmC,OAAO,CAACX,QAAQ,CAAC,IAAI,CAAC,CAAC;IAClE,OAAO;MAACO,YAAY,EAAE,OAAOE,YAAY,KAAK,QAAQ,GAAGA,YAAY,GAAG,CAAC;MAAED,KAAK,EAAEE;IAAI,CAAC;EACzF,CAAC,EAAE,CAACV,QAAQ,CAAC,CAAC;EAEd,oBACEtB,IAAA,CAACP,gBAAgB;IACfyC,UAAU,EAAEX,IAAI,CAACpB,IAAK;IACtB0B,YAAY,EAAEA,YAAa;IAC3BM,YAAY,EAAEvC,WAAW,CAAC8B,IAAI,EAAE,KAAK,CAAE;IACvCU,SAAS,EAAExC,WAAW,CAAC8B,IAAI,EAAEH,IAAI,CAAClB,OAAO,CAACC,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC,CAAE;IACpEE,UAAU,EAAEe,IAAI,CAACf,UAAW;IAC5BsB,KAAK,EAAEA,KAAM;IACbb,MAAM,EAAEA,MAAO;IAAAF,QAAA,EAEdA;EAAQ,CACO,CAAC;AAEvB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { BlurView as NativeBlurView } from '@hzblj/kara-native/swift-ui';
|
|
4
|
+
import { useSx } from '@hzblj/kara-sx';
|
|
5
|
+
import { useAppTheme } from '@hzblj/kara-theme';
|
|
6
|
+
import { useMemo } from 'react';
|
|
7
|
+
import { StyleSheet } from 'react-native';
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
/** `borderRadius` is the material's shape, so it goes to the effect view — the one that clips — not the layout box. */
|
|
10
|
+
export const BlurView = ({
|
|
11
|
+
appearance,
|
|
12
|
+
children,
|
|
13
|
+
material = 'regular',
|
|
14
|
+
testID,
|
|
15
|
+
vibrancy,
|
|
16
|
+
...sx
|
|
17
|
+
}) => {
|
|
18
|
+
const theme = useAppTheme();
|
|
19
|
+
const resolved = useSx(sx);
|
|
20
|
+
const {
|
|
21
|
+
cornerRadius,
|
|
22
|
+
style
|
|
23
|
+
} = useMemo(() => {
|
|
24
|
+
const {
|
|
25
|
+
borderRadius,
|
|
26
|
+
...rest
|
|
27
|
+
} = StyleSheet.flatten(resolved) ?? {};
|
|
28
|
+
return {
|
|
29
|
+
cornerRadius: typeof borderRadius === 'number' ? borderRadius : 0,
|
|
30
|
+
style: rest
|
|
31
|
+
};
|
|
32
|
+
}, [resolved]);
|
|
33
|
+
return /*#__PURE__*/_jsx(NativeBlurView, {
|
|
34
|
+
colorScheme: appearance ?? (theme.dark ? 'dark' : 'light'),
|
|
35
|
+
cornerRadius: cornerRadius,
|
|
36
|
+
material: material,
|
|
37
|
+
style: style,
|
|
38
|
+
testID: testID,
|
|
39
|
+
vibrancy: vibrancy,
|
|
40
|
+
children: children
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=blur-view.ios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BlurView","NativeBlurView","useSx","useAppTheme","useMemo","StyleSheet","jsx","_jsx","appearance","children","material","testID","vibrancy","sx","theme","resolved","cornerRadius","style","borderRadius","rest","flatten","colorScheme","dark"],"sourceRoot":"../../../../src","sources":["atoms/blur-view/blur-view.ios.tsx"],"mappings":";;AAAA,SAAQA,QAAQ,IAAIC,cAAc,QAAO,6BAA6B;AACtE,SAAQC,KAAK,QAAO,gBAAgB;AACpC,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,OAAO,QAAO,OAAO;AAC7B,SAAQC,UAAU,QAAO,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAIvC;AACA,OAAO,MAAMP,QAA2B,GAAGA,CAAC;EAC1CQ,UAAU;EACVC,QAAQ;EACRC,QAAQ,GAAG,SAAS;EACpBC,MAAM;EACNC,QAAQ;EACR,GAAGC;AACU,CAAC,KAAK;EACnB,MAAMC,KAAK,GAAGX,WAAW,CAAC,CAAC;EAC3B,MAAMY,QAAQ,GAAGb,KAAK,CAACW,EAAE,CAAC;EAC1B,MAAM;IAACG,YAAY;IAAEC;EAAK,CAAC,GAAGb,OAAO,CAAC,MAAM;IAC1C,MAAM;MAACc,YAAY;MAAE,GAAGC;IAAI,CAAC,GAAGd,UAAU,CAACe,OAAO,CAACL,QAAQ,CAAC,IAAI,CAAC,CAAC;IAClE,OAAO;MAACC,YAAY,EAAE,OAAOE,YAAY,KAAK,QAAQ,GAAGA,YAAY,GAAG,CAAC;MAAED,KAAK,EAAEE;IAAI,CAAC;EACzF,CAAC,EAAE,CAACJ,QAAQ,CAAC,CAAC;EAEd,oBACER,IAAA,CAACN,cAAc;IACboB,WAAW,EAAEb,UAAU,KAAKM,KAAK,CAACQ,IAAI,GAAG,MAAM,GAAG,OAAO,CAAE;IAC3DN,YAAY,EAAEA,YAAa;IAC3BN,QAAQ,EAAEA,QAAS;IACnBO,KAAK,EAAEA,KAAM;IACbN,MAAM,EAAEA,MAAO;IACfC,QAAQ,EAAEA,QAAS;IAAAH,QAAA,EAElBA;EAAQ,CACK,CAAC;AAErB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["atoms/blur-view/blur-view.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["atoms/blur-view/index.ts"],"mappings":";;AAAA,cAAc,aAAa;AAC3B,cAAc,sBAAmB","ignoreList":[]}
|
|
@@ -6,9 +6,13 @@ import { spacing, useAppTheme } from '@hzblj/kara-theme';
|
|
|
6
6
|
import { useMemo } from 'react';
|
|
7
7
|
import { useHostGuard } from "../../host-context.js";
|
|
8
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
/** Stands in for a missing handler: Material drops its 48dp touch target without one, and the box moves. */
|
|
10
|
+
const NOOP = () => undefined;
|
|
11
|
+
|
|
9
12
|
/**
|
|
10
|
-
* Material's checkbox, tinted with the accent. With a label it is a full-width row that toggles as a whole
|
|
11
|
-
*
|
|
13
|
+
* Material's checkbox, tinted with the accent. With a label it is a full-width row that toggles as a whole. It always
|
|
14
|
+
* gets a handler, so a disabled or read-only box keeps the touch target an enabled one has, and lines up with it;
|
|
15
|
+
* `enabled` is what stops the input.
|
|
12
16
|
*/
|
|
13
17
|
export const Checkbox = ({
|
|
14
18
|
disabled = false,
|
|
@@ -25,7 +29,7 @@ export const Checkbox = ({
|
|
|
25
29
|
checkmarkColor: theme.color('content.on.bg')
|
|
26
30
|
},
|
|
27
31
|
enabled: !disabled,
|
|
28
|
-
onCheckedChange: onValueChange,
|
|
32
|
+
onCheckedChange: onValueChange ?? NOOP,
|
|
29
33
|
value: value
|
|
30
34
|
});
|
|
31
35
|
if (!label) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Checkbox","ComposeCheckbox","Row","Text","clickable","fillMaxWidth","spacing","useAppTheme","useMemo","useHostGuard","jsx","_jsx","jsxs","_jsxs","disabled","label","onValueChange","value","theme","rowModifiers","control","colors","checkedColor","color","checkmarkColor","enabled","onCheckedChange","horizontalArrangement","spacedBy","s8","modifiers","verticalAlignment","children","colorString","style","typography","body"],"sourceRoot":"../../../../src","sources":["atoms/checkbox/checkbox.android.tsx"],"mappings":";;AAAA,SAAQA,QAAQ,IAAIC,eAAe,EAAEC,GAAG,EAAEC,IAAI,QAAO,0BAA0B;AAC/E,SAAQC,SAAS,EAAEC,YAAY,QAAO,oCAAoC;AAC1E,SAAQC,OAAO,EAAEC,WAAW,QAAO,mBAAmB;AACtD,SAAQC,OAAO,QAAO,OAAO;AAE7B,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG/C;AACA;AACA;AACA;AACA,OAAO,
|
|
1
|
+
{"version":3,"names":["Checkbox","ComposeCheckbox","Row","Text","clickable","fillMaxWidth","spacing","useAppTheme","useMemo","useHostGuard","jsx","_jsx","jsxs","_jsxs","NOOP","undefined","disabled","label","onValueChange","value","theme","rowModifiers","control","colors","checkedColor","color","checkmarkColor","enabled","onCheckedChange","horizontalArrangement","spacedBy","s8","modifiers","verticalAlignment","children","colorString","style","typography","body"],"sourceRoot":"../../../../src","sources":["atoms/checkbox/checkbox.android.tsx"],"mappings":";;AAAA,SAAQA,QAAQ,IAAIC,eAAe,EAAEC,GAAG,EAAEC,IAAI,QAAO,0BAA0B;AAC/E,SAAQC,SAAS,EAAEC,YAAY,QAAO,oCAAoC;AAC1E,SAAQC,OAAO,EAAEC,WAAW,QAAO,mBAAmB;AACtD,SAAQC,OAAO,QAAO,OAAO;AAE7B,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG/C;AACA,MAAMC,IAAI,GAAGA,CAAA,KAAMC,SAAS;;AAE5B;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMf,QAA2B,GAAGA,CAAC;EAACgB,QAAQ,GAAG,KAAK;EAAEC,KAAK;EAAEC,aAAa;EAAEC;AAAoB,CAAC,KAAK;EAC7GV,YAAY,CAAC,UAAU,CAAC;EACxB,MAAMW,KAAK,GAAGb,WAAW,CAAC,CAAC;EAC3B,MAAMc,YAAY,GAAGb,OAAO,CAC1B,MAAOQ,QAAQ,IAAI,CAACE,aAAa,GAAG,CAACb,YAAY,CAAC,CAAC,CAAC,GAAG,CAACA,YAAY,CAAC,CAAC,EAAED,SAAS,CAAC,MAAMc,aAAa,CAAC,CAACC,KAAK,CAAC,CAAC,CAAE,EAChH,CAACH,QAAQ,EAAEE,aAAa,EAAEC,KAAK,CACjC,CAAC;EACD,MAAMG,OAAO,gBACXX,IAAA,CAACV,eAAe;IACdsB,MAAM,EAAE;MAACC,YAAY,EAAEJ,KAAK,CAACK,KAAK,CAAC,qBAAqB,CAAC;MAAEC,cAAc,EAAEN,KAAK,CAACK,KAAK,CAAC,eAAe;IAAC,CAAE;IACzGE,OAAO,EAAE,CAACX,QAAS;IACnBY,eAAe,EAAEV,aAAa,IAAIJ,IAAK;IACvCK,KAAK,EAAEA;EAAM,CACd,CACF;EAED,IAAI,CAACF,KAAK,EAAE;IACV,OAAOK,OAAO;EAChB;EAEA,oBACET,KAAA,CAACX,GAAG;IAAC2B,qBAAqB,EAAE;MAACC,QAAQ,EAAExB,OAAO,CAACyB;IAAE,CAAE;IAACC,SAAS,EAAEX,YAAa;IAACY,iBAAiB,EAAC,QAAQ;IAAAC,QAAA,GACpGZ,OAAO,eACRX,IAAA,CAACR,IAAI;MAACsB,KAAK,EAAEL,KAAK,CAACe,WAAW,CAACnB,QAAQ,GAAG,kBAAkB,GAAG,iBAAiB,CAAE;MAACoB,KAAK,EAAEhB,KAAK,CAACiB,UAAU,CAACC,IAAK;MAAAJ,QAAA,EAC7GjB;IAAK,CACF,CAAC;EAAA,CACJ,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Host, DatePicker as SwiftUIDatePicker } from '@expo/ui/swift-ui';
|
|
4
|
+
import { datePickerStyle, labelsHidden, tint } from '@expo/ui/swift-ui/modifiers';
|
|
5
|
+
import { useAppTheme } from '@hzblj/kara-theme';
|
|
6
|
+
import { useMemo } from 'react';
|
|
5
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
|
|
8
|
+
const COMPONENTS = {
|
|
9
|
+
date: ['date'],
|
|
10
|
+
datetime: ['date', 'hourAndMinute'],
|
|
11
|
+
time: ['hourAndMinute']
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The system's compact date picker: the value in a pill, and a tap on it opens the calendar popover UIKit owns. Its own
|
|
16
|
+
* host, sized to the pill on both axes — a host that took the width it was given would lay the pill out against the
|
|
17
|
+
* far edge of it, or past its container's — so it drops into a row the way a `Text` does. The label is the caller's,
|
|
18
|
+
* beside it; the calendar is in the accent.
|
|
19
|
+
*/
|
|
7
20
|
export const DatePicker = ({
|
|
8
21
|
max,
|
|
9
22
|
min,
|
|
@@ -12,14 +25,22 @@ export const DatePicker = ({
|
|
|
12
25
|
testID,
|
|
13
26
|
value
|
|
14
27
|
}) => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
const theme = useAppTheme();
|
|
29
|
+
const modifiers = useMemo(() => [datePickerStyle('compact'), labelsHidden(), tint(theme.color('fill.accent.primary'))], [theme]);
|
|
30
|
+
return /*#__PURE__*/_jsx(Host, {
|
|
31
|
+
colorScheme: theme.dark ? 'dark' : 'light',
|
|
32
|
+
matchContents: true,
|
|
33
|
+
children: /*#__PURE__*/_jsx(SwiftUIDatePicker, {
|
|
34
|
+
displayedComponents: [...COMPONENTS[mode]],
|
|
35
|
+
modifiers: modifiers,
|
|
36
|
+
onDateChange: onValueChange,
|
|
37
|
+
range: min || max ? {
|
|
38
|
+
end: max,
|
|
39
|
+
start: min
|
|
40
|
+
} : undefined,
|
|
41
|
+
selection: value,
|
|
42
|
+
testID: testID
|
|
43
|
+
})
|
|
23
44
|
});
|
|
24
45
|
};
|
|
25
46
|
//# sourceMappingURL=date-picker.ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Host","DatePicker","SwiftUIDatePicker","datePickerStyle","labelsHidden","tint","useAppTheme","useMemo","jsx","_jsx","COMPONENTS","date","datetime","time","max","min","mode","onValueChange","testID","value","theme","modifiers","color","colorScheme","dark","matchContents","children","displayedComponents","onDateChange","range","end","start","undefined","selection"],"sourceRoot":"../../../../src","sources":["atoms/date-picker/date-picker.ios.tsx"],"mappings":";;AAAA,SAAQA,IAAI,EAAEC,UAAU,IAAIC,iBAAiB,QAAO,mBAAmB;AACvE,SAAQC,eAAe,EAAEC,YAAY,EAAEC,IAAI,QAAO,6BAA6B;AAC/E,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,OAAO,QAAO,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAI7B,MAAMC,UAAU,GAAG;EACjBC,IAAI,EAAE,CAAC,MAAM,CAAC;EACdC,QAAQ,EAAE,CAAC,MAAM,EAAE,eAAe,CAAC;EACnCC,IAAI,EAAE,CAAC,eAAe;AACxB,CAAyE;;AAEzE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMZ,UAA+B,GAAGA,CAAC;EAC9Ca,GAAG;EACHC,GAAG;EACHC,IAAI,GAAG,MAAM;EACbC,aAAa;EACbC,MAAM;EACNC;AACe,CAAC,KAAK;EACrB,MAAMC,KAAK,GAAGd,WAAW,CAAC,CAAC;EAE3B,MAAMe,SAAS,GAAGd,OAAO,CACvB,MAAM,CAACJ,eAAe,CAAC,SAAS,CAAC,EAAEC,YAAY,CAAC,CAAC,EAAEC,IAAI,CAACe,KAAK,CAACE,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAC5F,CAACF,KAAK,CACR,CAAC;EAED,oBACEX,IAAA,CAACT,IAAI;IAACuB,WAAW,EAAEH,KAAK,CAACI,IAAI,GAAG,MAAM,GAAG,OAAQ;IAACC,aAAa;IAAAC,QAAA,eAC7DjB,IAAA,CAACP,iBAAiB;MAChByB,mBAAmB,EAAE,CAAC,GAAGjB,UAAU,CAACM,IAAI,CAAC,CAAE;MAC3CK,SAAS,EAAEA,SAAU;MACrBO,YAAY,EAAEX,aAAc;MAC5BY,KAAK,EAAEd,GAAG,IAAID,GAAG,GAAG;QAACgB,GAAG,EAAEhB,GAAG;QAAEiB,KAAK,EAAEhB;MAAG,CAAC,GAAGiB,SAAU;MACvDC,SAAS,EAAEd,KAAM;MACjBD,MAAM,EAAEA;IAAO,CAChB;EAAC,CACE,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { BackdropBlurView } from '@hzblj/kara-native/jetpack-compose';
|
|
4
|
+
import { useSx } from '@hzblj/kara-sx';
|
|
5
|
+
import { radii, useAppTheme, withOpacity } from '@hzblj/kara-theme';
|
|
4
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/** dp. Strong enough that a photo behind reads as colour and light, not as detail. */
|
|
8
|
+
const BLUR_RADIUS = 16;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Frosted glass, Android's way: what lies behind the capsule, blurred (Android 12+), under a tonal Material surface
|
|
12
|
+
* and a light hairline — the blurred surfaces Android 16 gives its own system UI, not a copy of iOS's lens. Without a
|
|
13
|
+
* tint it is the surface colour, translucent, so the content keeps its usual colours on it; a tint fills it with that
|
|
14
|
+
* colour instead. Below Android 12, with nothing to blur, the same colours are drawn near-opaque. Android has no swell,
|
|
15
|
+
* so `interactive` changes nothing here — the `Pressable` around it gives the press its feedback.
|
|
16
|
+
*/
|
|
17
|
+
export const GlassView = ({
|
|
18
|
+
children,
|
|
19
|
+
interactive: _interactive,
|
|
20
|
+
testID,
|
|
21
|
+
tint,
|
|
22
|
+
...sx
|
|
23
|
+
}) => {
|
|
24
|
+
const theme = useAppTheme();
|
|
25
|
+
const style = useSx(sx);
|
|
26
|
+
const base = String(theme.color(tint ?? 'surface.primary'));
|
|
27
|
+
return /*#__PURE__*/_jsx(BackdropBlurView, {
|
|
28
|
+
blurRadius: BLUR_RADIUS,
|
|
29
|
+
cornerRadius: radii.full,
|
|
30
|
+
fallbackTint: withOpacity(base, 'o95'),
|
|
31
|
+
glassTint: withOpacity(base, tint ? 'o85' : 'o50'),
|
|
32
|
+
hairlineColor: withOpacity(String(theme.color('content.on.bg')), theme.dark ? 'o20' : 'o60'),
|
|
33
|
+
hairlineWidth: 1,
|
|
34
|
+
saturation: 1.6,
|
|
35
|
+
style: style,
|
|
36
|
+
testID: testID,
|
|
37
|
+
children: children
|
|
38
|
+
});
|
|
39
|
+
};
|
|
9
40
|
//# sourceMappingURL=glass-view.android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["BackdropBlurView","useSx","radii","useAppTheme","withOpacity","jsx","_jsx","BLUR_RADIUS","GlassView","children","interactive","_interactive","testID","tint","sx","theme","style","base","String","color","blurRadius","cornerRadius","full","fallbackTint","glassTint","hairlineColor","dark","hairlineWidth","saturation"],"sourceRoot":"../../../../src","sources":["atoms/glass-view/glass-view.android.tsx"],"mappings":";;AAAA,SAAQA,gBAAgB,QAAO,oCAAoC;AACnE,SAAQC,KAAK,QAAO,gBAAgB;AACpC,SAAQC,KAAK,EAAEC,WAAW,EAAEC,WAAW,QAAO,mBAAmB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAIjE;AACA,MAAMC,WAAW,GAAG,EAAE;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAA6B,GAAGA,CAAC;EAC5CC,QAAQ;EACRC,WAAW,EAAEC,YAAY;EACzBC,MAAM;EACNC,IAAI;EACJ,GAAGC;AACW,CAAC,KAAK;EACpB,MAAMC,KAAK,GAAGZ,WAAW,CAAC,CAAC;EAC3B,MAAMa,KAAK,GAAGf,KAAK,CAACa,EAAE,CAAC;EACvB,MAAMG,IAAI,GAAGC,MAAM,CAACH,KAAK,CAACI,KAAK,CAACN,IAAI,IAAI,iBAAiB,CAAC,CAAC;EAE3D,oBACEP,IAAA,CAACN,gBAAgB;IACfoB,UAAU,EAAEb,WAAY;IACxBc,YAAY,EAAEnB,KAAK,CAACoB,IAAK;IACzBC,YAAY,EAAEnB,WAAW,CAACa,IAAI,EAAE,KAAK,CAAE;IACvCO,SAAS,EAAEpB,WAAW,CAACa,IAAI,EAAEJ,IAAI,GAAG,KAAK,GAAG,KAAK,CAAE;IACnDY,aAAa,EAAErB,WAAW,CAACc,MAAM,CAACH,KAAK,CAACI,KAAK,CAAC,eAAe,CAAC,CAAC,EAAEJ,KAAK,CAACW,IAAI,GAAG,KAAK,GAAG,KAAK,CAAE;IAC7FC,aAAa,EAAE,CAAE;IACjBC,UAAU,EAAE,GAAI;IAChBZ,KAAK,EAAEA,KAAM;IACbJ,MAAM,EAAEA,MAAO;IAAAH,QAAA,EAEdA;EAAQ,CACO,CAAC;AAEvB,CAAC","ignoreList":[]}
|