@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
@@ -1,13 +1,13 @@
1
1
  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
- import { AnimatedPressable, HEIGHTS, OUTLINE_WIDTHS, PRESSED_CORNERS, buttonStyles, toggleState, useButtonAction, useCorner } from "../../button/index.js";
4
+ import { AnimatedPressable, HEIGHTS, OUTLINE_WIDTHS, PRESSED_CORNERS, buttonStyles, toggleState, useButtonAction, useCorner, useSlotTrigger } from "../../button/index.js";
5
5
  import { palettesOf } from "../../button/palettes.js";
6
6
  import { BUSY, PendingContent, PendingRing, usePending } from "../../button/pending.js";
7
7
  import { hitSlop, usePressFeedback } from "../../press/index.js";
8
8
  import { c } from "react/compiler-runtime";
9
- import { StyleSheet } from "react-native";
10
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
+ import { StyleSheet } from "react-native";
11
11
  import Animated from "react-native-reanimated";
12
12
  //#region src/components/icon-button/index.tsx
13
13
  const DISABLED = {
@@ -88,9 +88,10 @@ const sizesOf = themedStyles(({ sizing }) => {
88
88
  * `style`, `ref` and `testID` land on the `Pressable`.
89
89
  */
90
90
  function IconButton(t0) {
91
- const $ = c(75);
91
+ const $ = c(91);
92
92
  let children;
93
93
  let defaultSelected;
94
+ let delayLongPress;
94
95
  let href;
95
96
  let isSelected;
96
97
  let onBlur;
@@ -106,6 +107,7 @@ function IconButton(t0) {
106
107
  let ownHitSlop;
107
108
  let pendingLabel;
108
109
  let props;
110
+ let ref;
109
111
  let slot;
110
112
  let style;
111
113
  let t1;
@@ -115,59 +117,63 @@ function IconButton(t0) {
115
117
  let t5;
116
118
  let type;
117
119
  if ($[0] !== t0) {
118
- ({children, defaultSelected, disableRipple: t1, hitSlop: ownHitSlop, href, isDisabled: t2, isPending: t3, isSelected, onBlur, onChange, onFocus, onHoverIn, onHoverOut, onLayout, onLongPress, onPress, onPressIn, onPressOut, pendingLabel, size: t4, slot, style, type, variant: t5, ...props} = t0);
120
+ ({children, defaultSelected, delayLongPress, disableRipple: t1, hitSlop: ownHitSlop, href, isDisabled: t2, isPending: t3, isSelected, onBlur, onChange, onFocus, onHoverIn, onHoverOut, onLayout, onLongPress, onPress, onPressIn, onPressOut, pendingLabel, ref, size: t4, slot, style, type, variant: t5, ...props} = t0);
119
121
  $[0] = t0;
120
122
  $[1] = children;
121
123
  $[2] = defaultSelected;
122
- $[3] = href;
123
- $[4] = isSelected;
124
- $[5] = onBlur;
125
- $[6] = onChange;
126
- $[7] = onFocus;
127
- $[8] = onHoverIn;
128
- $[9] = onHoverOut;
129
- $[10] = onLayout;
130
- $[11] = onLongPress;
131
- $[12] = onPress;
132
- $[13] = onPressIn;
133
- $[14] = onPressOut;
134
- $[15] = ownHitSlop;
135
- $[16] = pendingLabel;
136
- $[17] = props;
137
- $[18] = slot;
138
- $[19] = style;
139
- $[20] = t1;
140
- $[21] = t2;
141
- $[22] = t3;
142
- $[23] = t4;
143
- $[24] = t5;
144
- $[25] = type;
124
+ $[3] = delayLongPress;
125
+ $[4] = href;
126
+ $[5] = isSelected;
127
+ $[6] = onBlur;
128
+ $[7] = onChange;
129
+ $[8] = onFocus;
130
+ $[9] = onHoverIn;
131
+ $[10] = onHoverOut;
132
+ $[11] = onLayout;
133
+ $[12] = onLongPress;
134
+ $[13] = onPress;
135
+ $[14] = onPressIn;
136
+ $[15] = onPressOut;
137
+ $[16] = ownHitSlop;
138
+ $[17] = pendingLabel;
139
+ $[18] = props;
140
+ $[19] = ref;
141
+ $[20] = slot;
142
+ $[21] = style;
143
+ $[22] = t1;
144
+ $[23] = t2;
145
+ $[24] = t3;
146
+ $[25] = t4;
147
+ $[26] = t5;
148
+ $[27] = type;
145
149
  } else {
146
150
  children = $[1];
147
151
  defaultSelected = $[2];
148
- href = $[3];
149
- isSelected = $[4];
150
- onBlur = $[5];
151
- onChange = $[6];
152
- onFocus = $[7];
153
- onHoverIn = $[8];
154
- onHoverOut = $[9];
155
- onLayout = $[10];
156
- onLongPress = $[11];
157
- onPress = $[12];
158
- onPressIn = $[13];
159
- onPressOut = $[14];
160
- ownHitSlop = $[15];
161
- pendingLabel = $[16];
162
- props = $[17];
163
- slot = $[18];
164
- style = $[19];
165
- t1 = $[20];
166
- t2 = $[21];
167
- t3 = $[22];
168
- t4 = $[23];
169
- t5 = $[24];
170
- type = $[25];
152
+ delayLongPress = $[3];
153
+ href = $[4];
154
+ isSelected = $[5];
155
+ onBlur = $[6];
156
+ onChange = $[7];
157
+ onFocus = $[8];
158
+ onHoverIn = $[9];
159
+ onHoverOut = $[10];
160
+ onLayout = $[11];
161
+ onLongPress = $[12];
162
+ onPress = $[13];
163
+ onPressIn = $[14];
164
+ onPressOut = $[15];
165
+ ownHitSlop = $[16];
166
+ pendingLabel = $[17];
167
+ props = $[18];
168
+ ref = $[19];
169
+ slot = $[20];
170
+ style = $[21];
171
+ t1 = $[22];
172
+ t2 = $[23];
173
+ t3 = $[24];
174
+ t4 = $[25];
175
+ t5 = $[26];
176
+ type = $[27];
171
177
  }
172
178
  const disableRipple = t1 === void 0 ? false : t1;
173
179
  const isDisabled = t2 === void 0 ? false : t2;
@@ -180,7 +186,7 @@ function IconButton(t0) {
180
186
  const isToggle = defaultSelected !== void 0 || isSelected !== void 0 || onChange !== void 0;
181
187
  const t6 = slot ?? "default";
182
188
  let t7;
183
- if ($[26] !== defaultSelected || $[27] !== href || $[28] !== isSelected || $[29] !== isToggle || $[30] !== onChange || $[31] !== onPress || $[32] !== t6 || $[33] !== type) {
189
+ if ($[28] !== defaultSelected || $[29] !== href || $[30] !== isSelected || $[31] !== isToggle || $[32] !== onChange || $[33] !== onPress || $[34] !== t6 || $[35] !== type) {
184
190
  t7 = {
185
191
  defaultSelected,
186
192
  href,
@@ -191,17 +197,55 @@ function IconButton(t0) {
191
197
  slot: t6,
192
198
  type
193
199
  };
194
- $[26] = defaultSelected;
195
- $[27] = href;
196
- $[28] = isSelected;
197
- $[29] = isToggle;
198
- $[30] = onChange;
199
- $[31] = onPress;
200
- $[32] = t6;
201
- $[33] = type;
202
- $[34] = t7;
203
- } else t7 = $[34];
200
+ $[28] = defaultSelected;
201
+ $[29] = href;
202
+ $[30] = isSelected;
203
+ $[31] = isToggle;
204
+ $[32] = onChange;
205
+ $[33] = onPress;
206
+ $[34] = t6;
207
+ $[35] = type;
208
+ $[36] = t7;
209
+ } else t7 = $[36];
204
210
  const action = useButtonAction(t7);
211
+ let t8;
212
+ if ($[37] !== delayLongPress || $[38] !== href || $[39] !== onHoverIn || $[40] !== onHoverOut || $[41] !== onLongPress || $[42] !== ref || $[43] !== slot) {
213
+ t8 = {
214
+ delayLongPress,
215
+ href,
216
+ onHoverIn,
217
+ onHoverOut,
218
+ onLongPress,
219
+ ref,
220
+ slot
221
+ };
222
+ $[37] = delayLongPress;
223
+ $[38] = href;
224
+ $[39] = onHoverIn;
225
+ $[40] = onHoverOut;
226
+ $[41] = onLongPress;
227
+ $[42] = ref;
228
+ $[43] = slot;
229
+ $[44] = t8;
230
+ } else t8 = $[44];
231
+ const t9 = useSlotTrigger(t8);
232
+ let hoverIn;
233
+ let hoverOut;
234
+ let longPress;
235
+ let triggerProps;
236
+ if ($[45] !== t9) {
237
+ ({onHoverIn: hoverIn, onHoverOut: hoverOut, onLongPress: longPress, ...triggerProps} = t9);
238
+ $[45] = t9;
239
+ $[46] = hoverIn;
240
+ $[47] = hoverOut;
241
+ $[48] = longPress;
242
+ $[49] = triggerProps;
243
+ } else {
244
+ hoverIn = $[46];
245
+ hoverOut = $[47];
246
+ longPress = $[48];
247
+ triggerProps = $[49];
248
+ }
205
249
  const colors = palettesOf(theme)[isDisabled ? DISABLED[variant] : isToggle ? TOGGLE_PALETTES[variant][action.selected ? "selected" : "unselected"] : variant];
206
250
  const feedback = usePressFeedback({
207
251
  color: colors.content,
@@ -209,8 +253,8 @@ function IconButton(t0) {
209
253
  disableRipple,
210
254
  onBlur,
211
255
  onFocus,
212
- onHoverIn,
213
- onHoverOut,
256
+ onHoverIn: hoverIn,
257
+ onHoverOut: hoverOut,
214
258
  onPressIn,
215
259
  onPressOut,
216
260
  pending
@@ -219,119 +263,121 @@ function IconButton(t0) {
219
263
  const edge = sizing[HEIGHTS[size]];
220
264
  const shaped = useCorner(feedback.pressed || action.selected ? radii[PRESSED_CORNERS[size]] : radii.pill, onLayout);
221
265
  const T0 = AnimatedPressable;
222
- const t8 = href === void 0 ? "button" : "link";
223
- let t9;
224
- if ($[35] !== action || $[36] !== isToggle) {
225
- t9 = isToggle ? toggleState(action.selected) : void 0;
226
- $[35] = action;
227
- $[36] = isToggle;
228
- $[37] = t9;
229
- } else t9 = $[37];
230
- const t10 = pending ? BUSY : void 0;
231
- const t11 = feedback.handlers;
232
- let t12;
233
- if ($[38] !== edge || $[39] !== ownHitSlop) {
234
- t12 = ownHitSlop ?? hitSlop(edge, edge);
235
- $[38] = edge;
236
- $[39] = ownHitSlop;
237
- $[40] = t12;
238
- } else t12 = $[40];
239
- const t13 = shaped.onLayout;
240
- const t14 = pending ? void 0 : onLongPress;
241
- const t15 = pending ? void 0 : action.onPress;
242
- const t16 = composeStyles(styles.base, sizesOf(theme)[size], variant === "outlined" ? outlineWidths[size] : void 0, colors.container, shaped.corner, feedback.ring, style);
243
- let t17;
244
- if ($[41] !== shaped.corner) {
245
- t17 = composeStyles(buttonStyles.clip, shaped.corner);
246
- $[41] = shaped.corner;
247
- $[42] = t17;
248
- } else t17 = $[42];
249
- let t18;
250
- if ($[43] !== feedback.layer || $[44] !== t17) {
251
- t18 = /* @__PURE__ */ jsx(Animated.View, {
252
- style: t17,
266
+ const t10 = href === void 0 ? "button" : "link";
267
+ let t11;
268
+ if ($[50] !== action || $[51] !== isToggle) {
269
+ t11 = isToggle ? toggleState(action.selected) : void 0;
270
+ $[50] = action;
271
+ $[51] = isToggle;
272
+ $[52] = t11;
273
+ } else t11 = $[52];
274
+ const t12 = pending ? BUSY : void 0;
275
+ const t13 = feedback.handlers;
276
+ let t14;
277
+ if ($[53] !== edge || $[54] !== ownHitSlop) {
278
+ t14 = ownHitSlop ?? hitSlop(edge, edge);
279
+ $[53] = edge;
280
+ $[54] = ownHitSlop;
281
+ $[55] = t14;
282
+ } else t14 = $[55];
283
+ const t15 = shaped.onLayout;
284
+ const t16 = pending ? void 0 : longPress;
285
+ const t17 = pending ? void 0 : action.onPress;
286
+ const t18 = composeStyles(styles.base, sizesOf(theme)[size], variant === "outlined" ? outlineWidths[size] : void 0, colors.container, shaped.corner, feedback.ring, style);
287
+ let t19;
288
+ if ($[56] !== shaped.corner) {
289
+ t19 = composeStyles(buttonStyles.clip, shaped.corner);
290
+ $[56] = shaped.corner;
291
+ $[57] = t19;
292
+ } else t19 = $[57];
293
+ let t20;
294
+ if ($[58] !== feedback.layer || $[59] !== t19) {
295
+ t20 = /* @__PURE__ */ jsx(Animated.View, {
296
+ style: t19,
253
297
  children: feedback.layer
254
298
  });
255
- $[43] = feedback.layer;
256
- $[44] = t17;
257
- $[45] = t18;
258
- } else t18 = $[45];
299
+ $[58] = feedback.layer;
300
+ $[59] = t19;
301
+ $[60] = t20;
302
+ } else t20 = $[60];
259
303
  const T1 = PendingContent;
260
304
  const T2 = IconStyleContext;
261
- const t19 = iconStyleOf(colors.content, size);
262
- let t20;
263
- if ($[46] !== T2 || $[47] !== children || $[48] !== t19) {
264
- t20 = /* @__PURE__ */ jsx(T2, {
265
- value: t19,
305
+ const t21 = iconStyleOf(colors.content, size);
306
+ let t22;
307
+ if ($[61] !== T2 || $[62] !== children || $[63] !== t21) {
308
+ t22 = /* @__PURE__ */ jsx(T2, {
309
+ value: t21,
266
310
  children
267
311
  });
268
- $[46] = T2;
269
- $[47] = children;
270
- $[48] = t19;
271
- $[49] = t20;
272
- } else t20 = $[49];
273
- let t21;
274
- if ($[50] !== T1 || $[51] !== pending || $[52] !== t20) {
275
- t21 = /* @__PURE__ */ jsx(T1, {
312
+ $[61] = T2;
313
+ $[62] = children;
314
+ $[63] = t21;
315
+ $[64] = t22;
316
+ } else t22 = $[64];
317
+ let t23;
318
+ if ($[65] !== T1 || $[66] !== pending || $[67] !== t22) {
319
+ t23 = /* @__PURE__ */ jsx(T1, {
276
320
  isPending: pending,
277
- children: t20
321
+ children: t22
278
322
  });
279
- $[50] = T1;
280
- $[51] = pending;
281
- $[52] = t20;
282
- $[53] = t21;
283
- } else t21 = $[53];
284
- let t22;
285
- if ($[54] !== colors || $[55] !== pending || $[56] !== ringLabel || $[57] !== size) {
286
- t22 = pending ? /* @__PURE__ */ jsx(PendingRing, {
323
+ $[65] = T1;
324
+ $[66] = pending;
325
+ $[67] = t22;
326
+ $[68] = t23;
327
+ } else t23 = $[68];
328
+ let t24;
329
+ if ($[69] !== colors || $[70] !== pending || $[71] !== ringLabel || $[72] !== size) {
330
+ t24 = pending ? /* @__PURE__ */ jsx(PendingRing, {
287
331
  color: colors.content,
288
332
  diameter: ICON_SIZES[size],
289
333
  label: ringLabel
290
334
  }) : null;
291
- $[54] = colors;
292
- $[55] = pending;
293
- $[56] = ringLabel;
294
- $[57] = size;
295
- $[58] = t22;
296
- } else t22 = $[58];
297
- let t23;
298
- if ($[59] !== T0 || $[60] !== feedback.handlers || $[61] !== isDisabled || $[62] !== props || $[63] !== shaped.onLayout || $[64] !== t10 || $[65] !== t12 || $[66] !== t14 || $[67] !== t15 || $[68] !== t16 || $[69] !== t18 || $[70] !== t21 || $[71] !== t22 || $[72] !== t8 || $[73] !== t9) {
299
- t23 = /* @__PURE__ */ jsxs(T0, {
300
- role: t8,
301
- ...t9,
302
- ...t10,
303
- ...props,
335
+ $[69] = colors;
336
+ $[70] = pending;
337
+ $[71] = ringLabel;
338
+ $[72] = size;
339
+ $[73] = t24;
340
+ } else t24 = $[73];
341
+ let t25;
342
+ if ($[74] !== T0 || $[75] !== feedback.handlers || $[76] !== isDisabled || $[77] !== props || $[78] !== shaped.onLayout || $[79] !== t10 || $[80] !== t11 || $[81] !== t12 || $[82] !== t14 || $[83] !== t16 || $[84] !== t17 || $[85] !== t18 || $[86] !== t20 || $[87] !== t23 || $[88] !== t24 || $[89] !== triggerProps) {
343
+ t25 = /* @__PURE__ */ jsxs(T0, {
344
+ role: t10,
304
345
  ...t11,
346
+ ...t12,
347
+ ...props,
348
+ ...triggerProps,
349
+ ...t13,
305
350
  disabled: isDisabled,
306
- hitSlop: t12,
307
- onLayout: t13,
308
- onLongPress: t14,
309
- onPress: t15,
310
- style: t16,
351
+ hitSlop: t14,
352
+ onLayout: t15,
353
+ onLongPress: t16,
354
+ onPress: t17,
355
+ style: t18,
311
356
  children: [
312
- t18,
313
- t21,
314
- t22
357
+ t20,
358
+ t23,
359
+ t24
315
360
  ]
316
361
  });
317
- $[59] = T0;
318
- $[60] = feedback.handlers;
319
- $[61] = isDisabled;
320
- $[62] = props;
321
- $[63] = shaped.onLayout;
322
- $[64] = t10;
323
- $[65] = t12;
324
- $[66] = t14;
325
- $[67] = t15;
326
- $[68] = t16;
327
- $[69] = t18;
328
- $[70] = t21;
329
- $[71] = t22;
330
- $[72] = t8;
331
- $[73] = t9;
332
- $[74] = t23;
333
- } else t23 = $[74];
334
- return t23;
362
+ $[74] = T0;
363
+ $[75] = feedback.handlers;
364
+ $[76] = isDisabled;
365
+ $[77] = props;
366
+ $[78] = shaped.onLayout;
367
+ $[79] = t10;
368
+ $[80] = t11;
369
+ $[81] = t12;
370
+ $[82] = t14;
371
+ $[83] = t16;
372
+ $[84] = t17;
373
+ $[85] = t18;
374
+ $[86] = t20;
375
+ $[87] = t23;
376
+ $[88] = t24;
377
+ $[89] = triggerProps;
378
+ $[90] = t25;
379
+ } else t25 = $[90];
380
+ return t25;
335
381
  }
336
382
  function iconStyleOf(color, size) {
337
383
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","PressableProps","StyleProp","View","ViewStyle","AnimatedStyle","StyleSheet","Animated","ButtonLinkForm","ButtonPressForm","ButtonToggleForm","PaletteName","IconStyle","AnimatedPressable","buttonStyles","HEIGHTS","OUTLINE_WIDTHS","PRESSED_CORNERS","toggleState","useButtonAction","useCorner","palettesOf","BUSY","PendingContent","PendingRing","usePending","IconStyleContext","hitSlop","usePressFeedback","useTheme","composeStyles","themedStyles","IconButtonProps","Omit","children","disableRipple","isDisabled","ref","size","IconButtonSize","style","variant","IconButtonVariant","DISABLED","Readonly","Record","filled","outlined","standard","tonal","ICON_SIZES","lg","md","xl","xs","xxl","TOGGLE_PALETTES","selected","unselected","styles","create","base","alignItems","flexShrink","justifyContent","outlineWidths","borderWidth","sizesOf","sizing","square","edge","height","width","IconButton","t0","$","_c","defaultSelected","href","isSelected","onBlur","onChange","onFocus","onHoverIn","onHoverOut","onLayout","onLongPress","onPress","onPressIn","onPressOut","ownHitSlop","pendingLabel","props","slot","t1","t2","t3","t4","t5","type","isPending","undefined","theme","pending","ringLabel","isToggle","t6","t7","action","colors","feedback","color","content","disabled","radii","shaped","pressed","pill","T0","t8","t9","t10","t11","handlers","t12","t13","t14","t15","t16","container","corner","ring","t17","clip","t18","layer","T1","T2","t19","iconStyleOf","t20","t21","t22","t23","_c"],"sources":["../../../src/components/icon-button/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type { PressableProps, StyleProp, View, ViewStyle } from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\n\nimport { StyleSheet } 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'\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 PendingContent,\n PendingRing,\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'\n\n// The icon buttons spec page's four styles at its five sizes, as kanso-ui's\n// IconButton draws them: Button's chrome around a single icon. The pairs are\n// the page's: filled on primary, tonal on secondary container, outlined with\n// an outline-variant rule and an on-surface-variant icon, and standard,\n// transparent, with the same icon over whatever it sits on. Disabled is\n// Button's, on-surface at the two disabled opacities, and a standard button\n// takes the text button's colour since neither has a container.\n//\n// The sizes are the page's XS to XL at Button's five heights, so the two line\n// up in a row: a square of 32, 40, 56, 96 or 136dp holding an icon of 20, 24,\n// 24, 32 or 40dp. The two middle sizes share one icon, and the container\n// alone grows between them. The two smallest take presses over a 48dp target\n// through `hitSlop`, which is the page's floor for them.\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 icon and takes primary once selected, a tonal one moves\n// from the secondary container pair to secondary, a standard one stays\n// transparent while its icon moves to primary, and an outlined one swaps its\n// rule for the inverse surface pair. So a selected filled toggle looks like a\n// plain filled button, and an unselected one does not.\n//\n// **A pending button keeps its place**, as Button's does: the icon is hidden\n// where it stands and an indeterminate ring is drawn over it, in the icon's\n// colour and at the icon's size, which is what web's `1em` reads there. The\n// button keeps its focus and its ring, reports itself busy and takes no\n// press until it clears, and src/button's pending.tsx says the change out\n// loud.\n//\n// **The corner morphs from a circle to a rounded square.** A press tightens\n// it to the size's pressed corner, 8dp for the two small sizes, 12dp at\n// `lg` and 16dp at the two large, and a selected toggle rests there, which is\n// the page's round-to-square morph. It eases as Button's does.\n//\n// The forms, the toggle's state, what a press does and the corner's ease are\n// src/button's, shared with Button.\n\ntype IconButtonProps = (ButtonLinkForm | ButtonPressForm | ButtonToggleForm) &\n Omit<PressableProps, 'aria-label' | 'children' | 'disabled' | 'style'> & {\n /**\n * What the button does, in words. Required rather than optional: an icon\n * on its own has no accessible name, so without this the control\n * announces nothing at all.\n */\n readonly 'aria-label': string\n /**\n * The icon. The button hands it its colour and the page's icon size for\n * the button's size through `useIconStyle()`.\n */\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 * 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 * Control size: `xs` 32dp, `md` 40dp, `lg` 56dp, `xl` 96dp, `xxl` 136dp,\n * the icon buttons spec page's XS to XL, and the same heights `Button`\n * uses, so the two line up beside each other in a row. The icon is 20dp,\n * 24dp, 24dp, 32dp and 40dp in turn.\n * @default 'md'\n */\n readonly size?: IconButtonSize\n readonly style?: StyleProp<ViewStyle>\n /**\n * `standard` is transparent and tints what it sits on; `outlined` is\n * transparent with a rule around it; `filled` and `tonal` carry a\n * container of their own.\n * @default 'standard'\n */\n readonly variant?: IconButtonVariant\n }\n\ntype IconButtonSize = 'lg' | 'md' | 'xl' | 'xs' | 'xxl'\n\ntype IconButtonVariant = 'filled' | 'outlined' | 'standard' | 'tonal'\n\n// The disabled container each variant draws. Filled and tonal share the\n// page's one disabled container, and standard draws the text button's\n// colour, which is the icon alone.\nconst DISABLED: Readonly<Record<IconButtonVariant, PaletteName>> = {\n filled: 'filledDisabled',\n outlined: 'outlinedDisabled',\n standard: 'textDisabled',\n tonal: 'filledDisabled',\n}\n\n// The icon each size holds, 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<IconButtonSize, number>> = {\n lg: 24,\n md: 24,\n xl: 32,\n xs: 20,\n xxl: 40,\n}\n\n// Which container a toggle draws, selected and not. An unselected outlined,\n// standard or tonal toggle is the plain button of that variant.\nconst TOGGLE_PALETTES: Readonly<\n Record<\n IconButtonVariant,\n Readonly<Record<'selected' | 'unselected', PaletteName>>\n >\n> = {\n filled: { selected: 'filledToggleSelected', unselected: 'filledToggle' },\n outlined: { selected: 'outlinedToggleSelected', unselected: 'outlined' },\n standard: { selected: 'standardToggleSelected', unselected: 'standard' },\n tonal: { selected: 'tonalToggleSelected', unselected: 'tonal' },\n}\n\nconst styles = StyleSheet.create({\n // The icon sits in the middle of a square that a row never squeezes.\n base: {\n alignItems: 'center',\n flexShrink: 0,\n justifyContent: 'center',\n },\n})\n\n// The outlined rule's width at each size, Button's.\nconst outlineWidths = StyleSheet.create({\n lg: { borderWidth: OUTLINE_WIDTHS.lg },\n md: { borderWidth: OUTLINE_WIDTHS.md },\n xl: { borderWidth: OUTLINE_WIDTHS.xl },\n xs: { borderWidth: OUTLINE_WIDTHS.xs },\n xxl: { borderWidth: OUTLINE_WIDTHS.xxl },\n})\n\n// Square, so one control height sets both edges.\nconst sizesOf = themedStyles(({ sizing }) => {\n function square(size: IconButtonSize): ViewStyle {\n const edge = sizing[HEIGHTS[size]]\n\n return { height: edge, width: edge }\n }\n\n return StyleSheet.create({\n lg: square('lg'),\n md: square('md'),\n xl: square('xl'),\n xs: square('xs'),\n xxl: square('xxl'),\n })\n})\n\n/**\n * A button that is an icon, at five control heights, with web's props and\n * values. Given `href` it is a link with the same appearance, and given\n * `isSelected`, `defaultSelected` or `onChange` it is a toggle, which reports\n * its state to a screen reader and draws the page's second pair of colour\n * roles for its variant. The three forms are exclusive, so a toggle given\n * `href` does not compile.\n *\n * ```tsx\n * <IconButton aria-label=\"Label\" defaultSelected variant=\"tonal\">\n * <Icon />\n * </IconButton>\n * ```\n *\n * The two sizes under 48dp, `xs` and `md`, take presses over a 48dp target\n * through `hitSlop`, which a `hitSlop` of the call site's own replaces.\n * `style`, `ref` and `testID` land on the `Pressable`.\n */\nfunction IconButton({\n children,\n defaultSelected,\n disableRipple = false,\n hitSlop: ownHitSlop,\n href,\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 size = 'md',\n slot,\n style,\n type,\n variant = 'standard',\n ...props\n}: IconButtonProps) {\n const theme = useTheme()\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.\n const isToggle =\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 : 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, sizing } = theme\n const edge = sizing[HEIGHTS[size]]\n const shaped = useCorner(\n feedback.pressed || action.selected\n ? radii[PRESSED_CORNERS[size]]\n : radii.pill,\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(edge, edge)}\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' ? outlineWidths[size] : undefined,\n colors.container,\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 <PendingContent isPending={pending}>\n <IconStyleContext value={iconStyleOf(colors.content, size)}>\n {children}\n </IconStyleContext>\n </PendingContent>\n {pending ? (\n <PendingRing\n color={colors.content}\n diameter={ICON_SIZES[size]}\n label={ringLabel}\n />\n ) : null}\n </AnimatedPressable>\n )\n}\n\nfunction iconStyleOf(color: string, size: IconButtonSize): IconStyle {\n return { color, size: ICON_SIZES[size] }\n}\n\nexport { IconButton }\nexport type { IconButtonProps, IconButtonSize, IconButtonVariant }\n"],"mappings":";;;;;;;;;;;;AA4HA,MAAM6C,WAA6D;CACjEG,QAAQ;CACRC,UAAU;CACVC,UAAU;CACVC,OAAO;AACT;AAIA,MAAMC,aAAuD;CAC3DC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,KAAK;AACP;AAIA,MAAMC,kBAKF;CACFV,QAAQ;EAAEW,UAAU;EAAwBC,YAAY;CAAe;CACvEX,UAAU;EAAEU,UAAU;EAA0BC,YAAY;CAAW;CACvEV,UAAU;EAAES,UAAU;EAA0BC,YAAY;CAAW;CACvET,OAAO;EAAEQ,UAAU;EAAuBC,YAAY;CAAQ;AAChE;AAEA,MAAMC,SAASrD,WAAWsD,OAAO,EAE/BC,MAAM;CACJC,YAAY;CACZC,YAAY;CACZC,gBAAgB;AAClB,EACF,CAAC;AAGD,MAAMC,gBAAgB3D,WAAWsD,OAAO;CACtCT,IAAI,EAAEe,aAAalD,eAAemC,GAAG;CACrCC,IAAI,EAAEc,aAAalD,eAAeoC,GAAG;CACrCC,IAAI,EAAEa,aAAalD,eAAeqC,GAAG;CACrCC,IAAI,EAAEY,aAAalD,eAAesC,GAAG;CACrCC,KAAK,EAAEW,aAAalD,eAAeuC,IAAI;AACzC,CAAC;AAGD,MAAMY,UAAUpC,cAAc,EAAEqC,aAAa;CAC3C,SAASC,OAAO/B,MAAiC;EAC/C,MAAMgC,OAAOF,OAAOrD,QAAQuB;EAE5B,OAAO;GAAEiC,QAAQD;GAAME,OAAOF;EAAK;CACrC;CAEA,OAAOhE,WAAWsD,OAAO;EACvBT,IAAIkB,OAAO,IAAI;EACfjB,IAAIiB,OAAO,IAAI;EACfhB,IAAIgB,OAAO,IAAI;EACff,IAAIe,OAAO,IAAI;EACfd,KAAKc,OAAO,KAAK;CACnB,CAAC;AACH,CAAC;;;;;;;;;;;;;;;;;;;AA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A;GACD,SAAAwF;GACC,UAAAC;GACG,aAAAC;GACJ,SAAAC;GACF,OAAAC;GAXT,UAAA;IAqBEM;IAQAO;IAKCC;GAlCe;;EAyCEnE,EAAA,MAAA2C;EAAA3C,EAAA,MAAAmC,SAAAa;EAAAhD,EAAA,MAAAvC;EAAAuC,EAAA,MAAAiB;EAAAjB,EAAA,MAAAwC,OAAA9B;EAAAV,EAAA,MAAA8C;EAAA9C,EAAA,MAAAiD;EAAAjD,EAAA,MAAAmD;EAAAnD,EAAA,MAAAoD;EAAApD,EAAA,MAAAqD;EAAArD,EAAA,MAAA2D;EAAA3D,EAAA,MAAAkE;EAAAlE,EAAA,MAAAmE;EAAAnE,EAAA,MAAA4C;EAAA5C,EAAA,MAAA6C;EAAA7C,EAAA,MAAAoE;CAAA,OAAAA,MAAApE,EAAA;CAAA,OAzCpBoE;AAyCoB;AAIxB,SAASJ,YAAY5B,OAAezE,MAAiC;CACnE,OAAO;EAAEyE;EAAOzE,MAAMY,WAAWZ;CAAM;AACzC"}
1
+ {"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","PressableProps","StyleProp","View","ViewStyle","AnimatedStyle","StyleSheet","Animated","ButtonLinkForm","ButtonPressForm","ButtonToggleForm","PaletteName","IconStyle","AnimatedPressable","buttonStyles","HEIGHTS","OUTLINE_WIDTHS","PRESSED_CORNERS","toggleState","useButtonAction","useCorner","useSlotTrigger","palettesOf","BUSY","PendingContent","PendingRing","usePending","IconStyleContext","hitSlop","usePressFeedback","useTheme","composeStyles","themedStyles","IconButtonProps","Omit","children","disableRipple","isDisabled","ref","size","IconButtonSize","style","variant","IconButtonVariant","DISABLED","Readonly","Record","filled","outlined","standard","tonal","ICON_SIZES","lg","md","xl","xs","xxl","TOGGLE_PALETTES","selected","unselected","styles","create","base","alignItems","flexShrink","justifyContent","outlineWidths","borderWidth","sizesOf","sizing","square","edge","height","width","IconButton","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","type","isPending","undefined","theme","pending","ringLabel","isToggle","t6","t7","action","t8","t9","hoverIn","hoverOut","longPress","triggerProps","colors","feedback","color","content","disabled","radii","shaped","pressed","pill","T0","t10","t11","t12","t13","handlers","t14","t15","t16","t17","t18","container","corner","ring","t19","clip","t20","layer","T1","T2","t21","iconStyleOf","t22","t23","t24","t25","_c"],"sources":["../../../src/components/icon-button/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type { PressableProps, StyleProp, View, ViewStyle } from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\n\nimport { StyleSheet } 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'\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 PendingContent,\n PendingRing,\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'\n\n// The icon buttons spec page's four styles at its five sizes, as kanso-ui's\n// IconButton draws them: Button's chrome around a single icon. The pairs are\n// the page's: filled on primary, tonal on secondary container, outlined with\n// an outline-variant rule and an on-surface-variant icon, and standard,\n// transparent, with the same icon over whatever it sits on. Disabled is\n// Button's, on-surface at the two disabled opacities, and a standard button\n// takes the text button's colour since neither has a container.\n//\n// The sizes are the page's XS to XL at Button's five heights, so the two line\n// up in a row: a square of 32, 40, 56, 96 or 136dp holding an icon of 20, 24,\n// 24, 32 or 40dp. The two middle sizes share one icon, and the container\n// alone grows between them. The two smallest take presses over a 48dp target\n// through `hitSlop`, which is the page's floor for them.\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 icon and takes primary once selected, a tonal one moves\n// from the secondary container pair to secondary, a standard one stays\n// transparent while its icon moves to primary, and an outlined one swaps its\n// rule for the inverse surface pair. So a selected filled toggle looks like a\n// plain filled button, and an unselected one does not.\n//\n// **A pending button keeps its place**, as Button's does: the icon is hidden\n// where it stands and an indeterminate ring is drawn over it, in the icon's\n// colour and at the icon's size, which is what web's `1em` reads there. The\n// button keeps its focus and its ring, reports itself busy and takes no\n// press until it clears, and src/button's pending.tsx says the change out\n// loud.\n//\n// **The corner morphs from a circle to a rounded square.** A press tightens\n// it to the size's pressed corner, 8dp for the two small sizes, 12dp at\n// `lg` and 16dp at the two large, and a selected toggle rests there, which is\n// the page's round-to-square morph. It eases as Button's does.\n//\n// The forms, the toggle's state, what a press does and the corner's ease are\n// src/button's, shared with Button.\n\ntype IconButtonProps = (ButtonLinkForm | ButtonPressForm | ButtonToggleForm) &\n Omit<PressableProps, 'aria-label' | 'children' | 'disabled' | 'style'> & {\n /**\n * What the button does, in words. Required rather than optional: an icon\n * on its own has no accessible name, so without this the control\n * announces nothing at all.\n */\n readonly 'aria-label': string\n /**\n * The icon. The button hands it its colour and the page's icon size for\n * the button's size through `useIconStyle()`.\n */\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 * 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 * Control size: `xs` 32dp, `md` 40dp, `lg` 56dp, `xl` 96dp, `xxl` 136dp,\n * the icon buttons spec page's XS to XL, and the same heights `Button`\n * uses, so the two line up beside each other in a row. The icon is 20dp,\n * 24dp, 24dp, 32dp and 40dp in turn.\n * @default 'md'\n */\n readonly size?: IconButtonSize\n readonly style?: StyleProp<ViewStyle>\n /**\n * `standard` is transparent and tints what it sits on; `outlined` is\n * transparent with a rule around it; `filled` and `tonal` carry a\n * container of their own.\n * @default 'standard'\n */\n readonly variant?: IconButtonVariant\n }\n\ntype IconButtonSize = 'lg' | 'md' | 'xl' | 'xs' | 'xxl'\n\ntype IconButtonVariant = 'filled' | 'outlined' | 'standard' | 'tonal'\n\n// The disabled container each variant draws. Filled and tonal share the\n// page's one disabled container, and standard draws the text button's\n// colour, which is the icon alone.\nconst DISABLED: Readonly<Record<IconButtonVariant, PaletteName>> = {\n filled: 'filledDisabled',\n outlined: 'outlinedDisabled',\n standard: 'textDisabled',\n tonal: 'filledDisabled',\n}\n\n// The icon each size holds, 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<IconButtonSize, number>> = {\n lg: 24,\n md: 24,\n xl: 32,\n xs: 20,\n xxl: 40,\n}\n\n// Which container a toggle draws, selected and not. An unselected outlined,\n// standard or tonal toggle is the plain button of that variant.\nconst TOGGLE_PALETTES: Readonly<\n Record<\n IconButtonVariant,\n Readonly<Record<'selected' | 'unselected', PaletteName>>\n >\n> = {\n filled: { selected: 'filledToggleSelected', unselected: 'filledToggle' },\n outlined: { selected: 'outlinedToggleSelected', unselected: 'outlined' },\n standard: { selected: 'standardToggleSelected', unselected: 'standard' },\n tonal: { selected: 'tonalToggleSelected', unselected: 'tonal' },\n}\n\nconst styles = StyleSheet.create({\n // The icon sits in the middle of a square that a row never squeezes.\n base: {\n alignItems: 'center',\n flexShrink: 0,\n justifyContent: 'center',\n },\n})\n\n// The outlined rule's width at each size, Button's.\nconst outlineWidths = StyleSheet.create({\n lg: { borderWidth: OUTLINE_WIDTHS.lg },\n md: { borderWidth: OUTLINE_WIDTHS.md },\n xl: { borderWidth: OUTLINE_WIDTHS.xl },\n xs: { borderWidth: OUTLINE_WIDTHS.xs },\n xxl: { borderWidth: OUTLINE_WIDTHS.xxl },\n})\n\n// Square, so one control height sets both edges.\nconst sizesOf = themedStyles(({ sizing }) => {\n function square(size: IconButtonSize): ViewStyle {\n const edge = sizing[HEIGHTS[size]]\n\n return { height: edge, width: edge }\n }\n\n return StyleSheet.create({\n lg: square('lg'),\n md: square('md'),\n xl: square('xl'),\n xs: square('xs'),\n xxl: square('xxl'),\n })\n})\n\n/**\n * A button that is an icon, at five control heights, with web's props and\n * values. Given `href` it is a link with the same appearance, and given\n * `isSelected`, `defaultSelected` or `onChange` it is a toggle, which reports\n * its state to a screen reader and draws the page's second pair of colour\n * roles for its variant. The three forms are exclusive, so a toggle given\n * `href` does not compile.\n *\n * ```tsx\n * <IconButton aria-label=\"Label\" defaultSelected variant=\"tonal\">\n * <Icon />\n * </IconButton>\n * ```\n *\n * The two sizes under 48dp, `xs` and `md`, take presses over a 48dp target\n * through `hitSlop`, which a `hitSlop` of the call site's own replaces.\n * `style`, `ref` and `testID` land on the `Pressable`.\n */\nfunction IconButton({\n children,\n defaultSelected,\n delayLongPress,\n disableRipple = false,\n hitSlop: ownHitSlop,\n href,\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 size = 'md',\n slot,\n style,\n type,\n variant = 'standard',\n ...props\n}: IconButtonProps) {\n const theme = useTheme()\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.\n const isToggle =\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 : 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, sizing } = theme\n const edge = sizing[HEIGHTS[size]]\n const shaped = useCorner(\n feedback.pressed || action.selected\n ? radii[PRESSED_CORNERS[size]]\n : radii.pill,\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(edge, edge)}\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' ? outlineWidths[size] : undefined,\n colors.container,\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 <PendingContent isPending={pending}>\n <IconStyleContext value={iconStyleOf(colors.content, size)}>\n {children}\n </IconStyleContext>\n </PendingContent>\n {pending ? (\n <PendingRing\n color={colors.content}\n diameter={ICON_SIZES[size]}\n label={ringLabel}\n />\n ) : null}\n </AnimatedPressable>\n )\n}\n\nfunction iconStyleOf(color: string, size: IconButtonSize): IconStyle {\n return { color, size: ICON_SIZES[size] }\n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AA,MAAAkB;EAAAlB,EAAA,MAAA+C,OAAApC;EAAAX,EAAA,MAAAmD;EAAAnD,EAAA,MAAAoD;EAAApD,EAAA,MAAAqD;EAAArD,EAAA,MAAAwD;EAAAxD,EAAA,MAAA0D;EAAA1D,EAAA,MAAA2D;EAAA3D,EAAA,MAAA4D;EAAA5D,EAAA,MAAAkE;EAAAlE,EAAA,MAAAyE;EAAAzE,EAAA,MAAA0E;EAAA1E,EAAA,MAAAwC;EAAAxC,EAAA,MAAA2E;CAAA,OAAAA,MAAA3E,EAAA;CAAA,OA1CpB2E;AA0CoB;AAIxB,SAASJ,YAAY5B,OAAehF,MAAiC;CACnE,OAAO;EAAEgF;EAAOhF,MAAMY,WAAWZ;CAAM;AACzC"}
@@ -1,5 +1,5 @@
1
- import { Text, TextProps } from "react-native";
2
1
  import { ComponentRef, Ref } from "react";
2
+ import { Text, TextProps } from "react-native";
3
3
  //#region src/components/link/index.d.ts
4
4
  type LinkProps = Omit<TextProps, 'disabled'> & {
5
5
  /**
@@ -4,9 +4,9 @@ import { useLinkPress } from "../../router/index.js";
4
4
  import { withOpacity } from "../../theme/color.js";
5
5
  import { stylesOf as stylesOf$1 } from "../../press/styles.js";
6
6
  import { c } from "react/compiler-runtime";
7
- import { Platform, StyleSheet, Text } from "react-native";
8
7
  import { useState } from "react";
9
8
  import { jsx } from "react/jsx-runtime";
9
+ import { Platform, StyleSheet, Text } from "react-native";
10
10
  //#region src/components/link/index.tsx
11
11
  const underlines = StyleSheet.create({
12
12
  always: { textDecorationLine: "underline" },