@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-button.js","names":[],"sources":["../../src/ui/split-button.tsx"],"sourcesContent":["'use client'\n\nimport { type Placement } from '@floating-ui/dom'\nimport { type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { buttonVariants } from './button'\nimport { cn } from './lib/utils'\nimport { Popover, PopoverContent, PopoverTrigger } from './popover'\n\n// ── Types ───────────────────────────────────────────────────────\n\ntype SplitButtonVariant = 'solid' | 'soft' | 'outline'\ntype SplitButtonColor = NonNullable<VariantProps<typeof buttonVariants>['color']>\ntype SplitButtonSize = 'xs' | 'sm' | 'md' | 'icon-xs' | 'icon-sm' | 'icon-md'\n\nexport interface SplitButtonProps {\n /** Primary action content (left side). */\n children: React.ReactNode\n /** Primary click handler (left side). */\n onClick: (e: React.MouseEvent<HTMLButtonElement>) => void\n /** Content rendered inside the floating dropdown panel. */\n dropdownContent?: React.ReactNode\n /** Controlled open state. */\n open?: boolean\n /** Called when open state changes. Uncontrolled if omitted. */\n onOpenChange?: (open: boolean) => void\n /** @default 'solid' */\n variant?: SplitButtonVariant\n /** @default 'accent' */\n color?: SplitButtonColor\n /** @default 'md' */\n size?: SplitButtonSize\n /** Disable both halves. */\n disabled?: boolean\n /** aria-label for the primary button. */\n 'aria-label'?: string\n /** aria-label for the dropdown trigger. @default 'More options' */\n dropdownLabel?: string\n /** Custom icon for the dropdown trigger. Defaults to chevron-down. */\n dropdownIcon?: React.ReactNode\n /** Which side the dropdown trigger sits on. @default 'right' */\n triggerSide?: 'left' | 'right'\n /** Preferred placement for the dropdown panel. @default 'top-end' */\n placement?: Placement\n /** Width of the trigger (chevron) half. @default 'auto' */\n triggerWidth?: number | string\n className?: string\n}\n\n// ── Styling maps ────────────────────────────────────────────────\n\nconst dividerColor: Record<SplitButtonVariant, Record<string, string>> = {\n solid: {\n accent: 'bg-accent-11/20', error: 'bg-error-11/20', success: 'bg-success-11/20',\n warning: 'bg-warning-11/20', info: 'bg-info-11/20', neutral: 'bg-neutral-8/30',\n },\n soft: {\n accent: 'bg-accent-6', error: 'bg-error-6', success: 'bg-success-6',\n warning: 'bg-warning-6', info: 'bg-info-6', neutral: 'bg-surface-border',\n },\n outline: {\n accent: 'bg-accent-7', error: 'bg-error-7', success: 'bg-success-7',\n warning: 'bg-warning-7', info: 'bg-info-7', neutral: 'bg-surface-border-strong',\n },\n}\n\nconst heightClass: Record<SplitButtonSize, string> = {\n xs: 'h-ds-xs-plus', sm: 'h-ds-sm', md: 'h-ds-md',\n 'icon-xs': 'h-ds-xs-plus', 'icon-sm': 'h-ds-sm', 'icon-md': 'h-ds-md',\n}\n\nconst textClass: Record<SplitButtonSize, string> = {\n xs: 'text-body-sm', sm: 'text-body-sm', md: 'text-body-md',\n 'icon-xs': 'text-body-sm', 'icon-sm': 'text-body-sm', 'icon-md': 'text-body-md',\n}\n\nconst primaryPadding: Record<SplitButtonSize, string> = {\n xs: 'px-ds-03 gap-1', sm: 'px-ds-04 gap-1.5', md: 'px-ds-05 gap-2',\n 'icon-xs': 'px-ds-02', 'icon-sm': 'px-ds-03', 'icon-md': 'px-ds-04',\n}\n\nconst triggerPadding: Record<SplitButtonSize, string> = {\n xs: 'px-ds-02', sm: 'px-ds-02', md: 'px-ds-03',\n 'icon-xs': 'px-ds-01', 'icon-sm': 'px-ds-02', 'icon-md': 'px-ds-02',\n}\n\nconst radiusClass: Record<SplitButtonSize, string> = {\n xs: 'rounded-control', sm: 'rounded-control', md: 'rounded-control',\n 'icon-xs': 'rounded-control', 'icon-sm': 'rounded-control', 'icon-md': 'rounded-control',\n}\n\nfunction getHalfClasses(variant: SplitButtonVariant, color: string): string {\n const map: Record<SplitButtonVariant, Record<string, string>> = {\n solid: {\n accent: 'bg-accent-9 text-accent-fg hover:bg-accent-10 active:bg-accent-11',\n error: 'bg-error-9 text-error-fg hover:bg-error-10 active:bg-error-11',\n success: 'bg-success-9 text-success-fg hover:bg-success-10 active:bg-success-11',\n warning: 'bg-warning-9 text-warning-fg hover:bg-warning-10 active:bg-warning-11',\n info: 'bg-info-9 text-info-fg hover:bg-info-10 active:bg-info-11',\n neutral: 'bg-neutral-5 text-surface-fg hover:bg-neutral-7 active:bg-neutral-8',\n },\n soft: {\n accent: 'bg-accent-3 text-accent-11 hover:bg-accent-4 active:bg-accent-5',\n error: 'bg-error-3 text-error-11 hover:bg-error-4 active:bg-error-5',\n success: 'bg-success-3 text-success-11 hover:bg-success-4 active:bg-success-5',\n warning: 'bg-warning-3 text-warning-11 hover:bg-warning-4 active:bg-warning-5',\n info: 'bg-info-3 text-info-11 hover:bg-info-4 active:bg-info-5',\n neutral: 'bg-surface-raised-hover text-surface-fg-muted hover:bg-surface-raised-active active:bg-neutral-5',\n },\n outline: {\n accent: 'bg-transparent text-accent-11 hover:bg-accent-3 active:bg-accent-4',\n error: 'bg-transparent text-error-11 hover:bg-error-3 active:bg-error-4',\n success: 'bg-transparent text-success-11 hover:bg-success-3 active:bg-success-4',\n warning: 'bg-transparent text-warning-11 hover:bg-warning-3 active:bg-warning-4',\n info: 'bg-transparent text-info-11 hover:bg-info-3 active:bg-info-4',\n neutral: 'bg-transparent text-surface-fg hover:bg-surface-raised-hover active:bg-surface-raised-active',\n },\n }\n return map[variant][color] ?? map[variant].accent\n}\n\nfunction getOutlineBorderColor(color: string): string {\n const map: Record<string, string> = {\n accent: 'border-accent-7', error: 'border-error-7', success: 'border-success-7',\n warning: 'border-warning-7', info: 'border-info-7', neutral: 'border-surface-border-strong',\n }\n return map[color] ?? map.accent\n}\n\n// ── Chevron SVG ─────────────────────────────────────────────────\n\nfunction ChevronDown({ className }: { className?: string }) {\n return (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" className={className} aria-hidden=\"true\">\n <path d=\"M3 4.5L6 7.5L9 4.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n )\n}\n\n// ── Component ───────────────────────────────────────────────────\n\nconst SplitButton = React.forwardRef<HTMLDivElement, SplitButtonProps>(\n function SplitButton(\n {\n children,\n onClick,\n dropdownContent,\n open: openProp,\n onOpenChange,\n variant = 'solid',\n color = 'accent',\n size = 'md',\n disabled = false,\n 'aria-label': ariaLabel,\n dropdownLabel = 'More options',\n dropdownIcon,\n triggerSide = 'right',\n placement: placementProp = 'top-end',\n triggerWidth,\n className,\n },\n ref,\n ) {\n // Map the floating-ui `placement` (e.g. 'top-end') to Radix side + align.\n // Positioning, focus-in/return, outside-click, and Escape all come from the\n // Popover primitive now — no hand-rolled floating-ui / listeners.\n const [side, align] = React.useMemo(() => {\n const [s, a] = placementProp.split('-')\n return [\n s as 'top' | 'right' | 'bottom' | 'left',\n (a === 'start' ? 'start' : a === 'end' ? 'end' : 'center') as\n | 'start'\n | 'center'\n | 'end',\n ]\n }, [placementProp])\n\n const halfClasses = getHalfClasses(variant, color)\n const divider = dividerColor[variant][color] ?? dividerColor[variant].accent\n\n const triggerStyle = triggerWidth != null\n ? { width: typeof triggerWidth === 'number' ? `${triggerWidth}px` : triggerWidth }\n : undefined\n\n // Dropdown trigger (the chevron half). PopoverTrigger wires aria-haspopup /\n // aria-expanded / focus-return for us.\n const dropdownTrigger = (\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n disabled={disabled}\n aria-label={dropdownLabel}\n className={cn(\n 'inline-flex items-center justify-center select-none',\n 'transition-colors duration-fast-01 ease-productive-standard',\n 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-inset',\n 'disabled:pointer-events-none disabled:opacity-action-disabled',\n halfClasses,\n heightClass[size],\n triggerPadding[size],\n )}\n style={triggerStyle}\n >\n {dropdownIcon ?? <ChevronDown />}\n </button>\n </PopoverTrigger>\n )\n\n return (\n <Popover open={openProp} onOpenChange={onOpenChange}>\n {/* Button group */}\n <div\n ref={ref}\n role=\"group\"\n aria-label={ariaLabel ?? undefined}\n className={cn('relative inline-flex', className)}\n >\n <div\n className={cn(\n 'inline-flex items-stretch overflow-hidden',\n radiusClass[size],\n variant === 'solid' && 'shadow-raised',\n variant === 'outline' && `border ${getOutlineBorderColor(color)}`,\n )}\n >\n {triggerSide === 'left' && (\n <>\n {dropdownTrigger}\n <div className={cn('w-px self-stretch', divider)} />\n </>\n )}\n\n {/* Primary action */}\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n aria-label={ariaLabel}\n className={cn(\n 'inline-flex items-center justify-center font-semibold select-none whitespace-nowrap',\n 'transition-[colors,transform] duration-fast-01 ease-productive-standard',\n 'active:scale-[0.97]',\n 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-inset',\n 'disabled:pointer-events-none disabled:opacity-action-disabled',\n halfClasses,\n heightClass[size],\n textClass[size],\n primaryPadding[size],\n )}\n >\n {children}\n </button>\n\n {triggerSide === 'right' && (\n <>\n <div className={cn('w-px self-stretch', divider)} />\n {dropdownTrigger}\n </>\n )}\n </div>\n </div>\n\n {/* Dropdown panel — Popover handles focus, Escape, outside-click, return */}\n {dropdownContent && (\n <PopoverContent\n side={side}\n align={align}\n sideOffset={8}\n className=\"w-auto min-w-[10rem] p-ds-01\"\n >\n {dropdownContent}\n </PopoverContent>\n )}\n </Popover>\n )\n },\n)\n\nSplitButton.displayName = 'SplitButton'\n\nexport { SplitButton }\nexport type { SplitButtonColor, SplitButtonSize,SplitButtonVariant }\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"split-button.js","names":[],"sources":["../../src/ui/split-button.tsx"],"sourcesContent":["'use client'\n\nimport { type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { buttonVariants } from './button'\nimport { cn } from './lib/utils'\nimport { Popover, PopoverContent, PopoverTrigger } from './popover'\n\n// ── Types ───────────────────────────────────────────────────────\n\n/**\n * Placement of the dropdown panel, in floating-ui's vocabulary.\n *\n * Declared here rather than imported from `@floating-ui/dom`: that package is\n * bundled into dist at runtime but is NOT a consumer dependency, so a type\n * import leaks an unresolvable specifier into the published .d.ts —\n * `error TS2307: Cannot find module '@floating-ui/dom'` for anyone type-checking\n * declarations. The union is stable and two lines; borrowing it is not worth an\n * install. (This component no longer calls floating-ui at all — see the Radix\n * Popover mapping below.)\n */\nexport type SplitButtonPlacement =\n | 'top' | 'right' | 'bottom' | 'left'\n | 'top-start' | 'top-end'\n | 'right-start' | 'right-end'\n | 'bottom-start' | 'bottom-end'\n | 'left-start' | 'left-end'\n\ntype SplitButtonVariant = 'solid' | 'soft' | 'outline'\ntype SplitButtonColor = NonNullable<VariantProps<typeof buttonVariants>['color']>\ntype SplitButtonSize = 'xs' | 'sm' | 'md' | 'icon-xs' | 'icon-sm' | 'icon-md'\n\nexport interface SplitButtonProps {\n /** Primary action content (left side). */\n children: React.ReactNode\n /** Primary click handler (left side). */\n onClick: (e: React.MouseEvent<HTMLButtonElement>) => void\n /** Content rendered inside the floating dropdown panel. */\n dropdownContent?: React.ReactNode\n /** Controlled open state. */\n open?: boolean\n /** Called when open state changes. Uncontrolled if omitted. */\n onOpenChange?: (open: boolean) => void\n /** @default 'solid' */\n variant?: SplitButtonVariant\n /** @default 'accent' */\n color?: SplitButtonColor\n /** @default 'md' */\n size?: SplitButtonSize\n /** Disable both halves. */\n disabled?: boolean\n /** aria-label for the primary button. */\n 'aria-label'?: string\n /** aria-label for the dropdown trigger. @default 'More options' */\n dropdownLabel?: string\n /** Custom icon for the dropdown trigger. Defaults to chevron-down. */\n dropdownIcon?: React.ReactNode\n /** Which side the dropdown trigger sits on. @default 'right' */\n triggerSide?: 'left' | 'right'\n /** Preferred placement for the dropdown panel. @default 'top-end' */\n placement?: SplitButtonPlacement\n /** Width of the trigger (chevron) half. @default 'auto' */\n triggerWidth?: number | string\n className?: string\n}\n\n// ── Styling maps ────────────────────────────────────────────────\n\nconst dividerColor: Record<SplitButtonVariant, Record<string, string>> = {\n solid: {\n accent: 'bg-accent-11/20', error: 'bg-error-11/20', success: 'bg-success-11/20',\n warning: 'bg-warning-11/20', info: 'bg-info-11/20', neutral: 'bg-neutral-8/30',\n },\n soft: {\n accent: 'bg-accent-6', error: 'bg-error-6', success: 'bg-success-6',\n warning: 'bg-warning-6', info: 'bg-info-6', neutral: 'bg-surface-border',\n },\n outline: {\n accent: 'bg-accent-7', error: 'bg-error-7', success: 'bg-success-7',\n warning: 'bg-warning-7', info: 'bg-info-7', neutral: 'bg-surface-border-strong',\n },\n}\n\nconst heightClass: Record<SplitButtonSize, string> = {\n xs: 'h-ds-xs-plus', sm: 'h-ds-sm', md: 'h-ds-md',\n 'icon-xs': 'h-ds-xs-plus', 'icon-sm': 'h-ds-sm', 'icon-md': 'h-ds-md',\n}\n\nconst textClass: Record<SplitButtonSize, string> = {\n xs: 'text-body-sm', sm: 'text-body-sm', md: 'text-body-md',\n 'icon-xs': 'text-body-sm', 'icon-sm': 'text-body-sm', 'icon-md': 'text-body-md',\n}\n\nconst primaryPadding: Record<SplitButtonSize, string> = {\n xs: 'px-ds-03 gap-1', sm: 'px-ds-04 gap-1.5', md: 'px-ds-05 gap-2',\n 'icon-xs': 'px-ds-02', 'icon-sm': 'px-ds-03', 'icon-md': 'px-ds-04',\n}\n\nconst triggerPadding: Record<SplitButtonSize, string> = {\n xs: 'px-ds-02', sm: 'px-ds-02', md: 'px-ds-03',\n 'icon-xs': 'px-ds-01', 'icon-sm': 'px-ds-02', 'icon-md': 'px-ds-02',\n}\n\nconst radiusClass: Record<SplitButtonSize, string> = {\n xs: 'rounded-control', sm: 'rounded-control', md: 'rounded-control',\n 'icon-xs': 'rounded-control', 'icon-sm': 'rounded-control', 'icon-md': 'rounded-control',\n}\n\nfunction getHalfClasses(variant: SplitButtonVariant, color: string): string {\n const map: Record<SplitButtonVariant, Record<string, string>> = {\n solid: {\n accent: 'bg-accent-9 text-accent-fg hover:bg-accent-10 active:bg-accent-11',\n error: 'bg-error-9 text-error-fg hover:bg-error-10 active:bg-error-11',\n success: 'bg-success-9 text-success-fg hover:bg-success-10 active:bg-success-11',\n warning: 'bg-warning-9 text-warning-fg hover:bg-warning-10 active:bg-warning-11',\n info: 'bg-info-9 text-info-fg hover:bg-info-10 active:bg-info-11',\n neutral: 'bg-neutral-5 text-surface-fg hover:bg-neutral-7 active:bg-neutral-8',\n },\n soft: {\n accent: 'bg-accent-3 text-accent-11 hover:bg-accent-4 active:bg-accent-5',\n error: 'bg-error-3 text-error-11 hover:bg-error-4 active:bg-error-5',\n success: 'bg-success-3 text-success-11 hover:bg-success-4 active:bg-success-5',\n warning: 'bg-warning-3 text-warning-11 hover:bg-warning-4 active:bg-warning-5',\n info: 'bg-info-3 text-info-11 hover:bg-info-4 active:bg-info-5',\n neutral: 'bg-surface-raised-hover text-surface-fg-muted hover:bg-surface-raised-active active:bg-neutral-5',\n },\n outline: {\n accent: 'bg-transparent text-accent-11 hover:bg-accent-3 active:bg-accent-4',\n error: 'bg-transparent text-error-11 hover:bg-error-3 active:bg-error-4',\n success: 'bg-transparent text-success-11 hover:bg-success-3 active:bg-success-4',\n warning: 'bg-transparent text-warning-11 hover:bg-warning-3 active:bg-warning-4',\n info: 'bg-transparent text-info-11 hover:bg-info-3 active:bg-info-4',\n neutral: 'bg-transparent text-surface-fg hover:bg-surface-raised-hover active:bg-surface-raised-active',\n },\n }\n return map[variant][color] ?? map[variant].accent\n}\n\nfunction getOutlineBorderColor(color: string): string {\n const map: Record<string, string> = {\n accent: 'border-accent-7', error: 'border-error-7', success: 'border-success-7',\n warning: 'border-warning-7', info: 'border-info-7', neutral: 'border-surface-border-strong',\n }\n return map[color] ?? map.accent\n}\n\n// ── Chevron SVG ─────────────────────────────────────────────────\n\nfunction ChevronDown({ className }: { className?: string }) {\n return (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" className={className} aria-hidden=\"true\">\n <path d=\"M3 4.5L6 7.5L9 4.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n )\n}\n\n// ── Component ───────────────────────────────────────────────────\n\nconst SplitButton = React.forwardRef<HTMLDivElement, SplitButtonProps>(\n function SplitButton(\n {\n children,\n onClick,\n dropdownContent,\n open: openProp,\n onOpenChange,\n variant = 'solid',\n color = 'accent',\n size = 'md',\n disabled = false,\n 'aria-label': ariaLabel,\n dropdownLabel = 'More options',\n dropdownIcon,\n triggerSide = 'right',\n placement: placementProp = 'top-end',\n triggerWidth,\n className,\n },\n ref,\n ) {\n // Map the floating-ui `placement` (e.g. 'top-end') to Radix side + align.\n // Positioning, focus-in/return, outside-click, and Escape all come from the\n // Popover primitive now — no hand-rolled floating-ui / listeners.\n const [side, align] = React.useMemo(() => {\n const [s, a] = placementProp.split('-')\n return [\n s as 'top' | 'right' | 'bottom' | 'left',\n (a === 'start' ? 'start' : a === 'end' ? 'end' : 'center') as\n | 'start'\n | 'center'\n | 'end',\n ]\n }, [placementProp])\n\n const halfClasses = getHalfClasses(variant, color)\n const divider = dividerColor[variant][color] ?? dividerColor[variant].accent\n\n const triggerStyle = triggerWidth != null\n ? { width: typeof triggerWidth === 'number' ? `${triggerWidth}px` : triggerWidth }\n : undefined\n\n // Dropdown trigger (the chevron half). PopoverTrigger wires aria-haspopup /\n // aria-expanded / focus-return for us.\n const dropdownTrigger = (\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n disabled={disabled}\n aria-label={dropdownLabel}\n className={cn(\n 'inline-flex items-center justify-center select-none',\n 'transition-colors duration-fast-01 ease-productive-standard',\n 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-inset',\n 'disabled:pointer-events-none disabled:opacity-action-disabled',\n halfClasses,\n heightClass[size],\n triggerPadding[size],\n )}\n style={triggerStyle}\n >\n {dropdownIcon ?? <ChevronDown />}\n </button>\n </PopoverTrigger>\n )\n\n return (\n <Popover open={openProp} onOpenChange={onOpenChange}>\n {/* Button group */}\n <div\n ref={ref}\n role=\"group\"\n aria-label={ariaLabel ?? undefined}\n className={cn('relative inline-flex', className)}\n >\n <div\n className={cn(\n 'inline-flex items-stretch overflow-hidden',\n radiusClass[size],\n variant === 'solid' && 'shadow-raised',\n variant === 'outline' && `border ${getOutlineBorderColor(color)}`,\n )}\n >\n {triggerSide === 'left' && (\n <>\n {dropdownTrigger}\n <div className={cn('w-px self-stretch', divider)} />\n </>\n )}\n\n {/* Primary action */}\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n aria-label={ariaLabel}\n className={cn(\n 'inline-flex items-center justify-center font-semibold select-none whitespace-nowrap',\n 'transition-[colors,transform] duration-fast-01 ease-productive-standard',\n 'active:scale-[0.97]',\n 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-inset',\n 'disabled:pointer-events-none disabled:opacity-action-disabled',\n halfClasses,\n heightClass[size],\n textClass[size],\n primaryPadding[size],\n )}\n >\n {children}\n </button>\n\n {triggerSide === 'right' && (\n <>\n <div className={cn('w-px self-stretch', divider)} />\n {dropdownTrigger}\n </>\n )}\n </div>\n </div>\n\n {/* Dropdown panel — Popover handles focus, Escape, outside-click, return */}\n {dropdownContent && (\n <PopoverContent\n side={side}\n align={align}\n sideOffset={8}\n className=\"w-auto min-w-[10rem] p-ds-01\"\n >\n {dropdownContent}\n </PopoverContent>\n )}\n </Popover>\n )\n },\n)\n\nSplitButton.displayName = 'SplitButton'\n\nexport { SplitButton }\nexport type { SplitButtonColor, SplitButtonSize,SplitButtonVariant }\n"],"mappings":"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"}
|
package/dist/ui/stat-card.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { FlashPreset, FlashSpec, FlashSpeed } from './stat-flash';
|
|
1
|
+
import { CardSize } from './card.js';
|
|
2
|
+
import { IconInput } from './lib/icon-input.js';
|
|
3
|
+
import { FlashPreset, FlashSpec, FlashSpeed } from './stat-flash.js';
|
|
5
4
|
import * as React from 'react';
|
|
6
5
|
/**
|
|
7
6
|
* Props for StatCard — a dashboard metric tile displaying a label, a large numeric value,
|
package/dist/ui/stat-flash.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { Transition } from 'framer-motion';
|
|
3
|
-
import { IconInput } from './lib/icon-input';
|
|
2
|
+
import { IconInput } from './lib/icon-input.js';
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
export type FlashTone = 'success' | 'error' | 'warning' | 'info' | 'accent';
|
|
6
5
|
/** Named entrance states. Each maps to a tone + glyph. */
|
package/dist/ui/stepper.d.ts
CHANGED
package/dist/ui/surface.js
CHANGED
package/dist/ui/switch.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import * as SwitchPrimitives from '../primitives/react-switch';
|
|
1
|
+
import { FieldState } from './lib/field-state.js';
|
|
2
|
+
import * as SwitchPrimitives from '../primitives/react-switch.js';
|
|
4
3
|
import * as React from "react";
|
|
5
4
|
export interface SwitchProps extends React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> {
|
|
6
5
|
/** Validation/feedback state. `'error'` also sets `aria-invalid`. Inherited from `FormField` when omitted. Distinct from `color` (the ON-track tint). */
|
package/dist/ui/switch.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { springs as e } from "./lib/motion.js";
|
|
3
|
+
import { cn as t } from "./lib/utils.js";
|
|
4
|
+
import { useFormField as n } from "./form.js";
|
|
5
|
+
import { resolveFieldState as r } from "../_chunks/field-state.js";
|
|
6
|
+
import { Root as i, Thumb as a } from "../_chunks/primitives/react-switch.js";
|
|
7
7
|
import * as o from "react";
|
|
8
8
|
import { jsx as s } from "react/jsx-runtime";
|
|
9
9
|
import { motion as c, useReducedMotion as l } from "framer-motion";
|
|
@@ -33,11 +33,11 @@ var u = {
|
|
|
33
33
|
success: "data-[state=checked]:bg-success-9",
|
|
34
34
|
warning: "data-[state=checked]:bg-warning-9"
|
|
35
35
|
}, p = o.forwardRef(({ className: p, state: m, size: h = "md", color: g = "accent", thumbIcon: _, checked: v, defaultChecked: y, onCheckedChange: b, ...x }, S) => {
|
|
36
|
-
let C =
|
|
36
|
+
let C = n(), w = r(m, C.state), T = x["aria-describedby"] ?? C.helperTextId, E = x["aria-required"] ?? C.required, [D, O] = o.useState(y ?? !1), k = v === void 0 ? D : v, A = l(), j = typeof document < "u" && (document.dir === "rtl" || document.documentElement.dir === "rtl"), { track: M, thumb: N, travel: P } = u[h], F = o.useCallback((e) => {
|
|
37
37
|
v === void 0 && O(e), b?.(e);
|
|
38
38
|
}, [v, b]);
|
|
39
|
-
return /* @__PURE__ */ s(
|
|
40
|
-
className:
|
|
39
|
+
return /* @__PURE__ */ s(i, {
|
|
40
|
+
className: t("touch-target peer inline-flex shrink-0 cursor-pointer items-center rounded-pill border-2 border-surface-border-strong shadow-raised transition-colors duration-fast-01 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-action-disabled data-[state=checked]:border-transparent data-[state=unchecked]:bg-surface-border-strong data-[state=unchecked]:hover:bg-surface-raised-active", M, f[g], w && d[w], p),
|
|
41
41
|
checked: v,
|
|
42
42
|
defaultChecked: y,
|
|
43
43
|
onCheckedChange: F,
|
|
@@ -46,18 +46,18 @@ var u = {
|
|
|
46
46
|
"aria-required": E || void 0,
|
|
47
47
|
...x,
|
|
48
48
|
ref: S,
|
|
49
|
-
children: /* @__PURE__ */ s(
|
|
49
|
+
children: /* @__PURE__ */ s(a, {
|
|
50
50
|
asChild: !0,
|
|
51
51
|
children: /* @__PURE__ */ s(c.span, {
|
|
52
|
-
className:
|
|
52
|
+
className: t("pointer-events-none flex items-center justify-center rounded-pill bg-accent-fg shadow-raised-hover ring-0", N),
|
|
53
53
|
animate: { x: (k ? P : 0) * (j ? -1 : 1) },
|
|
54
54
|
whileTap: A ? void 0 : { scale: .85 },
|
|
55
|
-
transition: A ? { duration: 0 } :
|
|
55
|
+
transition: A ? { duration: 0 } : e.snappy,
|
|
56
56
|
children: _
|
|
57
57
|
})
|
|
58
58
|
})
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
|
-
p.displayName =
|
|
61
|
+
p.displayName = i.displayName;
|
|
62
62
|
//#endregion
|
|
63
63
|
export { p as Switch };
|
package/dist/ui/tabs.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { VariantProps } from 'class-variance-authority';
|
|
3
|
-
import * as TabsPrimitive from '../primitives/react-tabs';
|
|
2
|
+
import * as TabsPrimitive from '../primitives/react-tabs.js';
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
type TabsOrientation = 'horizontal' | 'vertical';
|
|
6
5
|
/**
|
package/dist/ui/tabs.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { springs as e, tweens as t } from "./lib/motion.js";
|
|
3
|
+
import { cva as n } from "../_chunks/vendor-utils.js";
|
|
4
|
+
import { cn as r } from "./lib/utils.js";
|
|
5
|
+
import { Content as i, List as a, Root2 as o, Trigger as s } from "../_chunks/primitives/react-tabs.js";
|
|
6
6
|
import * as c from "react";
|
|
7
7
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
8
|
import { LayoutGroup as d, motion as f } from "framer-motion";
|
|
9
9
|
//#region src/ui/tabs.tsx
|
|
10
|
-
var p = c.createContext(void 0), m = c.createContext("horizontal"), h = c.forwardRef(({ value: e, defaultValue: t, onValueChange:
|
|
10
|
+
var p = c.createContext(void 0), m = c.createContext("horizontal"), h = c.forwardRef(({ value: e, defaultValue: t, onValueChange: n, orientation: i, ...a }, s) => {
|
|
11
11
|
let [u, d] = c.useState(e ?? t ?? "");
|
|
12
12
|
c.useEffect(() => {
|
|
13
13
|
e !== void 0 && d(e);
|
|
14
14
|
}, [e]);
|
|
15
15
|
let f = c.useCallback((e) => {
|
|
16
|
-
d(e),
|
|
17
|
-
}, [
|
|
16
|
+
d(e), n?.(e);
|
|
17
|
+
}, [n]), h = i ?? "horizontal";
|
|
18
18
|
return /* @__PURE__ */ l(p.Provider, {
|
|
19
19
|
value: u,
|
|
20
20
|
children: /* @__PURE__ */ l(m.Provider, {
|
|
21
21
|
value: h,
|
|
22
|
-
children: /* @__PURE__ */ l(
|
|
23
|
-
ref:
|
|
22
|
+
children: /* @__PURE__ */ l(o, {
|
|
23
|
+
ref: s,
|
|
24
24
|
value: e,
|
|
25
25
|
defaultValue: e === void 0 ? t : void 0,
|
|
26
26
|
onValueChange: f,
|
|
27
27
|
orientation: i,
|
|
28
28
|
...a,
|
|
29
|
-
className:
|
|
29
|
+
className: r(h === "vertical" && "flex flex-row gap-ds-05", a.className)
|
|
30
30
|
})
|
|
31
31
|
})
|
|
32
32
|
});
|
|
@@ -37,7 +37,7 @@ var g = c.createContext({
|
|
|
37
37
|
size: "md",
|
|
38
38
|
color: "accent",
|
|
39
39
|
layoutId: "tab-indicator"
|
|
40
|
-
}), _ =
|
|
40
|
+
}), _ = n("inline-flex items-center", {
|
|
41
41
|
variants: {
|
|
42
42
|
variant: {
|
|
43
43
|
line: "border-b border-surface-border-strong w-full gap-0",
|
|
@@ -67,7 +67,7 @@ var g = c.createContext({
|
|
|
67
67
|
size: "md",
|
|
68
68
|
orientation: "horizontal"
|
|
69
69
|
}
|
|
70
|
-
}), v =
|
|
70
|
+
}), v = n("relative inline-flex items-center justify-center gap-ds-02 whitespace-nowrap font-sans font-medium transition-colors duration-100 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-1 disabled:pointer-events-none disabled:opacity-action-disabled", {
|
|
71
71
|
variants: {
|
|
72
72
|
variant: {
|
|
73
73
|
line: ["-mb-px", "text-surface-fg-muted hover:text-surface-fg"],
|
|
@@ -87,8 +87,8 @@ var g = c.createContext({
|
|
|
87
87
|
variant: "line",
|
|
88
88
|
size: "md"
|
|
89
89
|
}
|
|
90
|
-
}), y = c.forwardRef(({ className: e, variant:
|
|
91
|
-
let u = c.useContext(m), f =
|
|
90
|
+
}), y = c.forwardRef(({ className: e, variant: t, size: n, color: i, ...o }, s) => {
|
|
91
|
+
let u = c.useContext(m), f = t ?? "line", p = n ?? "md", h = i ?? "accent", v = c.useId(), y = c.useMemo(() => ({
|
|
92
92
|
variant: f,
|
|
93
93
|
size: p,
|
|
94
94
|
color: h,
|
|
@@ -101,66 +101,66 @@ var g = c.createContext({
|
|
|
101
101
|
]);
|
|
102
102
|
return /* @__PURE__ */ l(g.Provider, {
|
|
103
103
|
value: y,
|
|
104
|
-
children: /* @__PURE__ */ l(d, { children: /* @__PURE__ */ l(
|
|
105
|
-
ref:
|
|
106
|
-
className:
|
|
104
|
+
children: /* @__PURE__ */ l(d, { children: /* @__PURE__ */ l(a, {
|
|
105
|
+
ref: s,
|
|
106
|
+
className: r(_({
|
|
107
107
|
variant: f,
|
|
108
108
|
size: p,
|
|
109
109
|
orientation: u
|
|
110
110
|
}), e),
|
|
111
|
-
...
|
|
111
|
+
...o
|
|
112
112
|
}) })
|
|
113
113
|
});
|
|
114
114
|
});
|
|
115
|
-
y.displayName =
|
|
115
|
+
y.displayName = a.displayName;
|
|
116
116
|
var b = {
|
|
117
117
|
accent: "data-[state=active]:text-accent-11",
|
|
118
118
|
neutral: "data-[state=active]:text-surface-fg"
|
|
119
119
|
}, x = {
|
|
120
120
|
accent: "bg-accent-9",
|
|
121
121
|
neutral: "bg-surface-fg"
|
|
122
|
-
}, S = c.forwardRef(({ className:
|
|
123
|
-
let d = c.useContext(g), h = c.useContext(p), _ = c.useContext(m), y =
|
|
124
|
-
return /* @__PURE__ */ u(
|
|
122
|
+
}, S = c.forwardRef(({ className: t, variant: n, children: i, ...a }, o) => {
|
|
123
|
+
let d = c.useContext(g), h = c.useContext(p), _ = c.useContext(m), y = n ?? d.variant, S = d.size, C = d.color, w = a.value === h, T = _ === "vertical";
|
|
124
|
+
return /* @__PURE__ */ u(s, {
|
|
125
125
|
ref: o,
|
|
126
|
-
className:
|
|
126
|
+
className: r(v({
|
|
127
127
|
variant: y,
|
|
128
128
|
size: S
|
|
129
|
-
}), y === "line" && b[C], T && "w-full justify-start", y === "line" && T && "-ml-px -mb-0",
|
|
129
|
+
}), y === "line" && b[C], T && "w-full justify-start", y === "line" && T && "-ml-px -mb-0", t),
|
|
130
130
|
...a,
|
|
131
131
|
children: [
|
|
132
132
|
y === "contained" && w && /* @__PURE__ */ l(f.span, {
|
|
133
133
|
layoutId: `${d.layoutId}-contained`,
|
|
134
134
|
className: "absolute inset-0 rounded-control bg-surface-overlay shadow-raised",
|
|
135
|
-
transition:
|
|
135
|
+
transition: e.smooth
|
|
136
136
|
}),
|
|
137
137
|
/* @__PURE__ */ l("span", {
|
|
138
138
|
className: "relative z-[1] inline-flex min-w-0 items-center gap-ds-02",
|
|
139
139
|
children: /* @__PURE__ */ l("span", {
|
|
140
140
|
className: "truncate",
|
|
141
|
-
children:
|
|
141
|
+
children: i
|
|
142
142
|
})
|
|
143
143
|
}),
|
|
144
144
|
y === "line" && w && /* @__PURE__ */ l(f.span, {
|
|
145
145
|
layoutId: `${d.layoutId}-line`,
|
|
146
|
-
className:
|
|
147
|
-
transition:
|
|
146
|
+
className: r("absolute", T ? "left-0 top-0 bottom-0 w-0.5" : "bottom-0 left-0 right-0 h-0.5", x[C]),
|
|
147
|
+
transition: e.smooth
|
|
148
148
|
})
|
|
149
149
|
]
|
|
150
150
|
});
|
|
151
151
|
});
|
|
152
|
-
S.displayName =
|
|
153
|
-
var C = c.forwardRef(({ className:
|
|
154
|
-
ref:
|
|
155
|
-
className:
|
|
156
|
-
...
|
|
152
|
+
S.displayName = s.displayName;
|
|
153
|
+
var C = c.forwardRef(({ className: e, children: n, ...a }, o) => /* @__PURE__ */ l(i, {
|
|
154
|
+
ref: o,
|
|
155
|
+
className: r("ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2", c.useContext(m) === "vertical" ? "mt-0 flex-1 min-w-0" : "mt-ds-05", e),
|
|
156
|
+
...a,
|
|
157
157
|
children: /* @__PURE__ */ l(f.div, {
|
|
158
158
|
initial: { opacity: 0 },
|
|
159
159
|
animate: { opacity: 1 },
|
|
160
|
-
transition:
|
|
160
|
+
transition: t.fade,
|
|
161
161
|
children: n
|
|
162
162
|
})
|
|
163
163
|
}));
|
|
164
|
-
C.displayName =
|
|
164
|
+
C.displayName = i.displayName;
|
|
165
165
|
//#endregion
|
|
166
166
|
export { h as Tabs, C as TabsContent, y as TabsList, S as TabsTrigger };
|
package/dist/ui/textarea.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { VariantProps } from 'class-variance-authority';
|
|
3
|
-
import { FieldState } from './lib/field-state';
|
|
2
|
+
import { FieldState } from './lib/field-state.js';
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
declare const textareaVariants: (props?: ({
|
|
6
5
|
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
package/dist/ui/toast-types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/ui/toast.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { ExternalToast } from 'sonner';
|
|
3
|
-
import { ToastActionOptions, ToastOptions, ToastType, ToastUndoOptions, ToastUploadOptions, UploadFile } from './toast-types';
|
|
2
|
+
import { ToastActionOptions, ToastOptions, ToastType, ToastUndoOptions, ToastUploadOptions, UploadFile } from './toast-types.js';
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
declare function TimerBar({ duration, type, paused, }: {
|
|
6
5
|
duration: number;
|
|
@@ -67,5 +66,5 @@ declare namespace toast {
|
|
|
67
66
|
}
|
|
68
67
|
export type ToastProps = ToastOptions;
|
|
69
68
|
export { formatFileSize, TimerBar, toast, ToastContent, UploadFileRow, UploadToastContent, };
|
|
70
|
-
export type { ToastActionOptions, ToastOptions, ToastType, ToastUndoOptions, ToastUploadOptions, UploadFile, } from './toast-types';
|
|
69
|
+
export type { ToastActionOptions, ToastOptions, ToastType, ToastUndoOptions, ToastUploadOptions, UploadFile, } from './toast-types.js';
|
|
71
70
|
//# sourceMappingURL=toast.d.ts.map
|
package/dist/ui/toaster.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { VariantProps } from 'class-variance-authority';
|
|
3
|
-
import { toggleVariants } from './toggle';
|
|
4
|
-
import * as ToggleGroupPrimitive from '../primitives/react-toggle-group';
|
|
2
|
+
import { toggleVariants } from './toggle.js';
|
|
3
|
+
import * as ToggleGroupPrimitive from '../primitives/react-toggle-group.js';
|
|
5
4
|
import * as React from 'react';
|
|
6
5
|
declare const ToggleGroup: React.ForwardRefExoticComponent<((Omit<ToggleGroupPrimitive.ToggleGroupSingleProps & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<ToggleGroupPrimitive.ToggleGroupMultipleProps & React.RefAttributes<HTMLDivElement>, "ref">) & VariantProps<(props?: ({
|
|
7
6
|
variant?: "outline" | "default" | null | undefined;
|
package/dist/ui/toggle-group.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { cn as e } from "./lib/utils.js";
|
|
3
|
+
import { toggleVariants as t } from "./toggle.js";
|
|
4
|
+
import { Item2 as n, Root2 as r } from "../_chunks/primitives/react-toggle-group.js";
|
|
5
5
|
import * as i from "react";
|
|
6
6
|
import { jsx as a } from "react/jsx-runtime";
|
|
7
7
|
//#region src/ui/toggle-group.tsx
|
|
@@ -9,19 +9,19 @@ var o = i.createContext({
|
|
|
9
9
|
size: "md",
|
|
10
10
|
variant: "default",
|
|
11
11
|
color: "accent"
|
|
12
|
-
}), s = i.forwardRef(({ className:
|
|
12
|
+
}), s = i.forwardRef(({ className: t, variant: n, size: s, color: c, children: l, ...u }, d) => {
|
|
13
13
|
let f = i.useMemo(() => ({
|
|
14
|
-
variant:
|
|
14
|
+
variant: n,
|
|
15
15
|
size: s,
|
|
16
16
|
color: c
|
|
17
17
|
}), [
|
|
18
|
-
|
|
18
|
+
n,
|
|
19
19
|
s,
|
|
20
20
|
c
|
|
21
21
|
]);
|
|
22
|
-
return /* @__PURE__ */ a(
|
|
22
|
+
return /* @__PURE__ */ a(r, {
|
|
23
23
|
ref: d,
|
|
24
|
-
className:
|
|
24
|
+
className: e("inline-flex items-center gap-ds-02", t),
|
|
25
25
|
...u,
|
|
26
26
|
children: /* @__PURE__ */ a(o.Provider, {
|
|
27
27
|
value: f,
|
|
@@ -29,19 +29,19 @@ var o = i.createContext({
|
|
|
29
29
|
})
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
|
-
s.displayName =
|
|
33
|
-
var c = i.forwardRef(({ className:
|
|
32
|
+
s.displayName = r.displayName;
|
|
33
|
+
var c = i.forwardRef(({ className: r, variant: s, size: c, color: l, ...u }, d) => {
|
|
34
34
|
let f = i.useContext(o);
|
|
35
|
-
return /* @__PURE__ */ a(
|
|
35
|
+
return /* @__PURE__ */ a(n, {
|
|
36
36
|
ref: d,
|
|
37
|
-
className:
|
|
37
|
+
className: e(t({
|
|
38
38
|
variant: s ?? f.variant,
|
|
39
39
|
size: c ?? f.size,
|
|
40
40
|
color: l ?? f.color
|
|
41
|
-
}), "active:scale-[0.95] transition-transform",
|
|
41
|
+
}), "active:scale-[0.95] transition-transform", r),
|
|
42
42
|
...u
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
|
-
c.displayName =
|
|
45
|
+
c.displayName = n.displayName;
|
|
46
46
|
//#endregion
|
|
47
47
|
export { s as ToggleGroup, c as ToggleGroupItem };
|
package/dist/ui/toggle.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { VariantProps } from 'class-variance-authority';
|
|
3
|
-
import * as TogglePrimitive from '../primitives/react-toggle';
|
|
2
|
+
import * as TogglePrimitive from '../primitives/react-toggle.js';
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
declare const toggleVariants: (props?: ({
|
|
6
5
|
variant?: "outline" | "default" | null | undefined;
|
package/dist/ui/toggle.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { motionProps as e, springs as t } from "./lib/motion.js";
|
|
3
|
+
import { cva as n } from "../_chunks/vendor-utils.js";
|
|
4
|
+
import { cn as r } from "./lib/utils.js";
|
|
5
|
+
import { Root as i } from "../_chunks/primitives/react-toggle.js";
|
|
6
6
|
import * as a from "react";
|
|
7
7
|
import { jsx as o } from "react/jsx-runtime";
|
|
8
8
|
import { motion as s } from "framer-motion";
|
|
9
9
|
//#region src/ui/toggle.tsx
|
|
10
|
-
var c = s.create(
|
|
10
|
+
var c = s.create(i), l = n("inline-flex items-center justify-center gap-ds-03 rounded-control font-medium transition-colors duration-fast-01 ease-productive-standard focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-action-disabled", {
|
|
11
11
|
variants: {
|
|
12
12
|
variant: {
|
|
13
13
|
default: "bg-transparent hover:bg-surface-raised-hover text-surface-fg-muted",
|
|
@@ -30,17 +30,17 @@ var c = s.create(e), l = r("inline-flex items-center justify-center gap-ds-03 ro
|
|
|
30
30
|
size: "md",
|
|
31
31
|
color: "accent"
|
|
32
32
|
}
|
|
33
|
-
}), u = a.forwardRef(({ className:
|
|
33
|
+
}), u = a.forwardRef(({ className: n, variant: i, size: a, color: s, ...u }, d) => /* @__PURE__ */ o(c, {
|
|
34
34
|
ref: d,
|
|
35
35
|
whileTap: { scale: .95 },
|
|
36
|
-
transition:
|
|
37
|
-
className:
|
|
38
|
-
variant:
|
|
36
|
+
transition: t.snappy,
|
|
37
|
+
className: r(l({
|
|
38
|
+
variant: i,
|
|
39
39
|
size: a,
|
|
40
40
|
color: s
|
|
41
|
-
}),
|
|
42
|
-
...
|
|
41
|
+
}), n),
|
|
42
|
+
...e(u)
|
|
43
43
|
}));
|
|
44
|
-
u.displayName =
|
|
44
|
+
u.displayName = i.displayName;
|
|
45
45
|
//#endregion
|
|
46
46
|
export { u as Toggle, l as toggleVariants };
|
package/dist/ui/tooltip.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import * as TooltipPrimitive from '../primitives/react-tooltip';
|
|
1
|
+
import * as TooltipPrimitive from '../primitives/react-tooltip.js';
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
declare const TooltipProvider: React.FC<React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider>>;
|
|
5
4
|
declare const Tooltip: React.FC<React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>>;
|
package/dist/ui/tooltip.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { springs as e, tweens as t } from "./lib/motion.js";
|
|
3
|
+
import { cn as n } from "./lib/utils.js";
|
|
4
|
+
import { useControllableOpen as r } from "../_chunks/use-controllable-open.js";
|
|
5
|
+
import { Content2 as i, Portal as a, Provider as o, Root3 as s, Trigger as c } from "../_chunks/primitives/react-tooltip.js";
|
|
6
6
|
import * as l from "react";
|
|
7
7
|
import { Fragment as u, jsx as d } from "react/jsx-runtime";
|
|
8
8
|
import { AnimatePresence as f, motion as p } from "framer-motion";
|
|
9
9
|
//#region src/ui/tooltip.tsx
|
|
10
10
|
var m = l.createContext(!1), h = ({ children: e, ...t }) => /* @__PURE__ */ d(m.Provider, {
|
|
11
11
|
value: !0,
|
|
12
|
-
children: /* @__PURE__ */ d(
|
|
12
|
+
children: /* @__PURE__ */ d(o, {
|
|
13
13
|
...t,
|
|
14
14
|
children: e
|
|
15
15
|
})
|
|
@@ -17,21 +17,21 @@ var m = l.createContext(!1), h = ({ children: e, ...t }) => /* @__PURE__ */ d(m.
|
|
|
17
17
|
function g({ children: e }) {
|
|
18
18
|
return l.useContext(m) ? /* @__PURE__ */ d(u, { children: e }) : /* @__PURE__ */ d(m.Provider, {
|
|
19
19
|
value: !0,
|
|
20
|
-
children: /* @__PURE__ */ d(
|
|
20
|
+
children: /* @__PURE__ */ d(o, {
|
|
21
21
|
delayDuration: 300,
|
|
22
22
|
children: e
|
|
23
23
|
})
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
var _ = l.createContext({ open: !1 }), v = ({ open: e, defaultOpen: t, onOpenChange: n, ...i }) => {
|
|
27
|
-
let { open: a, setOpen: o } =
|
|
27
|
+
let { open: a, setOpen: o } = r({
|
|
28
28
|
open: e,
|
|
29
29
|
defaultOpen: t,
|
|
30
30
|
onOpenChange: n
|
|
31
|
-
}),
|
|
31
|
+
}), c = l.useMemo(() => ({ open: a }), [a]);
|
|
32
32
|
return /* @__PURE__ */ d(g, { children: /* @__PURE__ */ d(_.Provider, {
|
|
33
|
-
value:
|
|
34
|
-
children: /* @__PURE__ */ d(
|
|
33
|
+
value: c,
|
|
34
|
+
children: /* @__PURE__ */ d(s, {
|
|
35
35
|
open: a,
|
|
36
36
|
onOpenChange: o,
|
|
37
37
|
...i
|
|
@@ -39,20 +39,20 @@ var _ = l.createContext({ open: !1 }), v = ({ open: e, defaultOpen: t, onOpenCha
|
|
|
39
39
|
}) });
|
|
40
40
|
};
|
|
41
41
|
v.displayName = "Tooltip";
|
|
42
|
-
var y =
|
|
42
|
+
var y = c, b = {
|
|
43
43
|
top: { y: 4 },
|
|
44
44
|
bottom: { y: -4 },
|
|
45
45
|
left: { x: 4 },
|
|
46
46
|
right: { x: -4 }
|
|
47
|
-
}, x = l.forwardRef(({ className:
|
|
48
|
-
let { open: h } = l.useContext(_), g = b[
|
|
49
|
-
return /* @__PURE__ */ d(f, { children: h && /* @__PURE__ */ d(
|
|
47
|
+
}, x = l.forwardRef(({ className: r, sideOffset: o = 4, side: s = "top", children: c, ...u }, m) => {
|
|
48
|
+
let { open: h } = l.useContext(_), g = b[s] ?? {};
|
|
49
|
+
return /* @__PURE__ */ d(f, { children: h && /* @__PURE__ */ d(a, {
|
|
50
50
|
forceMount: !0,
|
|
51
|
-
children: /* @__PURE__ */ d(
|
|
51
|
+
children: /* @__PURE__ */ d(i, {
|
|
52
52
|
ref: m,
|
|
53
53
|
forceMount: !0,
|
|
54
|
-
sideOffset:
|
|
55
|
-
side:
|
|
54
|
+
sideOffset: o,
|
|
55
|
+
side: s,
|
|
56
56
|
...u,
|
|
57
57
|
asChild: !0,
|
|
58
58
|
children: /* @__PURE__ */ d(p.div, {
|
|
@@ -73,15 +73,15 @@ var y = i, b = {
|
|
|
73
73
|
...g
|
|
74
74
|
},
|
|
75
75
|
transition: {
|
|
76
|
-
...
|
|
77
|
-
opacity:
|
|
76
|
+
...e.snappy,
|
|
77
|
+
opacity: t.fade
|
|
78
78
|
},
|
|
79
|
-
className:
|
|
79
|
+
className: n("z-tooltip overflow-hidden rounded-overlay-sm bg-surface-inverted px-ds-04 py-ds-02b text-body-sm text-surface-inverted-fg shadow-floating", r),
|
|
80
80
|
children: c
|
|
81
81
|
})
|
|
82
82
|
})
|
|
83
83
|
}) });
|
|
84
84
|
});
|
|
85
|
-
x.displayName =
|
|
85
|
+
x.displayName = i.displayName;
|
|
86
86
|
//#endregion
|
|
87
87
|
export { v as Tooltip, x as TooltipContent, h as TooltipProvider, y as TooltipTrigger };
|