@hzblj/kara-components 0.8.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 (154) hide show
  1. package/CHANGELOG.md +60 -26
  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/module/atoms/progress/progress.ios.js +10 -4
  10. package/lib/module/atoms/progress/progress.ios.js.map +1 -1
  11. package/lib/module/atoms/surface/surface.ios.js +3 -0
  12. package/lib/module/atoms/surface/surface.ios.js.map +1 -1
  13. package/lib/module/atoms/text-field/text-field.android.js +19 -4
  14. package/lib/module/atoms/text-field/text-field.android.js.map +1 -1
  15. package/lib/module/atoms/text-field/text-field.ios.js +7 -2
  16. package/lib/module/atoms/text-field/text-field.ios.js.map +1 -1
  17. package/lib/typescript/atoms/activity-indicator/activity-indicator.types.d.ts +1 -1
  18. package/lib/typescript/atoms/avatar/avatar.types.d.ts +2 -2
  19. package/lib/typescript/atoms/badge/badge.types.d.ts +1 -1
  20. package/lib/typescript/atoms/blur-view/blur-view.types.d.ts +6 -6
  21. package/lib/typescript/atoms/button/button.types.d.ts +7 -7
  22. package/lib/typescript/atoms/card/card.types.d.ts +1 -1
  23. package/lib/typescript/atoms/checkbox/checkbox.types.d.ts +2 -2
  24. package/lib/typescript/atoms/chip/chip.types.d.ts +1 -1
  25. package/lib/typescript/atoms/color-picker/color-picker.types.d.ts +4 -3
  26. package/lib/typescript/atoms/date-picker/date-picker.types.d.ts +4 -4
  27. package/lib/typescript/atoms/divider/divider.types.d.ts +2 -2
  28. package/lib/typescript/atoms/fab/fab.types.d.ts +2 -2
  29. package/lib/typescript/atoms/glass-view/glass-view.types.d.ts +5 -5
  30. package/lib/typescript/atoms/h-stack/h-stack.types.d.ts +3 -3
  31. package/lib/typescript/atoms/icon/icon.types.d.ts +4 -4
  32. package/lib/typescript/atoms/icon-button/icon-button.types.d.ts +7 -3
  33. package/lib/typescript/atoms/island/island.types.d.ts +4 -4
  34. package/lib/typescript/atoms/list/list.types.d.ts +5 -5
  35. package/lib/typescript/atoms/picker/picker.types.d.ts +1 -1
  36. package/lib/typescript/atoms/pressable/pressable.types.d.ts +21 -5
  37. package/lib/typescript/atoms/progress/progress.types.d.ts +2 -2
  38. package/lib/typescript/atoms/rn-flat-list/rn-flat-list.types.d.ts +2 -2
  39. package/lib/typescript/atoms/rn-icon/rn-icon.types.d.ts +1 -1
  40. package/lib/typescript/atoms/rn-scroll-view/rn-scroll-view.types.d.ts +2 -2
  41. package/lib/typescript/atoms/rn-section-list/rn-section-list.types.d.ts +2 -2
  42. package/lib/typescript/atoms/rn-text/rn-text.types.d.ts +2 -2
  43. package/lib/typescript/atoms/rn-view/rn-view.types.d.ts +3 -3
  44. package/lib/typescript/atoms/scroll-view/scroll-view.types.d.ts +3 -3
  45. package/lib/typescript/atoms/segmented-control/segmented-control.types.d.ts +3 -3
  46. package/lib/typescript/atoms/skeleton/skeleton.types.d.ts +2 -2
  47. package/lib/typescript/atoms/spacer/spacer.types.d.ts +1 -1
  48. package/lib/typescript/atoms/surface/surface.types.d.ts +2 -2
  49. package/lib/typescript/atoms/switch/switch.types.d.ts +1 -1
  50. package/lib/typescript/atoms/text/text.types.d.ts +1 -1
  51. package/lib/typescript/atoms/text-field/text-field.types.d.ts +8 -4
  52. package/lib/typescript/atoms/v-stack/v-stack.types.d.ts +1 -1
  53. package/lib/typescript/atoms/z-stack/z-stack.types.d.ts +1 -1
  54. package/lib/typescript/glyph/glyph-button.types.d.ts +1 -1
  55. package/lib/typescript/glyph/glyph.types.d.ts +1 -1
  56. package/lib/typescript/molecules/collapsible/collapsible.types.d.ts +1 -1
  57. package/lib/typescript/molecules/empty-state/empty-state.types.d.ts +1 -1
  58. package/lib/typescript/molecules/label/label.types.d.ts +1 -1
  59. package/lib/typescript/molecules/labeled-content/labeled-content.types.d.ts +2 -2
  60. package/lib/typescript/molecules/list-item/list-item.types.d.ts +2 -2
  61. package/lib/typescript/molecules/navigation-bar/navigation-bar.types.d.ts +8 -8
  62. package/lib/typescript/molecules/pager/pager.types.d.ts +2 -2
  63. package/lib/typescript/molecules/radio-group/radio-group.types.d.ts +2 -2
  64. package/lib/typescript/molecules/rn-list-item/rn-list-item.types.d.ts +1 -1
  65. package/lib/typescript/molecules/rn-tooltip/rn-tooltip.types.d.ts +7 -7
  66. package/lib/typescript/molecules/scroll-edge-container/scroll-edge-container.types.d.ts +3 -3
  67. package/lib/typescript/molecules/search-bar/search-bar.types.d.ts +2 -2
  68. package/lib/typescript/molecules/stepper/stepper.types.d.ts +2 -2
  69. package/lib/typescript/molecules/tooltip/tooltip.types.d.ts +6 -6
  70. package/lib/typescript/organisms/action-sheet/action-sheet.types.d.ts +3 -3
  71. package/lib/typescript/organisms/alert/alert.types.d.ts +3 -3
  72. package/lib/typescript/organisms/context-menu/context-menu.types.d.ts +9 -9
  73. package/lib/typescript/organisms/fab-menu/fab-menu.types.d.ts +5 -5
  74. package/lib/typescript/organisms/form/form.types.d.ts +1 -1
  75. package/lib/typescript/organisms/menu/menu.types.d.ts +2 -2
  76. package/lib/typescript/organisms/sheet/sheet.types.d.ts +12 -12
  77. package/lib/typescript/organisms/snackbar/snackbar.types.d.ts +1 -1
  78. package/lib/typescript/organisms/swipe-actions/swipe-actions.types.d.ts +5 -5
  79. package/lib/typescript/templates/screen/screen.types.d.ts +2 -2
  80. package/package.json +4 -4
  81. package/src/atoms/activity-indicator/activity-indicator.types.ts +1 -1
  82. package/src/atoms/avatar/avatar.types.ts +2 -2
  83. package/src/atoms/badge/badge.types.ts +1 -1
  84. package/src/atoms/blur-view/blur-view.types.ts +6 -6
  85. package/src/atoms/button/button.types.ts +7 -7
  86. package/src/atoms/card/card.types.ts +1 -1
  87. package/src/atoms/checkbox/checkbox.types.ts +2 -2
  88. package/src/atoms/chip/chip.types.ts +1 -1
  89. package/src/atoms/color-picker/color-picker.android.tsx +26 -6
  90. package/src/atoms/color-picker/color-picker.types.ts +4 -3
  91. package/src/atoms/date-picker/date-picker.types.ts +4 -4
  92. package/src/atoms/divider/divider.types.ts +2 -2
  93. package/src/atoms/fab/fab.types.ts +2 -2
  94. package/src/atoms/glass-view/glass-view.types.ts +5 -5
  95. package/src/atoms/h-stack/h-stack.types.ts +3 -3
  96. package/src/atoms/icon/icon.types.ts +4 -4
  97. package/src/atoms/icon-button/icon-button.ios.tsx +12 -2
  98. package/src/atoms/icon-button/icon-button.types.ts +7 -3
  99. package/src/atoms/island/island.types.ts +4 -4
  100. package/src/atoms/list/list.types.ts +5 -5
  101. package/src/atoms/picker/picker.types.ts +1 -1
  102. package/src/atoms/pressable/pressable.tsx +39 -18
  103. package/src/atoms/pressable/pressable.types.ts +22 -5
  104. package/src/atoms/progress/progress.ios.tsx +14 -5
  105. package/src/atoms/progress/progress.types.ts +2 -2
  106. package/src/atoms/rn-flat-list/rn-flat-list.types.ts +2 -2
  107. package/src/atoms/rn-icon/rn-icon.types.ts +1 -1
  108. package/src/atoms/rn-scroll-view/rn-scroll-view.types.ts +2 -2
  109. package/src/atoms/rn-section-list/rn-section-list.types.ts +2 -2
  110. package/src/atoms/rn-text/rn-text.types.ts +2 -2
  111. package/src/atoms/rn-view/rn-view.types.ts +3 -3
  112. package/src/atoms/scroll-view/scroll-view.types.ts +3 -3
  113. package/src/atoms/segmented-control/segmented-control.types.ts +3 -3
  114. package/src/atoms/skeleton/skeleton.types.ts +2 -2
  115. package/src/atoms/spacer/spacer.types.ts +1 -1
  116. package/src/atoms/surface/surface.ios.tsx +2 -1
  117. package/src/atoms/surface/surface.types.ts +2 -2
  118. package/src/atoms/switch/switch.types.ts +1 -1
  119. package/src/atoms/text/text.types.ts +1 -1
  120. package/src/atoms/text-field/text-field.android.tsx +19 -3
  121. package/src/atoms/text-field/text-field.ios.tsx +7 -1
  122. package/src/atoms/text-field/text-field.types.ts +8 -4
  123. package/src/atoms/v-stack/v-stack.types.ts +1 -1
  124. package/src/atoms/z-stack/z-stack.types.ts +1 -1
  125. package/src/glyph/glyph-button.types.ts +1 -1
  126. package/src/glyph/glyph.types.ts +1 -1
  127. package/src/molecules/collapsible/collapsible.types.ts +1 -1
  128. package/src/molecules/empty-state/empty-state.types.ts +1 -1
  129. package/src/molecules/label/label.types.ts +1 -1
  130. package/src/molecules/labeled-content/labeled-content.types.ts +2 -2
  131. package/src/molecules/list-item/list-item.types.ts +2 -2
  132. package/src/molecules/navigation-bar/navigation-bar.types.ts +8 -8
  133. package/src/molecules/pager/pager.types.ts +2 -2
  134. package/src/molecules/radio-group/radio-group.types.ts +2 -2
  135. package/src/molecules/rn-list-item/rn-list-item.types.ts +1 -1
  136. package/src/molecules/rn-tooltip/rn-tooltip.types.ts +7 -7
  137. package/src/molecules/scroll-edge-container/scroll-edge-container.types.ts +3 -3
  138. package/src/molecules/search-bar/search-bar.types.ts +2 -2
  139. package/src/molecules/stepper/stepper.types.ts +2 -2
  140. package/src/molecules/tooltip/tooltip.types.ts +6 -6
  141. package/src/organisms/action-sheet/action-sheet.types.ts +3 -3
  142. package/src/organisms/alert/alert.types.ts +3 -3
  143. package/src/organisms/context-menu/context-menu.types.ts +9 -9
  144. package/src/organisms/fab-menu/fab-menu.types.ts +5 -5
  145. package/src/organisms/form/form.types.ts +1 -1
  146. package/src/organisms/menu/menu.types.ts +2 -2
  147. package/src/organisms/sheet/sheet.types.ts +12 -12
  148. package/src/organisms/snackbar/snackbar.types.ts +1 -1
  149. package/src/organisms/swipe-actions/swipe-actions.types.ts +5 -5
  150. package/src/templates/screen/screen.types.ts +2 -2
  151. package/lib/module/platform-support.js +0 -19
  152. package/lib/module/platform-support.js.map +0 -1
  153. package/lib/typescript/platform-support.d.ts +0 -8
  154. package/src/platform-support.ts +0 -20
