@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
|
@@ -3,7 +3,7 @@ import type { ReactNode } from 'react';
|
|
|
3
3
|
import type { ScrollViewProps as RNScrollViewProps } from 'react-native';
|
|
4
4
|
import type { ScrollViewAxis } from '../scroll-view';
|
|
5
5
|
/**
|
|
6
|
-
* React Native tier scroll container
|
|
6
|
+
* React Native tier scroll container, the sibling of `RnView`/`RnText`. Use it when the
|
|
7
7
|
* subtree is React Native and native atoms are embedded through `Island`. For a screen that
|
|
8
8
|
* is native all the way down, reach for the `ScrollView` atom instead.
|
|
9
9
|
*
|
|
@@ -15,7 +15,7 @@ export type RnScrollViewProps = ResponsiveViewSx & Omit<RNScrollViewProps, 'cont
|
|
|
15
15
|
axis?: ScrollViewAxis;
|
|
16
16
|
/** The scrolling content. */
|
|
17
17
|
children?: ReactNode;
|
|
18
|
-
/** Styles the scrolling content container
|
|
18
|
+
/** Styles the scrolling content container; padding and gap belong here. */
|
|
19
19
|
content?: ResponsiveViewSx;
|
|
20
20
|
/** Shows the scroll indicators. On by default. */
|
|
21
21
|
showsIndicators?: boolean;
|
|
@@ -2,10 +2,10 @@ import type { ResponsiveViewSx } from '@hzblj/kara-sx';
|
|
|
2
2
|
import type { DefaultSectionT, SectionListProps as RNSectionListProps } from 'react-native';
|
|
3
3
|
/**
|
|
4
4
|
* Top-level `sx` styles the viewport; `content` styles the scrolling content container, so padding and
|
|
5
|
-
* gap belong there
|
|
5
|
+
* gap belong there (the same split as `RnScrollView` and `RnFlatList`). `removeClippedSubviews` is off unless
|
|
6
6
|
* you turn it on, as in `RnFlatList`: Android's default would leave rows with hosts in them empty.
|
|
7
7
|
*/
|
|
8
8
|
export type RnSectionListProps<TItem, TSection = DefaultSectionT> = ResponsiveViewSx & Omit<RNSectionListProps<TItem, TSection>, 'contentContainerStyle' | 'style'> & {
|
|
9
|
-
/** Styles the scrolling content container
|
|
9
|
+
/** Styles the scrolling content container; padding and gap belong here. */
|
|
10
10
|
content?: ResponsiveViewSx;
|
|
11
11
|
};
|
|
@@ -3,8 +3,8 @@ import type { ColorToken, TextVariant } from '@hzblj/kara-theme';
|
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
4
|
import type { TextProps as RNTextProps } from 'react-native';
|
|
5
5
|
/**
|
|
6
|
-
* React Native's `Text` in a theme typography variant
|
|
7
|
-
* `Box`'s `sx` surface for its own box
|
|
6
|
+
* React Native's `Text` in a theme typography variant: the React Native tier, for text outside a native host. It takes
|
|
7
|
+
* `Box`'s `sx` surface for its own box (margins, flex, padding, a background), all but `align`, which here aligns the
|
|
8
8
|
* lines.
|
|
9
9
|
*/
|
|
10
10
|
export type RnTextProps = Omit<RNTextProps, 'style'> & Omit<ResponsiveViewSx, 'align'> & {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
-
/** Carries a React Native view into a SwiftUI or Compose tree
|
|
2
|
+
/** Carries a React Native view into a SwiftUI or Compose tree: `@expo/ui`'s `RNHostView` on both platforms. */
|
|
3
3
|
export type RnViewProps = {
|
|
4
4
|
/**
|
|
5
5
|
* A single React Native *view*. It may not contain React Native text: a bare string becomes a
|
|
6
6
|
* `RawText` node, which has no component view, so mounting it across the SwiftUI host boundary
|
|
7
7
|
* fails the `RCTComponentViewFactory` assertion and takes the whole app down. `@expo/ui` states
|
|
8
|
-
* the rule itself in `ListItem.ios.tsx`
|
|
8
|
+
* the rule itself in `ListItem.ios.tsx` ("SwiftUI hosts can't render bare strings") and wraps
|
|
9
9
|
* every raw string in a SwiftUI `Text` before it reaches a host. Do the same: use the `Text` atom
|
|
10
10
|
* inside the host, and keep `RnText` outside it.
|
|
11
11
|
*/
|
|
@@ -15,7 +15,7 @@ export type RnViewProps = {
|
|
|
15
15
|
* intrinsic size and would otherwise stretch to fill the SwiftUI parent.
|
|
16
16
|
*/
|
|
17
17
|
matchContents?: boolean;
|
|
18
|
-
/** Not forwarded on either platform
|
|
18
|
+
/** Not forwarded on either platform: give the child its own `testID`. */
|
|
19
19
|
testID?: string;
|
|
20
20
|
};
|
|
21
21
|
export type RnViewComponent = (props: RnViewProps) => ReactNode;
|
|
@@ -3,7 +3,7 @@ import type { SpaceSize } from '@hzblj/kara-theme';
|
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
4
|
export type ScrollViewAxis = 'horizontal' | 'vertical';
|
|
5
5
|
/**
|
|
6
|
-
* The `sx` props style the scrolling *content* container, not the viewport
|
|
6
|
+
* The `sx` props style the scrolling *content* container, not the viewport: `p` behaves
|
|
7
7
|
* like React Native's `contentContainerStyle` padding and scrolls with the content.
|
|
8
8
|
*/
|
|
9
9
|
export type ScrollViewProps = ResponsiveSx & {
|
|
@@ -13,13 +13,13 @@ export type ScrollViewProps = ResponsiveSx & {
|
|
|
13
13
|
children?: ReactNode;
|
|
14
14
|
/**
|
|
15
15
|
* Enables pull-to-refresh. Async on purpose: the spinner runs until the promise settles, which is
|
|
16
|
-
* what SwiftUI's `refreshable` expects and what Compose's controlled indicator is driven from
|
|
16
|
+
* what SwiftUI's `refreshable` expects and what Compose's controlled indicator is driven from, so
|
|
17
17
|
* neither platform needs a separate `refreshing` flag to be kept in sync by the caller.
|
|
18
18
|
*
|
|
19
19
|
* Only a vertical scroll view can be pulled; on a horizontal one both platforms ignore it.
|
|
20
20
|
*/
|
|
21
21
|
onRefresh?: () => Promise<void>;
|
|
22
|
-
/** iOS only
|
|
22
|
+
/** iOS only: Compose exposes no indicator toggle, so Android always shows the native one. */
|
|
23
23
|
showsIndicators?: boolean;
|
|
24
24
|
/** The space between children. */
|
|
25
25
|
spacing?: SpaceSize;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* A row of mutually exclusive segments, the selected one in the accent
|
|
3
|
+
* A row of mutually exclusive segments, the selected one in the accent: kara's own `UISegmentedControl` on iOS,
|
|
4
4
|
* Material's single-choice segmented buttons on Android. It needs no `Screen` or `Island`: iOS is a plain view, Android
|
|
5
5
|
* brings its own host. It takes the width it is given; the height is the platform's.
|
|
6
6
|
*/
|
|
@@ -8,13 +8,13 @@ export type SegmentedControlProps = {
|
|
|
8
8
|
/** Stops the user changing the segment, and dims the control. */
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
/**
|
|
11
|
-
* Called with the index and label of the segment the user picked
|
|
11
|
+
* Called with the index and label of the segment the user picked, never for a tap on the one already selected.
|
|
12
12
|
* Android plays `selection`; iOS's control plays its own feedback.
|
|
13
13
|
*/
|
|
14
14
|
onChange?: (index: number, value: string) => void;
|
|
15
15
|
/** The selected segment. Controlled: pass back what `onChange` reports. */
|
|
16
16
|
selectedIndex: number;
|
|
17
|
-
/** Test identifier, on the whole control
|
|
17
|
+
/** Test identifier, on the whole control. Reach a segment by its label. */
|
|
18
18
|
testID?: string;
|
|
19
19
|
/** The segments' labels, in order. */
|
|
20
20
|
values: string[];
|
|
@@ -2,7 +2,8 @@ import type { SxDimension } from '@hzblj/kara-sx';
|
|
|
2
2
|
import type { RadiiSize } from '@hzblj/kara-theme';
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
4
|
/**
|
|
5
|
-
* A loading placeholder that pulses in `fill.quaternary
|
|
5
|
+
* A loading placeholder that pulses in `fill.quaternary`, and holds still with motion reduced. Hidden from screen
|
|
6
|
+
* readers: what is loading is for the screen to say. It is a React Native view, so it needs no host. Sized with the
|
|
6
7
|
* `sx` names: `w`, `h`, `borderRadius`.
|
|
7
8
|
*/
|
|
8
9
|
export type SkeletonProps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SpaceSize } from '@hzblj/kara-theme';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
-
/** Takes up the free space in a stack
|
|
3
|
+
/** Takes up the free space in a stack: SwiftUI `Spacer` / Compose `Spacer` with `weight(1)`. */
|
|
4
4
|
export type SpacerProps = {
|
|
5
5
|
/** The least room it takes. iOS holds it along the stack's axis; Android as a minimum height only. */
|
|
6
6
|
min?: SpaceSize;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ResponsiveSx } from '@hzblj/kara-sx';
|
|
1
|
+
import type { AccessibilityProps, ResponsiveSx } from '@hzblj/kara-sx';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
/**
|
|
4
|
-
* A container on `surface.primary`, padded `s16` and rounded `large` unless told otherwise
|
|
4
|
+
* A container on `surface.primary`, padded `s16` and rounded `large` unless told otherwise: a SwiftUI `VStack` on
|
|
5
5
|
* iOS, Material's `Surface` around a `Column` on Android.
|
|
6
6
|
*/
|
|
7
|
-
export type SurfaceProps = ResponsiveSx & {
|
|
7
|
+
export type SurfaceProps = ResponsiveSx & AccessibilityProps & {
|
|
8
8
|
/** Stacked vertically, from the leading edge. */
|
|
9
9
|
children?: ReactNode;
|
|
10
10
|
/** iOS wraps the content in a `GlassEffectContainer`; Android raises it to a tonal elevation of `3`. */
|
|
@@ -4,7 +4,7 @@ export type SwitchProps = {
|
|
|
4
4
|
/** Stops the user flipping it, and dims it. */
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
/**
|
|
7
|
-
* Shown beside the switch. On Android it makes a full-width row
|
|
7
|
+
* Shown beside the switch. On Android it makes a full-width row (label at the start, switch at the end) that
|
|
8
8
|
* toggles wherever it is tapped.
|
|
9
9
|
*/
|
|
10
10
|
label?: string;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { ResponsiveSx } from '@hzblj/kara-sx';
|
|
1
|
+
import type { AccessibilityProps, ResponsiveSx } from '@hzblj/kara-sx';
|
|
2
2
|
import type { ColorToken, TextVariant } from '@hzblj/kara-theme';
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
4
|
export type TextAlign = 'center' | 'left' | 'right';
|
|
5
5
|
export type TextDecoration = 'none' | 'strikethrough' | 'underline';
|
|
6
6
|
export type TextTransform = 'lowercase' | 'uppercase';
|
|
7
7
|
/**
|
|
8
|
-
* SwiftUI `Text` / Compose `Text` in a theme typography variant
|
|
8
|
+
* SwiftUI `Text` / Compose `Text` in a theme typography variant. A native atom: outside a host, use `RnText`. It takes
|
|
9
9
|
* the native `sx` surface too: padding, a frame (`wide` lines it up by `align`), a background, and the `ios` bucket's
|
|
10
10
|
* `contentTransition`, `animation` and `monospacedDigit` for a number that changes in place.
|
|
11
11
|
*/
|
|
12
|
-
export type TextProps = ResponsiveSx & {
|
|
12
|
+
export type TextProps = ResponsiveSx & AccessibilityProps & {
|
|
13
13
|
/**
|
|
14
14
|
* How its lines align. iOS reads `left` and `right` as leading and trailing, so they flip in a right-to-left
|
|
15
15
|
* layout; Android keeps them as they are.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* An uncontrolled text field with an optional label above it
|
|
3
|
+
* An uncontrolled text field with an optional label above it: SwiftUI `TextField` (`SecureField` when `secure`) /
|
|
4
4
|
* Compose `OutlinedTextField`.
|
|
5
5
|
*/
|
|
6
6
|
export type TextFieldProps = {
|
|
7
|
-
/** The text it starts with. Read once, on mount
|
|
7
|
+
/** The text it starts with. Read once, on mount: the field is uncontrolled. */
|
|
8
8
|
defaultValue?: string;
|
|
9
9
|
/** Stops editing and dims the field. On iOS it outranks `error`. */
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
/**
|
|
12
|
-
* Marks the field invalid: a destructive outline and label. A message is shown under the field as well
|
|
13
|
-
* as Material's supporting text, beside its error icon
|
|
12
|
+
* Marks the field invalid: a destructive outline and label. A message is shown under the field as well (on Android
|
|
13
|
+
* as Material's supporting text, beside its error icon), so the error never rests on colour alone; Material's error
|
|
14
14
|
* colour is a pale red in dark mode. `true` marks it without a message.
|
|
15
15
|
*/
|
|
16
16
|
error?: boolean | string;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { ResponsiveSx } from '@hzblj/kara-sx';
|
|
1
|
+
import type { AccessibilityProps, ResponsiveSx } from '@hzblj/kara-sx';
|
|
2
2
|
import type { SpaceSize } from '@hzblj/kara-theme';
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
4
|
export type VStackAlign = 'center' | 'end' | 'start';
|
|
5
|
-
/** Stacks its children top to bottom
|
|
6
|
-
export type VStackProps = ResponsiveSx & {
|
|
5
|
+
/** Stacks its children top to bottom: SwiftUI `VStack` / Compose `Column`. */
|
|
6
|
+
export type VStackProps = ResponsiveSx & AccessibilityProps & {
|
|
7
7
|
/** The children's horizontal alignment. `start` by default. */
|
|
8
8
|
align?: VStackAlign;
|
|
9
9
|
/** Laid out top to bottom, `spacing` apart. */
|
|
10
10
|
children?: ReactNode;
|
|
11
11
|
/**
|
|
12
12
|
* Makes the whole stack pressable. iOS adds a tap gesture with no press feedback; Android a `clickable` whose ripple
|
|
13
|
-
* fills the stack's shape.
|
|
13
|
+
* fills the stack's shape. Screen readers then read the stack as one button.
|
|
14
14
|
*/
|
|
15
15
|
onPress?: () => void;
|
|
16
16
|
/** The space between children. */
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { ResponsiveSx } from '@hzblj/kara-sx';
|
|
1
|
+
import type { AccessibilityProps, ResponsiveSx } from '@hzblj/kara-sx';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
export type ZStackAlign = 'bottom' | 'center' | 'top';
|
|
4
|
-
/** Layers its children on one another
|
|
5
|
-
export type ZStackProps = ResponsiveSx & {
|
|
4
|
+
/** Layers its children on one another: SwiftUI `ZStack` / Compose `Box`. */
|
|
5
|
+
export type ZStackProps = ResponsiveSx & AccessibilityProps & {
|
|
6
6
|
/** Where the children sit vertically; they are always centred horizontally. `center` by default. */
|
|
7
7
|
align?: ZStackAlign;
|
|
8
8
|
/** Drawn in order, the last on top. */
|
|
9
9
|
children?: ReactNode;
|
|
10
10
|
/**
|
|
11
11
|
* Makes the whole stack pressable. iOS adds a tap gesture with no press feedback; Android a `clickable` whose ripple
|
|
12
|
-
* fills the stack's shape.
|
|
12
|
+
* fills the stack's shape. Screen readers then read the stack as one button.
|
|
13
13
|
*/
|
|
14
14
|
onPress?: () => void;
|
|
15
15
|
/** Test identifier, forwarded to the native view. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GlyphName } from '@hzblj/kara-native';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
-
/** An icon button over one of kara's glyphs
|
|
3
|
+
/** An icon button over one of kara's glyphs, for the controls its own components build (a stepper, a bar). */
|
|
4
4
|
export type GlyphButtonProps = {
|
|
5
5
|
accessibilityLabel?: string;
|
|
6
6
|
disabled?: boolean;
|
|
@@ -2,10 +2,12 @@ import type { GlyphName } from '@hzblj/kara-native';
|
|
|
2
2
|
import type { ColorToken, SpaceSize } from '@hzblj/kara-theme';
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
4
|
/**
|
|
5
|
-
* One of the few glyphs kara's own components draw
|
|
5
|
+
* One of the few glyphs kara's own components draw: a search field's magnifier, a row's chevron. Internal: apps draw
|
|
6
6
|
* their own icons with `Icon` / `RnIcon`.
|
|
7
7
|
*/
|
|
8
8
|
export type GlyphProps = {
|
|
9
|
+
/** What a screen reader says. Unset, the glyph is decorative and hidden from it. */
|
|
10
|
+
accessibilityLabel?: string;
|
|
9
11
|
color?: ColorToken;
|
|
10
12
|
name: GlyphName;
|
|
11
13
|
size?: SpaceSize;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* A row that shows and hides its content: SwiftUI's `DisclosureGroup` on iOS; on Android a pressable row with a
|
|
4
|
-
* chevron over an animated reveal. A native atom
|
|
4
|
+
* chevron over an animated reveal. A native atom: it renders inside `<Screen>` or `<Island>`.
|
|
5
5
|
*/
|
|
6
6
|
export type CollapsibleProps = {
|
|
7
7
|
/** Shown while `expanded`. */
|
|
@@ -5,7 +5,7 @@ import type { IconName } from '../../atoms/icon';
|
|
|
5
5
|
* `action` takes a `Button` so the state can offer a way out.
|
|
6
6
|
*/
|
|
7
7
|
export type EmptyStateProps = {
|
|
8
|
-
/** Under the text
|
|
8
|
+
/** Under the text: a `Button`, say. */
|
|
9
9
|
action?: ReactNode;
|
|
10
10
|
/** A second line under the title, in the secondary colour. */
|
|
11
11
|
description?: string;
|
|
@@ -2,7 +2,7 @@ import type { ColorToken, SpaceSize, TextVariant } from '@hzblj/kara-theme';
|
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import type { IconName } from '../../atoms/icon';
|
|
4
4
|
/**
|
|
5
|
-
* An inline icon + text pair
|
|
5
|
+
* An inline icon + text pair: the thing you put inside a button, a menu row or a section
|
|
6
6
|
* header. For a full tappable row with a subtitle and chevron, use `ListItem`.
|
|
7
7
|
*/
|
|
8
8
|
export type LabelProps = {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import type { AccessibilityProps } from '@hzblj/kara-sx';
|
|
1
2
|
import type { SpaceSize } from '@hzblj/kara-theme';
|
|
2
3
|
import type { ReactNode } from 'react';
|
|
3
4
|
import type { IconName } from '../../atoms/icon';
|
|
4
5
|
/**
|
|
5
|
-
* A label on the leading edge and its value on the trailing edge
|
|
6
|
-
* Pass `children` instead of `value` when the trailing side is a control rather than text.
|
|
6
|
+
* A label on the leading edge and its value on the trailing edge: the settings/detail row.
|
|
7
|
+
* Pass `children` instead of `value` when the trailing side is a control rather than text. With a `value`, screen
|
|
8
|
+
* readers read the row as one element ("Version, 2.4"); with a control, the control stays its own.
|
|
7
9
|
*/
|
|
8
|
-
export type LabeledContentProps = {
|
|
10
|
+
export type LabeledContentProps = AccessibilityProps & {
|
|
9
11
|
/** The trailing side when it is a control, in place of `value`. */
|
|
10
12
|
children?: ReactNode;
|
|
11
13
|
/** One of the app's icons, before the label, in the secondary colour. */
|
|
@@ -14,7 +16,7 @@ export type LabeledContentProps = {
|
|
|
14
16
|
label: string;
|
|
15
17
|
/** Makes the row pressable and adds a chevron on the trailing edge. */
|
|
16
18
|
onPress?: () => void;
|
|
17
|
-
/** Horizontal padding inside the row
|
|
19
|
+
/** Horizontal padding inside the row, and inside its press area too, so Android's ripple reaches the card's edges. */
|
|
18
20
|
px?: SpaceSize;
|
|
19
21
|
/** Test identifier, forwarded to the native view. */
|
|
20
22
|
testID?: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { AccessibilityProps } from '@hzblj/kara-sx';
|
|
1
2
|
import type { ColorToken, TextVariant } from '@hzblj/kara-theme';
|
|
2
3
|
import type { ReactNode } from 'react';
|
|
3
4
|
import type { IconName } from '../../atoms/icon';
|
|
4
5
|
/** Opens an external URL in the platform browser or the app that claims the scheme. */
|
|
5
|
-
export type LinkProps = {
|
|
6
|
+
export type LinkProps = AccessibilityProps & {
|
|
6
7
|
/** Colours the label and the icon. `content.accent` by default. */
|
|
7
8
|
color?: ColorToken;
|
|
8
9
|
/** One of the app's icons, before the label. */
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
+
import type { AccessibilityProps } from '@hzblj/kara-sx';
|
|
1
2
|
import type { SpaceSize } from '@hzblj/kara-theme';
|
|
2
3
|
import type { ReactNode } from 'react';
|
|
3
4
|
import type { IconName } from '../../atoms/icon';
|
|
4
5
|
/**
|
|
5
|
-
* A row with an optional icon, a title and subtitle, and a chevron when it can be pressed.
|
|
6
|
-
* inside `<Screen>` or `<Island>`; `RnListItem` is
|
|
6
|
+
* A row with an optional icon, a title and subtitle, and a chevron when it can be pressed. Screen readers read it as one
|
|
7
|
+
* element (a button when it is pressable). A native atom: it renders inside `<Screen>` or `<Island>`; `RnListItem` is
|
|
8
|
+
* the same row without a host.
|
|
7
9
|
*/
|
|
8
|
-
export type ListItemProps = {
|
|
10
|
+
export type ListItemProps = AccessibilityProps & {
|
|
9
11
|
/** One of the app's icons, before the title, in the secondary colour. */
|
|
10
12
|
icon?: IconName;
|
|
11
13
|
/** Makes the row pressable and adds a chevron on the trailing edge. */
|
|
12
14
|
onPress?: () => void;
|
|
13
15
|
/**
|
|
14
|
-
* Horizontal padding inside the row
|
|
16
|
+
* Horizontal padding inside the row, and inside its press area too, so Android's ripple reaches the card's edges. For
|
|
15
17
|
* rows in a card of your own; a `List` insets its rows by itself.
|
|
16
18
|
*/
|
|
17
19
|
px?: SpaceSize;
|
|
@@ -12,8 +12,8 @@ type NavigationBarItemBase = {
|
|
|
12
12
|
testID?: string;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
|
-
* One item of the bar. `back` and `close` are the platform's own
|
|
16
|
-
* Material arrow and cross on Android
|
|
15
|
+
* One item of the bar. `back` and `close` are the platform's own (a chevron and the system close item on iOS, the
|
|
16
|
+
* Material arrow and cross on Android), with `Back` / `Close` as their labels unless given others. `icon` is one of the
|
|
17
17
|
* app's icons and names itself for VoiceOver and TalkBack.
|
|
18
18
|
*/
|
|
19
19
|
export type NavigationBarItem = (NavigationBarItemBase & {
|
|
@@ -28,7 +28,7 @@ export type NavigationBarSearchRef = {
|
|
|
28
28
|
/** Empties the field and ends editing. */
|
|
29
29
|
clear: () => void;
|
|
30
30
|
};
|
|
31
|
-
/** A search field in place of the title
|
|
31
|
+
/** A search field in place of the title. iOS only for now; Android keeps the title. */
|
|
32
32
|
export type NavigationBarSearch = {
|
|
33
33
|
/** Every edit of the field's text. */
|
|
34
34
|
onChangeText: (text: string) => void;
|
|
@@ -43,10 +43,10 @@ export type NavigationBarSearch = {
|
|
|
43
43
|
};
|
|
44
44
|
export type NavigationBarTitleAlignment = 'center' | 'leading';
|
|
45
45
|
/**
|
|
46
|
-
* A title with items on either side, for a header that is not a navigation screen's
|
|
46
|
+
* A title with items on either side, for a header that is not a navigation screen's. `Sheet.Header` is built on it.
|
|
47
47
|
* On iOS a standalone `UINavigationBar`, so the items press and render exactly like a native-stack header's: on iOS 26
|
|
48
48
|
* neighbours share a glass capsule instead of swelling as standalone glass buttons do. On Android Material's top app
|
|
49
|
-
* bar. Where an item goes is the caller's choice
|
|
49
|
+
* bar. Where an item goes is the caller's choice: the bar places nothing by itself, so a close can sit on either side.
|
|
50
50
|
* The React Native tier: it needs no host.
|
|
51
51
|
*/
|
|
52
52
|
export type NavigationBarProps = {
|
|
@@ -56,13 +56,13 @@ export type NavigationBarProps = {
|
|
|
56
56
|
leadingItems?: NavigationBarItem[];
|
|
57
57
|
/** Replaces the title with a search field (iOS). */
|
|
58
58
|
search?: NavigationBarSearch;
|
|
59
|
-
/** Test identifier, forwarded to the native bar. iOS only
|
|
59
|
+
/** Test identifier, forwarded to the native bar. iOS only; Android ignores it. */
|
|
60
60
|
testID?: string;
|
|
61
61
|
/** The bar's title. */
|
|
62
62
|
title?: string;
|
|
63
|
-
/** `center`
|
|
63
|
+
/** `center` (iOS's own) by default; `leading` is Material's top app bar. */
|
|
64
64
|
titleAlignment?: NavigationBarTitleAlignment;
|
|
65
|
-
/** Fades the title out and in without moving the items
|
|
65
|
+
/** Fades the title out and in without moving the items, for a large title that scrolls under the bar. */
|
|
66
66
|
titleVisible?: boolean;
|
|
67
67
|
/** In screen order, toward the trailing edge. */
|
|
68
68
|
trailingItems?: NavigationBarItem[];
|
|
@@ -4,7 +4,7 @@ import type { ReactNode } from 'react';
|
|
|
4
4
|
* A swipeable, snapping pager: SwiftUI's `TabView` in its page style, Compose's `HorizontalPager`.
|
|
5
5
|
*
|
|
6
6
|
* Pages are addressed by their index rather than by a name, because Compose's pager is index-native
|
|
7
|
-
* and SwiftUI's tab values are strings
|
|
7
|
+
* and SwiftUI's tab values are strings; synthesising the string from the child's position is
|
|
8
8
|
* lossless, whereas inventing indices for named tabs on Compose would not be. Children are therefore
|
|
9
9
|
* plain nodes with no `Pager.Page` part to wrap them in: a page carries no props of its own, so the
|
|
10
10
|
* ceremony would buy nothing.
|
|
@@ -21,7 +21,7 @@ export type PagerProps = {
|
|
|
21
21
|
onPageChange?: (page: number) => void;
|
|
22
22
|
/** Zero-based. Controlled when passed; otherwise the pager just starts at 0 and owns its position. */
|
|
23
23
|
page?: number;
|
|
24
|
-
/** Android only
|
|
24
|
+
/** Android only: a SwiftUI page-style `TabView` has no gap between pages. */
|
|
25
25
|
pageSpacing?: SpaceSize;
|
|
26
26
|
/**
|
|
27
27
|
* Android only. SwiftUI can only disable a `TabView` as a whole, which would take the pages'
|
|
@@ -3,12 +3,12 @@ import type { ReactNode } from 'react';
|
|
|
3
3
|
export type RadioOption = {
|
|
4
4
|
/** The option's text. */
|
|
5
5
|
label: string;
|
|
6
|
-
/** Identifies the option to `value` and `onValueChange`, and keys its row
|
|
6
|
+
/** Identifies the option to `value` and `onValueChange`, and keys its row. Keep it unique. */
|
|
7
7
|
value: string;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
10
|
* A single choice from a list: rows with a checkmark on the selected one on iOS, Material radio buttons on Android. A
|
|
11
|
-
* native atom
|
|
11
|
+
* native atom: it renders inside `<Screen>` or `<Island>`.
|
|
12
12
|
*/
|
|
13
13
|
export type RadioGroupProps = {
|
|
14
14
|
/** The user pressed an option; it passes that option's `value`. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { ListItemProps } from '../list-item';
|
|
3
3
|
/**
|
|
4
|
-
* `ListItem`'s row in the React Native tier
|
|
4
|
+
* `ListItem`'s row in the React Native tier: plain views, no host. For lists long enough that a native host per row
|
|
5
5
|
* would cost too much to mount (a navigation list, an `RnFlatList` of rows), with the platform's own press feedback: a
|
|
6
6
|
* ripple across the whole row on Android, a highlight on iOS. In a rounded card, give the card `overflow="hidden"`:
|
|
7
7
|
* Android draws the ripple as the row's foreground, which only a parent's clip keeps inside rounded corners.
|
|
@@ -4,15 +4,15 @@ export type RnTooltipActionVariant = 'link' | 'primary' | 'secondary';
|
|
|
4
4
|
export type RnTooltipAction = {
|
|
5
5
|
/** The button's text. */
|
|
6
6
|
label: string;
|
|
7
|
-
/** Called on press. The tooltip stays up
|
|
7
|
+
/** Called on press. The tooltip stays up; turn `visible` off here if the action should close it. */
|
|
8
8
|
onPress: () => void;
|
|
9
|
-
/** `link` by default
|
|
9
|
+
/** `link` by default, an underlined text. `primary`/`secondary` are small filled/outlined buttons. */
|
|
10
10
|
variant?: RnTooltipActionVariant;
|
|
11
11
|
};
|
|
12
12
|
/** `outside`: a touch outside the bubble. `anchorHidden`: the anchor's centre left the visible area. */
|
|
13
13
|
export type RnTooltipDismissReason = 'anchorHidden' | 'outside';
|
|
14
14
|
/**
|
|
15
|
-
* A rich tooltip
|
|
15
|
+
* A rich tooltip (title, message, actions) anchored below a React Native view, and drawn above every sibling.
|
|
16
16
|
* Controlled: it never hides itself. `onDismiss` reports why it should, and the caller turns `visible` off. The React
|
|
17
17
|
* Native tier, unlike `Tooltip`, whose anchor is a native view inside a host.
|
|
18
18
|
*/
|
|
@@ -22,19 +22,19 @@ export type RnTooltipProps = {
|
|
|
22
22
|
/** Which end of the bubble the actions sit at. `end` by default. */
|
|
23
23
|
actionsAlignment?: 'end' | 'start';
|
|
24
24
|
/**
|
|
25
|
-
* Insets from the window's top and bottom that the anchor's centre must stay inside
|
|
26
|
-
* content. Past them the tooltip asks to be dismissed with `anchorHidden`.
|
|
25
|
+
* Insets from the window's top and bottom that the anchor's centre must stay inside (a header or a tab bar over the
|
|
26
|
+
* content). Past them the tooltip asks to be dismissed with `anchorHidden`.
|
|
27
27
|
*/
|
|
28
28
|
boundaryInsets?: {
|
|
29
29
|
bottom?: number;
|
|
30
30
|
top?: number;
|
|
31
31
|
};
|
|
32
|
-
/** The anchor
|
|
32
|
+
/** The anchor: a single React Native view. */
|
|
33
33
|
children: ReactElement;
|
|
34
34
|
/** The body text, under the title. */
|
|
35
35
|
message?: string;
|
|
36
36
|
/**
|
|
37
|
-
* Asks for the tooltip to close, with the reason
|
|
37
|
+
* Asks for the tooltip to close, with the reason; turn `visible` off. On Android any touch outside asks, the start
|
|
38
38
|
* of a scroll included; iOS keeps the tooltip through a scroll.
|
|
39
39
|
*/
|
|
40
40
|
onDismiss: (reason: RnTooltipDismissReason) => void;
|
|
@@ -3,13 +3,13 @@ import type { ResponsiveViewSx } from '@hzblj/kara-sx';
|
|
|
3
3
|
import type { ReactElement, ReactNode } from 'react';
|
|
4
4
|
export type { ScrollEdgeEffect, ScrollEdgeScrollableProps } from '@hzblj/kara-native/swift-ui';
|
|
5
5
|
/**
|
|
6
|
-
* Bars over one React Native scroll view, with each platform's scroll edge under them
|
|
6
|
+
* Bars over one React Native scroll view, with each platform's scroll edge under them: on iOS 26 the system's
|
|
7
7
|
* progressive blur where content scrolls past a bar; on Android a Material top app bar's behaviour, the bars stacked
|
|
8
8
|
* around the scroll view and filling with `surface.secondary` once content scrolls under them. The React Native tier:
|
|
9
9
|
* it needs no host.
|
|
10
10
|
*
|
|
11
11
|
* A screen-level container: wrap the screen's scroll view with it. Mounted inside a cell of a virtualized list on iOS
|
|
12
|
-
* it draws only its bottom bar
|
|
12
|
+
* it draws only its bottom bar; the hosted scroll view and the top bar stay blank.
|
|
13
13
|
*/
|
|
14
14
|
export type ScrollEdgeContainerProps = ResponsiveViewSx & {
|
|
15
15
|
/**
|
|
@@ -19,7 +19,7 @@ export type ScrollEdgeContainerProps = ResponsiveViewSx & {
|
|
|
19
19
|
automaticInsets?: boolean;
|
|
20
20
|
/** Laid over the scroll view's bottom edge on iOS; stacked below it on Android, filled while content continues below. */
|
|
21
21
|
bottomBar?: ReactNode;
|
|
22
|
-
/** Exactly one React Native scroll view
|
|
22
|
+
/** Exactly one React Native scroll view: `RnScrollView`, `RnFlatList`, `RnSectionList`. */
|
|
23
23
|
children: ReactElement<ScrollEdgeScrollableProps>;
|
|
24
24
|
/** iOS 26: how hard the edge cuts. `soft` by default. */
|
|
25
25
|
effect?: ScrollEdgeEffect;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* A search field drawn the same on both platforms
|
|
3
|
+
* A search field drawn the same on both platforms: a rounded box with a magnifier, a `TextInput` and a clear button
|
|
4
4
|
* while there is text. The React Native tier: it needs no host.
|
|
5
5
|
*/
|
|
6
6
|
export type SearchBarProps = {
|
|
@@ -10,7 +10,7 @@ export type SearchBarProps = {
|
|
|
10
10
|
placeholder?: string;
|
|
11
11
|
/** Test identifier, put on the field's container view rather than on the `TextInput`. */
|
|
12
12
|
testID?: string;
|
|
13
|
-
/** The field's text. Controlled
|
|
13
|
+
/** The field's text. Controlled: pass back what `onChangeText` reports. */
|
|
14
14
|
value: string;
|
|
15
15
|
};
|
|
16
16
|
export type SearchBarComponent = (props: SearchBarProps) => ReactNode;
|
|
@@ -2,6 +2,6 @@ import type { StepperComponent } from './stepper.types';
|
|
|
2
2
|
/**
|
|
3
3
|
* SwiftUI's `Stepper` at the end of a row, the label leading and the value just before the control — the way iOS's own
|
|
4
4
|
* settings show a stepped value. The value rolls to the next one (`numericText`), up or down with the change, in
|
|
5
|
-
* monospaced digits so the row does not jump.
|
|
5
|
+
* monospaced digits so the row does not jump. With motion reduced it cross-fades instead.
|
|
6
6
|
*/
|
|
7
7
|
export declare const Stepper: StepperComponent;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* A number with minus and plus buttons beside a label: SwiftUI's `Stepper` on iOS; on Android the label, the value and
|
|
4
|
-
* two icon buttons in a row. A native atom
|
|
4
|
+
* two icon buttons in a row. A native atom: it renders inside `<Screen>` or `<Island>`.
|
|
5
5
|
*/
|
|
6
6
|
export type StepperProps = {
|
|
7
|
-
/** The leading text. The value is shown too
|
|
7
|
+
/** The leading text. The value is shown too: before the control on iOS, between the buttons on Android. */
|
|
8
8
|
label: string;
|
|
9
9
|
/** The highest value. When unset, Android has no upper limit and iOS stops at `100`. */
|
|
10
10
|
max?: number;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* A short text tip on a native view, shown while `visible
|
|
4
|
-
* tooltip centred above them on Android. A native atom
|
|
3
|
+
* A short text tip on a native view, shown while `visible`: a SwiftUI popover from `children` on iOS, Material's plain
|
|
4
|
+
* tooltip centred above them on Android. A native atom: it renders inside `<Screen>` or `<Island>`; `RnTooltip`
|
|
5
5
|
* anchors to a React Native view.
|
|
6
6
|
*/
|
|
7
7
|
export type TooltipProps = {
|
|
8
|
-
/** The anchor
|
|
8
|
+
/** The anchor: a native view. */
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
/** The tip. */
|
|
11
11
|
text: string;
|
|
12
|
-
/** Shows the tip while true. Controlled: nothing opens it but this
|
|
12
|
+
/** Shows the tip while true. Controlled: nothing opens it but this. Wire a long press to it if you want one. */
|
|
13
13
|
visible: boolean;
|
|
14
14
|
/**
|
|
15
|
-
* The user dismissed the tip
|
|
16
|
-
* start of a scroll included, or the anchor scrolling out of the window.
|
|
15
|
+
* The user dismissed the tip, so turn `visible` off. iOS: a tap outside the popover. Android: any touch outside it,
|
|
16
|
+
* the start of a scroll included, or the anchor scrolling out of the window.
|
|
17
17
|
*/
|
|
18
18
|
onDismiss: () => void;
|
|
19
19
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type DurationSize, type EasingName } from '@hzblj/kara-theme';
|
|
2
|
+
import { type WithTimingConfig } from 'react-native-reanimated';
|
|
3
|
+
/**
|
|
4
|
+
* A Reanimated timing from the motion tokens, `smoothOut` unless told otherwise. `ReduceMotion.Never`, because a
|
|
5
|
+
* component has applied `useReducedMotion` before it animates: what is left (a fade, a dim) is meant to run, and
|
|
6
|
+
* Reanimated's own check reads the setting once at launch and never hears of `KaraProvider reduceMotion`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const timing: (size: DurationSize, curve?: EasingName) => WithTimingConfig;
|