@kanso-labs/react-native-kanso-ui 0.3.1 → 0.5.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 (123) hide show
  1. package/dist/autocomplete/index.js +39 -0
  2. package/dist/autocomplete/index.js.map +1 -0
  3. package/dist/button/index.d.ts +2 -1
  4. package/dist/button/index.js +35 -2
  5. package/dist/button/index.js.map +1 -1
  6. package/dist/button/pending.js +1 -1
  7. package/dist/button/slots.d.ts +2 -0
  8. package/dist/button/slots.js.map +1 -1
  9. package/dist/chip/index.js +1 -1
  10. package/dist/components/autocomplete/index.d.ts +49 -0
  11. package/dist/components/autocomplete/index.js +87 -0
  12. package/dist/components/autocomplete/index.js.map +1 -0
  13. package/dist/components/avatar/index.d.ts +1 -1
  14. package/dist/components/button/index.d.ts +2 -2
  15. package/dist/components/button/index.js +196 -150
  16. package/dist/components/button/index.js.map +1 -1
  17. package/dist/components/card/index.d.ts +1 -1
  18. package/dist/components/card/index.js +1 -1
  19. package/dist/components/checkbox/index.d.ts +1 -1
  20. package/dist/components/checkbox/index.js +106 -193
  21. package/dist/components/checkbox/index.js.map +1 -1
  22. package/dist/components/chip/index.d.ts +1 -1
  23. package/dist/components/chip-group/index.d.ts +1 -1
  24. package/dist/components/chip-group/index.js +1 -1
  25. package/dist/components/copy-field/index.d.ts +1 -1
  26. package/dist/components/copy-field/index.js +1 -1
  27. package/dist/components/currency/index.d.ts +1 -1
  28. package/dist/components/currency/index.js +1 -1
  29. package/dist/components/dialog/index.d.ts +3 -2
  30. package/dist/components/dialog/index.js +105 -242
  31. package/dist/components/dialog/index.js.map +1 -1
  32. package/dist/components/icon-button/index.d.ts +2 -2
  33. package/dist/components/icon-button/index.js +205 -159
  34. package/dist/components/icon-button/index.js.map +1 -1
  35. package/dist/components/link/index.d.ts +1 -1
  36. package/dist/components/link/index.js +1 -1
  37. package/dist/components/list/index.d.ts +216 -0
  38. package/dist/components/list/index.js +1118 -0
  39. package/dist/components/list/index.js.map +1 -0
  40. package/dist/components/list-item/index.d.ts +63 -0
  41. package/dist/components/list-item/index.js +275 -0
  42. package/dist/components/list-item/index.js.map +1 -0
  43. package/dist/components/menu/index.d.ts +309 -0
  44. package/dist/components/menu/index.js +1283 -0
  45. package/dist/components/menu/index.js.map +1 -0
  46. package/dist/components/meter/index.d.ts +1 -1
  47. package/dist/components/meter/index.js +1 -1
  48. package/dist/components/number-field/index.d.ts +1 -1
  49. package/dist/components/number-field/index.js +2 -2
  50. package/dist/components/popover/index.d.ts +140 -0
  51. package/dist/components/popover/index.js +704 -0
  52. package/dist/components/popover/index.js.map +1 -0
  53. package/dist/components/product-icon/index.d.ts +1 -1
  54. package/dist/components/progress-indicator/index.d.ts +1 -1
  55. package/dist/components/progress-indicator/index.js +1 -1
  56. package/dist/components/radio-group/index.d.ts +1 -1
  57. package/dist/components/radio-group/index.js +1 -1
  58. package/dist/components/search-field/index.d.ts +12 -4
  59. package/dist/components/search-field/index.js +64 -58
  60. package/dist/components/search-field/index.js.map +1 -1
  61. package/dist/components/segmented-button/index.d.ts +1 -1
  62. package/dist/components/segmented-button/index.js +1 -1
  63. package/dist/components/separator/index.d.ts +1 -1
  64. package/dist/components/separator/index.js +1 -1
  65. package/dist/components/sheet/index.d.ts +137 -0
  66. package/dist/components/sheet/index.js +1091 -0
  67. package/dist/components/sheet/index.js.map +1 -0
  68. package/dist/components/snackbar/index.d.ts +1 -1
  69. package/dist/components/snackbar/index.js +1 -1
  70. package/dist/components/stack/index.d.ts +1 -1
  71. package/dist/components/stack/index.js +1 -1
  72. package/dist/components/switch/index.d.ts +1 -1
  73. package/dist/components/switch/index.js +1 -1
  74. package/dist/components/switch/index.js.map +1 -1
  75. package/dist/components/text/index.d.ts +1 -1
  76. package/dist/components/text/index.js +1 -1
  77. package/dist/components/text-field/index.d.ts +1 -1
  78. package/dist/components/text-field/index.js +1 -1
  79. package/dist/control/checkbox-box.js +137 -0
  80. package/dist/control/checkbox-box.js.map +1 -0
  81. package/dist/control/index.js +1 -1
  82. package/dist/field/index.d.ts +1 -1
  83. package/dist/field/index.js +1 -1
  84. package/dist/form/index.d.ts +1 -1
  85. package/dist/glyphs/index.js +21 -2
  86. package/dist/glyphs/index.js.map +1 -1
  87. package/dist/i18n/index.js +16 -1
  88. package/dist/i18n/index.js.map +1 -1
  89. package/dist/i18n/messages.js +374 -34
  90. package/dist/i18n/messages.js.map +1 -1
  91. package/dist/index.d.ts +7 -1
  92. package/dist/index.js +8 -2
  93. package/dist/indicator/index.d.ts +1 -1
  94. package/dist/indicator/index.js +2 -2
  95. package/dist/mark/index.d.ts +1 -1
  96. package/dist/mark/index.js +1 -1
  97. package/dist/modal/index.d.ts +16 -0
  98. package/dist/modal/index.js +277 -0
  99. package/dist/modal/index.js.map +1 -0
  100. package/dist/overlay/anchored.d.ts +2 -0
  101. package/dist/overlay/anchored.js +182 -0
  102. package/dist/overlay/anchored.js.map +1 -0
  103. package/dist/overlay/host.d.ts +2 -0
  104. package/dist/overlay/host.js +1 -1
  105. package/dist/overlay/index.d.ts +4 -0
  106. package/dist/overlay/panel.js +215 -0
  107. package/dist/overlay/panel.js.map +1 -0
  108. package/dist/overlay/placement.d.ts +8 -0
  109. package/dist/overlay/placement.js +87 -0
  110. package/dist/overlay/placement.js.map +1 -0
  111. package/dist/press/index.js +1 -1
  112. package/dist/ref/index.js +15 -0
  113. package/dist/ref/index.js.map +1 -0
  114. package/dist/router/index.js +1 -1
  115. package/dist/row/index.js +158 -0
  116. package/dist/row/index.js.map +1 -0
  117. package/dist/row/styles.js +51 -0
  118. package/dist/row/styles.js.map +1 -0
  119. package/dist/theme/scope.js +1 -1
  120. package/dist/theme-scope.d.ts +1 -1
  121. package/dist/theme-scope.js +1 -1
  122. package/dist/typography/fonts.js +1 -1
  123. package/package.json +6 -6
@@ -2,13 +2,13 @@ import { IconStyleContext } from "../../glyphs/icon-style.js";
2
2
  import { useTheme } from "../../theme/scope.js";
3
3
  import { composeStyles, themedStyles } from "../../theme/styles.js";
4
4
  import { useTypeRole } from "../../typography/roles.js";
5
- import { AnimatedPressable, HEIGHTS, OUTLINE_WIDTHS, PRESSED_CORNERS, buttonStyles, toggleState, useButtonAction, useCorner } from "../../button/index.js";
5
+ import { AnimatedPressable, HEIGHTS, OUTLINE_WIDTHS, PRESSED_CORNERS, buttonStyles, toggleState, useButtonAction, useCorner, useSlotTrigger } from "../../button/index.js";
6
6
  import { palettesOf } from "../../button/palettes.js";
7
7
  import { BUSY, CONCEALED, PendingContent, PendingRing, pendingStyles, usePending } from "../../button/pending.js";
8
8
  import { hitSlop, usePressFeedback } from "../../press/index.js";
9
9
  import { c } from "react/compiler-runtime";
10
- import { StyleSheet, Text, useWindowDimensions } from "react-native";
11
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { StyleSheet, Text, useWindowDimensions } from "react-native";
12
12
  import Animated from "react-native-reanimated";
13
13
  //#region src/components/button/index.tsx
