@multiplatform.one/components 7.61.0 → 7.62.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/Chip/index.cjs +29 -12
- package/dist/cjs/Chip/index.native.js +29 -12
- package/dist/cjs/Chip/index.native.js.map +1 -1
- package/dist/cjs/formLayouts/FormLayouts.cjs +52 -9
- package/dist/cjs/formLayouts/FormLayouts.native.js +52 -9
- package/dist/cjs/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/cjs/formLayouts/PreferencePanel.cjs +27 -11
- package/dist/cjs/formLayouts/PreferencePanel.native.js +27 -11
- package/dist/cjs/formLayouts/PreferencePanel.native.js.map +1 -1
- package/dist/cjs/formLayouts/index.cjs +2 -1
- package/dist/cjs/formLayouts/index.native.js +2 -1
- package/dist/cjs/formLayouts/index.native.js.map +1 -1
- package/dist/cjs/layouts/tags.cjs +25 -73
- package/dist/cjs/layouts/tags.native.js +26 -79
- package/dist/cjs/layouts/tags.native.js.map +1 -1
- package/dist/esm/Accordion/index.native.js.map +1 -1
- package/dist/esm/AnimateHeight/index.native.js.map +1 -1
- package/dist/esm/Avatar/getInitials.native.js.map +1 -1
- package/dist/esm/Avatar/index.native.js.map +1 -1
- package/dist/esm/Badge/index.native.js.map +1 -1
- package/dist/esm/Button.native.js.map +1 -1
- package/dist/esm/Carousel/index.native.js.map +1 -1
- package/dist/esm/Chip/index.mjs +31 -15
- package/dist/esm/Chip/index.mjs.map +1 -1
- package/dist/esm/Chip/index.native.js +31 -15
- package/dist/esm/Chip/index.native.js.map +1 -1
- package/dist/esm/Collapsible.native.js.map +1 -1
- package/dist/esm/ContextMenu/index.native.js.map +1 -1
- package/dist/esm/CopyField/index.native.js.map +1 -1
- package/dist/esm/Dialog.native.js.map +1 -1
- package/dist/esm/DotIndicator/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/index.native.js.map +1 -1
- package/dist/esm/ErrorBoundary/index.native.js.map +1 -1
- package/dist/esm/Heading.native.js.map +1 -1
- package/dist/esm/Meter/index.native.js.map +1 -1
- package/dist/esm/Meter/meter.native.js.map +1 -1
- package/dist/esm/OverflowRow/index.native.js.map +1 -1
- package/dist/esm/Pagination.native.js.map +1 -1
- package/dist/esm/Popover.native.js.map +1 -1
- package/dist/esm/ProgressSteps/index.native.js.map +1 -1
- package/dist/esm/Quote/index.native.js.map +1 -1
- package/dist/esm/ScrollView/revealFocusedField.native.js.map +1 -1
- package/dist/esm/Separator/index.native.js.map +1 -1
- package/dist/esm/Sheet.native.js.map +1 -1
- package/dist/esm/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/esm/SheetModal/detents.native.js.map +1 -1
- package/dist/esm/SheetModal/useSheetFrameFocus.native.js.map +1 -1
- package/dist/esm/Skeleton/index.native.js.map +1 -1
- package/dist/esm/SkipLink/index.native.js.map +1 -1
- package/dist/esm/SortableList/SortableHandle.native.js.map +1 -1
- package/dist/esm/SortableList/index.native.js.map +1 -1
- package/dist/esm/SortableList/useSortableRows.native.js.map +1 -1
- package/dist/esm/Tabs/index.native.js.map +1 -1
- package/dist/esm/Text.native.js.map +1 -1
- package/dist/esm/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/esm/Toast/index.native.js.map +1 -1
- package/dist/esm/Toast/store.native.js.map +1 -1
- package/dist/esm/Tooltip/nativePress.native.js.map +1 -1
- package/dist/esm/Tooltip/tooltipShared.native.js.map +1 -1
- package/dist/esm/TreeSelect/index.native.js.map +1 -1
- package/dist/esm/TreeSelect/treeSelectModel.native.js.map +1 -1
- package/dist/esm/Video/PlayerChrome.native.js.map +1 -1
- package/dist/esm/Video/VideoFrame.native.js.map +1 -1
- package/dist/esm/Video/types.native.js.map +1 -1
- package/dist/esm/Wheel/index.native.js.map +1 -1
- package/dist/esm/Wizard/index.native.js.map +1 -1
- package/dist/esm/actions/ActionBar.native.js.map +1 -1
- package/dist/esm/actions/DangerSection.native.js.map +1 -1
- package/dist/esm/actions/DestructiveAction.native.js.map +1 -1
- package/dist/esm/actions/HeaderActions.native.js.map +1 -1
- package/dist/esm/actions/devWarn.native.js.map +1 -1
- package/dist/esm/actions/index.native.js.map +1 -1
- package/dist/esm/actions/severity.native.js.map +1 -1
- package/dist/esm/appShell/BottomAccessory.native.js.map +1 -1
- package/dist/esm/appShell/Dock.native.js.map +1 -1
- package/dist/esm/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/esm/appShell/SettingsSplit.native.js.map +1 -1
- package/dist/esm/appShell/Springboard.native.js.map +1 -1
- package/dist/esm/appShell/SystemBar.native.js.map +1 -1
- package/dist/esm/appShell/TabBar.native.js.map +1 -1
- package/dist/esm/appShell/appTile.native.js.map +1 -1
- package/dist/esm/appShell/bottomChrome.native.js.map +1 -1
- package/dist/esm/appShell/index.native.js.map +1 -1
- package/dist/esm/charts/Axis.native.js.map +1 -1
- package/dist/esm/charts/BarChart.native.js.map +1 -1
- package/dist/esm/charts/ChartDataView.native.js.map +1 -1
- package/dist/esm/charts/ChartSurface.native.js.map +1 -1
- package/dist/esm/charts/LineChart.native.js.map +1 -1
- package/dist/esm/charts/PieChart.native.js.map +1 -1
- package/dist/esm/charts/Sparkline.native.js.map +1 -1
- package/dist/esm/charts/accessibility.native.js.map +1 -1
- package/dist/esm/charts/chartHeight.native.js.map +1 -1
- package/dist/esm/charts/composeChart.native.js.map +1 -1
- package/dist/esm/charts/index.native.js.map +1 -1
- package/dist/esm/charts/math.native.js.map +1 -1
- package/dist/esm/charts/series.native.js.map +1 -1
- package/dist/esm/charts/svg.native.js.map +1 -1
- package/dist/esm/charts/types.native.js.map +1 -1
- package/dist/esm/charts/useChartTheme.native.js.map +1 -1
- package/dist/esm/code/Code/index.native.js.map +1 -1
- package/dist/esm/code/CodeBlock/index.native.js.map +1 -1
- package/dist/esm/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/esm/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
- package/dist/esm/code/Highlighter/index.native.js.map +1 -1
- package/dist/esm/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
- package/dist/esm/code/Pre/index.native.js.map +1 -1
- package/dist/esm/code/index.native.js.map +1 -1
- package/dist/esm/componentColors.native.js.map +1 -1
- package/dist/esm/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/esm/feedback/NotifyHost.native.js.map +1 -1
- package/dist/esm/feedback/copy.native.js.map +1 -1
- package/dist/esm/feedback/index.native.js.map +1 -1
- package/dist/esm/feedback/notify.native.js.map +1 -1
- package/dist/esm/feedback/route.native.js.map +1 -1
- package/dist/esm/feedback/store.native.js.map +1 -1
- package/dist/esm/formLayouts/FormLayouts.mjs +54 -12
- package/dist/esm/formLayouts/FormLayouts.mjs.map +1 -1
- package/dist/esm/formLayouts/FormLayouts.native.js +54 -12
- package/dist/esm/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/esm/formLayouts/PreferencePanel.mjs +27 -11
- package/dist/esm/formLayouts/PreferencePanel.mjs.map +1 -1
- package/dist/esm/formLayouts/PreferencePanel.native.js +27 -11
- package/dist/esm/formLayouts/PreferencePanel.native.js.map +1 -1
- package/dist/esm/formLayouts/index.mjs +2 -2
- package/dist/esm/formLayouts/index.mjs.map +1 -1
- package/dist/esm/formLayouts/index.native.js +2 -2
- package/dist/esm/formLayouts/index.native.js.map +1 -1
- package/dist/esm/hooks/index.native.js.map +1 -1
- package/dist/esm/hooks/useClipboard.native.js.map +1 -1
- package/dist/esm/hooks/useDocumentTitle.native.js.map +1 -1
- package/dist/esm/icons/CheckRegular.native.js.map +1 -1
- package/dist/esm/icons/MinusRegular.native.js.map +1 -1
- package/dist/esm/icons/index.native.js.map +1 -1
- package/dist/esm/icons/lucide.native.js.map +1 -1
- package/dist/esm/icons/themed.native.js.map +1 -1
- package/dist/esm/images/Image/ImageFrame.native.js.map +1 -1
- package/dist/esm/images/Image/shared.native.js.map +1 -1
- package/dist/esm/images/Image/types.native.js.map +1 -1
- package/dist/esm/images/index.native.js.map +1 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/knobImmuneExports.native.js.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/esm/layouts/Debug/index.native.js.map +1 -1
- package/dist/esm/layouts/EmptyState.native.js.map +1 -1
- package/dist/esm/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/esm/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
- package/dist/esm/layouts/PageTemplates.native.js.map +1 -1
- package/dist/esm/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/esm/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
- package/dist/esm/layouts/StatusDot.native.js.map +1 -1
- package/dist/esm/layouts/ViewSwitcher.native.js.map +1 -1
- package/dist/esm/layouts/attachments.native.js.map +1 -1
- package/dist/esm/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/esm/layouts/index.native.js.map +1 -1
- package/dist/esm/layouts/page.native.js.map +1 -1
- package/dist/esm/layouts/pageHeadingScope.native.js.map +1 -1
- package/dist/esm/layouts/screenScroll.native.js.map +1 -1
- package/dist/esm/layouts/shellSidebarSlot.native.js.map +1 -1
- package/dist/esm/layouts/sidebar.native.js.map +1 -1
- package/dist/esm/layouts/tags.mjs +28 -76
- package/dist/esm/layouts/tags.mjs.map +1 -1
- package/dist/esm/layouts/tags.native.js +29 -82
- package/dist/esm/layouts/tags.native.js.map +1 -1
- package/dist/esm/layouts/timeline.native.js.map +1 -1
- package/dist/esm/layouts/toolbar.native.js.map +1 -1
- package/dist/esm/shared/actionScan.native.js.map +1 -1
- package/dist/esm/shared/i18n.native.js.map +1 -1
- package/dist/esm/shared/restoreRetries.native.js.map +1 -1
- package/dist/esm/shared/t.native.js.map +1 -1
- package/dist/esm/shared/textRidesText.native.js.map +1 -1
- package/dist/esm/shared/useReturnFocusOnClose.native.js.map +1 -1
- package/dist/esm/surfaces.native.js.map +1 -1
- package/dist/esm/tamagui.native.js.map +1 -1
- package/dist/esm/testSetup.native.js.map +1 -1
- package/dist/esm/utils/setTinted.native.js.map +1 -1
- package/dist/esm/utils/unwrapText.native.js.map +1 -1
- package/dist/esm/views/Calendar.native.js.map +1 -1
- package/dist/esm/views/Dashboard.native.js.map +1 -1
- package/dist/esm/views/Gantt.native.js.map +1 -1
- package/dist/esm/views/GanttDateGrip.native.js.map +1 -1
- package/dist/esm/views/ImageGrid.native.js.map +1 -1
- package/dist/esm/views/List.native.js.map +1 -1
- package/dist/esm/views/Matrix.native.js.map +1 -1
- package/dist/esm/views/ReportBuilder.native.js.map +1 -1
- package/dist/esm/views/TreeView.native.js.map +1 -1
- package/dist/esm/views/calendarMath.native.js.map +1 -1
- package/dist/esm/views/ganttIntervals.native.js.map +1 -1
- package/dist/esm/views/ganttMath.native.js.map +1 -1
- package/dist/esm/views/index.native.js.map +1 -1
- package/dist/esm/views/kanbanDnd.native.js.map +1 -1
- package/dist/esm/views/matrixMath.native.js.map +1 -1
- package/dist/esm/views/treeViewDnd.native.js.map +1 -1
- package/dist/esm/views/treeViewLayout.native.js.map +1 -1
- package/dist/esm/views/treeViewMotion.native.js.map +1 -1
- package/dist/esm/views/treeViewReveal.native.js.map +1 -1
- package/dist/jsx/Chip/index.mjs +31 -15
- package/dist/jsx/Chip/index.mjs.map +1 -1
- package/dist/jsx/Chip/index.native.js +29 -12
- package/dist/jsx/Chip/index.native.js.map +1 -1
- package/dist/jsx/formLayouts/FormLayouts.mjs +54 -12
- package/dist/jsx/formLayouts/FormLayouts.mjs.map +1 -1
- package/dist/jsx/formLayouts/FormLayouts.native.js +52 -9
- package/dist/jsx/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/jsx/formLayouts/PreferencePanel.mjs +27 -11
- package/dist/jsx/formLayouts/PreferencePanel.mjs.map +1 -1
- package/dist/jsx/formLayouts/PreferencePanel.native.js +27 -11
- package/dist/jsx/formLayouts/PreferencePanel.native.js.map +1 -1
- package/dist/jsx/formLayouts/index.mjs +2 -2
- package/dist/jsx/formLayouts/index.mjs.map +1 -1
- package/dist/jsx/formLayouts/index.native.js +2 -1
- package/dist/jsx/formLayouts/index.native.js.map +1 -1
- package/dist/jsx/layouts/tags.mjs +28 -76
- package/dist/jsx/layouts/tags.mjs.map +1 -1
- package/dist/jsx/layouts/tags.native.js +26 -79
- package/dist/jsx/layouts/tags.native.js.map +1 -1
- package/package.json +9 -9
- package/src/Chip/index.tsx +34 -12
- package/src/formLayouts/FormLayouts.spec.tsx +58 -3
- package/src/formLayouts/FormLayouts.stories.tsx +34 -1
- package/src/formLayouts/FormLayouts.tsx +78 -22
- package/src/formLayouts/PreferencePanel.spec.tsx +13 -2
- package/src/formLayouts/PreferencePanel.tsx +39 -21
- package/src/formLayouts/formLayouts.designLaw.spec.ts +6 -4
- package/src/formLayouts/index.ts +1 -0
- package/src/layouts/tags-token-field.spec.tsx +137 -0
- package/src/layouts/tags.glyphInk.spec.tsx +115 -0
- package/src/layouts/tags.tsx +22 -86
- package/types/Chip/index.d.ts +1 -0
- package/types/Chip/index.d.ts.map +1 -1
- package/types/formLayouts/FormLayouts.d.ts +12 -1
- package/types/formLayouts/FormLayouts.d.ts.map +1 -1
- package/types/formLayouts/PreferencePanel.d.ts.map +1 -1
- package/types/formLayouts/index.d.ts +1 -1
- package/types/formLayouts/index.d.ts.map +1 -1
- package/types/layouts/tags.d.ts.map +1 -1
- package/src/layouts/tags-trigger.spec.tsx +0 -145
|
@@ -30,6 +30,7 @@ var import_theme = require("@multiplatform.one/theme");
|
|
|
30
30
|
var import_tamagui = require("tamagui");
|
|
31
31
|
var import_Alert = require("../Alert/index.cjs");
|
|
32
32
|
var import_Card = require("../Card.cjs");
|
|
33
|
+
var import_FormLayouts = require("./FormLayouts.cjs");
|
|
33
34
|
var import_Heading = require("../Heading.cjs");
|
|
34
35
|
var import_Separator = require("../Separator/index.cjs");
|
|
35
36
|
var import_Text = require("../Text.cjs");
|
|
@@ -140,20 +141,18 @@ function PreferencePanel({
|
|
|
140
141
|
const {
|
|
141
142
|
knobProps
|
|
142
143
|
} = (0, import_theme.useResolvedKnobs)();
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
paddingVertical: inset,
|
|
147
|
-
paddingHorizontal: 0,
|
|
144
|
+
const standalone = (0, import_FormLayouts.useStandaloneForm)();
|
|
145
|
+
const inset = standalone ? knobProps.panelPadding.padding : 0;
|
|
146
|
+
const frame = {
|
|
148
147
|
width: "100%",
|
|
149
148
|
maxWidth: 560,
|
|
150
149
|
alignSelf: "center",
|
|
151
150
|
...knobProps.gap,
|
|
152
151
|
$sm: {
|
|
153
152
|
maxWidth: "100%"
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
const body = /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
157
156
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.View, {
|
|
158
157
|
flexDirection: "column",
|
|
159
158
|
gap: "$1",
|
|
@@ -169,7 +168,7 @@ function PreferencePanel({
|
|
|
169
168
|
children: subtitle
|
|
170
169
|
})
|
|
171
170
|
})]
|
|
172
|
-
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Separator.Separator, {}), sections.map((section, si) => /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.View, {
|
|
171
|
+
}), standalone && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Separator.Separator, {}), sections.map((section, si) => /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.View, {
|
|
173
172
|
flexDirection: "column",
|
|
174
173
|
...knobProps.gap,
|
|
175
174
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.View, {
|
|
@@ -202,9 +201,9 @@ function PreferencePanel({
|
|
|
202
201
|
intent: bannerIntent(section.banner.theme),
|
|
203
202
|
children: section.banner.message
|
|
204
203
|
})]
|
|
205
|
-
}), si < sections.length - 1 && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Separator.Separator, {})]
|
|
204
|
+
}), standalone && si < sections.length - 1 && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Separator.Separator, {})]
|
|
206
205
|
}, section.title)), footer && /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
207
|
-
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Separator.Separator, {}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
206
|
+
children: [standalone && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Separator.Separator, {}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
208
207
|
flexDirection: "row",
|
|
209
208
|
...knobProps.gap,
|
|
210
209
|
paddingHorizontal: inset,
|
|
@@ -212,4 +211,21 @@ function PreferencePanel({
|
|
|
212
211
|
})]
|
|
213
212
|
})]
|
|
214
213
|
});
|
|
214
|
+
if (standalone) return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Card.Card, {
|
|
215
|
+
...knobProps.surface,
|
|
216
|
+
"data-form-frame": "card",
|
|
217
|
+
paddingVertical: inset,
|
|
218
|
+
paddingHorizontal: 0,
|
|
219
|
+
...frame,
|
|
220
|
+
size,
|
|
221
|
+
...props,
|
|
222
|
+
children: body
|
|
223
|
+
});
|
|
224
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
225
|
+
"data-form-frame": "inline",
|
|
226
|
+
flexDirection: "column",
|
|
227
|
+
...frame,
|
|
228
|
+
...props,
|
|
229
|
+
children: body
|
|
230
|
+
});
|
|
215
231
|
}
|
|
@@ -33,6 +33,7 @@ var import_theme = require("@multiplatform.one/theme");
|
|
|
33
33
|
var import_tamagui = require("tamagui");
|
|
34
34
|
var import_Alert = require("../Alert/index.native.js");
|
|
35
35
|
var import_Card = require("../Card.native.js");
|
|
36
|
+
var import_FormLayouts = require("./FormLayouts.native.js");
|
|
36
37
|
var import_Heading = require("../Heading.native.js");
|
|
37
38
|
var import_Separator = require("../Separator/index.native.js");
|
|
38
39
|
var import_Text = require("../Text.native.js");
|
|
@@ -154,20 +155,18 @@ function PreferencePanel(param) {
|
|
|
154
155
|
var {
|
|
155
156
|
knobProps
|
|
156
157
|
} = (0, import_theme.useResolvedKnobs)();
|
|
157
|
-
var
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
paddingVertical: inset,
|
|
161
|
-
paddingHorizontal: 0,
|
|
158
|
+
var standalone = (0, import_FormLayouts.useStandaloneForm)();
|
|
159
|
+
var inset = standalone ? knobProps.panelPadding.padding : 0;
|
|
160
|
+
var frame = {
|
|
162
161
|
width: "100%",
|
|
163
162
|
maxWidth: 560,
|
|
164
163
|
alignSelf: "center",
|
|
165
164
|
...knobProps.gap,
|
|
166
165
|
$sm: {
|
|
167
166
|
maxWidth: "100%"
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
var body = /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
171
170
|
children: [/* Header */
|
|
172
171
|
/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.View, {
|
|
173
172
|
flexDirection: "column",
|
|
@@ -184,7 +183,7 @@ function PreferencePanel(param) {
|
|
|
184
183
|
children: subtitle
|
|
185
184
|
})
|
|
186
185
|
})]
|
|
187
|
-
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Separator.Separator, {}), /* Sections */
|
|
186
|
+
}), standalone && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Separator.Separator, {}), /* Sections */
|
|
188
187
|
sections.map(function (section, si) {
|
|
189
188
|
return /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.View, {
|
|
190
189
|
flexDirection: "column",
|
|
@@ -221,11 +220,11 @@ function PreferencePanel(param) {
|
|
|
221
220
|
intent: bannerIntent(section.banner.theme),
|
|
222
221
|
children: section.banner.message
|
|
223
222
|
})]
|
|
224
|
-
}), si < sections.length - 1 && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Separator.Separator, {})]
|
|
223
|
+
}), standalone && si < sections.length - 1 && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Separator.Separator, {})]
|
|
225
224
|
}, section.title);
|
|
226
225
|
}), /* Footer */
|
|
227
226
|
footer && /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
228
|
-
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Separator.Separator, {}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
227
|
+
children: [standalone && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Separator.Separator, {}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
229
228
|
flexDirection: "row",
|
|
230
229
|
...knobProps.gap,
|
|
231
230
|
paddingHorizontal: inset,
|
|
@@ -233,5 +232,22 @@ function PreferencePanel(param) {
|
|
|
233
232
|
})]
|
|
234
233
|
})]
|
|
235
234
|
});
|
|
235
|
+
if (standalone) return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Card.Card, {
|
|
236
|
+
...knobProps.surface,
|
|
237
|
+
"data-form-frame": "card",
|
|
238
|
+
paddingVertical: inset,
|
|
239
|
+
paddingHorizontal: 0,
|
|
240
|
+
...frame,
|
|
241
|
+
size,
|
|
242
|
+
...props,
|
|
243
|
+
children: body
|
|
244
|
+
});
|
|
245
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
246
|
+
"data-form-frame": "inline",
|
|
247
|
+
flexDirection: "column",
|
|
248
|
+
...frame,
|
|
249
|
+
...props,
|
|
250
|
+
children: body
|
|
251
|
+
});
|
|
236
252
|
}
|
|
237
253
|
//# sourceMappingURL=PreferencePanel.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","PreferencePanel_exports","__export","PreferencePanel","module","exports","import_jsx_runtime","require","import_forms","import_theme","import_tamagui","import_Alert","import_Card","import_Heading","import_Separator","import_Text","alertIntents","bannerIntent","theme","arguments","length","_alertIntents_find","find","intent","ToggleRow","param","item","jsx","ListItem","title","label","subTitle","description","backgroundColor","iconAfter","Switch","checked","onChange","onValueChange","switchProps","pressStyle","opacity","onPress","RadioRow","size","knobProps","useResolvedKnobs","jsxs","View","flexDirection","gap","children","Text","body","Theme","name","Paragraph","RadioGroup","options","CustomRow","content","PreferenceRow","type","SectionGroup","YStack","testID","overflow","elevatedSurface","containerRadius","subtitle","sections","footer","props","inset","panelPadding","padding","
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","PreferencePanel_exports","__export","PreferencePanel","module","exports","import_jsx_runtime","require","import_forms","import_theme","import_tamagui","import_Alert","import_Card","import_FormLayouts","import_Heading","import_Separator","import_Text","alertIntents","bannerIntent","theme","arguments","length","_alertIntents_find","find","intent","ToggleRow","param","item","jsx","ListItem","title","label","subTitle","description","backgroundColor","iconAfter","Switch","checked","onChange","onValueChange","switchProps","pressStyle","opacity","onPress","RadioRow","size","knobProps","useResolvedKnobs","jsxs","View","flexDirection","gap","children","Text","body","Theme","name","Paragraph","RadioGroup","options","CustomRow","content","PreferenceRow","type","SectionGroup","YStack","testID","overflow","elevatedSurface","containerRadius","subtitle","sections","footer","props","standalone","useStandaloneForm","inset","panelPadding","padding","frame","width","maxWidth","alignSelf","$sm","Fragment","paddingHorizontal","H3"],"sources":["../../../src/formLayouts/PreferencePanel.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,uBAAA;AAAAC,QAAA,CAAAD,uBAAA;EAAAE,eAAA,EAAAA,CAAA,KAAAA;AAAA;AACAC,MAAA,CAAAC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f;IACJ,eACI,IAAA9C,kBAAA,CAAA0C,IAAA,EAAAtC,cAAA,CAAAuC,IAAA;MAEHC,aAAA;MAAAC,GAAA;MACHkC,iBAAA,EAAAT,KAAA;MAEJxB,QACE,GAIJ,mBAAA9C,kBAAA,CAAAsB,GAAA,EAAAd,cAAA,CAAAwE,EAAA","ignoreList":[]}
|
|
@@ -29,7 +29,8 @@ __export(formLayouts_exports, {
|
|
|
29
29
|
PreferencePanel: () => import_PreferencePanel.PreferencePanel,
|
|
30
30
|
SettingsFormLayout: () => import_FormLayouts.SettingsFormLayout,
|
|
31
31
|
SignUpLayout: () => import_FormLayouts.SignUpLayout,
|
|
32
|
-
SocialButton: () => import_FormLayouts.SocialButton
|
|
32
|
+
SocialButton: () => import_FormLayouts.SocialButton,
|
|
33
|
+
useStandaloneForm: () => import_FormLayouts.useStandaloneForm
|
|
33
34
|
});
|
|
34
35
|
module.exports = __toCommonJS(formLayouts_exports);
|
|
35
36
|
var import_FormLayouts = require("./FormLayouts.cjs");
|
|
@@ -31,7 +31,8 @@ __export(formLayouts_exports, {
|
|
|
31
31
|
PreferencePanel: () => import_PreferencePanel.PreferencePanel,
|
|
32
32
|
SettingsFormLayout: () => import_FormLayouts.SettingsFormLayout,
|
|
33
33
|
SignUpLayout: () => import_FormLayouts.SignUpLayout,
|
|
34
|
-
SocialButton: () => import_FormLayouts.SocialButton
|
|
34
|
+
SocialButton: () => import_FormLayouts.SocialButton,
|
|
35
|
+
useStandaloneForm: () => import_FormLayouts.useStandaloneForm
|
|
35
36
|
});
|
|
36
37
|
module.exports = __toCommonJS(formLayouts_exports);
|
|
37
38
|
var import_FormLayouts = require("./FormLayouts.native.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","formLayouts_exports","__export","FormCard","import_FormLayouts","GithubButton","Hide","LoginLayout","PreferencePanel","import_PreferencePanel","SettingsFormLayout","SignUpLayout","SocialButton","module","exports","require"],"sources":["../../../src/formLayouts/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,mBAAA;AAAAC,QAAA,CAAAD,mBAAA;EAAAE,QAAA,EAAAA,CAAA,KAAAC,kBAAA,CAAAD,QAAA;EAAAE,YAAA,EAAAA,CAAA,KAAAD,kBAAA,CAAAC,YAAA;EAAAC,IAAA,EAAAA,CAAA,KAAAF,kBAAA,CAAAE,IAAA;EAAAC,WAAA,EAAAA,CAAA,KAAAH,kBAAA,CAAAG,WAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAC,sBAAA,CAAAD,eAAA;EAAAE,kBAAA,EAAAA,CAAA,KAAAN,kBAAA,CAAAM,kBAAA;EAAAC,YAAA,EAAAA,CAAA,KAAAP,kBAAA,CAAAO,YAAA;EAAAC,YAAA,EAAAA,CAAA,KAAAR,kBAAA,CAAAQ;AAAA;AAAAC,MAAA,CAAAC,OAAA,
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","formLayouts_exports","__export","FormCard","import_FormLayouts","GithubButton","Hide","LoginLayout","PreferencePanel","import_PreferencePanel","SettingsFormLayout","SignUpLayout","SocialButton","useStandaloneForm","module","exports","require"],"sources":["../../../src/formLayouts/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,mBAAA;AAAAC,QAAA,CAAAD,mBAAA;EAAAE,QAAA,EAAAA,CAAA,KAAAC,kBAAA,CAAAD,QAAA;EAAAE,YAAA,EAAAA,CAAA,KAAAD,kBAAA,CAAAC,YAAA;EAAAC,IAAA,EAAAA,CAAA,KAAAF,kBAAA,CAAAE,IAAA;EAAAC,WAAA,EAAAA,CAAA,KAAAH,kBAAA,CAAAG,WAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAC,sBAAA,CAAAD,eAAA;EAAAE,kBAAA,EAAAA,CAAA,KAAAN,kBAAA,CAAAM,kBAAA;EAAAC,YAAA,EAAAA,CAAA,KAAAP,kBAAA,CAAAO,YAAA;EAAAC,YAAA,EAAAA,CAAA,KAAAR,kBAAA,CAAAQ,YAAA;EAAAC,iBAAA,EAAAA,CAAA,KAAAT,kBAAA,CAAAS;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAnB,YASO,CAAAK,mBAAA;AASP,IAAAG,kBAAA,GAAAY,OAAgC","ignoreList":[]}
|
|
@@ -47,9 +47,6 @@ var import_componentColors = require("../componentColors.cjs");
|
|
|
47
47
|
var import_t = require("../shared/t.cjs");
|
|
48
48
|
var import_Text = require("../Text.cjs");
|
|
49
49
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
|
-
const AddTagTarget = (0, import_tamagui.styled)(import_tamagui.View, {
|
|
51
|
-
name: "AddTagTarget"
|
|
52
|
-
});
|
|
53
50
|
function Tags({
|
|
54
51
|
tags,
|
|
55
52
|
suggestions = [],
|
|
@@ -80,6 +77,8 @@ function Tags({
|
|
|
80
77
|
} = (0, import_theme.useResolvedKnobs)({
|
|
81
78
|
size
|
|
82
79
|
});
|
|
80
|
+
const accentGlyphInk = (0, import_theme.useGlyphColor)(knobProps.textAccentColor);
|
|
81
|
+
const rowGlyphInk = (0, import_theme.useGlyphColor)(import_componentColors.componentColors.text.primary);
|
|
83
82
|
const small = (0, import_theme.sizeTokenStep)(knobProps.sizeToken) < 0;
|
|
84
83
|
const inputRef = (0, import_react2.useRef)(null);
|
|
85
84
|
const listboxId = (0, import_react2.useId)();
|
|
@@ -90,8 +89,7 @@ function Tags({
|
|
|
90
89
|
const chipSize = small ? (0, import_theme.sizeKeyBelow)(knobProps.sizeToken) : knobProps.sizeToken;
|
|
91
90
|
const [inputValue, setInputValue] = (0, import_react2.useState)("");
|
|
92
91
|
const [isPopoverOpen, setIsPopoverOpen] = (0, import_react2.useState)(false);
|
|
93
|
-
const [
|
|
94
|
-
const [addPressed, setAddPressed] = (0, import_react2.useState)(false);
|
|
92
|
+
const [pendingRemoveId, setPendingRemoveId] = (0, import_react2.useState)(null);
|
|
95
93
|
const [activeIndex, setActiveIndex] = (0, import_react2.useState)(-1);
|
|
96
94
|
const [kbNav, setKbNav] = (0, import_react2.useState)(false);
|
|
97
95
|
const {
|
|
@@ -156,12 +154,14 @@ function Tags({
|
|
|
156
154
|
}, [handleAddTag, trimmedInput]);
|
|
157
155
|
const handleInputChange = (0, import_react2.useCallback)(text => {
|
|
158
156
|
setInputValue(text);
|
|
157
|
+
setPendingRemoveId(null);
|
|
159
158
|
setIsPopoverOpen(true);
|
|
160
159
|
setKbNav(false);
|
|
161
160
|
setActiveIndex(0);
|
|
162
161
|
}, []);
|
|
163
162
|
const handleKeyDown = (0, import_react2.useCallback)(e => {
|
|
164
163
|
if (e.nativeEvent?.isComposing) return;
|
|
164
|
+
if (e.key !== "Backspace") setPendingRemoveId(null);
|
|
165
165
|
const count = listOptions.length;
|
|
166
166
|
if (e.key === "ArrowDown") {
|
|
167
167
|
e.preventDefault();
|
|
@@ -199,14 +199,20 @@ function Tags({
|
|
|
199
199
|
}
|
|
200
200
|
if (e.key === "Backspace" && !inputValue && enableRemove && onRemove && tags.length > 0) {
|
|
201
201
|
e.preventDefault();
|
|
202
|
-
|
|
202
|
+
const last = tags[tags.length - 1];
|
|
203
|
+
if (pendingRemoveId === last.id) {
|
|
204
|
+
setPendingRemoveId(null);
|
|
205
|
+
onRemove(last);
|
|
206
|
+
} else {
|
|
207
|
+
setPendingRemoveId(last.id);
|
|
208
|
+
}
|
|
203
209
|
return;
|
|
204
210
|
}
|
|
205
211
|
if (e.key === "," && trimmedInput) {
|
|
206
212
|
e.preventDefault();
|
|
207
213
|
handleAddTag(trimmedInput);
|
|
208
214
|
}
|
|
209
|
-
}, [listOptions, activeIndex, handleSelectOption, handleAddTag, trimmedInput, inputValue, enableRemove, onRemove, tags]);
|
|
215
|
+
}, [listOptions, activeIndex, handleSelectOption, handleAddTag, trimmedInput, inputValue, enableRemove, onRemove, tags, pendingRemoveId]);
|
|
210
216
|
(0, import_react2.useEffect)(() => {
|
|
211
217
|
if (isPopoverOpen && inputRef.current) {
|
|
212
218
|
inputRef.current.focus();
|
|
@@ -222,7 +228,8 @@ function Tags({
|
|
|
222
228
|
gap: "$2",
|
|
223
229
|
opacity: 0.5,
|
|
224
230
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.TagIcon, {
|
|
225
|
-
size: small ? 14 : 16
|
|
231
|
+
size: small ? 14 : 16,
|
|
232
|
+
color: accentGlyphInk
|
|
226
233
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
227
234
|
color: knobProps.textAccentColor,
|
|
228
235
|
fontSize: small ? "$1" : "$2",
|
|
@@ -240,6 +247,8 @@ function Tags({
|
|
|
240
247
|
size: chipSize,
|
|
241
248
|
variant: chipVariant,
|
|
242
249
|
color: chipColor,
|
|
250
|
+
selected: tag.id === pendingRemoveId,
|
|
251
|
+
icon: false,
|
|
243
252
|
disabled,
|
|
244
253
|
onDismiss: enableRemove && !disabled && onRemove ? actions.onRemove : void 0,
|
|
245
254
|
children: tag.label
|
|
@@ -309,7 +318,8 @@ function Tags({
|
|
|
309
318
|
},
|
|
310
319
|
onPress: () => handleSelectOption(option),
|
|
311
320
|
children: [option.kind === "create" ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.PlusIcon, {
|
|
312
|
-
size: 16
|
|
321
|
+
size: 16,
|
|
322
|
+
color: rowGlyphInk
|
|
313
323
|
}) : null, /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
314
324
|
...knobProps.body,
|
|
315
325
|
color: import_componentColors.componentColors.text.primary,
|
|
@@ -388,74 +398,13 @@ function Tags({
|
|
|
388
398
|
},
|
|
389
399
|
children: [tags.length === 0 && !enableAdd ? emptyState : tags.map(tag => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.default.Fragment, {
|
|
390
400
|
children: renderTagItem(tag)
|
|
391
|
-
}, tag.id)), canAdd && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.
|
|
392
|
-
asChild: true,
|
|
393
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(AddTagTarget, {
|
|
394
|
-
role: "button",
|
|
395
|
-
"aria-label": addTagLabel,
|
|
396
|
-
tabIndex: 0,
|
|
397
|
-
cursor: "pointer",
|
|
398
|
-
alignItems: "center",
|
|
399
|
-
justifyContent: "center",
|
|
400
|
-
flexShrink: 0,
|
|
401
|
-
...(0, import_theme.pressTargetStyle)(),
|
|
402
|
-
minWidth: void 0,
|
|
403
|
-
paddingHorizontal: 3,
|
|
404
|
-
marginHorizontal: -3,
|
|
405
|
-
outlineWidth: 0,
|
|
406
|
-
focusStyle: {
|
|
407
|
-
outlineWidth: 0
|
|
408
|
-
},
|
|
409
|
-
focusVisibleStyle: {
|
|
410
|
-
outlineWidth: 0
|
|
411
|
-
},
|
|
412
|
-
onPress: e => {
|
|
413
|
-
e.stopPropagation?.();
|
|
414
|
-
openAdd();
|
|
415
|
-
},
|
|
416
|
-
onPressIn: () => setAddPressed(true),
|
|
417
|
-
onPressOut: () => setAddPressed(false),
|
|
418
|
-
onFocus: () => {
|
|
419
|
-
if ((0, import_theme.wasKeyboardFocus)()) setAddKbFocus(true);
|
|
420
|
-
},
|
|
421
|
-
onBlur: () => setAddKbFocus(false),
|
|
422
|
-
onKeyDown: e => {
|
|
423
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
424
|
-
e.preventDefault();
|
|
425
|
-
openAdd();
|
|
426
|
-
}
|
|
427
|
-
},
|
|
428
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_Chip.ChipFrame, {
|
|
429
|
-
size: chipSize,
|
|
430
|
-
...(0, import_Chip.chipFrameGeometry)(chipSize),
|
|
431
|
-
variant: "outline",
|
|
432
|
-
backgroundColor: addPressed ? import_componentColors.componentColors.interactive.active : "transparent",
|
|
433
|
-
...knobProps.borderRadius,
|
|
434
|
-
borderColor: import_componentColors.componentColors.interactive.border,
|
|
435
|
-
gap: small ? 0 : "$1",
|
|
436
|
-
hoverStyle: addPressed ? void 0 : {
|
|
437
|
-
backgroundColor: import_componentColors.componentColors.interactive.hover
|
|
438
|
-
},
|
|
439
|
-
...(addKbFocus ? (0, import_theme.ensureFocusVisibleRing)() : {
|
|
440
|
-
outlineWidth: 0
|
|
441
|
-
}),
|
|
442
|
-
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.PlusIcon, {
|
|
443
|
-
size: (0, import_Chip.chipIconSize)(chipSize)
|
|
444
|
-
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Chip.ChipText, {
|
|
445
|
-
size: chipSize,
|
|
446
|
-
fontSize: (0, import_Chip.chipTextSize)(chipSize),
|
|
447
|
-
lineHeight: (0, import_theme.sizeKeyBelow)(chipSize),
|
|
448
|
-
color: knobProps.textAccentColor,
|
|
449
|
-
children: small ? "\u200B" : addTagLabel
|
|
450
|
-
})]
|
|
451
|
-
})
|
|
452
|
-
})
|
|
453
|
-
}), canAdd && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Input, {
|
|
401
|
+
}, tag.id)), canAdd && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Input, {
|
|
454
402
|
ref: inputRef,
|
|
455
403
|
value: inputValue,
|
|
456
404
|
onChangeText: handleInputChange,
|
|
457
405
|
onKeyDown: handleKeyDown,
|
|
458
406
|
onFocus: () => setIsPopoverOpen(true),
|
|
407
|
+
onBlur: () => setPendingRemoveId(null),
|
|
459
408
|
placeholder,
|
|
460
409
|
flexGrow: 1,
|
|
461
410
|
flexShrink: 1,
|
|
@@ -480,6 +429,7 @@ function Tags({
|
|
|
480
429
|
placeholderTextColor: knobProps.textAccentColor,
|
|
481
430
|
autoComplete: "off",
|
|
482
431
|
role: "combobox",
|
|
432
|
+
"aria-label": addTagLabel,
|
|
483
433
|
"aria-autocomplete": "list",
|
|
484
434
|
"aria-expanded": isPopoverOpen,
|
|
485
435
|
"aria-controls": listboxId,
|
|
@@ -510,7 +460,9 @@ function Tags({
|
|
|
510
460
|
offset: 4,
|
|
511
461
|
stayInFrame: true,
|
|
512
462
|
allowFlip: true,
|
|
513
|
-
children: [
|
|
463
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Popover.Anchor, {
|
|
464
|
+
children: field
|
|
465
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_theme.PopoverContent, {
|
|
514
466
|
overflow: "hidden",
|
|
515
467
|
minWidth: 220,
|
|
516
468
|
...(0, import_theme.transitionProps)(knobProps.motion.overlay),
|
|
@@ -49,9 +49,6 @@ var import_Chip = require("../Chip/index.native.js");
|
|
|
49
49
|
var import_componentColors = require("../componentColors.native.js");
|
|
50
50
|
var import_t = require("../shared/t.native.js");
|
|
51
51
|
var import_Text = require("../Text.native.js");
|
|
52
|
-
var AddTagTarget = (0, import_tamagui.styled)(import_tamagui.View, {
|
|
53
|
-
name: "AddTagTarget"
|
|
54
|
-
});
|
|
55
52
|
function Tags(param) {
|
|
56
53
|
var {
|
|
57
54
|
tags,
|
|
@@ -83,6 +80,8 @@ function Tags(param) {
|
|
|
83
80
|
} = (0, import_theme.useResolvedKnobs)({
|
|
84
81
|
size
|
|
85
82
|
});
|
|
83
|
+
var accentGlyphInk = (0, import_theme.useGlyphColor)(knobProps.textAccentColor);
|
|
84
|
+
var rowGlyphInk = (0, import_theme.useGlyphColor)(import_componentColors.componentColors.text.primary);
|
|
86
85
|
var small = (0, import_theme.sizeTokenStep)(knobProps.sizeToken) < 0;
|
|
87
86
|
var inputRef = (0, import_react2.useRef)(null);
|
|
88
87
|
var listboxId = (0, import_react2.useId)();
|
|
@@ -93,8 +92,7 @@ function Tags(param) {
|
|
|
93
92
|
var chipSize = small ? (0, import_theme.sizeKeyBelow)(knobProps.sizeToken) : knobProps.sizeToken;
|
|
94
93
|
var [inputValue, setInputValue] = (0, import_react2.useState)("");
|
|
95
94
|
var [isPopoverOpen, setIsPopoverOpen] = (0, import_react2.useState)(false);
|
|
96
|
-
var [
|
|
97
|
-
var [addPressed, setAddPressed] = (0, import_react2.useState)(false);
|
|
95
|
+
var [pendingRemoveId, setPendingRemoveId] = (0, import_react2.useState)(null);
|
|
98
96
|
var [activeIndex, setActiveIndex] = (0, import_react2.useState)(-1);
|
|
99
97
|
var [kbNav, setKbNav] = (0, import_react2.useState)(false);
|
|
100
98
|
var {
|
|
@@ -184,6 +182,7 @@ function Tags(param) {
|
|
|
184
182
|
}, [handleAddTag, trimmedInput]);
|
|
185
183
|
var handleInputChange = (0, import_react2.useCallback)(function (text) {
|
|
186
184
|
setInputValue(text);
|
|
185
|
+
setPendingRemoveId(null);
|
|
187
186
|
setIsPopoverOpen(true);
|
|
188
187
|
setKbNav(false);
|
|
189
188
|
setActiveIndex(0);
|
|
@@ -191,6 +190,7 @@ function Tags(param) {
|
|
|
191
190
|
var handleKeyDown = (0, import_react2.useCallback)(function (e) {
|
|
192
191
|
var _e_nativeEvent;
|
|
193
192
|
if ((_e_nativeEvent = e.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.isComposing) return;
|
|
193
|
+
if (e.key !== "Backspace") setPendingRemoveId(null);
|
|
194
194
|
var count = listOptions.length;
|
|
195
195
|
if (e.key === "ArrowDown") {
|
|
196
196
|
e.preventDefault();
|
|
@@ -228,14 +228,20 @@ function Tags(param) {
|
|
|
228
228
|
}
|
|
229
229
|
if (e.key === "Backspace" && !inputValue && enableRemove && onRemove && tags.length > 0) {
|
|
230
230
|
e.preventDefault();
|
|
231
|
-
|
|
231
|
+
var last = tags[tags.length - 1];
|
|
232
|
+
if (pendingRemoveId === last.id) {
|
|
233
|
+
setPendingRemoveId(null);
|
|
234
|
+
onRemove(last);
|
|
235
|
+
} else {
|
|
236
|
+
setPendingRemoveId(last.id);
|
|
237
|
+
}
|
|
232
238
|
return;
|
|
233
239
|
}
|
|
234
240
|
if (e.key === "," && trimmedInput) {
|
|
235
241
|
e.preventDefault();
|
|
236
242
|
handleAddTag(trimmedInput);
|
|
237
243
|
}
|
|
238
|
-
}, [listOptions, activeIndex, handleSelectOption, handleAddTag, trimmedInput, inputValue, enableRemove, onRemove, tags]);
|
|
244
|
+
}, [listOptions, activeIndex, handleSelectOption, handleAddTag, trimmedInput, inputValue, enableRemove, onRemove, tags, pendingRemoveId]);
|
|
239
245
|
(0, import_react2.useEffect)(function () {
|
|
240
246
|
if (isPopoverOpen && inputRef.current) {
|
|
241
247
|
inputRef.current.focus();
|
|
@@ -251,7 +257,8 @@ function Tags(param) {
|
|
|
251
257
|
gap: "$2",
|
|
252
258
|
opacity: 0.5,
|
|
253
259
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.TagIcon, {
|
|
254
|
-
size: small ? 14 : 16
|
|
260
|
+
size: small ? 14 : 16,
|
|
261
|
+
color: accentGlyphInk
|
|
255
262
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
256
263
|
color: knobProps.textAccentColor,
|
|
257
264
|
fontSize: small ? "$1" : "$2",
|
|
@@ -271,6 +278,8 @@ function Tags(param) {
|
|
|
271
278
|
size: chipSize,
|
|
272
279
|
variant: chipVariant,
|
|
273
280
|
color: chipColor,
|
|
281
|
+
selected: tag.id === pendingRemoveId,
|
|
282
|
+
icon: false,
|
|
274
283
|
disabled,
|
|
275
284
|
onDismiss: enableRemove && !disabled && onRemove ? actions.onRemove : void 0,
|
|
276
285
|
children: tag.label
|
|
@@ -351,7 +360,8 @@ function Tags(param) {
|
|
|
351
360
|
return handleSelectOption(option);
|
|
352
361
|
},
|
|
353
362
|
children: [option.kind === "create" ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.PlusIcon, {
|
|
354
|
-
size: 16
|
|
363
|
+
size: 16,
|
|
364
|
+
color: rowGlyphInk
|
|
355
365
|
}) : null, /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Text, {
|
|
356
366
|
...knobProps.body,
|
|
357
367
|
color: import_componentColors.componentColors.text.primary,
|
|
@@ -437,75 +447,6 @@ function Tags(param) {
|
|
|
437
447
|
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react2.default.Fragment, {
|
|
438
448
|
children: renderTagItem(tag)
|
|
439
449
|
}, tag.id);
|
|
440
|
-
}), canAdd && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Popover.Trigger, {
|
|
441
|
-
asChild: true,
|
|
442
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(AddTagTarget, {
|
|
443
|
-
role: "button",
|
|
444
|
-
"aria-label": addTagLabel,
|
|
445
|
-
tabIndex: 0,
|
|
446
|
-
cursor: "pointer",
|
|
447
|
-
alignItems: "center",
|
|
448
|
-
justifyContent: "center",
|
|
449
|
-
flexShrink: 0,
|
|
450
|
-
...(0, import_theme.pressTargetStyle)(),
|
|
451
|
-
minWidth: void 0,
|
|
452
|
-
paddingHorizontal: 3,
|
|
453
|
-
marginHorizontal: -3,
|
|
454
|
-
outlineWidth: 0,
|
|
455
|
-
focusStyle: {
|
|
456
|
-
outlineWidth: 0
|
|
457
|
-
},
|
|
458
|
-
focusVisibleStyle: {
|
|
459
|
-
outlineWidth: 0
|
|
460
|
-
},
|
|
461
|
-
onPress: function onPress(e) {
|
|
462
|
-
var _e_stopPropagation;
|
|
463
|
-
(_e_stopPropagation = e.stopPropagation) === null || _e_stopPropagation === void 0 ? void 0 : _e_stopPropagation.call(e);
|
|
464
|
-
openAdd();
|
|
465
|
-
},
|
|
466
|
-
onPressIn: function onPressIn() {
|
|
467
|
-
return setAddPressed(true);
|
|
468
|
-
},
|
|
469
|
-
onPressOut: function onPressOut() {
|
|
470
|
-
return setAddPressed(false);
|
|
471
|
-
},
|
|
472
|
-
onFocus: function onFocus() {
|
|
473
|
-
if ((0, import_theme.wasKeyboardFocus)()) setAddKbFocus(true);
|
|
474
|
-
},
|
|
475
|
-
onBlur: function onBlur() {
|
|
476
|
-
return setAddKbFocus(false);
|
|
477
|
-
},
|
|
478
|
-
onKeyDown: function onKeyDown(e) {
|
|
479
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
480
|
-
e.preventDefault();
|
|
481
|
-
openAdd();
|
|
482
|
-
}
|
|
483
|
-
},
|
|
484
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_Chip.ChipFrame, {
|
|
485
|
-
size: chipSize,
|
|
486
|
-
...(0, import_Chip.chipFrameGeometry)(chipSize),
|
|
487
|
-
variant: "outline",
|
|
488
|
-
backgroundColor: addPressed ? import_componentColors.componentColors.interactive.active : "transparent",
|
|
489
|
-
...knobProps.borderRadius,
|
|
490
|
-
borderColor: import_componentColors.componentColors.interactive.border,
|
|
491
|
-
gap: small ? 0 : "$1",
|
|
492
|
-
hoverStyle: addPressed ? void 0 : {
|
|
493
|
-
backgroundColor: import_componentColors.componentColors.interactive.hover
|
|
494
|
-
},
|
|
495
|
-
...(addKbFocus ? (0, import_theme.ensureFocusVisibleRing)() : {
|
|
496
|
-
outlineWidth: 0
|
|
497
|
-
}),
|
|
498
|
-
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.PlusIcon, {
|
|
499
|
-
size: (0, import_Chip.chipIconSize)(chipSize)
|
|
500
|
-
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_Chip.ChipText, {
|
|
501
|
-
size: chipSize,
|
|
502
|
-
fontSize: (0, import_Chip.chipTextSize)(chipSize),
|
|
503
|
-
lineHeight: (0, import_theme.sizeKeyBelow)(chipSize),
|
|
504
|
-
color: knobProps.textAccentColor,
|
|
505
|
-
children: small ? "\u200B" : addTagLabel
|
|
506
|
-
})]
|
|
507
|
-
})
|
|
508
|
-
})
|
|
509
450
|
}), canAdd && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Input, {
|
|
510
451
|
ref: inputRef,
|
|
511
452
|
value: inputValue,
|
|
@@ -514,6 +455,9 @@ function Tags(param) {
|
|
|
514
455
|
onFocus: function onFocus() {
|
|
515
456
|
return setIsPopoverOpen(true);
|
|
516
457
|
},
|
|
458
|
+
onBlur: function onBlur() {
|
|
459
|
+
return setPendingRemoveId(null);
|
|
460
|
+
},
|
|
517
461
|
placeholder,
|
|
518
462
|
flexGrow: 1,
|
|
519
463
|
flexShrink: 1,
|
|
@@ -542,6 +486,7 @@ function Tags(param) {
|
|
|
542
486
|
placeholderTextColor: knobProps.textAccentColor,
|
|
543
487
|
autoComplete: "off",
|
|
544
488
|
role: "combobox",
|
|
489
|
+
"aria-label": addTagLabel,
|
|
545
490
|
"aria-autocomplete": "list",
|
|
546
491
|
"aria-expanded": isPopoverOpen,
|
|
547
492
|
"aria-controls": listboxId,
|
|
@@ -572,7 +517,9 @@ function Tags(param) {
|
|
|
572
517
|
offset: 4,
|
|
573
518
|
stayInFrame: true,
|
|
574
519
|
allowFlip: true,
|
|
575
|
-
children: [
|
|
520
|
+
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Popover.Anchor, {
|
|
521
|
+
children: field
|
|
522
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_theme.PopoverContent, {
|
|
576
523
|
overflow: "hidden",
|
|
577
524
|
minWidth: 220,
|
|
578
525
|
...(0, import_theme.transitionProps)(knobProps.motion.overlay),
|