@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.
- package/CHANGELOG.md +45 -28
- package/README.md +8 -8
- 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/icon-button/icon-button.ios.js +17 -4
- package/lib/module/atoms/icon-button/icon-button.ios.js.map +1 -1
- package/lib/module/atoms/pressable/pressable.js +45 -22
- package/lib/module/atoms/pressable/pressable.js.map +1 -1
- package/lib/typescript/atoms/activity-indicator/activity-indicator.types.d.ts +1 -1
- package/lib/typescript/atoms/avatar/avatar.types.d.ts +2 -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.types.d.ts +7 -7
- package/lib/typescript/atoms/card/card.types.d.ts +1 -1
- 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 +2 -2
- package/lib/typescript/atoms/glass-view/glass-view.types.d.ts +5 -5
- package/lib/typescript/atoms/h-stack/h-stack.types.d.ts +3 -3
- package/lib/typescript/atoms/icon/icon.types.d.ts +4 -4
- package/lib/typescript/atoms/icon-button/icon-button.types.d.ts +7 -3
- 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 +21 -5
- package/lib/typescript/atoms/progress/progress.types.d.ts +1 -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 -2
- package/lib/typescript/atoms/spacer/spacer.types.d.ts +1 -1
- package/lib/typescript/atoms/surface/surface.types.d.ts +1 -1
- package/lib/typescript/atoms/switch/switch.types.d.ts +1 -1
- package/lib/typescript/atoms/text/text.types.d.ts +1 -1
- package/lib/typescript/atoms/text-field/text-field.types.d.ts +4 -4
- package/lib/typescript/atoms/v-stack/v-stack.types.d.ts +1 -1
- package/lib/typescript/atoms/z-stack/z-stack.types.d.ts +1 -1
- package/lib/typescript/glyph/glyph-button.types.d.ts +1 -1
- package/lib/typescript/glyph/glyph.types.d.ts +1 -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 +2 -2
- package/lib/typescript/molecules/list-item/list-item.types.d.ts +2 -2
- 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.types.d.ts +2 -2
- package/lib/typescript/molecules/tooltip/tooltip.types.d.ts +6 -6
- 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 +5 -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 +1 -1
- 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/package.json +4 -4
- package/src/atoms/activity-indicator/activity-indicator.types.ts +1 -1
- package/src/atoms/avatar/avatar.types.ts +2 -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.types.ts +7 -7
- package/src/atoms/card/card.types.ts +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.types.ts +2 -2
- package/src/atoms/glass-view/glass-view.types.ts +5 -5
- package/src/atoms/h-stack/h-stack.types.ts +3 -3
- package/src/atoms/icon/icon.types.ts +4 -4
- package/src/atoms/icon-button/icon-button.ios.tsx +12 -2
- package/src/atoms/icon-button/icon-button.types.ts +7 -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 +39 -18
- package/src/atoms/pressable/pressable.types.ts +22 -5
- package/src/atoms/progress/progress.types.ts +1 -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.types.ts +3 -3
- package/src/atoms/skeleton/skeleton.types.ts +2 -2
- package/src/atoms/spacer/spacer.types.ts +1 -1
- package/src/atoms/surface/surface.types.ts +1 -1
- package/src/atoms/switch/switch.types.ts +1 -1
- package/src/atoms/text/text.types.ts +1 -1
- package/src/atoms/text-field/text-field.types.ts +4 -4
- package/src/atoms/v-stack/v-stack.types.ts +1 -1
- package/src/atoms/z-stack/z-stack.types.ts +1 -1
- package/src/glyph/glyph-button.types.ts +1 -1
- package/src/glyph/glyph.types.ts +1 -1
- 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.types.ts +2 -2
- package/src/molecules/list-item/list-item.types.ts +2 -2
- 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.types.ts +1 -1
- package/src/molecules/rn-tooltip/rn-tooltip.types.ts +7 -7
- 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.types.ts +2 -2
- package/src/molecules/tooltip/tooltip.types.ts +6 -6
- 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.types.ts +5 -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.types.ts +1 -1
- package/src/organisms/swipe-actions/swipe-actions.types.ts +5 -5
- package/src/templates/screen/screen.types.ts +2 -2
- 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ResponsiveSx } from '@hzblj/kara-sx';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
/**
|
|
4
|
-
* A raised container
|
|
4
|
+
* A raised container: SwiftUI `VStack` / Compose `Column` on `surface.primary`, with a large radius, `s16` padding and
|
|
5
5
|
* the `card` shadow. Any `sx` prop overrides its default.
|
|
6
6
|
*/
|
|
7
7
|
export type CardProps = ResponsiveSx & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
/** Material's `Checkbox` on Android. iOS has none, so there it is a SwiftUI `Toggle
|
|
2
|
+
/** Material's `Checkbox` on Android. iOS has none, so there it is a SwiftUI `Toggle`, the same switch as `Switch`. */
|
|
3
3
|
export type CheckboxProps = {
|
|
4
4
|
/** Dims the control and ignores taps. */
|
|
5
5
|
disabled?: boolean;
|
|
@@ -7,7 +7,7 @@ export type CheckboxProps = {
|
|
|
7
7
|
label?: string;
|
|
8
8
|
/** Called with the new value when the user toggles it. */
|
|
9
9
|
onValueChange?: (value: boolean) => void;
|
|
10
|
-
/** Whether it is checked. Controlled
|
|
10
|
+
/** Whether it is checked. Controlled: update it from `onValueChange`. */
|
|
11
11
|
value: boolean;
|
|
12
12
|
};
|
|
13
13
|
export type CheckboxComponent = (props: CheckboxProps) => ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
/** A filter pill on a `Pressable`, not a native control
|
|
2
|
+
/** A filter pill on a `Pressable`, not a native control. It belongs to the React Native tier, so it needs no host. */
|
|
3
3
|
export type ChipProps = {
|
|
4
4
|
/** The text in the pill. */
|
|
5
5
|
label: string;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* A row with a label and a colour well that opens a picker: SwiftUI's `ColorPicker` on iOS. Compose ships none, so on
|
|
4
|
+
* Android it is kara's own, in the same shape: a well with a rainbow ring, and a sheet with a grid of swatches, a
|
|
5
|
+
* spectrum and RGB sliders.
|
|
5
6
|
*/
|
|
6
7
|
export type ColorPickerProps = {
|
|
7
|
-
/** Text beside the colour well. */
|
|
8
|
+
/** Text beside the colour well, and the Android sheet's title. */
|
|
8
9
|
label?: string;
|
|
9
10
|
/** Called with the colour the user picks. */
|
|
10
11
|
onValueChange?: (color: string) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
export type DatePickerMode = 'date' | 'datetime' | 'time';
|
|
3
3
|
/**
|
|
4
|
-
* A date or time picker
|
|
4
|
+
* A date or time picker: SwiftUI's compact `DatePicker` on iOS, a field that opens Material's picker dialog on a tap
|
|
5
5
|
* on Android. The React Native tier: it brings its own host and sizes itself to the value, so it sits in a row beside
|
|
6
6
|
* its label like a `Text`.
|
|
7
7
|
*/
|
|
@@ -15,11 +15,11 @@ export type DatePickerProps = {
|
|
|
15
15
|
* `value`'s time of day.
|
|
16
16
|
*/
|
|
17
17
|
mode?: DatePickerMode;
|
|
18
|
-
/** Called with the new date
|
|
18
|
+
/** Called with the new date: on iOS as it changes, on Android when the dialog is confirmed. */
|
|
19
19
|
onValueChange?: (date: Date) => void;
|
|
20
|
-
/** Test identifier
|
|
20
|
+
/** Test identifier, on the native picker on iOS and on the tappable field on Android. */
|
|
21
21
|
testID?: string;
|
|
22
|
-
/** The selected date. Controlled
|
|
22
|
+
/** The selected date. Controlled: update it from `onValueChange`. */
|
|
23
23
|
value: Date;
|
|
24
24
|
};
|
|
25
25
|
export type DatePickerComponent = (props: DatePickerProps) => ReactNode;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ColorToken } from '@hzblj/kara-theme';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
-
/** A horizontal hairline
|
|
3
|
+
/** A horizontal hairline: SwiftUI `Divider` / Compose `HorizontalDivider`. */
|
|
4
4
|
export type DividerProps = {
|
|
5
5
|
/** The line's colour. `border.tertiary` by default. */
|
|
6
6
|
color?: ColorToken;
|
|
7
|
-
/** Test identifier, forwarded to the native view on iOS
|
|
7
|
+
/** Test identifier, forwarded to the native view on iOS. Android ignores it. */
|
|
8
8
|
testID?: string;
|
|
9
9
|
};
|
|
10
10
|
export type DividerComponent = (props: DividerProps) => ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { IconName } from '../icon';
|
|
3
3
|
/**
|
|
4
|
-
* A floating action button
|
|
4
|
+
* A floating action button: Material's `FloatingActionButton` on Android, a 56pt accent circle (a plain SwiftUI
|
|
5
5
|
* `Button`) on iOS. It renders inline; pinning it to a corner is up to the screen.
|
|
6
6
|
*/
|
|
7
7
|
export type FabProps = {
|
|
@@ -9,7 +9,7 @@ export type FabProps = {
|
|
|
9
9
|
name: IconName;
|
|
10
10
|
/** Called when the button is pressed. */
|
|
11
11
|
onPress?: () => void;
|
|
12
|
-
/** Test identifier, forwarded to the native view on iOS
|
|
12
|
+
/** Test identifier, forwarded to the native view on iOS. Android ignores it. */
|
|
13
13
|
testID?: string;
|
|
14
14
|
};
|
|
15
15
|
export type FabComponent = (props: FabProps) => ReactNode;
|
|
@@ -2,13 +2,13 @@ import type { ResponsiveViewSx } from '@hzblj/kara-sx';
|
|
|
2
2
|
import type { ColorToken } from '@hzblj/kara-theme';
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
4
|
/**
|
|
5
|
-
* Glass around a React Native subtree, shaped as a capsule
|
|
6
|
-
* Liquid Glass. Android: frosted glass
|
|
7
|
-
* (or `tint`) and a hairline. iOS before 26 has no Liquid Glass and draws a capsule of `tint` instead, or
|
|
8
|
-
* buttons' translucent fill (`btn.bg.glass.base`) when there is none.
|
|
5
|
+
* Glass around a React Native subtree, shaped as a capsule. It belongs to the React Native tier, so it needs no host.
|
|
6
|
+
* iOS 26: Liquid Glass. Android: frosted glass, made of what lies behind, blurred on Android 12+, under a translucent
|
|
7
|
+
* tonal surface (or `tint`) and a hairline. iOS before 26 has no Liquid Glass and draws a capsule of `tint` instead, or
|
|
8
|
+
* of the glass buttons' translucent fill (`btn.bg.glass.base`) when there is none.
|
|
9
9
|
*
|
|
10
10
|
* On Android each glass re-records what lies behind it before every frame: a few buttons cost nothing, but keep it out
|
|
11
|
-
* of the cells of a long list
|
|
11
|
+
* of the cells of a long list. A plain `tint` reads as well there.
|
|
12
12
|
*/
|
|
13
13
|
export type GlassViewProps = ResponsiveViewSx & {
|
|
14
14
|
/** React Native views. Give them `pointerEvents="none"` when `interactive`, so the press reaches the `Pressable`. */
|
|
@@ -2,13 +2,13 @@ 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 HStackAlign = 'center' | 'end' | 'start';
|
|
5
|
-
/** A horizontal stack
|
|
5
|
+
/** A horizontal stack: SwiftUI `HStack` / Compose `Row`. */
|
|
6
6
|
export type HStackProps = ResponsiveSx & {
|
|
7
|
-
/** How the children line up vertically
|
|
7
|
+
/** How the children line up vertically: `start` is the top, `end` the bottom. `start` by default. */
|
|
8
8
|
align?: HStackAlign;
|
|
9
9
|
/** Native views, laid out from the leading edge. */
|
|
10
10
|
children?: ReactNode;
|
|
11
|
-
/** Makes the stack pressable
|
|
11
|
+
/** Makes the stack pressable: a tap gesture on iOS, a `clickable` with Material's ripple on Android. */
|
|
12
12
|
onPress?: () => void;
|
|
13
13
|
/** The gap between children. Unset, SwiftUI puts its default spacing between them and Compose none. */
|
|
14
14
|
spacing?: SpaceSize;
|
|
@@ -11,12 +11,12 @@ declare global {
|
|
|
11
11
|
}
|
|
12
12
|
type DeclaredIconName = keyof KaraIcons & string;
|
|
13
13
|
/**
|
|
14
|
-
* One of the app's icons. Once the plugin has written `kara-icons.d.ts` only those names type-check
|
|
14
|
+
* One of the app's icons. Once the plugin has written `kara-icons.d.ts` only those names type-check: an icon removed
|
|
15
15
|
* from the folder fails at every call site. Before that, any string, so a project can adopt icons gradually.
|
|
16
16
|
*/
|
|
17
17
|
export type IconName = [DeclaredIconName] extends [never] ? string : DeclaredIconName;
|
|
18
18
|
/**
|
|
19
|
-
* One of the app's icons, in a host
|
|
19
|
+
* One of the app's icons, in a host: SwiftUI `Image` from the asset catalog on iOS, Material's `Icon` with the vector
|
|
20
20
|
* drawable on Android. `RnIcon` draws the same asset outside one.
|
|
21
21
|
*/
|
|
22
22
|
export type IconProps = {
|
|
@@ -24,11 +24,11 @@ export type IconProps = {
|
|
|
24
24
|
accessibilityLabel?: string;
|
|
25
25
|
/** The icon's tint. `content.primary` by default. */
|
|
26
26
|
color?: ColorToken;
|
|
27
|
-
/** Which of the app's icons
|
|
27
|
+
/** Which of the app's icons, a key of `KaraIcons`. */
|
|
28
28
|
name: IconName;
|
|
29
29
|
/** Its width and height, a spacing token. `s24` by default. */
|
|
30
30
|
size?: SpaceSize;
|
|
31
|
-
/** Test identifier, forwarded to the native view on iOS
|
|
31
|
+
/** Test identifier, forwarded to the native view on iOS. Android ignores it. */
|
|
32
32
|
testID?: string;
|
|
33
33
|
};
|
|
34
34
|
export type IconComponent = (props: IconProps) => ReactNode;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { IconName } from '../icon';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* A button that is just an icon: a plain SwiftUI `Button` on iOS, Material's `IconButton` on Android. The icon sits
|
|
5
|
+
* centred in a tap target the size each platform asks for, 44pt on iOS and 48dp on Android, so a row of them spaces
|
|
6
|
+
* itself the same way on both.
|
|
7
|
+
*/
|
|
4
8
|
export type IconButtonProps = {
|
|
5
|
-
/**
|
|
9
|
+
/** Dims the icon (iOS's own disabled look, `btn.content.disabled` on Android) and stops the button responding. */
|
|
6
10
|
disabled?: boolean;
|
|
7
11
|
/** The icon, one of the app's. */
|
|
8
12
|
name: IconName;
|
|
9
13
|
/** Called when the button is pressed. */
|
|
10
14
|
onPress?: () => void;
|
|
11
|
-
/** Test identifier, forwarded to the native view on iOS
|
|
15
|
+
/** Test identifier, forwarded to the native view on iOS. Android ignores it. */
|
|
12
16
|
testID?: string;
|
|
13
17
|
};
|
|
14
18
|
export type IconButtonComponent = (props: IconButtonProps) => ReactNode;
|
|
@@ -2,7 +2,7 @@ import type { ResponsiveViewSx } from '@hzblj/kara-sx';
|
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
4
4
|
/**
|
|
5
|
-
* A host for native atoms in a React Native layout
|
|
5
|
+
* A host for native atoms in a React Native layout: the SwiftUI / Compose `Host` an `@expo/ui` tree mounts into. It
|
|
6
6
|
* sits in that layout like a `Box`, and takes `Box`'s `sx` props for it: `h`, `flex`, margins.
|
|
7
7
|
*/
|
|
8
8
|
export type IslandProps = ResponsiveViewSx & {
|
|
@@ -14,15 +14,15 @@ export type IslandProps = ResponsiveViewSx & {
|
|
|
14
14
|
* width maps to `fixedSize(horizontal: true)`, so the native side ignores the proposed width and
|
|
15
15
|
* resolves a `wide` stack's ideal width as unbounded.
|
|
16
16
|
*
|
|
17
|
-
* Turn it off
|
|
17
|
+
* Turn it off (and give the island an explicit height, `h`) when the subtree contains an
|
|
18
18
|
* `RnView`: that host drives its SwiftUI frame from the child's Yoga-laid-out bounds while this one
|
|
19
19
|
* writes its measured size back into the Yoga style, and the two together spin a layout loop that
|
|
20
20
|
* hangs the main thread as soon as the views lay out on screen.
|
|
21
21
|
*/
|
|
22
22
|
matchContents?: boolean;
|
|
23
|
-
/** A React Native style for the host view, merged over the `sx` props
|
|
23
|
+
/** A React Native style for the host view, merged over the `sx` props, for what they cannot say. */
|
|
24
24
|
style?: StyleProp<ViewStyle>;
|
|
25
|
-
/** Test identifier, forwarded to the host view on iOS
|
|
25
|
+
/** Test identifier, forwarded to the host view on iOS. Android ignores it. */
|
|
26
26
|
testID?: string;
|
|
27
27
|
};
|
|
28
28
|
export type IslandComponent = (props: IslandProps) => ReactNode;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* A scrolling list
|
|
3
|
+
* A scrolling list: SwiftUI `List`, Compose `LazyColumn`. It has no height of its own, so it needs one from outside:
|
|
4
4
|
* a `Screen`, or an `Island` with `matchContents={false}` and a height. In an island that sizes itself to its content
|
|
5
5
|
* Compose measures it against an infinite height and throws ("Vertically scrollable component was measured with an
|
|
6
6
|
* infinity maximum height"); SwiftUI shows nothing. For a handful of rows that should not scroll, use a `VStack`.
|
|
7
7
|
*
|
|
8
|
-
* Rows are separated for you
|
|
8
|
+
* Rows are separated for you (SwiftUI's own separators, a `Divider` between rows on Android), so a `Divider` among
|
|
9
9
|
* the children is one too many: on iOS it becomes an empty row of its own.
|
|
10
10
|
*/
|
|
11
11
|
export type ListProps = {
|
|
12
|
-
/** The rows
|
|
12
|
+
/** The rows: native views, one row each. */
|
|
13
13
|
children: ReactNode;
|
|
14
14
|
/**
|
|
15
|
-
* Enables pull-to-refresh. Async on purpose
|
|
15
|
+
* Enables pull-to-refresh. Async on purpose (see `ScrollViewProps.onRefresh`): the spinner runs
|
|
16
16
|
* until the promise settles, so neither platform needs a `refreshing` flag kept in sync by hand.
|
|
17
17
|
*/
|
|
18
18
|
onRefresh?: () => Promise<void>;
|
|
19
|
-
/** Test identifier, forwarded to the native view on iOS
|
|
19
|
+
/** Test identifier, forwarded to the native view on iOS. Android ignores it. */
|
|
20
20
|
testID?: string;
|
|
21
21
|
};
|
|
22
22
|
export type ListComponent = (props: ListProps) => ReactNode;
|
|
@@ -7,7 +7,7 @@ export type PickerOption = {
|
|
|
7
7
|
value: string;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
|
-
* A single choice from a list
|
|
10
|
+
* A single choice from a list: a SwiftUI wheel picker on iOS, Material's exposed dropdown on Android. It brings its
|
|
11
11
|
* own host, so it renders outside `Screen` and `Island` as well.
|
|
12
12
|
*/
|
|
13
13
|
export type PickerProps = {
|
|
@@ -1,21 +1,37 @@
|
|
|
1
1
|
import type { ResponsiveViewSx } from '@hzblj/kara-sx';
|
|
2
|
+
import type { OpacitySize } from '@hzblj/kara-theme';
|
|
2
3
|
import type { ReactNode } from 'react';
|
|
3
4
|
import type { Haptic } from '../../haptics';
|
|
5
|
+
/** How the content answers a press: it springs down, it dims, or it stays still. */
|
|
6
|
+
export type PressEffect = 'none' | 'opacity' | 'scale';
|
|
4
7
|
/**
|
|
5
|
-
* React Native's `Pressable`, styled through `sx` like a `Box`, taking touches 8 points past its edges.
|
|
6
|
-
*
|
|
7
|
-
* pressable's shape
|
|
8
|
-
*
|
|
8
|
+
* React Native's `Pressable`, styled through `sx` like a `Box`, taking touches 8 points past its edges. Each platform
|
|
9
|
+
* presses its own way by default: iOS springs the content down to 96%, Android draws Material's ripple over it,
|
|
10
|
+
* clipped to the pressable's shape. `pressEffect` picks the same answer on both, and Android keeps its ripple on top
|
|
11
|
+
* unless `ripple` is off. Give it the `borderRadius` of what it wraps (`full` around a `GlassView`). The React Native
|
|
12
|
+
* tier: it needs no host.
|
|
9
13
|
*/
|
|
10
14
|
export type PressableProps = ResponsiveViewSx & {
|
|
11
15
|
/** The pressable content. */
|
|
12
16
|
children?: ReactNode;
|
|
13
|
-
/** Ignores presses
|
|
17
|
+
/** Ignores presses: no `onPress`, no haptic, no press effect or ripple. */
|
|
14
18
|
disabled?: boolean;
|
|
15
19
|
/** Played on press. `true` is a `light` impact; a name picks the haptic, e.g. `selection` for a choice. */
|
|
16
20
|
haptic?: boolean | Haptic;
|
|
17
21
|
/** Called when the press is released, after the `haptic` plays. */
|
|
18
22
|
onPress?: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* How the content answers while it is held. `scale` springs it down to `pressedScale`, `opacity` dims it to
|
|
25
|
+
* `pressedOpacity`, `none` leaves it still. `scale` on iOS and `none` on Android by default, where the ripple is the
|
|
26
|
+
* press.
|
|
27
|
+
*/
|
|
28
|
+
pressEffect?: PressEffect;
|
|
29
|
+
/** What `opacity` dims to, an opacity token. `o60` by default. */
|
|
30
|
+
pressedOpacity?: OpacitySize;
|
|
31
|
+
/** What `scale` springs down to. `0.96` by default. */
|
|
32
|
+
pressedScale?: number;
|
|
33
|
+
/** Android's ripple: Material's pressed state layer over the content, clipped to the shape. On by default. iOS has none. */
|
|
34
|
+
ripple?: boolean;
|
|
19
35
|
/** Test identifier, forwarded to the view. */
|
|
20
36
|
testID?: string;
|
|
21
37
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* A progress bar or ring, tinted `fill.accent.primary
|
|
3
|
+
* A progress bar or ring, tinted `fill.accent.primary`: SwiftUI `ProgressView` (a capacity `Gauge` for a ring with a
|
|
4
4
|
* value, which `ProgressView` cannot draw on iOS) / Compose's `LinearProgressIndicator` and `CircularProgressIndicator`.
|
|
5
5
|
*/
|
|
6
6
|
export type ProgressProps = {
|
|
@@ -2,10 +2,10 @@ import type { ResponsiveViewSx } from '@hzblj/kara-sx';
|
|
|
2
2
|
import type { FlatListProps as RNFlatListProps } 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`). `removeClippedSubviews` is off unless you turn it on:
|
|
6
6
|
* Android's default would detach a row's host before it has measured itself, and the row would stay empty.
|
|
7
7
|
*/
|
|
8
8
|
export type RnFlatListProps<TItem> = ResponsiveViewSx & Omit<RNFlatListProps<TItem>, '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
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { IconProps } from '../icon';
|
|
3
|
-
/** The same contract as `Icon`, for the React Native tier
|
|
3
|
+
/** The same contract as `Icon`, for the React Native tier: anywhere, no `Screen` or `Island` needed. */
|
|
4
4
|
export type RnIconProps = IconProps;
|
|
5
5
|
export type RnIconComponent = (props: RnIconProps) => ReactNode;
|
|
@@ -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,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
|
|
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
|
|
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,7 +1,7 @@
|
|
|
1
1
|
import type { 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
7
|
export type SurfaceProps = ResponsiveSx & {
|
|
@@ -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;
|
|
@@ -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
|
|
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,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;
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 = {
|