@hzblj/kara-components 0.9.0 → 0.10.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.
Files changed (142) hide show
  1. package/CHANGELOG.md +45 -28
  2. package/README.md +8 -8
  3. package/lib/module/atoms/color-picker/color-picker.android.js +32 -5
  4. package/lib/module/atoms/color-picker/color-picker.android.js.map +1 -1
  5. package/lib/module/atoms/icon-button/icon-button.ios.js +17 -4
  6. package/lib/module/atoms/icon-button/icon-button.ios.js.map +1 -1
  7. package/lib/module/atoms/pressable/pressable.js +45 -22
  8. package/lib/module/atoms/pressable/pressable.js.map +1 -1
  9. package/lib/typescript/atoms/activity-indicator/activity-indicator.types.d.ts +1 -1
  10. package/lib/typescript/atoms/avatar/avatar.types.d.ts +2 -2
  11. package/lib/typescript/atoms/badge/badge.types.d.ts +1 -1
  12. package/lib/typescript/atoms/blur-view/blur-view.types.d.ts +6 -6
  13. package/lib/typescript/atoms/button/button.types.d.ts +7 -7
  14. package/lib/typescript/atoms/card/card.types.d.ts +1 -1
  15. package/lib/typescript/atoms/checkbox/checkbox.types.d.ts +2 -2
  16. package/lib/typescript/atoms/chip/chip.types.d.ts +1 -1
  17. package/lib/typescript/atoms/color-picker/color-picker.types.d.ts +4 -3
  18. package/lib/typescript/atoms/date-picker/date-picker.types.d.ts +4 -4
  19. package/lib/typescript/atoms/divider/divider.types.d.ts +2 -2
  20. package/lib/typescript/atoms/fab/fab.types.d.ts +2 -2
  21. package/lib/typescript/atoms/glass-view/glass-view.types.d.ts +5 -5
  22. package/lib/typescript/atoms/h-stack/h-stack.types.d.ts +3 -3
  23. package/lib/typescript/atoms/icon/icon.types.d.ts +4 -4
  24. package/lib/typescript/atoms/icon-button/icon-button.types.d.ts +7 -3
  25. package/lib/typescript/atoms/island/island.types.d.ts +4 -4
  26. package/lib/typescript/atoms/list/list.types.d.ts +5 -5
  27. package/lib/typescript/atoms/picker/picker.types.d.ts +1 -1
  28. package/lib/typescript/atoms/pressable/pressable.types.d.ts +21 -5
  29. package/lib/typescript/atoms/progress/progress.types.d.ts +1 -1
  30. package/lib/typescript/atoms/rn-flat-list/rn-flat-list.types.d.ts +2 -2
  31. package/lib/typescript/atoms/rn-icon/rn-icon.types.d.ts +1 -1
  32. package/lib/typescript/atoms/rn-scroll-view/rn-scroll-view.types.d.ts +2 -2
  33. package/lib/typescript/atoms/rn-section-list/rn-section-list.types.d.ts +2 -2
  34. package/lib/typescript/atoms/rn-text/rn-text.types.d.ts +2 -2
  35. package/lib/typescript/atoms/rn-view/rn-view.types.d.ts +3 -3
  36. package/lib/typescript/atoms/scroll-view/scroll-view.types.d.ts +3 -3
  37. package/lib/typescript/atoms/segmented-control/segmented-control.types.d.ts +3 -3
  38. package/lib/typescript/atoms/skeleton/skeleton.types.d.ts +2 -2
  39. package/lib/typescript/atoms/spacer/spacer.types.d.ts +1 -1
  40. package/lib/typescript/atoms/surface/surface.types.d.ts +1 -1
  41. package/lib/typescript/atoms/switch/switch.types.d.ts +1 -1
  42. package/lib/typescript/atoms/text/text.types.d.ts +1 -1
  43. package/lib/typescript/atoms/text-field/text-field.types.d.ts +4 -4
  44. package/lib/typescript/atoms/v-stack/v-stack.types.d.ts +1 -1
  45. package/lib/typescript/atoms/z-stack/z-stack.types.d.ts +1 -1
  46. package/lib/typescript/glyph/glyph-button.types.d.ts +1 -1
  47. package/lib/typescript/glyph/glyph.types.d.ts +1 -1
  48. package/lib/typescript/molecules/collapsible/collapsible.types.d.ts +1 -1
  49. package/lib/typescript/molecules/empty-state/empty-state.types.d.ts +1 -1
  50. package/lib/typescript/molecules/label/label.types.d.ts +1 -1
  51. package/lib/typescript/molecules/labeled-content/labeled-content.types.d.ts +2 -2
  52. package/lib/typescript/molecules/list-item/list-item.types.d.ts +2 -2
  53. package/lib/typescript/molecules/navigation-bar/navigation-bar.types.d.ts +8 -8
  54. package/lib/typescript/molecules/pager/pager.types.d.ts +2 -2
  55. package/lib/typescript/molecules/radio-group/radio-group.types.d.ts +2 -2
  56. package/lib/typescript/molecules/rn-list-item/rn-list-item.types.d.ts +1 -1
  57. package/lib/typescript/molecules/rn-tooltip/rn-tooltip.types.d.ts +7 -7
  58. package/lib/typescript/molecules/scroll-edge-container/scroll-edge-container.types.d.ts +3 -3
  59. package/lib/typescript/molecules/search-bar/search-bar.types.d.ts +2 -2
  60. package/lib/typescript/molecules/stepper/stepper.types.d.ts +2 -2
  61. package/lib/typescript/molecules/tooltip/tooltip.types.d.ts +6 -6
  62. package/lib/typescript/organisms/action-sheet/action-sheet.types.d.ts +3 -3
  63. package/lib/typescript/organisms/alert/alert.types.d.ts +3 -3
  64. package/lib/typescript/organisms/context-menu/context-menu.types.d.ts +9 -9
  65. package/lib/typescript/organisms/fab-menu/fab-menu.types.d.ts +5 -5
  66. package/lib/typescript/organisms/form/form.types.d.ts +1 -1
  67. package/lib/typescript/organisms/menu/menu.types.d.ts +2 -2
  68. package/lib/typescript/organisms/sheet/sheet.types.d.ts +12 -12
  69. package/lib/typescript/organisms/snackbar/snackbar.types.d.ts +1 -1
  70. package/lib/typescript/organisms/swipe-actions/swipe-actions.types.d.ts +5 -5
  71. package/lib/typescript/templates/screen/screen.types.d.ts +2 -2
  72. package/package.json +4 -4
  73. package/src/atoms/activity-indicator/activity-indicator.types.ts +1 -1
  74. package/src/atoms/avatar/avatar.types.ts +2 -2
  75. package/src/atoms/badge/badge.types.ts +1 -1
  76. package/src/atoms/blur-view/blur-view.types.ts +6 -6
  77. package/src/atoms/button/button.types.ts +7 -7
  78. package/src/atoms/card/card.types.ts +1 -1
  79. package/src/atoms/checkbox/checkbox.types.ts +2 -2
  80. package/src/atoms/chip/chip.types.ts +1 -1
  81. package/src/atoms/color-picker/color-picker.android.tsx +26 -6
  82. package/src/atoms/color-picker/color-picker.types.ts +4 -3
  83. package/src/atoms/date-picker/date-picker.types.ts +4 -4
  84. package/src/atoms/divider/divider.types.ts +2 -2
  85. package/src/atoms/fab/fab.types.ts +2 -2
  86. package/src/atoms/glass-view/glass-view.types.ts +5 -5
  87. package/src/atoms/h-stack/h-stack.types.ts +3 -3
  88. package/src/atoms/icon/icon.types.ts +4 -4
  89. package/src/atoms/icon-button/icon-button.ios.tsx +12 -2
  90. package/src/atoms/icon-button/icon-button.types.ts +7 -3
  91. package/src/atoms/island/island.types.ts +4 -4
  92. package/src/atoms/list/list.types.ts +5 -5
  93. package/src/atoms/picker/picker.types.ts +1 -1
  94. package/src/atoms/pressable/pressable.tsx +39 -18
  95. package/src/atoms/pressable/pressable.types.ts +22 -5
  96. package/src/atoms/progress/progress.types.ts +1 -1
  97. package/src/atoms/rn-flat-list/rn-flat-list.types.ts +2 -2
  98. package/src/atoms/rn-icon/rn-icon.types.ts +1 -1
  99. package/src/atoms/rn-scroll-view/rn-scroll-view.types.ts +2 -2
  100. package/src/atoms/rn-section-list/rn-section-list.types.ts +2 -2
  101. package/src/atoms/rn-text/rn-text.types.ts +2 -2
  102. package/src/atoms/rn-view/rn-view.types.ts +3 -3
  103. package/src/atoms/scroll-view/scroll-view.types.ts +3 -3
  104. package/src/atoms/segmented-control/segmented-control.types.ts +3 -3
  105. package/src/atoms/skeleton/skeleton.types.ts +2 -2
  106. package/src/atoms/spacer/spacer.types.ts +1 -1
  107. package/src/atoms/surface/surface.types.ts +1 -1
  108. package/src/atoms/switch/switch.types.ts +1 -1
  109. package/src/atoms/text/text.types.ts +1 -1
  110. package/src/atoms/text-field/text-field.types.ts +4 -4
  111. package/src/atoms/v-stack/v-stack.types.ts +1 -1
  112. package/src/atoms/z-stack/z-stack.types.ts +1 -1
  113. package/src/glyph/glyph-button.types.ts +1 -1
  114. package/src/glyph/glyph.types.ts +1 -1
  115. package/src/molecules/collapsible/collapsible.types.ts +1 -1
  116. package/src/molecules/empty-state/empty-state.types.ts +1 -1
  117. package/src/molecules/label/label.types.ts +1 -1
  118. package/src/molecules/labeled-content/labeled-content.types.ts +2 -2
  119. package/src/molecules/list-item/list-item.types.ts +2 -2
  120. package/src/molecules/navigation-bar/navigation-bar.types.ts +8 -8
  121. package/src/molecules/pager/pager.types.ts +2 -2
  122. package/src/molecules/radio-group/radio-group.types.ts +2 -2
  123. package/src/molecules/rn-list-item/rn-list-item.types.ts +1 -1
  124. package/src/molecules/rn-tooltip/rn-tooltip.types.ts +7 -7
  125. package/src/molecules/scroll-edge-container/scroll-edge-container.types.ts +3 -3
  126. package/src/molecules/search-bar/search-bar.types.ts +2 -2
  127. package/src/molecules/stepper/stepper.types.ts +2 -2
  128. package/src/molecules/tooltip/tooltip.types.ts +6 -6
  129. package/src/organisms/action-sheet/action-sheet.types.ts +3 -3
  130. package/src/organisms/alert/alert.types.ts +3 -3
  131. package/src/organisms/context-menu/context-menu.types.ts +9 -9
  132. package/src/organisms/fab-menu/fab-menu.types.ts +5 -5
  133. package/src/organisms/form/form.types.ts +1 -1
  134. package/src/organisms/menu/menu.types.ts +2 -2
  135. package/src/organisms/sheet/sheet.types.ts +12 -12
  136. package/src/organisms/snackbar/snackbar.types.ts +1 -1
  137. package/src/organisms/swipe-actions/swipe-actions.types.ts +5 -5
  138. package/src/templates/screen/screen.types.ts +2 -2
  139. package/lib/module/platform-support.js +0 -19
  140. package/lib/module/platform-support.js.map +0 -1
  141. package/lib/typescript/platform-support.d.ts +0 -8
  142. package/src/platform-support.ts +0 -20
