@kanso-labs/react-native-kanso-ui 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/README.md +4 -3
  2. package/dist/autocomplete/index.js +15 -1
  3. package/dist/autocomplete/index.js.map +1 -1
  4. package/dist/button/group.d.ts +5 -0
  5. package/dist/button/group.js +115 -0
  6. package/dist/button/group.js.map +1 -0
  7. package/dist/button/index.d.ts +4 -1
  8. package/dist/button/index.js +44 -22
  9. package/dist/button/index.js.map +1 -1
  10. package/dist/button/slots.js +2 -1
  11. package/dist/button/slots.js.map +1 -1
  12. package/dist/calendar/index.js +351 -182
  13. package/dist/calendar/index.js.map +1 -1
  14. package/dist/calendar/styles.js +33 -2
  15. package/dist/calendar/styles.js.map +1 -1
  16. package/dist/carousel/arrangement.d.ts +5 -0
  17. package/dist/carousel/arrangement.js +123 -0
  18. package/dist/carousel/arrangement.js.map +1 -0
  19. package/dist/chequer/index.js +95 -0
  20. package/dist/chequer/index.js.map +1 -0
  21. package/dist/collection/index.d.ts +157 -0
  22. package/dist/collection/index.js +1331 -0
  23. package/dist/collection/index.js.map +1 -0
  24. package/dist/color-thumb/index.js +56 -0
  25. package/dist/color-thumb/index.js.map +1 -0
  26. package/dist/components/button/index.d.ts +4 -2
  27. package/dist/components/button/index.js +227 -188
  28. package/dist/components/button/index.js.map +1 -1
  29. package/dist/components/button-group/index.d.ts +87 -0
  30. package/dist/components/button-group/index.js +275 -0
  31. package/dist/components/button-group/index.js.map +1 -0
  32. package/dist/components/calendar/index.d.ts +11 -3
  33. package/dist/components/calendar/index.js +60 -45
  34. package/dist/components/calendar/index.js.map +1 -1
  35. package/dist/components/carousel/index.d.ts +72 -0
  36. package/dist/components/carousel/index.js +496 -0
  37. package/dist/components/carousel/index.js.map +1 -0
  38. package/dist/components/checkbox-group/index.d.ts +3 -4
  39. package/dist/components/checkbox-group/index.js +1 -1
  40. package/dist/components/checkbox-group/index.js.map +1 -1
  41. package/dist/components/color-area/index.d.ts +85 -0
  42. package/dist/components/color-area/index.js +630 -0
  43. package/dist/components/color-area/index.js.map +1 -0
  44. package/dist/components/color-field/index.d.ts +144 -0
  45. package/dist/components/color-field/index.js +516 -0
  46. package/dist/components/color-field/index.js.map +1 -0
  47. package/dist/components/color-picker/index.d.ts +74 -0
  48. package/dist/components/color-picker/index.js +317 -0
  49. package/dist/components/color-picker/index.js.map +1 -0
  50. package/dist/components/color-slider/index.d.ts +82 -0
  51. package/dist/components/color-slider/index.js +456 -0
  52. package/dist/components/color-slider/index.js.map +1 -0
  53. package/dist/components/color-swatch/index.d.ts +46 -0
  54. package/dist/components/color-swatch/index.js +127 -0
  55. package/dist/components/color-swatch/index.js.map +1 -0
  56. package/dist/components/color-swatch-picker/index.d.ts +81 -0
  57. package/dist/components/color-swatch-picker/index.js +287 -0
  58. package/dist/components/color-swatch-picker/index.js.map +1 -0
  59. package/dist/components/color-wheel/index.d.ts +71 -0
  60. package/dist/components/color-wheel/index.js +407 -0
  61. package/dist/components/color-wheel/index.js.map +1 -0
  62. package/dist/components/combo-box/index.d.ts +193 -0
  63. package/dist/components/combo-box/index.js +616 -0
  64. package/dist/components/combo-box/index.js.map +1 -0
  65. package/dist/components/date-field/index.d.ts +120 -0
  66. package/dist/components/date-field/index.js +111 -0
  67. package/dist/components/date-field/index.js.map +1 -0
  68. package/dist/components/date-picker/index.d.ts +130 -0
  69. package/dist/components/date-picker/index.js +310 -0
  70. package/dist/components/date-picker/index.js.map +1 -0
  71. package/dist/components/date-range-picker/index.d.ts +139 -0
  72. package/dist/components/date-range-picker/index.js +421 -0
  73. package/dist/components/date-range-picker/index.js.map +1 -0
  74. package/dist/components/disclosure/index.d.ts +94 -0
  75. package/dist/components/disclosure/index.js +365 -0
  76. package/dist/components/disclosure/index.js.map +1 -0
  77. package/dist/components/disclosure-group/index.d.ts +61 -0
  78. package/dist/components/disclosure-group/index.js +100 -0
  79. package/dist/components/disclosure-group/index.js.map +1 -0
  80. package/dist/components/drop-zone/index.d.ts +113 -0
  81. package/dist/components/drop-zone/index.js +304 -0
  82. package/dist/components/drop-zone/index.js.map +1 -0
  83. package/dist/components/fab/index.d.ts +1 -1
  84. package/dist/components/fab/index.js +91 -76
  85. package/dist/components/fab/index.js.map +1 -1
  86. package/dist/components/form/index.d.ts +3 -2
  87. package/dist/components/form/index.js.map +1 -1
  88. package/dist/components/icon-button/index.d.ts +4 -2
  89. package/dist/components/icon-button/index.js +204 -171
  90. package/dist/components/icon-button/index.js.map +1 -1
  91. package/dist/components/list/index.d.ts +15 -158
  92. package/dist/components/list/index.js +21 -1047
  93. package/dist/components/list/index.js.map +1 -1
  94. package/dist/components/list-box/index.d.ts +73 -0
  95. package/dist/components/list-box/index.js +82 -0
  96. package/dist/components/list-box/index.js.map +1 -0
  97. package/dist/components/loading-indicator/index.d.ts +32 -0
  98. package/dist/components/loading-indicator/index.js +174 -0
  99. package/dist/components/loading-indicator/index.js.map +1 -0
  100. package/dist/components/navigation-tree/index.d.ts +117 -0
  101. package/dist/components/navigation-tree/index.js +135 -0
  102. package/dist/components/navigation-tree/index.js.map +1 -0
  103. package/dist/components/number-field/index.js +132 -143
  104. package/dist/components/number-field/index.js.map +1 -1
  105. package/dist/components/range-calendar/index.d.ts +69 -0
  106. package/dist/components/range-calendar/index.js +144 -0
  107. package/dist/components/range-calendar/index.js.map +1 -0
  108. package/dist/components/search-view/index.d.ts +78 -0
  109. package/dist/components/search-view/index.js +570 -0
  110. package/dist/components/search-view/index.js.map +1 -0
  111. package/dist/components/select/index.d.ts +152 -0
  112. package/dist/components/select/index.js +419 -0
  113. package/dist/components/select/index.js.map +1 -0
  114. package/dist/components/slider/index.d.ts +111 -0
  115. package/dist/components/slider/index.js +673 -0
  116. package/dist/components/slider/index.js.map +1 -0
  117. package/dist/components/split-button/index.d.ts +77 -0
  118. package/dist/components/split-button/index.js +354 -0
  119. package/dist/components/split-button/index.js.map +1 -0
  120. package/dist/components/tabs/index.d.ts +196 -0
  121. package/dist/components/tabs/index.js +1137 -0
  122. package/dist/components/tabs/index.js.map +1 -0
  123. package/dist/components/time-field/index.d.ts +43 -0
  124. package/dist/components/time-field/index.js +107 -0
  125. package/dist/components/time-field/index.js.map +1 -0
  126. package/dist/components/time-picker/index.d.ts +65 -0
  127. package/dist/components/time-picker/index.js +1168 -0
  128. package/dist/components/time-picker/index.js.map +1 -0
  129. package/dist/components/tooltip/index.d.ts +101 -0
  130. package/dist/components/tooltip/index.js +223 -0
  131. package/dist/components/tooltip/index.js.map +1 -0
  132. package/dist/components/tree/index.d.ts +112 -0
  133. package/dist/components/tree/index.js +157 -0
  134. package/dist/components/tree/index.js.map +1 -0
  135. package/dist/disclosure/chevron.js +75 -0
  136. package/dist/disclosure/chevron.js.map +1 -0
  137. package/dist/disclosure/index.js +7 -0
  138. package/dist/disclosure/index.js.map +1 -0
  139. package/dist/drop/index.d.ts +54 -0
  140. package/dist/drop/index.js +161 -0
  141. package/dist/drop/index.js.map +1 -0
  142. package/dist/field/chevron.js +74 -0
  143. package/dist/field/chevron.js.map +1 -0
  144. package/dist/field/index.d.ts +2 -1
  145. package/dist/field/index.js +310 -154
  146. package/dist/field/index.js.map +1 -1
  147. package/dist/field/styles.js +9 -0
  148. package/dist/field/styles.js.map +1 -1
  149. package/dist/files/index.d.ts +18 -0
  150. package/dist/files/index.js +107 -0
  151. package/dist/files/index.js.map +1 -0
  152. package/dist/form/index.d.ts +5 -2
  153. package/dist/form/index.js +64 -85
  154. package/dist/form/index.js.map +1 -1
  155. package/dist/glyphs/index.js +92 -1
  156. package/dist/glyphs/index.js.map +1 -1
  157. package/dist/i18n/index.js +20 -1
  158. package/dist/i18n/index.js.map +1 -1
  159. package/dist/i18n/messages.js +1394 -34
  160. package/dist/i18n/messages.js.map +1 -1
  161. package/dist/index.d.ts +35 -3
  162. package/dist/index.js +34 -3
  163. package/dist/indicator/paths.js +23 -1
  164. package/dist/indicator/paths.js.map +1 -1
  165. package/dist/modal/index.js +92 -77
  166. package/dist/modal/index.js.map +1 -1
  167. package/dist/number/keyboard.js +16 -0
  168. package/dist/number/keyboard.js.map +1 -0
  169. package/dist/overlay/anchored.js +68 -38
  170. package/dist/overlay/anchored.js.map +1 -1
  171. package/dist/overlay/keyboard.js +57 -0
  172. package/dist/overlay/keyboard.js.map +1 -0
  173. package/dist/overlay/panel.js +173 -19
  174. package/dist/overlay/panel.js.map +1 -1
  175. package/dist/overlay/placement.js +13 -1
  176. package/dist/overlay/placement.js.map +1 -1
  177. package/dist/picker/index.js +322 -0
  178. package/dist/picker/index.js.map +1 -0
  179. package/dist/press/index.d.ts +2 -0
  180. package/dist/press/index.js +102 -100
  181. package/dist/press/index.js.map +1 -1
  182. package/dist/row/index.js +77 -69
  183. package/dist/row/index.js.map +1 -1
  184. package/dist/row/styles.js +13 -2
  185. package/dist/row/styles.js.map +1 -1
  186. package/dist/segments/field.js +277 -0
  187. package/dist/segments/field.js.map +1 -0
  188. package/dist/segments/index.js +574 -0
  189. package/dist/segments/index.js.map +1 -0
  190. package/dist/segments/styles.js +24 -0
  191. package/dist/segments/styles.js.map +1 -0
  192. package/dist/slider/index.js +145 -0
  193. package/dist/slider/index.js.map +1 -0
  194. package/dist/swatch/index.js +56 -0
  195. package/dist/swatch/index.js.map +1 -0
  196. package/package.json +11 -2
