@devalok/shilp-sutra 0.54.0 → 0.55.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/MIGRATION.md +28 -0
- package/dist/_chunks/badge-group.js +1 -1
- package/dist/_chunks/popover.js +38 -37
- package/dist/_chunks/popover.js.map +1 -1
- package/dist/_chunks/primitives/react-accordion.js +270 -0
- package/dist/_chunks/primitives/react-accordion.js.map +1 -0
- package/dist/_chunks/primitives/react-alert-dialog.js +857 -0
- package/dist/_chunks/primitives/react-alert-dialog.js.map +1 -0
- package/dist/_chunks/primitives/react-aspect-ratio.js +32 -0
- package/dist/_chunks/primitives/react-aspect-ratio.js.map +1 -0
- package/dist/_chunks/primitives/react-avatar.js +69 -0
- package/dist/_chunks/primitives/react-avatar.js.map +1 -0
- package/dist/_chunks/primitives/react-checkbox.js +151 -0
- package/dist/_chunks/primitives/react-checkbox.js.map +1 -0
- package/dist/_chunks/primitives/react-context-menu.js +905 -0
- package/dist/_chunks/primitives/react-context-menu.js.map +1 -0
- package/dist/_chunks/primitives/react-dropdown-menu.js +220 -0
- package/dist/_chunks/primitives/react-dropdown-menu.js.map +1 -0
- package/dist/_chunks/primitives/react-hover-card.js +153 -0
- package/dist/_chunks/primitives/react-hover-card.js.map +1 -0
- package/dist/_chunks/primitives/react-label.js +16 -0
- package/dist/_chunks/primitives/react-label.js.map +1 -0
- package/dist/_chunks/primitives/react-menubar.js +304 -0
- package/dist/_chunks/primitives/react-menubar.js.map +1 -0
- package/dist/_chunks/primitives/react-navigation-menu.js +560 -0
- package/dist/_chunks/primitives/react-navigation-menu.js.map +1 -0
- package/dist/_chunks/primitives/react-popover.js +186 -0
- package/dist/_chunks/primitives/react-popover.js.map +1 -0
- package/dist/_chunks/primitives/react-progress.js +70 -0
- package/dist/_chunks/primitives/react-progress.js.map +1 -0
- package/dist/_chunks/primitives/react-radio-group.js +170 -0
- package/dist/_chunks/primitives/react-radio-group.js.map +1 -0
- package/dist/_chunks/primitives/react-select.js +671 -0
- package/dist/_chunks/primitives/react-select.js.map +1 -0
- package/dist/_chunks/primitives/react-separator.js +24 -0
- package/dist/_chunks/primitives/react-separator.js.map +1 -0
- package/dist/_chunks/primitives/react-slider.js +349 -0
- package/dist/_chunks/primitives/react-slider.js.map +1 -0
- package/dist/_chunks/primitives/react-switch.js +92 -0
- package/dist/_chunks/primitives/react-switch.js.map +1 -0
- package/dist/_chunks/primitives/react-tabs.js +114 -0
- package/dist/_chunks/primitives/react-tabs.js.map +1 -0
- package/dist/_chunks/primitives/react-toggle-group.js +122 -0
- package/dist/_chunks/primitives/react-toggle-group.js.map +1 -0
- package/dist/_chunks/primitives/react-toggle.js +28 -0
- package/dist/_chunks/primitives/react-toggle.js.map +1 -0
- package/dist/_chunks/primitives/react-tooltip.js +341 -0
- package/dist/_chunks/primitives/react-tooltip.js.map +1 -0
- package/dist/_chunks/primitives-internal.js +2071 -0
- package/dist/_chunks/primitives-internal.js.map +1 -0
- package/dist/_chunks/shared.js +32 -32
- package/dist/_chunks/tiptap.js +1 -1
- package/dist/ai/ai-command-provider.d.ts +2 -3
- package/dist/ai/block-renderer.d.ts +1 -2
- package/dist/ai/blocks/block-shell.d.ts +0 -1
- package/dist/ai/blocks/block-table.d.ts +1 -2
- package/dist/ai/blocks/confirm.d.ts +1 -2
- package/dist/ai/blocks/divider.d.ts +1 -2
- package/dist/ai/blocks/error.d.ts +1 -2
- package/dist/ai/blocks/index.d.ts +7 -8
- package/dist/ai/blocks/info.d.ts +1 -2
- package/dist/ai/blocks/loading.d.ts +1 -2
- package/dist/ai/blocks/stat-row.d.ts +1 -2
- package/dist/ai/blocks/success.d.ts +1 -2
- package/dist/ai/blocks/text.d.ts +1 -2
- package/dist/ai/command-bar.d.ts +1 -2
- package/dist/ai/conversation.d.ts +2 -3
- package/dist/ai/devadoot-icon.d.ts +0 -1
- package/dist/ai/index.d.ts +16 -17
- package/dist/ai/types.js +1 -0
- package/dist/composed/activity-feed.d.ts +1 -2
- package/dist/composed/avatar-group.d.ts +1 -2
- package/dist/composed/bulk-action-bar.d.ts +2 -3
- package/dist/composed/command-palette.d.ts +1 -2
- package/dist/composed/confirm-dialog.d.ts +0 -1
- package/dist/composed/date-picker/calendar-grid.d.ts +0 -1
- package/dist/composed/date-picker/date-picker.d.ts +0 -1
- package/dist/composed/date-picker/date-range-picker.d.ts +1 -2
- package/dist/composed/date-picker/date-time-picker.d.ts +0 -1
- package/dist/composed/date-picker/index.d.ts +17 -18
- package/dist/composed/date-picker/month-picker.d.ts +0 -1
- package/dist/composed/date-picker/presets.d.ts +0 -1
- package/dist/composed/date-picker/time-picker.d.ts +0 -1
- package/dist/composed/date-picker/use-calendar.d.ts +0 -1
- package/dist/composed/date-picker/year-picker.d.ts +0 -1
- package/dist/composed/deadline-indicator.d.ts +0 -1
- package/dist/composed/diff.d.ts +0 -1
- package/dist/composed/emoji-picker.d.ts +0 -1
- package/dist/composed/empty-state.d.ts +1 -2
- package/dist/composed/error-boundary.d.ts +0 -1
- package/dist/composed/extensions/emoji-data.d.ts +0 -1
- package/dist/composed/extensions/emoji-node.d.ts +0 -1
- package/dist/composed/extensions/emoji-suggestion.d.ts +1 -2
- package/dist/composed/extensions/file-attachment.d.ts +0 -1
- package/dist/composed/extensions/mention-suggestion.d.ts +1 -2
- package/dist/composed/extensions/slash-command.d.ts +0 -1
- package/dist/composed/file-preview/audio-preview.d.ts +0 -1
- package/dist/composed/file-preview/document-preview.d.ts +0 -1
- package/dist/composed/file-preview/embed-preview.d.ts +0 -1
- package/dist/composed/file-preview/image-preview.d.ts +0 -1
- package/dist/composed/file-preview/shared.d.ts +0 -1
- package/dist/composed/file-preview/video-preview.d.ts +0 -1
- package/dist/composed/file-preview.d.ts +0 -1
- package/dist/composed/filter-bar.d.ts +0 -1
- package/dist/composed/form-section.d.ts +0 -1
- package/dist/composed/global-loading.d.ts +0 -1
- package/dist/composed/index.d.ts +49 -50
- package/dist/composed/inline-edit.d.ts +0 -1
- package/dist/composed/markdown-viewer.d.ts +0 -1
- package/dist/composed/master-detail.d.ts +0 -1
- package/dist/composed/member-picker.d.ts +0 -1
- package/dist/composed/multi-select-popover.d.ts +0 -1
- package/dist/composed/priority-indicator.d.ts +0 -1
- package/dist/composed/responsive-modal.d.ts +1 -2
- package/dist/composed/responsive-modal.js +47 -47
- package/dist/composed/rich-chat-input/attachment-strip.d.ts +0 -1
- package/dist/composed/rich-chat-input/audio-player.d.ts +0 -1
- package/dist/composed/rich-chat-input/audio-waveform.d.ts +0 -1
- package/dist/composed/rich-chat-input/chat-toolbar.d.ts +0 -1
- package/dist/composed/rich-chat-input/recording-overlay.d.ts +0 -1
- package/dist/composed/rich-chat-input/reply-banner.d.ts +0 -1
- package/dist/composed/rich-chat-input/schedule-send.d.ts +0 -1
- package/dist/composed/rich-chat-input/use-voice-recorder.d.ts +0 -1
- package/dist/composed/rich-chat-input.d.ts +9 -10
- package/dist/composed/rich-chat-input.js +1 -1
- package/dist/composed/rich-text-editor.d.ts +1 -2
- package/dist/composed/schedule-view.d.ts +0 -1
- package/dist/composed/simple-tooltip.d.ts +0 -1
- package/dist/composed/status-badge.d.ts +1 -2
- package/dist/hooks/index.d.ts +6 -7
- package/dist/hooks/use-color-mode.d.ts +0 -1
- package/dist/hooks/use-mobile.d.ts +0 -1
- package/dist/hooks/use-touch-device.d.ts +0 -1
- package/dist/hooks/use-viewport-height.d.ts +0 -1
- package/dist/motion/check-motion-provider.d.ts +0 -1
- package/dist/motion/index.d.ts +2 -3
- package/dist/motion/motion-provider.d.ts +1 -2
- package/dist/motion/primitives-index.d.ts +1 -2
- package/dist/motion/primitives.d.ts +1 -2
- package/dist/primitives/_internal/react-arrow.d.ts +1 -1
- package/dist/primitives/_internal/react-collection.d.ts +2 -2
- package/dist/primitives/_internal/react-dismissable-layer.d.ts +1 -1
- package/dist/primitives/_internal/react-focus-scope.d.ts +1 -1
- package/dist/primitives/_internal/react-popper.d.ts +4 -4
- package/dist/primitives/_internal/react-portal.d.ts +1 -1
- package/dist/primitives/_internal/react-use-rect.d.ts +1 -1
- package/dist/primitives/react-accordion.d.ts +3 -3
- package/dist/primitives/react-alert-dialog.d.ts +2 -2
- package/dist/primitives/react-aspect-ratio.d.ts +1 -1
- package/dist/primitives/react-avatar.d.ts +2 -2
- package/dist/primitives/react-checkbox.d.ts +3 -3
- package/dist/primitives/react-collapsible.d.ts +2 -2
- package/dist/primitives/react-context-menu.d.ts +3 -3
- package/dist/primitives/react-dialog.d.ts +5 -5
- package/dist/primitives/react-dropdown-menu.d.ts +3 -3
- package/dist/primitives/react-hover-card.d.ts +5 -5
- package/dist/primitives/react-label.d.ts +1 -1
- package/dist/primitives/react-menu.d.ts +7 -7
- package/dist/primitives/react-menubar.d.ts +5 -5
- package/dist/primitives/react-navigation-menu.d.ts +5 -5
- package/dist/primitives/react-popover.d.ts +6 -6
- package/dist/primitives/react-progress.d.ts +2 -2
- package/dist/primitives/react-radio-group.d.ts +3 -3
- package/dist/primitives/react-roving-focus.d.ts +2 -2
- package/dist/primitives/react-select.d.ts +6 -6
- package/dist/primitives/react-separator.d.ts +1 -1
- package/dist/primitives/react-slider.d.ts +2 -2
- package/dist/primitives/react-switch.d.ts +2 -2
- package/dist/primitives/react-tabs.d.ts +3 -3
- package/dist/primitives/react-toast.d.ts +3 -3
- package/dist/primitives/react-toggle-group.d.ts +4 -4
- package/dist/primitives/react-toggle.d.ts +1 -1
- package/dist/primitives/react-tooltip.d.ts +5 -5
- package/dist/primitives/react-visually-hidden.d.ts +1 -1
- package/dist/shell/app-command-palette.d.ts +2 -3
- package/dist/shell/bottom-navbar.d.ts +1 -2
- package/dist/shell/command-registry.d.ts +1 -2
- package/dist/shell/index.d.ts +7 -8
- package/dist/shell/link-context.d.ts +2 -3
- package/dist/shell/notification-center.d.ts +0 -1
- package/dist/shell/notification-preferences.d.ts +0 -1
- package/dist/shell/top-bar.d.ts +1 -2
- package/dist/test-utils/conformance.d.ts +0 -1
- package/dist/ui/accordion.d.ts +1 -2
- package/dist/ui/accordion.js +1 -1
- package/dist/ui/alert-dialog.d.ts +1 -2
- package/dist/ui/alert-dialog.js +52 -52
- package/dist/ui/alert.d.ts +0 -1
- package/dist/ui/aspect-ratio.d.ts +1 -2
- package/dist/ui/aspect-ratio.js +4 -4
- package/dist/ui/autocomplete.d.ts +1 -2
- package/dist/ui/autocomplete.js +1 -1
- package/dist/ui/avatar.d.ts +1 -2
- package/dist/ui/avatar.js +33 -33
- package/dist/ui/badge-group.d.ts +1 -2
- package/dist/ui/badge-indicator.d.ts +0 -1
- package/dist/ui/badge.d.ts +3 -4
- package/dist/ui/banner.d.ts +0 -1
- package/dist/ui/breadcrumb.js +1 -1
- package/dist/ui/button-group.d.ts +1 -2
- package/dist/ui/button-processing.d.ts +0 -1
- package/dist/ui/button.d.ts +1 -2
- package/dist/ui/button.js +1 -1
- package/dist/ui/card.d.ts +0 -1
- package/dist/ui/charts/_internal/animation.d.ts +0 -1
- package/dist/ui/charts/_internal/axes.d.ts +0 -1
- package/dist/ui/charts/_internal/colors.d.ts +1 -2
- package/dist/ui/charts/_internal/grid-lines.d.ts +0 -1
- package/dist/ui/charts/_internal/legend.d.ts +0 -1
- package/dist/ui/charts/_internal/scales.d.ts +0 -1
- package/dist/ui/charts/_internal/tooltip.d.ts +0 -1
- package/dist/ui/charts/_internal/types.d.ts +0 -1
- package/dist/ui/charts/area-chart.d.ts +1 -2
- package/dist/ui/charts/bar-chart.d.ts +1 -2
- package/dist/ui/charts/chart-container.d.ts +1 -2
- package/dist/ui/charts/gauge-chart.d.ts +0 -1
- package/dist/ui/charts/index.d.ts +9 -10
- package/dist/ui/charts/line-chart.d.ts +1 -2
- package/dist/ui/charts/pie-chart.d.ts +0 -1
- package/dist/ui/charts/radar-chart.d.ts +0 -1
- package/dist/ui/charts/sparkline.d.ts +0 -1
- package/dist/ui/chat/date-separator.d.ts +0 -1
- package/dist/ui/chat/index.d.ts +7 -8
- package/dist/ui/chat/message-input.d.ts +0 -1
- package/dist/ui/chat/message-list.d.ts +0 -1
- package/dist/ui/chat/message.d.ts +1 -2
- package/dist/ui/chat/system-message.d.ts +1 -2
- package/dist/ui/chat/typing-indicator.d.ts +0 -1
- package/dist/ui/chat/unread-separator.d.ts +0 -1
- package/dist/ui/checkbox.d.ts +2 -3
- package/dist/ui/checkbox.js +13 -13
- package/dist/ui/collapsible.d.ts +1 -2
- package/dist/ui/collapsible.js +1 -1
- package/dist/ui/color-input.d.ts +0 -1
- package/dist/ui/color-swatch.d.ts +0 -1
- package/dist/ui/combobox.d.ts +2 -3
- package/dist/ui/combobox.js +125 -125
- package/dist/ui/combobox.js.map +1 -1
- package/dist/ui/context-menu.d.ts +1 -2
- package/dist/ui/context-menu.js +58 -58
- package/dist/ui/data-table-body.d.ts +0 -1
- package/dist/ui/data-table-bulk-actions.d.ts +0 -1
- package/dist/ui/data-table-card.d.ts +0 -1
- package/dist/ui/data-table-context.d.ts +0 -1
- package/dist/ui/data-table-header.d.ts +0 -1
- package/dist/ui/data-table-pagination.d.ts +0 -1
- package/dist/ui/data-table-toolbar.d.ts +0 -1
- package/dist/ui/data-table.d.ts +3 -4
- package/dist/ui/devalok-grain.d.ts +0 -1
- package/dist/ui/dialog.d.ts +1 -2
- package/dist/ui/dialog.js +43 -43
- package/dist/ui/dot.d.ts +0 -1
- package/dist/ui/dropdown-menu.d.ts +1 -2
- package/dist/ui/dropdown-menu.js +69 -69
- package/dist/ui/file-upload.d.ts +0 -1
- package/dist/ui/form.d.ts +0 -1
- package/dist/ui/hover-card.d.ts +1 -2
- package/dist/ui/hover-card.js +16 -16
- package/dist/ui/icon-button.d.ts +2 -3
- package/dist/ui/icon-context.d.ts +0 -1
- package/dist/ui/icon-group.d.ts +1 -2
- package/dist/ui/icon.d.ts +1 -2
- package/dist/ui/index.d.ts +78 -79
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/input-otp.d.ts +0 -1
- package/dist/ui/input.d.ts +1 -2
- package/dist/ui/label.d.ts +1 -2
- package/dist/ui/label.js +7 -7
- package/dist/ui/lib/bottom-sheet.d.ts +0 -1
- package/dist/ui/lib/check-tokens.d.ts +0 -1
- package/dist/ui/lib/field-state.d.ts +0 -1
- package/dist/ui/lib/icon-input.d.ts +0 -1
- package/dist/ui/lib/index.d.ts +6 -7
- package/dist/ui/lib/keybinding.d.ts +0 -1
- package/dist/ui/lib/link-context.d.ts +0 -1
- package/dist/ui/lib/mention.d.ts +0 -1
- package/dist/ui/lib/normalize-icon.d.ts +2 -2
- package/dist/ui/lib/slot.d.ts +2 -3
- package/dist/ui/lib/use-controllable-open.d.ts +0 -1
- package/dist/ui/link.d.ts +0 -1
- package/dist/ui/link.js +1 -1
- package/dist/ui/menubar.d.ts +1 -2
- package/dist/ui/menubar.js +64 -64
- package/dist/ui/navigation-menu.d.ts +1 -2
- package/dist/ui/navigation-menu.js +67 -67
- package/dist/ui/number-input.d.ts +1 -2
- package/dist/ui/oauth-button/index.d.ts +1 -2
- package/dist/ui/oauth-button/oauth-button.d.ts +2 -3
- package/dist/ui/pagination.d.ts +0 -1
- package/dist/ui/pagination.js +1 -1
- package/dist/ui/popover.d.ts +1 -2
- package/dist/ui/progress-ring.d.ts +0 -1
- package/dist/ui/progress.d.ts +1 -2
- package/dist/ui/progress.js +30 -30
- package/dist/ui/radio.d.ts +2 -3
- package/dist/ui/radio.js +18 -18
- package/dist/ui/search-input.d.ts +0 -1
- package/dist/ui/segmented-control.d.ts +1 -2
- package/dist/ui/select.d.ts +1 -2
- package/dist/ui/select.js +55 -55
- package/dist/ui/separator.d.ts +1 -2
- package/dist/ui/separator.js +5 -5
- package/dist/ui/sheet.d.ts +1 -2
- package/dist/ui/sheet.js +45 -45
- package/dist/ui/sidebar.d.ts +4 -5
- package/dist/ui/sidebar.js +1 -1
- package/dist/ui/slider.d.ts +1 -2
- package/dist/ui/slider.js +14 -14
- package/dist/ui/spinner.d.ts +0 -1
- package/dist/ui/split-button.d.ts +14 -4
- package/dist/ui/split-button.d.ts.map +1 -1
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/stat-card.d.ts +3 -4
- package/dist/ui/stat-flash.d.ts +1 -2
- package/dist/ui/stepper.d.ts +1 -2
- package/dist/ui/surface.js +1 -1
- package/dist/ui/switch.d.ts +2 -3
- package/dist/ui/switch.js +12 -12
- package/dist/ui/table-row-link.d.ts +0 -1
- package/dist/ui/tabs.d.ts +1 -2
- package/dist/ui/tabs.js +35 -35
- package/dist/ui/textarea.d.ts +1 -2
- package/dist/ui/toast-registry.d.ts +0 -1
- package/dist/ui/toast-types.js +1 -0
- package/dist/ui/toast.d.ts +2 -3
- package/dist/ui/toaster.d.ts +0 -1
- package/dist/ui/toggle-group.d.ts +2 -3
- package/dist/ui/toggle-group.js +14 -14
- package/dist/ui/toggle.d.ts +1 -2
- package/dist/ui/toggle.js +12 -12
- package/dist/ui/tooltip.d.ts +1 -2
- package/dist/ui/tooltip.js +21 -21
- package/dist/ui/tree-view/index.d.ts +3 -4
- package/dist/ui/tree-view/tree-item.d.ts +1 -2
- package/dist/ui/tree-view/tree-view.d.ts +1 -2
- package/dist/ui/tree-view/use-tree.d.ts +1 -2
- package/dist/ui/truncated-text.d.ts +0 -1
- package/docs/recipes/install-astro.md +2 -0
- package/docs/recipes/install-next-app-router.md +2 -0
- package/docs/recipes/install-remix.md +2 -0
- package/docs/recipes/install-tanstack-start.md +2 -0
- package/docs/recipes/install-vite.md +2 -0
- package/docs/recipes/troubleshoot.md +80 -0
- package/llms.txt +1 -1
- package/mcp-manifest.json +9 -1
- package/package.json +30 -5
- package/skill/SKILL.md +1 -1
- package/skill/references/components.md +1 -1
- package/skill/references/setup-astro.md +2 -0
- package/skill/references/setup-next-app-router.md +2 -0
- package/skill/references/setup-remix.md +2 -0
- package/skill/references/setup-tanstack-start.md +2 -0
- package/skill/references/setup-vite.md +2 -0
- package/skill/references/troubleshoot.md +80 -0
- package/dist/_chunks/primitives.js +0 -7596
- package/dist/_chunks/primitives.js.map +0 -1
|
@@ -0,0 +1,671 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Anchor as e, Arrow as t, Content as n, DismissableLayer as r, FocusScope as i, Portal as a, Primitive as o, Root as s, clamp as c, composeEventHandlers as l, createCollection as u, createContextScope as d, createPopperScope as f, createSlot as p, useCallbackRef as m, useComposedRefs as h, useControllableState as g, useDirection as _, useFocusGuards as v, useId as y, useLayoutEffect as b, usePrevious as x } from "../primitives-internal.js";
|
|
3
|
+
import { ReactRemoveScroll as S, hideOthers as C } from "./react-alert-dialog.js";
|
|
4
|
+
import { VISUALLY_HIDDEN_STYLES as w } from "./react-navigation-menu.js";
|
|
5
|
+
import * as T from "react";
|
|
6
|
+
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
7
|
+
import * as k from "react-dom";
|
|
8
|
+
//#region src/primitives/react-select.js
|
|
9
|
+
var A = [
|
|
10
|
+
" ",
|
|
11
|
+
"Enter",
|
|
12
|
+
"ArrowUp",
|
|
13
|
+
"ArrowDown"
|
|
14
|
+
], j = [" ", "Enter"], M = "Select", [N, P, F] = u(M), [I, ee] = d(M, [F, f]), L = f(), [R, z] = I(M), [te, B] = I(M), V = (e) => {
|
|
15
|
+
let { __scopeSelect: t, children: n, open: r, defaultOpen: i, onOpenChange: a, value: o, defaultValue: c, onValueChange: l, dir: u, name: d, autoComplete: f, disabled: p, required: m, form: h } = e, v = L(t), [b, x] = T.useState(null), [S, C] = T.useState(null), [w, E] = T.useState(!1), k = _(u), [A, j] = g({
|
|
16
|
+
prop: r,
|
|
17
|
+
defaultProp: i ?? !1,
|
|
18
|
+
onChange: a,
|
|
19
|
+
caller: M
|
|
20
|
+
}), [P, F] = g({
|
|
21
|
+
prop: o,
|
|
22
|
+
defaultProp: c,
|
|
23
|
+
onChange: l,
|
|
24
|
+
caller: M
|
|
25
|
+
}), I = T.useRef(null), ee = !b || h || !!b.closest("form"), [z, B] = T.useState(/* @__PURE__ */ new Set()), V = Array.from(z).map((e) => e.props.value).join(";");
|
|
26
|
+
return /* @__PURE__ */ D(s, {
|
|
27
|
+
...v,
|
|
28
|
+
children: /* @__PURE__ */ O(R, {
|
|
29
|
+
required: m,
|
|
30
|
+
scope: t,
|
|
31
|
+
trigger: b,
|
|
32
|
+
onTriggerChange: x,
|
|
33
|
+
valueNode: S,
|
|
34
|
+
onValueNodeChange: C,
|
|
35
|
+
valueNodeHasChildren: w,
|
|
36
|
+
onValueNodeHasChildrenChange: E,
|
|
37
|
+
contentId: y(),
|
|
38
|
+
value: P,
|
|
39
|
+
onValueChange: F,
|
|
40
|
+
open: A,
|
|
41
|
+
onOpenChange: j,
|
|
42
|
+
dir: k,
|
|
43
|
+
triggerPointerDownPosRef: I,
|
|
44
|
+
disabled: p,
|
|
45
|
+
children: [/* @__PURE__ */ D(N.Provider, {
|
|
46
|
+
scope: t,
|
|
47
|
+
children: /* @__PURE__ */ D(te, {
|
|
48
|
+
scope: e.__scopeSelect,
|
|
49
|
+
onNativeOptionAdd: T.useCallback((e) => {
|
|
50
|
+
B((t) => new Set(t).add(e));
|
|
51
|
+
}, []),
|
|
52
|
+
onNativeOptionRemove: T.useCallback((e) => {
|
|
53
|
+
B((t) => {
|
|
54
|
+
let n = new Set(t);
|
|
55
|
+
return n.delete(e), n;
|
|
56
|
+
});
|
|
57
|
+
}, []),
|
|
58
|
+
children: n
|
|
59
|
+
})
|
|
60
|
+
}), ee ? /* @__PURE__ */ O(Re, {
|
|
61
|
+
"aria-hidden": !0,
|
|
62
|
+
required: m,
|
|
63
|
+
tabIndex: -1,
|
|
64
|
+
name: d,
|
|
65
|
+
autoComplete: f,
|
|
66
|
+
value: P,
|
|
67
|
+
onChange: (e) => F(e.target.value),
|
|
68
|
+
disabled: p,
|
|
69
|
+
form: h,
|
|
70
|
+
children: [P === void 0 ? /* @__PURE__ */ D("option", { value: "" }) : null, Array.from(z)]
|
|
71
|
+
}, V) : null]
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
V.displayName = M;
|
|
76
|
+
var H = "SelectTrigger", U = T.forwardRef((t, n) => {
|
|
77
|
+
let { __scopeSelect: r, disabled: i = !1, ...a } = t, s = L(r), c = z(H, r), u = c.disabled || i, d = h(n, c.onTriggerChange), f = P(r), p = T.useRef("touch"), [m, g, _] = Be((e) => {
|
|
78
|
+
let t = f().filter((e) => !e.disabled), n = Ve(t, e, t.find((e) => e.value === c.value));
|
|
79
|
+
n !== void 0 && c.onValueChange(n.value);
|
|
80
|
+
}), v = (e) => {
|
|
81
|
+
u || (c.onOpenChange(!0), _()), e && (c.triggerPointerDownPosRef.current = {
|
|
82
|
+
x: Math.round(e.pageX),
|
|
83
|
+
y: Math.round(e.pageY)
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
return /* @__PURE__ */ D(e, {
|
|
87
|
+
asChild: !0,
|
|
88
|
+
...s,
|
|
89
|
+
children: /* @__PURE__ */ D(o.button, {
|
|
90
|
+
type: "button",
|
|
91
|
+
role: "combobox",
|
|
92
|
+
"aria-controls": c.contentId,
|
|
93
|
+
"aria-expanded": c.open,
|
|
94
|
+
"aria-required": c.required,
|
|
95
|
+
"aria-autocomplete": "none",
|
|
96
|
+
dir: c.dir,
|
|
97
|
+
"data-state": c.open ? "open" : "closed",
|
|
98
|
+
disabled: u,
|
|
99
|
+
"data-disabled": u ? "" : void 0,
|
|
100
|
+
"data-placeholder": ze(c.value) ? "" : void 0,
|
|
101
|
+
...a,
|
|
102
|
+
ref: d,
|
|
103
|
+
onClick: l(a.onClick, (e) => {
|
|
104
|
+
e.currentTarget.focus(), p.current !== "mouse" && v(e);
|
|
105
|
+
}),
|
|
106
|
+
onPointerDown: l(a.onPointerDown, (e) => {
|
|
107
|
+
p.current = e.pointerType;
|
|
108
|
+
let t = e.target;
|
|
109
|
+
t.hasPointerCapture(e.pointerId) && t.releasePointerCapture(e.pointerId), e.button === 0 && e.ctrlKey === !1 && e.pointerType === "mouse" && (v(e), e.preventDefault());
|
|
110
|
+
}),
|
|
111
|
+
onKeyDown: l(a.onKeyDown, (e) => {
|
|
112
|
+
let t = m.current !== "";
|
|
113
|
+
!(e.ctrlKey || e.altKey || e.metaKey) && e.key.length === 1 && g(e.key), !(t && e.key === " ") && A.includes(e.key) && (v(), e.preventDefault());
|
|
114
|
+
})
|
|
115
|
+
})
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
U.displayName = H;
|
|
119
|
+
var W = "SelectValue", G = T.forwardRef((e, t) => {
|
|
120
|
+
let { __scopeSelect: n, className: r, style: i, children: a, placeholder: s = "", ...c } = e, l = z(W, n), { onValueNodeHasChildrenChange: u } = l, d = a !== void 0, f = h(t, l.onValueNodeChange);
|
|
121
|
+
return b(() => {
|
|
122
|
+
u(d);
|
|
123
|
+
}, [u, d]), /* @__PURE__ */ D(o.span, {
|
|
124
|
+
...c,
|
|
125
|
+
ref: f,
|
|
126
|
+
style: { pointerEvents: "none" },
|
|
127
|
+
children: ze(l.value) ? /* @__PURE__ */ D(E, { children: s }) : a
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
G.displayName = W;
|
|
131
|
+
var ne = "SelectIcon", re = T.forwardRef((e, t) => {
|
|
132
|
+
let { __scopeSelect: n, children: r, ...i } = e;
|
|
133
|
+
return /* @__PURE__ */ D(o.span, {
|
|
134
|
+
"aria-hidden": !0,
|
|
135
|
+
...i,
|
|
136
|
+
ref: t,
|
|
137
|
+
children: r || "▼"
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
re.displayName = ne;
|
|
141
|
+
var ie = "SelectPortal", ae = (e) => /* @__PURE__ */ D(a, {
|
|
142
|
+
asChild: !0,
|
|
143
|
+
...e
|
|
144
|
+
});
|
|
145
|
+
ae.displayName = ie;
|
|
146
|
+
var K = "SelectContent", q = T.forwardRef((e, t) => {
|
|
147
|
+
let n = z(K, e.__scopeSelect), [r, i] = T.useState();
|
|
148
|
+
if (b(() => {
|
|
149
|
+
i(new DocumentFragment());
|
|
150
|
+
}, []), !n.open) {
|
|
151
|
+
let t = r;
|
|
152
|
+
return t ? k.createPortal(/* @__PURE__ */ D(oe, {
|
|
153
|
+
scope: e.__scopeSelect,
|
|
154
|
+
children: /* @__PURE__ */ D(N.Slot, {
|
|
155
|
+
scope: e.__scopeSelect,
|
|
156
|
+
children: /* @__PURE__ */ D("div", { children: e.children })
|
|
157
|
+
})
|
|
158
|
+
}), t) : null;
|
|
159
|
+
}
|
|
160
|
+
return /* @__PURE__ */ D(le, {
|
|
161
|
+
...e,
|
|
162
|
+
ref: t
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
q.displayName = K;
|
|
166
|
+
var J = 10, [oe, Y] = I(K), se = "SelectContentImpl", ce = /* @__PURE__ */ p("SelectContent.RemoveScroll"), le = T.forwardRef((e, t) => {
|
|
167
|
+
let { __scopeSelect: n, position: a = "item-aligned", onCloseAutoFocus: o, onEscapeKeyDown: s, onPointerDownOutside: c, side: u, sideOffset: d, align: f, alignOffset: p, arrowPadding: m, collisionBoundary: g, collisionPadding: _, sticky: y, hideWhenDetached: b, avoidCollisions: x, ...w } = e, E = z(K, n), [O, k] = T.useState(null), [A, j] = T.useState(null), M = h(t, (e) => k(e)), [N, F] = T.useState(null), [I, ee] = T.useState(null), L = P(n), [R, te] = T.useState(!1), B = T.useRef(!1);
|
|
168
|
+
T.useEffect(() => {
|
|
169
|
+
if (O) return C(O);
|
|
170
|
+
}, [O]), v();
|
|
171
|
+
let V = T.useCallback((e) => {
|
|
172
|
+
let [t, ...n] = L().map((e) => e.ref.current), [r] = n.slice(-1), i = document.activeElement;
|
|
173
|
+
for (let n of e) if (n === i || (n?.scrollIntoView({ block: "nearest" }), n === t && A && (A.scrollTop = 0), n === r && A && (A.scrollTop = A.scrollHeight), n?.focus(), document.activeElement !== i)) return;
|
|
174
|
+
}, [L, A]), H = T.useCallback(() => V([N, O]), [
|
|
175
|
+
V,
|
|
176
|
+
N,
|
|
177
|
+
O
|
|
178
|
+
]);
|
|
179
|
+
T.useEffect(() => {
|
|
180
|
+
R && H();
|
|
181
|
+
}, [R, H]);
|
|
182
|
+
let { onOpenChange: U, triggerPointerDownPosRef: W } = E;
|
|
183
|
+
T.useEffect(() => {
|
|
184
|
+
if (O) {
|
|
185
|
+
let e = {
|
|
186
|
+
x: 0,
|
|
187
|
+
y: 0
|
|
188
|
+
}, t = (t) => {
|
|
189
|
+
e = {
|
|
190
|
+
x: Math.abs(Math.round(t.pageX) - (W.current?.x ?? 0)),
|
|
191
|
+
y: Math.abs(Math.round(t.pageY) - (W.current?.y ?? 0))
|
|
192
|
+
};
|
|
193
|
+
}, n = (n) => {
|
|
194
|
+
e.x <= 10 && e.y <= 10 ? n.preventDefault() : O.contains(n.target) || U(!1), document.removeEventListener("pointermove", t), W.current = null;
|
|
195
|
+
};
|
|
196
|
+
return W.current !== null && (document.addEventListener("pointermove", t), document.addEventListener("pointerup", n, {
|
|
197
|
+
capture: !0,
|
|
198
|
+
once: !0
|
|
199
|
+
})), () => {
|
|
200
|
+
document.removeEventListener("pointermove", t), document.removeEventListener("pointerup", n, { capture: !0 });
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
}, [
|
|
204
|
+
O,
|
|
205
|
+
U,
|
|
206
|
+
W
|
|
207
|
+
]), T.useEffect(() => {
|
|
208
|
+
let e = () => U(!1);
|
|
209
|
+
return window.addEventListener("blur", e), window.addEventListener("resize", e), () => {
|
|
210
|
+
window.removeEventListener("blur", e), window.removeEventListener("resize", e);
|
|
211
|
+
};
|
|
212
|
+
}, [U]);
|
|
213
|
+
let [G, ne] = Be((e) => {
|
|
214
|
+
let t = L().filter((e) => !e.disabled), n = Ve(t, e, t.find((e) => e.ref.current === document.activeElement));
|
|
215
|
+
n && setTimeout(() => n.ref.current.focus());
|
|
216
|
+
}), re = T.useCallback((e, t, n) => {
|
|
217
|
+
let r = !B.current && !n;
|
|
218
|
+
(E.value !== void 0 && E.value === t || r) && (F(e), r && (B.current = !0));
|
|
219
|
+
}, [E.value]), ie = T.useCallback(() => O?.focus(), [O]), ae = T.useCallback((e, t, n) => {
|
|
220
|
+
let r = !B.current && !n;
|
|
221
|
+
(E.value !== void 0 && E.value === t || r) && ee(e);
|
|
222
|
+
}, [E.value]), q = a === "popper" ? X : de, J = q === X ? {
|
|
223
|
+
side: u,
|
|
224
|
+
sideOffset: d,
|
|
225
|
+
align: f,
|
|
226
|
+
alignOffset: p,
|
|
227
|
+
arrowPadding: m,
|
|
228
|
+
collisionBoundary: g,
|
|
229
|
+
collisionPadding: _,
|
|
230
|
+
sticky: y,
|
|
231
|
+
hideWhenDetached: b,
|
|
232
|
+
avoidCollisions: x
|
|
233
|
+
} : {};
|
|
234
|
+
return /* @__PURE__ */ D(oe, {
|
|
235
|
+
scope: n,
|
|
236
|
+
content: O,
|
|
237
|
+
viewport: A,
|
|
238
|
+
onViewportChange: j,
|
|
239
|
+
itemRefCallback: re,
|
|
240
|
+
selectedItem: N,
|
|
241
|
+
onItemLeave: ie,
|
|
242
|
+
itemTextRefCallback: ae,
|
|
243
|
+
focusSelectedItem: H,
|
|
244
|
+
selectedItemText: I,
|
|
245
|
+
position: a,
|
|
246
|
+
isPositioned: R,
|
|
247
|
+
searchRef: G,
|
|
248
|
+
children: /* @__PURE__ */ D(S, {
|
|
249
|
+
as: ce,
|
|
250
|
+
allowPinchZoom: !0,
|
|
251
|
+
children: /* @__PURE__ */ D(i, {
|
|
252
|
+
asChild: !0,
|
|
253
|
+
trapped: E.open,
|
|
254
|
+
onMountAutoFocus: (e) => {
|
|
255
|
+
e.preventDefault();
|
|
256
|
+
},
|
|
257
|
+
onUnmountAutoFocus: l(o, (e) => {
|
|
258
|
+
E.trigger?.focus({ preventScroll: !0 }), e.preventDefault();
|
|
259
|
+
}),
|
|
260
|
+
children: /* @__PURE__ */ D(r, {
|
|
261
|
+
asChild: !0,
|
|
262
|
+
disableOutsidePointerEvents: !0,
|
|
263
|
+
onEscapeKeyDown: s,
|
|
264
|
+
onPointerDownOutside: c,
|
|
265
|
+
onFocusOutside: (e) => e.preventDefault(),
|
|
266
|
+
onDismiss: () => E.onOpenChange(!1),
|
|
267
|
+
children: /* @__PURE__ */ D(q, {
|
|
268
|
+
role: "listbox",
|
|
269
|
+
id: E.contentId,
|
|
270
|
+
"data-state": E.open ? "open" : "closed",
|
|
271
|
+
dir: E.dir,
|
|
272
|
+
onContextMenu: (e) => e.preventDefault(),
|
|
273
|
+
...w,
|
|
274
|
+
...J,
|
|
275
|
+
onPlaced: () => te(!0),
|
|
276
|
+
ref: M,
|
|
277
|
+
style: {
|
|
278
|
+
display: "flex",
|
|
279
|
+
flexDirection: "column",
|
|
280
|
+
outline: "none",
|
|
281
|
+
...w.style
|
|
282
|
+
},
|
|
283
|
+
onKeyDown: l(w.onKeyDown, (e) => {
|
|
284
|
+
let t = e.ctrlKey || e.altKey || e.metaKey;
|
|
285
|
+
if (e.key === "Tab" && e.preventDefault(), !t && e.key.length === 1 && ne(e.key), [
|
|
286
|
+
"ArrowUp",
|
|
287
|
+
"ArrowDown",
|
|
288
|
+
"Home",
|
|
289
|
+
"End"
|
|
290
|
+
].includes(e.key)) {
|
|
291
|
+
let t = L().filter((e) => !e.disabled).map((e) => e.ref.current);
|
|
292
|
+
if (["ArrowUp", "End"].includes(e.key) && (t = t.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(e.key)) {
|
|
293
|
+
let n = e.target, r = t.indexOf(n);
|
|
294
|
+
t = t.slice(r + 1);
|
|
295
|
+
}
|
|
296
|
+
setTimeout(() => V(t)), e.preventDefault();
|
|
297
|
+
}
|
|
298
|
+
})
|
|
299
|
+
})
|
|
300
|
+
})
|
|
301
|
+
})
|
|
302
|
+
})
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
le.displayName = se;
|
|
306
|
+
var ue = "SelectItemAlignedPosition", de = T.forwardRef((e, t) => {
|
|
307
|
+
let { __scopeSelect: n, onPlaced: r, ...i } = e, a = z(K, n), s = Y(K, n), [l, u] = T.useState(null), [d, f] = T.useState(null), p = h(t, (e) => f(e)), m = P(n), g = T.useRef(!1), _ = T.useRef(!0), { viewport: v, selectedItem: y, selectedItemText: x, focusSelectedItem: S } = s, C = T.useCallback(() => {
|
|
308
|
+
if (a.trigger && a.valueNode && l && d && v && y && x) {
|
|
309
|
+
let e = a.trigger.getBoundingClientRect(), t = d.getBoundingClientRect(), n = a.valueNode.getBoundingClientRect(), i = x.getBoundingClientRect();
|
|
310
|
+
if (a.dir !== "rtl") {
|
|
311
|
+
let r = i.left - t.left, a = n.left - r, o = e.left - a, s = e.width + o, u = Math.max(s, t.width), d = window.innerWidth - J, f = c(a, [J, Math.max(J, d - u)]);
|
|
312
|
+
l.style.minWidth = s + "px", l.style.left = f + "px";
|
|
313
|
+
} else {
|
|
314
|
+
let r = t.right - i.right, a = window.innerWidth - n.right - r, o = window.innerWidth - e.right - a, s = e.width + o, u = Math.max(s, t.width), d = window.innerWidth - J, f = c(a, [J, Math.max(J, d - u)]);
|
|
315
|
+
l.style.minWidth = s + "px", l.style.right = f + "px";
|
|
316
|
+
}
|
|
317
|
+
let o = m(), s = window.innerHeight - J * 2, u = v.scrollHeight, f = window.getComputedStyle(d), p = parseInt(f.borderTopWidth, 10), h = parseInt(f.paddingTop, 10), _ = parseInt(f.borderBottomWidth, 10), b = parseInt(f.paddingBottom, 10), S = p + h + u + b + _, C = Math.min(y.offsetHeight * 5, S), w = window.getComputedStyle(v), T = parseInt(w.paddingTop, 10), E = parseInt(w.paddingBottom, 10), D = e.top + e.height / 2 - J, O = s - D, k = y.offsetHeight / 2, A = y.offsetTop + k, j = p + h + A, M = S - j;
|
|
318
|
+
if (j <= D) {
|
|
319
|
+
let e = o.length > 0 && y === o[o.length - 1].ref.current;
|
|
320
|
+
l.style.bottom = "0px";
|
|
321
|
+
let t = d.clientHeight - v.offsetTop - v.offsetHeight, n = j + Math.max(O, k + (e ? E : 0) + t + _);
|
|
322
|
+
l.style.height = n + "px";
|
|
323
|
+
} else {
|
|
324
|
+
let e = o.length > 0 && y === o[0].ref.current;
|
|
325
|
+
l.style.top = "0px";
|
|
326
|
+
let t = Math.max(D, p + v.offsetTop + (e ? T : 0) + k) + M;
|
|
327
|
+
l.style.height = t + "px", v.scrollTop = j - D + v.offsetTop;
|
|
328
|
+
}
|
|
329
|
+
l.style.margin = `${J}px 0`, l.style.minHeight = C + "px", l.style.maxHeight = s + "px", r?.(), requestAnimationFrame(() => g.current = !0);
|
|
330
|
+
}
|
|
331
|
+
}, [
|
|
332
|
+
m,
|
|
333
|
+
a.trigger,
|
|
334
|
+
a.valueNode,
|
|
335
|
+
l,
|
|
336
|
+
d,
|
|
337
|
+
v,
|
|
338
|
+
y,
|
|
339
|
+
x,
|
|
340
|
+
a.dir,
|
|
341
|
+
r
|
|
342
|
+
]);
|
|
343
|
+
b(() => C(), [C]);
|
|
344
|
+
let [w, E] = T.useState();
|
|
345
|
+
return b(() => {
|
|
346
|
+
d && E(window.getComputedStyle(d).zIndex);
|
|
347
|
+
}, [d]), /* @__PURE__ */ D(pe, {
|
|
348
|
+
scope: n,
|
|
349
|
+
contentWrapper: l,
|
|
350
|
+
shouldExpandOnScrollRef: g,
|
|
351
|
+
onScrollButtonChange: T.useCallback((e) => {
|
|
352
|
+
e && _.current === !0 && (C(), S?.(), _.current = !1);
|
|
353
|
+
}, [C, S]),
|
|
354
|
+
children: /* @__PURE__ */ D("div", {
|
|
355
|
+
ref: u,
|
|
356
|
+
style: {
|
|
357
|
+
display: "flex",
|
|
358
|
+
flexDirection: "column",
|
|
359
|
+
position: "fixed",
|
|
360
|
+
zIndex: w
|
|
361
|
+
},
|
|
362
|
+
children: /* @__PURE__ */ D(o.div, {
|
|
363
|
+
...i,
|
|
364
|
+
ref: p,
|
|
365
|
+
style: {
|
|
366
|
+
boxSizing: "border-box",
|
|
367
|
+
maxHeight: "100%",
|
|
368
|
+
...i.style
|
|
369
|
+
}
|
|
370
|
+
})
|
|
371
|
+
})
|
|
372
|
+
});
|
|
373
|
+
});
|
|
374
|
+
de.displayName = ue;
|
|
375
|
+
var fe = "SelectPopperPosition", X = T.forwardRef((e, t) => {
|
|
376
|
+
let { __scopeSelect: r, align: i = "start", collisionPadding: a = J, ...o } = e;
|
|
377
|
+
return /* @__PURE__ */ D(n, {
|
|
378
|
+
...L(r),
|
|
379
|
+
...o,
|
|
380
|
+
ref: t,
|
|
381
|
+
align: i,
|
|
382
|
+
collisionPadding: a,
|
|
383
|
+
style: {
|
|
384
|
+
boxSizing: "border-box",
|
|
385
|
+
...o.style,
|
|
386
|
+
"--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
387
|
+
"--radix-select-content-available-width": "var(--radix-popper-available-width)",
|
|
388
|
+
"--radix-select-content-available-height": "var(--radix-popper-available-height)",
|
|
389
|
+
"--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
|
|
390
|
+
"--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
});
|
|
394
|
+
X.displayName = fe;
|
|
395
|
+
var [pe, me] = I(K, {}), he = "SelectViewport", ge = T.forwardRef((e, t) => {
|
|
396
|
+
let { __scopeSelect: n, nonce: r, ...i } = e, a = Y(he, n), s = me(he, n), c = h(t, a.onViewportChange), u = T.useRef(0);
|
|
397
|
+
return /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("style", {
|
|
398
|
+
dangerouslySetInnerHTML: { __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}" },
|
|
399
|
+
nonce: r
|
|
400
|
+
}), /* @__PURE__ */ D(N.Slot, {
|
|
401
|
+
scope: n,
|
|
402
|
+
children: /* @__PURE__ */ D(o.div, {
|
|
403
|
+
"data-radix-select-viewport": "",
|
|
404
|
+
role: "presentation",
|
|
405
|
+
...i,
|
|
406
|
+
ref: c,
|
|
407
|
+
style: {
|
|
408
|
+
position: "relative",
|
|
409
|
+
flex: 1,
|
|
410
|
+
overflow: "hidden auto",
|
|
411
|
+
...i.style
|
|
412
|
+
},
|
|
413
|
+
onScroll: l(i.onScroll, (e) => {
|
|
414
|
+
let t = e.currentTarget, { contentWrapper: n, shouldExpandOnScrollRef: r } = s;
|
|
415
|
+
if (r?.current && n) {
|
|
416
|
+
let e = Math.abs(u.current - t.scrollTop);
|
|
417
|
+
if (e > 0) {
|
|
418
|
+
let r = window.innerHeight - J * 2, i = parseFloat(n.style.minHeight), a = parseFloat(n.style.height), o = Math.max(i, a);
|
|
419
|
+
if (o < r) {
|
|
420
|
+
let i = o + e, a = Math.min(r, i), s = i - a;
|
|
421
|
+
n.style.height = a + "px", n.style.bottom === "0px" && (t.scrollTop = s > 0 ? s : 0, n.style.justifyContent = "flex-end");
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
u.current = t.scrollTop;
|
|
426
|
+
})
|
|
427
|
+
})
|
|
428
|
+
})] });
|
|
429
|
+
});
|
|
430
|
+
ge.displayName = he;
|
|
431
|
+
var _e = "SelectGroup", [ve, ye] = I(_e), be = T.forwardRef((e, t) => {
|
|
432
|
+
let { __scopeSelect: n, ...r } = e, i = y();
|
|
433
|
+
return /* @__PURE__ */ D(ve, {
|
|
434
|
+
scope: n,
|
|
435
|
+
id: i,
|
|
436
|
+
children: /* @__PURE__ */ D(o.div, {
|
|
437
|
+
role: "group",
|
|
438
|
+
"aria-labelledby": i,
|
|
439
|
+
...r,
|
|
440
|
+
ref: t
|
|
441
|
+
})
|
|
442
|
+
});
|
|
443
|
+
});
|
|
444
|
+
be.displayName = _e;
|
|
445
|
+
var xe = "SelectLabel", Se = T.forwardRef((e, t) => {
|
|
446
|
+
let { __scopeSelect: n, ...r } = e, i = ye(xe, n);
|
|
447
|
+
return /* @__PURE__ */ D(o.div, {
|
|
448
|
+
id: i.id,
|
|
449
|
+
...r,
|
|
450
|
+
ref: t
|
|
451
|
+
});
|
|
452
|
+
});
|
|
453
|
+
Se.displayName = xe;
|
|
454
|
+
var Z = "SelectItem", [Ce, we] = I(Z), Te = T.forwardRef((e, t) => {
|
|
455
|
+
let { __scopeSelect: n, value: r, disabled: i = !1, textValue: a, ...s } = e, c = z(Z, n), u = Y(Z, n), d = c.value === r, [f, p] = T.useState(a ?? ""), [m, g] = T.useState(!1), _ = h(t, (e) => u.itemRefCallback?.(e, r, i)), v = y(), b = T.useRef("touch"), x = () => {
|
|
456
|
+
i || (c.onValueChange(r), c.onOpenChange(!1));
|
|
457
|
+
};
|
|
458
|
+
if (r === "") throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");
|
|
459
|
+
return /* @__PURE__ */ D(Ce, {
|
|
460
|
+
scope: n,
|
|
461
|
+
value: r,
|
|
462
|
+
disabled: i,
|
|
463
|
+
textId: v,
|
|
464
|
+
isSelected: d,
|
|
465
|
+
onItemTextChange: T.useCallback((e) => {
|
|
466
|
+
p((t) => t || (e?.textContent ?? "").trim());
|
|
467
|
+
}, []),
|
|
468
|
+
children: /* @__PURE__ */ D(N.ItemSlot, {
|
|
469
|
+
scope: n,
|
|
470
|
+
value: r,
|
|
471
|
+
disabled: i,
|
|
472
|
+
textValue: f,
|
|
473
|
+
children: /* @__PURE__ */ D(o.div, {
|
|
474
|
+
role: "option",
|
|
475
|
+
"aria-labelledby": v,
|
|
476
|
+
"data-highlighted": m ? "" : void 0,
|
|
477
|
+
"aria-selected": d && m,
|
|
478
|
+
"data-state": d ? "checked" : "unchecked",
|
|
479
|
+
"aria-disabled": i || void 0,
|
|
480
|
+
"data-disabled": i ? "" : void 0,
|
|
481
|
+
tabIndex: i ? void 0 : -1,
|
|
482
|
+
...s,
|
|
483
|
+
ref: _,
|
|
484
|
+
onFocus: l(s.onFocus, () => g(!0)),
|
|
485
|
+
onBlur: l(s.onBlur, () => g(!1)),
|
|
486
|
+
onClick: l(s.onClick, () => {
|
|
487
|
+
b.current !== "mouse" && x();
|
|
488
|
+
}),
|
|
489
|
+
onPointerUp: l(s.onPointerUp, () => {
|
|
490
|
+
b.current === "mouse" && x();
|
|
491
|
+
}),
|
|
492
|
+
onPointerDown: l(s.onPointerDown, (e) => {
|
|
493
|
+
b.current = e.pointerType;
|
|
494
|
+
}),
|
|
495
|
+
onPointerMove: l(s.onPointerMove, (e) => {
|
|
496
|
+
b.current = e.pointerType, i ? u.onItemLeave?.() : b.current === "mouse" && e.currentTarget.focus({ preventScroll: !0 });
|
|
497
|
+
}),
|
|
498
|
+
onPointerLeave: l(s.onPointerLeave, (e) => {
|
|
499
|
+
e.currentTarget === document.activeElement && u.onItemLeave?.();
|
|
500
|
+
}),
|
|
501
|
+
onKeyDown: l(s.onKeyDown, (e) => {
|
|
502
|
+
u.searchRef?.current !== "" && e.key === " " || (j.includes(e.key) && x(), e.key === " " && e.preventDefault());
|
|
503
|
+
})
|
|
504
|
+
})
|
|
505
|
+
})
|
|
506
|
+
});
|
|
507
|
+
});
|
|
508
|
+
Te.displayName = Z;
|
|
509
|
+
var Q = "SelectItemText", Ee = T.forwardRef((e, t) => {
|
|
510
|
+
let { __scopeSelect: n, className: r, style: i, ...a } = e, s = z(Q, n), c = Y(Q, n), l = we(Q, n), u = B(Q, n), [d, f] = T.useState(null), p = h(t, (e) => f(e), l.onItemTextChange, (e) => c.itemTextRefCallback?.(e, l.value, l.disabled)), m = d?.textContent, g = T.useMemo(() => /* @__PURE__ */ D("option", {
|
|
511
|
+
value: l.value,
|
|
512
|
+
disabled: l.disabled,
|
|
513
|
+
children: m
|
|
514
|
+
}, l.value), [
|
|
515
|
+
l.disabled,
|
|
516
|
+
l.value,
|
|
517
|
+
m
|
|
518
|
+
]), { onNativeOptionAdd: _, onNativeOptionRemove: v } = u;
|
|
519
|
+
return b(() => (_(g), () => v(g)), [
|
|
520
|
+
_,
|
|
521
|
+
v,
|
|
522
|
+
g
|
|
523
|
+
]), /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(o.span, {
|
|
524
|
+
id: l.textId,
|
|
525
|
+
...a,
|
|
526
|
+
ref: p
|
|
527
|
+
}), l.isSelected && s.valueNode && !s.valueNodeHasChildren ? k.createPortal(a.children, s.valueNode) : null] });
|
|
528
|
+
});
|
|
529
|
+
Ee.displayName = Q;
|
|
530
|
+
var De = "SelectItemIndicator", Oe = T.forwardRef((e, t) => {
|
|
531
|
+
let { __scopeSelect: n, ...r } = e;
|
|
532
|
+
return we(De, n).isSelected ? /* @__PURE__ */ D(o.span, {
|
|
533
|
+
"aria-hidden": !0,
|
|
534
|
+
...r,
|
|
535
|
+
ref: t
|
|
536
|
+
}) : null;
|
|
537
|
+
});
|
|
538
|
+
Oe.displayName = De;
|
|
539
|
+
var ke = "SelectScrollUpButton", Ae = T.forwardRef((e, t) => {
|
|
540
|
+
let n = Y(ke, e.__scopeSelect), r = me(ke, e.__scopeSelect), [i, a] = T.useState(!1), o = h(t, r.onScrollButtonChange);
|
|
541
|
+
return b(() => {
|
|
542
|
+
if (n.viewport && n.isPositioned) {
|
|
543
|
+
let e = function() {
|
|
544
|
+
let e = t.scrollTop > 0;
|
|
545
|
+
a(e);
|
|
546
|
+
}, t = n.viewport;
|
|
547
|
+
return e(), t.addEventListener("scroll", e), () => t.removeEventListener("scroll", e);
|
|
548
|
+
}
|
|
549
|
+
}, [n.viewport, n.isPositioned]), i ? /* @__PURE__ */ D(Ne, {
|
|
550
|
+
...e,
|
|
551
|
+
ref: o,
|
|
552
|
+
onAutoScroll: () => {
|
|
553
|
+
let { viewport: e, selectedItem: t } = n;
|
|
554
|
+
e && t && (e.scrollTop -= t.offsetHeight);
|
|
555
|
+
}
|
|
556
|
+
}) : null;
|
|
557
|
+
});
|
|
558
|
+
Ae.displayName = ke;
|
|
559
|
+
var je = "SelectScrollDownButton", Me = T.forwardRef((e, t) => {
|
|
560
|
+
let n = Y(je, e.__scopeSelect), r = me(je, e.__scopeSelect), [i, a] = T.useState(!1), o = h(t, r.onScrollButtonChange);
|
|
561
|
+
return b(() => {
|
|
562
|
+
if (n.viewport && n.isPositioned) {
|
|
563
|
+
let e = function() {
|
|
564
|
+
let e = t.scrollHeight - t.clientHeight, n = Math.ceil(t.scrollTop) < e;
|
|
565
|
+
a(n);
|
|
566
|
+
}, t = n.viewport;
|
|
567
|
+
return e(), t.addEventListener("scroll", e), () => t.removeEventListener("scroll", e);
|
|
568
|
+
}
|
|
569
|
+
}, [n.viewport, n.isPositioned]), i ? /* @__PURE__ */ D(Ne, {
|
|
570
|
+
...e,
|
|
571
|
+
ref: o,
|
|
572
|
+
onAutoScroll: () => {
|
|
573
|
+
let { viewport: e, selectedItem: t } = n;
|
|
574
|
+
e && t && (e.scrollTop += t.offsetHeight);
|
|
575
|
+
}
|
|
576
|
+
}) : null;
|
|
577
|
+
});
|
|
578
|
+
Me.displayName = je;
|
|
579
|
+
var Ne = T.forwardRef((e, t) => {
|
|
580
|
+
let { __scopeSelect: n, onAutoScroll: r, ...i } = e, a = Y("SelectScrollButton", n), s = T.useRef(null), c = P(n), u = T.useCallback(() => {
|
|
581
|
+
s.current !== null && (window.clearInterval(s.current), s.current = null);
|
|
582
|
+
}, []);
|
|
583
|
+
return T.useEffect(() => () => u(), [u]), b(() => {
|
|
584
|
+
c().find((e) => e.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
585
|
+
}, [c]), /* @__PURE__ */ D(o.div, {
|
|
586
|
+
"aria-hidden": !0,
|
|
587
|
+
...i,
|
|
588
|
+
ref: t,
|
|
589
|
+
style: {
|
|
590
|
+
flexShrink: 0,
|
|
591
|
+
...i.style
|
|
592
|
+
},
|
|
593
|
+
onPointerDown: l(i.onPointerDown, () => {
|
|
594
|
+
s.current === null && (s.current = window.setInterval(r, 50));
|
|
595
|
+
}),
|
|
596
|
+
onPointerMove: l(i.onPointerMove, () => {
|
|
597
|
+
a.onItemLeave?.(), s.current === null && (s.current = window.setInterval(r, 50));
|
|
598
|
+
}),
|
|
599
|
+
onPointerLeave: l(i.onPointerLeave, () => {
|
|
600
|
+
u();
|
|
601
|
+
})
|
|
602
|
+
});
|
|
603
|
+
}), Pe = "SelectSeparator", Fe = T.forwardRef((e, t) => {
|
|
604
|
+
let { __scopeSelect: n, ...r } = e;
|
|
605
|
+
return /* @__PURE__ */ D(o.div, {
|
|
606
|
+
"aria-hidden": !0,
|
|
607
|
+
...r,
|
|
608
|
+
ref: t
|
|
609
|
+
});
|
|
610
|
+
});
|
|
611
|
+
Fe.displayName = Pe;
|
|
612
|
+
var $ = "SelectArrow", Ie = T.forwardRef((e, n) => {
|
|
613
|
+
let { __scopeSelect: r, ...i } = e, a = L(r), o = z($, r), s = Y($, r);
|
|
614
|
+
return o.open && s.position === "popper" ? /* @__PURE__ */ D(t, {
|
|
615
|
+
...a,
|
|
616
|
+
...i,
|
|
617
|
+
ref: n
|
|
618
|
+
}) : null;
|
|
619
|
+
});
|
|
620
|
+
Ie.displayName = $;
|
|
621
|
+
var Le = "SelectBubbleInput", Re = T.forwardRef(({ __scopeSelect: e, value: t, ...n }, r) => {
|
|
622
|
+
let i = T.useRef(null), a = h(r, i), s = x(t);
|
|
623
|
+
return T.useEffect(() => {
|
|
624
|
+
let e = i.current;
|
|
625
|
+
if (!e) return;
|
|
626
|
+
let n = window.HTMLSelectElement.prototype, r = Object.getOwnPropertyDescriptor(n, "value").set;
|
|
627
|
+
if (s !== t && r) {
|
|
628
|
+
let n = new Event("change", { bubbles: !0 });
|
|
629
|
+
r.call(e, t), e.dispatchEvent(n);
|
|
630
|
+
}
|
|
631
|
+
}, [s, t]), /* @__PURE__ */ D(o.select, {
|
|
632
|
+
...n,
|
|
633
|
+
style: {
|
|
634
|
+
...w,
|
|
635
|
+
...n.style
|
|
636
|
+
},
|
|
637
|
+
ref: a,
|
|
638
|
+
defaultValue: t
|
|
639
|
+
});
|
|
640
|
+
});
|
|
641
|
+
Re.displayName = Le;
|
|
642
|
+
function ze(e) {
|
|
643
|
+
return e === "" || e === void 0;
|
|
644
|
+
}
|
|
645
|
+
function Be(e) {
|
|
646
|
+
let t = m(e), n = T.useRef(""), r = T.useRef(0), i = T.useCallback((e) => {
|
|
647
|
+
let i = n.current + e;
|
|
648
|
+
t(i), (function e(t) {
|
|
649
|
+
n.current = t, window.clearTimeout(r.current), t !== "" && (r.current = window.setTimeout(() => e(""), 1e3));
|
|
650
|
+
})(i);
|
|
651
|
+
}, [t]), a = T.useCallback(() => {
|
|
652
|
+
n.current = "", window.clearTimeout(r.current);
|
|
653
|
+
}, []);
|
|
654
|
+
return T.useEffect(() => () => window.clearTimeout(r.current), []), [
|
|
655
|
+
n,
|
|
656
|
+
i,
|
|
657
|
+
a
|
|
658
|
+
];
|
|
659
|
+
}
|
|
660
|
+
function Ve(e, t, n) {
|
|
661
|
+
let r = t.length > 1 && Array.from(t).every((e) => e === t[0]) ? t[0] : t, i = n ? e.indexOf(n) : -1, a = He(e, Math.max(i, 0));
|
|
662
|
+
r.length === 1 && (a = a.filter((e) => e !== n));
|
|
663
|
+
let o = a.find((e) => e.textValue.toLowerCase().startsWith(r.toLowerCase()));
|
|
664
|
+
return o === n ? void 0 : o;
|
|
665
|
+
}
|
|
666
|
+
function He(e, t) {
|
|
667
|
+
return e.map((n, r) => e[(t + r) % e.length]);
|
|
668
|
+
}
|
|
669
|
+
var Ue = V, We = U, Ge = G, Ke = re, qe = ae, Je = q, Ye = ge, Xe = be, Ze = Se, Qe = Te, $e = Ee, et = Oe, tt = Ae, nt = Me, rt = Fe;
|
|
670
|
+
//#endregion
|
|
671
|
+
export { Je as Content2, Xe as Group, Ke as Icon, Qe as Item, et as ItemIndicator, $e as ItemText, Ze as Label, qe as Portal, Ue as Root2, nt as ScrollDownButton, tt as ScrollUpButton, rt as Separator, We as Trigger, Ge as Value, Ye as Viewport };
|