@multiplatform.one/forms 7.75.0 → 7.77.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/dist/cjs/DescriptionList/index.cjs +60 -5
- package/dist/cjs/DescriptionList/index.native.js +61 -5
- package/dist/cjs/DescriptionList/index.native.js.map +1 -1
- package/dist/cjs/InputParts/index.cjs +5 -3
- package/dist/cjs/InputParts/index.native.js +5 -3
- package/dist/cjs/InputParts/index.native.js.map +1 -1
- package/dist/cjs/Label/index.cjs +6 -4
- package/dist/cjs/Label/index.native.js +6 -4
- package/dist/cjs/Label/index.native.js.map +1 -1
- package/dist/cjs/fieldLayout.cjs +39 -4
- package/dist/cjs/fieldLayout.native.js +39 -4
- package/dist/cjs/fieldLayout.native.js.map +1 -1
- package/dist/cjs/fields/Input/index.cjs +7 -1
- package/dist/cjs/fields/Input/index.native.js +7 -1
- package/dist/cjs/fields/Input/index.native.js.map +1 -1
- package/dist/cjs/fields/Select/index.cjs +39 -22
- package/dist/cjs/fields/Select/index.native.js +40 -22
- package/dist/cjs/fields/Select/index.native.js.map +1 -1
- package/dist/cjs/fields/Switch/index.cjs +6 -2
- package/dist/cjs/fields/Switch/index.native.js +6 -2
- package/dist/cjs/fields/Switch/index.native.js.map +1 -1
- package/dist/cjs/index.cjs +4 -1
- package/dist/cjs/index.native.js +3 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/shared/fieldRowContext.cjs +42 -0
- package/dist/cjs/shared/fieldRowContext.native.js +46 -0
- package/dist/cjs/shared/fieldRowContext.native.js.map +1 -0
- package/dist/cjs/standardActions.cjs +11 -1
- package/dist/cjs/standardActions.native.js +11 -1
- package/dist/cjs/standardActions.native.js.map +1 -1
- package/dist/esm/DescriptionList/index.mjs +60 -5
- package/dist/esm/DescriptionList/index.mjs.map +1 -1
- package/dist/esm/DescriptionList/index.native.js +61 -5
- package/dist/esm/DescriptionList/index.native.js.map +1 -1
- package/dist/esm/InputParts/index.mjs +5 -3
- package/dist/esm/InputParts/index.mjs.map +1 -1
- package/dist/esm/InputParts/index.native.js +5 -3
- package/dist/esm/InputParts/index.native.js.map +1 -1
- package/dist/esm/Label/index.mjs +6 -4
- package/dist/esm/Label/index.mjs.map +1 -1
- package/dist/esm/Label/index.native.js +6 -4
- package/dist/esm/Label/index.native.js.map +1 -1
- package/dist/esm/fieldLayout.mjs +41 -6
- package/dist/esm/fieldLayout.mjs.map +1 -1
- package/dist/esm/fieldLayout.native.js +41 -6
- package/dist/esm/fieldLayout.native.js.map +1 -1
- package/dist/esm/fields/Combobox/index.mjs.map +1 -1
- package/dist/esm/fields/Combobox/index.native.js.map +1 -1
- package/dist/esm/fields/Input/index.mjs +7 -1
- package/dist/esm/fields/Input/index.mjs.map +1 -1
- package/dist/esm/fields/Input/index.native.js +7 -1
- package/dist/esm/fields/Input/index.native.js.map +1 -1
- package/dist/esm/fields/Select/index.mjs +40 -23
- package/dist/esm/fields/Select/index.mjs.map +1 -1
- package/dist/esm/fields/Select/index.native.js +41 -23
- package/dist/esm/fields/Select/index.native.js.map +1 -1
- package/dist/esm/fields/Switch/index.mjs +7 -3
- package/dist/esm/fields/Switch/index.mjs.map +1 -1
- package/dist/esm/fields/Switch/index.native.js +7 -3
- package/dist/esm/fields/Switch/index.native.js.map +1 -1
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +2 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/shared/fieldRowContext.mjs +16 -0
- package/dist/esm/shared/fieldRowContext.mjs.map +1 -0
- package/dist/esm/shared/fieldRowContext.native.js +17 -0
- package/dist/esm/shared/fieldRowContext.native.js.map +1 -0
- package/dist/esm/standardActions.mjs +12 -2
- package/dist/esm/standardActions.mjs.map +1 -1
- package/dist/esm/standardActions.native.js +12 -2
- package/dist/esm/standardActions.native.js.map +1 -1
- package/dist/jsx/DescriptionList/index.mjs +60 -5
- package/dist/jsx/DescriptionList/index.mjs.map +1 -1
- package/dist/jsx/DescriptionList/index.native.js +61 -5
- package/dist/jsx/DescriptionList/index.native.js.map +1 -1
- package/dist/jsx/InputParts/index.mjs +5 -3
- package/dist/jsx/InputParts/index.mjs.map +1 -1
- package/dist/jsx/InputParts/index.native.js +5 -3
- package/dist/jsx/InputParts/index.native.js.map +1 -1
- package/dist/jsx/Label/index.mjs +6 -4
- package/dist/jsx/Label/index.mjs.map +1 -1
- package/dist/jsx/Label/index.native.js +6 -4
- package/dist/jsx/Label/index.native.js.map +1 -1
- package/dist/jsx/fieldLayout.mjs +41 -6
- package/dist/jsx/fieldLayout.mjs.map +1 -1
- package/dist/jsx/fieldLayout.native.js +39 -4
- package/dist/jsx/fieldLayout.native.js.map +1 -1
- package/dist/jsx/fields/Combobox/index.mjs.map +1 -1
- package/dist/jsx/fields/Combobox/index.native.js.map +1 -1
- package/dist/jsx/fields/Input/index.mjs +7 -1
- package/dist/jsx/fields/Input/index.mjs.map +1 -1
- package/dist/jsx/fields/Input/index.native.js +7 -1
- package/dist/jsx/fields/Input/index.native.js.map +1 -1
- package/dist/jsx/fields/Select/index.mjs +40 -23
- package/dist/jsx/fields/Select/index.mjs.map +1 -1
- package/dist/jsx/fields/Select/index.native.js +40 -22
- package/dist/jsx/fields/Select/index.native.js.map +1 -1
- package/dist/jsx/fields/Switch/index.mjs +7 -3
- package/dist/jsx/fields/Switch/index.mjs.map +1 -1
- package/dist/jsx/fields/Switch/index.native.js +6 -2
- package/dist/jsx/fields/Switch/index.native.js.map +1 -1
- package/dist/jsx/index.js +2 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +2 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +3 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/shared/fieldRowContext.mjs +16 -0
- package/dist/jsx/shared/fieldRowContext.mjs.map +1 -0
- package/dist/jsx/shared/fieldRowContext.native.js +46 -0
- package/dist/jsx/shared/fieldRowContext.native.js.map +1 -0
- package/dist/jsx/standardActions.mjs +12 -2
- package/dist/jsx/standardActions.mjs.map +1 -1
- package/dist/jsx/standardActions.native.js +11 -1
- package/dist/jsx/standardActions.native.js.map +1 -1
- package/package.json +8 -8
- package/src/DescriptionList/DescriptionList.spec.tsx +81 -0
- package/src/DescriptionList/index.tsx +78 -12
- package/src/InputParts/index.tsx +5 -3
- package/src/Label/index.tsx +9 -4
- package/src/fieldLayout.tsx +46 -6
- package/src/fieldRows.spec.tsx +150 -0
- package/src/fields/Combobox/index.tsx +2 -3
- package/src/fields/Input/index.tsx +5 -0
- package/src/fields/Select/Select.spec.tsx +10 -0
- package/src/fields/Select/index.tsx +47 -19
- package/src/fields/Switch/index.tsx +9 -4
- package/src/index.ts +2 -0
- package/src/shared/fieldRowContext.tsx +19 -0
- package/src/standardActions.ts +9 -1
- package/types/DescriptionList/index.d.ts +18 -0
- package/types/DescriptionList/index.d.ts.map +1 -1
- package/types/InputParts/index.d.ts.map +1 -1
- package/types/Label/index.d.ts.map +1 -1
- package/types/fieldLayout.d.ts.map +1 -1
- package/types/fields/Combobox/index.d.ts.map +1 -1
- package/types/fields/Input/index.d.ts.map +1 -1
- package/types/fields/Select/index.d.ts.map +1 -1
- package/types/fields/Switch/index.d.ts +1 -1
- package/types/fields/Switch/index.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/shared/fieldRowContext.d.ts +14 -0
- package/types/shared/fieldRowContext.d.ts.map +1 -0
- package/types/standardActions.d.ts +2 -2
- package/types/standardActions.d.ts.map +1 -1
|
@@ -45,6 +45,7 @@ var ReactNative = __toESM(require("react-native-web"));
|
|
|
45
45
|
var import_react_native = require("react-native-web");
|
|
46
46
|
var import_tamagui = require("tamagui");
|
|
47
47
|
var import_Chip = require("../../Chip/index.cjs");
|
|
48
|
+
var import_fieldRowContext = require("../../shared/fieldRowContext.cjs");
|
|
48
49
|
var import_pickerTriggerContract = require("../../shared/pickerTriggerContract.cjs");
|
|
49
50
|
var import_Skeleton = require("../../Skeleton/index.cjs");
|
|
50
51
|
var import_fieldLayout = require("../../fieldLayout.cjs");
|
|
@@ -78,6 +79,17 @@ const selectRowOutlineRest = {
|
|
|
78
79
|
...selectOutlineRest,
|
|
79
80
|
borderRadius: 0
|
|
80
81
|
};
|
|
82
|
+
function TriggerCaret({
|
|
83
|
+
color
|
|
84
|
+
}) {
|
|
85
|
+
return (0, import_fieldRowContext.useFieldRow)() ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.CaretRightIcon, {
|
|
86
|
+
size: 16,
|
|
87
|
+
color
|
|
88
|
+
}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.CaretDownIcon, {
|
|
89
|
+
size: 16,
|
|
90
|
+
color
|
|
91
|
+
});
|
|
92
|
+
}
|
|
81
93
|
const SelectRow = (0, import_tamagui.styled)(import_tamagui.View, {
|
|
82
94
|
name: "SelectRow",
|
|
83
95
|
...import_theme2.menuRowFrame,
|
|
@@ -389,6 +401,7 @@ function FloatingSelectCore({
|
|
|
389
401
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
390
402
|
const [activeIndex, setActiveIndex] = (0, import_react.useState)(null);
|
|
391
403
|
const [controlledScrolling, setControlledScrolling] = (0, import_react.useState)(false);
|
|
404
|
+
const rowFace = (0, import_fieldRowContext.useFieldRow)();
|
|
392
405
|
const {
|
|
393
406
|
kbTrigger,
|
|
394
407
|
kbNav,
|
|
@@ -846,9 +859,11 @@ function FloatingSelectCore({
|
|
|
846
859
|
suppressFocusRing: open,
|
|
847
860
|
size: knobProps.sizeToken,
|
|
848
861
|
...(0, import_pickerTriggerContract.pickerTriggerContract)(knobProps.control.height),
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
862
|
+
...(rowFace ? null : {
|
|
863
|
+
paddingHorizontal: knobProps.panelPadding.padding
|
|
864
|
+
}),
|
|
865
|
+
...(inTableCell || rowFace ?
|
|
866
|
+
// Chromeless in cells and field rows.
|
|
852
867
|
{} : {
|
|
853
868
|
borderWidth: knobProps.borderRadius.borderWidth
|
|
854
869
|
}),
|
|
@@ -859,7 +874,7 @@ function FloatingSelectCore({
|
|
|
859
874
|
minWidth: 0,
|
|
860
875
|
paddingVertical: "$2",
|
|
861
876
|
justifyContent: multiple && selectedValues.length > 0 ? "center" : "flex-start",
|
|
862
|
-
alignItems: multiple && selectedValues.length > 0 ? "center" : "flex-start",
|
|
877
|
+
alignItems: multiple && selectedValues.length > 0 ? "center" : rowFace ? "flex-end" : "flex-start",
|
|
863
878
|
children: multiple && selectedValues.length > 0 ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
864
879
|
flexDirection: "row",
|
|
865
880
|
flexWrap: "nowrap",
|
|
@@ -882,7 +897,7 @@ function FloatingSelectCore({
|
|
|
882
897
|
...knobProps.controlType,
|
|
883
898
|
fontFamily: knobProps.body.fontFamily,
|
|
884
899
|
fontWeight: knobProps.body.fontWeight,
|
|
885
|
-
color: selectedOption ? textColor : import_colorRamps.formCommonColors.muted,
|
|
900
|
+
color: selectedOption ? rowFace ? "$textMuted" : textColor : import_colorRamps.formCommonColors.muted,
|
|
886
901
|
numberOfLines: 1,
|
|
887
902
|
userSelect: "none",
|
|
888
903
|
children: selectedOption?.label ?? placeholder
|
|
@@ -890,8 +905,7 @@ function FloatingSelectCore({
|
|
|
890
905
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
891
906
|
flexShrink: 0,
|
|
892
907
|
alignSelf: "center",
|
|
893
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(
|
|
894
|
-
size: 16,
|
|
908
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(TriggerCaret, {
|
|
895
909
|
color: glyphColor
|
|
896
910
|
})
|
|
897
911
|
})]
|
|
@@ -1044,6 +1058,7 @@ function NativeSelectCore({
|
|
|
1044
1058
|
const listRef = (0, import_react.useRef)(null);
|
|
1045
1059
|
const listboxId = `${id}-listbox`;
|
|
1046
1060
|
const optionId = index => `${listboxId}-option-${index}`;
|
|
1061
|
+
const rowFace = (0, import_fieldRowContext.useFieldRow)();
|
|
1047
1062
|
const {
|
|
1048
1063
|
kbTrigger,
|
|
1049
1064
|
kbNav,
|
|
@@ -1251,9 +1266,11 @@ function NativeSelectCore({
|
|
|
1251
1266
|
disabled,
|
|
1252
1267
|
size: knobProps.sizeToken,
|
|
1253
1268
|
...(0, import_pickerTriggerContract.pickerTriggerContract)(knobProps.control.height),
|
|
1254
|
-
|
|
1269
|
+
...(rowFace ? null : {
|
|
1270
|
+
paddingHorizontal: knobProps.panelPadding.padding
|
|
1271
|
+
}),
|
|
1255
1272
|
pointerEvents: "none",
|
|
1256
|
-
...(inTableCell ? {} : {
|
|
1273
|
+
...(inTableCell || rowFace ? {} : {
|
|
1257
1274
|
borderWidth: knobProps.borderRadius.borderWidth
|
|
1258
1275
|
}),
|
|
1259
1276
|
"data-testid": "select-trigger",
|
|
@@ -1263,21 +1280,19 @@ function NativeSelectCore({
|
|
|
1263
1280
|
minWidth: 0,
|
|
1264
1281
|
paddingVertical: "$2",
|
|
1265
1282
|
justifyContent: "flex-start",
|
|
1266
|
-
alignItems: "flex-start",
|
|
1283
|
+
alignItems: rowFace ? "flex-end" : "flex-start",
|
|
1267
1284
|
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
1268
1285
|
...knobProps.controlType,
|
|
1269
1286
|
fontFamily: knobProps.body.fontFamily,
|
|
1270
1287
|
fontWeight: knobProps.body.fontWeight,
|
|
1271
|
-
color: selectedOption ? import_colorRamps.formCommonColors.text : import_colorRamps.formCommonColors.muted,
|
|
1288
|
+
color: selectedOption ? rowFace ? "$textMuted" : import_colorRamps.formCommonColors.text : import_colorRamps.formCommonColors.muted,
|
|
1272
1289
|
numberOfLines: 1,
|
|
1273
1290
|
children: triggerValueText
|
|
1274
1291
|
})
|
|
1275
1292
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
1276
1293
|
flexShrink: 0,
|
|
1277
1294
|
alignSelf: "center",
|
|
1278
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(
|
|
1279
|
-
size: 16
|
|
1280
|
-
})
|
|
1295
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(TriggerCaret, {})
|
|
1281
1296
|
})]
|
|
1282
1297
|
})
|
|
1283
1298
|
});
|
|
@@ -1304,8 +1319,10 @@ function NativeSelectCore({
|
|
|
1304
1319
|
disabled,
|
|
1305
1320
|
size: knobProps.sizeToken,
|
|
1306
1321
|
...(0, import_pickerTriggerContract.pickerTriggerContract)(knobProps.control.height),
|
|
1307
|
-
|
|
1308
|
-
|
|
1322
|
+
...(rowFace ? null : {
|
|
1323
|
+
paddingHorizontal: knobProps.panelPadding.padding
|
|
1324
|
+
}),
|
|
1325
|
+
...(inTableCell || rowFace ? {} : {
|
|
1309
1326
|
borderWidth: knobProps.borderRadius.borderWidth
|
|
1310
1327
|
}),
|
|
1311
1328
|
...(import_tamagui.isWeb ? selectTriggerRingProps(kbTrigger, open) : void 0),
|
|
@@ -1345,7 +1362,7 @@ function NativeSelectCore({
|
|
|
1345
1362
|
minWidth: 0,
|
|
1346
1363
|
paddingVertical: "$2",
|
|
1347
1364
|
justifyContent: multiple && selectedValues.length > 0 ? "center" : "flex-start",
|
|
1348
|
-
alignItems: multiple && selectedValues.length > 0 ? "center" : "flex-start",
|
|
1365
|
+
alignItems: multiple && selectedValues.length > 0 ? "center" : rowFace ? "flex-end" : "flex-start",
|
|
1349
1366
|
children: multiple && selectedValues.length > 0 ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
1350
1367
|
flexDirection: "row",
|
|
1351
1368
|
flexWrap: "nowrap",
|
|
@@ -1368,15 +1385,14 @@ function NativeSelectCore({
|
|
|
1368
1385
|
...knobProps.controlType,
|
|
1369
1386
|
fontFamily: knobProps.body.fontFamily,
|
|
1370
1387
|
fontWeight: knobProps.body.fontWeight,
|
|
1371
|
-
color: selectedOption ? textColor : import_colorRamps.formCommonColors.muted,
|
|
1388
|
+
color: selectedOption ? rowFace ? "$textMuted" : textColor : import_colorRamps.formCommonColors.muted,
|
|
1372
1389
|
numberOfLines: 1,
|
|
1373
1390
|
children: selectedOption?.label ?? placeholder
|
|
1374
1391
|
})
|
|
1375
1392
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
1376
1393
|
flexShrink: 0,
|
|
1377
1394
|
alignSelf: "center",
|
|
1378
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(
|
|
1379
|
-
size: 16,
|
|
1395
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(TriggerCaret, {
|
|
1380
1396
|
color: glyphColor
|
|
1381
1397
|
})
|
|
1382
1398
|
})]
|
|
@@ -1440,7 +1456,8 @@ function Select({
|
|
|
1440
1456
|
const compactMenu = (0, import_compactFace.resolveCompactFace)((0, import_compactFace.pickerCompactFace)(options?.length ?? 0), insideOverlay) === "menu";
|
|
1441
1457
|
const shouldUseSheet = !import_tamagui.isWeb || !effectiveGtSm && !compactMenu;
|
|
1442
1458
|
const inTableCell = (0, import_tableCellContext.useIsInTableCell)();
|
|
1443
|
-
const
|
|
1459
|
+
const inFieldRow = (0, import_fieldRowContext.useFieldRow)();
|
|
1460
|
+
const inline = !inTableCell && !inFieldRow && (0, import_shouldInlineChoices.shouldInlineChoices)({
|
|
1444
1461
|
insideOverlay,
|
|
1445
1462
|
multiple,
|
|
1446
1463
|
options
|
|
@@ -1453,7 +1470,7 @@ function Select({
|
|
|
1453
1470
|
options,
|
|
1454
1471
|
panelWidth
|
|
1455
1472
|
});
|
|
1456
|
-
if (!inline) {
|
|
1473
|
+
if (!inline && !inFieldRow) {
|
|
1457
1474
|
(0, import_devWarn.warnSelectTooFewOptions)({
|
|
1458
1475
|
count: options?.length ?? 0,
|
|
1459
1476
|
multiple,
|
|
@@ -48,6 +48,7 @@ var ReactNative = __toESM(require("react-native"));
|
|
|
48
48
|
var import_react_native = require("react-native");
|
|
49
49
|
var import_tamagui = require("tamagui");
|
|
50
50
|
var import_Chip = require("../../Chip");
|
|
51
|
+
var import_fieldRowContext = require("../../shared/fieldRowContext.native.js");
|
|
51
52
|
var import_pickerTriggerContract = require("../../shared/pickerTriggerContract.native.js");
|
|
52
53
|
var import_Skeleton = require("../../Skeleton");
|
|
53
54
|
var import_fieldLayout = require("../../fieldLayout.native.js");
|
|
@@ -80,6 +81,18 @@ var selectRowOutlineRest = {
|
|
|
80
81
|
...selectOutlineRest,
|
|
81
82
|
borderRadius: 0
|
|
82
83
|
};
|
|
84
|
+
function TriggerCaret(param) {
|
|
85
|
+
var {
|
|
86
|
+
color
|
|
87
|
+
} = param;
|
|
88
|
+
return (0, import_fieldRowContext.useFieldRow)() ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.CaretRightIcon, {
|
|
89
|
+
size: 16,
|
|
90
|
+
color
|
|
91
|
+
}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.CaretDownIcon, {
|
|
92
|
+
size: 16,
|
|
93
|
+
color
|
|
94
|
+
});
|
|
95
|
+
}
|
|
83
96
|
var SelectRow = (0, import_tamagui.styled)(import_tamagui.View, {
|
|
84
97
|
name: "SelectRow",
|
|
85
98
|
...import_theme2.menuRowFrame,
|
|
@@ -497,6 +510,7 @@ function FloatingSelectCore(param) {
|
|
|
497
510
|
var [open, setOpen] = (0, import_react.useState)(false);
|
|
498
511
|
var [activeIndex, setActiveIndex] = (0, import_react.useState)(null);
|
|
499
512
|
var [controlledScrolling, setControlledScrolling] = (0, import_react.useState)(false);
|
|
513
|
+
var rowFace = (0, import_fieldRowContext.useFieldRow)();
|
|
500
514
|
var {
|
|
501
515
|
kbTrigger,
|
|
502
516
|
kbNav,
|
|
@@ -1028,9 +1042,11 @@ function FloatingSelectCore(param) {
|
|
|
1028
1042
|
suppressFocusRing: open,
|
|
1029
1043
|
size: knobProps.sizeToken,
|
|
1030
1044
|
...(0, import_pickerTriggerContract.pickerTriggerContract)(knobProps.control.height),
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1045
|
+
...(rowFace ? null : {
|
|
1046
|
+
paddingHorizontal: knobProps.panelPadding.padding
|
|
1047
|
+
}),
|
|
1048
|
+
...(inTableCell || rowFace ?
|
|
1049
|
+
// Chromeless in cells and field rows.
|
|
1034
1050
|
{} : {
|
|
1035
1051
|
borderWidth: knobProps.borderRadius.borderWidth
|
|
1036
1052
|
}),
|
|
@@ -1042,7 +1058,7 @@ function FloatingSelectCore(param) {
|
|
|
1042
1058
|
minWidth: 0,
|
|
1043
1059
|
paddingVertical: "$2",
|
|
1044
1060
|
justifyContent: multiple && selectedValues.length > 0 ? "center" : "flex-start",
|
|
1045
|
-
alignItems: multiple && selectedValues.length > 0 ? "center" : "flex-start",
|
|
1061
|
+
alignItems: multiple && selectedValues.length > 0 ? "center" : rowFace ? "flex-end" : "flex-start",
|
|
1046
1062
|
children: multiple && selectedValues.length > 0 ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
1047
1063
|
flexDirection: "row",
|
|
1048
1064
|
flexWrap: "nowrap",
|
|
@@ -1070,7 +1086,7 @@ function FloatingSelectCore(param) {
|
|
|
1070
1086
|
...knobProps.controlType,
|
|
1071
1087
|
fontFamily: knobProps.body.fontFamily,
|
|
1072
1088
|
fontWeight: knobProps.body.fontWeight,
|
|
1073
|
-
color: selectedOption ? textColor : import_colorRamps.formCommonColors.muted,
|
|
1089
|
+
color: selectedOption ? rowFace ? "$textMuted" : textColor : import_colorRamps.formCommonColors.muted,
|
|
1074
1090
|
numberOfLines: 1,
|
|
1075
1091
|
userSelect: "none",
|
|
1076
1092
|
children: (_ref = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) !== null && _ref !== void 0 ? _ref : placeholder
|
|
@@ -1078,8 +1094,7 @@ function FloatingSelectCore(param) {
|
|
|
1078
1094
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
1079
1095
|
flexShrink: 0,
|
|
1080
1096
|
alignSelf: "center",
|
|
1081
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(
|
|
1082
|
-
size: 16,
|
|
1097
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(TriggerCaret, {
|
|
1083
1098
|
color: glyphColor
|
|
1084
1099
|
})
|
|
1085
1100
|
})]
|
|
@@ -1246,6 +1261,7 @@ function NativeSelectCore(param) {
|
|
|
1246
1261
|
var optionId = function optionId2(index) {
|
|
1247
1262
|
return `${listboxId}-option-${index}`;
|
|
1248
1263
|
};
|
|
1264
|
+
var rowFace = (0, import_fieldRowContext.useFieldRow)();
|
|
1249
1265
|
var {
|
|
1250
1266
|
kbTrigger,
|
|
1251
1267
|
kbNav,
|
|
@@ -1510,9 +1526,11 @@ function NativeSelectCore(param) {
|
|
|
1510
1526
|
disabled,
|
|
1511
1527
|
size: knobProps.sizeToken,
|
|
1512
1528
|
...(0, import_pickerTriggerContract.pickerTriggerContract)(knobProps.control.height),
|
|
1513
|
-
|
|
1529
|
+
...(rowFace ? null : {
|
|
1530
|
+
paddingHorizontal: knobProps.panelPadding.padding
|
|
1531
|
+
}),
|
|
1514
1532
|
pointerEvents: "none",
|
|
1515
|
-
...(inTableCell ? {} : {
|
|
1533
|
+
...(inTableCell || rowFace ? {} : {
|
|
1516
1534
|
borderWidth: knobProps.borderRadius.borderWidth
|
|
1517
1535
|
}),
|
|
1518
1536
|
"data-testid": "select-trigger",
|
|
@@ -1522,21 +1540,19 @@ function NativeSelectCore(param) {
|
|
|
1522
1540
|
minWidth: 0,
|
|
1523
1541
|
paddingVertical: "$2",
|
|
1524
1542
|
justifyContent: "flex-start",
|
|
1525
|
-
alignItems: "flex-start",
|
|
1543
|
+
alignItems: rowFace ? "flex-end" : "flex-start",
|
|
1526
1544
|
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
1527
1545
|
...knobProps.controlType,
|
|
1528
1546
|
fontFamily: knobProps.body.fontFamily,
|
|
1529
1547
|
fontWeight: knobProps.body.fontWeight,
|
|
1530
|
-
color: selectedOption ? import_colorRamps.formCommonColors.text : import_colorRamps.formCommonColors.muted,
|
|
1548
|
+
color: selectedOption ? rowFace ? "$textMuted" : import_colorRamps.formCommonColors.text : import_colorRamps.formCommonColors.muted,
|
|
1531
1549
|
numberOfLines: 1,
|
|
1532
1550
|
children: triggerValueText
|
|
1533
1551
|
})
|
|
1534
1552
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
1535
1553
|
flexShrink: 0,
|
|
1536
1554
|
alignSelf: "center",
|
|
1537
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(
|
|
1538
|
-
size: 16
|
|
1539
|
-
})
|
|
1555
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(TriggerCaret, {})
|
|
1540
1556
|
})]
|
|
1541
1557
|
})
|
|
1542
1558
|
});
|
|
@@ -1565,8 +1581,10 @@ function NativeSelectCore(param) {
|
|
|
1565
1581
|
disabled,
|
|
1566
1582
|
size: knobProps.sizeToken,
|
|
1567
1583
|
...(0, import_pickerTriggerContract.pickerTriggerContract)(knobProps.control.height),
|
|
1568
|
-
|
|
1569
|
-
|
|
1584
|
+
...(rowFace ? null : {
|
|
1585
|
+
paddingHorizontal: knobProps.panelPadding.padding
|
|
1586
|
+
}),
|
|
1587
|
+
...(inTableCell || rowFace ? {} : {
|
|
1570
1588
|
borderWidth: knobProps.borderRadius.borderWidth
|
|
1571
1589
|
}),
|
|
1572
1590
|
...(import_tamagui.isWeb ? selectTriggerRingProps(kbTrigger, open) : void 0),
|
|
@@ -1616,7 +1634,7 @@ function NativeSelectCore(param) {
|
|
|
1616
1634
|
minWidth: 0,
|
|
1617
1635
|
paddingVertical: "$2",
|
|
1618
1636
|
justifyContent: multiple && selectedValues.length > 0 ? "center" : "flex-start",
|
|
1619
|
-
alignItems: multiple && selectedValues.length > 0 ? "center" : "flex-start",
|
|
1637
|
+
alignItems: multiple && selectedValues.length > 0 ? "center" : rowFace ? "flex-end" : "flex-start",
|
|
1620
1638
|
children: multiple && selectedValues.length > 0 ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
1621
1639
|
flexDirection: "row",
|
|
1622
1640
|
flexWrap: "nowrap",
|
|
@@ -1644,15 +1662,14 @@ function NativeSelectCore(param) {
|
|
|
1644
1662
|
...knobProps.controlType,
|
|
1645
1663
|
fontFamily: knobProps.body.fontFamily,
|
|
1646
1664
|
fontWeight: knobProps.body.fontWeight,
|
|
1647
|
-
color: selectedOption ? textColor : import_colorRamps.formCommonColors.muted,
|
|
1665
|
+
color: selectedOption ? rowFace ? "$textMuted" : textColor : import_colorRamps.formCommonColors.muted,
|
|
1648
1666
|
numberOfLines: 1,
|
|
1649
1667
|
children: (_ref2 = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) !== null && _ref2 !== void 0 ? _ref2 : placeholder
|
|
1650
1668
|
})
|
|
1651
1669
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
1652
1670
|
flexShrink: 0,
|
|
1653
1671
|
alignSelf: "center",
|
|
1654
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(
|
|
1655
|
-
size: 16,
|
|
1672
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(TriggerCaret, {
|
|
1656
1673
|
color: glyphColor
|
|
1657
1674
|
})
|
|
1658
1675
|
})]
|
|
@@ -1718,7 +1735,8 @@ function Select(param) {
|
|
|
1718
1735
|
var compactMenu = (0, import_compactFace.resolveCompactFace)((0, import_compactFace.pickerCompactFace)((_ref = options === null || options === void 0 ? void 0 : options.length) !== null && _ref !== void 0 ? _ref : 0), insideOverlay) === "menu";
|
|
1719
1736
|
var shouldUseSheet = !import_tamagui.isWeb || !effectiveGtSm && !compactMenu;
|
|
1720
1737
|
var inTableCell = (0, import_tableCellContext.useIsInTableCell)();
|
|
1721
|
-
var
|
|
1738
|
+
var inFieldRow = (0, import_fieldRowContext.useFieldRow)();
|
|
1739
|
+
var inline = !inTableCell && !inFieldRow && (0, import_shouldInlineChoices.shouldInlineChoices)({
|
|
1722
1740
|
insideOverlay,
|
|
1723
1741
|
multiple,
|
|
1724
1742
|
options
|
|
@@ -1731,7 +1749,7 @@ function Select(param) {
|
|
|
1731
1749
|
options,
|
|
1732
1750
|
panelWidth
|
|
1733
1751
|
});
|
|
1734
|
-
if (!inline) {
|
|
1752
|
+
if (!inline && !inFieldRow) {
|
|
1735
1753
|
var _ref1;
|
|
1736
1754
|
(0, import_devWarn.warnSelectTooFewOptions)({
|
|
1737
1755
|
count: (_ref1 = options === null || options === void 0 ? void 0 : options.length) !== null && _ref1 !== void 0 ? _ref1 : 0,
|