@hzblj/kara-components 0.9.0 → 0.11.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 +72 -28
- package/README.md +8 -8
- package/lib/module/atoms/activity-indicator/activity-indicator.android.js +6 -1
- package/lib/module/atoms/activity-indicator/activity-indicator.android.js.map +1 -1
- package/lib/module/atoms/activity-indicator/activity-indicator.ios.js +2 -0
- package/lib/module/atoms/activity-indicator/activity-indicator.ios.js.map +1 -1
- package/lib/module/atoms/avatar/avatar.js +5 -0
- package/lib/module/atoms/avatar/avatar.js.map +1 -1
- package/lib/module/atoms/button/button-tokens.js +2 -2
- package/lib/module/atoms/button/button-tokens.js.map +1 -1
- package/lib/module/atoms/button/button.android.js +6 -2
- package/lib/module/atoms/button/button.android.js.map +1 -1
- package/lib/module/atoms/button/button.ios.js +7 -2
- package/lib/module/atoms/button/button.ios.js.map +1 -1
- package/lib/module/atoms/card/card.android.js +5 -3
- package/lib/module/atoms/card/card.android.js.map +1 -1
- package/lib/module/atoms/card/card.ios.js +7 -3
- package/lib/module/atoms/card/card.ios.js.map +1 -1
- package/lib/module/atoms/checkbox/checkbox.android.js +1 -1
- package/lib/module/atoms/checkbox/checkbox.android.js.map +1 -1
- package/lib/module/atoms/color-picker/color-picker.android.js +32 -5
- package/lib/module/atoms/color-picker/color-picker.android.js.map +1 -1
- package/lib/module/atoms/fab/fab.android.js +9 -1
- package/lib/module/atoms/fab/fab.android.js.map +1 -1
- package/lib/module/atoms/fab/fab.ios.js +9 -3
- package/lib/module/atoms/fab/fab.ios.js.map +1 -1
- package/lib/module/atoms/glass-view/glass-view.android.js +1 -1
- package/lib/module/atoms/glass-view/glass-view.android.js.map +1 -1
- package/lib/module/atoms/h-stack/h-stack.ios.js +5 -3
- package/lib/module/atoms/h-stack/h-stack.ios.js.map +1 -1
- package/lib/module/atoms/icon-button/icon-button.android.js +9 -0
- package/lib/module/atoms/icon-button/icon-button.android.js.map +1 -1
- package/lib/module/atoms/icon-button/icon-button.ios.js +26 -6
- package/lib/module/atoms/icon-button/icon-button.ios.js.map +1 -1
- package/lib/module/atoms/image/image.js +4 -4
- package/lib/module/atoms/image/image.js.map +1 -1
- package/lib/module/atoms/pressable/pressable.js +52 -28
- package/lib/module/atoms/pressable/pressable.js.map +1 -1
- package/lib/module/atoms/progress/progress.android.js +7 -0
- package/lib/module/atoms/progress/progress.android.js.map +1 -1
- package/lib/module/atoms/progress/progress.ios.js +6 -1
- package/lib/module/atoms/progress/progress.ios.js.map +1 -1
- package/lib/module/atoms/segmented-control/segmented-control.android.js +1 -1
- package/lib/module/atoms/segmented-control/segmented-control.android.js.map +1 -1
- package/lib/module/atoms/segmented-control/segmented-control.ios.js +1 -1
- package/lib/module/atoms/segmented-control/segmented-control.ios.js.map +1 -1
- package/lib/module/atoms/skeleton/skeleton.js +20 -6
- package/lib/module/atoms/skeleton/skeleton.js.map +1 -1
- package/lib/module/atoms/surface/surface.android.js +5 -3
- package/lib/module/atoms/surface/surface.android.js.map +1 -1
- package/lib/module/atoms/surface/surface.ios.js +7 -3
- package/lib/module/atoms/surface/surface.ios.js.map +1 -1
- package/lib/module/atoms/switch/switch.android.js +1 -1
- package/lib/module/atoms/switch/switch.android.js.map +1 -1
- package/lib/module/atoms/text/text.android.js +5 -3
- package/lib/module/atoms/text/text.android.js.map +1 -1
- package/lib/module/atoms/text/text.ios.js +6 -4
- package/lib/module/atoms/text/text.ios.js.map +1 -1
- package/lib/module/atoms/v-stack/v-stack.ios.js +5 -3
- package/lib/module/atoms/v-stack/v-stack.ios.js.map +1 -1
- package/lib/module/atoms/z-stack/z-stack.ios.js +5 -3
- package/lib/module/atoms/z-stack/z-stack.ios.js.map +1 -1
- package/lib/module/glyph/glyph.android.js +2 -0
- package/lib/module/glyph/glyph.android.js.map +1 -1
- package/lib/module/glyph/glyph.ios.js +5 -2
- package/lib/module/glyph/glyph.ios.js.map +1 -1
- package/lib/module/molecules/collapsible/collapsible.android.js +18 -8
- package/lib/module/molecules/collapsible/collapsible.android.js.map +1 -1
- package/lib/module/molecules/labeled-content/labeled-content.js +4 -1
- package/lib/module/molecules/labeled-content/labeled-content.js.map +1 -1
- package/lib/module/molecules/link/link.js +4 -1
- package/lib/module/molecules/link/link.js.map +1 -1
- package/lib/module/molecules/list-item/list-item.js +4 -1
- package/lib/module/molecules/list-item/list-item.js.map +1 -1
- package/lib/module/molecules/navigation-bar/navigation-bar.android.js +1 -1
- package/lib/module/molecules/navigation-bar/navigation-bar.android.js.map +1 -1
- package/lib/module/molecules/navigation-bar/navigation-bar.ios.js +1 -1
- package/lib/module/molecules/navigation-bar/navigation-bar.ios.js.map +1 -1
- package/lib/module/molecules/rn-list-item/rn-list-item.js +10 -2
- package/lib/module/molecules/rn-list-item/rn-list-item.js.map +1 -1
- package/lib/module/molecules/scroll-edge-container/scroll-edge-container.android.js +3 -4
- package/lib/module/molecules/scroll-edge-container/scroll-edge-container.android.js.map +1 -1
- package/lib/module/molecules/stepper/stepper.ios.js +6 -2
- package/lib/module/molecules/stepper/stepper.ios.js.map +1 -1
- package/lib/module/motion.js +19 -0
- package/lib/module/motion.js.map +1 -0
- package/lib/module/organisms/fab-menu/fab-menu.android.js +8 -5
- package/lib/module/organisms/fab-menu/fab-menu.android.js.map +1 -1
- package/lib/module/organisms/fab-menu/fab-menu.ios.js +5 -2
- package/lib/module/organisms/fab-menu/fab-menu.ios.js.map +1 -1
- package/lib/module/organisms/snackbar/snackbar.js +142 -17
- package/lib/module/organisms/snackbar/snackbar.js.map +1 -1
- package/lib/module/organisms/swipe-actions/swipe-actions.android.js +1 -1
- package/lib/module/organisms/swipe-actions/swipe-actions.android.js.map +1 -1
- package/lib/module/use-stack-modifiers.js +10 -8
- package/lib/module/use-stack-modifiers.js.map +1 -1
- package/lib/typescript/atoms/activity-indicator/activity-indicator.types.d.ts +3 -1
- package/lib/typescript/atoms/avatar/avatar.types.d.ts +7 -2
- package/lib/typescript/atoms/badge/badge.types.d.ts +1 -1
- package/lib/typescript/atoms/blur-view/blur-view.types.d.ts +6 -6
- package/lib/typescript/atoms/button/button-tokens.d.ts +1 -1
- package/lib/typescript/atoms/button/button.types.d.ts +9 -7
- package/lib/typescript/atoms/card/card.types.d.ts +3 -3
- package/lib/typescript/atoms/checkbox/checkbox.types.d.ts +2 -2
- package/lib/typescript/atoms/chip/chip.types.d.ts +1 -1
- package/lib/typescript/atoms/color-picker/color-picker.types.d.ts +4 -3
- package/lib/typescript/atoms/date-picker/date-picker.types.d.ts +4 -4
- package/lib/typescript/atoms/divider/divider.types.d.ts +2 -2
- package/lib/typescript/atoms/fab/fab.types.d.ts +10 -3
- package/lib/typescript/atoms/glass-view/glass-view.types.d.ts +5 -5
- package/lib/typescript/atoms/h-stack/h-stack.types.d.ts +8 -5
- package/lib/typescript/atoms/icon/icon.types.d.ts +4 -4
- package/lib/typescript/atoms/icon-button/icon-button.types.d.ts +14 -3
- package/lib/typescript/atoms/image/image.d.ts +2 -2
- package/lib/typescript/atoms/island/island.types.d.ts +4 -4
- package/lib/typescript/atoms/list/list.types.d.ts +5 -5
- package/lib/typescript/atoms/picker/picker.types.d.ts +1 -1
- package/lib/typescript/atoms/pressable/pressable.types.d.ts +23 -7
- package/lib/typescript/atoms/progress/progress.types.d.ts +3 -1
- package/lib/typescript/atoms/rn-flat-list/rn-flat-list.types.d.ts +2 -2
- package/lib/typescript/atoms/rn-icon/rn-icon.types.d.ts +1 -1
- package/lib/typescript/atoms/rn-scroll-view/rn-scroll-view.types.d.ts +2 -2
- package/lib/typescript/atoms/rn-section-list/rn-section-list.types.d.ts +2 -2
- package/lib/typescript/atoms/rn-text/rn-text.types.d.ts +2 -2
- package/lib/typescript/atoms/rn-view/rn-view.types.d.ts +3 -3
- package/lib/typescript/atoms/scroll-view/scroll-view.types.d.ts +3 -3
- package/lib/typescript/atoms/segmented-control/segmented-control.types.d.ts +3 -3
- package/lib/typescript/atoms/skeleton/skeleton.types.d.ts +2 -1
- package/lib/typescript/atoms/spacer/spacer.types.d.ts +1 -1
- package/lib/typescript/atoms/surface/surface.types.d.ts +3 -3
- package/lib/typescript/atoms/switch/switch.types.d.ts +1 -1
- package/lib/typescript/atoms/text/text.types.d.ts +3 -3
- package/lib/typescript/atoms/text-field/text-field.types.d.ts +4 -4
- package/lib/typescript/atoms/v-stack/v-stack.types.d.ts +4 -4
- package/lib/typescript/atoms/z-stack/z-stack.types.d.ts +4 -4
- package/lib/typescript/glyph/glyph-button.types.d.ts +1 -1
- package/lib/typescript/glyph/glyph.types.d.ts +3 -1
- package/lib/typescript/molecules/collapsible/collapsible.types.d.ts +1 -1
- package/lib/typescript/molecules/empty-state/empty-state.types.d.ts +1 -1
- package/lib/typescript/molecules/label/label.types.d.ts +1 -1
- package/lib/typescript/molecules/labeled-content/labeled-content.types.d.ts +6 -4
- package/lib/typescript/molecules/link/link.types.d.ts +2 -1
- package/lib/typescript/molecules/list-item/list-item.types.d.ts +6 -4
- package/lib/typescript/molecules/navigation-bar/navigation-bar.types.d.ts +8 -8
- package/lib/typescript/molecules/pager/pager.types.d.ts +2 -2
- package/lib/typescript/molecules/radio-group/radio-group.types.d.ts +2 -2
- 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 +7 -7
- package/lib/typescript/molecules/scroll-edge-container/scroll-edge-container.types.d.ts +3 -3
- package/lib/typescript/molecules/search-bar/search-bar.types.d.ts +2 -2
- package/lib/typescript/molecules/stepper/stepper.ios.d.ts +1 -1
- package/lib/typescript/molecules/stepper/stepper.types.d.ts +2 -2
- package/lib/typescript/molecules/tooltip/tooltip.types.d.ts +6 -6
- package/lib/typescript/motion.d.ts +8 -0
- package/lib/typescript/organisms/action-sheet/action-sheet.types.d.ts +3 -3
- package/lib/typescript/organisms/alert/alert.types.d.ts +3 -3
- package/lib/typescript/organisms/context-menu/context-menu.types.d.ts +9 -9
- package/lib/typescript/organisms/fab-menu/fab-menu.types.d.ts +10 -5
- package/lib/typescript/organisms/form/form.types.d.ts +1 -1
- package/lib/typescript/organisms/menu/menu.types.d.ts +2 -2
- package/lib/typescript/organisms/sheet/sheet.types.d.ts +12 -12
- package/lib/typescript/organisms/snackbar/snackbar.types.d.ts +39 -6
- package/lib/typescript/organisms/swipe-actions/swipe-actions.types.d.ts +5 -5
- package/lib/typescript/templates/screen/screen.types.d.ts +2 -2
- package/lib/typescript/use-stack-modifiers.d.ts +6 -5
- package/package.json +4 -4
- package/src/atoms/activity-indicator/activity-indicator.android.tsx +7 -1
- package/src/atoms/activity-indicator/activity-indicator.ios.tsx +9 -1
- package/src/atoms/activity-indicator/activity-indicator.types.ts +3 -1
- package/src/atoms/avatar/avatar.tsx +5 -1
- package/src/atoms/avatar/avatar.types.ts +7 -2
- package/src/atoms/badge/badge.types.ts +1 -1
- package/src/atoms/blur-view/blur-view.types.ts +6 -6
- package/src/atoms/button/button-tokens.ts +2 -2
- package/src/atoms/button/button.android.tsx +5 -3
- package/src/atoms/button/button.ios.tsx +10 -2
- package/src/atoms/button/button.types.ts +9 -7
- package/src/atoms/card/card.android.tsx +6 -4
- package/src/atoms/card/card.ios.tsx +7 -3
- package/src/atoms/card/card.types.ts +9 -8
- package/src/atoms/checkbox/checkbox.android.tsx +1 -1
- package/src/atoms/checkbox/checkbox.types.ts +2 -2
- package/src/atoms/chip/chip.types.ts +1 -1
- package/src/atoms/color-picker/color-picker.android.tsx +26 -6
- package/src/atoms/color-picker/color-picker.types.ts +4 -3
- package/src/atoms/date-picker/date-picker.types.ts +4 -4
- package/src/atoms/divider/divider.types.ts +2 -2
- package/src/atoms/fab/fab.android.tsx +5 -3
- package/src/atoms/fab/fab.ios.tsx +8 -4
- package/src/atoms/fab/fab.types.ts +10 -3
- package/src/atoms/glass-view/glass-view.android.tsx +1 -1
- package/src/atoms/glass-view/glass-view.types.ts +5 -5
- package/src/atoms/h-stack/h-stack.ios.tsx +6 -4
- package/src/atoms/h-stack/h-stack.types.ts +18 -14
- package/src/atoms/icon/icon.types.ts +4 -4
- package/src/atoms/icon-button/icon-button.android.tsx +16 -3
- package/src/atoms/icon-button/icon-button.ios.tsx +24 -5
- package/src/atoms/icon-button/icon-button.types.ts +14 -3
- package/src/atoms/image/image.tsx +3 -3
- package/src/atoms/island/island.types.ts +4 -4
- package/src/atoms/list/list.types.ts +5 -5
- package/src/atoms/picker/picker.types.ts +1 -1
- package/src/atoms/pressable/pressable.tsx +50 -21
- package/src/atoms/pressable/pressable.types.ts +35 -17
- package/src/atoms/progress/progress.android.tsx +5 -3
- package/src/atoms/progress/progress.ios.tsx +5 -2
- package/src/atoms/progress/progress.types.ts +3 -1
- package/src/atoms/rn-flat-list/rn-flat-list.types.ts +2 -2
- package/src/atoms/rn-icon/rn-icon.types.ts +1 -1
- package/src/atoms/rn-scroll-view/rn-scroll-view.types.ts +2 -2
- package/src/atoms/rn-section-list/rn-section-list.types.ts +2 -2
- package/src/atoms/rn-text/rn-text.types.ts +2 -2
- package/src/atoms/rn-view/rn-view.types.ts +3 -3
- package/src/atoms/scroll-view/scroll-view.types.ts +3 -3
- package/src/atoms/segmented-control/segmented-control.android.tsx +1 -1
- package/src/atoms/segmented-control/segmented-control.ios.tsx +1 -1
- package/src/atoms/segmented-control/segmented-control.types.ts +3 -3
- package/src/atoms/skeleton/skeleton.tsx +18 -4
- package/src/atoms/skeleton/skeleton.types.ts +2 -1
- package/src/atoms/spacer/spacer.types.ts +1 -1
- package/src/atoms/surface/surface.android.tsx +6 -4
- package/src/atoms/surface/surface.ios.tsx +7 -3
- package/src/atoms/surface/surface.types.ts +11 -10
- package/src/atoms/switch/switch.android.tsx +1 -1
- package/src/atoms/switch/switch.types.ts +1 -1
- package/src/atoms/text/text.android.tsx +6 -4
- package/src/atoms/text/text.ios.tsx +6 -4
- package/src/atoms/text/text.types.ts +24 -23
- package/src/atoms/text-field/text-field.types.ts +4 -4
- package/src/atoms/v-stack/v-stack.ios.tsx +6 -4
- package/src/atoms/v-stack/v-stack.types.ts +18 -17
- package/src/atoms/z-stack/z-stack.ios.tsx +6 -4
- package/src/atoms/z-stack/z-stack.types.ts +16 -15
- package/src/glyph/glyph-button.types.ts +1 -1
- package/src/glyph/glyph.android.tsx +14 -2
- package/src/glyph/glyph.ios.tsx +13 -3
- package/src/glyph/glyph.types.ts +3 -1
- package/src/molecules/collapsible/collapsible.android.tsx +27 -7
- package/src/molecules/collapsible/collapsible.types.ts +1 -1
- package/src/molecules/empty-state/empty-state.types.ts +1 -1
- package/src/molecules/label/label.types.ts +1 -1
- package/src/molecules/labeled-content/labeled-content.tsx +12 -1
- package/src/molecules/labeled-content/labeled-content.types.ts +6 -4
- package/src/molecules/link/link.tsx +2 -1
- package/src/molecules/link/link.types.ts +2 -1
- package/src/molecules/list-item/list-item.tsx +20 -2
- package/src/molecules/list-item/list-item.types.ts +6 -4
- package/src/molecules/navigation-bar/navigation-bar.android.tsx +1 -1
- package/src/molecules/navigation-bar/navigation-bar.ios.tsx +1 -1
- package/src/molecules/navigation-bar/navigation-bar.types.ts +8 -8
- package/src/molecules/pager/pager.types.ts +2 -2
- package/src/molecules/radio-group/radio-group.types.ts +2 -2
- package/src/molecules/rn-list-item/rn-list-item.tsx +18 -3
- package/src/molecules/rn-list-item/rn-list-item.types.ts +1 -1
- package/src/molecules/rn-tooltip/rn-tooltip.types.ts +7 -7
- package/src/molecules/scroll-edge-container/scroll-edge-container.android.tsx +3 -2
- package/src/molecules/scroll-edge-container/scroll-edge-container.types.ts +3 -3
- package/src/molecules/search-bar/search-bar.types.ts +2 -2
- package/src/molecules/stepper/stepper.ios.tsx +8 -2
- package/src/molecules/stepper/stepper.types.ts +2 -2
- package/src/molecules/tooltip/tooltip.types.ts +6 -6
- package/src/motion.ts +13 -0
- package/src/organisms/action-sheet/action-sheet.types.ts +3 -3
- package/src/organisms/alert/alert.types.ts +3 -3
- package/src/organisms/context-menu/context-menu.types.ts +9 -9
- package/src/organisms/fab-menu/fab-menu.android.tsx +9 -5
- package/src/organisms/fab-menu/fab-menu.ios.tsx +6 -2
- package/src/organisms/fab-menu/fab-menu.types.ts +10 -5
- package/src/organisms/form/form.types.ts +1 -1
- package/src/organisms/menu/menu.types.ts +2 -2
- package/src/organisms/sheet/sheet.types.ts +12 -12
- package/src/organisms/snackbar/snackbar.tsx +143 -19
- package/src/organisms/snackbar/snackbar.types.ts +42 -6
- package/src/organisms/swipe-actions/swipe-actions.android.tsx +1 -1
- package/src/organisms/swipe-actions/swipe-actions.types.ts +5 -5
- package/src/templates/screen/screen.types.ts +2 -2
- package/src/use-stack-modifiers.ts +20 -7
- package/lib/module/platform-support.js +0 -19
- package/lib/module/platform-support.js.map +0 -1
- package/lib/typescript/platform-support.d.ts +0 -8
- package/src/platform-support.ts +0 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,58 @@
|
|
|
1
1
|
# @hzblj/kara-components
|
|
2
2
|
|
|
3
|
+
## 0.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#25](https://github.com/hzblj/kara-ui/pull/25) [`6828522`](https://github.com/hzblj/kara-ui/commit/68285220a725ccfcd2c2bd9a4bcc7eb3a7f8a047) Thanks [@hzblj](https://github.com/hzblj)! - Accessibility props in the engine: `accessibilityLabel`, `accessibilityHint`, `accessibilityRole` (`button`, `header`, `image`, `link`, `text`), `accessibilityValue`, `accessibilityHidden` and `accessible`, one set for both platforms. `@hzblj/kara-sx` turns them into SwiftUI's accessibility modifiers on iOS and into Compose semantics on Android, through a new `karaAccessibility` modifier in `@hzblj/kara-native` (a native rebuild picks it up). The stacks, `Text`, `Card`, `Surface`, `ListItem`, `RnListItem`, `LabeledContent`, `Link` and `Pressable` take all of them; `Button` takes a hint, and `Avatar`, `Progress` and `ActivityIndicator` a label.
|
|
8
|
+
|
|
9
|
+
What the components do by themselves: a stack with `onPress` is read as one button, `Pressable` is a button, list rows and a `LabeledContent` with a value are read as one element, `Link` is a link, and `Skeleton` and an `Avatar` without a label are hidden. `IconButton`, `Fab` and `FabMenu` now require an `accessibilityLabel`, since an icon has nothing of its own for VoiceOver or TalkBack to say; `Snackbar`'s close button is labelled.
|
|
10
|
+
|
|
11
|
+
Reduce Motion: `useReducedMotion()` follows the device's Reduce Motion (iOS) or Remove animations (Android) setting live, and `KaraProvider reduceMotion` can force it (`always`) or ignore it (`never`). With motion reduced, `Pressable` dims instead of scaling, `Snackbar` only fades, `Skeleton` holds still, Android's `Collapsible` fades and snaps its chevron, and iOS's `Stepper` cross-fades its value.
|
|
12
|
+
|
|
13
|
+
- [#25](https://github.com/hzblj/kara-ui/pull/25) [`6828522`](https://github.com/hzblj/kara-ui/commit/68285220a725ccfcd2c2bd9a4bcc7eb3a7f8a047) Thanks [@hzblj](https://github.com/hzblj)! - Motion tokens on transitions.dev's scale, in place of the `d0` to `d10000` steps, of which six were ever used. Durations are named by what the motion does: `micro` (80 ms, what answers a touch), `quick` (150 ms, something leaving or swapped in place), `fast` (250 ms, something arriving), `medium` (350 ms, a larger surface leaving), `slow` (400 ms, a larger surface arriving), `verySlow` (500 ms, an emphasised moment), `stagger` (40 ms, the offset between items) and `none`. Pick a step by what the motion does, not by the number it had: as a rule of thumb, `d100` is `micro`, `d150` `quick`, `d200` `quick` or `fast`, `d250` and `d300` `fast`, `d400` `slow` and `d500` `verySlow`. `ZoomTransition`'s Android `duration` takes the same names and, unset, keeps Material's own 450 ms.
|
|
14
|
+
|
|
15
|
+
New `easing` tokens carry the curves as cubic-bézier points, ready for `Easing.bezier(...easing.smoothOut)`: `smoothOut` for arriving and leaving alike, `inOut` for a swap in place, `out` for a small fade, `linear` for what loops.
|
|
16
|
+
|
|
17
|
+
The components use them: `Pressable` eases its scale down in `quick` and back in `fast` with no bounce, and dims in `micro`; `Snackbar` arrives in `fast` and leaves in `quick` on `smoothOut`; `Image` fades in over `quick`.
|
|
18
|
+
|
|
19
|
+
`content.on.bg` is `content.on.accent`, which is what it sits on (Material's `onPrimary` under `dynamicColor`). The opacity and spacing scales keep their values and are documented now: the opacity ramp's tens and quarters, and spacing's 4 pt grid with half steps where small gaps need them.
|
|
20
|
+
|
|
21
|
+
- [#25](https://github.com/hzblj/kara-ui/pull/25) [`6828522`](https://github.com/hzblj/kara-ui/commit/68285220a725ccfcd2c2bd9a4bcc7eb3a7f8a047) Thanks [@hzblj](https://github.com/hzblj)! - `Snackbar` puts its action at the trailing end, as far in from the edge as the message is from the start, and takes Material's options: `duration` (`short`, `long`, `indefinite` or milliseconds, with `onDismiss` when it runs out), `dismissible` (a close button), `actionOnNewLine`, `position` (`bottom` or `top`) and `offset`. `animation` picks how it comes and goes (`scale`, Material's own, by default on Android; `slide` on iOS; `fade`), and `entering` and `exiting` take Reanimated animations of your own. It is announced to VoiceOver and TalkBack when it appears.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [[`6828522`](https://github.com/hzblj/kara-ui/commit/68285220a725ccfcd2c2bd9a4bcc7eb3a7f8a047), [`6828522`](https://github.com/hzblj/kara-ui/commit/68285220a725ccfcd2c2bd9a4bcc7eb3a7f8a047)]:
|
|
26
|
+
- @hzblj/kara-sx@0.11.0
|
|
27
|
+
- @hzblj/kara-native@0.11.0
|
|
28
|
+
- @hzblj/kara-theme@0.11.0
|
|
29
|
+
|
|
30
|
+
## 0.10.0
|
|
31
|
+
|
|
32
|
+
### Minor Changes
|
|
33
|
+
|
|
34
|
+
- [#23](https://github.com/hzblj/kara-ui/pull/23) [`26f1651`](https://github.com/hzblj/kara-ui/commit/26f1651b6a8be9fc2d7af6bbe29bd2335605a717) Thanks [@hzblj](https://github.com/hzblj)! - `ColorPicker` works on Android. Compose ships no colour picker, so kara draws its own in the iOS picker's shape: a well with a rainbow ring beside the label, and a Material bottom sheet with a grid of swatches, a spectrum and RGB sliders, an opacity slider with `supportsOpacity`, and the colour with its hex at the foot. It reports every change through `onValueChange`, as `#RRGGBB` or, with opacity, `#RRGGBBAA`. It needs no extra dependency.
|
|
35
|
+
|
|
36
|
+
`Pressable` takes a `pressEffect`: `scale` springs the content down to `pressedScale` (0.96), `opacity` dims it to `pressedOpacity` (`o60`), `none` holds it still. Each platform keeps its own by default, a spring on iOS and the ripple on Android, and Android keeps the ripple on top of any effect unless `ripple` is off.
|
|
37
|
+
|
|
38
|
+
`IconButton` on iOS sits in a 44pt tap target with the icon centred, as Android's sits in Material's 48dp, so a row of them spaces itself the same way on both. A disabled one is dimmed once, by SwiftUI, instead of twice.
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- Updated dependencies [[`26f1651`](https://github.com/hzblj/kara-ui/commit/26f1651b6a8be9fc2d7af6bbe29bd2335605a717), [`26f1651`](https://github.com/hzblj/kara-ui/commit/26f1651b6a8be9fc2d7af6bbe29bd2335605a717)]:
|
|
43
|
+
- @hzblj/kara-native@0.10.0
|
|
44
|
+
- @hzblj/kara-theme@0.10.0
|
|
45
|
+
- @hzblj/kara-sx@0.10.0
|
|
46
|
+
|
|
3
47
|
## 0.9.0
|
|
4
48
|
|
|
5
49
|
### Minor Changes
|
|
6
50
|
|
|
7
|
-
- [#21](https://github.com/hzblj/kara-ui/pull/21) [`356c00f`](https://github.com/hzblj/kara-ui/commit/356c00f76eee8323c4eb65ed4cbcda121c3af627) Thanks [@hzblj](https://github.com/hzblj)! - `TextField`'s `error` takes a message: `error="A postcode has five digits."` shows it under the field
|
|
51
|
+
- [#21](https://github.com/hzblj/kara-ui/pull/21) [`356c00f`](https://github.com/hzblj/kara-ui/commit/356c00f76eee8323c4eb65ed4cbcda121c3af627) Thanks [@hzblj](https://github.com/hzblj)! - `TextField`'s `error` takes a message: `error="A postcode has five digits."` shows it under the field (Material's supporting text beside its error icon on Android), so an error never rests on colour alone, which in dark mode Material draws a pale red. `error` alone still marks the field. kara's glyphs gain `error` for it.
|
|
8
52
|
|
|
9
53
|
`Tabs` on iOS tint their icons: the selected one takes the accent and the rest the label colour. Expo Router tints an asset-catalog icon only when both states have an icon colour, so with the accent alone every icon kept its SVG's black, selected or not, in dark mode too.
|
|
10
54
|
|
|
11
|
-
`Surface` on iOS sits on `surface.primary` unless told otherwise, as it does on Android; a plain one drew nothing behind its content. `Progress` with `circular` and a `value` is a ring that fills on iOS
|
|
55
|
+
`Surface` on iOS sits on `surface.primary` unless told otherwise, as it does on Android; a plain one drew nothing behind its content. `Progress` with `circular` and a `value` is a ring that fills on iOS (a SwiftUI capacity `Gauge`), where a circular `ProgressView` ignored the value and spun.
|
|
12
56
|
|
|
13
57
|
### Patch Changes
|
|
14
58
|
|
|
@@ -21,23 +65,23 @@
|
|
|
21
65
|
|
|
22
66
|
### Minor Changes
|
|
23
67
|
|
|
24
|
-
- [#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
|
|
68
|
+
- [#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`.
|
|
25
69
|
|
|
26
70
|
`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.
|
|
27
71
|
|
|
28
72
|
- [#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.
|
|
29
73
|
|
|
30
|
-
- `GlassView` is frosted glass on Android: what lies behind the capsule, blurred (Android 12+), under a translucent tonal surface
|
|
31
|
-
- `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
|
|
32
|
-
- New token `surface.secondary`: Material's `surfaceContainer` on Android, `tertiarySystemGroupedBackgroundColor` on iOS
|
|
74
|
+
- `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.
|
|
75
|
+
- `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; before, it grew to its content's height, ran under the bottom bar and could not scroll.
|
|
76
|
+
- New token `surface.secondary`, a step above `surface.primary`: Material's `surfaceContainer` on Android, `tertiarySystemGroupedBackgroundColor` on iOS.
|
|
33
77
|
|
|
34
|
-
- [#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
|
|
78
|
+
- [#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.
|
|
35
79
|
|
|
36
80
|
`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.
|
|
37
81
|
|
|
38
|
-
- [#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
|
|
82
|
+
- [#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`).
|
|
39
83
|
|
|
40
|
-
- iOS: UIKit's `system*Material` blur as a plain view
|
|
84
|
+
- 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.
|
|
41
85
|
- 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.
|
|
42
86
|
- `appearance` pins a material to light or dark whatever the app's; `borderRadius` shapes it and clips the content.
|
|
43
87
|
|
|
@@ -45,8 +89,8 @@
|
|
|
45
89
|
|
|
46
90
|
- [#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:
|
|
47
91
|
|
|
48
|
-
- `Text` takes the native `sx` surface
|
|
49
|
-
- `RnText` takes `Box`'s `sx` props for its own box
|
|
92
|
+
- `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.
|
|
93
|
+
- `RnText` takes `Box`'s `sx` props for its own box (margins, `flex`, padding), all but `align`, which still aligns its lines.
|
|
50
94
|
- `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`.
|
|
51
95
|
- `Island` takes the same `sx` props for where it sits in React Native layout: `<Island h={240} matchContents={false}>`. An explicit `style` still wins.
|
|
52
96
|
- `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.
|
|
@@ -63,7 +107,7 @@
|
|
|
63
107
|
|
|
64
108
|
### Minor Changes
|
|
65
109
|
|
|
66
|
-
- [#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
|
|
110
|
+
- [#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:
|
|
67
111
|
|
|
68
112
|
```tsx
|
|
69
113
|
<SwipeActions
|
|
@@ -75,33 +119,33 @@
|
|
|
75
119
|
</SwipeActions>
|
|
76
120
|
```
|
|
77
121
|
|
|
78
|
-
iOS renders SwiftUI's `swipeActions`, each action its icon on a button in its tint
|
|
122
|
+
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.
|
|
79
123
|
|
|
80
|
-
- [#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
|
|
124
|
+
- [#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.
|
|
81
125
|
|
|
82
|
-
- [#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
|
|
126
|
+
- [#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.
|
|
83
127
|
|
|
84
128
|
`TooltipBox` (`@hzblj/kara-native/jetpack-compose`) takes `plain` for that style, and hides when `isPresented` turns false.
|
|
85
129
|
|
|
86
130
|
### Patch Changes
|
|
87
131
|
|
|
88
|
-
- [#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
|
|
132
|
+
- [#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.
|
|
89
133
|
|
|
90
134
|
`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`.
|
|
91
135
|
|
|
92
136
|
- [#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:
|
|
93
137
|
|
|
94
|
-
- `Screen` keeps its content clear of the status bar when nothing sits above it, as a SwiftUI host keeps to the safe area
|
|
95
|
-
- `Form` is inset from its container on every side, with section titles and footers indented to the cards' content, like SwiftUI's grouped form
|
|
138
|
+
- `Screen` keeps its content clear of the status bar when nothing sits above it, as a SwiftUI host keeps to the safe area; it used to draw under it. Under a navigation bar nothing changes; the background still runs to the edges.
|
|
139
|
+
- `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 used to run into the screen's edges.
|
|
96
140
|
- 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.
|
|
97
141
|
|
|
98
|
-
- [#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
|
|
142
|
+
- [#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.
|
|
99
143
|
|
|
100
|
-
- [#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`
|
|
144
|
+
- [#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.
|
|
101
145
|
|
|
102
146
|
- [#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.
|
|
103
147
|
|
|
104
|
-
- [#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
|
|
148
|
+
- [#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.
|
|
105
149
|
|
|
106
150
|
- 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)]:
|
|
107
151
|
- @hzblj/kara-native@0.7.0
|
|
@@ -114,13 +158,13 @@
|
|
|
114
158
|
|
|
115
159
|
- [#10](https://github.com/hzblj/kara-ui/pull/10) [`62b7131`](https://github.com/hzblj/kara-ui/commit/62b713143bd03872ecdd89ca8de42d98fe589617) Thanks [@hzblj](https://github.com/hzblj)! - Haptics: kara's own, native on both platforms, named for what happened.
|
|
116
160
|
|
|
117
|
-
- `haptics.success()`, `haptics.selection()`, …
|
|
118
|
-
- iOS: UIKit's feedback generators, kept alive and warmed up with `haptics.prepare`
|
|
161
|
+
- One function per haptic (`haptics.success()`, `haptics.selection()`, …) and `haptics.play(name)` for a name that arrives as data. `selection`, `tick`, `toggleOn`/`toggleOff`, `success`/`warning`/`error`, `longPress`, `dragStart`, `thresholdActivate`/`thresholdDeactivate`, `keyPress`, and the impacts `soft`, `light`, `medium`, `rigid`, `heavy` (`intensity` scales them on iOS). Synchronous, nothing to await.
|
|
162
|
+
- iOS: UIKit's feedback generators, kept alive and warmed up with `haptics.prepare` (`Pressable` prepares its haptic on press-in). Android: the system's own haptic feedback (`View.performHapticFeedback`), with Android 14's constants falling back to older ones, never a raw vibration. Both follow the user's system setting.
|
|
119
163
|
- `useHapticFeedback(trigger, haptic)` plays on every change of a value, never on mount; a function of the previous and next value picks a haptic per change.
|
|
120
164
|
- `haptics.setEnabled(false)` silences every kara haptic, the components' own included.
|
|
121
165
|
- `Pressable`'s `haptic` takes a name as well as `true` (a `light` impact); `Chip` plays `selection`.
|
|
122
166
|
- On Android, where Compose's Material controls play nothing: `Switch` plays `toggleOn`/`toggleOff`, a stepped `Slider` ticks at every stop, `SegmentedControl` plays `selection`. iOS keeps its native controls' own feedback.
|
|
123
|
-
- `Slider`: `step` is the increment on Android too
|
|
167
|
+
- `Slider`: `step` is the increment on Android too. It was passed to Compose as the number of stops.
|
|
124
168
|
- `expo-haptics` is no longer a peer dependency.
|
|
125
169
|
|
|
126
170
|
### Patch Changes
|
|
@@ -181,7 +225,7 @@
|
|
|
181
225
|
|
|
182
226
|
### Minor Changes
|
|
183
227
|
|
|
184
|
-
- [`f84ffd5`](https://github.com/hzblj/kara-ui/commit/f84ffd52954a5e7052541c8682787137de205a28) Thanks [@hzblj](https://github.com/hzblj)! - Native sheets with a native header. `Sheet` is now a TrueSheet (`@lodev09/react-native-true-sheet`, a new peer dependency) with `<Sheet.Header>`
|
|
228
|
+
- [`f84ffd5`](https://github.com/hzblj/kara-ui/commit/f84ffd52954a5e7052541c8682787137de205a28) Thanks [@hzblj](https://github.com/hzblj)! - Native sheets with a native header. `Sheet` is now a TrueSheet (`@lodev09/react-native-true-sheet`, a new peer dependency) with `<Sheet.Header>`, `<Sheet.ScrollView>`, `useSheetScroll`, detents, a footer and a ref (`present`/`dismiss`/`resize`). `<Sheet.Header>` is a real navigation bar with a centred, leading or large title that hands over to the bar as it scrolls away, items on either side, and on iOS 26 the content scrolls under it with the soft edge effect. It is React Native tier now: no host, native atoms inside go in an `Island`. `fitToContents` is replaced by `detents` (`['auto']` by default).
|
|
185
229
|
|
|
186
230
|
`NavigationBar` takes `leadingItems` / `trailingItems` instead of `onBack` / `onClose`: `back`, `close` or an app `icon`, on either side and in any order; on iOS 26 neighbours share a glass capsule unless an item is `separated`. Also `titleAlignment`, `titleVisible`, `inverted` and an iOS `search` field. On Android it is now Material's native top app bar.
|
|
187
231
|
|
|
@@ -209,12 +253,12 @@
|
|
|
209
253
|
|
|
210
254
|
- [`c30bef6`](https://github.com/hzblj/kara-ui/commit/c30bef6be2639deb6d385ad209d1a2799b5b656f) Thanks [@hzblj](https://github.com/hzblj)! - Icons are now fully native and the app's own: `plugins: [['@hzblj/kara-ui', {icons: {source: './assets/icons'}}]]` turns every SVG in the folder into an iOS asset-catalog template image and an Android vector drawable at prebuild (`x.ios.svg` / `x.android.svg` for per-platform glyphs), and writes `kara-icons.d.ts` so `name` only accepts icons that exist; `npx kara-icons` does the same for CI. `Icon` draws them in a host, the new `RnIcon` anywhere, and `Tabs` passes them as `xcasset` / `drawable`. The built-in SF Symbol / Material icon names and the `@expo/vector-icons` peer dependency are gone.
|
|
211
255
|
|
|
212
|
-
- [`c30bef6`](https://github.com/hzblj/kara-ui/commit/c30bef6be2639deb6d385ad209d1a2799b5b656f) Thanks [@hzblj](https://github.com/hzblj)! - Leaner, reusable-only components. `Countdown` is gone, with its native views. There is one `ContextMenu` now
|
|
256
|
+
- [`c30bef6`](https://github.com/hzblj/kara-ui/commit/c30bef6be2639deb6d385ad209d1a2799b5b656f) Thanks [@hzblj](https://github.com/hzblj)! - Leaner, reusable-only components. `Countdown` is gone, with its native views. There is one `ContextMenu` now: the native module's long-press menu on React Native content, with a custom preview on iOS (formerly `RnContextMenu`); the `@expo/ui`-based one is removed.
|
|
213
257
|
|
|
214
258
|
Android, reworked to look and behave like Material while honouring the theme:
|
|
215
259
|
|
|
216
260
|
- `Button`, `Badge` and `Alert` render their labels; `Button` keeps Material's own shape (no iOS ring), takes `tint` as its fill with a label that contrasts with it, and draws `glass` as Material's outlined button.
|
|
217
|
-
- `Alert` is built from `AlertDialog`'s slots
|
|
261
|
+
- `Alert` is built from `AlertDialog`'s slots instead of drawing empty: title, message, the confirm action (destructive when asked) and Cancel.
|
|
218
262
|
- `Menu` presents its actions in Material's dropdown popup, with their icons, instead of laying them out over the trigger.
|
|
219
263
|
- `Picker` is a themed Material exposed dropdown the width of its container.
|
|
220
264
|
- `Switch`, `Checkbox` and `RadioGroup` are tinted with the accent, and with a label are full-width rows that toggle as a whole; `Form` sections span the form's width.
|
|
@@ -232,7 +276,7 @@
|
|
|
232
276
|
|
|
233
277
|
### Minor Changes
|
|
234
278
|
|
|
235
|
-
- [`f919c7b`](https://github.com/hzblj/kara-ui/commit/f919c7b06f3798cebd58eef1581076bf1ee61cd1) Thanks [@hzblj](https://github.com/hzblj)! - First release of the kara-ui design system: theme and tokens, the `sx` engine, atoms, molecules, organisms and `Screen`, native tabs (`@hzblj/kara-ui/router`), the KaraUI native module (Liquid Glass, scroll edge effect, native countdown, context menu with preview, rich tooltip, FAB menu), and `KaraProvider` with theme overrides
|
|
279
|
+
- [`f919c7b`](https://github.com/hzblj/kara-ui/commit/f919c7b06f3798cebd58eef1581076bf1ee61cd1) Thanks [@hzblj](https://github.com/hzblj)! - First release of the kara-ui design system: theme and tokens, the `sx` engine, atoms, molecules, organisms and `Screen`, native tabs (`@hzblj/kara-ui/router`), the KaraUI native module (Liquid Glass, scroll edge effect, native countdown, context menu with preview, rich tooltip, FAB menu), and `KaraProvider` with theme overrides (colours, the app's own fonts, the Material seed, and Material You dynamic colour on Android). Text uses the platform's face by default. Install `@hzblj/kara-ui`; the scoped packages are its building blocks.
|
|
236
280
|
|
|
237
281
|
### Patch Changes
|
|
238
282
|
|
package/README.md
CHANGED
|
@@ -8,25 +8,25 @@
|
|
|
8
8
|
[license-badge]: https://img.shields.io/badge/license-MIT-ff5700?labelColor=27272a
|
|
9
9
|
[license-url]: https://github.com/hzblj/kara-ui/blob/main/LICENSE
|
|
10
10
|
|
|
11
|
-
<a href="https://www.kara.janblazej.dev"><img src="https://www.kara.janblazej.dev/og.png" alt="Kara
|
|
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
12
|
|
|
13
|
-
The components of [Kara UI](https://www.kara.janblazej.dev)
|
|
13
|
+
The components of [Kara UI](https://www.kara.janblazej.dev), a native-first design system for Expo.
|
|
14
14
|
|
|
15
15
|
> **Install [`@hzblj/kara-ui`](https://www.npmjs.com/package/@hzblj/kara-ui) instead.** This package is one of its
|
|
16
16
|
> building blocks, published so its types resolve; everything here is re-exported from `@hzblj/kara-ui`.
|
|
17
17
|
|
|
18
18
|
## What's inside
|
|
19
19
|
|
|
20
|
-
- **Native components
|
|
20
|
+
- **Native components**: real SwiftUI views on iOS and Jetpack Compose on Android, through `@expo/ui`. A `Switch` is
|
|
21
21
|
a SwiftUI `Toggle` on one and a Material `Switch` on the other.
|
|
22
|
-
- **`Screen` and `Island
|
|
23
|
-
- **The React Native tier
|
|
24
|
-
`sx` props, for long lists and for content around the native islands.
|
|
25
|
-
- **Haptics
|
|
22
|
+
- **`Screen` and `Island`**: the hosts native views render in.
|
|
23
|
+
- **The React Native tier**: `RnView`, `RnText`, `RnScrollView` and the rest are plain React Native views with the
|
|
24
|
+
same `sx` props, for long lists and for content around the native islands.
|
|
25
|
+
- **Haptics**: the platform's own feedback, named for what happened.
|
|
26
26
|
|
|
27
27
|
## Documentation
|
|
28
28
|
|
|
29
|
-
- [Components](https://www.kara.janblazej.dev/docs/components)
|
|
29
|
+
- [Components](https://www.kara.janblazej.dev/docs/components): every one on iOS and Android, with its props
|
|
30
30
|
- [Screen and Island](https://www.kara.janblazej.dev/docs/hosts)
|
|
31
31
|
- [Haptics](https://www.kara.janblazej.dev/docs/haptics)
|
|
32
32
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { Host, LoadingIndicator } from '@expo/ui/jetpack-compose';
|
|
4
4
|
import { fillMaxSize, testID as testIdModifier } from '@expo/ui/jetpack-compose/modifiers';
|
|
5
|
+
import { useAccessibilityModifiers } from '@hzblj/kara-sx';
|
|
5
6
|
import { useAppTheme } from '@hzblj/kara-theme';
|
|
6
7
|
import { useMemo } from 'react';
|
|
7
8
|
import { StyleSheet } from 'react-native';
|
|
@@ -23,12 +24,16 @@ const styles = StyleSheet.create({
|
|
|
23
24
|
* anywhere and takes its place in the first frame.
|
|
24
25
|
*/
|
|
25
26
|
export const ActivityIndicator = ({
|
|
27
|
+
accessibilityLabel,
|
|
26
28
|
color = 'fill.accent.primary',
|
|
27
29
|
size = 'small',
|
|
28
30
|
testID
|
|
29
31
|
}) => {
|
|
30
32
|
const theme = useAppTheme();
|
|
31
|
-
const
|
|
33
|
+
const accessibilityModifiers = useAccessibilityModifiers({
|
|
34
|
+
accessibilityLabel
|
|
35
|
+
});
|
|
36
|
+
const modifiers = useMemo(() => [fillMaxSize(), ...(testID ? [testIdModifier(testID)] : []), ...accessibilityModifiers], [accessibilityModifiers, testID]);
|
|
32
37
|
return /*#__PURE__*/_jsx(Host, {
|
|
33
38
|
colorScheme: theme.dark ? 'dark' : 'light',
|
|
34
39
|
seedColor: theme.materialSeed,
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"names":["Host","LoadingIndicator","fillMaxSize","testID","testIdModifier","useAccessibilityModifiers","useAppTheme","useMemo","StyleSheet","jsx","_jsx","styles","create","large","height","width","small","ActivityIndicator","accessibilityLabel","color","size","theme","accessibilityModifiers","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,yBAAyB,QAAO,gBAAgB;AACxD,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,kBAAkB;EAClBC,KAAK,GAAG,qBAAqB;EAC7BC,IAAI,GAAG,OAAO;EACdjB;AACsB,CAAC,KAAK;EAC5B,MAAMkB,KAAK,GAAGf,WAAW,CAAC,CAAC;EAC3B,MAAMgB,sBAAsB,GAAGjB,yBAAyB,CAAC;IAACa;EAAkB,CAAC,CAAC;EAC9E,MAAMK,SAAS,GAAGhB,OAAO,CACvB,MAAM,CAACL,WAAW,CAAC,CAAC,EAAE,IAAIC,MAAM,GAAG,CAACC,cAAc,CAACD,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,GAAGmB,sBAAsB,CAAC,EAC7F,CAACA,sBAAsB,EAAEnB,MAAM,CACjC,CAAC;EAED,oBACEO,IAAA,CAACV,IAAI;IAACwB,WAAW,EAAEH,KAAK,CAACI,IAAI,GAAG,MAAM,GAAG,OAAQ;IAACC,SAAS,EAAEL,KAAK,CAACM,YAAa;IAACC,KAAK,EAAEjB,MAAM,CAACS,IAAI,CAAE;IAAAS,QAAA,eACnGnB,IAAA,CAACT,gBAAgB;MAACkB,KAAK,EAAEE,KAAK,CAACF,KAAK,CAACA,KAAK,CAAE;MAACI,SAAS,EAAEA;IAAU,CAAE;EAAC,CACjE,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -5,12 +5,14 @@ import { ActivityIndicator as RNActivityIndicator } from 'react-native';
|
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
/** React Native's spinner, which on iOS is UIKit's own `UIActivityIndicatorView`. */
|
|
7
7
|
export const ActivityIndicator = ({
|
|
8
|
+
accessibilityLabel,
|
|
8
9
|
color = 'fill.accent.primary',
|
|
9
10
|
size = 'small',
|
|
10
11
|
testID
|
|
11
12
|
}) => {
|
|
12
13
|
const theme = useAppTheme();
|
|
13
14
|
return /*#__PURE__*/_jsx(RNActivityIndicator, {
|
|
15
|
+
accessibilityLabel: accessibilityLabel,
|
|
14
16
|
color: theme.color(color),
|
|
15
17
|
size: size,
|
|
16
18
|
testID: testID
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"names":["useAppTheme","ActivityIndicator","RNActivityIndicator","jsx","_jsx","accessibilityLabel","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,kBAAkB;EAClBC,KAAK,GAAG,qBAAqB;EAC7BC,IAAI,GAAG,OAAO;EACdC;AACsB,CAAC,KAAK;EAC5B,MAAMC,KAAK,GAAGT,WAAW,CAAC,CAAC;EAE3B,oBACEI,IAAA,CAACF,mBAAmB;IAClBG,kBAAkB,EAAEA,kBAAmB;IACvCC,KAAK,EAAEG,KAAK,CAACH,KAAK,CAACA,KAAK,CAAE;IAC1BC,IAAI,EAAEA,IAAK;IACXC,MAAM,EAAEA;EAAO,CAChB,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -16,6 +16,7 @@ const VARIANT = {
|
|
|
16
16
|
sm: 'caption'
|
|
17
17
|
};
|
|
18
18
|
export const Avatar = ({
|
|
19
|
+
accessibilityLabel,
|
|
19
20
|
initials,
|
|
20
21
|
size = 'md',
|
|
21
22
|
source,
|
|
@@ -23,6 +24,10 @@ export const Avatar = ({
|
|
|
23
24
|
}) => {
|
|
24
25
|
const diameter = DIAMETER[size];
|
|
25
26
|
return /*#__PURE__*/_jsx(Box, {
|
|
27
|
+
"aria-hidden": accessibilityLabel === undefined,
|
|
28
|
+
accessibilityLabel: accessibilityLabel,
|
|
29
|
+
accessibilityRole: accessibilityLabel === undefined ? undefined : 'image',
|
|
30
|
+
accessible: accessibilityLabel !== undefined,
|
|
26
31
|
align: "center",
|
|
27
32
|
bg: "fill.tertiary",
|
|
28
33
|
borderRadius: "full",
|
|
@@ -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","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;
|
|
1
|
+
{"version":3,"names":["spacing","Box","Image","RnText","jsx","_jsx","DIAMETER","lg","s64","md","s40","sm","s24","VARIANT","Avatar","accessibilityLabel","initials","size","source","testID","diameter","undefined","accessibilityRole","accessible","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,kBAAkB;EAAEC,QAAQ;EAAEC,IAAI,GAAG,IAAI;EAAEC,MAAM;EAAEC;AAAmB,CAAC,KAAK;EACnH,MAAMC,QAAQ,GAAGd,QAAQ,CAACW,IAAI,CAAC;EAE/B,oBACEZ,IAAA,CAACJ,GAAG;IACF,eAAac,kBAAkB,KAAKM,SAAU;IAC9CN,kBAAkB,EAAEA,kBAAmB;IACvCO,iBAAiB,EAAEP,kBAAkB,KAAKM,SAAS,GAAGA,SAAS,GAAG,OAAQ;IAC1EE,UAAU,EAAER,kBAAkB,KAAKM,SAAU;IAC7CG,KAAK,EAAC,QAAQ;IACdC,EAAE,EAAC,eAAe;IAClBC,YAAY,EAAC,MAAM;IACnBC,CAAC,EAAEP,QAAS;IACZQ,OAAO,EAAC,QAAQ;IAChBC,QAAQ,EAAC,QAAQ;IACjBV,MAAM,EAAEA,MAAO;IACfW,CAAC,EAAEV,QAAS;IAAAW,QAAA,EAEXb,MAAM,gBACLb,IAAA,CAACH,KAAK;MAACyB,CAAC,EAAEP,QAAS;MAACF,MAAM,EAAEA,MAAO;MAACY,CAAC,EAAEV;IAAS,CAAE,CAAC,gBAEnDf,IAAA,CAACF,MAAM;MAAC6B,KAAK,EAAC,mBAAmB;MAACC,OAAO,EAAEpB,OAAO,CAACI,IAAI,CAAE;MAAAc,QAAA,EACtDf,QAAQ,IAAI;IAAE,CACT;EACT,CACE,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const TOKENS = {
|
|
4
4
|
accent: {
|
|
5
|
-
content: 'content.on.
|
|
5
|
+
content: 'content.on.accent',
|
|
6
6
|
fill: 'fill.accent.primary',
|
|
7
7
|
shadow: 'btn.accent'
|
|
8
8
|
},
|
|
@@ -78,5 +78,5 @@ const currentHex = (token, theme) => {
|
|
|
78
78
|
* The label for a button filled with an arbitrary `tint`: the on-accent white over a strong colour, the primary
|
|
79
79
|
* content colour over a pale one (`fill.accent.base`) — the light container tokens pair with it in both appearances.
|
|
80
80
|
*/
|
|
81
|
-
export const contentOnTint = (tint, theme) => (luminance(currentHex(tint, theme)) ?? 0) > 0.4 ? 'content.primary' : 'content.on.
|
|
81
|
+
export const contentOnTint = (tint, theme) => (luminance(currentHex(tint, theme)) ?? 0) > 0.4 ? 'content.primary' : 'content.on.accent';
|
|
82
82
|
//# sourceMappingURL=button-tokens.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TOKENS","accent","content","fill","shadow","destructive","glass","secondary","buttonTokens","variant","disabled","theme","tokens","disabledFill","luminance","color","hex","exec","undefined","r","g","b","map","i","channel","Number","parseInt","slice","currentHex","token","resolved","entry","split","reduce","node","key","dark","light","adaptive","contentOnTint","tint"],"sourceRoot":"../../../../src","sources":["atoms/button/button-tokens.ts"],"mappings":";;AAUA,MAAMA,MAAM,GAAG;EACbC,MAAM,EAAE;IAACC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"names":["TOKENS","accent","content","fill","shadow","destructive","glass","secondary","buttonTokens","variant","disabled","theme","tokens","disabledFill","luminance","color","hex","exec","undefined","r","g","b","map","i","channel","Number","parseInt","slice","currentHex","token","resolved","entry","split","reduce","node","key","dark","light","adaptive","contentOnTint","tint"],"sourceRoot":"../../../../src","sources":["atoms/button/button-tokens.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { Button as ComposeButton, Text as ComposeText, OutlinedButton } from '@expo/ui/jetpack-compose';
|
|
4
4
|
import { testID as testIdModifier } from '@expo/ui/jetpack-compose/modifiers';
|
|
5
|
-
import { useSxModifiers } from '@hzblj/kara-sx';
|
|
5
|
+
import { useAccessibilityModifiers, useSxModifiers } from '@hzblj/kara-sx';
|
|
6
6
|
import { useAppTheme } from '@hzblj/kara-theme';
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
import { useHostGuard } from "../../host-context.js";
|
|
@@ -18,6 +18,7 @@ import { buttonTokens, contentOnTint } from "./button-tokens.js";
|
|
|
18
18
|
*/
|
|
19
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
20
|
export const Button = ({
|
|
21
|
+
accessibilityHint,
|
|
21
22
|
disabled = false,
|
|
22
23
|
label,
|
|
23
24
|
onPress,
|
|
@@ -32,7 +33,10 @@ export const Button = ({
|
|
|
32
33
|
const sxModifiers = useSxModifiers({
|
|
33
34
|
wide
|
|
34
35
|
});
|
|
35
|
-
const
|
|
36
|
+
const accessibilityModifiers = useAccessibilityModifiers({
|
|
37
|
+
accessibilityHint
|
|
38
|
+
}, accessibilityHint !== undefined);
|
|
39
|
+
const modifiers = useMemo(() => [...sxModifiers, ...(testID ? [testIdModifier(testID)] : []), ...accessibilityModifiers], [accessibilityModifiers, sxModifiers, testID]);
|
|
36
40
|
const style = theme.typography.body;
|
|
37
41
|
const outlined = variant === 'glass' && !tint;
|
|
38
42
|
const fill = tint && !disabled ? tint : tokens.fill;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","ComposeButton","Text","ComposeText","OutlinedButton","testID","testIdModifier","useSxModifiers","useAppTheme","useMemo","useHostGuard","buttonTokens","contentOnTint","jsx","_jsx","disabled","label","onPress","tint","variant","wide","theme","tokens","sxModifiers","modifiers","style","typography","body","outlined","fill","content","MaterialButton","colors","contentColor","color","disabledContentColor","containerColor","disabledContainerColor","enabled","onClick","children","colorString","fontFamily","fontSize","fontWeight","lineHeight"],"sourceRoot":"../../../../src","sources":["atoms/button/button.android.tsx"],"mappings":";;AAAA,SAAQA,MAAM,IAAIC,aAAa,EAAEC,IAAI,IAAIC,WAAW,EAAEC,cAAc,QAAO,0BAA0B;AACrG,SAAQC,MAAM,IAAIC,cAAc,QAAO,oCAAoC;AAC3E,SAAQC,cAAc,QAAO,gBAAgB;
|
|
1
|
+
{"version":3,"names":["Button","ComposeButton","Text","ComposeText","OutlinedButton","testID","testIdModifier","useAccessibilityModifiers","useSxModifiers","useAppTheme","useMemo","useHostGuard","buttonTokens","contentOnTint","jsx","_jsx","accessibilityHint","disabled","label","onPress","tint","variant","wide","theme","tokens","sxModifiers","accessibilityModifiers","undefined","modifiers","style","typography","body","outlined","fill","content","MaterialButton","colors","contentColor","color","disabledContentColor","containerColor","disabledContainerColor","enabled","onClick","children","colorString","fontFamily","fontSize","fontWeight","lineHeight"],"sourceRoot":"../../../../src","sources":["atoms/button/button.android.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { Button as SwiftUIButton } from '@expo/ui/swift-ui';
|
|
4
4
|
import { buttonStyle as buttonStyleModifier, controlSize as controlSizeModifier, disabled as disabledModifier, glassEffect as glassEffectModifier, tint as tintModifier } from '@expo/ui/swift-ui/modifiers';
|
|
5
|
+
import { useAccessibilityModifiers } from '@hzblj/kara-sx';
|
|
5
6
|
import { useAppTheme } from '@hzblj/kara-theme';
|
|
6
7
|
import { useMemo } from 'react';
|
|
7
8
|
import { useHostGuard } from "../../host-context.js";
|
|
@@ -22,6 +23,7 @@ const TINT_BY_VARIANT = {
|
|
|
22
23
|
secondary: undefined
|
|
23
24
|
};
|
|
24
25
|
export const Button = ({
|
|
26
|
+
accessibilityHint,
|
|
25
27
|
buttonStyle,
|
|
26
28
|
controlSize = 'large',
|
|
27
29
|
disabled = false,
|
|
@@ -51,8 +53,11 @@ export const Button = ({
|
|
|
51
53
|
const filled = Boolean(glassTint) || style === 'borderedProminent' || style === 'glassProminent';
|
|
52
54
|
// A prominent style — and tinted glass — is coloured by the tint, so a caller's own tint picks the label on it.
|
|
53
55
|
const content = tint && filled && !disabled ? contentOnTint(tint, theme) : tokens.content;
|
|
56
|
+
const accessibilityModifiers = useAccessibilityModifiers({
|
|
57
|
+
accessibilityHint
|
|
58
|
+
});
|
|
54
59
|
const modifiers = useMemo(() => {
|
|
55
|
-
const list = [buttonStyleModifier(glassTint ? 'plain' : style), controlSizeModifier(controlSize)];
|
|
60
|
+
const list = [buttonStyleModifier(glassTint ? 'plain' : style), controlSizeModifier(controlSize), ...accessibilityModifiers];
|
|
56
61
|
if (glassTint) {
|
|
57
62
|
list.push(glassEffectModifier({
|
|
58
63
|
glass: {
|
|
@@ -69,7 +74,7 @@ export const Button = ({
|
|
|
69
74
|
list.push(disabledModifier(true));
|
|
70
75
|
}
|
|
71
76
|
return list;
|
|
72
|
-
}, [controlSize, disabled, glassTint, resolvedTint, style, theme]);
|
|
77
|
+
}, [accessibilityModifiers, controlSize, disabled, glassTint, resolvedTint, style, theme]);
|
|
73
78
|
return /*#__PURE__*/_jsx(SwiftUIButton, {
|
|
74
79
|
modifiers: modifiers,
|
|
75
80
|
onPress: onPress,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","SwiftUIButton","buttonStyle","buttonStyleModifier","controlSize","controlSizeModifier","disabled","disabledModifier","glassEffect","glassEffectModifier","tint","tintModifier","useAppTheme","useMemo","useHostGuard","Text","VStack","buttonTokens","contentOnTint","jsx","_jsx","STYLE_BY_VARIANT","accent","destructive","glass","secondary","TINT_BY_VARIANT","undefined","label","onPress","testID","variant","wide","theme","tokens","resolvedTint","style","glassTint","color","filled","Boolean","content","modifiers","list","push","interactive","shape","children","align","py"],"sourceRoot":"../../../../src","sources":["atoms/button/button.ios.tsx"],"mappings":";;AAAA,SAAQA,MAAM,IAAIC,aAAa,QAAO,mBAAmB;AACzD,SACEC,WAAW,IAAIC,mBAAmB,EAClCC,WAAW,IAAIC,mBAAmB,EAClCC,QAAQ,IAAIC,gBAAgB,EAC5BC,WAAW,IAAIC,mBAAmB,EAClCC,IAAI,IAAIC,YAAY,QACf,6BAA6B;AACpC,SAAyBC,WAAW,QAAO,mBAAmB;AAC9D,SAAQC,OAAO,QAAO,OAAO;AAC7B,SAAQC,YAAY,QAAO,uBAAoB;AAC/C,SAAQC,IAAI,QAAO,kBAAS;AAC5B,SAAQC,MAAM,QAAO,qBAAY;AAEjC,SAAQC,YAAY,EAAEC,aAAa,QAAO,oBAAiB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAE3D,MAAMC,gBAAgB,GAAG;EACvBC,MAAM,EAAE,mBAAmB;EAC3BC,WAAW,EAAE,mBAAmB;EAChCC,KAAK,EAAE,OAAO;EACdC,SAAS,EAAE;AACb,CAA2D;AAE3D,MAAMC,eAAe,GAAG;EACtBJ,MAAM,EAAE,qBAAqB;EAC7BC,WAAW,EAAE,0BAA0B;EACvCC,KAAK,EAAEG,SAAS;EAChBF,SAAS,EAAEE;AACb,CAAkE;AAElE,OAAO,
|
|
1
|
+
{"version":3,"names":["Button","SwiftUIButton","buttonStyle","buttonStyleModifier","controlSize","controlSizeModifier","disabled","disabledModifier","glassEffect","glassEffectModifier","tint","tintModifier","useAccessibilityModifiers","useAppTheme","useMemo","useHostGuard","Text","VStack","buttonTokens","contentOnTint","jsx","_jsx","STYLE_BY_VARIANT","accent","destructive","glass","secondary","TINT_BY_VARIANT","undefined","accessibilityHint","label","onPress","testID","variant","wide","theme","tokens","resolvedTint","style","glassTint","color","filled","Boolean","content","accessibilityModifiers","modifiers","list","push","interactive","shape","children","align","py"],"sourceRoot":"../../../../src","sources":["atoms/button/button.ios.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
import { Column } from '@expo/ui/jetpack-compose';
|
|
4
4
|
import { testID as testIdModifier } from '@expo/ui/jetpack-compose/modifiers';
|
|
5
|
-
import { useSxModifiers } from '@hzblj/kara-sx';
|
|
5
|
+
import { splitAccessibility, useAccessibilityModifiers, useSxModifiers } from '@hzblj/kara-sx';
|
|
6
6
|
import { useMemo } from 'react';
|
|
7
7
|
import { useHostGuard } from "../../host-context.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
export const Card = ({
|
|
10
10
|
children,
|
|
11
11
|
testID,
|
|
12
|
-
...
|
|
12
|
+
...props
|
|
13
13
|
}) => {
|
|
14
14
|
useHostGuard('Card');
|
|
15
|
+
const [accessibility, sx] = splitAccessibility(props);
|
|
15
16
|
const sxModifiers = useSxModifiers({
|
|
16
17
|
bg: 'surface.primary',
|
|
17
18
|
borderRadius: 'large',
|
|
@@ -19,7 +20,8 @@ export const Card = ({
|
|
|
19
20
|
shadow: 'card',
|
|
20
21
|
...sx
|
|
21
22
|
});
|
|
22
|
-
const
|
|
23
|
+
const accessibilityModifiers = useAccessibilityModifiers(accessibility);
|
|
24
|
+
const modifiers = useMemo(() => [...sxModifiers, ...(testID ? [testIdModifier(testID)] : []), ...accessibilityModifiers], [accessibilityModifiers, sxModifiers, testID]);
|
|
23
25
|
return /*#__PURE__*/_jsx(Column, {
|
|
24
26
|
modifiers: modifiers,
|
|
25
27
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Column","testID","testIdModifier","useSxModifiers","useMemo","useHostGuard","jsx","_jsx","Card","children","sx","sxModifiers","bg","borderRadius","p","shadow","modifiers"],"sourceRoot":"../../../../src","sources":["atoms/card/card.android.tsx"],"mappings":";;AAAA,SAAQA,MAAM,QAAO,0BAA0B;AAC/C,SAAQC,MAAM,IAAIC,cAAc,QAAO,oCAAoC;AAC3E,SAAQC,cAAc,QAAO,gBAAgB;
|
|
1
|
+
{"version":3,"names":["Column","testID","testIdModifier","splitAccessibility","useAccessibilityModifiers","useSxModifiers","useMemo","useHostGuard","jsx","_jsx","Card","children","props","accessibility","sx","sxModifiers","bg","borderRadius","p","shadow","accessibilityModifiers","modifiers"],"sourceRoot":"../../../../src","sources":["atoms/card/card.android.tsx"],"mappings":";;AAAA,SAAQA,MAAM,QAAO,0BAA0B;AAC/C,SAAQC,MAAM,IAAIC,cAAc,QAAO,oCAAoC;AAC3E,SAAQC,kBAAkB,EAAEC,yBAAyB,EAAEC,cAAc,QAAO,gBAAgB;AAC5F,SAAQC,OAAO,QAAO,OAAO;AAC7B,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG/C,OAAO,MAAMC,IAAmB,GAAGA,CAAC;EAACC,QAAQ;EAAEV,MAAM;EAAE,GAAGW;AAAgB,CAAC,KAAK;EAC9EL,YAAY,CAAC,MAAM,CAAC;EACpB,MAAM,CAACM,aAAa,EAAEC,EAAE,CAAC,GAAGX,kBAAkB,CAACS,KAAK,CAAC;EACrD,MAAMG,WAAW,GAAGV,cAAc,CAAC;IAACW,EAAE,EAAE,iBAAiB;IAAEC,YAAY,EAAE,OAAO;IAAEC,CAAC,EAAE,KAAK;IAAEC,MAAM,EAAE,MAAM;IAAE,GAAGL;EAAE,CAAC,CAAC;EACnH,MAAMM,sBAAsB,GAAGhB,yBAAyB,CAACS,aAAa,CAAC;EACvE,MAAMQ,SAAS,GAAGf,OAAO,CACvB,MAAM,CAAC,GAAGS,WAAW,EAAE,IAAId,MAAM,GAAG,CAACC,cAAc,CAACD,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,GAAGmB,sBAAsB,CAAC,EAC9F,CAACA,sBAAsB,EAAEL,WAAW,EAAEd,MAAM,CAC9C,CAAC;EAED,oBAAOQ,IAAA,CAACT,MAAM;IAACqB,SAAS,EAAEA,SAAU;IAAAV,QAAA,EAAEA;EAAQ,CAAS,CAAC;AAC1D,CAAC","ignoreList":[]}
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { VStack } from '@expo/ui/swift-ui';
|
|
4
|
-
import { useSxModifiers } from '@hzblj/kara-sx';
|
|
4
|
+
import { splitAccessibility, useAccessibilityModifiers, useSxModifiers } from '@hzblj/kara-sx';
|
|
5
|
+
import { useMemo } from 'react';
|
|
5
6
|
import { useHostGuard } from "../../host-context.js";
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
export const Card = ({
|
|
8
9
|
children,
|
|
9
10
|
testID,
|
|
10
|
-
...
|
|
11
|
+
...props
|
|
11
12
|
}) => {
|
|
12
13
|
useHostGuard('Card');
|
|
13
|
-
const
|
|
14
|
+
const [accessibility, sx] = splitAccessibility(props);
|
|
15
|
+
const sxModifiers = useSxModifiers({
|
|
14
16
|
bg: 'surface.primary',
|
|
15
17
|
borderRadius: 'large',
|
|
16
18
|
p: 's16',
|
|
17
19
|
shadow: 'card',
|
|
18
20
|
...sx
|
|
19
21
|
});
|
|
22
|
+
const accessibilityModifiers = useAccessibilityModifiers(accessibility);
|
|
23
|
+
const modifiers = useMemo(() => [...sxModifiers, ...accessibilityModifiers], [accessibilityModifiers, sxModifiers]);
|
|
20
24
|
return /*#__PURE__*/_jsx(VStack, {
|
|
21
25
|
alignment: "leading",
|
|
22
26
|
modifiers: modifiers,
|