@kanso-labs/react-native-kanso-ui 0.11.24 → 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.
- package/dist/calendar/index.js +105 -41
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/styles.js +7 -0
- package/dist/calendar/styles.js.map +1 -1
- package/dist/components/calendar/index.d.ts +2 -2
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/carousel/index.d.ts +24 -3
- package/dist/components/carousel/index.js +58 -35
- package/dist/components/carousel/index.js.map +1 -1
- package/dist/components/color-picker/index.js +98 -93
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/range-calendar/index.d.ts +2 -2
- package/dist/components/range-calendar/index.js.map +1 -1
- package/dist/components/segmented-button/index.js +108 -88
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/table/index.js +1 -0
- package/dist/components/table/index.js.map +1 -1
- package/dist/field/index.d.ts +1 -1
- package/dist/field/index.js +112 -161
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +4 -0
- package/dist/field/styles.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/package.json +11 -11
package/dist/field/index.js
CHANGED
|
@@ -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(
|
|
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
|
-
|
|
143
|
-
const t16 = feedback.handlers.onHoverOut;
|
|
144
|
-
let t17;
|
|
141
|
+
let t15;
|
|
145
142
|
if ($[23] !== control || $[24] !== trigger?.onPress) {
|
|
146
|
-
|
|
143
|
+
t15 = trigger?.onPress ?? focusOf(control);
|
|
147
144
|
$[23] = control;
|
|
148
145
|
$[24] = trigger?.onPress;
|
|
149
|
-
$[25] =
|
|
150
|
-
} else
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
227
|
-
} else
|
|
228
|
-
let
|
|
229
|
-
if ($[
|
|
230
|
-
|
|
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
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
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
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
} else
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
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
|
-
|
|
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 ?
|
|
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,
|