@@ -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 — kara's own `UISegmentedControl` on iOS,
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 — never for a tap on the one already selected.
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 — reach a segment by its label. */
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,8 +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` — a React Native view, so it needs no host. Sized with the
6
- * `sx` names: `w`, `h`, `borderRadius`.
5
+ * A loading placeholder that pulses in `fill.quaternary`. It is a React Native view, so it needs no host. Sized with
6
+ * the `sx` names: `w`, `h`, `borderRadius`.
7
7
  */
8
8
  export type SkeletonProps = {
9
9
  /** The corner radius. `small` by default. */
@@ -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 — SwiftUI `Spacer` / Compose `Spacer` with `weight(1)`. */
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,8 +1,8 @@
1
1
  import type { ResponsiveSx } from '@hzblj/kara-sx';
2
2
  import type { ReactNode } from 'react';
3
3
  /**
4
- * A container padded `s16` and rounded `large` unless told otherwise — a SwiftUI `VStack` on iOS, Material's
5
- * `Surface` around a `Column` on Android.
4
+ * A container on `surface.primary`, padded `s16` and rounded `large` unless told otherwise: a SwiftUI `VStack` on
5
+ * iOS, Material's `Surface` around a `Column` on Android.
6
6
  */
7
7
  export type SurfaceProps = ResponsiveSx & {
8
8
  /** Stacked vertically, from the leading edge. */
@@ -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 — label at the start, switch at the end — that
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;
@@ -5,7 +5,7 @@ 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 — a native atom; outside a host, use `RnText`. It takes
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
  */
@@ -1,15 +1,19 @@
1
1
  import type { ReactNode } from 'react';
2
2
  /**
3
- * An uncontrolled text field with an optional label above it — SwiftUI `TextField` (`SecureField` when `secure`) /
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 — the field is uncontrolled. */
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
- /** Marks the field invalid: a destructive outline and label. */
12
- error?: boolean;
11
+ /**
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
+ * colour is a pale red in dark mode. `true` marks it without a message.
15
+ */
16
+ error?: boolean | string;
13
17
  /** Shown above the field, in `labelMedium`. */
14
18
  label?: string;
15
19
  /** Wraps the text and grows the field to fit it. iOS ignores it when `secure`. */
@@ -2,7 +2,7 @@ import type { 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 — SwiftUI `VStack` / Compose `Column`. */
5
+ /** Stacks its children top to bottom: SwiftUI `VStack` / Compose `Column`. */
6
6
  export type VStackProps = ResponsiveSx & {
7
7
  /** The children's horizontal alignment. `start` by default. */
8
8
  align?: VStackAlign;
@@ -1,7 +1,7 @@
1
1
  import type { 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 — SwiftUI `ZStack` / Compose `Box`. */
4
+ /** Layers its children on one another: SwiftUI `ZStack` / Compose `Box`. */
5
5
  export type ZStackProps = ResponsiveSx & {
6
6
  /** Where the children sit vertically; they are always centred horizontally. `center` by default. */
7
7
  align?: ZStackAlign;
@@ -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 — for the controls its own components build (a stepper, a bar). */
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,7 +2,7 @@ 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 — a search field's magnifier, a row's chevron. Internal: apps 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 = {
@@ -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 — it renders inside `<Screen>` or `<Island>`.
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 — a `Button`, say. */
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 — the thing you put inside a button, a menu row or a section
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 = {
@@ -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. */