14
14
  const DISABLED = {
@@ -161,9 +161,10 @@ const outlinedSizesOf = themedStyles((theme) => {
161
161
  * `style`, `ref` and `testID` land on the `Pressable`.
162
162
  */
163
163
  function Button(t0) {
164
- const $ = c(73);
164
+ const $ = c(89);
165
165
  let children;
166
166
  let defaultSelected;
167
+ let delayLongPress;
167
168
  let href;
168
169
  let icon;
169
170
  let isSelected;
@@ -180,6 +181,7 @@ function Button(t0) {
180
181
  let ownHitSlop;
181
182
  let pendingLabel;
182
183
  let props;
184
+ let ref;
183
185
  let slot;
184
186
  let style;
185
187
  let t1;
@@ -190,63 +192,67 @@ function Button(t0) {
190
192
  let t6;
191
193
  let type;
192
194
  if ($[0] !== t0) {
193
- ({children, defaultSelected, disableRipple: t1, hitSlop: ownHitSlop, href, icon, isDisabled: t2, isPending: t3, isSelected, onBlur, onChange, onFocus, onHoverIn, onHoverOut, onLayout, onLongPress, onPress, onPressIn, onPressOut, pendingLabel, shape: t4, size: t5, slot, style, type, variant: t6, ...props} = t0);
195
+ ({children, defaultSelected, delayLongPress, disableRipple: t1, hitSlop: ownHitSlop, href, icon, isDisabled: t2, isPending: t3, isSelected, onBlur, onChange, onFocus, onHoverIn, onHoverOut, onLayout, onLongPress, onPress, onPressIn, onPressOut, pendingLabel, ref, shape: t4, size: t5, slot, style, type, variant: t6, ...props} = t0);
194
196
  $[0] = t0;
195
197
  $[1] = children;
196
198
  $[2] = defaultSelected;
197
- $[3] = href;
198
- $[4] = icon;
199
- $[5] = isSelected;
200
- $[6] = onBlur;
201
- $[7] = onChange;
202
- $[8] = onFocus;
203
- $[9] = onHoverIn;
204
- $[10] = onHoverOut;
205
- $[11] = onLayout;
206
- $[12] = onLongPress;
207
- $[13] = onPress;
208
- $[14] = onPressIn;
209
- $[15] = onPressOut;
210
- $[16] = ownHitSlop;
211
- $[17] = pendingLabel;
212
- $[18] = props;
213
- $[19] = slot;
214
- $[20] = style;
215
- $[21] = t1;
216
- $[22] = t2;
217
- $[23] = t3;
218
- $[24] = t4;
219
- $[25] = t5;
220
- $[26] = t6;
221
- $[27] = type;
199
+ $[3] = delayLongPress;
200
+ $[4] = href;
201
+ $[5] = icon;
202
+ $[6] = isSelected;
203
+ $[7] = onBlur;
204
+ $[8] = onChange;
205
+ $[9] = onFocus;
206
+ $[10] = onHoverIn;
207
+ $[11] = onHoverOut;
208
+ $[12] = onLayout;
209
+ $[13] = onLongPress;
210
+ $[14] = onPress;
211
+ $[15] = onPressIn;
212
+ $[16] = onPressOut;
213
+ $[17] = ownHitSlop;
214
+ $[18] = pendingLabel;
215
+ $[19] = props;
216
+ $[20] = ref;
217
+ $[21] = slot;
218
+ $[22] = style;
219
+ $[23] = t1;
220
+ $[24] = t2;
221
+ $[25] = t3;
222
+ $[26] = t4;
223
+ $[27] = t5;
224
+ $[28] = t6;
225
+ $[29] = type;
222
226
  } else {
223
227
  children = $[1];
224
228
  defaultSelected = $[2];
225
- href = $[3];
226
- icon = $[4];
227
- isSelected = $[5];
228
- onBlur = $[6];
229
- onChange = $[7];
230
- onFocus = $[8];
231
- onHoverIn = $[9];
232
- onHoverOut = $[10];
233
- onLayout = $[11];
234
- onLongPress = $[12];
235
- onPress = $[13];
236
- onPressIn = $[14];
237
- onPressOut = $[15];
238
- ownHitSlop = $[16];
239
- pendingLabel = $[17];
240
- props = $[18];
241
- slot = $[19];
242
- style = $[20];
243
- t1 = $[21];
244
- t2 = $[22];
245
- t3 = $[23];
246
- t4 = $[24];
247
- t5 = $[25];
248
- t6 = $[26];
249
- type = $[27];
229
+ delayLongPress = $[3];
230
+ href = $[4];
231
+ icon = $[5];
232
+ isSelected = $[6];
233
+ onBlur = $[7];
234
+ onChange = $[8];
235
+ onFocus = $[9];
236
+ onHoverIn = $[10];
237
+ onHoverOut = $[11];
238
+ onLayout = $[12];
239
+ onLongPress = $[13];
240
+ onPress = $[14];
241
+ onPressIn = $[15];
242
+ onPressOut = $[16];
243
+ ownHitSlop = $[17];
244
+ pendingLabel = $[18];
245
+ props = $[19];
246
+ ref = $[20];
247
+ slot = $[21];
248
+ style = $[22];
249
+ t1 = $[23];
250
+ t2 = $[24];
251
+ t3 = $[25];
252
+ t4 = $[26];
253
+ t5 = $[27];
254
+ t6 = $[28];
255
+ type = $[29];
250
256
  }
251
257
  const disableRipple = t1 === void 0 ? false : t1;
252
258
  const isDisabled = t2 === void 0 ? false : t2;
@@ -262,7 +268,7 @@ function Button(t0) {
262
268
  const isToggle = variant !== "text" && (defaultSelected !== void 0 || isSelected !== void 0 || onChange !== void 0);
263
269
  const t7 = slot ?? "default";
264
270
  let t8;
265
- if ($[28] !== defaultSelected || $[29] !== href || $[30] !== isSelected || $[31] !== isToggle || $[32] !== onChange || $[33] !== onPress || $[34] !== t7 || $[35] !== type) {
271
+ if ($[30] !== defaultSelected || $[31] !== href || $[32] !== isSelected || $[33] !== isToggle || $[34] !== onChange || $[35] !== onPress || $[36] !== t7 || $[37] !== type) {
266
272
  t8 = {
267
273
  defaultSelected,
268
274
  href,
@@ -273,17 +279,55 @@ function Button(t0) {
273
279
  slot: t7,
274
280
  type
275
281
  };
276
- $[28] = defaultSelected;
277
- $[29] = href;
278
- $[30] = isSelected;
279
- $[31] = isToggle;
280
- $[32] = onChange;
281
- $[33] = onPress;
282
- $[34] = t7;
283
- $[35] = type;
284
- $[36] = t8;
285
- } else t8 = $[36];
282
+ $[30] = defaultSelected;
283
+ $[31] = href;
284
+ $[32] = isSelected;
285
+ $[33] = isToggle;
286
+ $[34] = onChange;
287
+ $[35] = onPress;
288
+ $[36] = t7;
289
+ $[37] = type;
290
+ $[38] = t8;
291
+ } else t8 = $[38];
286
292
  const action = useButtonAction(t8);
293
+ let t9;
294
+ if ($[39] !== delayLongPress || $[40] !== href || $[41] !== onHoverIn || $[42] !== onHoverOut || $[43] !== onLongPress || $[44] !== ref || $[45] !== slot) {
295
+ t9 = {
296
+ delayLongPress,
297
+ href,
298
+ onHoverIn,
299
+ onHoverOut,
300
+ onLongPress,
301
+ ref,
302
+ slot
303
+ };
304
+ $[39] = delayLongPress;
305
+ $[40] = href;
306
+ $[41] = onHoverIn;
307
+ $[42] = onHoverOut;
308
+ $[43] = onLongPress;
309
+ $[44] = ref;
310
+ $[45] = slot;
311
+ $[46] = t9;
312
+ } else t9 = $[46];
313
+ const t10 = useSlotTrigger(t9);
314
+ let hoverIn;
315
+ let hoverOut;
316
+ let longPress;
317
+ let triggerProps;
318
+ if ($[47] !== t10) {
319
+ ({onHoverIn: hoverIn, onHoverOut: hoverOut, onLongPress: longPress, ...triggerProps} = t10);
320
+ $[47] = t10;
321
+ $[48] = hoverIn;
322
+ $[49] = hoverOut;
323
+ $[50] = longPress;
324
+ $[51] = triggerProps;
325
+ } else {
326
+ hoverIn = $[48];
327
+ hoverOut = $[49];
328
+ longPress = $[50];
329
+ triggerProps = $[51];
330
+ }
287
331
  const colors = palettesOf(theme)[isDisabled ? DISABLED[variant] : variant !== "text" && isToggle ? TOGGLE_PALETTES[variant][action.selected ? "selected" : "unselected"] : variant];
288
332
  const feedback = usePressFeedback({
289
333
  color: colors.content,
@@ -291,8 +335,8 @@ function Button(t0) {
291
335
  disableRipple,
292
336
  onBlur,
293
337
  onFocus,
294
- onHoverIn,
295
- onHoverOut,
338
+ onHoverIn: hoverIn,
339
+ onHoverOut: hoverOut,
296
340
  onPressIn,
297
341
  onPressOut,
298
342
  pending
@@ -301,111 +345,113 @@ function Button(t0) {
301
345
  const resting = shape === "square" !== action.selected ? radii[SQUARE_CORNERS[size]] : radii.pill;
302
346
  const shaped = useCorner(feedback.pressed ? radii[PRESSED_CORNERS[size]] : resting, onLayout);
303
347
  const T0 = AnimatedPressable;
304
- const t9 = href === void 0 ? "button" : "link";
305
- let t10;
306
- if ($[37] !== action.selected || $[38] !== isToggle) {
307
- t10 = isToggle ? toggleState(action.selected) : void 0;
308
- $[37] = action.selected;
309
- $[38] = isToggle;
310
- $[39] = t10;
311
- } else t10 = $[39];
312
- const t11 = pending ? BUSY : void 0;
313
- const t12 = feedback.handlers;
314
- let t13;
315
- if ($[40] !== ownHitSlop || $[41] !== size || $[42] !== theme.sizing) {
316
- t13 = ownHitSlop ?? hitSlop(theme.sizing[HEIGHTS[size]]);
317
- $[40] = ownHitSlop;
318
- $[41] = size;
319
- $[42] = theme.sizing;
320
- $[43] = t13;
321
- } else t13 = $[43];
322
- const t14 = shaped.onLayout;
323
- const t15 = pending ? void 0 : onLongPress;
324
- const t16 = pending ? void 0 : action.onPress;
325
- const t17 = composeStyles(styles.base, sizesOf(theme)[size], variant === "outlined" ? outlinedSizesOf(theme)[size] : void 0, colors.container, shadowOf(variant, feedback, isDisabled, theme), shaped.corner, feedback.ring, style);
326
- let t18;
327
- if ($[44] !== shaped.corner) {
328
- t18 = composeStyles(buttonStyles.clip, shaped.corner);
329
- $[44] = shaped.corner;
330
- $[45] = t18;
331
- } else t18 = $[45];
332
- let t19;
333
- if ($[46] !== feedback.layer || $[47] !== t18) {
334
- t19 = /* @__PURE__ */ jsx(Animated.View, {
335
- style: t18,
348
+ const t11 = href === void 0 ? "button" : "link";
349
+ let t12;
350
+ if ($[52] !== action.selected || $[53] !== isToggle) {
351
+ t12 = isToggle ? toggleState(action.selected) : void 0;
352
+ $[52] = action.selected;
353
+ $[53] = isToggle;
354
+ $[54] = t12;
355
+ } else t12 = $[54];
356
+ const t13 = pending ? BUSY : void 0;
357
+ const t14 = feedback.handlers;
358
+ let t15;
359
+ if ($[55] !== ownHitSlop || $[56] !== size || $[57] !== theme.sizing) {
360
+ t15 = ownHitSlop ?? hitSlop(theme.sizing[HEIGHTS[size]]);
361
+ $[55] = ownHitSlop;
362
+ $[56] = size;
363
+ $[57] = theme.sizing;
364
+ $[58] = t15;
365
+ } else t15 = $[58];
366
+ const t16 = shaped.onLayout;
367
+ const t17 = pending ? void 0 : longPress;
368
+ const t18 = pending ? void 0 : action.onPress;
369
+ const t19 = composeStyles(styles.base, sizesOf(theme)[size], variant === "outlined" ? outlinedSizesOf(theme)[size] : void 0, colors.container, shadowOf(variant, feedback, isDisabled, theme), shaped.corner, feedback.ring, style);
370
+ let t20;
371
+ if ($[59] !== shaped.corner) {
372
+ t20 = composeStyles(buttonStyles.clip, shaped.corner);
373
+ $[59] = shaped.corner;
374
+ $[60] = t20;
375
+ } else t20 = $[60];
376
+ let t21;
377
+ if ($[61] !== feedback.layer || $[62] !== t20) {
378
+ t21 = /* @__PURE__ */ jsx(Animated.View, {
379
+ style: t20,
336
380
  children: feedback.layer
337
381
  });
338
- $[46] = feedback.layer;
339
- $[47] = t18;
340
- $[48] = t19;
341
- } else t19 = $[48];
342
- const t20 = icon === void 0 ? null : /* @__PURE__ */ jsx(PendingContent, {
382
+ $[61] = feedback.layer;
383
+ $[62] = t20;
384
+ $[63] = t21;
385
+ } else t21 = $[63];
386
+ const t22 = icon === void 0 ? null : /* @__PURE__ */ jsx(PendingContent, {
343
387
  isPending: pending,
344
388
  children: /* @__PURE__ */ jsx(IconStyleContext, {
345
389
  value: iconStyleOf(colors.content, size),
346
390
  children: icon
347
391
  })
348
392
  });
349
- const t21 = children === void 0 ? null : /* @__PURE__ */ jsx(Text, {
393
+ const t23 = children === void 0 ? null : /* @__PURE__ */ jsx(Text, {
350
394
  ...pending ? CONCEALED : void 0,
351
395
  style: composeStyles(role, styles.label, colors.label, pending ? pendingStyles.hidden : void 0),
352
396
  children
353
397
  });
354
- let t22;
355
- if ($[49] !== colors || $[50] !== fontScale || $[51] !== pending || $[52] !== ringLabel || $[53] !== size || $[54] !== theme.typography) {
356
- t22 = pending ? /* @__PURE__ */ jsx(PendingRing, {
398
+ let t24;
399
+ if ($[64] !== colors || $[65] !== fontScale || $[66] !== pending || $[67] !== ringLabel || $[68] !== size || $[69] !== theme.typography) {
400
+ t24 = pending ? /* @__PURE__ */ jsx(PendingRing, {
357
401
  color: colors.content,
358
402
  diameter: theme.typography[`${ROLES[size]}Size`] * fontScale,
359
403
  label: ringLabel
360
404
  }) : null;
361
- $[49] = colors;
362
- $[50] = fontScale;
363
- $[51] = pending;
364
- $[52] = ringLabel;
365
- $[53] = size;
366
- $[54] = theme.typography;
367
- $[55] = t22;
368
- } else t22 = $[55];
369
- let t23;
370
- if ($[56] !== T0 || $[57] !== feedback.handlers || $[58] !== isDisabled || $[59] !== props || $[60] !== shaped.onLayout || $[61] !== t10 || $[62] !== t11 || $[63] !== t13 || $[64] !== t15 || $[65] !== t16 || $[66] !== t17 || $[67] !== t19 || $[68] !== t20 || $[69] !== t21 || $[70] !== t22 || $[71] !== t9) {
371
- t23 = /* @__PURE__ */ jsxs(T0, {
372
- role: t9,
373
- ...t10,
374
- ...t11,
375
- ...props,
405
+ $[64] = colors;
406
+ $[65] = fontScale;
407
+ $[66] = pending;
408
+ $[67] = ringLabel;
409
+ $[68] = size;
410
+ $[69] = theme.typography;
411
+ $[70] = t24;
412
+ } else t24 = $[70];
413
+ let t25;
414
+ if ($[71] !== T0 || $[72] !== feedback.handlers || $[73] !== isDisabled || $[74] !== props || $[75] !== shaped.onLayout || $[76] !== t11 || $[77] !== t12 || $[78] !== t13 || $[79] !== t15 || $[80] !== t17 || $[81] !== t18 || $[82] !== t19 || $[83] !== t21 || $[84] !== t22 || $[85] !== t23 || $[86] !== t24 || $[87] !== triggerProps) {
415
+ t25 = /* @__PURE__ */ jsxs(T0, {
416
+ role: t11,
376
417
  ...t12,
418
+ ...t13,
419
+ ...props,
420
+ ...triggerProps,
421
+ ...t14,
377
422
  disabled: isDisabled,
378
- hitSlop: t13,
379
- onLayout: t14,
380
- onLongPress: t15,
381
- onPress: t16,
382
- style: t17,
423
+ hitSlop: t15,
424
+ onLayout: t16,
425
+ onLongPress: t17,
426
+ onPress: t18,
427
+ style: t19,
383
428
  children: [
384
- t19,
385
- t20,
386
429
  t21,
387
- t22
430
+ t22,
431
+ t23,
432
+ t24
388
433
  ]
389
434
  });
390
- $[56] = T0;
391
- $[57] = feedback.handlers;
392
- $[58] = isDisabled;
393
- $[59] = props;
394
- $[60] = shaped.onLayout;
395
- $[61] = t10;
396
- $[62] = t11;
397
- $[63] = t13;
398
- $[64] = t15;
399
- $[65] = t16;
400
- $[66] = t17;
401
- $[67] = t19;
402
- $[68] = t20;
403
- $[69] = t21;
404
- $[70] = t22;
405
- $[71] = t9;
406
- $[72] = t23;
407
- } else t23 = $[72];
408
- return t23;
435
+ $[71] = T0;
436
+ $[72] = feedback.handlers;
437
+ $[73] = isDisabled;
438
+ $[74] = props;
439
+ $[75] = shaped.onLayout;
440
+ $[76] = t11;
441
+ $[77] = t12;
442
+ $[78] = t13;
443
+ $[79] = t15;
444
+ $[80] = t17;
445
+ $[81] = t18;
446
+ $[82] = t19;
447
+ $[83] = t21;
448
+ $[84] = t22;
449
+ $[85] = t23;
450
+ $[86] = t24;
451
+ $[87] = triggerProps;
452
+ $[88] = t25;
453
+ } else t25 = $[88];
454
+ return t25;
409
455
  }
410
456
  function iconStyleOf(color, size) {
411
457
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","PressableProps","StyleProp","TextStyle","View","ViewStyle","AnimatedStyle","Text","NativeText","StyleSheet","useWindowDimensions","Animated","ButtonLinkForm","ButtonPressForm","ButtonToggleForm","PaletteName","IconStyle","ResolvedTheme","TypeRole","AnimatedPressable","buttonStyles","HEIGHTS","OUTLINE_WIDTHS","PRESSED_CORNERS","toggleState","useButtonAction","useCorner","palettesOf","BUSY","CONCEALED","PendingContent","PendingRing","pendingStyles","usePending","IconStyleContext","hitSlop","usePressFeedback","useTheme","composeStyles","themedStyles","useTypeRole","ButtonForm","variant","Exclude","ButtonVariant","ButtonProps","Omit","children","disableRipple","icon","isDisabled","ref","shape","ButtonShape","size","ButtonSize","style","ToggleVariant","DISABLED","Readonly","Record","elevated","filled","outlined","text","tonal","ICON_SIZES","lg","md","xl","xs","xxl","ROLES","SQUARE_CORNERS","const","TOGGLE_PALETTES","selected","unselected","styles","create","base","alignItems","flexDirection","justifyContent","maxWidth","flexShrink","label","textAlign","inlinePaddings","spacing","shadowsOf","shadows","elevation1","boxShadow","elevation2","sizesOf","theme","sizing","inline","gap","sm","minHeight","controlLg","paddingHorizontal","paddingVertical","controlSm","controlXl","controlXs","controlXxl","outlinedSizesOf","borderWidth","Button","t0","$","_c","defaultSelected","href","isSelected","onBlur","onChange","onFocus","onHoverIn","onHoverOut","onLayout","onLongPress","onPress","onPressIn","onPressOut","ownHitSlop","pendingLabel","props","slot","t1","t2","t3","t4","t5","t6","type","isPending","undefined","role","fontScale","pending","ringLabel","isToggle","t7","t8","action","colors","feedback","color","content","disabled","radii","resting","pill","shaped","pressed","T0","t9","t10","t11","t12","handlers","t13","t14","t15","t16","t17","container","shadowOf","corner","ring","t18","clip","t19","layer","t20","iconStyleOf","t21","hidden","t22","typography","t23","hovered","lifted","_c","NativeText"],"sources":["../../../src/components/button/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type {\n PressableProps,\n StyleProp,\n TextStyle,\n View,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\n\nimport {\n Text as NativeText,\n StyleSheet,\n useWindowDimensions,\n} from 'react-native'\nimport Animated from 'react-native-reanimated'\n\nimport type {\n ButtonLinkForm,\n ButtonPressForm,\n ButtonToggleForm,\n} from '../../button'\nimport type { PaletteName } from '../../button/palettes'\nimport type { IconStyle } from '../../glyphs/icon-style'\nimport type { ResolvedTheme } from '../../theme/scope'\nimport type { TypeRole } from '../../typography/roles'\n\nimport {\n AnimatedPressable,\n buttonStyles,\n HEIGHTS,\n OUTLINE_WIDTHS,\n PRESSED_CORNERS,\n toggleState,\n useButtonAction,\n useCorner,\n} from '../../button'\nimport { palettesOf } from '../../button/palettes'\nimport {\n BUSY,\n CONCEALED,\n PendingContent,\n PendingRing,\n pendingStyles,\n usePending,\n} from '../../button/pending'\nimport { IconStyleContext } from '../../glyphs/icon-style'\nimport { hitSlop, usePressFeedback } from '../../press'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\n\n// The buttons spec page's five colour styles, five sizes and two shapes, as\n// kanso-ui's Button draws them. The variant carries colour and the size\n// carries geometry, so the two never argue: the padding belongs to the size\n// alone, and a text button is as wide as a filled one at the same size.\n//\n// The colour pairs are the page's: filled on primary, tonal on secondary\n// container, outlined with an outline-variant rule and an on-surface-variant\n// label, text on primary, and elevated on surface container low with a\n// primary label. Elevated is the one variant whose shadow is part of it: it\n// rests at elevation 1, rises to 2 under a pointer and settles back while\n// pressed, where filled and tonal rest flat and lift to 1 under a pointer\n// only. The shadow is the theme's `boxShadow` value, which React Native draws\n// on iOS and Android as React Native Web draws it in a browser.\n//\n// The state layers, the ripple and the focus ring are src/press's, drawn in\n// the label's colour over the container, as on web.\n//\n// **Disabled is the page's colour at an opacity, translucent.** A container\n// is on-surface at the `disabledContainer` opacity, and the label on-surface\n// at `disabledContent`, over whatever the button sits on rather than mixed\n// over the surface role as web's are; src/button/palettes.ts gives the\n// reason. Disabled drops the shadow, since a shadow says a control is there\n// to press.\n//\n// **A toggle is the same button reporting a state.** Given `isSelected`,\n// `defaultSelected` or `onChange` it takes the page's second pair of colour\n// roles for its variant: a filled toggle rests on surface container with an\n// on-surface-variant label and takes primary once selected, a tonal one moves\n// from the secondary container pair to secondary, an elevated one keeps its\n// low surface until it takes primary, and an outlined one swaps its rule for\n// the inverse surface pair. The page gives text no pair, so a text button\n// given those props stays a plain one.\n//\n// **A pending button keeps its place.** Given `isPending` the label and the\n// icon are hidden where they stand, so the button keeps its width, and an\n// indeterminate ring is drawn over them in the label's colour, at the label's\n// type size times the device's text size, which is what web's `1em` reads.\n// The button keeps its focus and its ring and takes no press, so a double tap\n// cannot run the action twice: neither `onPress` nor `onLongPress` is called,\n// and a toggle keeps its state until it clears. It reports itself busy, and\n// src/button's pending.tsx says the change out loud.\n//\n// **The corner is a shape the button morphs between.** `round` rests as the\n// pill and `square` at the size's square corner: 12dp up to the page's S,\n// 16dp at M and 28dp above. A press tightens either to the size's pressed\n// corner, 8dp, 12dp or 16dp, and a toggle trades its shape for the other\n// once selected. The corner eases through Reanimated, as src/button's\n// `useCorner` sets out.\n//\n// The forms, the toggle's state, what a press does and the corner's ease are\n// src/button's, shared with IconButton.\n\ntype ButtonForm =\n | ButtonLinkForm\n | ButtonPressForm\n | (ButtonToggleForm & {\n /**\n * A toggle takes any variant but `text`, which the page gives no\n * selected colours.\n */\n readonly variant?: Exclude<ButtonVariant, 'text'>\n })\n\ntype ButtonProps = ButtonForm &\n Omit<PressableProps, 'children' | 'disabled' | 'style'> & {\n /** The label. */\n readonly children?: ReactNode\n /**\n * Draws no press ripple. The state layer is unaffected.\n * @default false\n */\n readonly disableRipple?: boolean\n /**\n * An icon before the label, at the page's icon size for the button's\n * size: 20dp at `xs` and `md`, 24dp at `lg`, 32dp at `xl` and 40dp at\n * `xxl`. The slot hands it the label's colour and that size through\n * `useIconStyle()`.\n */\n readonly icon?: ReactNode\n /**\n * Draws the button disabled, and takes no presses.\n * @default false\n */\n readonly isDisabled?: boolean\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * The corner the button rests at: `round` is the pill, `square` the\n * page's rounded rectangle, 12dp up to `md`, 16dp at `lg` and 28dp above.\n * Either tightens while pressed, and a toggle trades one for the other\n * once selected.\n * @default 'round'\n */\n readonly shape?: ButtonShape\n /**\n * Control height: `xs` 32dp, `md` 40dp, `lg` 56dp, `xl` 96dp, `xxl` 136dp,\n * the buttons spec page's XS, S, M, L and XL, each with its own padding\n * and type role. `md` is the page's default. The height is a floor, so a\n * label that wraps, or that the device's text size enlarges, grows the\n * button rather than running out of it.\n * @default 'md'\n */\n readonly size?: ButtonSize\n readonly style?: StyleProp<ViewStyle>\n /**\n * How much weight the button pulls. `filled` and `tonal` carry a container\n * of their own; `outlined` and `text` sit on the page; `elevated` sits on\n * a low surface and lifts off it with a shadow, for a button that has to\n * separate from a busy background rather than from the page.\n * @default 'filled'\n */\n readonly variant?: ButtonVariant\n }\n\ntype ButtonShape = 'round' | 'square'\n\ntype ButtonSize = 'lg' | 'md' | 'xl' | 'xs' | 'xxl'\n\ntype ButtonVariant = 'elevated' | 'filled' | 'outlined' | 'text' | 'tonal'\n\ntype ToggleVariant = Exclude<ButtonVariant, 'text'>\n\n// The disabled container each variant draws. Filled, tonal and elevated share\n// one, which is the page's single disabled container for all three.\nconst DISABLED: Readonly<Record<ButtonVariant, PaletteName>> = {\n elevated: 'filledDisabled',\n filled: 'filledDisabled',\n outlined: 'outlinedDisabled',\n text: 'textDisabled',\n tonal: 'filledDisabled',\n}\n\n// The icon each size draws, from the page's size token sets. Literals, as on\n// web: they are icon sizes, which the theme has no scale for.\nconst ICON_SIZES: Readonly<Record<ButtonSize, number>> = {\n lg: 24,\n md: 20,\n xl: 32,\n xs: 20,\n xxl: 40,\n}\n\n// The type role each size sets its label in, taken whole: label-large for the\n// two small sizes, then title-medium, headline-small and headline-large.\nconst ROLES: Readonly<Record<ButtonSize, TypeRole>> = {\n lg: 'titleMedium',\n md: 'labelLarge',\n xl: 'headlineSmall',\n xs: 'labelLarge',\n xxl: 'headlineLarge',\n}\n\n// The square corner each size rests at, and a round toggle takes once\n// selected.\nconst SQUARE_CORNERS = {\n lg: 'lg',\n md: 'md',\n xl: 'xl',\n xs: 'md',\n xxl: 'xl',\n} as const satisfies Record<ButtonSize, keyof ResolvedTheme['radii']>\n\n// Which container a toggle draws, selected and not.\nconst TOGGLE_PALETTES: Readonly<\n Record<\n ToggleVariant,\n Readonly<Record<'selected' | 'unselected', PaletteName>>\n >\n> = {\n elevated: { selected: 'elevatedToggleSelected', unselected: 'elevated' },\n filled: { selected: 'filledToggleSelected', unselected: 'filledToggle' },\n outlined: { selected: 'outlinedToggleSelected', unselected: 'outlined' },\n tonal: { selected: 'tonalToggleSelected', unselected: 'tonal' },\n}\n\nconst styles = StyleSheet.create({\n // The label sits in the middle of a button wider than it, one stretched by\n // a column or given a width, as the page draws every button, and a button\n // is never wider than what holds it.\n base: {\n alignItems: 'center',\n flexDirection: 'row',\n justifyContent: 'center',\n maxWidth: '100%',\n },\n icon: {\n alignItems: 'center',\n flexShrink: 0,\n justifyContent: 'center',\n },\n // A label too long for the row wraps, its lines centred, and grows the\n // button with it.\n label: {\n flexShrink: 1,\n textAlign: 'center',\n },\n})\n\n// Each size's inline padding. The two largest are literals: 48 and 64 are not\n// steps of the spacing scale, and the scale should not grow to fit one\n// component. `xs` pads 12 a side, the extra-small token set's leading and\n// trailing space.\nfunction inlinePaddings({\n spacing,\n}: ResolvedTheme): Readonly<Record<ButtonSize, number>> {\n return { lg: spacing.xl, md: spacing.lg, xl: 48, xs: spacing.md, xxl: 64 }\n}\n\nconst shadowsOf = themedStyles(({ shadows }) =>\n StyleSheet.create({\n elevation1: { boxShadow: shadows.elevation1 },\n elevation2: { boxShadow: shadows.elevation2 },\n }),\n)\n\n// The five sizes, from the page's size token sets: the container height, the\n// padding, and the gap before an icon. The height is a floor rather than a\n// fixed size, and the block padding is what keeps a wrapped label off the\n// pill's edge: a step short of a single line's own inset, so a label on one\n// line still draws exactly the page's height.\nconst sizesOf = themedStyles((theme) => {\n const { sizing, spacing } = theme\n const inline = inlinePaddings(theme)\n\n return StyleSheet.create({\n lg: {\n gap: spacing.sm,\n minHeight: sizing.controlLg,\n paddingHorizontal: inline.lg,\n paddingVertical: spacing.md,\n },\n md: {\n gap: spacing.sm,\n minHeight: sizing.controlSm,\n paddingHorizontal: inline.md,\n paddingVertical: spacing.sm,\n },\n xl: {\n gap: spacing.md,\n minHeight: sizing.controlXl,\n paddingHorizontal: inline.xl,\n paddingVertical: spacing.xl,\n },\n xs: {\n gap: spacing.sm,\n minHeight: sizing.controlXs,\n paddingHorizontal: inline.xs,\n paddingVertical: spacing.xs,\n },\n xxl: {\n gap: spacing.lg,\n minHeight: sizing.controlXxl,\n paddingHorizontal: inline.xxl,\n paddingVertical: spacing.xxl,\n },\n })\n})\n\n// The outlined button draws its rule inside the width the other variants\n// take, as the page's buttons do: the padding gives up what the rule takes,\n// so an outlined and a filled button with one label are one width.\nconst outlinedSizesOf = themedStyles((theme) => {\n const inline = inlinePaddings(theme)\n\n function outlined(size: ButtonSize): ViewStyle {\n return {\n borderWidth: OUTLINE_WIDTHS[size],\n paddingHorizontal: inline[size] - OUTLINE_WIDTHS[size],\n }\n }\n\n return StyleSheet.create({\n lg: outlined('lg'),\n md: outlined('md'),\n xl: outlined('xl'),\n xs: outlined('xs'),\n xxl: outlined('xxl'),\n })\n})\n\n/**\n * The design's button, at five emphasis levels and five control heights,\n * round or square, with web's props and values. Given `href` it is a link with\n * the same appearance, and given `isSelected`, `defaultSelected` or\n * `onChange` it is a toggle, which reports its state to a screen reader and\n * draws the page's second pair of colour roles for its variant.\n *\n * ```tsx\n * <Button defaultSelected variant=\"tonal\">\n * Label\n * </Button>\n * ```\n *\n * A column stretches a button across it, as it does any view, and as a flex\n * column does a button on web; a column that should hold its buttons at their\n * labels' width says so with `alignItems`.\n *\n * The two sizes under 48dp tall, `xs` and `md`, take presses over a 48dp\n * target through `hitSlop`, which a `hitSlop` of the call site's own replaces.\n * `style`, `ref` and `testID` land on the `Pressable`.\n */\nfunction Button({\n children,\n defaultSelected,\n disableRipple = false,\n hitSlop: ownHitSlop,\n href,\n icon,\n isDisabled = false,\n isPending = false,\n isSelected,\n onBlur,\n onChange,\n onFocus,\n onHoverIn,\n onHoverOut,\n onLayout,\n onLongPress,\n onPress,\n onPressIn,\n onPressOut,\n pendingLabel,\n shape = 'round',\n size = 'md',\n slot,\n style,\n type,\n variant = 'filled',\n ...props\n}: ButtonProps) {\n const theme = useTheme()\n const role = useTypeRole(ROLES[size])\n const { fontScale } = useWindowDimensions()\n // A link is never pending, as on web, where its props have no such state.\n const pending = href === undefined && isPending\n const ringLabel = usePending(pending, pendingLabel)\n\n // The three props that make this a toggle, read as web reads them. The\n // types keep them off a `text` button; the check here keeps a call site\n // that slipped past them a plain button.\n const isToggle =\n variant !== 'text' &&\n (defaultSelected !== undefined ||\n isSelected !== undefined ||\n onChange !== undefined)\n const action = useButtonAction({\n defaultSelected,\n href,\n isSelected,\n isToggle,\n onChange,\n onPress,\n slot: slot ?? 'default',\n type,\n })\n const colors =\n palettesOf(theme)[\n isDisabled\n ? DISABLED[variant]\n : variant !== 'text' && isToggle\n ? TOGGLE_PALETTES[variant][\n action.selected ? 'selected' : 'unselected'\n ]\n : variant\n ]\n\n const feedback = usePressFeedback({\n color: colors.content,\n disabled: isDisabled,\n disableRipple,\n onBlur,\n onFocus,\n onHoverIn,\n onHoverOut,\n onPressIn,\n onPressOut,\n pending,\n })\n\n const { radii } = theme\n const resting =\n (shape === 'square') !== action.selected\n ? radii[SQUARE_CORNERS[size]]\n : radii.pill\n const shaped = useCorner(\n feedback.pressed ? radii[PRESSED_CORNERS[size]] : resting,\n onLayout,\n )\n\n return (\n <AnimatedPressable\n role={href === undefined ? 'button' : 'link'}\n {...(isToggle ? toggleState(action.selected) : undefined)}\n {...(pending ? BUSY : undefined)}\n {...props}\n {...feedback.handlers}\n disabled={isDisabled}\n hitSlop={ownHitSlop ?? hitSlop(theme.sizing[HEIGHTS[size]])}\n onLayout={shaped.onLayout}\n onLongPress={pending ? undefined : onLongPress}\n onPress={pending ? undefined : action.onPress}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.base,\n sizesOf(theme)[size],\n variant === 'outlined' ? outlinedSizesOf(theme)[size] : undefined,\n colors.container,\n shadowOf(variant, feedback, isDisabled, theme),\n shaped.corner,\n feedback.ring,\n style,\n )}\n >\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n buttonStyles.clip,\n shaped.corner,\n )}\n >\n {feedback.layer}\n </Animated.View>\n {icon === undefined ? null : (\n <PendingContent isPending={pending}>\n <IconStyleContext value={iconStyleOf(colors.content, size)}>\n {icon}\n </IconStyleContext>\n </PendingContent>\n )}\n {children === undefined ? null : (\n <NativeText\n {...(pending ? CONCEALED : undefined)}\n style={composeStyles<TextStyle>(\n role,\n styles.label,\n colors.label,\n pending ? pendingStyles.hidden : undefined,\n )}\n >\n {children}\n </NativeText>\n )}\n {pending ? (\n <PendingRing\n color={colors.content}\n diameter={theme.typography[`${ROLES[size]}Size`] * fontScale}\n label={ringLabel}\n />\n ) : null}\n </AnimatedPressable>\n )\n}\n\nfunction iconStyleOf(color: string, size: ButtonSize): IconStyle {\n return { color, size: ICON_SIZES[size] }\n}\n\n// The shadow a variant draws in its state: elevated rests at 1 and rises to 2\n// under a pointer, filled and tonal rest flat and rise to 1, and a press\n// brings each back to where it rests.\nfunction shadowOf(\n variant: ButtonVariant,\n {\n hovered,\n pressed,\n }: { readonly hovered: boolean; readonly pressed: boolean },\n isDisabled: boolean,\n theme: ResolvedTheme,\n): undefined | ViewStyle {\n const lifted = hovered && !pressed\n\n if (isDisabled) {\n return undefined\n }\n\n if (variant === 'elevated') {\n return shadowsOf(theme)[lifted ? 'elevation2' : 'elevation1']\n }\n\n return (variant === 'filled' || variant === 'tonal') && lifted\n ? shadowsOf(theme).elevation1\n : undefined\n}\n\nexport { Button }\nexport type { ButtonProps, ButtonShape, ButtonSize, ButtonVariant }\n"],"mappings":";;;;;;;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extStyle","View","ViewStyle","AnimatedStyle","Text","NativeText","StyleSheet","useWindowDimensions","Animated","ButtonLinkForm","ButtonPressForm","ButtonToggleForm","PaletteName","IconStyle","ResolvedTheme","TypeRole","AnimatedPressable","buttonStyles","HEIGHTS","OUTLINE_WIDTHS","PRESSED_CORNERS","toggleState","useButtonAction","useCorner","useSlotTrigger","palettesOf","BUSY","CONCEALED","PendingContent","PendingRing","pendingStyles","usePending","IconStyleContext","hitSlop","usePressFeedback","useTheme","composeStyles","themedStyles","useTypeRole","ButtonForm","variant","Exclude","ButtonVariant","ButtonProps","Omit","children","disableRipple","icon","isDisabled","ref","shape","ButtonShape","size","ButtonSize","style","ToggleVariant","DISABLED","Readonly","Record","elevated","filled","outlined","text","tonal","ICON_SIZES","lg","md","xl","xs","xxl","ROLES","SQUARE_CORNERS","const","TOGGLE_PALETTES","selected","unselected","styles","create","base","alignItems","flexDirection","justifyContent","maxWidth","flexShrink","label","textAlign","inlinePaddings","spacing","shadowsOf","shadows","elevation1","boxShadow","elevation2","sizesOf","theme","sizing","inline","gap","sm","minHeight","controlLg","paddingHorizontal","paddingVertical","controlSm","controlXl","controlXs","controlXxl","outlinedSizesOf","borderWidth","Button","t0","$","_c","defaultSelected","delayLongPress","href","isSelected","onBlur","onChange","onFocus","onHoverIn","onHoverOut","onLayout","onLongPress","onPress","onPressIn","onPressOut","ownHitSlop","pendingLabel","props","slot","t1","t2","t3","t4","t5","t6","type","isPending","undefined","role","fontScale","pending","ringLabel","isToggle","t7","t8","action","t9","t10","hoverIn","hoverOut","longPress","triggerProps","colors","feedback","color","content","disabled","radii","resting","pill","shaped","pressed","T0","t11","t12","t13","t14","handlers","t15","t16","t17","t18","t19","container","shadowOf","corner","ring","t20","clip","t21","layer","t22","iconStyleOf","t23","hidden","t24","typography","t25","hovered","lifted","_c","NativeText"],"sources":["../../../src/components/button/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type {\n PressableProps,\n StyleProp,\n TextStyle,\n View,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\n\nimport {\n Text as NativeText,\n StyleSheet,\n useWindowDimensions,\n} from 'react-native'\nimport Animated from 'react-native-reanimated'\n\nimport type {\n ButtonLinkForm,\n ButtonPressForm,\n ButtonToggleForm,\n} from '../../button'\nimport type { PaletteName } from '../../button/palettes'\nimport type { IconStyle } from '../../glyphs/icon-style'\nimport type { ResolvedTheme } from '../../theme/scope'\nimport type { TypeRole } from '../../typography/roles'\n\nimport {\n AnimatedPressable,\n buttonStyles,\n HEIGHTS,\n OUTLINE_WIDTHS,\n PRESSED_CORNERS,\n toggleState,\n useButtonAction,\n useCorner,\n useSlotTrigger,\n} from '../../button'\nimport { palettesOf } from '../../button/palettes'\nimport {\n BUSY,\n CONCEALED,\n PendingContent,\n PendingRing,\n pendingStyles,\n usePending,\n} from '../../button/pending'\nimport { IconStyleContext } from '../../glyphs/icon-style'\nimport { hitSlop, usePressFeedback } from '../../press'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\n\n// The buttons spec page's five colour styles, five sizes and two shapes, as\n// kanso-ui's Button draws them. The variant carries colour and the size\n// carries geometry, so the two never argue: the padding belongs to the size\n// alone, and a text button is as wide as a filled one at the same size.\n//\n// The colour pairs are the page's: filled on primary, tonal on secondary\n// container, outlined with an outline-variant rule and an on-surface-variant\n// label, text on primary, and elevated on surface container low with a\n// primary label. Elevated is the one variant whose shadow is part of it: it\n// rests at elevation 1, rises to 2 under a pointer and settles back while\n// pressed, where filled and tonal rest flat and lift to 1 under a pointer\n// only. The shadow is the theme's `boxShadow` value, which React Native draws\n// on iOS and Android as React Native Web draws it in a browser.\n//\n// The state layers, the ripple and the focus ring are src/press's, drawn in\n// the label's colour over the container, as on web.\n//\n// **Disabled is the page's colour at an opacity, translucent.** A container\n// is on-surface at the `disabledContainer` opacity, and the label on-surface\n// at `disabledContent`, over whatever the button sits on rather than mixed\n// over the surface role as web's are; src/button/palettes.ts gives the\n// reason. Disabled drops the shadow, since a shadow says a control is there\n// to press.\n//\n// **A toggle is the same button reporting a state.** Given `isSelected`,\n// `defaultSelected` or `onChange` it takes the page's second pair of colour\n// roles for its variant: a filled toggle rests on surface container with an\n// on-surface-variant label and takes primary once selected, a tonal one moves\n// from the secondary container pair to secondary, an elevated one keeps its\n// low surface until it takes primary, and an outlined one swaps its rule for\n// the inverse surface pair. The page gives text no pair, so a text button\n// given those props stays a plain one.\n//\n// **A pending button keeps its place.** Given `isPending` the label and the\n// icon are hidden where they stand, so the button keeps its width, and an\n// indeterminate ring is drawn over them in the label's colour, at the label's\n// type size times the device's text size, which is what web's `1em` reads.\n// The button keeps its focus and its ring and takes no press, so a double tap\n// cannot run the action twice: neither `onPress` nor `onLongPress` is called,\n// and a toggle keeps its state until it clears. It reports itself busy, and\n// src/button's pending.tsx says the change out loud.\n//\n// **The corner is a shape the button morphs between.** `round` rests as the\n// pill and `square` at the size's square corner: 12dp up to the page's S,\n// 16dp at M and 28dp above. A press tightens either to the size's pressed\n// corner, 8dp, 12dp or 16dp, and a toggle trades its shape for the other\n// once selected. The corner eases through Reanimated, as src/button's\n// `useCorner` sets out.\n//\n// The forms, the toggle's state, what a press does and the corner's ease are\n// src/button's, shared with IconButton.\n\ntype ButtonForm =\n | ButtonLinkForm\n | ButtonPressForm\n | (ButtonToggleForm & {\n /**\n * A toggle takes any variant but `text`, which the page gives no\n * selected colours.\n */\n readonly variant?: Exclude<ButtonVariant, 'text'>\n })\n\ntype ButtonProps = ButtonForm &\n Omit<PressableProps, 'children' | 'disabled' | 'style'> & {\n /** The label. */\n readonly children?: ReactNode\n /**\n * Draws no press ripple. The state layer is unaffected.\n * @default false\n */\n readonly disableRipple?: boolean\n /**\n * An icon before the label, at the page's icon size for the button's\n * size: 20dp at `xs` and `md`, 24dp at `lg`, 32dp at `xl` and 40dp at\n * `xxl`. The slot hands it the label's colour and that size through\n * `useIconStyle()`.\n */\n readonly icon?: ReactNode\n /**\n * Draws the button disabled, and takes no presses.\n * @default false\n */\n readonly isDisabled?: boolean\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * The corner the button rests at: `round` is the pill, `square` the\n * page's rounded rectangle, 12dp up to `md`, 16dp at `lg` and 28dp above.\n * Either tightens while pressed, and a toggle trades one for the other\n * once selected.\n * @default 'round'\n */\n readonly shape?: ButtonShape\n /**\n * Control height: `xs` 32dp, `md` 40dp, `lg` 56dp, `xl` 96dp, `xxl` 136dp,\n * the buttons spec page's XS, S, M, L and XL, each with its own padding\n * and type role. `md` is the page's default. The height is a floor, so a\n * label that wraps, or that the device's text size enlarges, grows the\n * button rather than running out of it.\n * @default 'md'\n */\n readonly size?: ButtonSize\n readonly style?: StyleProp<ViewStyle>\n /**\n * How much weight the button pulls. `filled` and `tonal` carry a container\n * of their own; `outlined` and `text` sit on the page; `elevated` sits on\n * a low surface and lifts off it with a shadow, for a button that has to\n * separate from a busy background rather than from the page.\n * @default 'filled'\n */\n readonly variant?: ButtonVariant\n }\n\ntype ButtonShape = 'round' | 'square'\n\ntype ButtonSize = 'lg' | 'md' | 'xl' | 'xs' | 'xxl'\n\ntype ButtonVariant = 'elevated' | 'filled' | 'outlined' | 'text' | 'tonal'\n\ntype ToggleVariant = Exclude<ButtonVariant, 'text'>\n\n// The disabled container each variant draws. Filled, tonal and elevated share\n// one, which is the page's single disabled container for all three.\nconst DISABLED: Readonly<Record<ButtonVariant, PaletteName>> = {\n elevated: 'filledDisabled',\n filled: 'filledDisabled',\n outlined: 'outlinedDisabled',\n text: 'textDisabled',\n tonal: 'filledDisabled',\n}\n\n// The icon each size draws, from the page's size token sets. Literals, as on\n// web: they are icon sizes, which the theme has no scale for.\nconst ICON_SIZES: Readonly<Record<ButtonSize, number>> = {\n lg: 24,\n md: 20,\n xl: 32,\n xs: 20,\n xxl: 40,\n}\n\n// The type role each size sets its label in, taken whole: label-large for the\n// two small sizes, then title-medium, headline-small and headline-large.\nconst ROLES: Readonly<Record<ButtonSize, TypeRole>> = {\n lg: 'titleMedium',\n md: 'labelLarge',\n xl: 'headlineSmall',\n xs: 'labelLarge',\n xxl: 'headlineLarge',\n}\n\n// The square corner each size rests at, and a round toggle takes once\n// selected.\nconst SQUARE_CORNERS = {\n lg: 'lg',\n md: 'md',\n xl: 'xl',\n xs: 'md',\n xxl: 'xl',\n} as const satisfies Record<ButtonSize, keyof ResolvedTheme['radii']>\n\n// Which container a toggle draws, selected and not.\nconst TOGGLE_PALETTES: Readonly<\n Record<\n ToggleVariant,\n Readonly<Record<'selected' | 'unselected', PaletteName>>\n >\n> = {\n elevated: { selected: 'elevatedToggleSelected', unselected: 'elevated' },\n filled: { selected: 'filledToggleSelected', unselected: 'filledToggle' },\n outlined: { selected: 'outlinedToggleSelected', unselected: 'outlined' },\n tonal: { selected: 'tonalToggleSelected', unselected: 'tonal' },\n}\n\nconst styles = StyleSheet.create({\n // The label sits in the middle of a button wider than it, one stretched by\n // a column or given a width, as the page draws every button, and a button\n // is never wider than what holds it.\n base: {\n alignItems: 'center',\n flexDirection: 'row',\n justifyContent: 'center',\n maxWidth: '100%',\n },\n icon: {\n alignItems: 'center',\n flexShrink: 0,\n justifyContent: 'center',\n },\n // A label too long for the row wraps, its lines centred, and grows the\n // button with it.\n label: {\n flexShrink: 1,\n textAlign: 'center',\n },\n})\n\n// Each size's inline padding. The two largest are literals: 48 and 64 are not\n// steps of the spacing scale, and the scale should not grow to fit one\n// component. `xs` pads 12 a side, the extra-small token set's leading and\n// trailing space.\nfunction inlinePaddings({\n spacing,\n}: ResolvedTheme): Readonly<Record<ButtonSize, number>> {\n return { lg: spacing.xl, md: spacing.lg, xl: 48, xs: spacing.md, xxl: 64 }\n}\n\nconst shadowsOf = themedStyles(({ shadows }) =>\n StyleSheet.create({\n elevation1: { boxShadow: shadows.elevation1 },\n elevation2: { boxShadow: shadows.elevation2 },\n }),\n)\n\n// The five sizes, from the page's size token sets: the container height, the\n// padding, and the gap before an icon. The height is a floor rather than a\n// fixed size, and the block padding is what keeps a wrapped label off the\n// pill's edge: a step short of a single line's own inset, so a label on one\n// line still draws exactly the page's height.\nconst sizesOf = themedStyles((theme) => {\n const { sizing, spacing } = theme\n const inline = inlinePaddings(theme)\n\n return StyleSheet.create({\n lg: {\n gap: spacing.sm,\n minHeight: sizing.controlLg,\n paddingHorizontal: inline.lg,\n paddingVertical: spacing.md,\n },\n md: {\n gap: spacing.sm,\n minHeight: sizing.controlSm,\n paddingHorizontal: inline.md,\n paddingVertical: spacing.sm,\n },\n xl: {\n gap: spacing.md,\n minHeight: sizing.controlXl,\n paddingHorizontal: inline.xl,\n paddingVertical: spacing.xl,\n },\n xs: {\n gap: spacing.sm,\n minHeight: sizing.controlXs,\n paddingHorizontal: inline.xs,\n paddingVertical: spacing.xs,\n },\n xxl: {\n gap: spacing.lg,\n minHeight: sizing.controlXxl,\n paddingHorizontal: inline.xxl,\n paddingVertical: spacing.xxl,\n },\n })\n})\n\n// The outlined button draws its rule inside the width the other variants\n// take, as the page's buttons do: the padding gives up what the rule takes,\n// so an outlined and a filled button with one label are one width.\nconst outlinedSizesOf = themedStyles((theme) => {\n const inline = inlinePaddings(theme)\n\n function outlined(size: ButtonSize): ViewStyle {\n return {\n borderWidth: OUTLINE_WIDTHS[size],\n paddingHorizontal: inline[size] - OUTLINE_WIDTHS[size],\n }\n }\n\n return StyleSheet.create({\n lg: outlined('lg'),\n md: outlined('md'),\n xl: outlined('xl'),\n xs: outlined('xs'),\n xxl: outlined('xxl'),\n })\n})\n\n/**\n * The design's button, at five emphasis levels and five control heights,\n * round or square, with web's props and values. Given `href` it is a link with\n * the same appearance, and given `isSelected`, `defaultSelected` or\n * `onChange` it is a toggle, which reports its state to a screen reader and\n * draws the page's second pair of colour roles for its variant.\n *\n * ```tsx\n * <Button defaultSelected variant=\"tonal\">\n * Label\n * </Button>\n * ```\n *\n * A column stretches a button across it, as it does any view, and as a flex\n * column does a button on web; a column that should hold its buttons at their\n * labels' width says so with `alignItems`.\n *\n * The two sizes under 48dp tall, `xs` and `md`, take presses over a 48dp\n * target through `hitSlop`, which a `hitSlop` of the call site's own replaces.\n * `style`, `ref` and `testID` land on the `Pressable`.\n */\nfunction Button({\n children,\n defaultSelected,\n delayLongPress,\n disableRipple = false,\n hitSlop: ownHitSlop,\n href,\n icon,\n isDisabled = false,\n isPending = false,\n isSelected,\n onBlur,\n onChange,\n onFocus,\n onHoverIn,\n onHoverOut,\n onLayout,\n onLongPress,\n onPress,\n onPressIn,\n onPressOut,\n pendingLabel,\n ref,\n shape = 'round',\n size = 'md',\n slot,\n style,\n type,\n variant = 'filled',\n ...props\n}: ButtonProps) {\n const theme = useTheme()\n const role = useTypeRole(ROLES[size])\n const { fontScale } = useWindowDimensions()\n // A link is never pending, as on web, where its props have no such state.\n const pending = href === undefined && isPending\n const ringLabel = usePending(pending, pendingLabel)\n\n // The three props that make this a toggle, read as web reads them. The\n // types keep them off a `text` button; the check here keeps a call site\n // that slipped past them a plain button.\n const isToggle =\n variant !== 'text' &&\n (defaultSelected !== undefined ||\n isSelected !== undefined ||\n onChange !== undefined)\n const action = useButtonAction({\n defaultSelected,\n href,\n isSelected,\n isToggle,\n onChange,\n onPress,\n slot: slot ?? 'default',\n type,\n })\n const {\n onHoverIn: hoverIn,\n onHoverOut: hoverOut,\n onLongPress: longPress,\n ...triggerProps\n } = useSlotTrigger({\n delayLongPress,\n href,\n onHoverIn,\n onHoverOut,\n onLongPress,\n ref,\n slot,\n })\n const colors =\n palettesOf(theme)[\n isDisabled\n ? DISABLED[variant]\n : variant !== 'text' && isToggle\n ? TOGGLE_PALETTES[variant][\n action.selected ? 'selected' : 'unselected'\n ]\n : variant\n ]\n\n const feedback = usePressFeedback({\n color: colors.content,\n disabled: isDisabled,\n disableRipple,\n onBlur,\n onFocus,\n onHoverIn: hoverIn,\n onHoverOut: hoverOut,\n onPressIn,\n onPressOut,\n pending,\n })\n\n const { radii } = theme\n const resting =\n (shape === 'square') !== action.selected\n ? radii[SQUARE_CORNERS[size]]\n : radii.pill\n const shaped = useCorner(\n feedback.pressed ? radii[PRESSED_CORNERS[size]] : resting,\n onLayout,\n )\n\n return (\n <AnimatedPressable\n role={href === undefined ? 'button' : 'link'}\n {...(isToggle ? toggleState(action.selected) : undefined)}\n {...(pending ? BUSY : undefined)}\n {...props}\n {...triggerProps}\n {...feedback.handlers}\n disabled={isDisabled}\n hitSlop={ownHitSlop ?? hitSlop(theme.sizing[HEIGHTS[size]])}\n onLayout={shaped.onLayout}\n onLongPress={pending ? undefined : longPress}\n onPress={pending ? undefined : action.onPress}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.base,\n sizesOf(theme)[size],\n variant === 'outlined' ? outlinedSizesOf(theme)[size] : undefined,\n colors.container,\n shadowOf(variant, feedback, isDisabled, theme),\n shaped.corner,\n feedback.ring,\n style,\n )}\n >\n <Animated.View\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n buttonStyles.clip,\n shaped.corner,\n )}\n >\n {feedback.layer}\n </Animated.View>\n {icon === undefined ? null : (\n <PendingContent isPending={pending}>\n <IconStyleContext value={iconStyleOf(colors.content, size)}>\n {icon}\n </IconStyleContext>\n </PendingContent>\n )}\n {children === undefined ? null : (\n <NativeText\n {...(pending ? CONCEALED : undefined)}\n style={composeStyles<TextStyle>(\n role,\n styles.label,\n colors.label,\n pending ? pendingStyles.hidden : undefined,\n )}\n >\n {children}\n </NativeText>\n )}\n {pending ? (\n <PendingRing\n color={colors.content}\n diameter={theme.typography[`${ROLES[size]}Size`] * fontScale}\n label={ringLabel}\n />\n ) : null}\n </AnimatedPressable>\n )\n}\n\nfunction iconStyleOf(color: string, size: ButtonSize): IconStyle {\n return { color, size: ICON_SIZES[size] }\n}\n\n// The shadow a variant draws in its state: elevated rests at 1 and rises to 2\n// under a pointer, filled and tonal rest flat and rise to 1, and a press\n// brings each back to where it rests.\nfunction shadowOf(\n variant: ButtonVariant,\n {\n hovered,\n pressed,\n }: { readonly hovered: boolean; readonly pressed: boolean },\n isDisabled: boolean,\n theme: ResolvedTheme,\n): undefined | ViewStyle {\n const lifted = hovered && !pressed\n\n if (isDisabled) {\n return undefined\n }\n\n if (variant === 'elevated') {\n return shadowsOf(theme)[lifted ? 'elevation2' : 'elevation1']\n }\n\n return (variant === 'filled' || variant === 'tonal') && lifted\n ? shadowsOf(theme).elevation1\n : undefined\n}\n\nexport { Button }\nexport type { ButtonProps, ButtonShape, ButtonSize, ButtonVariant }\n"],"mappings":";;;;;;;;;;;;;AAgLA,MAAM6D,WAAyD;CAC7DG,UAAU;CACVC,QAAQ;CACRC,UAAU;CACVC,MAAM;CACNC,OAAO;AACT;AAIA,MAAMC,aAAmD;CACvDC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,KAAK;AACP;AAIA,MAAMC,QAAgD;CACpDL,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,KAAK;AACP;AAIA,MAAME,iBAAiB;CACrBN,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,KAAK;AACP;AAGA,MAAMI,kBAKF;CACFd,UAAU;EAAEe,UAAU;EAA0BC,YAAY;CAAW;CACvEf,QAAQ;EAAEc,UAAU;EAAwBC,YAAY;CAAe;CACvEd,UAAU;EAAEa,UAAU;EAA0BC,YAAY;CAAW;CACvEZ,OAAO;EAAEW,UAAU;EAAuBC,YAAY;CAAQ;AAChE;AAEA,MAAMC,SAAStE,WAAWuE,OAAO;CAI/BC,MAAM;EACJC,YAAY;EACZC,eAAe;EACfC,gBAAgB;EAChBC,UAAU;CACZ;CACAnC,MAAM;EACJgC,YAAY;EACZI,YAAY;EACZF,gBAAgB;CAClB;CAGAG,OAAO;EACLD,YAAY;EACZE,WAAW;CACb;AACF,CAAC;AAMD,SAASC,eAAe,EACtBC,WACsD;CACtD,OAAO;EAAEtB,IAAIsB,QAAQpB;EAAID,IAAIqB,QAAQtB;EAAIE,IAAI;EAAIC,IAAImB,QAAQrB;E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,CAACiG,SAAS,eAAe;CAGlD,QAAQvJ,YAAY,YAAYA,YAAY,YAAYuJ,SACpDvG,UAAUM,KAAK,CAAC,CAACJ,aACjBiD,KAAAA;AACN"}
@@ -1,5 +1,5 @@
1
- import { PressableProps, StyleProp, View, ViewProps, ViewStyle } from "react-native";
2
1
  import { ComponentRef, ReactNode, Ref } from "react";
2
+ import { PressableProps, StyleProp, View, ViewProps, ViewStyle } from "react-native";
3
3
  //#region src/components/card/index.d.ts
4
4
  type CardBaseProps = {
5
5
  readonly children?: ReactNode;
@@ -4,8 +4,8 @@ import { useLinkPress } from "../../router/index.js";
4
4
  import { withOpacity } from "../../theme/color.js";
5
5
  import { usePressFeedback } from "../../press/index.js";
6
6
  import { c } from "react/compiler-runtime";
7
- import { Pressable, StyleSheet, View } from "react-native";
8
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { Pressable, StyleSheet, View } from "react-native";
9
9
  //#region src/components/card/index.tsx
10
10
  const paddings = themedStyles(({ spacing }) => StyleSheet.create({
11
11
  default: { padding: spacing.lg },
@@ -1,5 +1,5 @@
1
- import { StyleProp, View, ViewProps, ViewStyle } from "react-native";
2
1
  import { ComponentRef, ReactNode, Ref } from "react";
2
+ import { StyleProp, View, ViewProps, ViewStyle } from "react-native";
3
3
  //#region src/components/checkbox/index.d.ts
4
4
  type CheckboxProps = Omit<ViewProps, 'children' | 'style'> & {
5
5
  /**