@kanso-labs/react-native-kanso-ui 0.8.0 → 0.9.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 (78) hide show
  1. package/dist/badge/index.js +9 -70
  2. package/dist/badge/index.js.map +1 -1
  3. package/dist/button/index.js +1 -1
  4. package/dist/button/palettes.d.ts +2 -0
  5. package/dist/components/badge/index.d.ts +48 -0
  6. package/dist/components/badge/index.js +122 -0
  7. package/dist/components/badge/index.js.map +1 -0
  8. package/dist/{badge → components/badge}/styles.js +10 -6
  9. package/dist/components/badge/styles.js.map +1 -0
  10. package/dist/components/breadcrumbs/index.d.ts +66 -0
  11. package/dist/components/breadcrumbs/index.js +285 -0
  12. package/dist/components/breadcrumbs/index.js.map +1 -0
  13. package/dist/components/checkbox/index.d.ts +7 -1
  14. package/dist/components/checkbox/index.js +183 -138
  15. package/dist/components/checkbox/index.js.map +1 -1
  16. package/dist/components/checkbox-group/index.d.ts +93 -0
  17. package/dist/components/checkbox-group/index.js +306 -0
  18. package/dist/components/checkbox-group/index.js.map +1 -0
  19. package/dist/components/code/index.d.ts +25 -0
  20. package/dist/components/code/index.js +87 -0
  21. package/dist/components/code/index.js.map +1 -0
  22. package/dist/components/container/index.d.ts +47 -0
  23. package/dist/components/container/index.js +85 -0
  24. package/dist/components/container/index.js.map +1 -0
  25. package/dist/components/fab/index.d.ts +80 -0
  26. package/dist/components/fab/index.js +231 -0
  27. package/dist/components/fab/index.js.map +1 -0
  28. package/dist/components/fab-menu/index.d.ts +120 -0
  29. package/dist/components/fab-menu/index.js +640 -0
  30. package/dist/components/fab-menu/index.js.map +1 -0
  31. package/dist/components/feed/index.d.ts +57 -0
  32. package/dist/components/feed/index.js +167 -0
  33. package/dist/components/feed/index.js.map +1 -0
  34. package/dist/components/keycap/index.d.ts +27 -0
  35. package/dist/components/keycap/index.js +136 -0
  36. package/dist/components/keycap/index.js.map +1 -0
  37. package/dist/components/menu/index.js +1 -1
  38. package/dist/components/separator/index.d.ts +3 -2
  39. package/dist/components/separator/index.js +29 -26
  40. package/dist/components/separator/index.js.map +1 -1
  41. package/dist/components/supporting-pane/index.d.ts +44 -0
  42. package/dist/components/supporting-pane/index.js +109 -0
  43. package/dist/components/supporting-pane/index.js.map +1 -0
  44. package/dist/components/text/index.d.ts +1 -1
  45. package/dist/components/text/index.js +49 -21
  46. package/dist/components/text/index.js.map +1 -1
  47. package/dist/components/text-area/index.d.ts +145 -0
  48. package/dist/components/text-area/index.js +231 -0
  49. package/dist/components/text-area/index.js.map +1 -0
  50. package/dist/components/toolbar/index.d.ts +53 -0
  51. package/dist/components/toolbar/index.js +185 -0
  52. package/dist/components/toolbar/index.js.map +1 -0
  53. package/dist/control/group.js +23 -0
  54. package/dist/control/group.js.map +1 -0
  55. package/dist/fab/index.d.ts +19 -0
  56. package/dist/fab/index.js +147 -0
  57. package/dist/fab/index.js.map +1 -0
  58. package/dist/field/index.js +84 -43
  59. package/dist/field/index.js.map +1 -1
  60. package/dist/field/styles.js +18 -0
  61. package/dist/field/styles.js.map +1 -1
  62. package/dist/form/index.d.ts +1 -2
  63. package/dist/form/index.js +1 -1
  64. package/dist/form/index.js.map +1 -1
  65. package/dist/index.d.ts +17 -4
  66. package/dist/index.js +15 -3
  67. package/dist/modal/index.js +59 -46
  68. package/dist/modal/index.js.map +1 -1
  69. package/dist/navigation/index.js +8 -5
  70. package/dist/navigation/index.js.map +1 -1
  71. package/dist/overlay/placement.js +3 -1
  72. package/dist/overlay/placement.js.map +1 -1
  73. package/dist/separator/index.js +7 -0
  74. package/dist/separator/index.js.map +1 -0
  75. package/dist/typography/size.js +14 -0
  76. package/dist/typography/size.js.map +1 -0
  77. package/package.json +1 -1
  78. package/dist/badge/styles.js.map +0 -1
