@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
|
@@ -38,11 +38,13 @@
|
|
|
38
38
|
* `secondary` and `ghost` toggles use an accent tint and ring. An `icon`
|
|
39
39
|
* toggle uses a neutral hover surface and keeps caller-supplied icon colors.
|
|
40
40
|
*/
|
|
41
|
-
import { type
|
|
41
|
+
import { type ComponentPropsWithRef, type ElementType, type ReactNode } from "react";
|
|
42
42
|
import { type ControlSize } from "../../providers/ControlSizeContext";
|
|
43
|
-
|
|
44
|
-
type
|
|
45
|
-
|
|
43
|
+
/** Visual treatment for Button. */
|
|
44
|
+
export type ButtonVariant = "primary" | "secondary" | "danger" | "ghost" | "icon" | "link";
|
|
45
|
+
/** Visual size for Button. */
|
|
46
|
+
export type ButtonSize = "xs" | "sm" | "md" | "lg";
|
|
47
|
+
export interface ButtonProps extends ComponentPropsWithRef<"button"> {
|
|
46
48
|
/**
|
|
47
49
|
* Visual style. `primary` for the main action, `secondary` (default) for
|
|
48
50
|
* neutral actions, `danger` for destructive ones, `ghost` for low-emphasis
|
|
@@ -50,9 +52,9 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
50
52
|
* unpadded text actions in compact mode. Comfortable mode gives link
|
|
51
53
|
* actions the same minimum 44px hit area as other controls.
|
|
52
54
|
*/
|
|
53
|
-
variant?:
|
|
55
|
+
variant?: ButtonVariant;
|
|
54
56
|
/** Control height and padding. For `link`, controls text and icon size. Defaults to `md`. */
|
|
55
|
-
size?:
|
|
57
|
+
size?: ButtonSize;
|
|
56
58
|
/** Inherit ControlSizeProvider or opt into a minimum 44px hit area. */
|
|
57
59
|
controlSize?: ControlSize;
|
|
58
60
|
/**
|
|
@@ -80,6 +82,4 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
80
82
|
hideLabel?: boolean | "sm" | "md" | "lg";
|
|
81
83
|
children?: ReactNode;
|
|
82
84
|
}
|
|
83
|
-
export declare
|
|
84
|
-
export {};
|
|
85
|
-
//# sourceMappingURL=Button.d.ts.map
|
|
85
|
+
export declare function Button({ variant, size, controlSize, loading, pressed, icon: Icon, hideLabel, className, children, disabled, ref, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { useControlSize as t } from "../../providers/ControlSizeContext.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import { Loader2 as i } from "lucide-react";
|
|
6
|
+
//#region src/components/ui/Button.tsx
|
|
7
|
+
var a = {
|
|
8
|
+
primary: "bg-accent text-text-on-accent hover:bg-accent-hover active:bg-accent-active",
|
|
9
|
+
secondary: "bg-bg-secondary text-text-primary border border-border hover:bg-bg-hover hover:border-border-strong",
|
|
10
|
+
danger: "bg-danger-muted text-danger-fg border border-transparent hover:bg-danger/20",
|
|
11
|
+
ghost: "text-text-secondary hover:text-text-primary hover:bg-bg-hover",
|
|
12
|
+
icon: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover",
|
|
13
|
+
link: "text-accent-fg hover:underline underline-offset-2"
|
|
14
|
+
}, o = {
|
|
15
|
+
xs: "h-6 px-2 text-2xs gap-1",
|
|
16
|
+
sm: "h-7 px-2.5 text-xs gap-1.5",
|
|
17
|
+
md: "h-8 px-3 text-xs gap-2",
|
|
18
|
+
lg: "h-9 px-4 text-sm gap-2"
|
|
19
|
+
}, s = {
|
|
20
|
+
xs: "h-6 w-6",
|
|
21
|
+
sm: "h-7 w-7",
|
|
22
|
+
md: "h-8 w-8",
|
|
23
|
+
lg: "h-9 w-9"
|
|
24
|
+
}, c = {
|
|
25
|
+
xs: "text-2xs gap-1",
|
|
26
|
+
sm: "text-xs gap-1.5",
|
|
27
|
+
md: "text-xs gap-2",
|
|
28
|
+
lg: "text-sm gap-2"
|
|
29
|
+
}, l = {
|
|
30
|
+
xs: "h-3 w-3",
|
|
31
|
+
sm: "h-3.5 w-3.5",
|
|
32
|
+
md: "h-3.5 w-3.5",
|
|
33
|
+
lg: "h-4 w-4"
|
|
34
|
+
}, u = {
|
|
35
|
+
sm: "hidden sm:inline",
|
|
36
|
+
md: "hidden md:inline",
|
|
37
|
+
lg: "hidden lg:inline"
|
|
38
|
+
}, d = {
|
|
39
|
+
sm: {
|
|
40
|
+
xs: "px-1 sm:px-2",
|
|
41
|
+
sm: "px-1.5 sm:px-2.5",
|
|
42
|
+
md: "px-2 sm:px-3",
|
|
43
|
+
lg: "px-2.5 sm:px-4"
|
|
44
|
+
},
|
|
45
|
+
md: {
|
|
46
|
+
xs: "px-1 md:px-2",
|
|
47
|
+
sm: "px-1.5 md:px-2.5",
|
|
48
|
+
md: "px-2 md:px-3",
|
|
49
|
+
lg: "px-2.5 md:px-4"
|
|
50
|
+
},
|
|
51
|
+
lg: {
|
|
52
|
+
xs: "px-1 lg:px-2",
|
|
53
|
+
sm: "px-1.5 lg:px-2.5",
|
|
54
|
+
md: "px-2 lg:px-3",
|
|
55
|
+
lg: "px-2.5 lg:px-4"
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
function f({ variant: f = "secondary", size: p = "md", controlSize: m, loading: h, pressed: g, icon: _, hideLabel: v, className: y, children: b, disabled: x, ref: S, ...C }) {
|
|
59
|
+
let w = t(m), T = f === "icon", E = f === "link", D = g ?? (C["aria-pressed"] === !0 || C["aria-pressed"] === "true"), O = v === !0 ? "sm" : v === !1 ? void 0 : v;
|
|
60
|
+
return /* @__PURE__ */ r("button", {
|
|
61
|
+
type: "button",
|
|
62
|
+
ref: S,
|
|
63
|
+
"data-control-size": w,
|
|
64
|
+
"data-variant": f,
|
|
65
|
+
"data-size": p,
|
|
66
|
+
"data-pressed": g !== void 0 || C["aria-pressed"] !== void 0 ? String(D) : void 0,
|
|
67
|
+
"data-hide-label": O && !T ? "" : void 0,
|
|
68
|
+
disabled: x || h,
|
|
69
|
+
className: e((!E || w === "comfortable") && "ui-sized-control", "inline-flex items-center justify-center rounded-md font-medium", "font-control", "transition-colors duration-[100ms] ease-out", "cursor-pointer", "disabled:cursor-not-allowed disabled:opacity-40", "focus-visible:outline-accent focus-visible:outline-2 focus-visible:outline-offset-2", a[f], D && (f === "secondary" || f === "ghost" || T) && "text-text-primary", T ? s[p] : E ? c[p] : o[p], O && !T && !E && d[O]?.[p], y),
|
|
70
|
+
...C,
|
|
71
|
+
"aria-pressed": g ?? C["aria-pressed"],
|
|
72
|
+
children: [
|
|
73
|
+
h && /* @__PURE__ */ n(i, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
74
|
+
_ && !h && /* @__PURE__ */ n(_, { className: l[p] }),
|
|
75
|
+
b && (O ? /* @__PURE__ */ n("span", {
|
|
76
|
+
className: u[O],
|
|
77
|
+
children: b
|
|
78
|
+
}) : b)
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { f as Button };
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
* />
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
-
import { type ReactNode } from "react";
|
|
32
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
33
33
|
import { type CalendarAvailability, type CalendarEvent, type CalendarResource, type CalendarView, type Weekday } from "../../lib/calendar";
|
|
34
34
|
import { type CalendarAvailabilityChange, type CalendarDisplay, type CalendarDraft, type CalendarEventChange, type CalendarLabelOverrides, type CalendarRange, type CalendarRenderEvent, type CalendarSelection } from "./calendar/types";
|
|
35
|
-
export interface CalendarProps<T = unknown, A = unknown> {
|
|
35
|
+
export interface CalendarProps<T = unknown, A = unknown> extends Omit<ComponentPropsWithRef<"div">, "children" | "onChange"> {
|
|
36
36
|
/** Bookings/events to show. Filter them to the visible range for speed. */
|
|
37
37
|
events?: readonly CalendarEvent<T>[];
|
|
38
38
|
/**
|
|
@@ -188,5 +188,4 @@ export interface CalendarProps<T = unknown, A = unknown> {
|
|
|
188
188
|
/** Accessible name for the calendar region. */
|
|
189
189
|
"aria-label"?: string;
|
|
190
190
|
}
|
|
191
|
-
export declare function Calendar<T = unknown, A = unknown>({ events, availability, resources, view: viewProp, defaultView, onViewChange, views, date: dateProp, defaultDate, onDateChange, onRangeChange, weekStartsOn, workWeekDays, agendaDays, slotMinTime, slotMaxTime, slotDuration, slotLabelInterval, sharedTimeAxis, hourHeight, timelineHourWidth, resourceMinWidth, scrollToTime, scrollAlign, now: nowProp, nowIndicator, editLayer, readOnly, selectable, clickCreateDuration, shadeOutsideAvailability, onCreate, onEventClick, onEventChange, onAvailabilityClick, onAvailabilityChange, validate, onInvalidChange, onDateClick, renderEvent, monthMaxEvents, agendaShowAvailability, display, narrowView, narrowWidth, locale, timeZone, hour12, labels: labelOverrides, toolbar, toolbarActions, loading, className, "aria-label": ariaLabel, }: CalendarProps<T, A>): import("react/jsx-runtime").JSX.Element;
|
|
192
|
-
//# sourceMappingURL=Calendar.d.ts.map
|
|
191
|
+
export declare function Calendar<T = unknown, A = unknown>({ events, availability, resources, view: viewProp, defaultView, onViewChange, views, date: dateProp, defaultDate, onDateChange, onRangeChange, weekStartsOn, workWeekDays, agendaDays, slotMinTime, slotMaxTime, slotDuration, slotLabelInterval, sharedTimeAxis, hourHeight, timelineHourWidth, resourceMinWidth, scrollToTime, scrollAlign, now: nowProp, nowIndicator, editLayer, readOnly, selectable, clickCreateDuration, shadeOutsideAvailability, onCreate, onEventClick, onEventChange, onAvailabilityClick, onAvailabilityChange, validate, onInvalidChange, onDateClick, renderEvent, monthMaxEvents, agendaShowAvailability, display, narrowView, narrowWidth, locale, timeZone, hour12, labels: labelOverrides, toolbar, toolbarActions, loading, className, "aria-label": ariaLabel, ref, ...rest }: CalendarProps<T, A>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { mergeRefs as t } from "../../lib/mergeRefs.js";
|
|
3
|
+
import { Button as n } from "./Button.js";
|
|
4
|
+
import { SelectDropdown as r } from "./SelectDropdown.js";
|
|
5
|
+
import { createCalendarDateMath as ee, formatTimeRange as te, isTimeGridView as ne, parseTime as i, rangesOverlap as re, resourceIdsOf as ie } from "../../lib/calendar.js";
|
|
6
|
+
import { CalendarContext as ae } from "./calendar/context.js";
|
|
7
|
+
import { AgendaView as oe } from "./calendar/AgendaView.js";
|
|
8
|
+
import { MonthView as se } from "./calendar/MonthView.js";
|
|
9
|
+
import { TimeGrid as ce } from "./calendar/TimeGrid.js";
|
|
10
|
+
import { TimelineView as le } from "./calendar/TimelineView.js";
|
|
11
|
+
import { DEFAULT_CALENDAR_LABELS as a } from "./calendar/types.js";
|
|
12
|
+
import { RadioPill as ue } from "./RadioPill.js";
|
|
13
|
+
import { useEffect as o, useId as de, useLayoutEffect as fe, useMemo as s, useRef as pe, useState as c } from "react";
|
|
14
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
15
|
+
import { ChevronLeft as me, ChevronRight as he, Loader2 as ge } from "lucide-react";
|
|
16
|
+
//#region src/components/ui/Calendar.tsx
|
|
17
|
+
var _e = [
|
|
18
|
+
"day",
|
|
19
|
+
"threeDay",
|
|
20
|
+
"week",
|
|
21
|
+
"month",
|
|
22
|
+
"agenda"
|
|
23
|
+
];
|
|
24
|
+
function d() {
|
|
25
|
+
return /* @__PURE__ */ new Date();
|
|
26
|
+
}
|
|
27
|
+
function ve(e) {
|
|
28
|
+
let [t, n] = c(d);
|
|
29
|
+
return o(() => {
|
|
30
|
+
if (e) return;
|
|
31
|
+
let t = setInterval(() => n(d()), 3e4);
|
|
32
|
+
return () => clearInterval(t);
|
|
33
|
+
}, [e]), e ?? t;
|
|
34
|
+
}
|
|
35
|
+
function ye(e) {
|
|
36
|
+
let [t, n] = c(null);
|
|
37
|
+
return o(() => {
|
|
38
|
+
let t = e.current;
|
|
39
|
+
if (!t || typeof ResizeObserver > "u") return;
|
|
40
|
+
let r = new ResizeObserver((e) => {
|
|
41
|
+
n(e[0]?.contentRect.width ?? null);
|
|
42
|
+
});
|
|
43
|
+
return r.observe(t), () => r.disconnect();
|
|
44
|
+
}, [e]), t;
|
|
45
|
+
}
|
|
46
|
+
var f = /* @__PURE__ */ new Set();
|
|
47
|
+
function be(e) {
|
|
48
|
+
let t = !1;
|
|
49
|
+
try {
|
|
50
|
+
t = process.env.NODE_ENV !== "production";
|
|
51
|
+
} catch {}
|
|
52
|
+
!t || f.has(e) || (f.add(e), console.warn(`[Calendar] ${e}`));
|
|
53
|
+
}
|
|
54
|
+
function p(e, t, n) {
|
|
55
|
+
try {
|
|
56
|
+
return i(t);
|
|
57
|
+
} catch {
|
|
58
|
+
return be(`Invalid ${e} "${t}", expected HH:mm; using the default.`), n;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function m({ events: i = [], availability: f, resources: m = [], view: xe, defaultView: Se = "week", onViewChange: Ce, views: h = _e, date: we, defaultDate: Te, onDateChange: Ee, onRangeChange: De, weekStartsOn: g = 1, workWeekDays: Oe, agendaDays: ke = 7, slotMinTime: Ae = "07:00", slotMaxTime: _ = "20:00", slotDuration: je = 15, slotLabelInterval: Me = 60, sharedTimeAxis: v = !1, hourHeight: Ne = 48, timelineHourWidth: Pe = 96, resourceMinWidth: Fe = 120, scrollToTime: y, scrollAlign: Ie = "start", now: Le, nowIndicator: Re = !0, editLayer: b = "events", readOnly: x = !1, selectable: ze, clickCreateDuration: Be = 30, shadeOutsideAvailability: Ve = !0, onCreate: S, onEventClick: C, onEventChange: w, onAvailabilityClick: T, onAvailabilityChange: E, validate: He, onInvalidChange: Ue, onDateClick: We, renderEvent: Ge, monthMaxEvents: Ke, agendaShowAvailability: qe = !0, display: D, narrowView: O = "day", narrowWidth: Je = 640, locale: k = "en-GB", timeZone: A, hour12: Ye = !1, labels: j, toolbar: Xe = !0, toolbarActions: Ze, loading: Qe = !1, className: $e, "aria-label": et, ref: tt, ...nt }) {
|
|
62
|
+
let M = s(() => ee(A), [A]), { addDays: rt, formatLongDate: N, formatRangeTitle: it, getVisibleDays: at, minutesOfDay: ot, shiftDate: st } = M, ct = pe(null), lt = s(() => t(ct, tt), [tt]), ut = de(), dt = ve(Le), P = ye(ct), [ft, pt] = c(Se), [mt, ht] = c(() => Te ?? d()), F = xe ?? ft, I = we ?? mt, L = (e) => {
|
|
63
|
+
xe === void 0 && pt(e), Ce?.(e);
|
|
64
|
+
}, R = (e) => {
|
|
65
|
+
we === void 0 && ht(e), Ee?.(e);
|
|
66
|
+
}, z = P !== null && P < Je && O !== !1 && ne(F) && F !== "day" && O ? O : F, B = s(() => ({
|
|
67
|
+
...a,
|
|
68
|
+
...j,
|
|
69
|
+
views: {
|
|
70
|
+
...a.views,
|
|
71
|
+
...j?.views
|
|
72
|
+
},
|
|
73
|
+
status: {
|
|
74
|
+
...a.status,
|
|
75
|
+
...j?.status
|
|
76
|
+
}
|
|
77
|
+
}), [j]), V = s(() => ({
|
|
78
|
+
weekStartsOn: g,
|
|
79
|
+
workWeekDays: Oe,
|
|
80
|
+
agendaDays: ke
|
|
81
|
+
}), [
|
|
82
|
+
g,
|
|
83
|
+
Oe,
|
|
84
|
+
ke
|
|
85
|
+
]), gt = I.getTime(), H = s(() => at(z, new Date(gt), V), [
|
|
86
|
+
z,
|
|
87
|
+
gt,
|
|
88
|
+
V,
|
|
89
|
+
at
|
|
90
|
+
]), _t = H[0], vt = rt(H[H.length - 1], 1), U = _t.getTime(), W = vt.getTime(), yt = pe(De);
|
|
91
|
+
fe(() => {
|
|
92
|
+
yt.current = De;
|
|
93
|
+
}), o(() => {
|
|
94
|
+
yt.current?.({
|
|
95
|
+
start: new Date(U),
|
|
96
|
+
end: new Date(W),
|
|
97
|
+
view: z
|
|
98
|
+
});
|
|
99
|
+
}, [
|
|
100
|
+
U,
|
|
101
|
+
W,
|
|
102
|
+
z
|
|
103
|
+
]);
|
|
104
|
+
let G = s(() => i.filter((e) => re(e.start.getTime(), Math.max(e.end.getTime(), e.start.getTime() + 1), U, W)), [
|
|
105
|
+
i,
|
|
106
|
+
U,
|
|
107
|
+
W
|
|
108
|
+
]), K = s(() => (f ?? []).filter((e) => re(e.start.getTime(), e.end.getTime(), U, W)), [
|
|
109
|
+
f,
|
|
110
|
+
U,
|
|
111
|
+
W
|
|
112
|
+
]), q = p("slotMinTime", Ae, 0), J = p("slotMaxTime", _, 1440);
|
|
113
|
+
J <= q && be(`slotMaxTime "${_}" must be after slotMinTime "${Ae}"; showing the whole day.`);
|
|
114
|
+
let Y = s(() => J > q ? {
|
|
115
|
+
min: q,
|
|
116
|
+
max: J
|
|
117
|
+
} : {
|
|
118
|
+
min: 0,
|
|
119
|
+
max: 1440
|
|
120
|
+
}, [q, J]), bt = Math.max(1, Math.round(je)), X;
|
|
121
|
+
if (y) X = p("scrollToTime", y, Y.min);
|
|
122
|
+
else {
|
|
123
|
+
let e = K.filter((e) => (e.kind ?? "available") === "available").map((e) => A ? M.parts(e.start).hour * 60 + M.parts(e.start).minute : ot(e.start)).filter((e) => e >= Y.min && e < Y.max);
|
|
124
|
+
e.length && (X = Math.min(...e));
|
|
125
|
+
}
|
|
126
|
+
let Z = s(() => new Map(m.map((e) => [e.id, e])), [m]), Q = it(z, I, {
|
|
127
|
+
...V,
|
|
128
|
+
locale: k
|
|
129
|
+
}), xt = {
|
|
130
|
+
locale: k,
|
|
131
|
+
hour12: Ye,
|
|
132
|
+
timeZone: A
|
|
133
|
+
}, St = (e) => Z.get(ie(e)[0] ?? ""), Ct = (e) => {
|
|
134
|
+
let t = ie(e).map((e) => Z.get(e)?.title).filter(Boolean);
|
|
135
|
+
return t.length ? `, ${t.join(", ")}` : "";
|
|
136
|
+
}, wt = (e) => e.status && e.status !== "confirmed" ? B.status[e.status] : void 0, Tt = (e) => {
|
|
137
|
+
let t = He?.(e);
|
|
138
|
+
return typeof t == "string" && t ? t : void 0;
|
|
139
|
+
}, Et = {
|
|
140
|
+
view: z,
|
|
141
|
+
dates: M,
|
|
142
|
+
timeZone: A,
|
|
143
|
+
dayBounds: (e) => M.dayBounds(e, Y),
|
|
144
|
+
locale: k,
|
|
145
|
+
hour12: Ye,
|
|
146
|
+
weekStartsOn: g,
|
|
147
|
+
now: dt,
|
|
148
|
+
nowIndicator: Re,
|
|
149
|
+
labels: B,
|
|
150
|
+
itemHelpId: ut,
|
|
151
|
+
resources: m,
|
|
152
|
+
resourceById: Z,
|
|
153
|
+
step: bt,
|
|
154
|
+
bounds: Y,
|
|
155
|
+
hourHeight: Ne,
|
|
156
|
+
slotLabelInterval: Me,
|
|
157
|
+
sharedTimeAxis: v,
|
|
158
|
+
timelineHourWidth: Pe,
|
|
159
|
+
resourceMinWidth: Fe,
|
|
160
|
+
editLayer: b,
|
|
161
|
+
selectable: !x && !!S && (ze ?? !0),
|
|
162
|
+
clickCreateDuration: Be,
|
|
163
|
+
hasAvailability: f !== void 0,
|
|
164
|
+
shadeOutsideAvailability: Ve,
|
|
165
|
+
monthMaxEvents: Ke,
|
|
166
|
+
agendaShowAvailability: qe,
|
|
167
|
+
display: {
|
|
168
|
+
time: D?.time ?? !0,
|
|
169
|
+
description: D?.description ?? !0,
|
|
170
|
+
status: D?.status ?? !0,
|
|
171
|
+
badge: D?.badge ?? !0,
|
|
172
|
+
blockLabels: D?.blockLabels ?? !0,
|
|
173
|
+
availableBlocks: D?.availableBlocks ?? !0
|
|
174
|
+
},
|
|
175
|
+
scrollToMinute: X,
|
|
176
|
+
scrollAlign: Ie,
|
|
177
|
+
canEditEvent: (e) => !e.placeholder && !x && !!w && b === "events" && (e.editable ?? e.status !== "cancelled"),
|
|
178
|
+
canEditBlock: (e) => !e.placeholder && !x && !!E && b === "availability" && e.editable !== !1,
|
|
179
|
+
eventColor: (e) => e.color ?? St(e.resourceId)?.color ?? "accent",
|
|
180
|
+
blockColor: (e) => e.color ?? St(e.resourceId)?.color ?? ((e.kind ?? "available") === "available" ? "green" : "gray"),
|
|
181
|
+
statusLabel: wt,
|
|
182
|
+
describeEvent: (e) => {
|
|
183
|
+
let t = e.allDay ? `${N(e.start, k)}, ${B.allDay}` : `${N(e.start, k)}, ${te(e.start, e.end, xt)}`, n = wt(e);
|
|
184
|
+
return [
|
|
185
|
+
e.title,
|
|
186
|
+
t,
|
|
187
|
+
n,
|
|
188
|
+
e.badge,
|
|
189
|
+
e.description
|
|
190
|
+
].filter(Boolean).join(", ").concat(Ct(e.resourceId));
|
|
191
|
+
},
|
|
192
|
+
describeBlock: (e) => [
|
|
193
|
+
(e.kind ?? "available") === "available" ? B.available : B.unavailable,
|
|
194
|
+
e.label,
|
|
195
|
+
`${N(e.start, k)}, ${te(e.start, e.end, xt)}`
|
|
196
|
+
].filter(Boolean).join(", ").concat(Ct(e.resourceId)),
|
|
197
|
+
renderEvent: Ge,
|
|
198
|
+
hasEventClick: !!C,
|
|
199
|
+
hasBlockClick: !!T,
|
|
200
|
+
clickEvent: (e) => C?.(e),
|
|
201
|
+
clickBlock: (e) => T?.(e),
|
|
202
|
+
check: Tt,
|
|
203
|
+
commit: (e, t) => {
|
|
204
|
+
let n = Tt(e);
|
|
205
|
+
if (n) return Ue?.(e, n), !1;
|
|
206
|
+
if (e.target === "selection") S?.({
|
|
207
|
+
start: e.start,
|
|
208
|
+
end: e.end,
|
|
209
|
+
allDay: e.allDay,
|
|
210
|
+
resourceId: e.resourceId,
|
|
211
|
+
source: t
|
|
212
|
+
});
|
|
213
|
+
else {
|
|
214
|
+
let n = {
|
|
215
|
+
...e,
|
|
216
|
+
source: t
|
|
217
|
+
};
|
|
218
|
+
delete n.target, e.target === "event" ? w?.(n) : E?.(n);
|
|
219
|
+
}
|
|
220
|
+
return !0;
|
|
221
|
+
},
|
|
222
|
+
openDay: (e) => {
|
|
223
|
+
if (We) {
|
|
224
|
+
We(e);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
R(e), z !== "day" && z !== "timeline" && L("day");
|
|
228
|
+
}
|
|
229
|
+
}, Dt = h.map((e) => ({
|
|
230
|
+
value: e,
|
|
231
|
+
label: B.views[e]
|
|
232
|
+
})), $ = et ?? Q, Ot = JSON.stringify([
|
|
233
|
+
A,
|
|
234
|
+
H.map((e) => e.getTime()),
|
|
235
|
+
Y.min,
|
|
236
|
+
Y.max,
|
|
237
|
+
bt,
|
|
238
|
+
m.map((e) => e.id)
|
|
239
|
+
]), kt;
|
|
240
|
+
return kt = z === "month" ? /* @__PURE__ */ l(se, {
|
|
241
|
+
date: I,
|
|
242
|
+
events: G,
|
|
243
|
+
availability: K,
|
|
244
|
+
label: $
|
|
245
|
+
}, A) : z === "agenda" ? /* @__PURE__ */ l(oe, {
|
|
246
|
+
days: H,
|
|
247
|
+
events: G.filter((e) => !e.placeholder),
|
|
248
|
+
availability: K.filter((e) => !e.placeholder),
|
|
249
|
+
label: $
|
|
250
|
+
}, A) : z === "timeline" ? /* @__PURE__ */ l(le, {
|
|
251
|
+
day: H[0],
|
|
252
|
+
events: G,
|
|
253
|
+
availability: K,
|
|
254
|
+
label: $
|
|
255
|
+
}, Ot) : /* @__PURE__ */ l(ce, {
|
|
256
|
+
days: H,
|
|
257
|
+
events: G,
|
|
258
|
+
availability: K,
|
|
259
|
+
label: $
|
|
260
|
+
}, Ot), /* @__PURE__ */ l(ae.Provider, {
|
|
261
|
+
value: Et,
|
|
262
|
+
children: /* @__PURE__ */ u("div", {
|
|
263
|
+
...nt,
|
|
264
|
+
ref: lt,
|
|
265
|
+
"data-time-zone": A,
|
|
266
|
+
"data-shared-axis": v && A && [
|
|
267
|
+
"day",
|
|
268
|
+
"threeDay",
|
|
269
|
+
"workWeek",
|
|
270
|
+
"week"
|
|
271
|
+
].includes(z) ? !0 : void 0,
|
|
272
|
+
role: "region",
|
|
273
|
+
"aria-label": et ?? Q,
|
|
274
|
+
"aria-busy": Qe || void 0,
|
|
275
|
+
className: e("ui-cal relative flex h-full min-h-0 flex-col overflow-hidden", $e),
|
|
276
|
+
children: [
|
|
277
|
+
/* @__PURE__ */ l("span", {
|
|
278
|
+
id: ut,
|
|
279
|
+
className: "sr-only",
|
|
280
|
+
children: B.itemHelp
|
|
281
|
+
}),
|
|
282
|
+
Xe && /* @__PURE__ */ u("div", {
|
|
283
|
+
className: "ui-cal-noprint border-border flex flex-wrap items-center justify-between gap-2 border-b px-3 py-2",
|
|
284
|
+
children: [/* @__PURE__ */ u("div", {
|
|
285
|
+
className: "flex min-w-0 items-center gap-2",
|
|
286
|
+
children: [
|
|
287
|
+
/* @__PURE__ */ l(n, {
|
|
288
|
+
size: "sm",
|
|
289
|
+
onClick: () => R(dt),
|
|
290
|
+
children: B.today
|
|
291
|
+
}),
|
|
292
|
+
/* @__PURE__ */ u("div", {
|
|
293
|
+
className: "flex items-center",
|
|
294
|
+
children: [/* @__PURE__ */ l(n, {
|
|
295
|
+
variant: "icon",
|
|
296
|
+
size: "sm",
|
|
297
|
+
icon: me,
|
|
298
|
+
"aria-label": B.previous,
|
|
299
|
+
onClick: () => R(st(z, I, -1, V))
|
|
300
|
+
}), /* @__PURE__ */ l(n, {
|
|
301
|
+
variant: "icon",
|
|
302
|
+
size: "sm",
|
|
303
|
+
icon: he,
|
|
304
|
+
"aria-label": B.next,
|
|
305
|
+
onClick: () => R(st(z, I, 1, V))
|
|
306
|
+
})]
|
|
307
|
+
}),
|
|
308
|
+
/* @__PURE__ */ l("h2", {
|
|
309
|
+
className: "text-text-primary truncate text-sm font-semibold",
|
|
310
|
+
"aria-live": "polite",
|
|
311
|
+
children: Q
|
|
312
|
+
})
|
|
313
|
+
]
|
|
314
|
+
}), /* @__PURE__ */ u("div", {
|
|
315
|
+
className: "flex items-center gap-1.5",
|
|
316
|
+
children: [Ze, h.length > 1 && (P === null || P >= h.length * 80 + 420 ? /* @__PURE__ */ l(ue, {
|
|
317
|
+
"aria-label": B.view,
|
|
318
|
+
options: Dt,
|
|
319
|
+
value: F,
|
|
320
|
+
onValueChange: L
|
|
321
|
+
}) : /* @__PURE__ */ l(r, {
|
|
322
|
+
className: "w-28",
|
|
323
|
+
size: "sm",
|
|
324
|
+
options: Dt,
|
|
325
|
+
value: F,
|
|
326
|
+
onValueChange: (e) => L(e)
|
|
327
|
+
}))]
|
|
328
|
+
})]
|
|
329
|
+
}),
|
|
330
|
+
kt,
|
|
331
|
+
Qe && /* @__PURE__ */ u("div", {
|
|
332
|
+
className: "ui-cal-loading",
|
|
333
|
+
role: "status",
|
|
334
|
+
children: [/* @__PURE__ */ l(ge, { className: "text-accent h-6 w-6 animate-spin" }), /* @__PURE__ */ l("span", {
|
|
335
|
+
className: "sr-only",
|
|
336
|
+
children: B.loading
|
|
337
|
+
})]
|
|
338
|
+
})
|
|
339
|
+
]
|
|
340
|
+
})
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
//#endregion
|
|
344
|
+
export { m as Calendar };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
|
+
export interface CalendarGridProps extends Omit<ComponentPropsWithRef<"div">, "children" | "onSelect"> {
|
|
2
3
|
/** Explicit zone; day buttons return real instants at midnight in this zone. */
|
|
3
4
|
timeZone?: string;
|
|
4
5
|
/** Currently displayed month (year, month). */
|
|
@@ -24,6 +25,4 @@ interface CalendarGridProps {
|
|
|
24
25
|
/** Maximum selectable date. */
|
|
25
26
|
maxDate?: Date;
|
|
26
27
|
}
|
|
27
|
-
export declare function CalendarGrid({ year, month, timeZone, selected, rangeStart, rangeEnd, hoverDate, onSelect, onMonthChange, onHover, minDate, maxDate, }: CalendarGridProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export {};
|
|
29
|
-
//# sourceMappingURL=CalendarGrid.d.ts.map
|
|
28
|
+
export declare function CalendarGrid({ year, month, timeZone, selected, rangeStart, rangeEnd, hoverDate, onSelect, onMonthChange, onHover, minDate, maxDate, className, ref, ...rest }: CalendarGridProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { mergeRefs as t } from "../../lib/mergeRefs.js";
|
|
3
|
+
import { calendarDateFromParts as n, calendarDateParts as r } from "../../lib/calendar.js";
|
|
4
|
+
import { MONTHS_LONG as i } from "../../lib/months.js";
|
|
5
|
+
import { useRef as a, useState as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import { ChevronLeft as l, ChevronRight as u } from "lucide-react";
|
|
8
|
+
//#region src/components/ui/CalendarGrid.tsx
|
|
9
|
+
var d = [
|
|
10
|
+
"Mo",
|
|
11
|
+
"Tu",
|
|
12
|
+
"We",
|
|
13
|
+
"Th",
|
|
14
|
+
"Fr",
|
|
15
|
+
"Sa",
|
|
16
|
+
"Su"
|
|
17
|
+
];
|
|
18
|
+
function f(e, t, n) {
|
|
19
|
+
let i = r(e, n), a = r(t, n);
|
|
20
|
+
return i.year === a.year && i.month === a.month && i.day === a.day;
|
|
21
|
+
}
|
|
22
|
+
function p(e, t, n) {
|
|
23
|
+
if (!t || !n) return !1;
|
|
24
|
+
let r = e.getTime(), i = Math.min(t.getTime(), n.getTime()), a = Math.max(t.getTime(), n.getTime());
|
|
25
|
+
return r > i && r < a;
|
|
26
|
+
}
|
|
27
|
+
function m(e, t) {
|
|
28
|
+
return new Date(e, t + 1, 0).getDate();
|
|
29
|
+
}
|
|
30
|
+
function h(e, t) {
|
|
31
|
+
let n = new Date(e, t, 1).getDay();
|
|
32
|
+
return n === 0 ? 6 : n - 1;
|
|
33
|
+
}
|
|
34
|
+
function g({ year: g, month: _, timeZone: v, selected: y, rangeStart: b, rangeEnd: x, hoverDate: S, onSelect: C, onMonthChange: w, onHover: T, minDate: E, maxDate: D, className: O, ref: k, ...A }) {
|
|
35
|
+
let j = m(g, _), M = h(g, _), N = /* @__PURE__ */ new Date(), P = a(null), [F, I] = o(null);
|
|
36
|
+
function L() {
|
|
37
|
+
return F !== null && F >= 1 && F <= j ? F : y && r(y, v).year === g && r(y, v).month - 1 === _ ? r(y, v).day : b && r(b, v).year === g && r(b, v).month - 1 === _ ? r(b, v).day : r(N, v).year === g && r(N, v).month - 1 === _ ? r(N, v).day : 1;
|
|
38
|
+
}
|
|
39
|
+
let R = L();
|
|
40
|
+
function z(e, t) {
|
|
41
|
+
let n = 0;
|
|
42
|
+
switch (e.key) {
|
|
43
|
+
case "ArrowRight":
|
|
44
|
+
n = 1;
|
|
45
|
+
break;
|
|
46
|
+
case "ArrowLeft":
|
|
47
|
+
n = -1;
|
|
48
|
+
break;
|
|
49
|
+
case "ArrowDown":
|
|
50
|
+
n = 7;
|
|
51
|
+
break;
|
|
52
|
+
case "ArrowUp":
|
|
53
|
+
n = -7;
|
|
54
|
+
break;
|
|
55
|
+
default: return;
|
|
56
|
+
}
|
|
57
|
+
e.preventDefault();
|
|
58
|
+
let r = t + n;
|
|
59
|
+
r >= 1 && r <= j && (I(r), (P.current?.querySelector(`[data-day="${r}"]`))?.focus());
|
|
60
|
+
}
|
|
61
|
+
function B() {
|
|
62
|
+
_ === 0 ? w(g - 1, 11) : w(g, _ - 1);
|
|
63
|
+
}
|
|
64
|
+
function V() {
|
|
65
|
+
_ === 11 ? w(g + 1, 0) : w(g, _ + 1);
|
|
66
|
+
}
|
|
67
|
+
let H = [];
|
|
68
|
+
for (let e = 0; e < M; e++) H.push(null);
|
|
69
|
+
for (let e = 1; e <= j; e++) H.push(e);
|
|
70
|
+
return /* @__PURE__ */ c("div", {
|
|
71
|
+
...A,
|
|
72
|
+
className: e("w-[252px]", O),
|
|
73
|
+
ref: t(P, k),
|
|
74
|
+
children: [/* @__PURE__ */ c("div", {
|
|
75
|
+
className: "mb-2 flex items-center justify-between",
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ s("button", {
|
|
78
|
+
type: "button",
|
|
79
|
+
onClick: B,
|
|
80
|
+
"aria-label": "Previous month",
|
|
81
|
+
className: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover flex h-6 w-6 cursor-pointer items-center justify-center rounded-md transition-colors duration-[100ms]",
|
|
82
|
+
children: /* @__PURE__ */ s(l, { className: "h-3.5 w-3.5" })
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ c("span", {
|
|
85
|
+
className: "text-text-primary text-xs font-semibold",
|
|
86
|
+
"aria-live": "polite",
|
|
87
|
+
children: [
|
|
88
|
+
i[_],
|
|
89
|
+
" ",
|
|
90
|
+
g
|
|
91
|
+
]
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ s("button", {
|
|
94
|
+
type: "button",
|
|
95
|
+
onClick: V,
|
|
96
|
+
"aria-label": "Next month",
|
|
97
|
+
className: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover flex h-6 w-6 cursor-pointer items-center justify-center rounded-md transition-colors duration-[100ms]",
|
|
98
|
+
children: /* @__PURE__ */ s(u, { className: "h-3.5 w-3.5" })
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
}), /* @__PURE__ */ c("div", {
|
|
102
|
+
className: "grid grid-cols-7 gap-0",
|
|
103
|
+
children: [d.map((e) => /* @__PURE__ */ s("div", {
|
|
104
|
+
className: "text-text-tertiary text-2xs flex h-8 items-center justify-center font-medium",
|
|
105
|
+
children: e
|
|
106
|
+
}, e)), H.map((t, r) => {
|
|
107
|
+
if (t === null) return /* @__PURE__ */ s("div", { className: "h-8" }, `empty-${r}`);
|
|
108
|
+
let a = n({
|
|
109
|
+
year: g,
|
|
110
|
+
month: _ + 1,
|
|
111
|
+
day: t,
|
|
112
|
+
hour: 0,
|
|
113
|
+
minute: 0,
|
|
114
|
+
second: 0,
|
|
115
|
+
millisecond: 0
|
|
116
|
+
}, v), o = f(a, N, v), c = y ? f(a, y, v) : !1, l = b ? f(a, b, v) : !1, u = x ? f(a, x, v) : !1, d = p(a, b ?? null, x ?? S ?? null), m = E && a < E || D && a > D;
|
|
117
|
+
return /* @__PURE__ */ s("button", {
|
|
118
|
+
type: "button",
|
|
119
|
+
"data-day": t,
|
|
120
|
+
disabled: !!m,
|
|
121
|
+
tabIndex: t === R ? 0 : -1,
|
|
122
|
+
"aria-label": `${i[_]} ${t}, ${g}`,
|
|
123
|
+
"aria-current": o ? "date" : void 0,
|
|
124
|
+
onClick: () => C(a),
|
|
125
|
+
onKeyDown: (e) => z(e, t),
|
|
126
|
+
onMouseEnter: () => T?.(a),
|
|
127
|
+
onMouseLeave: () => T?.(null),
|
|
128
|
+
className: e("flex h-8 w-full cursor-pointer items-center justify-center text-xs transition-colors duration-[100ms]", "rounded-md", m && "cursor-not-allowed opacity-30", !m && !c && !l && !u && !d && "hover:bg-bg-hover text-text-primary", o && !c && !l && !u && "text-accent-fg font-semibold", (c || l || u) && "bg-accent text-text-on-accent font-semibold", d && !c && !l && !u && "bg-accent-muted text-accent-fg"),
|
|
129
|
+
children: t
|
|
130
|
+
}, t);
|
|
131
|
+
})]
|
|
132
|
+
})]
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
export { g as CalendarGrid };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode, Ref } from "react";
|
|
2
2
|
interface CardBaseProps {
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
/** Content for the top bar, separated from the body by a border. */
|
|
@@ -14,19 +14,20 @@ interface CardBaseProps {
|
|
|
14
14
|
/** Additional utility classes for the body wrapper. */
|
|
15
15
|
bodyClassName?: string;
|
|
16
16
|
}
|
|
17
|
-
type LinkAttributes = Omit<
|
|
17
|
+
type LinkAttributes = Omit<ComponentPropsWithRef<"a">, "type"> & {
|
|
18
18
|
href: string;
|
|
19
19
|
};
|
|
20
|
-
export interface CardProps extends CardBaseProps, Omit<
|
|
20
|
+
export interface CardProps extends CardBaseProps, Omit<ComponentPropsWithRef<"div">, "children" | "type" | "disabled" | "ref"> {
|
|
21
|
+
ref?: Ref<HTMLElement>;
|
|
21
22
|
/** Semantic container; use aria-labelledby to associate a header heading. */
|
|
22
23
|
as?: "div" | "section" | "article" | "aside";
|
|
23
24
|
type?: never;
|
|
24
25
|
disabled?: never;
|
|
25
26
|
}
|
|
26
|
-
export interface CardButtonProps extends CardBaseProps, Omit<
|
|
27
|
+
export interface CardButtonProps extends CardBaseProps, Omit<ComponentPropsWithRef<"button">, "children"> {
|
|
27
28
|
as: "button";
|
|
28
29
|
/** Native button type when as="button"; defaults to button. */
|
|
29
|
-
type?:
|
|
30
|
+
type?: ComponentPropsWithRef<"button">["type"];
|
|
30
31
|
/** Native disabled state when as="button". */
|
|
31
32
|
disabled?: boolean;
|
|
32
33
|
}
|
|
@@ -45,4 +46,3 @@ export declare function Card({ children, className, header, footer, cover, selec
|
|
|
45
46
|
renderLink?: never;
|
|
46
47
|
}) | CardLinkProps): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
47
48
|
export {};
|
|
48
|
-
//# sourceMappingURL=Card.d.ts.map
|