@dloizides/ui-forms 1.29.0 → 1.30.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.
- package/CHANGELOG.md +9 -0
- package/dist/index.d.mts +24 -14
- package/dist/index.d.ts +24 -14
- package/dist/index.js +111 -115
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +108 -116
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -357,9 +357,32 @@ var InlineFieldRow = ({
|
|
|
357
357
|
/* @__PURE__ */ jsx(AlignToControl, { style: styles4.action, children: action })
|
|
358
358
|
] });
|
|
359
359
|
};
|
|
360
|
+
var styles5 = StyleSheet.create({
|
|
361
|
+
stack: { flexDirection: "column" }
|
|
362
|
+
});
|
|
363
|
+
var FormStack = ({
|
|
364
|
+
children,
|
|
365
|
+
gap = FORM_GRID_DEFAULT_GAP,
|
|
366
|
+
style,
|
|
367
|
+
testID
|
|
368
|
+
}) => /* @__PURE__ */ jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsx(View, { style: [styles5.stack, { gap }, style], testID, children }) });
|
|
369
|
+
|
|
370
|
+
// src/ResponsiveFormLayout/isWideFormLayout.ts
|
|
371
|
+
var RESPONSIVE_FORM_DEFAULT_BREAKPOINT = 768;
|
|
372
|
+
function isWideFormLayout(width, breakpoint = RESPONSIVE_FORM_DEFAULT_BREAKPOINT) {
|
|
373
|
+
return width >= breakpoint;
|
|
374
|
+
}
|
|
375
|
+
function ResponsiveFormLayout({
|
|
376
|
+
narrow,
|
|
377
|
+
wide,
|
|
378
|
+
breakpoint = RESPONSIVE_FORM_DEFAULT_BREAKPOINT
|
|
379
|
+
}) {
|
|
380
|
+
const { width } = useWindowDimensions();
|
|
381
|
+
return /* @__PURE__ */ jsx(Fragment, { children: isWideFormLayout(width, breakpoint) ? wide : narrow });
|
|
382
|
+
}
|
|
360
383
|
var SECTION_GAP = 10;
|
|
361
384
|
var DESCRIPTION_FONT_SIZE = 12;
|
|
362
|
-
var
|
|
385
|
+
var styles6 = StyleSheet.create({
|
|
363
386
|
section: {
|
|
364
387
|
gap: SECTION_GAP
|
|
365
388
|
},
|
|
@@ -394,7 +417,7 @@ var FormSection = ({
|
|
|
394
417
|
// The section spaces its children with `gap`, so it owns their vertical rhythm exactly as a
|
|
395
418
|
// `FormGrid` owns a row's — without this a `Field` placed directly in a section would stack its
|
|
396
419
|
// 16px margin on the section's gap and recreate the F3 bug one level up.
|
|
397
|
-
/* @__PURE__ */ jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsxs(View, { role: "group", style: [
|
|
420
|
+
/* @__PURE__ */ jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsxs(View, { role: "group", style: [styles6.section, style], testID, ...a11y, children: [
|
|
398
421
|
hasTitle ? /* @__PURE__ */ jsx(
|
|
399
422
|
Text,
|
|
400
423
|
{
|
|
@@ -403,13 +426,13 @@ var FormSection = ({
|
|
|
403
426
|
children: title
|
|
404
427
|
}
|
|
405
428
|
) : null,
|
|
406
|
-
hasDescription ? /* @__PURE__ */ jsx(Text, { style: [
|
|
429
|
+
hasDescription ? /* @__PURE__ */ jsx(Text, { style: [styles6.description, { color: colors.textSecondary }], children: description }) : null,
|
|
407
430
|
children
|
|
408
431
|
] }) })
|
|
409
432
|
);
|
|
410
433
|
};
|
|
411
434
|
var ACTIONS_GAP = 12;
|
|
412
|
-
var
|
|
435
|
+
var styles7 = StyleSheet.create({
|
|
413
436
|
container: {
|
|
414
437
|
flexDirection: "row",
|
|
415
438
|
justifyContent: "flex-end",
|
|
@@ -429,7 +452,7 @@ var FormActions = ({
|
|
|
429
452
|
saveTestID = "save-button",
|
|
430
453
|
cancelTestID = "cancel-button",
|
|
431
454
|
testID
|
|
432
|
-
}) => /* @__PURE__ */ jsxs(View, { style: [
|
|
455
|
+
}) => /* @__PURE__ */ jsxs(View, { style: [styles7.container, containerStyle], testID, children: [
|
|
433
456
|
typeof onCancel === "function" ? /* @__PURE__ */ jsx(
|
|
434
457
|
Button,
|
|
435
458
|
{
|
|
@@ -550,7 +573,7 @@ var DETAIL_FONT = 12;
|
|
|
550
573
|
var DETAIL_GAP = 12;
|
|
551
574
|
var STACK_GAP = 2;
|
|
552
575
|
var DETAIL_BESIDE_MIN_MENU_WIDTH = 400;
|
|
553
|
-
var
|
|
576
|
+
var styles8 = StyleSheet.create({
|
|
554
577
|
beside: { alignItems: "baseline", flexDirection: "row", gap: DETAIL_GAP, justifyContent: "space-between" },
|
|
555
578
|
stacked: { gap: STACK_GAP },
|
|
556
579
|
shrink: { flexShrink: 1 },
|
|
@@ -585,9 +608,9 @@ function OptionRow({ option, isActive, isHighlighted, isListboxRow, menuWidth, h
|
|
|
585
608
|
onPress: () => onSelect(option.value),
|
|
586
609
|
style: [controlStyles.option, isHighlighted ? { backgroundColor: colors.text } : null],
|
|
587
610
|
testID: `${testID}-option-${option.value}`,
|
|
588
|
-
children: /* @__PURE__ */ jsxs(View, { style: isDetailBesideTitle(menuWidth) ?
|
|
589
|
-
/* @__PURE__ */ jsx(Text, { style: [controlStyles.optionText,
|
|
590
|
-
hasDetail ? /* @__PURE__ */ jsx(Text, { style: [
|
|
611
|
+
children: /* @__PURE__ */ jsxs(View, { style: isDetailBesideTitle(menuWidth) ? styles8.beside : styles8.stacked, children: [
|
|
612
|
+
/* @__PURE__ */ jsx(Text, { style: [controlStyles.optionText, styles8.shrink, { color: ink.title, fontWeight: isBold ? ACTIVE_WEIGHT : IDLE_WEIGHT }], children: option.label }),
|
|
613
|
+
hasDetail ? /* @__PURE__ */ jsx(Text, { style: [styles8.detail, { color: ink.detail }], children: option.detail }) : null
|
|
591
614
|
] })
|
|
592
615
|
}
|
|
593
616
|
);
|
|
@@ -1377,7 +1400,7 @@ function chipIdentity(option, selected, config) {
|
|
|
1377
1400
|
ariaChecked: isRadio ? selected : void 0
|
|
1378
1401
|
};
|
|
1379
1402
|
}
|
|
1380
|
-
var
|
|
1403
|
+
var styles9 = StyleSheet.create({
|
|
1381
1404
|
chipContainer: {
|
|
1382
1405
|
flexDirection: "row",
|
|
1383
1406
|
flexWrap: "wrap",
|
|
@@ -1463,7 +1486,7 @@ var ChipSelector = ({
|
|
|
1463
1486
|
View,
|
|
1464
1487
|
{
|
|
1465
1488
|
accessibilityRole: isRadioGroup ? "radiogroup" : void 0,
|
|
1466
|
-
style:
|
|
1489
|
+
style: styles9.chipContainer,
|
|
1467
1490
|
...webFieldA11y({ describedById, hasError }),
|
|
1468
1491
|
...radio.groupProps,
|
|
1469
1492
|
children: options.map(renderChip)
|
|
@@ -1473,7 +1496,7 @@ var ChipSelector = ({
|
|
|
1473
1496
|
);
|
|
1474
1497
|
};
|
|
1475
1498
|
var DESCRIPTION_FONT_SIZE2 = 12;
|
|
1476
|
-
var
|
|
1499
|
+
var styles10 = StyleSheet.create({
|
|
1477
1500
|
container: {
|
|
1478
1501
|
flexDirection: "row",
|
|
1479
1502
|
justifyContent: "space-between",
|
|
@@ -1534,15 +1557,15 @@ var FormSwitch = ({
|
|
|
1534
1557
|
accessible: false,
|
|
1535
1558
|
disabled,
|
|
1536
1559
|
onPress: toggle,
|
|
1537
|
-
style: [
|
|
1560
|
+
style: [styles10.container, containerStyle],
|
|
1538
1561
|
tabIndex: -1,
|
|
1539
1562
|
testID: `${testID}-row`,
|
|
1540
1563
|
children: [
|
|
1541
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1542
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1543
|
-
hasDescription ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1564
|
+
/* @__PURE__ */ jsxs(View, { style: styles10.textColumn, children: [
|
|
1565
|
+
/* @__PURE__ */ jsx(Text, { style: [styles10.label, themeStyles.label], children: label }),
|
|
1566
|
+
hasDescription ? /* @__PURE__ */ jsx(Text, { style: [styles10.description, themeStyles.description], children: description }) : null
|
|
1544
1567
|
] }),
|
|
1545
|
-
/* @__PURE__ */ jsx(View, { pointerEvents: "none", style:
|
|
1568
|
+
/* @__PURE__ */ jsx(View, { pointerEvents: "none", style: styles10.switchSlot, testID: `${testID}-hitbox`, children: /* @__PURE__ */ jsx(
|
|
1546
1569
|
Switch,
|
|
1547
1570
|
{
|
|
1548
1571
|
accessibilityHint: accessibilityHint ?? label,
|
|
@@ -1571,7 +1594,7 @@ var DISABLED_OPACITY = 0.5;
|
|
|
1571
1594
|
var FOCUS_RING_WIDTH = 2;
|
|
1572
1595
|
var WEB_NO_DEFAULT_OUTLINE = { outlineStyle: "none" };
|
|
1573
1596
|
var FOCUS_RING_INSET = -6;
|
|
1574
|
-
var
|
|
1597
|
+
var styles11 = StyleSheet.create({
|
|
1575
1598
|
container: {
|
|
1576
1599
|
flexDirection: "row",
|
|
1577
1600
|
alignItems: "flex-start",
|
|
@@ -1676,8 +1699,8 @@ var FormCheckbox = ({
|
|
|
1676
1699
|
onPress: toggle,
|
|
1677
1700
|
role: "checkbox",
|
|
1678
1701
|
style: [
|
|
1679
|
-
|
|
1680
|
-
hasHint ? null :
|
|
1702
|
+
styles11.container,
|
|
1703
|
+
hasHint ? null : styles11.centered,
|
|
1681
1704
|
containerStyle,
|
|
1682
1705
|
disabled ? { opacity: DISABLED_OPACITY } : null,
|
|
1683
1706
|
Platform.OS === "web" ? WEB_NO_DEFAULT_OUTLINE : null
|
|
@@ -1685,13 +1708,13 @@ var FormCheckbox = ({
|
|
|
1685
1708
|
testID,
|
|
1686
1709
|
...keyboardProps,
|
|
1687
1710
|
children: [
|
|
1688
|
-
/* @__PURE__ */ jsxs(View, { style: [
|
|
1689
|
-
focused ? /* @__PURE__ */ jsx(View, { pointerEvents: "none", style: [
|
|
1690
|
-
value ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1711
|
+
/* @__PURE__ */ jsxs(View, { style: [styles11.box, value ? themeStyles.boxOn : themeStyles.boxOff], testID: `${testID}-box`, children: [
|
|
1712
|
+
focused ? /* @__PURE__ */ jsx(View, { pointerEvents: "none", style: [styles11.focusRing, themeStyles.ring], testID: `${testID}-focus-ring` }) : null,
|
|
1713
|
+
value ? /* @__PURE__ */ jsx(Text, { style: [styles11.check, { color: colors.surface }], accessibilityElementsHidden: true, children: "\u2713" }) : null
|
|
1691
1714
|
] }),
|
|
1692
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1693
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1694
|
-
hasHint ? /* @__PURE__ */ jsx(Text, { nativeID: hintId, style: [
|
|
1715
|
+
/* @__PURE__ */ jsxs(View, { style: styles11.textColumn, children: [
|
|
1716
|
+
/* @__PURE__ */ jsx(Text, { style: [styles11.label, themeStyles.label], children: label }),
|
|
1717
|
+
hasHint ? /* @__PURE__ */ jsx(Text, { nativeID: hintId, style: [styles11.hint, themeStyles.hint], children: hintText }) : null
|
|
1695
1718
|
] })
|
|
1696
1719
|
]
|
|
1697
1720
|
}
|
|
@@ -2091,78 +2114,6 @@ function TypeaheadControlImpl(props, ref) {
|
|
|
2091
2114
|
] });
|
|
2092
2115
|
}
|
|
2093
2116
|
var TypeaheadControl = forwardRef(TypeaheadControlImpl);
|
|
2094
|
-
var WEB_DATE_PROPS = typeof document !== "undefined" ? { type: "date" } : {};
|
|
2095
|
-
function DateInput(p) {
|
|
2096
|
-
return /* @__PURE__ */ jsxs(View, { style: controlStyles.dateCol, children: [
|
|
2097
|
-
/* @__PURE__ */ jsx(Text, { style: [controlStyles.subLabel, { color: p.muted }], children: p.label }),
|
|
2098
|
-
/* @__PURE__ */ jsx(
|
|
2099
|
-
TextInput,
|
|
2100
|
-
{
|
|
2101
|
-
accessibilityLabel: p.label,
|
|
2102
|
-
accessibilityHint: p.hint,
|
|
2103
|
-
placeholder: p.placeholder,
|
|
2104
|
-
placeholderTextColor: p.muted,
|
|
2105
|
-
value: p.value,
|
|
2106
|
-
onChangeText: p.onChangeText,
|
|
2107
|
-
onSubmitEditing: p.onSubmit,
|
|
2108
|
-
style: [controlStyles.input, { borderColor: p.border, backgroundColor: p.surface, color: p.color }],
|
|
2109
|
-
testID: `${p.testID}-${p.side}`,
|
|
2110
|
-
...WEB_DATE_PROPS
|
|
2111
|
-
}
|
|
2112
|
-
)
|
|
2113
|
-
] });
|
|
2114
|
-
}
|
|
2115
|
-
function DateRangeControl({
|
|
2116
|
-
value,
|
|
2117
|
-
onChange,
|
|
2118
|
-
onSubmit,
|
|
2119
|
-
fromLabel,
|
|
2120
|
-
toLabel,
|
|
2121
|
-
fromPlaceholder,
|
|
2122
|
-
toPlaceholder,
|
|
2123
|
-
accessibilityHint,
|
|
2124
|
-
style,
|
|
2125
|
-
testID
|
|
2126
|
-
}) {
|
|
2127
|
-
const { theme } = useUi();
|
|
2128
|
-
const { colors } = theme;
|
|
2129
|
-
return /* @__PURE__ */ jsxs(View, { style: [controlStyles.dateRow, style], testID: `${testID}-range`, children: [
|
|
2130
|
-
/* @__PURE__ */ jsx(
|
|
2131
|
-
DateInput,
|
|
2132
|
-
{
|
|
2133
|
-
side: "from",
|
|
2134
|
-
label: fromLabel,
|
|
2135
|
-
placeholder: fromPlaceholder,
|
|
2136
|
-
value: value.from,
|
|
2137
|
-
color: colors.text,
|
|
2138
|
-
border: colors.border,
|
|
2139
|
-
surface: colors.surface,
|
|
2140
|
-
muted: colors.textSecondary,
|
|
2141
|
-
hint: accessibilityHint,
|
|
2142
|
-
testID,
|
|
2143
|
-
onChangeText: (from) => onChange({ from, to: value.to }),
|
|
2144
|
-
onSubmit
|
|
2145
|
-
}
|
|
2146
|
-
),
|
|
2147
|
-
/* @__PURE__ */ jsx(
|
|
2148
|
-
DateInput,
|
|
2149
|
-
{
|
|
2150
|
-
side: "to",
|
|
2151
|
-
label: toLabel,
|
|
2152
|
-
placeholder: toPlaceholder,
|
|
2153
|
-
value: value.to,
|
|
2154
|
-
color: colors.text,
|
|
2155
|
-
border: colors.border,
|
|
2156
|
-
surface: colors.surface,
|
|
2157
|
-
muted: colors.textSecondary,
|
|
2158
|
-
hint: accessibilityHint,
|
|
2159
|
-
testID,
|
|
2160
|
-
onChangeText: (to) => onChange({ from: value.from, to }),
|
|
2161
|
-
onSubmit
|
|
2162
|
-
}
|
|
2163
|
-
)
|
|
2164
|
-
] });
|
|
2165
|
-
}
|
|
2166
2117
|
var NATIVE_INPUT_BOX = {
|
|
2167
2118
|
borderStyle: "solid",
|
|
2168
2119
|
boxSizing: "border-box",
|
|
@@ -2225,6 +2176,7 @@ function renderNativeInput(fieldProps, context) {
|
|
|
2225
2176
|
editable: fieldProps.disabled !== true,
|
|
2226
2177
|
hasError: context.hasError,
|
|
2227
2178
|
id: context.controlId,
|
|
2179
|
+
placeholder: fieldProps.placeholder,
|
|
2228
2180
|
requiredField: fieldProps.required,
|
|
2229
2181
|
testID: fieldProps.testID,
|
|
2230
2182
|
value: fieldProps.value,
|
|
@@ -2240,6 +2192,46 @@ function TemporalField({ fieldProps, webInputType }) {
|
|
|
2240
2192
|
function DateField(props) {
|
|
2241
2193
|
return /* @__PURE__ */ jsx(TemporalField, { fieldProps: props, webInputType: "date" });
|
|
2242
2194
|
}
|
|
2195
|
+
function DateRangeControl({
|
|
2196
|
+
value,
|
|
2197
|
+
onChange,
|
|
2198
|
+
onSubmit,
|
|
2199
|
+
fromLabel,
|
|
2200
|
+
toLabel,
|
|
2201
|
+
fromPlaceholder,
|
|
2202
|
+
toPlaceholder,
|
|
2203
|
+
accessibilityHint,
|
|
2204
|
+
style,
|
|
2205
|
+
testID
|
|
2206
|
+
}) {
|
|
2207
|
+
const hint = accessibilityHint ?? "";
|
|
2208
|
+
return /* @__PURE__ */ jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsxs(View, { style: [controlStyles.dateRow, style], testID: `${testID}-range`, children: [
|
|
2209
|
+
/* @__PURE__ */ jsx(View, { style: controlStyles.dateCol, children: /* @__PURE__ */ jsx(
|
|
2210
|
+
DateField,
|
|
2211
|
+
{
|
|
2212
|
+
accessibilityHint: hint,
|
|
2213
|
+
label: fromLabel,
|
|
2214
|
+
placeholder: fromPlaceholder,
|
|
2215
|
+
testID: `${testID}-from`,
|
|
2216
|
+
value: value.from,
|
|
2217
|
+
onChange: (from) => onChange({ from, to: value.to }),
|
|
2218
|
+
onSubmit
|
|
2219
|
+
}
|
|
2220
|
+
) }),
|
|
2221
|
+
/* @__PURE__ */ jsx(View, { style: controlStyles.dateCol, children: /* @__PURE__ */ jsx(
|
|
2222
|
+
DateField,
|
|
2223
|
+
{
|
|
2224
|
+
accessibilityHint: hint,
|
|
2225
|
+
label: toLabel,
|
|
2226
|
+
placeholder: toPlaceholder,
|
|
2227
|
+
testID: `${testID}-to`,
|
|
2228
|
+
value: value.to,
|
|
2229
|
+
onChange: (to) => onChange({ from: value.from, to }),
|
|
2230
|
+
onSubmit
|
|
2231
|
+
}
|
|
2232
|
+
) })
|
|
2233
|
+
] }) });
|
|
2234
|
+
}
|
|
2243
2235
|
function DateTimeField(props) {
|
|
2244
2236
|
return /* @__PURE__ */ jsx(TemporalField, { fieldProps: props, webInputType: "datetime-local" });
|
|
2245
2237
|
}
|
|
@@ -2271,7 +2263,7 @@ var ROW_GAP = 4;
|
|
|
2271
2263
|
var TAB_PADDING = 4;
|
|
2272
2264
|
var INDICATOR_WIDTH = 2;
|
|
2273
2265
|
var TAB_FONT_SIZE = 12;
|
|
2274
|
-
var
|
|
2266
|
+
var styles12 = StyleSheet.create({
|
|
2275
2267
|
row: { flexDirection: "row", flexWrap: "nowrap", gap: ROW_GAP },
|
|
2276
2268
|
tab: {
|
|
2277
2269
|
borderBottomWidth: INDICATOR_WIDTH,
|
|
@@ -2311,13 +2303,13 @@ var StepperTab = ({
|
|
|
2311
2303
|
accessibilityRole: "tab",
|
|
2312
2304
|
accessibilityState: { selected },
|
|
2313
2305
|
"aria-selected": selected,
|
|
2314
|
-
style: [
|
|
2306
|
+
style: [styles12.tab, { borderBottomColor: indicator }, ring.ringStyle],
|
|
2315
2307
|
testID,
|
|
2316
2308
|
onBlur: ring.onBlur,
|
|
2317
2309
|
onFocus: ring.onFocus,
|
|
2318
2310
|
onPress: () => onStep(step.key),
|
|
2319
2311
|
...webKeyProps,
|
|
2320
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
2312
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles12.text, { color: theme.colors.text }, selected ? styles12.textSelected : void 0], children: step.label })
|
|
2321
2313
|
}
|
|
2322
2314
|
);
|
|
2323
2315
|
};
|
|
@@ -2327,7 +2319,7 @@ var StepperTabs = ({
|
|
|
2327
2319
|
onStep,
|
|
2328
2320
|
stepHint,
|
|
2329
2321
|
testID
|
|
2330
|
-
}) => /* @__PURE__ */ jsx(View, { accessibilityRole: "tablist", style:
|
|
2322
|
+
}) => /* @__PURE__ */ jsx(View, { accessibilityRole: "tablist", style: styles12.row, testID, children: steps.map((step) => /* @__PURE__ */ jsx(
|
|
2331
2323
|
StepperTab,
|
|
2332
2324
|
{
|
|
2333
2325
|
hint: stepHint,
|
|
@@ -2346,7 +2338,7 @@ function resolveStepNeighbours(steps, current) {
|
|
|
2346
2338
|
return { previous: steps[index - 1] ?? null, next: steps[index + 1] ?? null };
|
|
2347
2339
|
}
|
|
2348
2340
|
var ROW_GAP2 = 8;
|
|
2349
|
-
var
|
|
2341
|
+
var styles13 = StyleSheet.create({
|
|
2350
2342
|
cell: { flex: 1, minWidth: 0 },
|
|
2351
2343
|
row: { flexDirection: "row", gap: ROW_GAP2 }
|
|
2352
2344
|
});
|
|
@@ -2358,8 +2350,8 @@ var StepperNav = ({
|
|
|
2358
2350
|
testID
|
|
2359
2351
|
}) => {
|
|
2360
2352
|
const { previous, next } = resolveStepNeighbours(steps, current);
|
|
2361
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
2362
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
2353
|
+
return /* @__PURE__ */ jsxs(View, { style: styles13.row, testID, children: [
|
|
2354
|
+
/* @__PURE__ */ jsx(View, { style: styles13.cell, children: /* @__PURE__ */ jsx(
|
|
2363
2355
|
Button,
|
|
2364
2356
|
{
|
|
2365
2357
|
fullWidth: true,
|
|
@@ -2375,7 +2367,7 @@ var StepperNav = ({
|
|
|
2375
2367
|
}
|
|
2376
2368
|
}
|
|
2377
2369
|
) }),
|
|
2378
|
-
next === null ? null : /* @__PURE__ */ jsx(View, { style:
|
|
2370
|
+
next === null ? null : /* @__PURE__ */ jsx(View, { style: styles13.cell, children: /* @__PURE__ */ jsx(
|
|
2379
2371
|
Button,
|
|
2380
2372
|
{
|
|
2381
2373
|
fullWidth: true,
|
|
@@ -2390,13 +2382,13 @@ var StepperNav = ({
|
|
|
2390
2382
|
] });
|
|
2391
2383
|
};
|
|
2392
2384
|
var STATUS_FONT = 16;
|
|
2393
|
-
var
|
|
2385
|
+
var styles14 = StyleSheet.create({
|
|
2394
2386
|
line: { fontSize: STATUS_FONT }
|
|
2395
2387
|
});
|
|
2396
2388
|
function FormStatusLine({ message, testID, style }) {
|
|
2397
2389
|
const { theme } = useUi();
|
|
2398
2390
|
if (message === null || message === void 0 || message === "") return null;
|
|
2399
|
-
return /* @__PURE__ */ jsx(Text, { role: "alert", style: [
|
|
2391
|
+
return /* @__PURE__ */ jsx(Text, { role: "alert", style: [styles14.line, { color: theme.colors.text }, style], testID, children: message });
|
|
2400
2392
|
}
|
|
2401
2393
|
function useFocusFirstInvalid(refs) {
|
|
2402
2394
|
const latest = useRef(refs);
|
|
@@ -2423,7 +2415,7 @@ var PREVIEW_RADIUS = 8;
|
|
|
2423
2415
|
var GAP = 8;
|
|
2424
2416
|
var TITLE_FONT_SIZE = 14;
|
|
2425
2417
|
var HELP_FONT_SIZE = 13;
|
|
2426
|
-
var
|
|
2418
|
+
var styles15 = StyleSheet.create({
|
|
2427
2419
|
help: { flex: 1, fontSize: HELP_FONT_SIZE },
|
|
2428
2420
|
root: { gap: GAP },
|
|
2429
2421
|
tile: { alignItems: "center", flexDirection: "row", gap: GAP },
|
|
@@ -2445,11 +2437,11 @@ var UploadWithLinkField = ({
|
|
|
2445
2437
|
const url = value ?? "";
|
|
2446
2438
|
const [pasting, setPasting] = useState(url !== "");
|
|
2447
2439
|
const previewBox = { borderRadius: PREVIEW_RADIUS, height: previewSize, width: previewSize };
|
|
2448
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
2449
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
2450
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
2440
|
+
return /* @__PURE__ */ jsxs(View, { style: styles15.root, children: [
|
|
2441
|
+
/* @__PURE__ */ jsx(Text, { style: [styles15.title, { color: theme.colors.text }], children: labels.title }),
|
|
2442
|
+
/* @__PURE__ */ jsxs(View, { style: styles15.tile, children: [
|
|
2451
2443
|
url === "" ? /* @__PURE__ */ jsx(View, { style: [previewBox, { backgroundColor: theme.colors.border }] }) : /* @__PURE__ */ jsx(Image, { accessible: false, source: { uri: url }, style: previewBox, testID: `${testID}-preview` }),
|
|
2452
|
-
labels.help === void 0 ? null : /* @__PURE__ */ jsx(Text, { style: [
|
|
2444
|
+
labels.help === void 0 ? null : /* @__PURE__ */ jsx(Text, { style: [styles15.help, { color: theme.colors.text }], children: labels.help })
|
|
2453
2445
|
] }),
|
|
2454
2446
|
uploadControl,
|
|
2455
2447
|
/* @__PURE__ */ jsx(
|
|
@@ -2460,12 +2452,12 @@ var UploadWithLinkField = ({
|
|
|
2460
2452
|
accessibilityRole: "button",
|
|
2461
2453
|
accessibilityState: { expanded: pasting },
|
|
2462
2454
|
"aria-expanded": pasting,
|
|
2463
|
-
style: [
|
|
2455
|
+
style: [styles15.toggle, ring.ringStyle],
|
|
2464
2456
|
testID: `${testID}-paste`,
|
|
2465
2457
|
onBlur: ring.onBlur,
|
|
2466
2458
|
onFocus: ring.onFocus,
|
|
2467
2459
|
onPress: () => setPasting(!pasting),
|
|
2468
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
2460
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles15.toggleText, { color: theme.colors.text }], children: labels.pasteToggle })
|
|
2469
2461
|
}
|
|
2470
2462
|
),
|
|
2471
2463
|
pasting ? /* @__PURE__ */ jsx(
|
|
@@ -2483,6 +2475,6 @@ var UploadWithLinkField = ({
|
|
|
2483
2475
|
] });
|
|
2484
2476
|
};
|
|
2485
2477
|
|
|
2486
|
-
export { AlignToControl, AnchoredMenu, ChipSelector, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, DateRangeControl, DateTimeField, Field, FormActions, FormCell, FormCheckbox, FormField, FormGrid, FormSection, FormStatusLine, FormSwitch, INLINE_FIELD_ROW_MIN_WIDTH, InlineFieldRow, SelectControl, SelectField, StepperNav, StepperTabs, ThemedTextInput, TypeaheadControl, UploadWithLinkField, controlStyles, groupAriaChecked, inlineFieldRowLayout, isUnmatched, nextHighlight, resolveGroupSelection, resolveStepNeighbours, suggestOptions, toggleGroupSelection, useFocusFirstInvalid, useKeepInView, useRecentValues, useThemedInput };
|
|
2478
|
+
export { AlignToControl, AnchoredMenu, ChipSelector, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, DateRangeControl, DateTimeField, Field, FormActions, FormCell, FormCheckbox, FormField, FormGrid, FormSection, FormStack, FormStatusLine, FormSwitch, INLINE_FIELD_ROW_MIN_WIDTH, InlineFieldRow, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, ResponsiveFormLayout, SelectControl, SelectField, StepperNav, StepperTabs, ThemedTextInput, TypeaheadControl, UploadWithLinkField, controlStyles, groupAriaChecked, inlineFieldRowLayout, isUnmatched, isWideFormLayout, nextHighlight, resolveGroupSelection, resolveStepNeighbours, suggestOptions, toggleGroupSelection, useFocusFirstInvalid, useKeepInView, useRecentValues, useThemedInput };
|
|
2487
2479
|
//# sourceMappingURL=index.mjs.map
|
|
2488
2480
|
//# sourceMappingURL=index.mjs.map
|