@@ -0,0 +1,285 @@
1
+ import { useTheme } from "../../theme/scope.js";
2
+ import { composeStyles, themedStyles } from "../../theme/styles.js";
3
+ import { useTypeRole } from "../../typography/roles.js";
4
+ import { ChevronEndGlyph } from "../../glyphs/index.js";
5
+ import { Link } from "../link/index.js";
6
+ import { c } from "react/compiler-runtime";
7
+ import { Platform, StyleSheet, Text, View } from "react-native";
8
+ import { Children, Fragment, createContext, isValidElement, use } from "react";
9
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
+ //#region src/components/breadcrumbs/index.tsx
11
+ const ItemContext = createContext({
12
+ isCurrent: false,
13
+ isDisabled: false,
14
+ onAction: void 0
15
+ });
16
+ const CURRENT_PAGE = { "aria-current": "page" };
17
+ const CHEVRON_SIZE = 18;
18
+ const stylesOf = themedStyles(({ colors, spacing }) => StyleSheet.create({
19
+ chevron: { flexShrink: 0 },
20
+ current: { color: colors.onSurface },
21
+ item: {
22
+ alignItems: "center",
23
+ columnGap: spacing.xs,
24
+ flexDirection: "row",
25
+ flexShrink: 1
26
+ },
27
+ label: {
28
+ color: colors.onSurfaceVariant,
29
+ flexShrink: 1
30
+ },
31
+ root: {
32
+ alignItems: "center",
33
+ flexDirection: "row",
34
+ flexWrap: "wrap",
35
+ gap: spacing.xs
36
+ }
37
+ }));
38
+ function actionOf(id, onAction) {
39
+ return id === void 0 || onAction === void 0 ? void 0 : () => {
40
+ onAction(id);
41
+ };
42
+ }
43
+ /**
44
+ * A trail of links back up a hierarchy, ending at the screen you are on. The
45
+ * last item is the current one and is drawn as text; everything before it is
46
+ * a link.
47
+ *
48
+ * ```tsx
49
+ * <Breadcrumbs aria-label="Label">
50
+ * <Breadcrumbs.Item href="/first">First item</Breadcrumbs.Item>
51
+ * <Breadcrumbs.Item href="/second">Second item</Breadcrumbs.Item>
52
+ * <Breadcrumbs.Item>Third item</Breadcrumbs.Item>
53
+ * </Breadcrumbs>
54
+ * ```
55
+ *
56
+ * Name it with `aria-label`. A screen that navigates without an `href` gives
57
+ * each item an `id` and the trail an `onAction`, which is handed the `id` of
58
+ * the item pressed. The items may come as one fragment. `style`, `ref` and
59
+ * `testID` land on the row, which is the element a layout positions.
60
+ */
61
+ function Breadcrumbs(t0) {
62
+ const $ = c(26);
63
+ let children;
64
+ let onAction;
65
+ let props;
66
+ let style;
67
+ let t1;
68
+ if ($[0] !== t0) {
69
+ ({children, isDisabled: t1, onAction, style, ...props} = t0);
70
+ $[0] = t0;
71
+ $[1] = children;
72
+ $[2] = onAction;
73
+ $[3] = props;
74
+ $[4] = style;
75
+ $[5] = t1;
76
+ } else {
77
+ children = $[1];
78
+ onAction = $[2];
79
+ props = $[3];
80
+ style = $[4];
81
+ t1 = $[5];
82
+ }
83
+ const isDisabled = t1 === void 0 ? false : t1;
84
+ const theme = useTheme();
85
+ let T0;
86
+ let t2;
87
+ let t3;
88
+ let t4;
89
+ let t5;
90
+ if ($[6] !== children || $[7] !== isDisabled || $[8] !== onAction || $[9] !== props || $[10] !== style || $[11] !== theme) {
91
+ const items = positionsOf(itemsOf(children), isDisabled, onAction);
92
+ T0 = View;
93
+ t2 = props;
94
+ t3 = "group";
95
+ if ($[17] !== style || $[18] !== theme) {
96
+ t4 = composeStyles(stylesOf(theme).root, style);
97
+ $[17] = style;
98
+ $[18] = theme;
99
+ $[19] = t4;
100
+ } else t4 = $[19];
101
+ t5 = items.map(_temp);
102
+ $[6] = children;
103
+ $[7] = isDisabled;
104
+ $[8] = onAction;
105
+ $[9] = props;
106
+ $[10] = style;
107
+ $[11] = theme;
108
+ $[12] = T0;
109
+ $[13] = t2;
110
+ $[14] = t3;
111
+ $[15] = t4;
112
+ $[16] = t5;
113
+ } else {
114
+ T0 = $[12];
115
+ t2 = $[13];
116
+ t3 = $[14];
117
+ t4 = $[15];
118
+ t5 = $[16];
119
+ }
120
+ let t6;
121
+ if ($[20] !== T0 || $[21] !== t2 || $[22] !== t3 || $[23] !== t4 || $[24] !== t5) {
122
+ t6 = /* @__PURE__ */ jsx(T0, {
123
+ ...t2,
124
+ role: t3,
125
+ style: t4,
126
+ children: t5
127
+ });
128
+ $[20] = T0;
129
+ $[21] = t2;
130
+ $[22] = t3;
131
+ $[23] = t4;
132
+ $[24] = t5;
133
+ $[25] = t6;
134
+ } else t6 = $[25];
135
+ return t6;
136
+ }
137
+ /**
138
+ * One entry in the trail. Give it an `href` to navigate, or an `id` and let
139
+ * the trail's `onAction` handle it. The last entry is the current screen and
140
+ * is drawn as text rather than a link, whatever it is given. `style`, `ref`
141
+ * and `testID` land on the entry's row, which holds its label and the
142
+ * chevron after it.
143
+ */
144
+ function _temp(t0) {
145
+ const { element, key, position } = t0;
146
+ return /* @__PURE__ */ jsx(ItemContext, {
147
+ value: position,
148
+ children: element
149
+ }, key);
150
+ }
151
+ function BreadcrumbsItem(t0) {
152
+ const $ = c(31);
153
+ let children;
154
+ let href;
155
+ let id;
156
+ let props;
157
+ let style;
158
+ if ($[0] !== t0) {
159
+ ({children, href, id, style, ...props} = t0);
160
+ $[0] = t0;
161
+ $[1] = children;
162
+ $[2] = href;
163
+ $[3] = id;
164
+ $[4] = props;
165
+ $[5] = style;
166
+ } else {
167
+ children = $[1];
168
+ href = $[2];
169
+ id = $[3];
170
+ props = $[4];
171
+ style = $[5];
172
+ }
173
+ const theme = useTheme();
174
+ const { isCurrent, isDisabled, onAction } = use(ItemContext);
175
+ const labelRole = useTypeRole("labelLarge");
176
+ let T0;
177
+ let label;
178
+ let own;
179
+ let t1;
180
+ let t2;
181
+ if ($[6] !== isCurrent || $[7] !== labelRole || $[8] !== props || $[9] !== style || $[10] !== theme) {
182
+ own = stylesOf(theme);
183
+ label = composeStyles(labelRole, own.label, isCurrent ? own.current : void 0);
184
+ T0 = View;
185
+ t1 = props;
186
+ t2 = composeStyles(own.item, style);
187
+ $[6] = isCurrent;
188
+ $[7] = labelRole;
189
+ $[8] = props;
190
+ $[9] = style;
191
+ $[10] = theme;
192
+ $[11] = T0;
193
+ $[12] = label;
194
+ $[13] = own;
195
+ $[14] = t1;
196
+ $[15] = t2;
197
+ } else {
198
+ T0 = $[11];
199
+ label = $[12];
200
+ own = $[13];
201
+ t1 = $[14];
202
+ t2 = $[15];
203
+ }
204
+ let t3;
205
+ if ($[16] !== children || $[17] !== href || $[18] !== id || $[19] !== isCurrent || $[20] !== isDisabled || $[21] !== label || $[22] !== onAction || $[23] !== own || $[24] !== theme) {
206
+ t3 = isCurrent ? /* @__PURE__ */ jsx(Text, {
207
+ ...Platform.OS === "web" ? CURRENT_PAGE : void 0,
208
+ style: label,
209
+ children
210
+ }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Text, {
211
+ style: label,
212
+ children: /* @__PURE__ */ jsx(Link, {
213
+ href,
214
+ isDisabled,
215
+ onPress: actionOf(id, isDisabled ? void 0 : onAction),
216
+ tone: "inherit",
217
+ underline: "hover",
218
+ children
219
+ })
220
+ }), /* @__PURE__ */ jsx(ChevronEndGlyph, {
221
+ color: theme.colors.onSurfaceVariant,
222
+ size: CHEVRON_SIZE,
223
+ style: own.chevron
224
+ })] });
225
+ $[16] = children;
226
+ $[17] = href;
227
+ $[18] = id;
228
+ $[19] = isCurrent;
229
+ $[20] = isDisabled;
230
+ $[21] = label;
231
+ $[22] = onAction;
232
+ $[23] = own;
233
+ $[24] = theme;
234
+ $[25] = t3;
235
+ } else t3 = $[25];
236
+ let t4;
237
+ if ($[26] !== T0 || $[27] !== t1 || $[28] !== t2 || $[29] !== t3) {
238
+ t4 = /* @__PURE__ */ jsx(T0, {
239
+ ...t1,
240
+ style: t2,
241
+ children: t3
242
+ });
243
+ $[26] = T0;
244
+ $[27] = t1;
245
+ $[28] = t2;
246
+ $[29] = t3;
247
+ $[30] = t4;
248
+ } else t4 = $[30];
249
+ return t4;
250
+ }
251
+ /**
252
+ * The entries among a trail's children, with any fragment between them
253
+ * opened, so a trail can take its items as one fragment. Each keeps a key
254
+ * made of its own and its fragments', so two fragments' children never share
255
+ * one.
256
+ */
257
+ function itemsOf(children, prefix = "") {
258
+ return Children.toArray(children).flatMap((child) => {
259
+ if (!isValidElement(child)) return [];
260
+ const key = `${prefix}${String(child.key)}`;
261
+ return child.type === Fragment ? itemsOf(child.props.children, `${key}/`) : [{
262
+ element: child,
263
+ key
264
+ }];
265
+ });
266
+ }
267
+ /**
268
+ * Each entry with where it stands: the last is the current one, and the
269
+ * trail's `isDisabled` and `onAction` reach every one.
270
+ */
271
+ function positionsOf(items, isDisabled, onAction) {
272
+ return items.map((item, index) => ({
273
+ ...item,
274
+ position: {
275
+ isCurrent: index === items.length - 1,
276
+ isDisabled,
277
+ onAction
278
+ }
279
+ }));
280
+ }
281
+ Breadcrumbs.Item = BreadcrumbsItem;
282
+ //#endregion
283
+ export { Breadcrumbs, BreadcrumbsItem };
284
+
285
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ComponentRef","ReactElement","ReactNode","Ref","StyleProp","TextStyle","ViewProps","ViewStyle","Key","Children","createContext","Fragment","isValidElement","use","Text","NativeText","Platform","StyleSheet","View","ChevronEndGlyph","useTheme","composeStyles","themedStyles","useTypeRole","Link","BreadcrumbsItemProps","Omit","children","href","id","ref","style","BreadcrumbsProps","isDisabled","onAction","key","ItemPosition","isCurrent","ItemContext","undefined","CURRENT_PAGE","const","CHEVRON_SIZE","stylesOf","colors","spacing","create","chevron","flexShrink","current","color","onSurface","item","alignItems","columnGap","xs","flexDirection","label","onSurfaceVariant","root","flexWrap","gap","actionOf","Breadcrumbs","t0","$","_c","props","t1","theme","T0","t2","t3","t4","t5","items","positionsOf","itemsOf","map","_temp","t6","element","position","BreadcrumbsItem","labelRole","own","OS","prefix","toArray","flatMap","child","String","type","index","length","Item","_c","NativeText"],"sources":["../../../src/components/breadcrumbs/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactElement, ReactNode, Ref } from 'react'\nimport type { StyleProp, TextStyle, ViewProps, ViewStyle } from 'react-native'\nimport type { Key } from 'react-stately'\n\nimport { Children, createContext, Fragment, isValidElement, use } from 'react'\nimport { Text as NativeText, Platform, StyleSheet, View } from 'react-native'\n\nimport { ChevronEndGlyph } from '../../glyphs'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\nimport { Link } from '../link'\n\n// kanso-ui's Breadcrumbs: a trail of links back up a hierarchy, ending at the\n// screen you are on. Material Design has no breadcrumbs page, so web's\n// reading stands, taken from the two nearest pages: the row takes the top app\n// bar's muted content role, on-surface variant, and each link the text\n// button's label large type.\n//\n// Three things are this component's own, as they are web's.\n//\n// **The current item is text, not a link.** It is the last item, drawn in\n// the full-strength on-surface role, so the screen you are on is the most\n// legible thing in the row rather than a faded disabled link. Native has no\n// counterpart to web's `aria-current`, so there it is told apart by being the\n// one item that leads nowhere; on the web it carries `aria-current=\"page\"`,\n// as web's does.\n//\n// **The chevron belongs to the item before it.** Each item that is not the\n// current one draws one after its link, which puts a separator between every\n// pair and none at the end. It says \"further in\" rather than \"to the right\",\n// so it mirrors under a right-to-left layout, and a screen reader skips it.\n//\n// **A link is drawn as a link in a place already understood to be links.**\n// Each is the library's Link with `tone=\"inherit\"`, taking the row's muted\n// colour, and `underline=\"hover\"`, leaving the rule for a pointer. A press\n// goes through the `RouterProvider` around the trail, as any Link's does.\n//\n// The trail is one group named by its `aria-label`, and it wraps onto further\n// lines rather than running off the edge.\n\ntype BreadcrumbsItemProps = Omit<ViewProps, 'children' | 'id' | 'style'> & {\n /** The item's label. */\n readonly children?: ReactNode\n /**\n * Where the item leads. Leave it out on an item the screen handles through\n * the trail's `onAction`, and on the current one, which is never a link.\n */\n readonly href?: string\n /** What the trail's `onAction` is handed when the item is pressed. */\n readonly id?: Key\n readonly ref?: Ref<ComponentRef<typeof View>>\n readonly style?: StyleProp<ViewStyle>\n}\n\ntype BreadcrumbsProps = Omit<ViewProps, 'children' | 'style'> & {\n /** The trail, as `Breadcrumbs.Item` entries. */\n readonly children?: ReactNode\n /**\n * Disables every link in the trail.\n * @default false\n */\n readonly isDisabled?: boolean\n /**\n * Called with an item's `id` when its link is pressed, for a screen that\n * navigates without an `href`.\n */\n readonly onAction?: (key: Key) => void\n readonly ref?: Ref<ComponentRef<typeof View>>\n readonly style?: StyleProp<ViewStyle>\n}\n\n/** Where an item stands in its trail, which the trail tells each one. */\ntype ItemPosition = {\n readonly isCurrent: boolean\n readonly isDisabled: boolean\n readonly onAction: ((key: Key) => void) | undefined\n}\n\n// An item outside a trail is a link like any other.\nconst ItemContext = createContext<ItemPosition>({\n isCurrent: false,\n isDisabled: false,\n onAction: undefined,\n})\n\n// What marks the current item on the web, where a screen reader reads it.\nconst CURRENT_PAGE = { 'aria-current': 'page' } as const\n\n// 18dp, a step under the 20dp the menus page gives the same glyph, as web's\n// is: a separator inside a row of label large links sits heavier than the\n// words either side of it at 20.\nconst CHEVRON_SIZE = 18\n\nconst stylesOf = themedStyles(({ colors, spacing }) =>\n StyleSheet.create({\n chevron: {\n flexShrink: 0,\n },\n // The item you are on: the links' type in the full-strength content role,\n // so it reads as the end of the trail.\n current: {\n color: colors.onSurface,\n },\n // An item's label and chevron. It shrinks to the row's width when its\n // label alone is wider, so the label wraps inside it.\n item: {\n alignItems: 'center',\n columnGap: spacing.xs,\n flexDirection: 'row',\n flexShrink: 1,\n },\n label: {\n color: colors.onSurfaceVariant,\n flexShrink: 1,\n },\n root: {\n alignItems: 'center',\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: spacing.xs,\n },\n }),\n)\n\n// What a press on an item's link reports, when the item has an `id` and the\n// trail listens. A disabled trail hands its links nothing to call.\nfunction actionOf(id: Key | undefined, onAction: ItemPosition['onAction']) {\n return id === undefined || onAction === undefined\n ? undefined\n : () => {\n onAction(id)\n }\n}\n\n/**\n * A trail of links back up a hierarchy, ending at the screen you are on. The\n * last item is the current one and is drawn as text; everything before it is\n * a link.\n *\n * ```tsx\n * <Breadcrumbs aria-label=\"Label\">\n * <Breadcrumbs.Item href=\"/first\">First item</Breadcrumbs.Item>\n * <Breadcrumbs.Item href=\"/second\">Second item</Breadcrumbs.Item>\n * <Breadcrumbs.Item>Third item</Breadcrumbs.Item>\n * </Breadcrumbs>\n * ```\n *\n * Name it with `aria-label`. A screen that navigates without an `href` gives\n * each item an `id` and the trail an `onAction`, which is handed the `id` of\n * the item pressed. The items may come as one fragment. `style`, `ref` and\n * `testID` land on the row, which is the element a layout positions.\n */\nfunction Breadcrumbs({\n children,\n isDisabled = false,\n onAction,\n style,\n ...props\n}: BreadcrumbsProps) {\n const theme = useTheme()\n const items = positionsOf(itemsOf(children), isDisabled, onAction)\n\n return (\n <View\n {...props}\n role=\"group\"\n style={composeStyles<ViewStyle>(stylesOf(theme).root, style)}\n >\n {items.map(({ element, key, position }) => (\n <ItemContext key={key} value={position}>\n {element}\n </ItemContext>\n ))}\n </View>\n )\n}\n\n/**\n * One entry in the trail. Give it an `href` to navigate, or an `id` and let\n * the trail's `onAction` handle it. The last entry is the current screen and\n * is drawn as text rather than a link, whatever it is given. `style`, `ref`\n * and `testID` land on the entry's row, which holds its label and the\n * chevron after it.\n */\nfunction BreadcrumbsItem({\n children,\n href,\n id,\n style,\n ...props\n}: BreadcrumbsItemProps) {\n const theme = useTheme()\n const { isCurrent, isDisabled, onAction } = use(ItemContext)\n const labelRole = useTypeRole('labelLarge')\n\n const own = stylesOf(theme)\n const label = composeStyles<TextStyle>(\n labelRole,\n own.label,\n isCurrent ? own.current : undefined,\n )\n\n return (\n <View {...props} style={composeStyles<ViewStyle>(own.item, style)}>\n {isCurrent ? (\n <NativeText\n {...(Platform.OS === 'web' ? CURRENT_PAGE : undefined)}\n style={label}\n >\n {children}\n </NativeText>\n ) : (\n <>\n <NativeText style={label}>\n <Link\n href={href}\n isDisabled={isDisabled}\n onPress={actionOf(id, isDisabled ? undefined : onAction)}\n tone=\"inherit\"\n underline=\"hover\"\n >\n {children}\n </Link>\n </NativeText>\n <ChevronEndGlyph\n color={theme.colors.onSurfaceVariant}\n size={CHEVRON_SIZE}\n style={own.chevron}\n />\n </>\n )}\n </View>\n )\n}\n\n/**\n * The entries among a trail's children, with any fragment between them\n * opened, so a trail can take its items as one fragment. Each keeps a key\n * made of its own and its fragments', so two fragments' children never share\n * one.\n */\nfunction itemsOf(\n children: ReactNode,\n prefix = '',\n): { readonly element: ReactElement; readonly key: string }[] {\n return Children.toArray(children).flatMap((child) => {\n if (!isValidElement<{ readonly children?: ReactNode }>(child)) {\n return []\n }\n const key = `${prefix}${String(child.key)}`\n return child.type === Fragment\n ? itemsOf(child.props.children, `${key}/`)\n : [{ element: child, key }]\n })\n}\n\n/**\n * Each entry with where it stands: the last is the current one, and the\n * trail's `isDisabled` and `onAction` reach every one.\n */\nfunction positionsOf(\n items: readonly { readonly element: ReactElement; readonly key: string }[],\n isDisabled: boolean,\n onAction: ItemPosition['onAction'],\n) {\n return items.map((item, index) => ({\n ...item,\n position: {\n isCurrent: index === items.length - 1,\n isDisabled,\n onAction,\n } satisfies ItemPosition,\n }))\n}\n\nBreadcrumbs.Item = BreadcrumbsItem\n\nexport { Breadcrumbs, BreadcrumbsItem }\nexport type { BreadcrumbsItemProps, BreadcrumbsProps }\n"],"mappings":";;;;;;;;;;AAgFA,MAAMsC,cAAc5B,cAA4B;CAC9C2B,WAAW;CACXJ,YAAY;CACZC,UAAUK,KAAAA;AACZ,CAAC;AAGD,MAAMC,eAAe,EAAE,gBAAgB,OAAO;AAK9C,MAAME,eAAe;AAErB,MAAMC,WAAWrB,cAAc,EAAEsB,QAAQC,cACvC5B,WAAW6B,OAAO;CAChBC,SAAS,EACPC,YAAY,EACd;CAGAC,SAAS,EACPC,OAAON,OAAOO,UAChB;CAGAC,MAAM;EACJC,YAAY;EACZC,WAAWT,QAAQU;EACnBC,eAAe;EACfR,YAAY;CACd;CACAS,OAAO;EACLP,OAAON,OAAOc;EACdV,YAAY;CACd;CACAW,MAAM;EACJN,YAAY;EACZG,eAAe;EACfI,UAAU;EACVC,KAAKhB,QAAQU;CACf;AACF,CAAC,CACH;AAIA,SAASO,SAASjC,IAAqBK,UAAoC;CACzE,OAAOL,OAAOU,KAAAA,KAAaL,aAAaK,KAAAA,IACpCA,KAAAA,UACM;EACJL,SAASL,EAAE;CACb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,SAASjF,WAClBkE,QAAQa,MAAMvB,MAAMxC,UAAU,GAAGQ,IAAG,EAAG,IACvC,CAAC;GAAE8C,SAASS;GAAOvD;EAAI,CAAC;CAC9B,CAAC;AACH;;;;;AAMA,SAASyC,YACPD,OACA1C,YACAC,UACA;CACA,OAAOyC,MAAMG,KAAK1B,MAAMyC,WAAW;EACjC,GAAGzC;EACH8B,UAAU;GACR7C,WAAWwD,UAAUlB,MAAMmB,SAAS;GACpC7D;GACAC;EACF;CACF,EAAE;AACJ;AAEA6B,YAAYgC,OAAOZ"}
@@ -49,6 +49,12 @@ type CheckboxProps = Omit<ViewProps, 'children' | 'style'> & {
49
49
  readonly onChange?: (isSelected: boolean) => void;
50
50
  readonly ref?: Ref<ComponentRef<typeof View>>;
51
51
  readonly style?: StyleProp<ViewStyle>;
52
+ /**
53
+ * The entry this checkbox stands for inside a `CheckboxGroup`, which the
54
+ * group's value holds while it is selected. Required there, and unused
55
+ * outside one.
56
+ */
57
+ readonly value?: string;
52
58
  };
53
59
  /**
54
60
  * A checkbox with its label, and optionally a description or an error under
@@ -70,7 +76,7 @@ type CheckboxProps = Omit<ViewProps, 'children' | 'style'> & {
70
76
  * holding the row and the line under it, which is the element a layout
71
77
  * positions.
72
78
  */
73
- declare function Checkbox({ 'aria-label': ariaLabel, children, defaultSelected, description, error, isDisabled, isIndeterminate, isReadOnly, isSelected, onChange, style, ...props }: CheckboxProps): import("react").JSX.Element;
79
+ declare function Checkbox({ 'aria-label': ariaLabel, children, defaultSelected, description, error, isDisabled: ownDisabled, isIndeterminate, isReadOnly: ownReadOnly, isSelected, onChange, style, value, ...props }: CheckboxProps): import("react").JSX.Element;
74
80
  //#endregion
75
81
  export { Checkbox, type CheckboxProps };
76
82
  //# sourceMappingURL=index.d.ts.map