@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,58 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { useControlSize as t } from "../../providers/ControlSizeContext.js";
|
|
3
|
+
import { useControllableState as n } from "../../hooks/useControllableState.js";
|
|
4
|
+
import { FieldContext as r, describeField as i } from "./FieldContext.js";
|
|
5
|
+
import { Fieldset as a } from "./Fieldset.js";
|
|
6
|
+
import { useContext as o, useId as s } from "react";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/ui/Radio.tsx
|
|
9
|
+
function u({ label: n, description: a, controlSize: u, className: d, id: f, "aria-describedby": p, "aria-invalid": m, ref: h, ...g }) {
|
|
10
|
+
let _ = s(), v = t(u), y = o(r), b = f ?? y?.id ?? _, x = a ? `${b}-description` : void 0;
|
|
11
|
+
return /* @__PURE__ */ l("label", {
|
|
12
|
+
className: e("ui-choice flex items-start gap-2.5", d),
|
|
13
|
+
"data-control-size": v,
|
|
14
|
+
children: [/* @__PURE__ */ c("input", {
|
|
15
|
+
...g,
|
|
16
|
+
ref: h,
|
|
17
|
+
id: b,
|
|
18
|
+
type: "radio",
|
|
19
|
+
"aria-invalid": m ?? (y?.invalid || void 0),
|
|
20
|
+
"aria-describedby": i(p, y?.describedBy, x),
|
|
21
|
+
className: "ui-native-choice"
|
|
22
|
+
}), /* @__PURE__ */ l("span", {
|
|
23
|
+
className: "text-text-primary text-xs",
|
|
24
|
+
children: [/* @__PURE__ */ c("span", { children: n }), a && /* @__PURE__ */ c("span", {
|
|
25
|
+
id: x,
|
|
26
|
+
className: "text-text-secondary block text-xs",
|
|
27
|
+
children: a
|
|
28
|
+
})]
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function d({ name: e, id: t, options: r, value: i, defaultValue: o, onValueChange: l, required: d, disabled: f, controlSize: p, ...m }) {
|
|
33
|
+
let h = s(), g = t ?? h, [_, v] = n({
|
|
34
|
+
value: i,
|
|
35
|
+
defaultValue: o,
|
|
36
|
+
onChange: (e) => l?.(e)
|
|
37
|
+
});
|
|
38
|
+
return /* @__PURE__ */ c(a, {
|
|
39
|
+
...m,
|
|
40
|
+
id: g,
|
|
41
|
+
disabled: f,
|
|
42
|
+
children: r.map((t, n) => /* @__PURE__ */ c(u, {
|
|
43
|
+
id: `${g}-${n}`,
|
|
44
|
+
name: e ?? g,
|
|
45
|
+
value: t.value,
|
|
46
|
+
checked: _ === t.value,
|
|
47
|
+
onChange: () => v(t.value),
|
|
48
|
+
label: t.label,
|
|
49
|
+
description: t.description,
|
|
50
|
+
disabled: f || t.disabled,
|
|
51
|
+
required: d,
|
|
52
|
+
controlSize: p
|
|
53
|
+
}, t.value))
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
var f = /*#__PURE__*/ Object.assign(u, { Group: d });
|
|
57
|
+
//#endregion
|
|
58
|
+
export { f as Radio };
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
export interface RadioPillProps<T extends string> extends Omit<ComponentPropsWithRef<"div">, "defaultValue" | "children" | "onChange"> {
|
|
3
|
+
/** The segments to render, in order. Disabled segments are skipped by keyboard navigation. */
|
|
3
4
|
options: {
|
|
4
5
|
value: T;
|
|
5
6
|
label: string;
|
|
7
|
+
disabled?: boolean;
|
|
6
8
|
}[];
|
|
7
9
|
/** Value of the currently selected option. */
|
|
8
|
-
value
|
|
9
|
-
/**
|
|
10
|
-
|
|
10
|
+
value?: T;
|
|
11
|
+
/** Initially selected value when uncontrolled. */
|
|
12
|
+
defaultValue?: T;
|
|
13
|
+
/** Called with the option's value when a segment is selected. */
|
|
14
|
+
onValueChange?: (value: T) => void;
|
|
11
15
|
/** Disables all segments and dims the control. */
|
|
12
16
|
disabled?: boolean;
|
|
13
17
|
/** Additional utility classes appended to the radiogroup. */
|
|
@@ -15,6 +19,4 @@ interface RadioPillProps<T extends string> {
|
|
|
15
19
|
/** Accessible name for the radiogroup. */
|
|
16
20
|
"aria-label"?: string;
|
|
17
21
|
}
|
|
18
|
-
export declare function RadioPill<T extends string>({ options, value,
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=RadioPill.d.ts.map
|
|
22
|
+
export declare function RadioPill<T extends string>({ options, value: valueProp, defaultValue, onValueChange, disabled, className, "aria-label": ariaLabel, ref, ...rest }: RadioPillProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { useControllableState as t } from "../../hooks/useControllableState.js";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ui/RadioPill.tsx
|
|
5
|
+
function r({ options: r, value: i, defaultValue: a, onValueChange: o, disabled: s, className: c, "aria-label": l, ref: u, ...d }) {
|
|
6
|
+
let [f, p] = t({
|
|
7
|
+
value: i,
|
|
8
|
+
defaultValue: a,
|
|
9
|
+
onChange: (e) => o?.(e)
|
|
10
|
+
}), m = s ? [] : r.filter((e) => !e.disabled), h = m.find((e) => e.value === f) ?? m[0];
|
|
11
|
+
function g(e, t) {
|
|
12
|
+
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return;
|
|
13
|
+
let n;
|
|
14
|
+
switch (e.key) {
|
|
15
|
+
case "ArrowRight":
|
|
16
|
+
case "ArrowDown":
|
|
17
|
+
n = 1;
|
|
18
|
+
break;
|
|
19
|
+
case "ArrowLeft":
|
|
20
|
+
case "ArrowUp":
|
|
21
|
+
n = -1;
|
|
22
|
+
break;
|
|
23
|
+
default: return;
|
|
24
|
+
}
|
|
25
|
+
let r = m.findIndex((e) => e.value === t);
|
|
26
|
+
if (r < 0) return;
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
let i = (r + n + m.length) % m.length;
|
|
29
|
+
(e.currentTarget.parentElement?.querySelectorAll("[role=\"radio\"]:enabled"))?.[i]?.focus();
|
|
30
|
+
let a = m[i].value;
|
|
31
|
+
a !== f && p(a);
|
|
32
|
+
}
|
|
33
|
+
return /* @__PURE__ */ n("div", {
|
|
34
|
+
ref: u,
|
|
35
|
+
...d,
|
|
36
|
+
role: "radiogroup",
|
|
37
|
+
"aria-label": l,
|
|
38
|
+
className: e("border-border inline-flex overflow-hidden rounded-md border", s && "cursor-not-allowed opacity-40", c),
|
|
39
|
+
children: r.map((t) => /* @__PURE__ */ n("button", {
|
|
40
|
+
type: "button",
|
|
41
|
+
role: "radio",
|
|
42
|
+
"aria-checked": t.value === f,
|
|
43
|
+
tabIndex: t === h ? 0 : -1,
|
|
44
|
+
disabled: s || t.disabled,
|
|
45
|
+
onKeyDown: (e) => g(e, t.value),
|
|
46
|
+
onClick: () => p(t.value),
|
|
47
|
+
className: e("font-control px-3 py-1.5 text-xs font-medium transition-colors duration-[100ms]", "focus-visible:outline-accent focus-visible:outline-2 focus-visible:outline-offset-[-2px]", t.disabled && !s && "cursor-not-allowed opacity-40", !s && !t.disabled && "cursor-pointer", t.value === f ? "bg-accent text-text-on-accent" : "bg-bg-secondary text-text-secondary hover:bg-bg-hover hover:text-text-primary"),
|
|
48
|
+
children: t.label
|
|
49
|
+
}, t.value))
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { r as RadioPill };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Key, type ReactNode } from "react";
|
|
2
|
-
export interface ReorderListProps<T> {
|
|
1
|
+
import { type ComponentPropsWithRef, type Key, type ReactNode } from "react";
|
|
2
|
+
export interface ReorderListProps<T> extends Omit<ComponentPropsWithRef<"div">, "children" | "onChange"> {
|
|
3
3
|
items: T[];
|
|
4
4
|
/** Unique, stable identity; never use the item's current index. */
|
|
5
5
|
getKey: (item: T) => Key;
|
|
@@ -17,5 +17,4 @@ export interface ReorderListProps<T> {
|
|
|
17
17
|
/** Disable list actions; caller-owned content and add controls manage their own disabled state. */
|
|
18
18
|
disabled?: boolean;
|
|
19
19
|
}
|
|
20
|
-
export declare function ReorderList<T>({ items, getKey, renderItem, onReorder, onRemove, canRemove, getItemLabel, addButton, disabled, }: ReorderListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
//# sourceMappingURL=ReorderList.d.ts.map
|
|
20
|
+
export declare function ReorderList<T>({ items, getKey, renderItem, onReorder, onRemove, canRemove, getItemLabel, addButton, disabled, className, ref, ...rest }: ReorderListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { Button as t } from "./Button.js";
|
|
3
|
+
import { useLayoutEffect as n, useRef as r, useState as i } from "react";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
import { ArrowDown as s, ArrowUp as c, Trash2 as l } from "lucide-react";
|
|
6
|
+
//#region src/components/ui/ReorderList.tsx
|
|
7
|
+
function u({ items: u, getKey: d, renderItem: f, onReorder: p, onRemove: m, canRemove: h, getItemLabel: g, addButton: _, disabled: v = !1, className: y, ref: b, ...x }) {
|
|
8
|
+
let [S, C] = i(""), w = r(/* @__PURE__ */ new Map()), T = r(null), E = r(null);
|
|
9
|
+
n(() => {
|
|
10
|
+
let e = T.current;
|
|
11
|
+
e && u[e.index] !== void 0 && d(u[e.index]) === e.key && (w.current.get(e.key)?.[e.direction]?.focus(), T.current = null);
|
|
12
|
+
let t = E.current;
|
|
13
|
+
if (!t || u.some((e) => d(e) === t.key)) return;
|
|
14
|
+
let n = u[Math.min(t.index, u.length - 1)];
|
|
15
|
+
if (n !== void 0) {
|
|
16
|
+
let e = w.current.get(d(n));
|
|
17
|
+
(e?.remove ?? e?.down ?? e?.up)?.focus();
|
|
18
|
+
}
|
|
19
|
+
E.current = null;
|
|
20
|
+
}, [u, d]);
|
|
21
|
+
function D(e, t) {
|
|
22
|
+
let n = e + t;
|
|
23
|
+
if (v || n < 0 || n >= u.length) return;
|
|
24
|
+
let r = [...u];
|
|
25
|
+
[r[e], r[n]] = [r[n], r[e]], T.current = {
|
|
26
|
+
key: d(u[e]),
|
|
27
|
+
index: n,
|
|
28
|
+
direction: t === -1 ? "up" : "down"
|
|
29
|
+
}, p(r), C(`${g(u[e])} moved to position ${n + 1} of ${u.length}`);
|
|
30
|
+
}
|
|
31
|
+
return /* @__PURE__ */ o("div", {
|
|
32
|
+
ref: b,
|
|
33
|
+
...x,
|
|
34
|
+
className: e("space-y-3", y),
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ a("ol", {
|
|
37
|
+
role: "list",
|
|
38
|
+
className: "space-y-3",
|
|
39
|
+
children: u.map((n, r) => {
|
|
40
|
+
let i = d(n), p = g(n);
|
|
41
|
+
return /* @__PURE__ */ o("li", {
|
|
42
|
+
className: "border-border space-y-3 rounded-md border p-3",
|
|
43
|
+
children: [/* @__PURE__ */ o("div", {
|
|
44
|
+
className: "flex items-center justify-end gap-1.5",
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ a(t, {
|
|
47
|
+
ref: (e) => {
|
|
48
|
+
let t = w.current.get(i) ?? {
|
|
49
|
+
up: null,
|
|
50
|
+
down: null,
|
|
51
|
+
remove: null
|
|
52
|
+
};
|
|
53
|
+
t.up = e, t.up || t.down || t.remove ? w.current.set(i, t) : w.current.delete(i);
|
|
54
|
+
},
|
|
55
|
+
variant: "ghost",
|
|
56
|
+
size: "sm",
|
|
57
|
+
icon: c,
|
|
58
|
+
"aria-label": `Move ${p} up`,
|
|
59
|
+
disabled: v,
|
|
60
|
+
"aria-disabled": r === 0 || v,
|
|
61
|
+
className: e(r === 0 && "cursor-not-allowed opacity-40"),
|
|
62
|
+
onClick: () => D(r, -1),
|
|
63
|
+
children: "Up"
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ a(t, {
|
|
66
|
+
ref: (e) => {
|
|
67
|
+
let t = w.current.get(i) ?? {
|
|
68
|
+
up: null,
|
|
69
|
+
down: null,
|
|
70
|
+
remove: null
|
|
71
|
+
};
|
|
72
|
+
t.down = e, t.up || t.down || t.remove ? w.current.set(i, t) : w.current.delete(i);
|
|
73
|
+
},
|
|
74
|
+
variant: "ghost",
|
|
75
|
+
size: "sm",
|
|
76
|
+
icon: s,
|
|
77
|
+
"aria-label": `Move ${p} down`,
|
|
78
|
+
disabled: v,
|
|
79
|
+
"aria-disabled": r === u.length - 1 || v,
|
|
80
|
+
className: e(r === u.length - 1 && "cursor-not-allowed opacity-40"),
|
|
81
|
+
onClick: () => D(r, 1),
|
|
82
|
+
children: "Down"
|
|
83
|
+
}),
|
|
84
|
+
m && (h?.(n, r) ?? !0) && /* @__PURE__ */ a(t, {
|
|
85
|
+
ref: (e) => {
|
|
86
|
+
let t = w.current.get(i) ?? {
|
|
87
|
+
up: null,
|
|
88
|
+
down: null,
|
|
89
|
+
remove: null
|
|
90
|
+
};
|
|
91
|
+
t.remove = e, t.up || t.down || t.remove ? w.current.set(i, t) : w.current.delete(i);
|
|
92
|
+
},
|
|
93
|
+
variant: "ghost",
|
|
94
|
+
size: "sm",
|
|
95
|
+
icon: l,
|
|
96
|
+
"aria-label": `Remove ${p}`,
|
|
97
|
+
disabled: v,
|
|
98
|
+
onClick: () => {
|
|
99
|
+
E.current = {
|
|
100
|
+
key: i,
|
|
101
|
+
index: r
|
|
102
|
+
}, m(n, r), C(`${p} removed`);
|
|
103
|
+
},
|
|
104
|
+
children: "Remove"
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
}), f(n, r)]
|
|
108
|
+
}, i);
|
|
109
|
+
})
|
|
110
|
+
}),
|
|
111
|
+
/* @__PURE__ */ a("div", {
|
|
112
|
+
role: "status",
|
|
113
|
+
"aria-live": "polite",
|
|
114
|
+
"aria-atomic": "true",
|
|
115
|
+
className: "sr-only",
|
|
116
|
+
children: S
|
|
117
|
+
}),
|
|
118
|
+
_
|
|
119
|
+
]
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
export { u as ReorderList };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
2
|
import { type LucideIcon } from "lucide-react";
|
|
3
|
-
export interface SearchInputProps extends Omit<
|
|
3
|
+
export interface SearchInputProps extends Omit<ComponentPropsWithRef<"input">, "value" | "defaultValue" | "type" | "children" | "dangerouslySetInnerHTML"> {
|
|
4
4
|
/** Current search text (controlled). */
|
|
5
|
-
value
|
|
5
|
+
value?: string;
|
|
6
|
+
/** Initial text when uncontrolled. */
|
|
7
|
+
defaultValue?: string;
|
|
6
8
|
/** Called with the new text on every change. */
|
|
7
|
-
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
8
10
|
/** Placeholder text. Defaults to "Search...". */
|
|
9
11
|
placeholder?: string;
|
|
10
12
|
/** Additional utility classes appended to the wrapper. */
|
|
@@ -18,5 +20,4 @@ export interface SearchInputProps extends Omit<InputHTMLAttributes<HTMLInputElem
|
|
|
18
20
|
/** Message shown below the input while invalid. */
|
|
19
21
|
errorMessage?: ReactNode;
|
|
20
22
|
}
|
|
21
|
-
export declare function SearchInput({ value, onChange, placeholder, className, inputClassName, icon: Icon, invalid, errorMessage, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedBy, ...inputProps }: SearchInputProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
//# sourceMappingURL=SearchInput.d.ts.map
|
|
23
|
+
export declare function SearchInput({ value: valueProp, defaultValue, onValueChange, onChange, placeholder, className, inputClassName, icon: Icon, invalid, errorMessage, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedBy, ref, ...inputProps }: SearchInputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { useControllableState as t } from "../../hooks/useControllableState.js";
|
|
3
|
+
import { describeField as n } from "./FieldContext.js";
|
|
4
|
+
import { useId as r } from "react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { AlertTriangle as o, Search as s } from "lucide-react";
|
|
7
|
+
//#region src/components/ui/SearchInput.tsx
|
|
8
|
+
function c({ value: c, defaultValue: l = "", onValueChange: u, onChange: d, placeholder: f = "Search...", className: p, inputClassName: m, icon: h = s, invalid: g = !1, errorMessage: _, "aria-invalid": v, "aria-describedby": y, ref: b, ...x }) {
|
|
9
|
+
let [S, C] = t({
|
|
10
|
+
value: c,
|
|
11
|
+
defaultValue: l,
|
|
12
|
+
onChange: u
|
|
13
|
+
}), w = `${r()}-error`, T = g || v != null && v !== !1 && v !== "false", E = T && _ != null && typeof _ != "boolean" && _ !== "";
|
|
14
|
+
return /* @__PURE__ */ a("div", {
|
|
15
|
+
className: e("flex flex-col gap-1.5", p),
|
|
16
|
+
children: [/* @__PURE__ */ a("div", {
|
|
17
|
+
className: "relative",
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ i(h, {
|
|
20
|
+
"aria-hidden": "true",
|
|
21
|
+
className: "text-text-tertiary pointer-events-none absolute top-1/2 left-2 h-3.5 w-3.5 -translate-y-1/2"
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ i("input", {
|
|
24
|
+
...x,
|
|
25
|
+
ref: b,
|
|
26
|
+
type: "search",
|
|
27
|
+
value: S,
|
|
28
|
+
onChange: (e) => {
|
|
29
|
+
d?.(e), C(e.target.value);
|
|
30
|
+
},
|
|
31
|
+
placeholder: f,
|
|
32
|
+
"aria-invalid": g ? !0 : v,
|
|
33
|
+
"aria-describedby": n(y, E ? w : void 0),
|
|
34
|
+
className: e("bg-bg-secondary text-text-primary h-7 w-full pl-7 text-xs", !T && "pr-2", "border-border rounded-md border", "placeholder:text-text-placeholder", "transition-colors duration-[100ms]", "focus:outline-none", T ? "border-danger focus:border-danger" : "focus:border-accent", T && "search-input-invalid", m)
|
|
35
|
+
}),
|
|
36
|
+
T && /* @__PURE__ */ i(o, {
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
className: "search-input-warning text-danger pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-y-1/2"
|
|
39
|
+
})
|
|
40
|
+
]
|
|
41
|
+
}), E && /* @__PURE__ */ i("p", {
|
|
42
|
+
id: w,
|
|
43
|
+
className: "text-2xs text-danger-fg",
|
|
44
|
+
children: _
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { c as SearchInput };
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* <SectionHeader as="h3" className="mb-4">Settings</SectionHeader>
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
import type { ElementType, ReactNode } from "react";
|
|
19
|
-
interface SectionHeaderProps {
|
|
18
|
+
import type { ComponentPropsWithRef, ElementType, ReactNode } from "react";
|
|
19
|
+
export interface SectionHeaderProps extends Omit<ComponentPropsWithRef<"h2">, "children"> {
|
|
20
20
|
/** The heading text or content. */
|
|
21
21
|
children: ReactNode;
|
|
22
22
|
/**
|
|
@@ -30,6 +30,4 @@ interface SectionHeaderProps {
|
|
|
30
30
|
/** Render the dividing bottom border. Defaults to true. */
|
|
31
31
|
border?: boolean;
|
|
32
32
|
}
|
|
33
|
-
export declare function SectionHeader({ children, as: Tag, className, border, }: SectionHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
-
export {};
|
|
35
|
-
//# sourceMappingURL=SectionHeader.d.ts.map
|
|
33
|
+
export declare function SectionHeader({ children, as: Tag, className, border, ref, ...rest }: SectionHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/ui/SectionHeader.tsx
|
|
4
|
+
function n({ children: n, as: r = "h2", className: i, border: a = !0, ref: o, ...s }) {
|
|
5
|
+
return /* @__PURE__ */ t(r, {
|
|
6
|
+
ref: o,
|
|
7
|
+
...s,
|
|
8
|
+
className: e("text-text-primary font-heading text-xs font-semibold", a && "border-border border-b pb-2", i),
|
|
9
|
+
children: n
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { n as SectionHeader };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
2
|
import { type ControlSize } from "../../providers/ControlSizeContext";
|
|
3
3
|
export interface SelectOption {
|
|
4
4
|
value: string;
|
|
@@ -11,12 +11,12 @@ export interface SelectOptionGroup {
|
|
|
11
11
|
/** Groups contain leaf options; nested groups are not supported. */
|
|
12
12
|
options: SelectOption[];
|
|
13
13
|
}
|
|
14
|
-
interface SelectProps extends Omit<
|
|
14
|
+
export interface SelectProps extends Omit<ComponentPropsWithRef<"select">, "value"> {
|
|
15
15
|
/** Label text rendered above the select and linked to it. */
|
|
16
16
|
label?: string;
|
|
17
17
|
/** Render the label inside an empty single-select control. Listboxes retain the above label. */
|
|
18
18
|
labelPlacement?: "above" | "placeholder";
|
|
19
|
-
value?:
|
|
19
|
+
value?: ComponentPropsWithRef<"select">["value"] | null;
|
|
20
20
|
/** Error message shown next to the label; also marks the select invalid and turns the border red. */
|
|
21
21
|
error?: string;
|
|
22
22
|
/** Helper text shown above the select and linked via `aria-describedby`. */
|
|
@@ -26,6 +26,4 @@ interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "val
|
|
|
26
26
|
/** Leaf choices and labelled groups, rendered as native options and optgroups. */
|
|
27
27
|
options: (SelectOption | SelectOptionGroup)[];
|
|
28
28
|
}
|
|
29
|
-
export declare
|
|
30
|
-
export {};
|
|
31
|
-
//# sourceMappingURL=Select.d.ts.map
|
|
29
|
+
export declare function Select({ label, labelPlacement, error, options, className, id, hint, controlSize, required, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ref, ...props }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { useControlSize as t } from "../../providers/ControlSizeContext.js";
|
|
3
|
+
import { useFieldControl as n } from "./useFieldControl.js";
|
|
4
|
+
import { useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
|
|
5
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
|
+
import { ChevronDown as l } from "lucide-react";
|
|
7
|
+
//#region src/components/ui/Select.tsx
|
|
8
|
+
function u({ label: u, labelPlacement: d = "above", error: f, options: p, className: m, id: h, hint: g, controlSize: _, required: v, "aria-describedby": y, "aria-invalid": b, ref: x, ...S }) {
|
|
9
|
+
let C = n({
|
|
10
|
+
id: h,
|
|
11
|
+
error: f,
|
|
12
|
+
hint: g,
|
|
13
|
+
describedBy: y,
|
|
14
|
+
invalid: b,
|
|
15
|
+
required: v
|
|
16
|
+
}), { inputId: w, errorId: T, hintId: E } = C, D = t(_), O = a(null), k = r((e) => {
|
|
17
|
+
if (O.current = e, typeof x == "function") return x(e);
|
|
18
|
+
x && (x.current = e);
|
|
19
|
+
}, [x]), A = d === "placeholder" && u ? u : u ? void 0 : C.placeholderLabel, j = !!A && !S.multiple && (!S.size || S.size <= 1), M = S.value !== void 0, [N, P] = o(S.value ?? S.defaultValue ?? ""), F = M ? S.value ?? "" : N, I = j && F === "", L = p.some((e) => !("options" in e) && e.value === ""), R = (e) => /* @__PURE__ */ s("option", {
|
|
20
|
+
value: e.value,
|
|
21
|
+
disabled: e.disabled,
|
|
22
|
+
style: j ? { color: "var(--text-primary)" } : void 0,
|
|
23
|
+
children: e.label
|
|
24
|
+
}, e.value);
|
|
25
|
+
return i(() => {
|
|
26
|
+
let e = O.current;
|
|
27
|
+
if (!e || M || !j) return;
|
|
28
|
+
let t = !0;
|
|
29
|
+
queueMicrotask(() => {
|
|
30
|
+
t && P(e.value);
|
|
31
|
+
});
|
|
32
|
+
let n = e.form, r, i = () => {
|
|
33
|
+
clearTimeout(r), r = setTimeout(() => {
|
|
34
|
+
P(e.value);
|
|
35
|
+
}, 0);
|
|
36
|
+
};
|
|
37
|
+
n?.addEventListener("reset", i);
|
|
38
|
+
let a = new MutationObserver(() => {
|
|
39
|
+
P(e.value);
|
|
40
|
+
});
|
|
41
|
+
return a.observe(e, {
|
|
42
|
+
childList: !0,
|
|
43
|
+
subtree: !0,
|
|
44
|
+
attributes: !0,
|
|
45
|
+
attributeFilter: ["value", "selected"]
|
|
46
|
+
}), () => {
|
|
47
|
+
t = !1, n?.removeEventListener("reset", i), a.disconnect(), clearTimeout(r);
|
|
48
|
+
};
|
|
49
|
+
}, [
|
|
50
|
+
M,
|
|
51
|
+
j,
|
|
52
|
+
S.form
|
|
53
|
+
]), /* @__PURE__ */ c("div", {
|
|
54
|
+
className: "flex flex-col gap-1.5",
|
|
55
|
+
children: [
|
|
56
|
+
g && /* @__PURE__ */ s("p", {
|
|
57
|
+
id: E,
|
|
58
|
+
className: "text-text-secondary text-xs",
|
|
59
|
+
children: g
|
|
60
|
+
}),
|
|
61
|
+
(u || f) && /* @__PURE__ */ c("div", {
|
|
62
|
+
className: e("flex items-center justify-between", j && !f && "sr-only"),
|
|
63
|
+
children: [u && /* @__PURE__ */ s("label", {
|
|
64
|
+
htmlFor: w,
|
|
65
|
+
className: e("ui-field-label font-label text-xs font-medium", j && "sr-only"),
|
|
66
|
+
children: u
|
|
67
|
+
}), f && /* @__PURE__ */ s("p", {
|
|
68
|
+
id: T,
|
|
69
|
+
className: "text-2xs text-danger-fg",
|
|
70
|
+
children: f
|
|
71
|
+
})]
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ c("div", {
|
|
74
|
+
className: "relative",
|
|
75
|
+
"data-control-size": j ? D : void 0,
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ c("select", {
|
|
78
|
+
ref: j ? k : x,
|
|
79
|
+
"data-control-size": D,
|
|
80
|
+
required: C.required,
|
|
81
|
+
"aria-invalid": C.invalid,
|
|
82
|
+
"aria-describedby": C.describedBy,
|
|
83
|
+
id: w,
|
|
84
|
+
className: e("ui-sized-control bg-bg-secondary text-text-primary font-control h-7 w-full px-2 pr-7 text-xs", "appearance-none rounded-md border", "transition-colors duration-[100ms]", "focus:border-accent focus:outline-none", "disabled:cursor-not-allowed disabled:opacity-40", "cursor-pointer", f ? "border-danger" : "border-border", m),
|
|
85
|
+
...S,
|
|
86
|
+
value: j && M ? S.value ?? "" : S.value ?? void 0,
|
|
87
|
+
defaultValue: j && !M ? S.defaultValue ?? "" : S.defaultValue,
|
|
88
|
+
onChange: j ? (e) => {
|
|
89
|
+
M || P(e.currentTarget.value), S.onChange?.(e);
|
|
90
|
+
} : S.onChange,
|
|
91
|
+
style: I ? {
|
|
92
|
+
...S.style,
|
|
93
|
+
color: "transparent"
|
|
94
|
+
} : S.style,
|
|
95
|
+
children: [j && !L && /* @__PURE__ */ s("option", {
|
|
96
|
+
value: "",
|
|
97
|
+
disabled: !0,
|
|
98
|
+
hidden: !0
|
|
99
|
+
}), p.map((e, t) => "options" in e ? /* @__PURE__ */ s("optgroup", {
|
|
100
|
+
label: e.label,
|
|
101
|
+
style: j ? { color: "var(--text-primary)" } : void 0,
|
|
102
|
+
children: e.options.map(R)
|
|
103
|
+
}, `group-${t}`) : R(e))]
|
|
104
|
+
}),
|
|
105
|
+
I && /* @__PURE__ */ s("span", {
|
|
106
|
+
"aria-hidden": "true",
|
|
107
|
+
className: "ui-select-placeholder text-text-placeholder font-control pointer-events-none absolute top-1/2 -translate-y-1/2 truncate",
|
|
108
|
+
children: A
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ s(l, { className: "text-text-tertiary pointer-events-none absolute top-1/2 right-2.5 h-3.5 w-3.5 -translate-y-1/2" })
|
|
111
|
+
]
|
|
112
|
+
})
|
|
113
|
+
]
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
export { u as Select };
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
1
2
|
import type { SelectOption, SelectOptionGroup } from "./Select";
|
|
2
|
-
|
|
3
|
+
export type SelectDropdownSize = "sm" | "md";
|
|
4
|
+
export interface SelectDropdownProps extends Omit<ComponentPropsWithRef<"div">, "defaultValue" | "children" | "onChange"> {
|
|
3
5
|
/** Flat options, labelled groups, or a mix of both. Disabled leaves are skipped. */
|
|
4
6
|
options: (SelectOption | SelectOptionGroup)[];
|
|
7
|
+
/** Selected value (controlled). */
|
|
5
8
|
value?: string | null;
|
|
6
|
-
|
|
9
|
+
/** Initially selected value when uncontrolled. */
|
|
10
|
+
defaultValue?: string | null;
|
|
11
|
+
/** Called with the chosen option's value. */
|
|
12
|
+
onValueChange?: (value: string) => void;
|
|
7
13
|
label?: string;
|
|
8
14
|
/** Render the label in the empty trigger, including when an empty-valued option is selected. */
|
|
9
15
|
labelPlacement?: "above" | "placeholder";
|
|
10
16
|
placeholder?: string;
|
|
11
17
|
className?: string;
|
|
12
|
-
size?:
|
|
18
|
+
size?: SelectDropdownSize;
|
|
13
19
|
/** Disable the trigger and selection while preserving its position in the layout. */
|
|
14
20
|
disabled?: boolean;
|
|
15
21
|
}
|
|
@@ -21,6 +27,4 @@ interface SelectDropdownProps {
|
|
|
21
27
|
* typed text (the text resets after a short pause, and repeating a letter
|
|
22
28
|
* cycles); on the closed trigger it selects the match without opening.
|
|
23
29
|
*/
|
|
24
|
-
export declare function SelectDropdown({ options: entries, value,
|
|
25
|
-
export {};
|
|
26
|
-
//# sourceMappingURL=SelectDropdown.d.ts.map
|
|
30
|
+
export declare function SelectDropdown({ options: entries, value: valueProp, defaultValue, onValueChange, label, labelPlacement, placeholder, className, size, disabled, ref, ...rest }: SelectDropdownProps): import("react/jsx-runtime").JSX.Element;
|