@kanso-labs/react-native-kanso-ui 0.11.23 → 0.11.25

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.
@@ -57,7 +57,7 @@ function describedBy(id, { characterLimitLabel, description, error, locale, maxL
57
57
  * around it is what knows them.
58
58
  */
59
59
  function FieldBox(t0) {
60
- const $ = c(77);
60
+ const $ = c(43);
61
61
  const { children, control, end, floatingLabel: t1, isDisabled: t2, isFocused: t3, isInvalid: t4, isPopulated: t5, isRequired: t6, label, leading, ref, trailing, trigger, variant: t7 } = t0;
62
62
  const floatingLabel = t1 === void 0 ? true : t1;
63
63
  const isDisabled = t2 === void 0 ? false : t2;
@@ -132,80 +132,22 @@ function FieldBox(t0) {
132
132
  $[20] = t13;
133
133
  } else t13 = $[20];
134
134
  const disabledContent = t13;
135
- const T0 = Pressable;
136
135
  let t14;
137
136
  if ($[21] !== trigger) {
138
137
  t14 = trigger === void 0 ? NOT_A_CONTROL : triggerOf(trigger);
139
138
  $[21] = trigger;
140
139
  $[22] = t14;
141
140
  } else t14 = $[22];
142
- const t15 = feedback.handlers.onHoverIn;
143
- const t16 = feedback.handlers.onHoverOut;
144
- let t17;
141
+ let t15;
145
142
  if ($[23] !== control || $[24] !== trigger?.onPress) {
146
- t17 = trigger?.onPress ?? focusOf(control);
143
+ t15 = trigger?.onPress ?? focusOf(control);
147
144
  $[23] = control;
148
145
  $[24] = trigger?.onPress;
149
- $[25] = t17;
150
- } else t17 = $[25];
151
- const t18 = composeStyles(styles.box, trigger === void 0 ? void 0 : styles.boxTrigger, leading === void 0 ? void 0 : styles.boxLeading, trailing === void 0 ? void 0 : styles.boxTrailing, outlined ? styles.boxOutlined : void 0, isDisabled && !outlined ? styles.boxDisabled : void 0, minHeightOf(outlined ? 2 * spacing.lg + typography.bodyLargeLineHeight * fontScale : 2 * spacing.sm + (typography.bodySmallLineHeight + typography.bodyLargeLineHeight) * fontScale));
152
- const t19 = outlined ? /* @__PURE__ */ jsxs(View, {
153
- "aria-hidden": true,
154
- style: styles.outline,
155
- children: [
156
- /* @__PURE__ */ jsx(View, {
157
- style: composeStyles(styles.outlineStart, widthOf(outlineInset(spacing, leading))),
158
- children: /* @__PURE__ */ jsx(FieldStroke, {
159
- color: rule.color,
160
- sides: "all",
161
- style: styles.outlineStartBox,
162
- width: rule.width
163
- })
164
- }),
165
- /* @__PURE__ */ jsx(View, {
166
- style: composeStyles(styles.outlineNotch, widthOf(floated ? notch : 0)),
167
- children: /* @__PURE__ */ jsx(FieldStroke, {
168
- color: rule.color,
169
- sides: "all",
170
- style: styles.outlineNotchBox,
171
- width: rule.width
172
- })
173
- }),
174
- /* @__PURE__ */ jsx(View, {
175
- style: composeStyles(styles.outlineEnd, minWidthOf(outlineInset(spacing, trailing))),
176
- children: /* @__PURE__ */ jsx(FieldStroke, {
177
- color: rule.color,
178
- sides: "all",
179
- style: styles.outlineEndBox,
180
- width: rule.width
181
- })
182
- })
183
- ]
184
- }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [feedback.layer, /* @__PURE__ */ jsx(FieldStroke, {
185
- color: rule.color,
186
- sides: "top",
187
- style: styles.indicator,
188
- width: rule.width
189
- })] });
190
- let t20;
191
- if ($[26] !== colors.onSurfaceVariant || $[27] !== disabledContent || $[28] !== isDisabled || $[29] !== leading || $[30] !== styles.icon) {
192
- t20 = leading === void 0 ? null : /* @__PURE__ */ jsx(View, {
193
- style: styles.icon,
194
- children: /* @__PURE__ */ jsx(IconStyleContext, {
195
- value: iconStyleOf(isDisabled ? disabledContent : colors.onSurfaceVariant),
196
- children: leading
197
- })
198
- });
199
- $[26] = colors.onSurfaceVariant;
200
- $[27] = disabledContent;
201
- $[28] = isDisabled;
202
- $[29] = leading;
203
- $[30] = styles.icon;
204
- $[31] = t20;
205
- } else t20 = $[31];
206
- let t21;
207
- if ($[32] !== floated || $[33] !== floatingLabel || $[34] !== isDisabled || $[35] !== isFocused || $[36] !== isInvalid || $[37] !== isRequired || $[38] !== label || $[39] !== variant) {
208
- t21 = /* @__PURE__ */ jsx(BoxLabel, {
146
+ $[25] = t15;
147
+ } else t15 = $[25];
148
+ let t16;
149
+ if ($[26] !== floated || $[27] !== floatingLabel || $[28] !== isDisabled || $[29] !== isFocused || $[30] !== isInvalid || $[31] !== isRequired || $[32] !== label || $[33] !== variant) {
150
+ t16 = /* @__PURE__ */ jsx(BoxLabel, {
209
151
  floated,
210
152
  floatingLabel,
211
153
  isDisabled,
@@ -215,109 +157,112 @@ function FieldBox(t0) {
215
157
  variant,
216
158
  children: label
217
159
  });
218
- $[32] = floated;
219
- $[33] = floatingLabel;
220
- $[34] = isDisabled;
221
- $[35] = isFocused;
222
- $[36] = isInvalid;
223
- $[37] = isRequired;
224
- $[38] = label;
225
- $[39] = variant;
226
- $[40] = t21;
227
- } else t21 = $[40];
228
- let t22;
229
- if ($[41] !== floatingLabel || $[42] !== isRequired || $[43] !== label || $[44] !== outlined || $[45] !== setNotch) {
230
- t22 = outlined ? /* @__PURE__ */ jsx(NotchMeasure, {
160
+ $[26] = floated;
161
+ $[27] = floatingLabel;
162
+ $[28] = isDisabled;
163
+ $[29] = isFocused;
164
+ $[30] = isInvalid;
165
+ $[31] = isRequired;
166
+ $[32] = label;
167
+ $[33] = variant;
168
+ $[34] = t16;
169
+ } else t16 = $[34];
170
+ let t17;
171
+ if ($[35] !== floatingLabel || $[36] !== isRequired || $[37] !== label || $[38] !== outlined) {
172
+ t17 = outlined ? /* @__PURE__ */ jsx(NotchMeasure, {
231
173
  floatingLabel,
232
174
  isRequired,
233
175
  onMeasure: setNotch,
234
176
  children: label
235
177
  }) : null;
236
- $[41] = floatingLabel;
237
- $[42] = isRequired;
238
- $[43] = label;
239
- $[44] = outlined;
240
- $[45] = setNotch;
241
- $[46] = t22;
242
- } else t22 = $[46];
243
- let t23;
244
- if ($[47] !== boxControl || $[48] !== children) {
245
- t23 = /* @__PURE__ */ jsx(BoxContext, {
178
+ $[35] = floatingLabel;
179
+ $[36] = isRequired;
180
+ $[37] = label;
181
+ $[38] = outlined;
182
+ $[39] = t17;
183
+ } else t17 = $[39];
184
+ let t18;
185
+ if ($[40] !== boxControl || $[41] !== children) {
186
+ t18 = /* @__PURE__ */ jsx(BoxContext, {
246
187
  value: boxControl,
247
188
  children
248
189
  });
249
- $[47] = boxControl;
250
- $[48] = children;
251
- $[49] = t23;
252
- } else t23 = $[49];
253
- let t24;
254
- if ($[50] !== styles.column || $[51] !== t21 || $[52] !== t22 || $[53] !== t23) {
255
- t24 = /* @__PURE__ */ jsxs(View, {
256
- style: styles.column,
257
- children: [
258
- t21,
259
- t22,
260
- t23
261
- ]
262
- });
263
- $[50] = styles.column;
264
- $[51] = t21;
265
- $[52] = t22;
266
- $[53] = t23;
267
- $[54] = t24;
268
- } else t24 = $[54];
269
- let t25;
270
- if ($[55] !== colors.error || $[56] !== colors.onSurfaceVariant || $[57] !== disabledContent || $[58] !== isDisabled || $[59] !== isInvalid || $[60] !== styles.icon || $[61] !== trailing) {
271
- t25 = trailing === void 0 ? null : /* @__PURE__ */ jsx(View, {
272
- style: styles.icon,
273
- children: /* @__PURE__ */ jsx(IconStyleContext, {
274
- value: iconStyleOf(isDisabled ? disabledContent : isInvalid ? colors.error : colors.onSurfaceVariant),
275
- children: trailing
190
+ $[40] = boxControl;
191
+ $[41] = children;
192
+ $[42] = t18;
193
+ } else t18 = $[42];
194
+ return /* @__PURE__ */ jsxs(Pressable, {
195
+ ...t14,
196
+ disabled: isDisabled,
197
+ onHoverIn: feedback.handlers.onHoverIn,
198
+ onHoverOut: feedback.handlers.onHoverOut,
199
+ onPress: t15,
200
+ ref,
201
+ style: composeStyles(styles.box, trigger === void 0 ? void 0 : styles.boxTrigger, leading === void 0 ? void 0 : styles.boxLeading, trailing === void 0 ? void 0 : styles.boxTrailing, outlined ? styles.boxOutlined : void 0, isDisabled && !outlined ? styles.boxDisabled : void 0, minHeightOf(outlined ? 2 * spacing.lg + typography.bodyLargeLineHeight * fontScale : 2 * spacing.sm + (typography.bodySmallLineHeight + typography.bodyLargeLineHeight) * fontScale)),
202
+ children: [
203
+ outlined ? /* @__PURE__ */ jsxs(View, {
204
+ "aria-hidden": true,
205
+ style: styles.outline,
206
+ children: [
207
+ /* @__PURE__ */ jsx(View, {
208
+ style: composeStyles(styles.outlineStart, widthOf(outlineInset(spacing, leading))),
209
+ children: /* @__PURE__ */ jsx(FieldStroke, {
210
+ color: rule.color,
211
+ sides: "all",
212
+ style: styles.outlineStartBox,
213
+ width: rule.width
214
+ })
215
+ }),
216
+ /* @__PURE__ */ jsx(View, {
217
+ style: composeStyles(styles.outlineNotch, widthOf(floated ? notch : 0)),
218
+ children: /* @__PURE__ */ jsx(FieldStroke, {
219
+ color: rule.color,
220
+ sides: "all",
221
+ style: styles.outlineNotchBox,
222
+ width: rule.width
223
+ })
224
+ }),
225
+ /* @__PURE__ */ jsx(View, {
226
+ style: composeStyles(styles.outlineEnd, minWidthOf(outlineInset(spacing, trailing))),
227
+ children: /* @__PURE__ */ jsx(FieldStroke, {
228
+ color: rule.color,
229
+ sides: "all",
230
+ style: styles.outlineEndBox,
231
+ width: rule.width
232
+ })
233
+ })
234
+ ]
235
+ }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [feedback.layer, /* @__PURE__ */ jsx(FieldStroke, {
236
+ color: rule.color,
237
+ sides: "top",
238
+ style: styles.indicator,
239
+ width: rule.width
240
+ })] }),
241
+ leading === void 0 ? null : /* @__PURE__ */ jsx(View, {
242
+ style: composeStyles(styles.icon, outlined ? styles.iconOutlined : void 0),
243
+ children: /* @__PURE__ */ jsx(IconStyleContext, {
244
+ value: iconStyleOf(isDisabled ? disabledContent : colors.onSurfaceVariant),
245
+ children: leading
246
+ })
247
+ }),
248
+ /* @__PURE__ */ jsxs(View, {
249
+ style: styles.column,
250
+ children: [
251
+ t16,
252
+ t17,
253
+ t18
254
+ ]
255
+ }),
256
+ end,
257
+ trailing === void 0 ? null : /* @__PURE__ */ jsx(View, {
258
+ style: composeStyles(styles.icon, outlined ? styles.iconOutlined : void 0),
259
+ children: /* @__PURE__ */ jsx(IconStyleContext, {
260
+ value: iconStyleOf(isDisabled ? disabledContent : isInvalid ? colors.error : colors.onSurfaceVariant),
261
+ children: trailing
262
+ })
276
263
  })
277
- });
278
- $[55] = colors.error;
279
- $[56] = colors.onSurfaceVariant;
280
- $[57] = disabledContent;
281
- $[58] = isDisabled;
282
- $[59] = isInvalid;
283
- $[60] = styles.icon;
284
- $[61] = trailing;
285
- $[62] = t25;
286
- } else t25 = $[62];
287
- let t26;
288
- if ($[63] !== T0 || $[64] !== end || $[65] !== feedback.handlers.onHoverIn || $[66] !== feedback.handlers.onHoverOut || $[67] !== isDisabled || $[68] !== ref || $[69] !== t14 || $[70] !== t17 || $[71] !== t18 || $[72] !== t19 || $[73] !== t20 || $[74] !== t24 || $[75] !== t25) {
289
- t26 = /* @__PURE__ */ jsxs(T0, {
290
- ...t14,
291
- disabled: isDisabled,
292
- onHoverIn: t15,
293
- onHoverOut: t16,
294
- onPress: t17,
295
- ref,
296
- style: t18,
297
- children: [
298
- t19,
299
- t20,
300
- t24,
301
- end,
302
- t25
303
- ]
304
- });
305
- $[63] = T0;
306
- $[64] = end;
307
- $[65] = feedback.handlers.onHoverIn;
308
- $[66] = feedback.handlers.onHoverOut;
309
- $[67] = isDisabled;
310
- $[68] = ref;
311
- $[69] = t14;
312
- $[70] = t17;
313
- $[71] = t18;
314
- $[72] = t19;
315
- $[73] = t20;
316
- $[74] = t24;
317
- $[75] = t25;
318
- $[76] = t26;
319
- } else t26 = $[76];
320
- return t26;
264
+ ]
265
+ });
321
266
  }
322
267
  /**
323
268
  * A field's text control, in a {@link FieldBox}, or in {@link FieldStates}
@@ -432,7 +377,7 @@ function FieldInput(t0) {
432
377
  multiline,
433
378
  placeholderTextColor: muted,
434
379
  selectionColor: caret,
435
- style: composeStyles(role, styles.input, colorOf(content), numeric ? numericOf(mono) : void 0, multiline ? styles.inputMultiline : void 0, copied ? styles.inputOverCopy : extent, holdsChosen ? minWidthOf(CHOSEN_ROOM * typography.bodyLargeSize * fontScale) : void 0, affixed || copied || holdsChosen ? void 0 : clearance),
380
+ style: composeStyles(role, styles.input, colorOf(content), numeric ? numericOf(mono) : void 0, multiline ? styles.inputMultiline : void 0, copied ? styles.inputOverCopy : extent, holdsChosen ? beside(CHOSEN_ROOM * typography.bodyLargeSize * fontScale) : void 0, affixed || copied || holdsChosen ? void 0 : clearance),
436
381
  underlineColorAndroid: "transparent"
437
382
  });
438
383
  if (copied) return /* @__PURE__ */ jsxs(View, {
@@ -908,6 +853,12 @@ function affixPart(id, affix) {
908
853
  text: typeof affix === "string" || typeof affix === "number" ? String(affix) : ""
909
854
  }];
910
855
  }
856
+ function beside(room) {
857
+ return {
858
+ flexBasis: 0,
859
+ minWidth: room
860
+ };
861
+ }
911
862
  function boxControlOf(floatingLabel, floated, disabled, invalid, required, underLabel) {
912
863
  return {
913
864
  disabled,