@multiplatform.one/forms 7.7.4 → 7.7.6
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/Button/index.cjs +3 -33
- package/dist/cjs/Button/index.native.js +3 -33
- package/dist/cjs/Button/index.native.js.map +1 -1
- package/dist/cjs/ContextualSaveBar/index.cjs +17 -10
- package/dist/cjs/ContextualSaveBar/index.native.js +18 -10
- package/dist/cjs/ContextualSaveBar/index.native.js.map +1 -1
- package/dist/cjs/InputParts/index.cjs +3 -1
- package/dist/cjs/InputParts/index.native.js +3 -1
- package/dist/cjs/InputParts/index.native.js.map +1 -1
- package/dist/cjs/fields/Combobox/index.cjs +39 -48
- package/dist/cjs/fields/Combobox/index.native.js +43 -51
- package/dist/cjs/fields/Combobox/index.native.js.map +1 -1
- package/dist/cjs/fields/Select/index.cjs +11 -7
- package/dist/cjs/fields/Select/index.native.js +13 -19
- package/dist/cjs/fields/Select/index.native.js.map +1 -1
- package/dist/cjs/shared/pickerTriggerContract.cjs +38 -0
- package/dist/cjs/shared/pickerTriggerContract.native.js +41 -0
- package/dist/cjs/shared/pickerTriggerContract.native.js.map +1 -0
- package/dist/cjs/shared/pressSlopProps.cjs +68 -0
- package/dist/cjs/shared/pressSlopProps.native.js +72 -0
- package/dist/cjs/shared/pressSlopProps.native.js.map +1 -0
- package/dist/esm/Button/index.mjs +1 -31
- package/dist/esm/Button/index.mjs.map +1 -1
- package/dist/esm/Button/index.native.js +1 -31
- package/dist/esm/Button/index.native.js.map +1 -1
- package/dist/esm/ContextualSaveBar/index.mjs +17 -10
- package/dist/esm/ContextualSaveBar/index.mjs.map +1 -1
- package/dist/esm/ContextualSaveBar/index.native.js +18 -10
- package/dist/esm/ContextualSaveBar/index.native.js.map +1 -1
- package/dist/esm/InputParts/index.mjs +3 -1
- package/dist/esm/InputParts/index.mjs.map +1 -1
- package/dist/esm/InputParts/index.native.js +3 -1
- package/dist/esm/InputParts/index.native.js.map +1 -1
- package/dist/esm/fields/Combobox/index.mjs +39 -48
- package/dist/esm/fields/Combobox/index.mjs.map +1 -1
- package/dist/esm/fields/Combobox/index.native.js +43 -51
- package/dist/esm/fields/Combobox/index.native.js.map +1 -1
- package/dist/esm/fields/Select/index.mjs +12 -8
- package/dist/esm/fields/Select/index.mjs.map +1 -1
- package/dist/esm/fields/Select/index.native.js +14 -20
- package/dist/esm/fields/Select/index.native.js.map +1 -1
- package/dist/esm/shared/pickerTriggerContract.mjs +13 -0
- package/dist/esm/shared/pickerTriggerContract.mjs.map +1 -0
- package/dist/esm/shared/pickerTriggerContract.native.js +13 -0
- package/dist/esm/shared/pickerTriggerContract.native.js.map +1 -0
- package/dist/esm/shared/pressSlopProps.mjs +43 -0
- package/dist/esm/shared/pressSlopProps.mjs.map +1 -0
- package/dist/esm/shared/pressSlopProps.native.js +44 -0
- package/dist/esm/shared/pressSlopProps.native.js.map +1 -0
- package/dist/jsx/Button/index.mjs +1 -31
- package/dist/jsx/Button/index.mjs.map +1 -1
- package/dist/jsx/Button/index.native.js +3 -33
- package/dist/jsx/Button/index.native.js.map +1 -1
- package/dist/jsx/ContextualSaveBar/index.mjs +17 -10
- package/dist/jsx/ContextualSaveBar/index.mjs.map +1 -1
- package/dist/jsx/ContextualSaveBar/index.native.js +18 -10
- package/dist/jsx/ContextualSaveBar/index.native.js.map +1 -1
- package/dist/jsx/InputParts/index.mjs +3 -1
- package/dist/jsx/InputParts/index.mjs.map +1 -1
- package/dist/jsx/InputParts/index.native.js +3 -1
- package/dist/jsx/InputParts/index.native.js.map +1 -1
- package/dist/jsx/fields/Combobox/index.mjs +39 -48
- package/dist/jsx/fields/Combobox/index.mjs.map +1 -1
- package/dist/jsx/fields/Combobox/index.native.js +43 -51
- package/dist/jsx/fields/Combobox/index.native.js.map +1 -1
- package/dist/jsx/fields/Select/index.mjs +12 -8
- package/dist/jsx/fields/Select/index.mjs.map +1 -1
- package/dist/jsx/fields/Select/index.native.js +13 -19
- package/dist/jsx/fields/Select/index.native.js.map +1 -1
- package/dist/jsx/shared/pickerTriggerContract.mjs +13 -0
- package/dist/jsx/shared/pickerTriggerContract.mjs.map +1 -0
- package/dist/jsx/shared/pickerTriggerContract.native.js +41 -0
- package/dist/jsx/shared/pickerTriggerContract.native.js.map +1 -0
- package/dist/jsx/shared/pressSlopProps.mjs +43 -0
- package/dist/jsx/shared/pressSlopProps.mjs.map +1 -0
- package/dist/jsx/shared/pressSlopProps.native.js +72 -0
- package/dist/jsx/shared/pressSlopProps.native.js.map +1 -0
- package/package.json +7 -7
- package/src/Button/index.tsx +1 -35
- package/src/ContextualSaveBar/ContextualSaveBar.spec.tsx +33 -0
- package/src/ContextualSaveBar/ContextualSaveBar.stories.tsx +19 -0
- package/src/ContextualSaveBar/index.tsx +12 -8
- package/src/ContextualSaveBar/nativeFlow.spec.tsx +20 -0
- package/src/InputParts/index.tsx +5 -1
- package/src/fields/Combobox/index.tsx +40 -44
- package/src/fields/Select/index.tsx +13 -18
- package/src/fields/pickerActivation.spec.tsx +105 -0
- package/src/fields/pickerDensity.spec.tsx +86 -0
- package/src/fields/pickerRows.spec.tsx +66 -0
- package/src/shared/pickerTriggerContract.ts +13 -0
- package/src/shared/pressSlopProps.spec.ts +39 -0
- package/src/shared/pressSlopProps.ts +52 -0
- package/types/Button/index.d.ts.map +1 -1
- package/types/ContextualSaveBar/index.d.ts +1 -1
- package/types/ContextualSaveBar/index.d.ts.map +1 -1
- package/types/InputParts/index.d.ts.map +1 -1
- package/types/fields/Combobox/index.d.ts.map +1 -1
- package/types/fields/Select/index.d.ts.map +1 -1
- package/types/shared/pickerTriggerContract.d.ts +18 -0
- package/types/shared/pickerTriggerContract.d.ts.map +1 -0
- package/types/shared/pressSlopProps.d.ts +8 -0
- package/types/shared/pressSlopProps.d.ts.map +1 -0
|
@@ -32,7 +32,9 @@ var import_react3 = require("@floating-ui/react");
|
|
|
32
32
|
var import_theme = require("@multiplatform.one/theme");
|
|
33
33
|
var import_react_native = require("react-native-web");
|
|
34
34
|
var import_tamagui = require("tamagui");
|
|
35
|
+
var import_Button = require("../../Button/index.cjs");
|
|
35
36
|
var import_Chip = require("../../Chip/index.cjs");
|
|
37
|
+
var import_pickerTriggerContract = require("../../shared/pickerTriggerContract.cjs");
|
|
36
38
|
var import_Skeleton = require("../../Skeleton/index.cjs");
|
|
37
39
|
var import_fieldLayout = require("../../fieldLayout.cjs");
|
|
38
40
|
var import_InputParts = require("../../InputParts/index.cjs");
|
|
@@ -200,7 +202,7 @@ const ComboboxItem = (0, import_react.memo)(function ComboboxItem2({
|
|
|
200
202
|
active: isActive,
|
|
201
203
|
"aria-selected": isSelected,
|
|
202
204
|
"data-state": isSelected ? "active" : "inactive",
|
|
203
|
-
|
|
205
|
+
height: ctx.knobProps.control.height,
|
|
204
206
|
...listItemRingProps(Boolean(keyboardRing)),
|
|
205
207
|
...(suppressHover ? {
|
|
206
208
|
hoverStyle: {
|
|
@@ -986,18 +988,12 @@ function FloatingComboboxCore({
|
|
|
986
988
|
disabled,
|
|
987
989
|
size: knobProps.sizeToken,
|
|
988
990
|
suppressFocusRing: open && !multiple,
|
|
991
|
+
...(0, import_pickerTriggerContract.pickerTriggerContract)(knobProps.control.height),
|
|
989
992
|
...(inTableCell ?
|
|
990
|
-
// Chromeless in cells
|
|
991
|
-
{
|
|
992
|
-
minHeight: 44
|
|
993
|
-
} : {
|
|
993
|
+
// Chromeless in cells.
|
|
994
|
+
{} : {
|
|
994
995
|
borderRadius: knobProps.borderRadius.borderRadius,
|
|
995
|
-
borderWidth: knobProps.borderRadius.borderWidth
|
|
996
|
-
// LC-54 PRESS-FLOOR: compact/small size tokens render a sub-44
|
|
997
|
-
// trigger (the 36px "Allocated To" quick filter breaking the
|
|
998
|
-
// list's 44px control row) — same floor the house Select holds
|
|
999
|
-
// on both its trigger variants.
|
|
1000
|
-
minHeight: 44
|
|
996
|
+
borderWidth: knobProps.borderRadius.borderWidth
|
|
1001
997
|
}),
|
|
1002
998
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_floatingList.SyncFocusToOpen, {
|
|
1003
999
|
open
|
|
@@ -1026,6 +1022,7 @@ function FloatingComboboxCore({
|
|
|
1026
1022
|
children: getLabel(v)
|
|
1027
1023
|
}, v))
|
|
1028
1024
|
}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
1025
|
+
...knobProps.controlType,
|
|
1029
1026
|
fontFamily: knobProps.body.fontFamily,
|
|
1030
1027
|
fontWeight: knobProps.body.fontWeight,
|
|
1031
1028
|
color: selectedOption || !multiple && value && valueLabel ? textColor : import_colorRamps.formCommonColors.muted,
|
|
@@ -1033,11 +1030,15 @@ function FloatingComboboxCore({
|
|
|
1033
1030
|
userSelect: "none",
|
|
1034
1031
|
children: selectedOption?.label ?? (!multiple && value && valueLabel ? valueLabel : placeholder)
|
|
1035
1032
|
})
|
|
1036
|
-
}), clearable && !multiple && !disabled && typeof value === "string" && value !== "" && /* @__PURE__ */(0, import_jsx_runtime.jsx)(
|
|
1037
|
-
|
|
1033
|
+
}), clearable && !multiple && !disabled && typeof value === "string" && value !== "" && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Button.Button, {
|
|
1034
|
+
size: knobProps.control.height,
|
|
1035
|
+
chromeless: true,
|
|
1036
|
+
...(0, import_pickerTriggerContract.pickerTriggerContract)(knobProps.control.height),
|
|
1037
|
+
icon: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.XIcon, {
|
|
1038
|
+
size: 14
|
|
1039
|
+
}),
|
|
1038
1040
|
alignSelf: "center",
|
|
1039
1041
|
cursor: "pointer",
|
|
1040
|
-
role: "button",
|
|
1041
1042
|
tabIndex: -1,
|
|
1042
1043
|
"aria-label": t("Clear"),
|
|
1043
1044
|
opacity: 0.6,
|
|
@@ -1051,10 +1052,7 @@ function FloatingComboboxCore({
|
|
|
1051
1052
|
onPress: e => {
|
|
1052
1053
|
e.stopPropagation?.();
|
|
1053
1054
|
onValueChange?.("");
|
|
1054
|
-
}
|
|
1055
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.XIcon, {
|
|
1056
|
-
size: 14
|
|
1057
|
-
})
|
|
1055
|
+
}
|
|
1058
1056
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
1059
1057
|
paddingInlineEnd: "$2",
|
|
1060
1058
|
alignSelf: "center",
|
|
@@ -1184,7 +1182,7 @@ function FloatingComboboxCore({
|
|
|
1184
1182
|
id: comboboxOptionId(id, createOptionIndex),
|
|
1185
1183
|
selected: false,
|
|
1186
1184
|
active: createOptionIndex === activeIndex,
|
|
1187
|
-
|
|
1185
|
+
height: knobProps.control.height,
|
|
1188
1186
|
"data-combobox-index": createOptionIndex,
|
|
1189
1187
|
"data-active": createOptionIndex === activeIndex,
|
|
1190
1188
|
...listItemRingProps(createOptionIndex === activeIndex && listKeyboardRing),
|
|
@@ -1214,7 +1212,7 @@ function FloatingComboboxCore({
|
|
|
1214
1212
|
id: comboboxOptionId(id, createOptionIndex),
|
|
1215
1213
|
selected: false,
|
|
1216
1214
|
active: createOptionIndex === activeIndex,
|
|
1217
|
-
|
|
1215
|
+
height: knobProps.control.height,
|
|
1218
1216
|
"data-combobox-index": createOptionIndex,
|
|
1219
1217
|
"data-active": createOptionIndex === activeIndex,
|
|
1220
1218
|
...listItemRingProps(createOptionIndex === activeIndex && listKeyboardRing),
|
|
@@ -1283,7 +1281,7 @@ const comboboxSearchHeader = (knobProps, filter, setFilter, searchPlaceholder, t
|
|
|
1283
1281
|
alignItems: "center",
|
|
1284
1282
|
gap: "$2",
|
|
1285
1283
|
paddingHorizontal: "$3",
|
|
1286
|
-
height: knobProps.
|
|
1284
|
+
height: knobProps.control.height,
|
|
1287
1285
|
borderBottomWidth: 1,
|
|
1288
1286
|
borderBottomColor: import_colorRamps.formCommonColors.divider,
|
|
1289
1287
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.MagnifyingGlassIcon, {
|
|
@@ -1605,10 +1603,10 @@ function NativeComboboxCore({
|
|
|
1605
1603
|
"data-active": active,
|
|
1606
1604
|
...listItemRingProps(active && listKeyboardRing),
|
|
1607
1605
|
...(option.description ? {
|
|
1608
|
-
minHeight: knobProps.
|
|
1606
|
+
minHeight: knobProps.control.height,
|
|
1609
1607
|
paddingVertical: "$2"
|
|
1610
1608
|
} : {
|
|
1611
|
-
height: knobProps.
|
|
1609
|
+
height: knobProps.control.height
|
|
1612
1610
|
}),
|
|
1613
1611
|
onPress: import_tamagui.isWeb ? () => handleSelect(option) : void 0,
|
|
1614
1612
|
onMouseEnter: () => {
|
|
@@ -1675,7 +1673,7 @@ function NativeComboboxCore({
|
|
|
1675
1673
|
alignItems: "center",
|
|
1676
1674
|
gap: "$2",
|
|
1677
1675
|
paddingHorizontal: "$3",
|
|
1678
|
-
height: knobProps.
|
|
1676
|
+
height: knobProps.control.height,
|
|
1679
1677
|
role: "option",
|
|
1680
1678
|
id: comboboxOptionId(id, createOptionIndex),
|
|
1681
1679
|
"data-combobox-index": createOptionIndex,
|
|
@@ -1712,7 +1710,7 @@ function NativeComboboxCore({
|
|
|
1712
1710
|
alignItems: "center",
|
|
1713
1711
|
gap: "$2",
|
|
1714
1712
|
paddingHorizontal: "$3",
|
|
1715
|
-
height: knobProps.
|
|
1713
|
+
height: knobProps.control.height,
|
|
1716
1714
|
role: "option",
|
|
1717
1715
|
id: comboboxOptionId(id, createOptionIndex),
|
|
1718
1716
|
"data-combobox-index": createOptionIndex,
|
|
@@ -1792,11 +1790,10 @@ function NativeComboboxCore({
|
|
|
1792
1790
|
disabled,
|
|
1793
1791
|
size: knobProps.sizeToken,
|
|
1794
1792
|
suppressFocusRing: open && !multiple,
|
|
1793
|
+
...(0, import_pickerTriggerContract.pickerTriggerContract)(knobProps.control.height),
|
|
1795
1794
|
...(inTableCell ?
|
|
1796
|
-
// Chromeless in cells
|
|
1797
|
-
{
|
|
1798
|
-
minHeight: 44
|
|
1799
|
-
} : {
|
|
1795
|
+
// Chromeless in cells.
|
|
1796
|
+
{} : {
|
|
1800
1797
|
borderRadius: knobProps.borderRadius.borderRadius,
|
|
1801
1798
|
borderWidth: knobProps.borderRadius.borderWidth
|
|
1802
1799
|
}),
|
|
@@ -1817,7 +1814,7 @@ function NativeComboboxCore({
|
|
|
1817
1814
|
} : {
|
|
1818
1815
|
importantForAccessibility: "no"
|
|
1819
1816
|
}),
|
|
1820
|
-
onPress: import_tamagui.isWeb && !disabled ? () => handleOpenChange(
|
|
1817
|
+
onPress: import_tamagui.isWeb && !disabled ? () => handleOpenChange(true) : void 0,
|
|
1821
1818
|
onKeyDown: e => {
|
|
1822
1819
|
if (["Enter", " ", "ArrowDown", "ArrowUp", "j", "k"].includes(e.key) || e.code === "Space") {
|
|
1823
1820
|
e.preventDefault();
|
|
@@ -1850,30 +1847,13 @@ function NativeComboboxCore({
|
|
|
1850
1847
|
children: getLabel(v)
|
|
1851
1848
|
}, v))
|
|
1852
1849
|
}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
1850
|
+
...knobProps.controlType,
|
|
1853
1851
|
fontFamily: knobProps.body.fontFamily,
|
|
1854
1852
|
fontWeight: knobProps.body.fontWeight,
|
|
1855
1853
|
color: selectedOption || !multiple && value && valueLabel ? textColor : import_colorRamps.formCommonColors.muted,
|
|
1856
1854
|
numberOfLines: 1,
|
|
1857
1855
|
children: selectedOption?.label ?? (!multiple && value && valueLabel ? valueLabel : placeholder)
|
|
1858
1856
|
})
|
|
1859
|
-
}), clearable && !multiple && !disabled && typeof value === "string" && value !== "" && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
1860
|
-
paddingInlineEnd: "$1",
|
|
1861
|
-
alignSelf: "center",
|
|
1862
|
-
cursor: "pointer",
|
|
1863
|
-
role: "button",
|
|
1864
|
-
tabIndex: -1,
|
|
1865
|
-
"aria-label": t("Clear"),
|
|
1866
|
-
opacity: 0.6,
|
|
1867
|
-
hoverStyle: {
|
|
1868
|
-
opacity: 1
|
|
1869
|
-
},
|
|
1870
|
-
onPress: e => {
|
|
1871
|
-
e.stopPropagation?.();
|
|
1872
|
-
onValueChange?.("");
|
|
1873
|
-
},
|
|
1874
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.XIcon, {
|
|
1875
|
-
size: 14
|
|
1876
|
-
})
|
|
1877
1857
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
1878
1858
|
paddingInlineEnd: "$2",
|
|
1879
1859
|
alignSelf: "center",
|
|
@@ -1890,6 +1870,17 @@ function NativeComboboxCore({
|
|
|
1890
1870
|
sheet: true,
|
|
1891
1871
|
sheetFill: Boolean(onSearch),
|
|
1892
1872
|
trigger: triggerContent,
|
|
1873
|
+
triggerEnd: clearable && !multiple && !disabled && typeof value === "string" && value !== "" ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Button.Button, {
|
|
1874
|
+
size: knobProps.sizeToken,
|
|
1875
|
+
chromeless: true,
|
|
1876
|
+
minWidth: 44,
|
|
1877
|
+
minHeight: 44,
|
|
1878
|
+
"aria-label": t("Clear"),
|
|
1879
|
+
icon: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.XIcon, {
|
|
1880
|
+
size: 14
|
|
1881
|
+
}),
|
|
1882
|
+
onPress: () => onValueChange?.("")
|
|
1883
|
+
}) : void 0,
|
|
1893
1884
|
triggerA11y: {
|
|
1894
1885
|
label: ariaLabel ?? fieldA11y?.label,
|
|
1895
1886
|
value: triggerValueText,
|
|
@@ -35,7 +35,9 @@ var import_react3 = require("@floating-ui/react");
|
|
|
35
35
|
var import_theme = require("@multiplatform.one/theme");
|
|
36
36
|
var import_react_native = require("react-native");
|
|
37
37
|
var import_tamagui = require("tamagui");
|
|
38
|
+
var import_Button = require("../../Button/index.native.js");
|
|
38
39
|
var import_Chip = require("../../Chip/index.native.js");
|
|
40
|
+
var import_pickerTriggerContract = require("../../shared/pickerTriggerContract.native.js");
|
|
39
41
|
var import_Skeleton = require("../../Skeleton/index.native.js");
|
|
40
42
|
var import_fieldLayout = require("../../fieldLayout.native.js");
|
|
41
43
|
var import_InputParts = require("../../InputParts/index.native.js");
|
|
@@ -292,7 +294,7 @@ var ComboboxItem = /* @__PURE__ */(0, import_react.memo)(function ComboboxItem2(
|
|
|
292
294
|
active: isActive,
|
|
293
295
|
"aria-selected": isSelected,
|
|
294
296
|
"data-state": isSelected ? "active" : "inactive",
|
|
295
|
-
|
|
297
|
+
height: ctx.knobProps.control.height,
|
|
296
298
|
...listItemRingProps(Boolean(keyboardRing)),
|
|
297
299
|
...(suppressHover ? {
|
|
298
300
|
hoverStyle: {
|
|
@@ -1177,18 +1179,12 @@ function FloatingComboboxCore(param) {
|
|
|
1177
1179
|
// attaches below instead (MPO-38), leaving the trigger on screen and
|
|
1178
1180
|
// focusable, so it keeps its ring.
|
|
1179
1181
|
suppressFocusRing: open && !multiple,
|
|
1182
|
+
...(0, import_pickerTriggerContract.pickerTriggerContract)(knobProps.control.height),
|
|
1180
1183
|
...(inTableCell ?
|
|
1181
|
-
// Chromeless in cells
|
|
1182
|
-
{
|
|
1183
|
-
minHeight: 44
|
|
1184
|
-
} : {
|
|
1184
|
+
// Chromeless in cells.
|
|
1185
|
+
{} : {
|
|
1185
1186
|
borderRadius: knobProps.borderRadius.borderRadius,
|
|
1186
|
-
borderWidth: knobProps.borderRadius.borderWidth
|
|
1187
|
-
// LC-54 PRESS-FLOOR: compact/small size tokens render a sub-44
|
|
1188
|
-
// trigger (the 36px "Allocated To" quick filter breaking the
|
|
1189
|
-
// list's 44px control row) — same floor the house Select holds
|
|
1190
|
-
// on both its trigger variants.
|
|
1191
|
-
minHeight: 44
|
|
1187
|
+
borderWidth: knobProps.borderRadius.borderWidth
|
|
1192
1188
|
}),
|
|
1193
1189
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_floatingList.SyncFocusToOpen, {
|
|
1194
1190
|
open
|
|
@@ -1222,6 +1218,7 @@ function FloatingComboboxCore(param) {
|
|
|
1222
1218
|
}, v);
|
|
1223
1219
|
})
|
|
1224
1220
|
}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
1221
|
+
...knobProps.controlType,
|
|
1225
1222
|
fontFamily: knobProps.body.fontFamily,
|
|
1226
1223
|
fontWeight: knobProps.body.fontWeight,
|
|
1227
1224
|
color: selectedOption || !multiple && value && valueLabel ? textColor : import_colorRamps.formCommonColors.muted,
|
|
@@ -1229,11 +1226,15 @@ function FloatingComboboxCore(param) {
|
|
|
1229
1226
|
userSelect: "none",
|
|
1230
1227
|
children: (_ref = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) !== null && _ref !== void 0 ? _ref : !multiple && value && valueLabel ? valueLabel : placeholder
|
|
1231
1228
|
})
|
|
1232
|
-
}), clearable && !multiple && !disabled && typeof value === "string" && value !== "" && /* @__PURE__ */(0, import_jsx_runtime.jsx)(
|
|
1233
|
-
|
|
1229
|
+
}), clearable && !multiple && !disabled && typeof value === "string" && value !== "" && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Button.Button, {
|
|
1230
|
+
size: knobProps.control.height,
|
|
1231
|
+
chromeless: true,
|
|
1232
|
+
...(0, import_pickerTriggerContract.pickerTriggerContract)(knobProps.control.height),
|
|
1233
|
+
icon: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.XIcon, {
|
|
1234
|
+
size: 14
|
|
1235
|
+
}),
|
|
1234
1236
|
alignSelf: "center",
|
|
1235
1237
|
cursor: "pointer",
|
|
1236
|
-
role: "button",
|
|
1237
1238
|
tabIndex: -1,
|
|
1238
1239
|
"aria-label": t("Clear"),
|
|
1239
1240
|
opacity: 0.6,
|
|
@@ -1250,10 +1251,7 @@ function FloatingComboboxCore(param) {
|
|
|
1250
1251
|
var _e_stopPropagation;
|
|
1251
1252
|
(_e_stopPropagation = e.stopPropagation) === null || _e_stopPropagation === void 0 ? void 0 : _e_stopPropagation.call(e);
|
|
1252
1253
|
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange("");
|
|
1253
|
-
}
|
|
1254
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.XIcon, {
|
|
1255
|
-
size: 14
|
|
1256
|
-
})
|
|
1254
|
+
}
|
|
1257
1255
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
1258
1256
|
paddingInlineEnd: "$2",
|
|
1259
1257
|
alignSelf: "center",
|
|
@@ -1390,7 +1388,7 @@ function FloatingComboboxCore(param) {
|
|
|
1390
1388
|
id: comboboxOptionId(id, createOptionIndex),
|
|
1391
1389
|
selected: false,
|
|
1392
1390
|
active: createOptionIndex === activeIndex,
|
|
1393
|
-
|
|
1391
|
+
height: knobProps.control.height,
|
|
1394
1392
|
"data-combobox-index": createOptionIndex,
|
|
1395
1393
|
"data-active": createOptionIndex === activeIndex,
|
|
1396
1394
|
...listItemRingProps(createOptionIndex === activeIndex && listKeyboardRing),
|
|
@@ -1420,7 +1418,7 @@ function FloatingComboboxCore(param) {
|
|
|
1420
1418
|
id: comboboxOptionId(id, createOptionIndex),
|
|
1421
1419
|
selected: false,
|
|
1422
1420
|
active: createOptionIndex === activeIndex,
|
|
1423
|
-
|
|
1421
|
+
height: knobProps.control.height,
|
|
1424
1422
|
"data-combobox-index": createOptionIndex,
|
|
1425
1423
|
"data-active": createOptionIndex === activeIndex,
|
|
1426
1424
|
...listItemRingProps(createOptionIndex === activeIndex && listKeyboardRing),
|
|
@@ -1490,7 +1488,7 @@ var comboboxSearchHeader = function comboboxSearchHeader2(knobProps, filter, set
|
|
|
1490
1488
|
alignItems: "center",
|
|
1491
1489
|
gap: "$2",
|
|
1492
1490
|
paddingHorizontal: "$3",
|
|
1493
|
-
height: knobProps.
|
|
1491
|
+
height: knobProps.control.height,
|
|
1494
1492
|
borderBottomWidth: 1,
|
|
1495
1493
|
borderBottomColor: import_colorRamps.formCommonColors.divider,
|
|
1496
1494
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.MagnifyingGlassIcon, {
|
|
@@ -1878,10 +1876,10 @@ function NativeComboboxCore(param) {
|
|
|
1878
1876
|
"data-active": active,
|
|
1879
1877
|
...listItemRingProps(active && listKeyboardRing),
|
|
1880
1878
|
...(option.description ? {
|
|
1881
|
-
minHeight: knobProps.
|
|
1879
|
+
minHeight: knobProps.control.height,
|
|
1882
1880
|
paddingVertical: "$2"
|
|
1883
1881
|
} : {
|
|
1884
|
-
height: knobProps.
|
|
1882
|
+
height: knobProps.control.height
|
|
1885
1883
|
}),
|
|
1886
1884
|
onPress: import_tamagui.isWeb ? function () {
|
|
1887
1885
|
return handleSelect(option);
|
|
@@ -1952,7 +1950,7 @@ function NativeComboboxCore(param) {
|
|
|
1952
1950
|
alignItems: "center",
|
|
1953
1951
|
gap: "$2",
|
|
1954
1952
|
paddingHorizontal: "$3",
|
|
1955
|
-
height: knobProps.
|
|
1953
|
+
height: knobProps.control.height,
|
|
1956
1954
|
role: "option",
|
|
1957
1955
|
id: comboboxOptionId(id, createOptionIndex),
|
|
1958
1956
|
"data-combobox-index": createOptionIndex,
|
|
@@ -1989,7 +1987,7 @@ function NativeComboboxCore(param) {
|
|
|
1989
1987
|
alignItems: "center",
|
|
1990
1988
|
gap: "$2",
|
|
1991
1989
|
paddingHorizontal: "$3",
|
|
1992
|
-
height: knobProps.
|
|
1990
|
+
height: knobProps.control.height,
|
|
1993
1991
|
role: "option",
|
|
1994
1992
|
id: comboboxOptionId(id, createOptionIndex),
|
|
1995
1993
|
"data-combobox-index": createOptionIndex,
|
|
@@ -2075,11 +2073,10 @@ function NativeComboboxCore(param) {
|
|
|
2075
2073
|
// paint — it would ghost around the panel's corners. A multi-select
|
|
2076
2074
|
// panel attaches below instead (MPO-38), so it keeps its ring.
|
|
2077
2075
|
suppressFocusRing: open && !multiple,
|
|
2076
|
+
...(0, import_pickerTriggerContract.pickerTriggerContract)(knobProps.control.height),
|
|
2078
2077
|
...(inTableCell ?
|
|
2079
|
-
// Chromeless in cells
|
|
2080
|
-
{
|
|
2081
|
-
minHeight: 44
|
|
2082
|
-
} : {
|
|
2078
|
+
// Chromeless in cells.
|
|
2079
|
+
{} : {
|
|
2083
2080
|
borderRadius: knobProps.borderRadius.borderRadius,
|
|
2084
2081
|
borderWidth: knobProps.borderRadius.borderWidth
|
|
2085
2082
|
}),
|
|
@@ -2105,10 +2102,10 @@ function NativeComboboxCore(param) {
|
|
|
2105
2102
|
} : {
|
|
2106
2103
|
importantForAccessibility: "no"
|
|
2107
2104
|
}),
|
|
2108
|
-
//
|
|
2109
|
-
//
|
|
2105
|
+
// Sheet capture opens first on web, so this opener is idempotent.
|
|
2106
|
+
// Native delegates the gesture to FloatingPanel.
|
|
2110
2107
|
onPress: import_tamagui.isWeb && !disabled ? function () {
|
|
2111
|
-
return handleOpenChange(
|
|
2108
|
+
return handleOpenChange(true);
|
|
2112
2109
|
} : void 0,
|
|
2113
2110
|
onKeyDown: function onKeyDown(e) {
|
|
2114
2111
|
if (["Enter", " ", "ArrowDown", "ArrowUp", "j", "k"].includes(e.key) || e.code === "Space") {
|
|
@@ -2147,31 +2144,13 @@ function NativeComboboxCore(param) {
|
|
|
2147
2144
|
}, v);
|
|
2148
2145
|
})
|
|
2149
2146
|
}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
2147
|
+
...knobProps.controlType,
|
|
2150
2148
|
fontFamily: knobProps.body.fontFamily,
|
|
2151
2149
|
fontWeight: knobProps.body.fontWeight,
|
|
2152
2150
|
color: selectedOption || !multiple && value && valueLabel ? textColor : import_colorRamps.formCommonColors.muted,
|
|
2153
2151
|
numberOfLines: 1,
|
|
2154
2152
|
children: (_ref1 = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) !== null && _ref1 !== void 0 ? _ref1 : !multiple && value && valueLabel ? valueLabel : placeholder
|
|
2155
2153
|
})
|
|
2156
|
-
}), clearable && !multiple && !disabled && typeof value === "string" && value !== "" && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
2157
|
-
paddingInlineEnd: "$1",
|
|
2158
|
-
alignSelf: "center",
|
|
2159
|
-
cursor: "pointer",
|
|
2160
|
-
role: "button",
|
|
2161
|
-
tabIndex: -1,
|
|
2162
|
-
"aria-label": t("Clear"),
|
|
2163
|
-
opacity: 0.6,
|
|
2164
|
-
hoverStyle: {
|
|
2165
|
-
opacity: 1
|
|
2166
|
-
},
|
|
2167
|
-
onPress: function onPress(e) {
|
|
2168
|
-
var _e_stopPropagation;
|
|
2169
|
-
(_e_stopPropagation = e.stopPropagation) === null || _e_stopPropagation === void 0 ? void 0 : _e_stopPropagation.call(e);
|
|
2170
|
-
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange("");
|
|
2171
|
-
},
|
|
2172
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.XIcon, {
|
|
2173
|
-
size: 14
|
|
2174
|
-
})
|
|
2175
2154
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
2176
2155
|
paddingInlineEnd: "$2",
|
|
2177
2156
|
alignSelf: "center",
|
|
@@ -2190,6 +2169,19 @@ function NativeComboboxCore(param) {
|
|
|
2190
2169
|
// the user types, so a content-fit sheet would open as a sliver.
|
|
2191
2170
|
sheetFill: Boolean(onSearch),
|
|
2192
2171
|
trigger: triggerContent,
|
|
2172
|
+
triggerEnd: clearable && !multiple && !disabled && typeof value === "string" && value !== "" ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Button.Button, {
|
|
2173
|
+
size: knobProps.sizeToken,
|
|
2174
|
+
chromeless: true,
|
|
2175
|
+
minWidth: 44,
|
|
2176
|
+
minHeight: 44,
|
|
2177
|
+
"aria-label": t("Clear"),
|
|
2178
|
+
icon: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.XIcon, {
|
|
2179
|
+
size: 14
|
|
2180
|
+
}),
|
|
2181
|
+
onPress: function onPress() {
|
|
2182
|
+
return onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange("");
|
|
2183
|
+
}
|
|
2184
|
+
}) : void 0,
|
|
2193
2185
|
triggerA11y: {
|
|
2194
2186
|
label: ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : fieldA11y === null || fieldA11y === void 0 ? void 0 : fieldA11y.label,
|
|
2195
2187
|
value: triggerValueText,
|