@@ -39,7 +39,8 @@ const styles = StyleSheet.create({
39
39
  * site positions over its screen.
40
40
  */
41
41
  function Fab(t0) {
42
- const $ = c(41);
42
+ const $ = c(47);
43
+ let accessibilityHint;
43
44
  let children;
44
45
  let delayLongPress;
45
46
  let href;
@@ -63,53 +64,55 @@ function Fab(t0) {
63
64
  let t5;
64
65
  let type;
65
66
  if ($[0] !== t0) {
66
- ({children, delayLongPress, disableRipple: t1, href, isDisabled: t2, label, onBlur, onFocus, onHoverIn, onHoverOut, onLongPress, onPress, onPressIn, onPressOut, ref, size: t3, slot, style, tone: t4, type, variant: t5, ...props} = t0);
67
+ ({accessibilityHint, children, delayLongPress, disableRipple: t1, href, isDisabled: t2, label, onBlur, onFocus, onHoverIn, onHoverOut, onLongPress, onPress, onPressIn, onPressOut, ref, size: t3, slot, style, tone: t4, type, variant: t5, ...props} = t0);
67
68
  $[0] = t0;
68
- $[1] = children;
69
- $[2] = delayLongPress;
70
- $[3] = href;
71
- $[4] = label;
72
- $[5] = onBlur;
73
- $[6] = onFocus;
74
- $[7] = onHoverIn;
75
- $[8] = onHoverOut;
76
- $[9] = onLongPress;
77
- $[10] = onPress;
78
- $[11] = onPressIn;
79
- $[12] = onPressOut;
80
- $[13] = props;
81
- $[14] = ref;
82
- $[15] = slot;
83
- $[16] = style;
84
- $[17] = t1;
85
- $[18] = t2;
86
- $[19] = t3;
87
- $[20] = t4;
88
- $[21] = t5;
89
- $[22] = type;
69
+ $[1] = accessibilityHint;
70
+ $[2] = children;
71
+ $[3] = delayLongPress;
72
+ $[4] = href;
73
+ $[5] = label;
74
+ $[6] = onBlur;
75
+ $[7] = onFocus;
76
+ $[8] = onHoverIn;
77
+ $[9] = onHoverOut;
78
+ $[10] = onLongPress;
79
+ $[11] = onPress;
80
+ $[12] = onPressIn;
81
+ $[13] = onPressOut;
82
+ $[14] = props;
83
+ $[15] = ref;
84
+ $[16] = slot;
85
+ $[17] = style;
86
+ $[18] = t1;
87
+ $[19] = t2;
88
+ $[20] = t3;
89
+ $[21] = t4;
90
+ $[22] = t5;
91
+ $[23] = type;
90
92
  } else {
91
- children = $[1];
92
- delayLongPress = $[2];
93
- href = $[3];
94
- label = $[4];
95
- onBlur = $[5];
96
- onFocus = $[6];
97
- onHoverIn = $[7];
98
- onHoverOut = $[8];
99
- onLongPress = $[9];
100
- onPress = $[10];
101
- onPressIn = $[11];
102
- onPressOut = $[12];
103
- props = $[13];
104
- ref = $[14];
105
- slot = $[15];
106
- style = $[16];
107
- t1 = $[17];
108
- t2 = $[18];
109
- t3 = $[19];
110
- t4 = $[20];
111
- t5 = $[21];
112
- type = $[22];
93
+ accessibilityHint = $[1];
94
+ children = $[2];
95
+ delayLongPress = $[3];
96
+ href = $[4];
97
+ label = $[5];
98
+ onBlur = $[6];
99
+ onFocus = $[7];
100
+ onHoverIn = $[8];
101
+ onHoverOut = $[9];
102
+ onLongPress = $[10];
103
+ onPress = $[11];
104
+ onPressIn = $[12];
105
+ onPressOut = $[13];
106
+ props = $[14];
107
+ ref = $[15];
108
+ slot = $[16];
109
+ style = $[17];
110
+ t1 = $[18];
111
+ t2 = $[19];
112
+ t3 = $[20];
113
+ t4 = $[21];
114
+ t5 = $[22];
115
+ type = $[23];
113
116
  }
114
117
  const disableRipple = t1 === void 0 ? false : t1;
115
118
  const isDisabled = t2 === void 0 ? false : t2;
@@ -120,7 +123,7 @@ function Fab(t0) {
120
123
  const role = useTypeRole(EXTENDED_FAB_ROLES[size]);
121
124
  const t6 = slot ?? "default";
122
125
  let t7;
123
- if ($[23] !== href || $[24] !== onPress || $[25] !== t6 || $[26] !== type) {
126
+ if ($[24] !== href || $[25] !== onPress || $[26] !== t6 || $[27] !== type) {
124
127
  t7 = {
125
128
  defaultSelected: void 0,
126
129
  href,
@@ -131,50 +134,62 @@ function Fab(t0) {
131
134
  slot: t6,
132
135
  type
133
136
  };
134
- $[23] = href;
135
- $[24] = onPress;
136
- $[25] = t6;
137
- $[26] = type;
138
- $[27] = t7;
139
- } else t7 = $[27];
137
+ $[24] = href;
138
+ $[25] = onPress;
139
+ $[26] = t6;
140
+ $[27] = type;
141
+ $[28] = t7;
142
+ } else t7 = $[28];
140
143
  const action = useButtonAction(t7);
141
144
  let t8;
142
- if ($[28] !== delayLongPress || $[29] !== href || $[30] !== onHoverIn || $[31] !== onHoverOut || $[32] !== onLongPress || $[33] !== ref || $[34] !== slot) {
145
+ if ($[29] !== accessibilityHint || $[30] !== delayLongPress || $[31] !== href || $[32] !== onHoverIn || $[33] !== onHoverOut || $[34] !== onLongPress || $[35] !== onPressIn || $[36] !== onPressOut || $[37] !== ref || $[38] !== slot) {
143
146
  t8 = {
147
+ accessibilityHint,
144
148
  delayLongPress,
145
149
  href,
146
150
  onHoverIn,
147
151
  onHoverOut,
148
152
  onLongPress,
153
+ onPressIn,
154
+ onPressOut,
149
155
  ref,
150
156
  slot
151
157
  };
152
- $[28] = delayLongPress;
153
- $[29] = href;
154
- $[30] = onHoverIn;
155
- $[31] = onHoverOut;
156
- $[32] = onLongPress;
157
- $[33] = ref;
158
- $[34] = slot;
159
- $[35] = t8;
160
- } else t8 = $[35];
158
+ $[29] = accessibilityHint;
159
+ $[30] = delayLongPress;
160
+ $[31] = href;
161
+ $[32] = onHoverIn;
162
+ $[33] = onHoverOut;
163
+ $[34] = onLongPress;
164
+ $[35] = onPressIn;
165
+ $[36] = onPressOut;
166
+ $[37] = ref;
167
+ $[38] = slot;
168
+ $[39] = t8;
169
+ } else t8 = $[39];
161
170
  const t9 = useSlotTrigger(t8);
162
171
  let hoverIn;
163
172
  let hoverOut;
164
173
  let longPress;
174
+ let pressIn;
175
+ let pressOut;
165
176
  let triggerProps;
166
- if ($[36] !== t9) {
167
- ({onHoverIn: hoverIn, onHoverOut: hoverOut, onLongPress: longPress, ...triggerProps} = t9);
168
- $[36] = t9;
169
- $[37] = hoverIn;
170
- $[38] = hoverOut;
171
- $[39] = longPress;
172
- $[40] = triggerProps;
177
+ if ($[40] !== t9) {
178
+ ({onHoverIn: hoverIn, onHoverOut: hoverOut, onLongPress: longPress, onPressIn: pressIn, onPressOut: pressOut, ...triggerProps} = t9);
179
+ $[40] = t9;
180
+ $[41] = hoverIn;
181
+ $[42] = hoverOut;
182
+ $[43] = longPress;
183
+ $[44] = pressIn;
184
+ $[45] = pressOut;
185
+ $[46] = triggerProps;
173
186
  } else {
174
- hoverIn = $[37];
175
- hoverOut = $[38];
176
- longPress = $[39];
177
- triggerProps = $[40];
187
+ hoverIn = $[41];
188
+ hoverOut = $[42];
189
+ longPress = $[43];
190
+ pressIn = $[44];
191
+ pressOut = $[45];
192
+ triggerProps = $[46];
178
193
  }
179
194
  const palettes = fabPalettesOf(theme);
180
195
  const colors = isDisabled ? palettes.disabled : palettes[variant][tone];
@@ -186,8 +201,8 @@ function Fab(t0) {
186
201
  onFocus,
187
202
  onHoverIn: hoverIn,
188
203
  onHoverOut: hoverOut,
189
- onPressIn,
190
- onPressOut
204
+ onPressIn: pressIn,
205
+ onPressOut: pressOut
191
206
  });
192
207
  const corner = fabCornersOf(theme)[size];
193
208
  const isExtended = label !== void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","PressableProps","StyleProp","TextStyle","ViewStyle","AnimatedStyle","Text","NativeText","StyleSheet","View","ButtonLinkForm","ButtonPressForm","FabSize","FabTone","FabVariant","IconStyle","AnimatedPressable","buttonStyles","useButtonAction","useSlotTrigger","EXTENDED_FAB_ROLES","extendedFabSizesOf","FAB_ICON_SIZES","fabCornersOf","fabPalettesOf","fabShadowOf","fabSizesOf","IconStyleContext","usePressFeedback","useTheme","composeStyles","useTypeRole","FabNaming","label","FabPressForm","Omit","isPending","pendingLabel","FabProps","children","disableRipple","isDisabled","ref","size","style","tone","variant","styles","create","base","alignItems","flexDirection","flexShrink","justifyContent","icon","Fab","t0","$","_c","delayLongPress","href","onBlur","onFocus","onHoverIn","onHoverOut","onLongPress","onPress","onPressIn","onPressOut","props","slot","t1","t2","t3","t4","t5","type","undefined","theme","role","t6","t7","defaultSelected","isSelected","isToggle","onChange","action","t8","t9","hoverIn","hoverOut","longPress","triggerProps","palettes","colors","disabled","feedback","color","content","corner","isExtended","handlers","container","ring","clip","layer","iconStyleOf","_c","NativeText"],"sources":["../../../src/components/fab/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type {\n PressableProps,\n StyleProp,\n TextStyle,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\n\nimport { Text as NativeText, StyleSheet, View } from 'react-native'\n\nimport type { ButtonLinkForm, ButtonPressForm } from '../../button'\nimport type { FabSize, FabTone, FabVariant } from '../../fab'\nimport type { IconStyle } from '../../glyphs/icon-style'\n\nimport {\n AnimatedPressable,\n buttonStyles,\n useButtonAction,\n useSlotTrigger,\n} from '../../button'\nimport {\n EXTENDED_FAB_ROLES,\n extendedFabSizesOf,\n FAB_ICON_SIZES,\n fabCornersOf,\n fabPalettesOf,\n fabShadowOf,\n fabSizesOf,\n} from '../../fab'\nimport { IconStyleContext } from '../../glyphs/icon-style'\nimport { usePressFeedback } from '../../press'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\n\n// kanso-ui's Fab: the FAB page's floating action button, and the extended\n// FAB page's form of it with a label. A screen's primary action, raised over\n// the content on the pages' level 3 shadow and lifted to level 4 under a\n// hovering pointer, which is an iPad's or an Android mouse's, since a finger\n// never hovers.\n//\n// Three sizes, the pages' FAB, medium FAB and large FAB: `md` is 56dp with a\n// 24dp icon and a 16dp corner, `lg` 80dp with 28dp and 20dp, and `xl` 96dp\n// with 36dp and 28dp. The extended form keeps the size's height and corner\n// and sets a label after the icon in the size's type role, title medium,\n// title large and headline small, with 16dp, 26dp and 28dp of padding and\n// 8dp, 12dp and 16dp before the label. The 80dp size, the 20dp corner and\n// the 26dp and 28dp paddings fall between steps of their scales and are\n// written out. The pages' small FAB is gone from the newer set, so there is\n// no `xs`.\n//\n// Six colour pairs, by `tone` and `variant`: `tonal` draws the tone's\n// container pair, primary container being the pages' default, and `filled`\n// the tone itself, as Button's two variants of those names do.\n//\n// The hover, focus and pressed layers and the ripple are src/press's, in the\n// icon's colour over the container, as Button's are. The pages give no\n// disabled FAB; a disabled one takes the container every disabled button\n// takes, on-surface at the two disabled opacities, and drops its shadow.\n//\n// Unlike Button, the corner does not morph: the pages draw the FAB at one\n// shape in every state, as web does. Web's forced-colours rule has no\n// counterpart on iOS or Android and is not drawn.\n//\n// It is placed as any view is. A column stretches the extended form as it\n// does a Button, so a FAB floating over a screen takes its place from the\n// call site's `style`.\n//\n// What a press does, the link form and the slot it fills in an overlay are\n// src/button's, shared with Button and IconButton. The metrics and colours\n// are src/fab's, shared with FabMenu's FAB.\n\ntype FabNaming =\n | {\n /**\n * What the FAB does, in words. A FAB without a `label` is an icon\n * alone, which has no name of its own, so it needs this; with a\n * `label` the label is its name.\n */\n readonly 'aria-label': string\n readonly label?: never\n }\n | {\n readonly 'aria-label'?: string\n /**\n * A label after the icon, which makes this the extended FAB: as tall\n * as the size, as wide as what it holds.\n */\n readonly label: ReactNode\n }\n\n// A plain button's form, without the pending state web's FAB leaves out.\n// The two are named `never`, so a FAB given them does not compile.\ntype FabPressForm = Omit<ButtonPressForm, 'isPending' | 'pendingLabel'> & {\n readonly isPending?: never\n readonly pendingLabel?: never\n}\n\ntype FabProps = (ButtonLinkForm | FabPressForm) &\n FabNaming &\n Omit<PressableProps, 'aria-label' | 'children' | 'disabled' | 'style'> & {\n /**\n * The FAB's icon. The FAB hands it its colour and the size's icon size\n * through `useIconStyle()`.\n */\n readonly children?: ReactNode\n /**\n * Draws no press ripple. The state layers are unaffected.\n * @default false\n */\n readonly disableRipple?: boolean\n /**\n * Draws the FAB disabled, without its shadow, and takes no presses.\n * @default false\n */\n readonly isDisabled?: boolean\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * The pages' three sizes: `md` the FAB at 56dp, `lg` the medium FAB at\n * 80dp and `xl` the large FAB at 96dp.\n * @default 'md'\n */\n readonly size?: FabSize\n readonly style?: StyleProp<ViewStyle>\n /**\n * The colour role the FAB is drawn in.\n * @default 'primary'\n */\n readonly tone?: FabTone\n /**\n * `tonal` draws the tone's container pair, the pages' default; `filled`\n * draws the tone itself.\n * @default 'tonal'\n */\n readonly variant?: FabVariant\n }\n\nconst styles = StyleSheet.create({\n // The icon and the label sit in the middle of the container, and a row\n // never squeezes it.\n base: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 0,\n justifyContent: 'center',\n },\n icon: {\n alignItems: 'center',\n flexShrink: 0,\n justifyContent: 'center',\n },\n label: {\n flexShrink: 1,\n },\n})\n\n/**\n * A screen's primary action, raised over its content. Its icon is its\n * children; given a `label` it is the extended FAB, with the label after the\n * icon. Given `href` it is a link with the same appearance.\n *\n * ```tsx\n * <Fab aria-label=\"Label\">\n * <PlusIcon />\n * </Fab>\n * ```\n *\n * Without a `label` it is an icon alone, so `aria-label` is required there.\n * `style`, `ref` and `testID` land on the `Pressable`, which is what a call\n * site positions over its screen.\n */\nfunction Fab({\n children,\n delayLongPress,\n disableRipple = false,\n href,\n isDisabled = false,\n label,\n onBlur,\n onFocus,\n onHoverIn,\n onHoverOut,\n onLongPress,\n onPress,\n onPressIn,\n onPressOut,\n ref,\n size = 'md',\n slot,\n style,\n tone = 'primary',\n type,\n variant = 'tonal',\n ...props\n}: FabProps) {\n const theme = useTheme()\n const role = useTypeRole(EXTENDED_FAB_ROLES[size])\n const action = useButtonAction({\n defaultSelected: undefined,\n href,\n isSelected: undefined,\n isToggle: false,\n onChange: undefined,\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 palettes = fabPalettesOf(theme)\n const colors = isDisabled ? palettes.disabled : palettes[variant][tone]\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 })\n const corner = fabCornersOf(theme)[size]\n const isExtended = label !== undefined\n\n return (\n <AnimatedPressable\n role={href === undefined ? 'button' : 'link'}\n {...props}\n {...triggerProps}\n {...feedback.handlers}\n disabled={isDisabled}\n onLongPress={longPress}\n onPress={action.onPress}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.base,\n isExtended ? extendedFabSizesOf(theme)[size] : fabSizesOf(theme)[size],\n corner,\n colors.container,\n fabShadowOf(feedback, isDisabled, theme),\n feedback.ring,\n style,\n )}\n >\n <View style={composeStyles<ViewStyle>(buttonStyles.clip, corner)}>\n {feedback.layer}\n </View>\n {children === undefined ? null : (\n <View style={styles.icon}>\n <IconStyleContext value={iconStyleOf(colors.content, size)}>\n {children}\n </IconStyleContext>\n </View>\n )}\n {isExtended ? (\n <NativeText\n style={composeStyles<TextStyle>(role, styles.label, colors.label)}\n >\n {label}\n </NativeText>\n ) : null}\n </AnimatedPressable>\n )\n}\n\nfunction iconStyleOf(color: string, size: FabSize): IconStyle {\n return { color, size: FAB_ICON_SIZES[size] }\n}\n\nexport { Fab }\nexport type { FabProps, FabSize, FabTone, FabVariant }\n"],"mappings":";;;;;;;;;;;AA0IA,MAAMiD,SAASvC,WAAWwC,OAAO;CAG/BC,MAAM;EACJC,YAAY;EACZC,eAAe;EACfC,YAAY;EACZC,gBAAgB;CAClB;CACAC,MAAM;EACJJ,YAAY;EACZE,YAAY;EACZC,gBAAgB;CAClB;CACApB,OAAO,EACLmB,YAAY,EACd;AACF,CAAC;;;;;;;;;;;;;;;;AAiBD,SAAAG,IAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAnB;CAAA,IAAAoB;CAAA,IAAAC;CAAA,IAAA3B;CAAA,IAAA4B;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAA3B;CAAA,IAAA4B;CAAA,IAAA1B;CAAA,IAAA2B;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAnB,EAAA,OAAAD,IAAA;EAAa,CAAA,CAAAjB,UAAAoB,gBAAAnB,eAAA+B,IAAAX,MAAAnB,YAAA+B,IAAAvC,OAAA4B,QAAAC,SAAAC,WAAAC,YAAAC,aAAAC,SAAAC,WAAAC,YAAA1B,KAAAC,MAAA8B,I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aACC,oBAACQ,MAAD;IACS,OAAA9E,cAAyBiD,MAAMhC,OAAMd,OAAQ6D,OAAM7D,KAAM;IAE/DA,UAAAA;GAHQ,CAAA,IADZ;EA5Be;;AAmCE;AAIxB,SAASyE,YAAYT,OAAetD,MAA0B;CAC5D,OAAO;EAAEsD;EAAOtD,MAAMrB,eAAeqB;CAAM;AAC7C"}
1
+ {"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","PressableProps","StyleProp","TextStyle","ViewStyle","AnimatedStyle","Text","NativeText","StyleSheet","View","ButtonLinkForm","ButtonPressForm","FabSize","FabTone","FabVariant","IconStyle","AnimatedPressable","buttonStyles","useButtonAction","useSlotTrigger","EXTENDED_FAB_ROLES","extendedFabSizesOf","FAB_ICON_SIZES","fabCornersOf","fabPalettesOf","fabShadowOf","fabSizesOf","IconStyleContext","usePressFeedback","useTheme","composeStyles","useTypeRole","FabNaming","label","FabPressForm","Omit","isPending","pendingLabel","FabProps","children","disableRipple","isDisabled","ref","size","style","tone","variant","styles","create","base","alignItems","flexDirection","flexShrink","justifyContent","icon","Fab","t0","$","_c","accessibilityHint","delayLongPress","href","onBlur","onFocus","onHoverIn","onHoverOut","onLongPress","onPress","onPressIn","onPressOut","props","slot","t1","t2","t3","t4","t5","type","undefined","theme","role","t6","t7","defaultSelected","isSelected","isToggle","onChange","action","t8","t9","hoverIn","hoverOut","longPress","pressIn","pressOut","triggerProps","palettes","colors","disabled","feedback","color","content","corner","isExtended","handlers","container","ring","clip","layer","iconStyleOf","_c","NativeText"],"sources":["../../../src/components/fab/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref } from 'react'\nimport type {\n PressableProps,\n StyleProp,\n TextStyle,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle } from 'react-native-reanimated'\n\nimport { Text as NativeText, StyleSheet, View } from 'react-native'\n\nimport type { ButtonLinkForm, ButtonPressForm } from '../../button'\nimport type { FabSize, FabTone, FabVariant } from '../../fab'\nimport type { IconStyle } from '../../glyphs/icon-style'\n\nimport {\n AnimatedPressable,\n buttonStyles,\n useButtonAction,\n useSlotTrigger,\n} from '../../button'\nimport {\n EXTENDED_FAB_ROLES,\n extendedFabSizesOf,\n FAB_ICON_SIZES,\n fabCornersOf,\n fabPalettesOf,\n fabShadowOf,\n fabSizesOf,\n} from '../../fab'\nimport { IconStyleContext } from '../../glyphs/icon-style'\nimport { usePressFeedback } from '../../press'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles } from '../../theme/styles'\nimport { useTypeRole } from '../../typography/roles'\n\n// kanso-ui's Fab: the FAB page's floating action button, and the extended\n// FAB page's form of it with a label. A screen's primary action, raised over\n// the content on the pages' level 3 shadow and lifted to level 4 under a\n// hovering pointer, which is an iPad's or an Android mouse's, since a finger\n// never hovers.\n//\n// Three sizes, the pages' FAB, medium FAB and large FAB: `md` is 56dp with a\n// 24dp icon and a 16dp corner, `lg` 80dp with 28dp and 20dp, and `xl` 96dp\n// with 36dp and 28dp. The extended form keeps the size's height and corner\n// and sets a label after the icon in the size's type role, title medium,\n// title large and headline small, with 16dp, 26dp and 28dp of padding and\n// 8dp, 12dp and 16dp before the label. The 80dp size, the 20dp corner and\n// the 26dp and 28dp paddings fall between steps of their scales and are\n// written out. The pages' small FAB is gone from the newer set, so there is\n// no `xs`.\n//\n// Six colour pairs, by `tone` and `variant`: `tonal` draws the tone's\n// container pair, primary container being the pages' default, and `filled`\n// the tone itself, as Button's two variants of those names do.\n//\n// The hover, focus and pressed layers and the ripple are src/press's, in the\n// icon's colour over the container, as Button's are. The pages give no\n// disabled FAB; a disabled one takes the container every disabled button\n// takes, on-surface at the two disabled opacities, and drops its shadow.\n//\n// Unlike Button, the corner does not morph: the pages draw the FAB at one\n// shape in every state, as web does. Web's forced-colours rule has no\n// counterpart on iOS or Android and is not drawn.\n//\n// It is placed as any view is. A column stretches the extended form as it\n// does a Button, so a FAB floating over a screen takes its place from the\n// call site's `style`.\n//\n// What a press does, the link form and the slot it fills in an overlay are\n// src/button's, shared with Button and IconButton. The metrics and colours\n// are src/fab's, shared with FabMenu's FAB.\n\ntype FabNaming =\n | {\n /**\n * What the FAB does, in words. A FAB without a `label` is an icon\n * alone, which has no name of its own, so it needs this; with a\n * `label` the label is its name.\n */\n readonly 'aria-label': string\n readonly label?: never\n }\n | {\n readonly 'aria-label'?: string\n /**\n * A label after the icon, which makes this the extended FAB: as tall\n * as the size, as wide as what it holds.\n */\n readonly label: ReactNode\n }\n\n// A plain button's form, without the pending state web's FAB leaves out.\n// The two are named `never`, so a FAB given them does not compile.\ntype FabPressForm = Omit<ButtonPressForm, 'isPending' | 'pendingLabel'> & {\n readonly isPending?: never\n readonly pendingLabel?: never\n}\n\ntype FabProps = (ButtonLinkForm | FabPressForm) &\n FabNaming &\n Omit<PressableProps, 'aria-label' | 'children' | 'disabled' | 'style'> & {\n /**\n * The FAB's icon. The FAB hands it its colour and the size's icon size\n * through `useIconStyle()`.\n */\n readonly children?: ReactNode\n /**\n * Draws no press ripple. The state layers are unaffected.\n * @default false\n */\n readonly disableRipple?: boolean\n /**\n * Draws the FAB disabled, without its shadow, and takes no presses.\n * @default false\n */\n readonly isDisabled?: boolean\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * The pages' three sizes: `md` the FAB at 56dp, `lg` the medium FAB at\n * 80dp and `xl` the large FAB at 96dp.\n * @default 'md'\n */\n readonly size?: FabSize\n readonly style?: StyleProp<ViewStyle>\n /**\n * The colour role the FAB is drawn in.\n * @default 'primary'\n */\n readonly tone?: FabTone\n /**\n * `tonal` draws the tone's container pair, the pages' default; `filled`\n * draws the tone itself.\n * @default 'tonal'\n */\n readonly variant?: FabVariant\n }\n\nconst styles = StyleSheet.create({\n // The icon and the label sit in the middle of the container, and a row\n // never squeezes it.\n base: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 0,\n justifyContent: 'center',\n },\n icon: {\n alignItems: 'center',\n flexShrink: 0,\n justifyContent: 'center',\n },\n label: {\n flexShrink: 1,\n },\n})\n\n/**\n * A screen's primary action, raised over its content. Its icon is its\n * children; given a `label` it is the extended FAB, with the label after the\n * icon. Given `href` it is a link with the same appearance.\n *\n * ```tsx\n * <Fab aria-label=\"Label\">\n * <PlusIcon />\n * </Fab>\n * ```\n *\n * Without a `label` it is an icon alone, so `aria-label` is required there.\n * `style`, `ref` and `testID` land on the `Pressable`, which is what a call\n * site positions over its screen.\n */\nfunction Fab({\n accessibilityHint,\n children,\n delayLongPress,\n disableRipple = false,\n href,\n isDisabled = false,\n label,\n onBlur,\n onFocus,\n onHoverIn,\n onHoverOut,\n onLongPress,\n onPress,\n onPressIn,\n onPressOut,\n ref,\n size = 'md',\n slot,\n style,\n tone = 'primary',\n type,\n variant = 'tonal',\n ...props\n}: FabProps) {\n const theme = useTheme()\n const role = useTypeRole(EXTENDED_FAB_ROLES[size])\n const action = useButtonAction({\n defaultSelected: undefined,\n href,\n isSelected: undefined,\n isToggle: false,\n onChange: undefined,\n onPress,\n slot: slot ?? 'default',\n type,\n })\n const {\n onHoverIn: hoverIn,\n onHoverOut: hoverOut,\n onLongPress: longPress,\n onPressIn: pressIn,\n onPressOut: pressOut,\n ...triggerProps\n } = useSlotTrigger({\n accessibilityHint,\n delayLongPress,\n href,\n onHoverIn,\n onHoverOut,\n onLongPress,\n onPressIn,\n onPressOut,\n ref,\n slot,\n })\n const palettes = fabPalettesOf(theme)\n const colors = isDisabled ? palettes.disabled : palettes[variant][tone]\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: pressIn,\n onPressOut: pressOut,\n })\n const corner = fabCornersOf(theme)[size]\n const isExtended = label !== undefined\n\n return (\n <AnimatedPressable\n role={href === undefined ? 'button' : 'link'}\n {...props}\n {...triggerProps}\n {...feedback.handlers}\n disabled={isDisabled}\n onLongPress={longPress}\n onPress={action.onPress}\n style={composeStyles<AnimatedStyle<ViewStyle>>(\n styles.base,\n isExtended ? extendedFabSizesOf(theme)[size] : fabSizesOf(theme)[size],\n corner,\n colors.container,\n fabShadowOf(feedback, isDisabled, theme),\n feedback.ring,\n style,\n )}\n >\n <View style={composeStyles<ViewStyle>(buttonStyles.clip, corner)}>\n {feedback.layer}\n </View>\n {children === undefined ? null : (\n <View style={styles.icon}>\n <IconStyleContext value={iconStyleOf(colors.content, size)}>\n {children}\n </IconStyleContext>\n </View>\n )}\n {isExtended ? (\n <NativeText\n style={composeStyles<TextStyle>(role, styles.label, colors.label)}\n >\n {label}\n </NativeText>\n ) : null}\n </AnimatedPressable>\n )\n}\n\nfunction iconStyleOf(color: string, size: FabSize): IconStyle {\n return { color, size: FAB_ICON_SIZES[size] }\n}\n\nexport { Fab }\nexport type { FabProps, FabSize, FabTone, FabVariant }\n"],"mappings":";;;;;;;;;;;AA0IA,MAAMiD,SAASvC,WAAWwC,OAAO;CAG/BC,MAAM;EACJC,YAAY;EACZC,eAAe;EACfC,YAAY;EACZC,gBAAgB;CAClB;CACAC,MAAM;EACJJ,YAAY;EACZE,YAAY;EACZC,gBAAgB;CAClB;CACApB,OAAO,EACLmB,YAAY,EACd;AACF,CAAC;;;;;;;;;;;;;;;;AAiBD,SAAAG,IAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAApB;CAAA,IAAAqB;CAAA,IAAAC;CAAA,IAAA5B;CAAA,IAAA6B;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAA5B;CAAA,IAAA6B;CAAA,IAAA3B;CAAA,IAAA4B;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAApB,EAAA,OAAAD,IAAA;EAAa,CAAA,CAAAG,mBAAApB,UAAAqB,gBAAApB,eAAAgC,IAAAX,MAAApB,YAAAgC,IAAAxC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BAAmB0D,KAAK,CAAC,CAACpC,QAAQjB,WAAWqD,KAAK,CAAC,CAACpC,OACjE2D,QACAL,OAAMQ,WACNhF,YAAY0E,UAAU1D,YAAYsC,KAAK,GACvCoB,SAAQO,MACR9D,KACF;EAhBF,UAAA;GAkBE,oBAAC,MAAD;IAAa,OAAAd,cAAyBb,aAAY0F,MAAOL,MAAM;IAC5DH,UAAAA,SAAQS;GADN,CAAA;GAGJrE,aAAauC,KAAAA,IAAb,OACC,oBAAC,MAAD;IAAa,OAAA/B,OAAMO;IACjB,UAAA,oBAAC,kBAAD;KAAyB,OAAAuD,YAAYZ,OAAMI,SAAU1D,IAAI;KACtDJ;IADc,CAAA;GADd,CAAA;GAMNgE,aACC,oBAACQ,MAAD;IACS,OAAAjF,cAAyBkD,MAAMjC,OAAMd,OAAQgE,OAAMhE,KAAM;IAE/DA,UAAAA;GAHQ,CAAA,IADZ;EA5Be;;AAmCE;AAIxB,SAAS4E,YAAYT,OAAezD,MAA0B;CAC5D,OAAO;EAAEyD;EAAOzD,MAAMrB,eAAeqB;CAAM;AAC7C"}
@@ -17,8 +17,9 @@ type FormProps = {
17
17
  * Called with the values when the form is submitted: each field with a
18
18
  * `name` and not disabled, as the string a web form submits for it, so a
19
19
  * number field's value is its number written out, and an empty one is
20
- * `''`. Under `native` it is not called while a field blocks the
21
- * submission.
20
+ * `''`. A checkbox group's is the list of its ticked entries' values, an
21
+ * empty list while none is ticked. Under `native` it is not called while a
22
+ * field blocks the submission.
22
23
  */
23
24
  readonly onSubmit?: (values: FormValues) => void;
24
25
  readonly ref?: Ref<FormHandle>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ReactNode","Ref","useImperativeHandle","useMemo","useState","FormValidationBehavior","FormValues","ValidationErrors","createRegistry","FIELD_VALIDATION_BEHAVIOR","FormContext","submitOf","FormHandle","requestSubmit","FormProps","children","onSubmit","values","ref","validationBehavior","validationErrors","NO_ERRORS","Form","t0","$","_c","t1","t2","undefined","registry","t3","t4","state","t5","t6","t7","_c"],"sources":["../../../src/components/form/index.tsx"],"sourcesContent":["import type { ReactNode, Ref } from 'react'\n\nimport { useImperativeHandle, useMemo, useState } from 'react'\n\nimport type {\n FormValidationBehavior,\n FormValues,\n ValidationErrors,\n} from '../../form'\n\nimport {\n createRegistry,\n FIELD_VALIDATION_BEHAVIOR,\n FormContext,\n submitOf,\n} from '../../form'\n\n// No Material Design page of its own, as on web: a form is the fields inside\n// it, and the text fields page is what each of them draws. The error a form\n// reports lands in the field's supporting text, in the error role, under the\n// box.\n//\n// Native has no form element, so this is a context around its fields rather\n// than an element of its own. It draws nothing and lays nothing out; a Stack\n// inside it is what spaces the fields. It hands each field inside it two\n// things, as React Aria's Form does on web: `validationErrors`, keyed by each\n// field's `name`, which is how a server's answer reaches the fields without\n// any of them changing, and `validationBehavior`, which every field reads in\n// place of its own. And it reserves each field's message line, so an error\n// that arrives later moves nothing below the field.\n//\n// Native has no browser to validate or submit either, so the form does both.\n// A Button with `type=\"submit\"` inside it submits it, as does\n// `requestSubmit()` on its ref, which is how the keyboard's return key does.\n\n/** What a form's ref holds. */\ntype FormHandle = {\n /**\n * Submits the form, as a Button with `type=\"submit\"` inside it does: under\n * `native` it is held back while a field blocks it, and otherwise\n * `onSubmit` is handed the values. Named after the web form's method that\n * does the same.\n */\n readonly requestSubmit: () => void\n}\n\ntype FormProps = {\n readonly children?: ReactNode\n /**\n * Called with the values when the form is submitted: each field with a\n * `name` and not disabled, as the string a web form submits for it, so a\n * number field's value is its number written out, and an empty one is\n * `''`. Under `native` it is not called while a field blocks the\n * submission.\n */\n readonly onSubmit?: (values: FormValues) => void\n readonly ref?: Ref<FormHandle>\n /**\n * How the fields inside validate. `aria` marks a field invalid and shows\n * its error as soon as the field says so, through its `validate`, and\n * lets the form submit regardless. `native` holds the submission back\n * while a field is required and empty or rejected by its `validate`, shows\n * each such field's error once submission is tried, and focuses the first\n * of them.\n *\n * Under `aria`, moving focus after a server answers is the call site's.\n * Each error is announced as it appears under its field, but nothing\n * moves, because no part of the form knows a round trip happened:\n * `validationErrors` is a prop rather than an event, so a form cannot tell\n * a submission coming back from a first render that was given errors to\n * begin with. Focus the first field that came back invalid through its\n * `inputRef`, as the Async submit story does.\n * @default 'aria'\n */\n readonly validationBehavior?: FormValidationBehavior\n /**\n * Errors to show under the fields, keyed by each field's `name`, such as\n * what a server sent back: one message, or several shown as one line. A\n * field's error stays until the field is edited, and a new object shows\n * them all again.\n */\n readonly validationErrors?: ValidationErrors\n}\n\nconst NO_ERRORS: ValidationErrors = {}\n\n/**\n * A form: the fields inside it and what they are told about validation. Pass\n * `validationErrors`, an object keyed by field `name`, to show what a server\n * sent back under each field, and `validationBehavior=\"native\"` to hold the\n * submission back while a required field is empty or a field's `validate`\n * rejects its value. A Button with `type=\"submit\"` inside it submits it, and\n * `onSubmit` is handed the values by name.\n *\n * ```tsx\n * <Form onSubmit={(values) => save(values)}>\n * <Stack gap=\"md\">\n * <TextField label=\"Headline\" name=\"headline\" />\n * <Button type=\"submit\">Save changes</Button>\n * </Stack>\n * </Form>\n * ```\n *\n * Handing `validationErrors` back from a submission is where a reader has to\n * be told something arrived: see `validationBehavior` for what the form does\n * and what it leaves to the call site.\n *\n * A form also reserves each field's message line. A field on its own draws\n * that line only once it has something to say, so an error arriving after a\n * submit or an async check makes the field taller and moves everything below\n * it down the screen. Inside a form the line is there from the start, empty,\n * and nothing moves when it fills.\n *\n * It draws nothing, so it takes no `style`; its ref is a handle whose\n * `requestSubmit()` submits it.\n */\nfunction Form({\n children,\n onSubmit,\n ref,\n validationBehavior = FIELD_VALIDATION_BEHAVIOR,\n validationErrors = NO_ERRORS,\n}: FormProps) {\n const [registry] = useState(createRegistry)\n const requestSubmit = submitOf(registry, validationBehavior, onSubmit)\n const state = useMemo(\n () => ({ registry, requestSubmit, validationBehavior, validationErrors }),\n [registry, requestSubmit, validationBehavior, validationErrors],\n )\n\n useImperativeHandle(ref, () => ({ requestSubmit }), [requestSubmit])\n\n return <FormContext value={state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A;CAAnEtB,oBAAoBgB,KAAKe,IAA2BC,EAAe;CAAC,IAAAC;CAAA,IAAAX,EAAA,QAAAT,YAAAS,EAAA,QAAAQ,OAAA;EAE7DG,KAAA,oBAAC,aAAD;GAAoBH,OAAAA;GAAQjB;EAAhB,CAAA;EAAuCS,EAAA,MAAAT;EAAAS,EAAA,MAAAQ;EAAAR,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OAAnDW;AAAmD"}
1
+ {"version":3,"file":"index.js","names":["ReactNode","Ref","useImperativeHandle","useMemo","useState","FormValidationBehavior","FormValues","ValidationErrors","createRegistry","FIELD_VALIDATION_BEHAVIOR","FormContext","submitOf","FormHandle","requestSubmit","FormProps","children","onSubmit","values","ref","validationBehavior","validationErrors","NO_ERRORS","Form","t0","$","_c","t1","t2","undefined","registry","t3","t4","state","t5","t6","t7","_c"],"sources":["../../../src/components/form/index.tsx"],"sourcesContent":["import type { ReactNode, Ref } from 'react'\n\nimport { useImperativeHandle, useMemo, useState } from 'react'\n\nimport type {\n FormValidationBehavior,\n FormValues,\n ValidationErrors,\n} from '../../form'\n\nimport {\n createRegistry,\n FIELD_VALIDATION_BEHAVIOR,\n FormContext,\n submitOf,\n} from '../../form'\n\n// No Material Design page of its own, as on web: a form is the fields inside\n// it, and the text fields page is what each of them draws. The error a form\n// reports lands in the field's supporting text, in the error role, under the\n// box.\n//\n// Native has no form element, so this is a context around its fields rather\n// than an element of its own. It draws nothing and lays nothing out; a Stack\n// inside it is what spaces the fields. It hands each field inside it two\n// things, as React Aria's Form does on web: `validationErrors`, keyed by each\n// field's `name`, which is how a server's answer reaches the fields without\n// any of them changing, and `validationBehavior`, which every field reads in\n// place of its own. And it reserves each field's message line, so an error\n// that arrives later moves nothing below the field.\n//\n// Native has no browser to validate or submit either, so the form does both.\n// A Button with `type=\"submit\"` inside it submits it, as does\n// `requestSubmit()` on its ref, which is how the keyboard's return key does.\n\n/** What a form's ref holds. */\ntype FormHandle = {\n /**\n * Submits the form, as a Button with `type=\"submit\"` inside it does: under\n * `native` it is held back while a field blocks it, and otherwise\n * `onSubmit` is handed the values. Named after the web form's method that\n * does the same.\n */\n readonly requestSubmit: () => void\n}\n\ntype FormProps = {\n readonly children?: ReactNode\n /**\n * Called with the values when the form is submitted: each field with a\n * `name` and not disabled, as the string a web form submits for it, so a\n * number field's value is its number written out, and an empty one is\n * `''`. A checkbox group's is the list of its ticked entries' values, an\n * empty list while none is ticked. Under `native` it is not called while a\n * field blocks the submission.\n */\n readonly onSubmit?: (values: FormValues) => void\n readonly ref?: Ref<FormHandle>\n /**\n * How the fields inside validate. `aria` marks a field invalid and shows\n * its error as soon as the field says so, through its `validate`, and\n * lets the form submit regardless. `native` holds the submission back\n * while a field is required and empty or rejected by its `validate`, shows\n * each such field's error once submission is tried, and focuses the first\n * of them.\n *\n * Under `aria`, moving focus after a server answers is the call site's.\n * Each error is announced as it appears under its field, but nothing\n * moves, because no part of the form knows a round trip happened:\n * `validationErrors` is a prop rather than an event, so a form cannot tell\n * a submission coming back from a first render that was given errors to\n * begin with. Focus the first field that came back invalid through its\n * `inputRef`, as the Async submit story does.\n * @default 'aria'\n */\n readonly validationBehavior?: FormValidationBehavior\n /**\n * Errors to show under the fields, keyed by each field's `name`, such as\n * what a server sent back: one message, or several shown as one line. A\n * field's error stays until the field is edited, and a new object shows\n * them all again.\n */\n readonly validationErrors?: ValidationErrors\n}\n\nconst NO_ERRORS: ValidationErrors = {}\n\n/**\n * A form: the fields inside it and what they are told about validation. Pass\n * `validationErrors`, an object keyed by field `name`, to show what a server\n * sent back under each field, and `validationBehavior=\"native\"` to hold the\n * submission back while a required field is empty or a field's `validate`\n * rejects its value. A Button with `type=\"submit\"` inside it submits it, and\n * `onSubmit` is handed the values by name.\n *\n * ```tsx\n * <Form onSubmit={(values) => save(values)}>\n * <Stack gap=\"md\">\n * <TextField label=\"Headline\" name=\"headline\" />\n * <Button type=\"submit\">Save changes</Button>\n * </Stack>\n * </Form>\n * ```\n *\n * Handing `validationErrors` back from a submission is where a reader has to\n * be told something arrived: see `validationBehavior` for what the form does\n * and what it leaves to the call site.\n *\n * A form also reserves each field's message line. A field on its own draws\n * that line only once it has something to say, so an error arriving after a\n * submit or an async check makes the field taller and moves everything below\n * it down the screen. Inside a form the line is there from the start, empty,\n * and nothing moves when it fills.\n *\n * It draws nothing, so it takes no `style`; its ref is a handle whose\n * `requestSubmit()` submits it.\n */\nfunction Form({\n children,\n onSubmit,\n ref,\n validationBehavior = FIELD_VALIDATION_BEHAVIOR,\n validationErrors = NO_ERRORS,\n}: FormProps) {\n const [registry] = useState(createRegistry)\n const requestSubmit = submitOf(registry, validationBehavior, onSubmit)\n const state = useMemo(\n () => ({ registry, requestSubmit, validationBehavior, validationErrors }),\n [registry, requestSubmit, validationBehavior, validationErrors],\n )\n\n useImperativeHandle(ref, () => ({ requestSubmit }), [requestSubmit])\n\n return <FormContext value={state}>{children}</FormContext>\n}\n\nexport { Form }\nexport type { FormHandle, FormProps }\n"],"mappings":";;;;;AAqFA,MAAMqB,YAA8B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCrC,SAAAC,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAc,MAAA,EAAAV,UAAAC,UAAAE,KAAAC,oBAAAO,IAAAN,kBAAAO,OAAAJ;CAIZ,MAAAJ,qBAAAO,OAAAE,KAAAA,IAAAnB,4BAAAiB;CACA,MAAAN,mBAAAO,OAAAC,KAAAA,IAAAP,YAAAM;CAEA,MAAA,CAAAE,YAAmBzB,SAASI,cAAc;CAAC,IAAAsB;CAAA,IAAAN,EAAA,OAAAR,YAAAQ,EAAA,OAAAK,YAAAL,EAAA,OAAAL,oBAAA;EACrBW,KAAAnB,SAASkB,UAAUV,oBAAoBH,QAAQ;EAACQ,EAAA,KAAAR;EAAAQ,EAAA,KAAAK;EAAAL,EAAA,KAAAL;EAAAK,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAtE,MAAAX,gBAAsBiB;CAAgD,IAAAC;CAAA,IAAAP,EAAA,OAAAK,YAAAL,EAAA,OAAAX,iBAAAW,EAAA,OAAAL,sBAAAK,EAAA,OAAAJ,kBAAA;EAE7DW,KAAA;GAAAF;GAAAhB;GAAAM;GAAAC;EAAgE;EAACI,EAAA,KAAAK;EAAAL,EAAA,KAAAX;EAAAW,EAAA,KAAAL;EAAAK,EAAA,KAAAJ;EAAAI,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAD1E,MAAAQ,QACSD;CAER,IAAAE;CAAA,IAAAC;CAAA,IAAAV,EAAA,OAAAX,eAAA;EAEwBoB,YAAO,EAAApB,cAAgB;EAAIqB,KAAA,CAACrB,aAAa;EAACW,EAAA,KAAAX;EAAAW,EAAA,MAAAS;EAAAT,EAAA,MAAAU;CAAA,OAAA;EAAAD,KAAAT,EAAA;EAAAU,KAAAV,EAAA;CAAA;CAAnEtB,oBAAoBgB,KAAKe,IAA2BC,EAAe;CAAC,IAAAC;CAAA,IAAAX,EAAA,QAAAT,YAAAS,EAAA,QAAAQ,OAAA;EAE7DG,KAAA,oBAAC,aAAD;GAAoBH,OAAAA;GAAQjB;EAAhB,CAAA;EAAuCS,EAAA,MAAAT;EAAAS,EAAA,MAAAQ;EAAAR,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OAAnDW;AAAmD"}
@@ -19,6 +19,8 @@ type IconButtonProps = (ButtonLinkForm | ButtonPressForm | ButtonToggleForm) & O
19
19
  * @default false
20
20
  */
21
21
  readonly disableRipple?: boolean;
22
+ /** The key a ButtonGroup that selects reports the button by. */
23
+ readonly id?: string;
22
24
  /**
23
25
  * Draws the button disabled, and takes no presses.
24
26
  * @default false
@@ -30,7 +32,7 @@ type IconButtonProps = (ButtonLinkForm | ButtonPressForm | ButtonToggleForm) & O
30
32
  * the icon buttons spec page's XS to XL, and the same heights `Button`
31
33
  * uses, so the two line up beside each other in a row. The icon is 20dp,
32
34
  * 24dp, 24dp, 32dp and 40dp in turn.
33
- * @default 'md'
35
+ * @default the size of the ButtonGroup around it, else 'md'
34
36
  */
35
37
  readonly size?: IconButtonSize;
36
38
  readonly style?: StyleProp<ViewStyle>;
@@ -62,7 +64,7 @@ type IconButtonVariant = 'filled' | 'outlined' | 'standard' | 'tonal';
62
64
  * through `hitSlop`, which a `hitSlop` of the call site's own replaces.
63
65
  * `style`, `ref` and `testID` land on the `Pressable`.
64
66
  */
65
- declare function IconButton({ children, defaultSelected, delayLongPress, disableRipple, hitSlop: ownHitSlop, href, isDisabled, isPending, isSelected, onBlur, onChange, onFocus, onHoverIn, onHoverOut, onLayout, onLongPress, onPress, onPressIn, onPressOut, pendingLabel, ref, size, slot, style, type, variant, ...props }: IconButtonProps): import("react").JSX.Element;
67
+ declare function IconButton({ accessibilityHint, children, defaultSelected, delayLongPress, disableRipple, hitSlop: ownHitSlop, href, id, isDisabled: ownDisabled, isPending, isSelected, onBlur, onChange, onFocus, onHoverIn, onHoverOut, onLayout, onLongPress, onPress, onPressIn, onPressOut, pendingLabel, ref, size: ownSize, slot, style, type, variant, ...props }: IconButtonProps): import("react").JSX.Element;
66
68
  //#endregion
67
69
  export { IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant };
68
70
  //# sourceMappingURL=index.d.ts.map