@leonardaustin/ui 0.24.0 → 0.26.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/README.md +183 -2
- package/dist/components/app-shell/AppShell.d.ts +3 -4
- package/dist/components/app-shell/AppShell.js +82 -0
- package/dist/components/app-shell/AuthLayout.d.ts +3 -4
- package/dist/components/app-shell/AuthLayout.js +16 -0
- package/dist/components/app-shell/BackLink.d.ts +3 -4
- package/dist/components/app-shell/BackLink.js +19 -0
- package/dist/components/app-shell/BottomNav.d.ts +3 -3
- package/dist/components/app-shell/BottomNav.js +37 -0
- package/dist/components/app-shell/Breadcrumbs.d.ts +3 -3
- package/dist/components/app-shell/Breadcrumbs.js +46 -0
- package/dist/components/app-shell/CommandPalette.d.ts +3 -3
- package/dist/components/app-shell/CommandPalette.js +119 -0
- package/dist/components/app-shell/MobileDrawer.d.ts +3 -4
- package/dist/components/app-shell/MobileDrawer.js +128 -0
- package/dist/components/app-shell/Sidebar.d.ts +3 -4
- package/dist/components/app-shell/Sidebar.js +355 -0
- package/dist/components/app-shell/ThemeMenu.d.ts +3 -3
- package/dist/components/app-shell/ThemeMenu.js +273 -0
- package/dist/components/app-shell/TopBar.d.ts +3 -4
- package/dist/components/app-shell/TopBar.js +129 -0
- package/dist/components/app-shell/commandPaletteEvents.d.ts +0 -1
- package/dist/components/app-shell/commandPaletteEvents.js +16 -0
- package/dist/components/app-shell/navigation.d.ts +0 -1
- package/dist/components/app-shell/navigation.js +21 -0
- package/dist/components/app-shell/themeMenuEvents.d.ts +0 -1
- package/dist/components/app-shell/themeMenuEvents.js +7 -0
- package/dist/components/app-shell/types.d.ts +0 -1
- package/dist/components/charts/AreaChart.d.ts +4 -4
- package/dist/components/charts/AreaChart.js +217 -0
- package/dist/components/charts/BarChart.d.ts +4 -4
- package/dist/components/charts/BarChart.js +91 -0
- package/dist/components/charts/DonutChart.d.ts +4 -4
- package/dist/components/charts/DonutChart.js +172 -0
- package/dist/components/charts/RadarChart.d.ts +4 -4
- package/dist/components/charts/RadarChart.js +142 -0
- package/dist/components/charts/RadialBarChart.d.ts +4 -4
- package/dist/components/charts/RadialBarChart.js +219 -0
- package/dist/components/charts/SparkLine.d.ts +4 -4
- package/dist/components/charts/SparkLine.js +39 -0
- package/dist/components/charts/StackedBarChart.d.ts +4 -4
- package/dist/components/charts/StackedBarChart.js +249 -0
- package/dist/components/charts/VerticalBarChart.d.ts +4 -4
- package/dist/components/charts/VerticalBarChart.js +143 -0
- package/dist/components/charts/chartUtils.d.ts +0 -1
- package/dist/components/charts/chartUtils.js +68 -0
- package/dist/components/tables/ColumnPicker.d.ts +3 -4
- package/dist/components/tables/ColumnPicker.js +59 -0
- package/dist/components/tables/Pagination.d.ts +3 -5
- package/dist/components/tables/Pagination.js +56 -0
- package/dist/components/tables/ResourceTable.d.ts +3 -4
- package/dist/components/tables/ResourceTable.js +88 -0
- package/dist/components/tables/Table.d.ts +0 -1
- package/dist/components/tables/Table.js +95 -0
- package/dist/components/tables/sortRows.d.ts +0 -1
- package/dist/components/tables/sortRows.js +11 -0
- package/dist/components/ui/Accordion.d.ts +9 -2
- package/dist/components/ui/Accordion.js +35 -0
- package/dist/components/ui/Alert.d.ts +8 -6
- package/dist/components/ui/Alert.js +51 -0
- package/dist/components/ui/AttachmentList.d.ts +5 -6
- package/dist/components/ui/AttachmentList.js +90 -0
- package/dist/components/ui/AudioPlayer.d.ts +7 -4
- package/dist/components/ui/AudioPlayer.js +447 -0
- package/dist/components/ui/AuthCard.d.ts +3 -4
- package/dist/components/ui/AuthCard.js +39 -0
- package/dist/components/ui/AuthorByline.d.ts +5 -6
- package/dist/components/ui/AuthorByline.js +23 -0
- package/dist/components/ui/Avatar.d.ts +5 -4
- package/dist/components/ui/Avatar.js +36 -0
- package/dist/components/ui/Badge.d.ts +3 -3
- package/dist/components/ui/Badge.js +47 -0
- package/dist/components/ui/Button.d.ts +9 -9
- package/dist/components/ui/Button.js +83 -0
- package/dist/components/ui/Calendar.d.ts +3 -4
- package/dist/components/ui/Calendar.js +344 -0
- package/dist/components/ui/CalendarGrid.d.ts +3 -4
- package/dist/components/ui/CalendarGrid.js +136 -0
- package/dist/components/ui/Card.d.ts +6 -6
- package/dist/components/ui/Card.js +53 -0
- package/dist/components/ui/CharacterCount.d.ts +3 -4
- package/dist/components/ui/CharacterCount.js +27 -0
- package/dist/components/ui/Checkbox.d.ts +10 -9
- package/dist/components/ui/Checkbox.js +52 -0
- package/dist/components/ui/CodeInput.d.ts +7 -5
- package/dist/components/ui/CodeInput.js +96 -0
- package/dist/components/ui/Combobox.d.ts +8 -7
- package/dist/components/ui/Combobox.js +213 -0
- package/dist/components/ui/CopyButton.d.ts +6 -2
- package/dist/components/ui/CopyButton.js +57 -0
- package/dist/components/ui/DangerZone.d.ts +3 -5
- package/dist/components/ui/DangerZone.js +23 -0
- package/dist/components/ui/DatePartsInput.d.ts +6 -5
- package/dist/components/ui/DatePartsInput.js +138 -0
- package/dist/components/ui/DatePicker.d.ts +9 -5
- package/dist/components/ui/DatePicker.js +84 -0
- package/dist/components/ui/DateRangePicker.d.ts +7 -6
- package/dist/components/ui/DateRangePicker.js +143 -0
- package/dist/components/ui/DateTimePicker.d.ts +7 -5
- package/dist/components/ui/DateTimePicker.js +267 -0
- package/dist/components/ui/DetailPanel.d.ts +3 -4
- package/dist/components/ui/DetailPanel.js +183 -0
- package/dist/components/ui/Dialog.d.ts +3 -4
- package/dist/components/ui/Dialog.js +411 -0
- package/dist/components/ui/DialogActions.d.ts +3 -4
- package/dist/components/ui/DialogActions.js +35 -0
- package/dist/components/ui/Disclosure.d.ts +7 -4
- package/dist/components/ui/Disclosure.js +45 -0
- package/dist/components/ui/DividerLabel.d.ts +3 -4
- package/dist/components/ui/DividerLabel.js +20 -0
- package/dist/components/ui/DropdownMenu.d.ts +4 -5
- package/dist/components/ui/DropdownMenu.js +229 -0
- package/dist/components/ui/EmptyState.d.ts +3 -5
- package/dist/components/ui/EmptyState.js +31 -0
- package/dist/components/ui/ErrorBoundary.d.ts +3 -3
- package/dist/components/ui/ErrorBoundary.js +46 -0
- package/dist/components/ui/FieldContext.d.ts +0 -1
- package/dist/components/ui/FieldContext.js +8 -0
- package/dist/components/ui/Fieldset.d.ts +2 -3
- package/dist/components/ui/Fieldset.js +39 -0
- package/dist/components/ui/FilterButton.d.ts +4 -9
- package/dist/components/ui/FilterButton.js +17 -0
- package/dist/components/ui/FilterDropdown.d.ts +4 -6
- package/dist/components/ui/FilterDropdown.js +18 -0
- package/dist/components/ui/FormField.d.ts +4 -5
- package/dist/components/ui/FormField.js +68 -0
- package/dist/components/ui/Grid.d.ts +1 -2
- package/dist/components/ui/Grid.js +19 -0
- package/dist/components/ui/GridItem.d.ts +1 -2
- package/dist/components/ui/GridItem.js +16 -0
- package/dist/components/ui/Inline.d.ts +1 -2
- package/dist/components/ui/Inline.js +24 -0
- package/dist/components/ui/Kbd.d.ts +3 -4
- package/dist/components/ui/Kbd.js +13 -0
- package/dist/components/ui/ListItemLink.d.ts +3 -4
- package/dist/components/ui/ListItemLink.js +44 -0
- package/dist/components/ui/LoadingSpinner.d.ts +5 -5
- package/dist/components/ui/LoadingSpinner.js +19 -0
- package/dist/components/ui/MessageBubble.d.ts +5 -3
- package/dist/components/ui/MessageBubble.js +41 -0
- package/dist/components/ui/MetadataGrid.d.ts +5 -4
- package/dist/components/ui/MetadataGrid.js +76 -0
- package/dist/components/ui/MetricCard.d.ts +3 -4
- package/dist/components/ui/MetricCard.js +51 -0
- package/dist/components/ui/NavTabs.d.ts +2 -3
- package/dist/components/ui/NavTabs.js +29 -0
- package/dist/components/ui/OAuthButton.d.ts +2 -3
- package/dist/components/ui/OAuthButton.js +55 -0
- package/dist/components/ui/OverlineLabel.d.ts +3 -4
- package/dist/components/ui/OverlineLabel.js +13 -0
- package/dist/components/ui/PageHeader.d.ts +3 -4
- package/dist/components/ui/PageHeader.js +33 -0
- package/dist/components/ui/PageSection.d.ts +3 -4
- package/dist/components/ui/PageSection.js +31 -0
- package/dist/components/ui/PaginationBar.d.ts +3 -4
- package/dist/components/ui/PaginationBar.js +62 -0
- package/dist/components/ui/PasswordInput.d.ts +3 -5
- package/dist/components/ui/PasswordInput.js +62 -0
- package/dist/components/ui/PasswordRequirements.d.ts +3 -3
- package/dist/components/ui/PasswordRequirements.js +34 -0
- package/dist/components/ui/Popover.d.ts +5 -4
- package/dist/components/ui/Popover.js +53 -0
- package/dist/components/ui/ProfileHeader.d.ts +3 -4
- package/dist/components/ui/ProfileHeader.js +54 -0
- package/dist/components/ui/ProgressBar.d.ts +3 -4
- package/dist/components/ui/ProgressBar.js +42 -0
- package/dist/components/ui/ProseContent.d.ts +3 -4
- package/dist/components/ui/ProseContent.js +13 -0
- package/dist/components/ui/QrCode.d.ts +3 -4
- package/dist/components/ui/QrCode.js +47 -0
- package/dist/components/ui/Radio.d.ts +9 -7
- package/dist/components/ui/Radio.js +58 -0
- package/dist/components/ui/RadioPill.d.ts +10 -8
- package/dist/components/ui/RadioPill.js +53 -0
- package/dist/components/ui/ReorderList.d.ts +3 -4
- package/dist/components/ui/ReorderList.js +123 -0
- package/dist/components/ui/SearchInput.d.ts +7 -6
- package/dist/components/ui/SearchInput.js +49 -0
- package/dist/components/ui/SectionHeader.d.ts +3 -5
- package/dist/components/ui/SectionHeader.js +13 -0
- package/dist/components/ui/Select.d.ts +4 -6
- package/dist/components/ui/Select.js +117 -0
- package/dist/components/ui/SelectDropdown.d.ts +10 -6
- package/dist/components/ui/SelectDropdown.js +206 -0
- package/dist/components/ui/SettingRow.d.ts +5 -7
- package/dist/components/ui/SettingRow.js +25 -0
- package/dist/components/ui/SideSheet.d.ts +3 -4
- package/dist/components/ui/SideSheet.js +164 -0
- package/dist/components/ui/Skeleton.d.ts +3 -4
- package/dist/components/ui/Skeleton.js +18 -0
- package/dist/components/ui/Slider.d.ts +11 -7
- package/dist/components/ui/Slider.js +58 -0
- package/dist/components/ui/SplitPaneLayout.d.ts +6 -6
- package/dist/components/ui/SplitPaneLayout.js +22 -0
- package/dist/components/ui/Stack.d.ts +1 -2
- package/dist/components/ui/Stack.js +18 -0
- package/dist/components/ui/StatusDot.d.ts +3 -3
- package/dist/components/ui/StatusDot.js +24 -0
- package/dist/components/ui/StepProgress.d.ts +3 -3
- package/dist/components/ui/StepProgress.js +33 -0
- package/dist/components/ui/Tabs.d.ts +5 -6
- package/dist/components/ui/Tabs.js +63 -0
- package/dist/components/ui/TextInput.d.ts +3 -5
- package/dist/components/ui/TextInput.js +57 -0
- package/dist/components/ui/Textarea.d.ts +3 -5
- package/dist/components/ui/Textarea.js +59 -0
- package/dist/components/ui/ThemePreview.d.ts +3 -4
- package/dist/components/ui/ThemePreview.js +28 -0
- package/dist/components/ui/TimeInput.d.ts +7 -7
- package/dist/components/ui/TimeInput.js +22 -0
- package/dist/components/ui/Timeline.d.ts +3 -3
- package/dist/components/ui/Timeline.js +29 -0
- package/dist/components/ui/Toast.d.ts +0 -1
- package/dist/components/ui/Toast.js +121 -0
- package/dist/components/ui/Toggle.d.ts +10 -5
- package/dist/components/ui/Toggle.js +34 -0
- package/dist/components/ui/Toolbar.d.ts +3 -4
- package/dist/components/ui/Toolbar.js +70 -0
- package/dist/components/ui/Tooltip.d.ts +0 -1
- package/dist/components/ui/Tooltip.js +91 -0
- package/dist/components/ui/TranscriptLine.d.ts +5 -4
- package/dist/components/ui/TranscriptLine.js +40 -0
- package/dist/components/ui/UploadDropzone.d.ts +3 -6
- package/dist/components/ui/UploadDropzone.js +55 -0
- package/dist/components/ui/badgeColors.d.ts +0 -1
- package/dist/components/ui/badgeColors.js +5 -0
- package/dist/components/ui/calendar/AgendaView.d.ts +0 -1
- package/dist/components/ui/calendar/AgendaView.js +140 -0
- package/dist/components/ui/calendar/MonthView.d.ts +0 -1
- package/dist/components/ui/calendar/MonthView.js +321 -0
- package/dist/components/ui/calendar/TimeGrid.d.ts +0 -1
- package/dist/components/ui/calendar/TimeGrid.js +501 -0
- package/dist/components/ui/calendar/TimelineView.d.ts +0 -1
- package/dist/components/ui/calendar/TimelineView.js +311 -0
- package/dist/components/ui/calendar/context.d.ts +0 -1
- package/dist/components/ui/calendar/context.js +10 -0
- package/dist/components/ui/calendar/items.d.ts +0 -1
- package/dist/components/ui/calendar/items.js +152 -0
- package/dist/components/ui/calendar/types.d.ts +0 -1
- package/dist/components/ui/calendar/types.js +38 -0
- package/dist/components/ui/calendar/useGridInteraction.d.ts +0 -1
- package/dist/components/ui/calendar/useGridInteraction.js +393 -0
- package/dist/components/ui/useFieldControl.d.ts +1 -2
- package/dist/components/ui/useFieldControl.js +17 -0
- package/dist/config/theme.d.ts +0 -1
- package/dist/config/theme.js +219 -0
- package/dist/core.css +2933 -0
- package/dist/hooks/useAnchoredPopup.d.ts +0 -1
- package/dist/hooks/useAnchoredPopup.js +162 -0
- package/dist/hooks/useApplyTheme.d.ts +0 -1
- package/dist/hooks/useApplyTheme.js +16 -0
- package/dist/hooks/useControllableState.d.ts +14 -0
- package/dist/hooks/useControllableState.js +10 -0
- package/dist/hooks/useDismiss.d.ts +0 -1
- package/dist/hooks/useDismiss.js +24 -0
- package/dist/hooks/useFocusTrap.d.ts +0 -1
- package/dist/hooks/useFocusTrap.js +42 -0
- package/dist/hooks/useOverlayStack.d.ts +0 -1
- package/dist/hooks/useOverlayStack.js +23 -0
- package/dist/hooks/usePopover.d.ts +0 -1
- package/dist/hooks/usePopover.js +47 -0
- package/dist/hooks/usePortalContainer.d.ts +0 -1
- package/dist/hooks/usePortalContainer.js +14 -0
- package/dist/hooks/useSettings.d.ts +0 -1
- package/dist/hooks/useSettings.js +8 -0
- package/dist/hooks/useTheme.d.ts +0 -1
- package/dist/hooks/useTheme.js +8 -0
- package/dist/hooks/useTypeahead.d.ts +0 -1
- package/dist/hooks/useTypeahead.js +19 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +133 -12866
- package/dist/lib/anchorPlacement.d.ts +0 -1
- package/dist/lib/anchorPlacement.js +75 -0
- package/dist/lib/calendar.d.ts +0 -1
- package/dist/lib/calendar.js +666 -0
- package/dist/lib/cn.d.ts +0 -1
- package/dist/lib/cn.js +228 -0
- package/dist/lib/codeInput.d.ts +0 -1
- package/dist/lib/codeInput.js +51 -0
- package/dist/lib/dateParts.d.ts +0 -1
- package/dist/lib/dateParts.js +31 -0
- package/dist/lib/dialogDrag.d.ts +0 -1
- package/dist/lib/dialogDrag.js +45 -0
- package/dist/lib/dialogResize.d.ts +0 -1
- package/dist/lib/dialogResize.js +47 -0
- package/dist/lib/formatDate.d.ts +0 -1
- package/dist/lib/formatDate.js +29 -0
- package/dist/lib/formatMediaTime.d.ts +0 -1
- package/dist/lib/formatMediaTime.js +7 -0
- package/dist/lib/keyboardStep.d.ts +0 -1
- package/dist/lib/layout.d.ts +0 -1
- package/dist/lib/layout.js +29 -0
- package/dist/lib/math.d.ts +0 -1
- package/dist/lib/math.js +6 -0
- package/dist/lib/mergeRefs.d.ts +6 -0
- package/dist/lib/mergeRefs.js +17 -0
- package/dist/lib/months.d.ts +0 -1
- package/dist/lib/months.js +30 -0
- package/dist/lib/overlayStack.d.ts +0 -1
- package/dist/lib/overlayStack.js +47 -0
- package/dist/lib/panelResize.d.ts +0 -1
- package/dist/lib/panelResize.js +8 -0
- package/dist/lib/passwordRequirements.d.ts +0 -1
- package/dist/lib/passwordRequirements.js +23 -0
- package/dist/lib/qrCode.d.ts +0 -1
- package/dist/lib/qrCode.js +570 -0
- package/dist/lib/rect.d.ts +0 -1
- package/dist/lib/tones.d.ts +0 -1
- package/dist/lib/tones.js +104 -0
- package/dist/lib/typeahead.d.ts +0 -1
- package/dist/lib/typeahead.js +31 -0
- package/dist/providers/ControlSizeContext.d.ts +0 -1
- package/dist/providers/ControlSizeContext.js +9 -0
- package/dist/providers/ControlSizeProvider.d.ts +0 -1
- package/dist/providers/ControlSizeProvider.js +11 -0
- package/dist/providers/SettingsContext.d.ts +0 -1
- package/dist/providers/SettingsContext.js +53 -0
- package/dist/providers/SettingsProvider.d.ts +0 -1
- package/dist/providers/SettingsProvider.js +249 -0
- package/dist/providers/ThemeContext.d.ts +0 -1
- package/dist/providers/ThemeContext.js +5 -0
- package/dist/providers/ThemeProvider.d.ts +0 -1
- package/dist/providers/ThemeProvider.js +17 -0
- package/dist/providers/accentColors.d.ts +0 -1
- package/dist/providers/accentColors.js +75 -0
- package/dist/providers/themeClasses.d.ts +1 -1
- package/dist/providers/themeClasses.js +20 -0
- package/dist/styles.css +263 -176
- package/dist/themes/cyber-brutal-dark.css +53 -0
- package/dist/themes/cyber-brutal-light.css +75 -0
- package/dist/themes/glass-dark.css +217 -0
- package/dist/themes/glass-light.css +215 -0
- package/dist/themes/hashi.css +66 -0
- package/dist/themes/light-inverted.css +32 -0
- package/dist/themes/light.css +1 -0
- package/dist/themes/monokai.css +51 -0
- package/dist/themes/solarized.css +55 -0
- package/package.json +3 -1
- package/dist/components/app-shell/AppShell.d.ts.map +0 -1
- package/dist/components/app-shell/AuthLayout.d.ts.map +0 -1
- package/dist/components/app-shell/BackLink.d.ts.map +0 -1
- package/dist/components/app-shell/BottomNav.d.ts.map +0 -1
- package/dist/components/app-shell/Breadcrumbs.d.ts.map +0 -1
- package/dist/components/app-shell/CommandPalette.d.ts.map +0 -1
- package/dist/components/app-shell/MobileDrawer.d.ts.map +0 -1
- package/dist/components/app-shell/Sidebar.d.ts.map +0 -1
- package/dist/components/app-shell/ThemeMenu.d.ts.map +0 -1
- package/dist/components/app-shell/TopBar.d.ts.map +0 -1
- package/dist/components/app-shell/commandPaletteEvents.d.ts.map +0 -1
- package/dist/components/app-shell/navigation.d.ts.map +0 -1
- package/dist/components/app-shell/themeMenuEvents.d.ts.map +0 -1
- package/dist/components/app-shell/types.d.ts.map +0 -1
- package/dist/components/charts/AreaChart.d.ts.map +0 -1
- package/dist/components/charts/BarChart.d.ts.map +0 -1
- package/dist/components/charts/DonutChart.d.ts.map +0 -1
- package/dist/components/charts/RadarChart.d.ts.map +0 -1
- package/dist/components/charts/RadialBarChart.d.ts.map +0 -1
- package/dist/components/charts/SparkLine.d.ts.map +0 -1
- package/dist/components/charts/StackedBarChart.d.ts.map +0 -1
- package/dist/components/charts/VerticalBarChart.d.ts.map +0 -1
- package/dist/components/charts/chartUtils.d.ts.map +0 -1
- package/dist/components/tables/ColumnPicker.d.ts.map +0 -1
- package/dist/components/tables/Pagination.d.ts.map +0 -1
- package/dist/components/tables/ResourceTable.d.ts.map +0 -1
- package/dist/components/tables/Table.d.ts.map +0 -1
- package/dist/components/tables/sortRows.d.ts.map +0 -1
- package/dist/components/ui/Accordion.d.ts.map +0 -1
- package/dist/components/ui/Alert.d.ts.map +0 -1
- package/dist/components/ui/AttachmentList.d.ts.map +0 -1
- package/dist/components/ui/AudioPlayer.d.ts.map +0 -1
- package/dist/components/ui/AuthCard.d.ts.map +0 -1
- package/dist/components/ui/AuthorByline.d.ts.map +0 -1
- package/dist/components/ui/Avatar.d.ts.map +0 -1
- package/dist/components/ui/Badge.d.ts.map +0 -1
- package/dist/components/ui/Button.d.ts.map +0 -1
- package/dist/components/ui/Calendar.d.ts.map +0 -1
- package/dist/components/ui/CalendarGrid.d.ts.map +0 -1
- package/dist/components/ui/Card.d.ts.map +0 -1
- package/dist/components/ui/CharacterCount.d.ts.map +0 -1
- package/dist/components/ui/Checkbox.d.ts.map +0 -1
- package/dist/components/ui/CodeInput.d.ts.map +0 -1
- package/dist/components/ui/Combobox.d.ts.map +0 -1
- package/dist/components/ui/CopyButton.d.ts.map +0 -1
- package/dist/components/ui/DangerZone.d.ts.map +0 -1
- package/dist/components/ui/DatePartsInput.d.ts.map +0 -1
- package/dist/components/ui/DatePicker.d.ts.map +0 -1
- package/dist/components/ui/DateRangePicker.d.ts.map +0 -1
- package/dist/components/ui/DateTimePicker.d.ts.map +0 -1
- package/dist/components/ui/DetailPanel.d.ts.map +0 -1
- package/dist/components/ui/Dialog.d.ts.map +0 -1
- package/dist/components/ui/DialogActions.d.ts.map +0 -1
- package/dist/components/ui/Disclosure.d.ts.map +0 -1
- package/dist/components/ui/DividerLabel.d.ts.map +0 -1
- package/dist/components/ui/DropdownMenu.d.ts.map +0 -1
- package/dist/components/ui/EmptyState.d.ts.map +0 -1
- package/dist/components/ui/ErrorBoundary.d.ts.map +0 -1
- package/dist/components/ui/FieldContext.d.ts.map +0 -1
- package/dist/components/ui/Fieldset.d.ts.map +0 -1
- package/dist/components/ui/FilterButton.d.ts.map +0 -1
- package/dist/components/ui/FilterDropdown.d.ts.map +0 -1
- package/dist/components/ui/FormField.d.ts.map +0 -1
- package/dist/components/ui/Grid.d.ts.map +0 -1
- package/dist/components/ui/GridItem.d.ts.map +0 -1
- package/dist/components/ui/Inline.d.ts.map +0 -1
- package/dist/components/ui/Kbd.d.ts.map +0 -1
- package/dist/components/ui/ListItemLink.d.ts.map +0 -1
- package/dist/components/ui/LoadingSpinner.d.ts.map +0 -1
- package/dist/components/ui/MessageBubble.d.ts.map +0 -1
- package/dist/components/ui/MetadataGrid.d.ts.map +0 -1
- package/dist/components/ui/MetricCard.d.ts.map +0 -1
- package/dist/components/ui/NavTabs.d.ts.map +0 -1
- package/dist/components/ui/OAuthButton.d.ts.map +0 -1
- package/dist/components/ui/OverlineLabel.d.ts.map +0 -1
- package/dist/components/ui/PageHeader.d.ts.map +0 -1
- package/dist/components/ui/PageSection.d.ts.map +0 -1
- package/dist/components/ui/PaginationBar.d.ts.map +0 -1
- package/dist/components/ui/PasswordInput.d.ts.map +0 -1
- package/dist/components/ui/PasswordRequirements.d.ts.map +0 -1
- package/dist/components/ui/Popover.d.ts.map +0 -1
- package/dist/components/ui/ProfileHeader.d.ts.map +0 -1
- package/dist/components/ui/ProgressBar.d.ts.map +0 -1
- package/dist/components/ui/ProseContent.d.ts.map +0 -1
- package/dist/components/ui/QrCode.d.ts.map +0 -1
- package/dist/components/ui/Radio.d.ts.map +0 -1
- package/dist/components/ui/RadioPill.d.ts.map +0 -1
- package/dist/components/ui/ReorderList.d.ts.map +0 -1
- package/dist/components/ui/SearchInput.d.ts.map +0 -1
- package/dist/components/ui/SectionHeader.d.ts.map +0 -1
- package/dist/components/ui/Select.d.ts.map +0 -1
- package/dist/components/ui/SelectDropdown.d.ts.map +0 -1
- package/dist/components/ui/SettingRow.d.ts.map +0 -1
- package/dist/components/ui/SideSheet.d.ts.map +0 -1
- package/dist/components/ui/Skeleton.d.ts.map +0 -1
- package/dist/components/ui/Slider.d.ts.map +0 -1
- package/dist/components/ui/SplitPaneLayout.d.ts.map +0 -1
- package/dist/components/ui/Stack.d.ts.map +0 -1
- package/dist/components/ui/StatusDot.d.ts.map +0 -1
- package/dist/components/ui/StepProgress.d.ts.map +0 -1
- package/dist/components/ui/Tabs.d.ts.map +0 -1
- package/dist/components/ui/TextInput.d.ts.map +0 -1
- package/dist/components/ui/Textarea.d.ts.map +0 -1
- package/dist/components/ui/ThemePreview.d.ts.map +0 -1
- package/dist/components/ui/TimeInput.d.ts.map +0 -1
- package/dist/components/ui/Timeline.d.ts.map +0 -1
- package/dist/components/ui/Toast.d.ts.map +0 -1
- package/dist/components/ui/Toggle.d.ts.map +0 -1
- package/dist/components/ui/Toolbar.d.ts.map +0 -1
- package/dist/components/ui/Tooltip.d.ts.map +0 -1
- package/dist/components/ui/TranscriptLine.d.ts.map +0 -1
- package/dist/components/ui/UploadDropzone.d.ts.map +0 -1
- package/dist/components/ui/badgeColors.d.ts.map +0 -1
- package/dist/components/ui/calendar/AgendaView.d.ts.map +0 -1
- package/dist/components/ui/calendar/MonthView.d.ts.map +0 -1
- package/dist/components/ui/calendar/TimeGrid.d.ts.map +0 -1
- package/dist/components/ui/calendar/TimelineView.d.ts.map +0 -1
- package/dist/components/ui/calendar/context.d.ts.map +0 -1
- package/dist/components/ui/calendar/items.d.ts.map +0 -1
- package/dist/components/ui/calendar/types.d.ts.map +0 -1
- package/dist/components/ui/calendar/useGridInteraction.d.ts.map +0 -1
- package/dist/components/ui/useFieldControl.d.ts.map +0 -1
- package/dist/config/theme.d.ts.map +0 -1
- package/dist/hooks/useAnchoredPopup.d.ts.map +0 -1
- package/dist/hooks/useApplyTheme.d.ts.map +0 -1
- package/dist/hooks/useDismiss.d.ts.map +0 -1
- package/dist/hooks/useFocusTrap.d.ts.map +0 -1
- package/dist/hooks/useOverlayStack.d.ts.map +0 -1
- package/dist/hooks/usePopover.d.ts.map +0 -1
- package/dist/hooks/usePortalContainer.d.ts.map +0 -1
- package/dist/hooks/useSettings.d.ts.map +0 -1
- package/dist/hooks/useTheme.d.ts.map +0 -1
- package/dist/hooks/useTypeahead.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/anchorPlacement.d.ts.map +0 -1
- package/dist/lib/calendar.d.ts.map +0 -1
- package/dist/lib/cn.d.ts.map +0 -1
- package/dist/lib/codeInput.d.ts.map +0 -1
- package/dist/lib/dateParts.d.ts.map +0 -1
- package/dist/lib/dialogDrag.d.ts.map +0 -1
- package/dist/lib/dialogResize.d.ts.map +0 -1
- package/dist/lib/formatDate.d.ts.map +0 -1
- package/dist/lib/formatMediaTime.d.ts.map +0 -1
- package/dist/lib/keyboardStep.d.ts.map +0 -1
- package/dist/lib/layout.d.ts.map +0 -1
- package/dist/lib/math.d.ts.map +0 -1
- package/dist/lib/months.d.ts.map +0 -1
- package/dist/lib/overlayStack.d.ts.map +0 -1
- package/dist/lib/panelResize.d.ts.map +0 -1
- package/dist/lib/passwordRequirements.d.ts.map +0 -1
- package/dist/lib/qrCode.d.ts.map +0 -1
- package/dist/lib/rect.d.ts.map +0 -1
- package/dist/lib/tones.d.ts.map +0 -1
- package/dist/lib/typeahead.d.ts.map +0 -1
- package/dist/providers/ControlSizeContext.d.ts.map +0 -1
- package/dist/providers/ControlSizeProvider.d.ts.map +0 -1
- package/dist/providers/SettingsContext.d.ts.map +0 -1
- package/dist/providers/SettingsProvider.d.ts.map +0 -1
- package/dist/providers/ThemeContext.d.ts.map +0 -1
- package/dist/providers/ThemeProvider.d.ts.map +0 -1
- package/dist/providers/accentColors.d.ts.map +0 -1
- package/dist/providers/themeClasses.d.ts.map +0 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { useControlSize as t } from "../../providers/ControlSizeContext.js";
|
|
3
|
+
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ui/Card.tsx
|
|
5
|
+
function a({ children: a, className: o, header: s, footer: c, cover: l, selected: u, flush: d = !1, bodyClassName: f, ...p }) {
|
|
6
|
+
let m = t(), h = p.as === "button", g = p.as === "a", _ = h && p.disabled, v = h ? "span" : "div", y = e("ui-glass bg-bg-card border-border overflow-hidden rounded-md border", u && "border-accent", (h || g) && "focus-visible:outline-accent block w-full cursor-pointer appearance-none text-left transition-colors duration-[100ms] focus-visible:outline-2 focus-visible:outline-offset-2", (h || g) && !u && !_ && "hover:border-border-strong", _ && "cursor-not-allowed opacity-40", o), b = /* @__PURE__ */ i(n, { children: [
|
|
7
|
+
l != null && typeof l != "boolean" && l !== "" && /* @__PURE__ */ r(v, {
|
|
8
|
+
className: "block",
|
|
9
|
+
children: l
|
|
10
|
+
}),
|
|
11
|
+
s && /* @__PURE__ */ r(v, {
|
|
12
|
+
"data-control-size": m,
|
|
13
|
+
className: "ui-bar border-border flex flex-col justify-center border-b px-3 py-2.5",
|
|
14
|
+
children: s
|
|
15
|
+
}),
|
|
16
|
+
/* @__PURE__ */ r(v, {
|
|
17
|
+
className: e(h && "block", !d && "ui-surface-body p-3", f),
|
|
18
|
+
children: a
|
|
19
|
+
}),
|
|
20
|
+
c && /* @__PURE__ */ r(v, {
|
|
21
|
+
"data-control-size": m,
|
|
22
|
+
className: "ui-bar border-border bg-bg-primary/50 flex flex-col justify-center border-t px-3 py-2.5",
|
|
23
|
+
children: c
|
|
24
|
+
})
|
|
25
|
+
] });
|
|
26
|
+
if (p.as === "a") {
|
|
27
|
+
let { as: e, renderLink: t, ...n } = p, i = {
|
|
28
|
+
...n,
|
|
29
|
+
"aria-current": u ? "page" : n["aria-current"],
|
|
30
|
+
className: y,
|
|
31
|
+
children: b
|
|
32
|
+
};
|
|
33
|
+
return t ? t(i) : /* @__PURE__ */ r(e, { ...i });
|
|
34
|
+
}
|
|
35
|
+
if (p.as === "button") {
|
|
36
|
+
let { as: e, ...t } = p;
|
|
37
|
+
return /* @__PURE__ */ r(e, {
|
|
38
|
+
...t,
|
|
39
|
+
type: t.type ?? "button",
|
|
40
|
+
"aria-pressed": u ?? t["aria-pressed"],
|
|
41
|
+
className: y,
|
|
42
|
+
children: b
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
let { as: x = "div", ...S } = p;
|
|
46
|
+
return /* @__PURE__ */ r(x, {
|
|
47
|
+
...S,
|
|
48
|
+
className: y,
|
|
49
|
+
children: b
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { a as Card };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export interface CharacterCountProps extends
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
|
+
export interface CharacterCountProps extends ComponentPropsWithRef<"p"> {
|
|
3
3
|
/** Current text; its length is counted. */
|
|
4
4
|
value: string;
|
|
5
5
|
/** Character limit; the count turns red when exceeded. */
|
|
@@ -8,5 +8,4 @@ export interface CharacterCountProps extends HTMLAttributes<HTMLParagraphElement
|
|
|
8
8
|
announcementDelay?: number;
|
|
9
9
|
}
|
|
10
10
|
/** Counts UTF-16 code units, matching native input/textarea maxLength. */
|
|
11
|
-
export declare function CharacterCount({ value, maxLength, announcementDelay, className, ...props }: CharacterCountProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
//# sourceMappingURL=CharacterCount.d.ts.map
|
|
11
|
+
export declare function CharacterCount({ value, maxLength, announcementDelay, className, ref, ...props }: CharacterCountProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { useEffect as t, useState as n } from "react";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ui/CharacterCount.tsx
|
|
5
|
+
function a({ value: a, maxLength: o, announcementDelay: s = 1e3, className: c, ref: l, ...u }) {
|
|
6
|
+
let d = o - a.length, f = Math.abs(d), p = `${f} ${f === 1 ? "character" : "characters"} ${d < 0 ? "over the limit" : "remaining"}`, [m, h] = n(p);
|
|
7
|
+
return t(() => {
|
|
8
|
+
let e = setTimeout(() => h(p), s);
|
|
9
|
+
return () => clearTimeout(e);
|
|
10
|
+
}, [p, s]), /* @__PURE__ */ i("p", {
|
|
11
|
+
ref: l,
|
|
12
|
+
...u,
|
|
13
|
+
className: e("text-2xs", d < 0 ? "text-danger-fg" : "text-text-tertiary", c),
|
|
14
|
+
children: [/* @__PURE__ */ r("span", {
|
|
15
|
+
"aria-hidden": "true",
|
|
16
|
+
children: p
|
|
17
|
+
}), /* @__PURE__ */ r("span", {
|
|
18
|
+
className: "sr-only",
|
|
19
|
+
role: "status",
|
|
20
|
+
"aria-live": "polite",
|
|
21
|
+
"aria-atomic": "true",
|
|
22
|
+
children: m
|
|
23
|
+
})]
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { a as CharacterCount };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export interface CheckboxProps extends Omit<
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
|
+
export interface CheckboxProps extends Omit<ComponentPropsWithRef<"input">, "type" | "size" | "checked" | "defaultChecked"> {
|
|
3
3
|
/** Whether the checkbox is checked (controlled). */
|
|
4
|
-
checked
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
/** Initial checked state when uncontrolled. */
|
|
6
|
+
defaultChecked?: boolean;
|
|
5
7
|
/** Show the mixed state (dash) and expose aria-checked="mixed". */
|
|
6
8
|
indeterminate?: boolean;
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
+
/** Called with the new checked state. */
|
|
10
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
9
11
|
/** Visible label rendered beside the checkbox. */
|
|
10
12
|
label?: ReactNode;
|
|
11
|
-
/** Accessible name when no visible label is given
|
|
12
|
-
|
|
13
|
+
/** Accessible name when no visible label is given. */
|
|
14
|
+
"aria-label"?: string;
|
|
13
15
|
/** Opt-in larger controls, or inherit ControlSizeProvider. */
|
|
14
16
|
controlSize?: "compact" | "comfortable";
|
|
15
17
|
}
|
|
16
|
-
export declare
|
|
17
|
-
//# sourceMappingURL=Checkbox.d.ts.map
|
|
18
|
+
export declare function Checkbox({ id, checked: checkedProp, defaultChecked, indeterminate, onChange, onCheckedChange, label, disabled, controlSize, className, "aria-label": ariaLabel, "aria-describedby": describedBy, "aria-invalid": invalid, required, ref, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { mergeRefs as t } from "../../lib/mergeRefs.js";
|
|
3
|
+
import { useControlSize as n } from "../../providers/ControlSizeContext.js";
|
|
4
|
+
import { useControllableState as r } from "../../hooks/useControllableState.js";
|
|
5
|
+
import { FieldContext as i, describeField as a } from "./FieldContext.js";
|
|
6
|
+
import { useContext as o, useEffect as s, useId as c, useMemo as l, useRef as u } from "react";
|
|
7
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
|
+
import { Check as p, Minus as m } from "lucide-react";
|
|
9
|
+
//#region src/components/ui/Checkbox.tsx
|
|
10
|
+
function h({ id: h, checked: g, defaultChecked: _ = !1, indeterminate: v, onChange: y, onCheckedChange: b, label: x, disabled: S, controlSize: C, className: w, "aria-label": T, "aria-describedby": E, "aria-invalid": D, required: O, ref: k, ...A }) {
|
|
11
|
+
let [j, M] = r({
|
|
12
|
+
value: g,
|
|
13
|
+
defaultValue: _,
|
|
14
|
+
onChange: b
|
|
15
|
+
}), N = c(), P = n(C), F = o(i), I = h ?? F?.id ?? N, L = u(null), R = l(() => t(L, k), [k]);
|
|
16
|
+
return s(() => {
|
|
17
|
+
L.current && (L.current.indeterminate = !!v);
|
|
18
|
+
}, [v]), /* @__PURE__ */ f("div", {
|
|
19
|
+
className: e("ui-choice flex w-fit items-center gap-2.5", S ? "cursor-not-allowed opacity-40" : "cursor-pointer", w),
|
|
20
|
+
"data-control-size": P,
|
|
21
|
+
children: [/* @__PURE__ */ f("span", {
|
|
22
|
+
className: "ui-checkbox-control",
|
|
23
|
+
children: [/* @__PURE__ */ d("input", {
|
|
24
|
+
...A,
|
|
25
|
+
ref: R,
|
|
26
|
+
id: I,
|
|
27
|
+
type: "checkbox",
|
|
28
|
+
checked: j,
|
|
29
|
+
"aria-checked": v ? "mixed" : j,
|
|
30
|
+
"aria-label": T,
|
|
31
|
+
"aria-describedby": a(E, F?.describedBy),
|
|
32
|
+
"aria-invalid": D ?? (F?.invalid || void 0),
|
|
33
|
+
disabled: S,
|
|
34
|
+
required: O ?? F?.required,
|
|
35
|
+
onChange: (e) => {
|
|
36
|
+
y?.(e), M(e.target.checked);
|
|
37
|
+
},
|
|
38
|
+
className: "ui-checkbox-input"
|
|
39
|
+
}), /* @__PURE__ */ d("span", {
|
|
40
|
+
className: "ui-checkbox-decoration",
|
|
41
|
+
"aria-hidden": "true",
|
|
42
|
+
children: v ? /* @__PURE__ */ d(m, { className: "h-3 w-3" }) : j ? /* @__PURE__ */ d(p, { className: "h-3 w-3" }) : null
|
|
43
|
+
})]
|
|
44
|
+
}), x && /* @__PURE__ */ d("label", {
|
|
45
|
+
htmlFor: I,
|
|
46
|
+
className: e("text-text-primary text-xs", S ? "cursor-not-allowed" : "cursor-pointer"),
|
|
47
|
+
children: x
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { h as Checkbox };
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
|
+
export interface CodeInputProps extends Omit<ComponentPropsWithRef<"div">, "children" | "defaultValue" | "onChange"> {
|
|
2
3
|
/**
|
|
3
4
|
* The digits entered so far (controlled). Boxes the user has cleared are
|
|
4
5
|
* left out, so `value.length === length` only when every box is filled.
|
|
5
6
|
*/
|
|
6
|
-
value
|
|
7
|
+
value?: string;
|
|
8
|
+
/** Initial digits when uncontrolled. */
|
|
9
|
+
defaultValue?: string;
|
|
7
10
|
/** Called with the digits entered so far after every edit. */
|
|
8
|
-
|
|
11
|
+
onValueChange?: (value: string) => void;
|
|
9
12
|
/**
|
|
10
13
|
* Called with the code whenever an edit leaves every box filled — use it
|
|
11
14
|
* to auto-submit. Fires again if the user then changes a digit.
|
|
@@ -33,5 +36,4 @@ export interface CodeInputProps {
|
|
|
33
36
|
* Handles typing, paste, SMS autofill, Backspace/Delete and arrow keys; each
|
|
34
37
|
* box keeps its position, so clearing one never shifts the others.
|
|
35
38
|
*/
|
|
36
|
-
export declare function CodeInput({ value,
|
|
37
|
-
//# sourceMappingURL=CodeInput.d.ts.map
|
|
39
|
+
export declare function CodeInput({ value: valueProp, defaultValue, onValueChange, onComplete, length, error, invalid, disabled, autoFocus, name, "aria-label": ariaLabel, className, ref, ...rest }: CodeInputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { useControllableState as t } from "../../hooks/useControllableState.js";
|
|
3
|
+
import { applyBackspace as n, applyInput as r, applyText as i, toSlots as a } from "../../lib/codeInput.js";
|
|
4
|
+
import { useId as o, useRef as s, useState as c } from "react";
|
|
5
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/ui/CodeInput.tsx
|
|
7
|
+
function d({ value: d, defaultValue: f = "", onValueChange: p, onComplete: m, length: h = 6, error: g, invalid: _, disabled: v, autoFocus: y, name: b, "aria-label": x = "Verification code", className: S, ref: C, ...w }) {
|
|
8
|
+
let [T, E] = t({
|
|
9
|
+
value: d,
|
|
10
|
+
defaultValue: f,
|
|
11
|
+
onChange: p
|
|
12
|
+
}), D = s([]), O = o(), k = _ || !!g, [A, j] = c(() => {
|
|
13
|
+
let e = a(T, h);
|
|
14
|
+
return {
|
|
15
|
+
proposed: e,
|
|
16
|
+
shown: e
|
|
17
|
+
};
|
|
18
|
+
}), M = (e) => e.length === h && e.join("") === T, [N, P] = c({
|
|
19
|
+
value: T,
|
|
20
|
+
length: h
|
|
21
|
+
});
|
|
22
|
+
if ((N.value !== T || N.length !== h) && (P({
|
|
23
|
+
value: T,
|
|
24
|
+
length: h
|
|
25
|
+
}), !M(A.proposed) && !M(A.shown))) {
|
|
26
|
+
let e = a(T, h);
|
|
27
|
+
j({
|
|
28
|
+
proposed: e,
|
|
29
|
+
shown: e
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
let F = M(A.proposed) ? A.proposed : M(A.shown) ? A.shown : a(T, h);
|
|
33
|
+
function I(e) {
|
|
34
|
+
let t = D.current[Math.max(0, Math.min(e, h - 1))];
|
|
35
|
+
t?.focus(), t?.select();
|
|
36
|
+
}
|
|
37
|
+
function L(e) {
|
|
38
|
+
if (!e) return;
|
|
39
|
+
j({
|
|
40
|
+
proposed: e.slots,
|
|
41
|
+
shown: F
|
|
42
|
+
});
|
|
43
|
+
let t = e.slots.join("");
|
|
44
|
+
E(t), e.slots.every(Boolean) && m?.(t), I(e.focus);
|
|
45
|
+
}
|
|
46
|
+
function R(e, t) {
|
|
47
|
+
t.key === "Backspace" ? (t.preventDefault(), L(n(F, e))) : t.key === "ArrowLeft" ? (t.preventDefault(), I(e - 1)) : t.key === "ArrowRight" && (t.preventDefault(), I(e + 1));
|
|
48
|
+
}
|
|
49
|
+
return /* @__PURE__ */ u("div", {
|
|
50
|
+
ref: C,
|
|
51
|
+
...w,
|
|
52
|
+
className: e("flex flex-col gap-1.5", S),
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ l("div", {
|
|
55
|
+
role: "group",
|
|
56
|
+
"aria-label": x,
|
|
57
|
+
className: "flex justify-between gap-2",
|
|
58
|
+
children: F.map((t, n) => /* @__PURE__ */ l("input", {
|
|
59
|
+
ref: (e) => {
|
|
60
|
+
D.current[n] = e;
|
|
61
|
+
},
|
|
62
|
+
type: "text",
|
|
63
|
+
inputMode: "numeric",
|
|
64
|
+
autoComplete: n === 0 ? "one-time-code" : "off",
|
|
65
|
+
autoFocus: y && n === 0,
|
|
66
|
+
disabled: v,
|
|
67
|
+
"aria-label": `Digit ${n + 1} of ${h}`,
|
|
68
|
+
"aria-invalid": k || void 0,
|
|
69
|
+
"aria-describedby": g ? O : void 0,
|
|
70
|
+
value: t,
|
|
71
|
+
onFocus: (e) => e.target.select(),
|
|
72
|
+
onChange: (e) => L(r(F, n, e.target.value, e.target.selectionStart)),
|
|
73
|
+
onKeyDown: (e) => R(n, e),
|
|
74
|
+
onPaste: (e) => {
|
|
75
|
+
e.preventDefault(), L(i(F, n, e.clipboardData.getData("text")));
|
|
76
|
+
},
|
|
77
|
+
className: e("bg-bg-secondary text-text-primary h-10 w-10 rounded-md border text-center font-mono text-sm", "transition-colors duration-[100ms]", "focus:border-accent focus:outline-none", "disabled:cursor-not-allowed disabled:opacity-40", k ? "border-danger" : "border-border")
|
|
78
|
+
}, n))
|
|
79
|
+
}),
|
|
80
|
+
b && /* @__PURE__ */ l("input", {
|
|
81
|
+
type: "hidden",
|
|
82
|
+
name: b,
|
|
83
|
+
value: T,
|
|
84
|
+
disabled: v
|
|
85
|
+
}),
|
|
86
|
+
g && /* @__PURE__ */ l("p", {
|
|
87
|
+
id: O,
|
|
88
|
+
role: "alert",
|
|
89
|
+
className: "text-2xs text-danger-fg",
|
|
90
|
+
children: g
|
|
91
|
+
})
|
|
92
|
+
]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
export { d as CodeInput };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
2
|
import { type PopoverCloseReason, type PopoverOpenReason } from "../../hooks/usePopover";
|
|
3
3
|
import { type ControlSize } from "../../providers/ControlSizeContext";
|
|
4
4
|
export interface ComboboxOption {
|
|
5
|
-
/** Unique value returned to
|
|
5
|
+
/** Unique value returned to onValueChange when the option is chosen. */
|
|
6
6
|
value: string;
|
|
7
7
|
/** Text shown in the list and, once selected, on the trigger. */
|
|
8
8
|
label: string;
|
|
@@ -20,13 +20,15 @@ export interface ComboboxOption {
|
|
|
20
20
|
* `disabled` (the field was disabled while open).
|
|
21
21
|
*/
|
|
22
22
|
export type ComboboxOpenChangeReason = PopoverOpenReason | PopoverCloseReason;
|
|
23
|
-
export interface ComboboxProps<T extends ComboboxOption = ComboboxOption> {
|
|
23
|
+
export interface ComboboxProps<T extends ComboboxOption = ComboboxOption> extends Omit<ComponentPropsWithRef<"div">, "children" | "defaultValue" | "onChange" | "placeholder"> {
|
|
24
24
|
/** Options to choose from. Filtered by label against the search text unless filterOptions is false. */
|
|
25
25
|
options: T[];
|
|
26
26
|
/** Value of the selected option (controlled). */
|
|
27
|
-
value
|
|
27
|
+
value?: string;
|
|
28
|
+
/** Initially selected value when uncontrolled. */
|
|
29
|
+
defaultValue?: string;
|
|
28
30
|
/** Called with the value of the chosen option. */
|
|
29
|
-
|
|
31
|
+
onValueChange?: (value: string) => void;
|
|
30
32
|
/** Receives the complete result, including caller-owned metadata. */
|
|
31
33
|
onOptionChange?: (option: T) => void;
|
|
32
34
|
/** Text shown on the trigger when nothing is selected. Defaults to "Select...". */
|
|
@@ -83,5 +85,4 @@ export interface ComboboxProps<T extends ComboboxOption = ComboboxOption> {
|
|
|
83
85
|
*/
|
|
84
86
|
flip?: boolean;
|
|
85
87
|
}
|
|
86
|
-
export declare function Combobox<T extends ComboboxOption = ComboboxOption>({ options, value,
|
|
87
|
-
//# sourceMappingURL=Combobox.d.ts.map
|
|
88
|
+
export declare function Combobox<T extends ComboboxOption = ComboboxOption>({ options, value: valueProp, defaultValue, onValueChange, onOptionChange, placeholder, label, className, controlSize, id, name, disabled, "aria-label": ariaLabel, "aria-describedby": describedBy, "aria-invalid": invalid, query, onQueryChange, filterOptions, selectedOption, renderOption, loading, loadingMessage, error, onRetry, emptyMessage, footer, onOpenChange, flip, ref, onBlur, ...rest }: ComboboxProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { mergeRefs as t } from "../../lib/mergeRefs.js";
|
|
3
|
+
import { useControlSize as n } from "../../providers/ControlSizeContext.js";
|
|
4
|
+
import { useControllableState as r } from "../../hooks/useControllableState.js";
|
|
5
|
+
import { usePopover as i } from "../../hooks/usePopover.js";
|
|
6
|
+
import { useEffect as a, useId as ee, useMemo as te, useReducer as ne, useRef as o, useState as s } from "react";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
import { Check as re, ChevronDown as ie, Search as ae } from "lucide-react";
|
|
9
|
+
//#region src/components/ui/Combobox.tsx
|
|
10
|
+
function u({ options: u, value: oe, defaultValue: d = "", onValueChange: se, onOptionChange: ce, placeholder: f = "Select...", label: p, className: le, controlSize: ue, id: de, name: m, disabled: h, "aria-label": g, "aria-describedby": _, "aria-invalid": v, query: y, onQueryChange: fe, filterOptions: pe = !0, selectedOption: b, renderOption: x, loading: S = !1, loadingMessage: me = "Loading results…", error: C, onRetry: w, emptyMessage: he = "No results", footer: T, onOpenChange: ge, flip: _e = !0, ref: E, onBlur: ve, ...ye }) {
|
|
11
|
+
let D = n(ue), { open: O, show: be, close: k, rootRef: A, anchorRef: j, triggerRef: M, popupRef: N, labelId: P, triggerId: F, popupId: I } = i({
|
|
12
|
+
haspopup: "listbox",
|
|
13
|
+
matchWidth: !0,
|
|
14
|
+
disabled: h,
|
|
15
|
+
flip: _e,
|
|
16
|
+
onOpenChange: ge
|
|
17
|
+
}), [L, xe] = r({
|
|
18
|
+
value: oe,
|
|
19
|
+
defaultValue: d,
|
|
20
|
+
onChange: se
|
|
21
|
+
}), [Se, R] = s(""), [Ce, z] = s(0), [B, we] = s(() => u.find((e) => e.value === L)), V = o(null), H = o(!1), [, Te] = ne((e) => e + 1, 0);
|
|
22
|
+
function U() {
|
|
23
|
+
H.current = !0, Te();
|
|
24
|
+
}
|
|
25
|
+
let W = ee(), Ee = de ?? `${W}-search`, G = `${W}-selected`, K = y ?? Se, q = u.find((e) => e.value === L) ?? (b?.value === L ? b : void 0) ?? (B?.value === L ? B : void 0), J = pe ? u.filter((e) => e.label.toLowerCase().includes(K.toLowerCase())) : u, Y = Math.min(Ce, Math.max(J.length - 1, 0)), X = J[Y]?.disabled ? J.findIndex((e) => !e.disabled) : Y, Z = J[X];
|
|
26
|
+
function De(e) {
|
|
27
|
+
y === void 0 && R(e), fe?.(e), z(0), U();
|
|
28
|
+
let t = N.current?.ownerDocument.getElementById(I);
|
|
29
|
+
t && (t.scrollTop = 0);
|
|
30
|
+
}
|
|
31
|
+
function Q(e) {
|
|
32
|
+
e.disabled || (we(e), xe(e.value), ce?.(e), k("select"));
|
|
33
|
+
}
|
|
34
|
+
function Oe(e) {
|
|
35
|
+
if ([
|
|
36
|
+
"ArrowDown",
|
|
37
|
+
"ArrowUp",
|
|
38
|
+
"Home",
|
|
39
|
+
"End"
|
|
40
|
+
].includes(e.key)) {
|
|
41
|
+
e.preventDefault();
|
|
42
|
+
let t = e.key === "ArrowUp" || e.key === "End" ? -1 : 1, n = e.key === "Home" ? 0 : e.key === "End" ? J.length - 1 : X + t;
|
|
43
|
+
for (; n >= 0 && n < J.length && J[n].disabled;) n += t;
|
|
44
|
+
n >= 0 && n < J.length && (z(n), U());
|
|
45
|
+
} else e.key === "Enter" ? (e.preventDefault(), Z && Q(Z)) : e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), k("escape"));
|
|
46
|
+
}
|
|
47
|
+
function $(e) {
|
|
48
|
+
be(e), y === void 0 && R("");
|
|
49
|
+
let t = (y === void 0 ? u : J).findIndex((e) => e.value === L && !e.disabled);
|
|
50
|
+
z(Math.max(t, 0)), U(), setTimeout(() => V.current?.focus(), 0);
|
|
51
|
+
}
|
|
52
|
+
a(() => {
|
|
53
|
+
h && k("disabled");
|
|
54
|
+
}, [
|
|
55
|
+
h,
|
|
56
|
+
O,
|
|
57
|
+
k
|
|
58
|
+
]), a(() => {
|
|
59
|
+
if (!O || !H.current) return;
|
|
60
|
+
H.current = !1;
|
|
61
|
+
let e = N.current?.ownerDocument, t = e?.getElementById(I), n = e?.getElementById(`${I}-${X}`);
|
|
62
|
+
if (!t || !n) return;
|
|
63
|
+
let r = t.getBoundingClientRect(), i = n.getBoundingClientRect(), a = t.offsetHeight ? r.height / t.offsetHeight : 1;
|
|
64
|
+
i.top < r.top ? t.scrollTop -= (r.top - i.top) / a : i.bottom > r.bottom && (t.scrollTop += (i.bottom - r.bottom) / a);
|
|
65
|
+
});
|
|
66
|
+
let ke = te(() => t(A, E), [A, E]);
|
|
67
|
+
return /* @__PURE__ */ l("div", {
|
|
68
|
+
...ye,
|
|
69
|
+
className: e("flex flex-col gap-1.5", le),
|
|
70
|
+
ref: ke,
|
|
71
|
+
onBlur: (e) => {
|
|
72
|
+
ve?.(e), !e.defaultPrevented && O && !e.currentTarget.contains(e.relatedTarget) && k("blur");
|
|
73
|
+
},
|
|
74
|
+
children: [
|
|
75
|
+
p && /* @__PURE__ */ c("span", {
|
|
76
|
+
id: P,
|
|
77
|
+
className: "ui-field-label font-label text-xs font-medium",
|
|
78
|
+
children: p
|
|
79
|
+
}),
|
|
80
|
+
m && /* @__PURE__ */ c("input", {
|
|
81
|
+
type: "hidden",
|
|
82
|
+
name: m,
|
|
83
|
+
value: L,
|
|
84
|
+
disabled: h
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ l("div", {
|
|
87
|
+
className: "relative",
|
|
88
|
+
ref: j,
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ c("button", {
|
|
91
|
+
ref: M,
|
|
92
|
+
id: F,
|
|
93
|
+
"data-control-size": D,
|
|
94
|
+
type: "button",
|
|
95
|
+
disabled: h,
|
|
96
|
+
"aria-label": g ?? (p ? void 0 : f),
|
|
97
|
+
"aria-labelledby": p && !g ? `${P} ${G}` : void 0,
|
|
98
|
+
"aria-describedby": _,
|
|
99
|
+
"aria-invalid": v,
|
|
100
|
+
"aria-expanded": O,
|
|
101
|
+
"aria-haspopup": "listbox",
|
|
102
|
+
"aria-controls": O ? I : void 0,
|
|
103
|
+
onClick: () => O ? k("toggle") : $("toggle"),
|
|
104
|
+
onKeyDown: (e) => {
|
|
105
|
+
(e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), $("keyboard"));
|
|
106
|
+
},
|
|
107
|
+
className: e("ui-sized-control font-control flex h-7 w-full cursor-pointer items-center rounded-md px-2 pr-7 text-xs", "bg-bg-secondary border-border text-text-primary border", "hover:bg-bg-hover hover:border-border-strong", "transition-colors duration-[100ms] disabled:cursor-not-allowed disabled:opacity-40", "focus-visible:outline-accent focus-visible:outline-2 focus-visible:outline-offset-2"),
|
|
108
|
+
children: /* @__PURE__ */ c("span", {
|
|
109
|
+
id: G,
|
|
110
|
+
children: q ? q.label : /* @__PURE__ */ c("span", {
|
|
111
|
+
className: "text-text-placeholder",
|
|
112
|
+
children: L || f
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ c(ie, {
|
|
117
|
+
"aria-hidden": "true",
|
|
118
|
+
className: e("text-text-tertiary pointer-events-none absolute top-1/2 right-2.5 h-3.5 w-3.5 -translate-y-1/2 transition-transform", O && "rotate-180")
|
|
119
|
+
}),
|
|
120
|
+
O && /* @__PURE__ */ l("div", {
|
|
121
|
+
ref: N,
|
|
122
|
+
className: e("ui-glass ui-glass-popover bg-bg-tertiary border-border-strong animate-scale-in fixed top-0 left-0 z-[100] rounded-md border shadow-lg", "flex flex-col overflow-hidden"),
|
|
123
|
+
onMouseDown: (e) => {
|
|
124
|
+
e.target.closest("input, textarea, select, [contenteditable]") || e.preventDefault();
|
|
125
|
+
},
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ c("div", {
|
|
128
|
+
className: "border-border shrink-0 border-b p-1.5",
|
|
129
|
+
children: /* @__PURE__ */ l("div", {
|
|
130
|
+
className: "relative",
|
|
131
|
+
children: [/* @__PURE__ */ c(ae, {
|
|
132
|
+
"aria-hidden": "true",
|
|
133
|
+
className: "text-text-tertiary absolute top-1/2 left-2 h-3 w-3 -translate-y-1/2"
|
|
134
|
+
}), /* @__PURE__ */ c("input", {
|
|
135
|
+
ref: V,
|
|
136
|
+
"data-control-size": D,
|
|
137
|
+
"data-has-icon": "true",
|
|
138
|
+
id: Ee,
|
|
139
|
+
type: "text",
|
|
140
|
+
role: "combobox",
|
|
141
|
+
"aria-label": g ?? (p ? `Search ${p}` : "Search options"),
|
|
142
|
+
"aria-expanded": "true",
|
|
143
|
+
"aria-controls": I,
|
|
144
|
+
"aria-activedescendant": Z && !Z.disabled ? `${I}-${X}` : void 0,
|
|
145
|
+
"aria-autocomplete": "list",
|
|
146
|
+
"aria-describedby": _,
|
|
147
|
+
"aria-invalid": v,
|
|
148
|
+
value: K,
|
|
149
|
+
onChange: (e) => De(e.target.value),
|
|
150
|
+
onKeyDown: Oe,
|
|
151
|
+
placeholder: "Search...",
|
|
152
|
+
className: "ui-sized-control bg-bg-secondary text-text-primary border-border placeholder:text-text-placeholder focus:border-accent font-control h-7 w-full rounded border pr-2 pl-7 text-xs focus:outline-none"
|
|
153
|
+
})]
|
|
154
|
+
})
|
|
155
|
+
}),
|
|
156
|
+
S && /* @__PURE__ */ c("div", {
|
|
157
|
+
role: "status",
|
|
158
|
+
className: "text-text-tertiary shrink-0 px-3 py-2 text-xs",
|
|
159
|
+
children: me
|
|
160
|
+
}),
|
|
161
|
+
C && /* @__PURE__ */ l("div", {
|
|
162
|
+
role: "alert",
|
|
163
|
+
className: "text-text-secondary shrink-0 px-3 py-2 text-xs",
|
|
164
|
+
children: [C, w && /* @__PURE__ */ c("button", {
|
|
165
|
+
type: "button",
|
|
166
|
+
onClick: w,
|
|
167
|
+
className: "text-accent-fg ml-2",
|
|
168
|
+
children: "Retry"
|
|
169
|
+
})]
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ c("ul", {
|
|
172
|
+
id: I,
|
|
173
|
+
className: "max-h-48 min-h-0 overflow-y-auto py-1",
|
|
174
|
+
role: "listbox",
|
|
175
|
+
"aria-label": p ?? g ?? "Options",
|
|
176
|
+
"aria-busy": S,
|
|
177
|
+
children: J.map((t, n) => /* @__PURE__ */ l("li", {
|
|
178
|
+
id: `${I}-${n}`,
|
|
179
|
+
role: "option",
|
|
180
|
+
"aria-selected": t.value === L,
|
|
181
|
+
"aria-disabled": t.disabled || void 0,
|
|
182
|
+
onClick: () => Q(t),
|
|
183
|
+
onMouseEnter: () => {
|
|
184
|
+
t.disabled || z(n);
|
|
185
|
+
},
|
|
186
|
+
className: e("font-control flex w-full items-center gap-2 px-3 py-1.5 text-xs", "transition-colors duration-[100ms]", t.disabled ? "text-text-disabled cursor-not-allowed" : "cursor-pointer", !t.disabled && (n === X ? "bg-accent-muted text-accent-fg" : t.value === L ? "text-accent-fg" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover")),
|
|
187
|
+
children: [/* @__PURE__ */ c("span", {
|
|
188
|
+
className: "flex-1",
|
|
189
|
+
children: x ? x(t) : t.label
|
|
190
|
+
}), t.value === L && /* @__PURE__ */ c(re, {
|
|
191
|
+
"aria-hidden": "true",
|
|
192
|
+
className: "h-3 w-3 shrink-0"
|
|
193
|
+
})]
|
|
194
|
+
}, t.value))
|
|
195
|
+
}),
|
|
196
|
+
J.length === 0 && !S && !C && /* @__PURE__ */ c("div", {
|
|
197
|
+
role: "status",
|
|
198
|
+
className: "text-text-tertiary shrink-0 px-3 py-2 text-center text-xs",
|
|
199
|
+
children: he
|
|
200
|
+
}),
|
|
201
|
+
T && /* @__PURE__ */ c("div", {
|
|
202
|
+
className: "border-border shrink-0 border-t p-1.5",
|
|
203
|
+
children: T
|
|
204
|
+
})
|
|
205
|
+
]
|
|
206
|
+
})
|
|
207
|
+
]
|
|
208
|
+
})
|
|
209
|
+
]
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
//#endregion
|
|
213
|
+
export { u as Combobox };
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { type ButtonProps } from "./Button";
|
|
2
2
|
export interface CopyButtonProps extends Omit<ButtonProps, "children" | "icon" | "hideLabel" | "onClick" | "onCopy" | "value"> {
|
|
3
|
+
/** Text to copy or a function evaluated when the button is pressed. */
|
|
3
4
|
value: string | (() => string);
|
|
5
|
+
/** Visible label, or accessible name and tooltip in icon-only mode. */
|
|
4
6
|
label?: string;
|
|
7
|
+
/** Temporary success label. */
|
|
5
8
|
copiedLabel?: string;
|
|
9
|
+
/** Show the icon without visible text. */
|
|
6
10
|
iconOnly?: boolean;
|
|
11
|
+
/** Called with true on success or false on failure. */
|
|
7
12
|
onCopy?: (ok: boolean) => void;
|
|
8
13
|
}
|
|
9
|
-
export declare function CopyButton({ value, label, copiedLabel, iconOnly, onCopy, variant, ...props }: CopyButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
//# sourceMappingURL=CopyButton.d.ts.map
|
|
14
|
+
export declare function CopyButton({ value, label, copiedLabel, iconOnly, onCopy, variant, ref, ...props }: CopyButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Button as e } from "./Button.js";
|
|
2
|
+
import { useEffect as t, useRef as n, useState as r } from "react";
|
|
3
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
|
+
import { Check as s, Copy as c } from "lucide-react";
|
|
5
|
+
//#region src/components/ui/CopyButton.tsx
|
|
6
|
+
function l(e) {
|
|
7
|
+
let t = document.activeElement, n = document.createElement("textarea");
|
|
8
|
+
n.value = e, n.setAttribute("readonly", ""), n.style.position = "fixed", n.style.opacity = "0", document.body.appendChild(n);
|
|
9
|
+
try {
|
|
10
|
+
return n.focus(), n.select(), document.execCommand("copy");
|
|
11
|
+
} catch {
|
|
12
|
+
return !1;
|
|
13
|
+
} finally {
|
|
14
|
+
n.remove(), t instanceof HTMLElement && t.focus();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
async function u(e) {
|
|
18
|
+
if (navigator.clipboard?.writeText) try {
|
|
19
|
+
return await navigator.clipboard.writeText(e), !0;
|
|
20
|
+
} catch {}
|
|
21
|
+
return l(e);
|
|
22
|
+
}
|
|
23
|
+
function d({ value: l, label: d = "Copy", copiedLabel: f = "Copied", iconOnly: p = !1, onCopy: m, variant: h, ref: g, ..._ }) {
|
|
24
|
+
let [v, y] = r(null), [b, x] = r(""), S = n(null), C = n(null);
|
|
25
|
+
t(() => () => {
|
|
26
|
+
C.current !== null && clearTimeout(C.current), S.current !== null && clearTimeout(S.current);
|
|
27
|
+
}, []);
|
|
28
|
+
async function w() {
|
|
29
|
+
let e = !1;
|
|
30
|
+
try {
|
|
31
|
+
e = await u(typeof l == "function" ? l() : l);
|
|
32
|
+
} catch {}
|
|
33
|
+
C.current !== null && clearTimeout(C.current), y(e ? "copied" : "failed"), x(""), S.current !== null && clearTimeout(S.current), S.current = setTimeout(() => {
|
|
34
|
+
x(e ? f : "Copy failed"), S.current = null;
|
|
35
|
+
}, 50), C.current = setTimeout(() => {
|
|
36
|
+
y(null), x(""), C.current = null;
|
|
37
|
+
}, 2e3), m?.(e);
|
|
38
|
+
}
|
|
39
|
+
let T = v === "copied" ? f : v === "failed" ? "Copy failed" : d;
|
|
40
|
+
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(e, {
|
|
41
|
+
..._,
|
|
42
|
+
ref: g,
|
|
43
|
+
variant: h ?? (p ? "icon" : "secondary"),
|
|
44
|
+
icon: v === "copied" ? s : c,
|
|
45
|
+
"aria-label": p ? T : _["aria-label"],
|
|
46
|
+
title: p ? T : _.title,
|
|
47
|
+
onClick: w,
|
|
48
|
+
children: p ? void 0 : T
|
|
49
|
+
}), /* @__PURE__ */ a("span", {
|
|
50
|
+
className: "sr-only",
|
|
51
|
+
role: "status",
|
|
52
|
+
"aria-live": "polite",
|
|
53
|
+
children: b
|
|
54
|
+
})] });
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { d as CopyButton };
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
* </DangerZone>
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
import type { ReactNode } from "react";
|
|
21
|
-
interface DangerZoneProps {
|
|
20
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
21
|
+
export interface DangerZoneProps extends Omit<ComponentPropsWithRef<"div">, "title" | "children"> {
|
|
22
22
|
/**
|
|
23
23
|
* Section heading.
|
|
24
24
|
* Defaults to "Danger Zone" — the universal convention for destructive
|
|
@@ -35,6 +35,4 @@ interface DangerZoneProps {
|
|
|
35
35
|
/** Additional utility classes for the root container. */
|
|
36
36
|
className?: string;
|
|
37
37
|
}
|
|
38
|
-
export declare function DangerZone({ title, description, children, className, }: DangerZoneProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
-
export {};
|
|
40
|
-
//# sourceMappingURL=DangerZone.d.ts.map
|
|
38
|
+
export declare function DangerZone({ title, description, children, className, ref, ...rest }: DangerZoneProps): import("react/jsx-runtime").JSX.Element;
|