@@ -2,7 +2,7 @@ import type { SpaceSize } from '@hzblj/kara-theme';
2
2
  import type { ReactNode } from 'react';
3
3
  import type { IconName } from '../../atoms/icon';
4
4
  /**
5
- * A label on the leading edge and its value on the trailing edge — the settings/detail row.
5
+ * A label on the leading edge and its value on the trailing edge: the settings/detail row.
6
6
  * Pass `children` instead of `value` when the trailing side is a control rather than text.
7
7
  */
8
8
  export type LabeledContentProps = {
@@ -14,7 +14,7 @@ export type LabeledContentProps = {
14
14
  label: string;
15
15
  /** Makes the row pressable and adds a chevron on the trailing edge. */
16
16
  onPress?: () => void;
17
- /** Horizontal padding inside the row — inside its press area too, so Android's ripple reaches the card's edges. */
17
+ /** Horizontal padding inside the row, and inside its press area too, so Android's ripple reaches the card's edges. */
18
18
  px?: SpaceSize;
19
19
  /** Test identifier, forwarded to the native view. */
20
20
  testID?: string;
@@ -2,7 +2,7 @@ import type { SpaceSize } from '@hzblj/kara-theme';
2
2
  import type { ReactNode } from 'react';
3
3
  import type { IconName } from '../../atoms/icon';
4
4
  /**
5
- * A row with an optional icon, a title and subtitle, and a chevron when it can be pressed. A native atom — it renders
5
+ * A row with an optional icon, a title and subtitle, and a chevron when it can be pressed. A native atom: it renders
6
6
  * inside `<Screen>` or `<Island>`; `RnListItem` is the same row without a host.
7
7
  */
8
8
  export type ListItemProps = {
@@ -11,7 +11,7 @@ export type ListItemProps = {
11
11
  /** Makes the row pressable and adds a chevron on the trailing edge. */
12
12
  onPress?: () => void;
13
13
  /**
14
- * Horizontal padding inside the row — inside its press area too, so Android's ripple reaches the card's edges. For
14
+ * Horizontal padding inside the row, and inside its press area too, so Android's ripple reaches the card's edges. For
15
15
  * rows in a card of your own; a `List` insets its rows by itself.
16
16
  */
17
17
  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 — 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
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 — iOS only for now; Android keeps 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 — `Sheet.Header` is built on it.
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 — the bar places nothing by itself, so a close can sit on either side.
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 — Android ignores it. */
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` by default — iOS's own; `leading` is Material's top app bar. */
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 — for a large title that scrolls under the bar. */
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 — synthesising the string from the child's position is
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 — a SwiftUI page-style `TabView` has no gap between pages. */
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 — keep it unique. */
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 — it renders inside `<Screen>` or `<Island>`.
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 — plain views, no host. For lists long enough that a native host per row
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 — turn `visible` off here if the action should close it. */
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 — an underlined text. `primary`/`secondary` are small filled/outlined buttons. */
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 — title, message, actions — anchored below a React Native view, and drawn above every sibling.
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 — a header or a tab bar over the
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 — a single React Native view. */
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 — turn `visible` off. On Android any touch outside asks, the start
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 — on iOS 26 the system's
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 — the hosted scroll view and the top bar stay blank.
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 — `RnScrollView`, `RnFlatList`, `RnSectionList`. */
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 — a rounded box with a magnifier, a `TextInput` and a clear button
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 — pass back what `onChangeText` reports. */
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;
@@ -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 — it renders inside `<Screen>` or `<Island>`.
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 — before the control on iOS, between the buttons on Android. */
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` — 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`
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 — a native view. */
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 — wire a long press to it if you want one. */
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 — turn `visible` off. iOS: a tap outside the popover. Android: any touch outside it, the
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
  };
@@ -1,13 +1,13 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { MenuAction } from '../menu';
3
3
  /**
4
- * A list of actions to pick one from: SwiftUI's confirmation dialog on iOS, a `Sheet` of Material rows — icon and label
5
- * — under the title on Android. A native atom — it renders inside `<Screen>` or `<Island>`.
4
+ * A list of actions to pick one from: SwiftUI's confirmation dialog on iOS, a `Sheet` of Material rows (icon and label)
5
+ * under the title on Android. A native atom: it renders inside `<Screen>` or `<Island>`.
6
6
  */
7
7
  export type ActionSheetProps = {
8
8
  /** The choices, top to bottom. Picking one closes the sheet. */
9
9
  actions: MenuAction[];
10
- /** The sheet closed — after a pick too — so turn `visible` off. */
10
+ /** The sheet closed (after a pick too), so turn `visible` off. */
11
11
  onDismiss: () => void;
12
12
  /** The heading above the actions. Android always shows it; on iOS the system decides, and may hide it. */
13
13
  title: string;
@@ -1,18 +1,18 @@
1
1
  import type { ReactNode } from 'react';
2
2
  /**
3
3
  * A modal alert with a confirm button and Cancel: SwiftUI's alert on iOS, Material's `AlertDialog` on Android. A native
4
- * atom — it renders inside `<Screen>` or `<Island>`.
4
+ * atom: it renders inside `<Screen>` or `<Island>`.
5
5
  */
6
6
  export type AlertProps = {
7
7
  /** The confirm button's label. `OK` by default. */
8
8
  confirmLabel?: string;
9
- /** Marks the confirm button destructive — the system's destructive role on iOS, the destructive colour on Android. */
9
+ /** Marks the confirm button destructive: the system's destructive role on iOS, the destructive colour on Android. */
10
10
  destructive?: boolean;
11
11
  /** The body text, under the title. */
12
12
  message?: string;
13
13
  /** The confirm button was pressed. `onDismiss` follows, as it does for every way the alert closes. */
14
14
  onConfirm?: () => void;
15
- /** The alert closed — either button, or on Android a tap outside or back — so turn `visible` off. */
15
+ /** The alert closed (either button, or on Android a tap outside or back), so turn `visible` off. */
16
16
  onDismiss: () => void;
17
17
  /** The alert's heading. */
18
18
  title: string;
@@ -2,7 +2,7 @@ import type { ResponsiveViewSx } from '@hzblj/kara-sx';
2
2
  import type { ReactNode } from 'react';
3
3
  import type { MenuAction } from '../menu';
4
4
  /**
5
- * A context menu on a React Native subtree — a card in a list, say — opened by a long press. iOS: a
5
+ * A context menu on a React Native subtree (a card in a list, say), opened by a long press. iOS: a
6
6
  * `UIContextMenuInteraction`, with an optional React Native `preview` lifted while the menu is open and a callback for
7
7
  * a tap on it. Android, where Material has no lifted preview: a ripple and the long-press haptic, then a Material
8
8
  * dropdown where the finger is, with the trigger highlighted while it is open. The trigger is ordinary React Native layout, so it
@@ -13,33 +13,33 @@ export type ContextMenuProps = ResponsiveViewSx & {
13
13
  actions: MenuAction[];
14
14
  /** The trigger, laid out as usual. */
15
15
  children: ReactNode;
16
- /** iOS: the user tapped the lifted preview, committing to it — open the detail the card stands for. */
16
+ /** iOS: the user tapped the lifted preview, committing to it. Open the detail the card stands for. */
17
17
  onPreviewPress?: () => void;
18
18
  /**
19
- * iOS: lifted in place of the trigger while the menu is open — a larger version of the card, say. A snapshot of the
19
+ * iOS: lifted in place of the trigger while the menu is open (a larger version of the card, say). A snapshot of the
20
20
  * trigger when unset. Mounted only once a finger has rested on the trigger, so a list of cards does not pay for
21
21
  * every preview up front.
22
22
  */
23
23
  preview?: ReactNode;
24
24
  /**
25
25
  * iOS: how the preview leaves once tapped, before `onPreviewPress`. `zoom`: its photo grows straight into the pushed
26
- * screen, the way the App Store expands a preview — needs a `ZoomTransition.Source` (`@hzblj/kara-ui/router`) in the
27
- * trigger, a `preview` and iOS 18, and shrinks back like `dismiss` otherwise. `pop`: UIKit's default, the preview
26
+ * screen, the way the App Store expands a preview. It needs a `ZoomTransition.Source` (`@hzblj/kara-ui/router`) in
27
+ * the trigger, a `preview` and iOS 18, and shrinks back like `dismiss` otherwise. `pop`: UIKit's default, the preview
28
28
  * flies out. `dismiss`: it shrinks back onto the trigger first. Default: `zoom` when the trigger holds a
29
29
  * `ZoomTransition.Source`, `pop` otherwise.
30
30
  */
31
31
  previewTransition?: 'dismiss' | 'pop' | 'zoom';
32
- /** Test identifier — on the native view around the trigger on iOS, on the trigger's `Pressable` on Android. */
32
+ /** Test identifier: on the native view around the trigger on iOS, on the trigger's `Pressable` on Android. */
33
33
  testID?: string;
34
34
  };
35
- /** A region of a `ContextMenu`'s trigger that keeps its own long press — see `ContextMenu.Exclusion`. */
35
+ /** A region of a `ContextMenu`'s trigger that keeps its own long press (see `ContextMenu.Exclusion`). */
36
36
  export type ContextMenuExclusionProps = {
37
- /** The region — a button inside the card, say. */
37
+ /** The region: a button inside the card, say. */
38
38
  children: ReactNode;
39
39
  };
40
40
  export type ContextMenuComponent = ((props: ContextMenuProps) => ReactNode) & {
41
41
  /**
42
- * A region of the trigger that must not open the menu — a button inside the card. On iOS the interaction covers the
42
+ * A region of the trigger that must not open the menu: a button inside the card. On iOS the interaction covers the
43
43
  * whole trigger, so a long press on that button would otherwise open the card's menu.
44
44
  */
45
45
  Exclusion: (props: ContextMenuExclusionProps) => ReactNode;
@@ -2,16 +2,16 @@ import type { ReactNode } from 'react';
2
2
  import type { IconName } from '../../atoms/icon';
3
3
  import type { MenuAction } from '../menu';
4
4
  /**
5
- * A floating action button that unfolds into its actions. Android: Material 3 Expressive's `FloatingActionButtonMenu`
6
- * — the button turns into a close and the actions rise above it as labelled pills. iOS: the same button as the label
7
- * of a SwiftUI `Menu`. A native atom — it renders inside `<Screen>` or `<Island>`.
5
+ * A floating action button that unfolds into its actions. Android: Material 3 Expressive's `FloatingActionButtonMenu`,
6
+ * where the button turns into a close and the actions rise above it as labelled pills. iOS: the same button as the
7
+ * label of a SwiftUI `Menu`. A native atom: it renders inside `<Screen>` or `<Island>`.
8
8
  */
9
9
  export type FabMenuProps = {
10
10
  /** The actions the button unfolds into. */
11
11
  actions: MenuAction[];
12
- /** The closed button's icon — one of the app's. A plus by default. */
12
+ /** The closed button's icon, one of the app's. A plus by default. */
13
13
  icon?: IconName;
14
- /** Test identifier, forwarded to the SwiftUI `Menu`. iOS only — Android ignores it. */
14
+ /** Test identifier, forwarded to the SwiftUI `Menu`. iOS only; Android ignores it. */
15
15
  testID?: string;
16
16
  };
17
17
  export type FabMenuComponent = (props: FabMenuProps) => ReactNode;
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  /**
3
- * A settings form — SwiftUI `Form` with its grouped sections, Material cards on Android. On iOS it scrolls like a
3
+ * A settings form: SwiftUI `Form` with its grouped sections, Material cards on Android. On iOS it scrolls like a
4
4
  * `List`, so it needs a height from outside: a `Screen`, or an `Island` with `matchContents={false}` and a height. In
5
5
  * an island that sizes itself to its content it has no height and shows nothing.
6
6
  */
@@ -3,7 +3,7 @@ import type { IconName } from '../../atoms/icon';
3
3
  /** One action of a `Menu`, an `ActionSheet`, a `ContextMenu` or a `FabMenu`. */
4
4
  export type MenuAction = {
5
5
  /**
6
- * Draws the action in the destructive colour — the system's destructive role on iOS. `FabMenu` ignores it on
6
+ * Draws the action in the destructive colour (the system's destructive role on iOS). `FabMenu` ignores it on
7
7
  * Android.
8
8
  */
9
9
  destructive?: boolean;
@@ -19,7 +19,7 @@ export type MenuAction = {
19
19
  };
20
20
  /**
21
21
  * A text button that opens a list of actions: a SwiftUI `Menu` on iOS, a Material dropdown anchored to it on Android.
22
- * A native atom — it renders inside `<Screen>` or `<Island>`.
22
+ * A native atom: it renders inside `<Screen>` or `<Island>`.
23
23
  */
24
24
  export type MenuProps = {
25
25
  /** The menu's actions, top to bottom. */
@@ -7,12 +7,12 @@ import type { NavigationBarItem, NavigationBarSearch } from '../../molecules/nav
7
7
  export type SheetDetent = 'auto' | number;
8
8
  /**
9
9
  * `center` is iOS's own, `leading` Material's. `large` puts the title above the content in a large face, and once
10
- * that scrolls under the bar the bar's own title fades in — centred on iOS, leading on Android.
10
+ * that scrolls under the bar the bar's own title fades in (centred on iOS, leading on Android).
11
11
  */
12
12
  export type SheetTitleStyle = 'center' | 'large' | 'leading';
13
13
  /**
14
14
  * The sheet's header: a `NavigationBar` with the title and items, and anything else that should stay put above the
15
- * content (`children` — a segmented control, a search hint). On iOS 26 a scrollable sheet's content scrolls under it
15
+ * content (`children`: a segmented control, a search hint). On iOS 26 a scrollable sheet's content scrolls under it
16
16
  * with the system's scroll edge effect; elsewhere it sits above the content.
17
17
  */
18
18
  export type SheetHeaderProps = {
@@ -24,24 +24,24 @@ export type SheetHeaderProps = {
24
24
  leadingItems?: NavigationBarItem[];
25
25
  /** A search field in place of the title (iOS). */
26
26
  search?: NavigationBarSearch;
27
- /** The title — in the bar, or above the content with a `large` `titleStyle`. */
27
+ /** The title: in the bar, or above the content with a `large` `titleStyle`. */
28
28
  title?: string;
29
29
  /** `center` by default. */
30
30
  titleStyle?: SheetTitleStyle;
31
- /** In screen order, toward the trailing edge — the close item, by convention. */
31
+ /** In screen order, toward the trailing edge: the close item, by convention. */
32
32
  trailingItems?: NavigationBarItem[];
33
33
  };
34
34
  /** Imperative control of a `Sheet`, through its `ref`. */
35
35
  export type SheetRef = {
36
36
  /** Dismisses it without calling `onDismiss`, which reports the user's dismissals only. */
37
37
  dismiss: () => Promise<void>;
38
- /** Presents at a detent — the first by default. */
38
+ /** Presents at a detent, the first by default. */
39
39
  present: (detentIndex?: number) => Promise<void>;
40
40
  /** Moves to another detent. */
41
41
  resize: (detentIndex: number) => Promise<void>;
42
42
  };
43
43
  /**
44
- * A native sheet — `UISheetPresentationController` on iOS, Material's bottom sheet on Android — with an optional
44
+ * A native sheet (`UISheetPresentationController` on iOS, Material's bottom sheet on Android) with an optional
45
45
  * native header (`<Sheet.Header>` as a direct child). The React Native tier: it needs no host, and must not sit inside
46
46
  * one; native atoms in its content go in an `Island`.
47
47
  */
@@ -50,7 +50,7 @@ export type SheetProps = {
50
50
  bg?: ColorToken;
51
51
  /** The content. A `<Sheet.Header>` among the direct children becomes the native header instead. */
52
52
  children: ReactNode;
53
- /** Where the sheet can rest, smallest first. `['auto']` — fit the content — by default. */
53
+ /** Where the sheet can rest, smallest first. `['auto']` (fit the content) by default. */
54
54
  detents?: SheetDetent[];
55
55
  /** Dims what is behind. On by default. */
56
56
  dimmed?: boolean;
@@ -62,9 +62,9 @@ export type SheetProps = {
62
62
  footer?: ReactElement;
63
63
  /** The drag handle. On by default. */
64
64
  grabber?: boolean;
65
- /** The user dismissed it — `visible` going false does not call this. */
65
+ /** The user dismissed it; `visible` going false does not call this. */
66
66
  onDismiss: () => void;
67
- /** The sheet moved to another detent — its index in `detents`. */
67
+ /** The sheet moved to another detent: its index in `detents`. */
68
68
  onDetentChange?: (detentIndex: number) => void;
69
69
  /** The sheet finished presenting. */
70
70
  onPresent?: () => void;
@@ -72,7 +72,7 @@ export type SheetProps = {
72
72
  ref?: Ref<SheetRef>;
73
73
  /**
74
74
  * The content is a scroll view (`<Sheet.ScrollView>`) the sheet drives: dragging past its top resizes the sheet,
75
- * and a header scrolls with the iOS 26 edge effect. Off by default — set it with a scrolling body.
75
+ * and a header scrolls with the iOS 26 edge effect. Off by default; set it with a scrolling body.
76
76
  */
77
77
  scrollable?: boolean;
78
78
  /** Test identifier, forwarded to the native sheet. */
@@ -85,7 +85,7 @@ export type SheetScrollHandler = (event: NativeSyntheticEvent<NativeScrollEvent>
85
85
  export type SheetScrollContextValue = {
86
86
  /** Render it first in the content. `null` unless the header's `titleStyle` is `large`. */
87
87
  largeTitle: ReactNode;
88
- /** Forward the scroll view's scroll events to it — it tracks the large title. Unset when there is none. */
88
+ /** Forward the scroll view's scroll events to it; it tracks the large title. Unset when there is none. */
89
89
  onScroll?: SheetScrollHandler;
90
90
  /** The room an overlaid header takes, to add to the content's top padding. `0` where the header sits above it. */
91
91
  topInset: number;
@@ -97,7 +97,7 @@ export type SheetScrollContextValue = {
97
97
  export type SheetScrollViewProps = Pick<ScrollViewProps, 'keyboardShouldPersistTaps'> & {
98
98
  /** The scrolling content, after the large title if there is one. */
99
99
  children: ReactNode;
100
- /** Styles the scrolling content — padding and gap belong here, as with `RnScrollView`. */
100
+ /** Styles the scrolling content: padding and gap belong here, as with `RnScrollView`. */
101
101
  content?: ResponsiveViewSx;
102
102
  /** Called on every scroll event, after the sheet's own listener. */
103
103
  onScroll?: SheetScrollHandler;
@@ -8,7 +8,7 @@ export type SnackbarProps = {
8
8
  actionLabel?: string;
9
9
  /** The message. */
10
10
  message: string;
11
- /** The action was pressed. The snackbar stays up — turn `visible` off to hide it. */
11
+ /** The action was pressed. The snackbar stays up; turn `visible` off to hide it. */
12
12
  onAction?: () => void;
13
13
  /** Shows the snackbar while true, fading it in and out. It sets no timer of its own. */
14
14
  visible: boolean;
@@ -5,25 +5,25 @@ import type { IconName } from '../../atoms/icon';
5
5
  export type SwipeAction = {
6
6
  /** Fills the button with `fill.destructive.primary` unless `tint` says otherwise. */
7
7
  destructive?: boolean;
8
- /** One of the app's icons, on the button — a round one on iOS 26, as in Mail, a filled stadium on Android. */
8
+ /** One of the app's icons, on the button: a round one on iOS 26, as in Mail, a filled stadium on Android. */
9
9
  icon: IconName;
10
10
  /**
11
- * The action's name, written under the button — before iOS 26 a row of the usual height shows the icon alone and
11
+ * The action's name, written under the button; before iOS 26 a row of the usual height shows the icon alone and
12
12
  * keeps the label for VoiceOver. Actions are keyed by it, so keep labels unique within one row.
13
13
  */
14
14
  label: string;
15
15
  /** Called when the button is pressed. The row closes by itself. */
16
16
  onPress: () => void;
17
17
  /**
18
- * The button's fill — `fill.destructive.primary` for a destructive action, `fill.accent.primary` otherwise. The icon
18
+ * The button's fill: `fill.destructive.primary` for a destructive action, `fill.accent.primary` otherwise. The icon
19
19
  * on it is white, so pick a fill that holds white in both appearances.
20
20
  */
21
21
  tint?: ColorToken;
22
22
  };
23
23
  /**
24
- * A list row with buttons behind it, uncovered by a swipe — SwiftUI's `swipeActions` on iOS, and on Android, where
24
+ * A list row with buttons behind it, uncovered by a swipe. SwiftUI's `swipeActions` on iOS, and on Android, where
25
25
  * Compose has none, kara's own: the row slides on an anchored drag and the buttons show in the strip it leaves. One
26
- * row is open at a time on both; a tap on an open row closes it. A native organism — it belongs inside a `List`.
26
+ * row is open at a time on both; a tap on an open row closes it. A native organism: it belongs inside a `List`.
27
27
  */
28
28
  export type SwipeActionsProps = {
29
29
  /**
@@ -1,7 +1,7 @@
1
1
  import type { Sx } from '@hzblj/kara-sx';
2
2
  import type { ReactNode } from 'react';
3
3
  /**
4
- * The full-bleed native host a screen starts with — a SwiftUI or Compose `Host` filling its parent, so native atoms
4
+ * The full-bleed native host a screen starts with: a SwiftUI or Compose `Host` filling its parent, so native atoms
5
5
  * render anywhere inside it. The background runs to the edges; the content keeps clear of the status bar where the
6
6
  * screen covers it (no navigation bar above), on Android as SwiftUI's safe area does on iOS.
7
7
  */
@@ -12,7 +12,7 @@ export type ScreenProps = {
12
12
  children?: ReactNode;
13
13
  /** Keeps the content where it is when the keyboard opens, instead of avoiding it. Android reads it once, on mount. */
14
14
  ignoreKeyboardInset?: boolean;
15
- /** Test identifier — on the host view on iOS, on the view around it on Android. */
15
+ /** Test identifier, on the host view on iOS and on the view around it on Android. */
16
16
  testID?: string;
17
17
  };
18
18
  export type ScreenComponent = (props: ScreenProps) => ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hzblj/kara-components",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "The atoms, molecules, organisms and templates of @hzblj/kara-ui — real SwiftUI and Jetpack Compose views through @expo/ui.",
5
5
  "author": "Jan Blazej",
6
6
  "license": "MIT",
@@ -59,9 +59,9 @@
59
59
  ]
60
60
  },
61
61
  "dependencies": {
62
- "@hzblj/kara-native": "^0.9.0",
63
- "@hzblj/kara-sx": "^0.9.0",
64
- "@hzblj/kara-theme": "^0.9.0",
62
+ "@hzblj/kara-native": "^0.10.0",
63
+ "@hzblj/kara-sx": "^0.10.0",
64
+ "@hzblj/kara-theme": "^0.10.0",
65
65
  "sf-symbols-typescript": "^2.2.0"
66
66
  },
67
67
  "peerDependencies": {
@@ -4,7 +4,7 @@ import type {ReactNode} from 'react'
4
4
  export type ActivityIndicatorSize = 'large' | 'small'
5
5
 
6
6
  /**
7
- * That something is loading, for as long as it takes — UIKit's spinner on iOS, Material 3's expressive
7
+ * That something is loading, for as long as it takes: UIKit's spinner on iOS, Material 3's expressive
8
8
  * `LoadingIndicator` on Android, its shapes morphing as it turns. A React Native view on iOS and a host of its own on
9
9
  * Android, so it renders anywhere. For how far along something is, use `Progress`.
10
10
  */
@@ -3,11 +3,11 @@ import type {ImageSourcePropType} from 'react-native'
3
3
 
4
4
  export type AvatarSize = 'lg' | 'md' | 'sm'
5
5
 
6
- /** A round avatar: the image in `source`, or `initials` without one. The React Native tier — it needs no host. */
6
+ /** A round avatar: the image in `source`, or `initials` without one. The React Native tier: it needs no host. */
7
7
  export type AvatarProps = {
8
8
  /** Shown in place of the image when there is no `source`. */
9
9
  initials?: string
10
- /** The diameter — `sm` is `s24`, `md` `s40`, `lg` `s64`. `md` by default. */
10
+ /** The diameter: `sm` is `s24`, `md` `s40`, `lg` `s64`. `md` by default. */
11
11
  size?: AvatarSize
12
12
  /** The image, cropped to the circle. */
13
13
  source?: ImageSourcePropType
@@ -2,7 +2,7 @@ import type {ReactNode} from 'react'
2
2
 
3
3
  export type BadgeTone = 'accent' | 'destructive' | 'neutral' | 'success'
4
4
 
5
- /** A small status label in a capsule — a SwiftUI `HStack` in the tone's fill on iOS, Material's `Badge` on Android. */
5
+ /** A small status label in a capsule: a SwiftUI `HStack` in the tone's fill on iOS, Material's `Badge` on Android. */
6
6
  export type BadgeProps = {
7
7
  /** The text inside. */
8
8
  label: string