@pathscale/ui 1.2.6 → 1.2.8
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/LICENSE +22 -22
- package/README.md +59 -59
- package/dist/components/_shared/index.js +1 -3
- package/dist/components/_shared/overlayPosition.js +6 -6
- package/dist/components/accordion/Accordion.css +158 -158
- package/dist/components/accordion/Accordion.js +46 -45
- package/dist/components/accordion/index.js +3 -9
- package/dist/components/alert/Alert.css +116 -116
- package/dist/components/alert/Alert.js +34 -33
- package/dist/components/alert/index.js +1 -8
- package/dist/components/auth-card/AuthCard.js +21 -21
- package/dist/components/auth-card/index.js +1 -3
- package/dist/components/auth-error-message/AuthErrorMessage.js +10 -10
- package/dist/components/auth-error-message/index.js +1 -3
- package/dist/components/auth-field-group/AuthFieldGroup.js +9 -9
- package/dist/components/auth-field-group/index.js +1 -3
- package/dist/components/auth-footer-links/AuthFooterLinks.js +21 -21
- package/dist/components/auth-footer-links/index.js +1 -3
- package/dist/components/auth-form/AuthForm.js +11 -11
- package/dist/components/auth-form/index.js +1 -3
- package/dist/components/auth-powered-by/AuthPoweredBy.js +15 -15
- package/dist/components/auth-powered-by/index.js +1 -3
- package/dist/components/auth-submit-button/AuthSubmitButton.js +10 -10
- package/dist/components/auth-submit-button/index.js +1 -3
- package/dist/components/auth-success-message/AuthSuccessMessage.js +12 -12
- package/dist/components/auth-success-message/index.js +1 -3
- package/dist/components/avatar/Avatar.css +124 -124
- package/dist/components/avatar/Avatar.js +28 -27
- package/dist/components/avatar/AvatarGroup.js +11 -11
- package/dist/components/avatar/index.js +1 -6
- package/dist/components/badge/Badge.css +164 -164
- package/dist/components/badge/Badge.js +19 -19
- package/dist/components/badge/index.js +7 -9
- package/dist/components/breadcrumbs/Breadcrumbs.css +63 -63
- package/dist/components/breadcrumbs/Breadcrumbs.js +27 -26
- package/dist/components/breadcrumbs/index.js +1 -5
- package/dist/components/button/Button.css +194 -194
- package/dist/components/button/Button.js +23 -23
- package/dist/components/button/index.js +1 -3
- package/dist/components/button-group/ButtonGroup.css +117 -117
- package/dist/components/button-group/ButtonGroup.js +16 -15
- package/dist/components/button-group/context.js +2 -2
- package/dist/components/button-group/index.js +3 -6
- package/dist/components/calendar/Calendar.css +258 -258
- package/dist/components/calendar/Calendar.js +88 -88
- package/dist/components/calendar/index.js +1 -3
- package/dist/components/card/Card.css +110 -110
- package/dist/components/card/Card.js +23 -22
- package/dist/components/card/index.js +3 -8
- package/dist/components/chatbubble/ChatBubble.css +164 -164
- package/dist/components/chatbubble/ChatBubble.js +20 -20
- package/dist/components/chatbubble/ChatBubbleAvatar.js +9 -9
- package/dist/components/chatbubble/ChatBubbleFooter.js +9 -9
- package/dist/components/chatbubble/ChatBubbleHeader.js +11 -11
- package/dist/components/chatbubble/ChatBubbleMessage.js +12 -12
- package/dist/components/chatbubble/ChatBubbleTime.js +9 -9
- package/dist/components/chatbubble/index.js +1 -3
- package/dist/components/checkbox/Checkbox.css +183 -183
- package/dist/components/checkbox/Checkbox.js +32 -32
- package/dist/components/checkbox/index.js +1 -3
- package/dist/components/checkbox-group/CheckboxGroup.css +10 -10
- package/dist/components/checkbox-group/CheckboxGroup.js +14 -14
- package/dist/components/checkbox-group/context.js +2 -2
- package/dist/components/checkbox-group/index.js +4 -4
- package/dist/components/chip/Chip.css +197 -197
- package/dist/components/chip/Chip.js +32 -32
- package/dist/components/chip/index.js +6 -7
- package/dist/components/close-button/CloseButton.css +81 -81
- package/dist/components/close-button/CloseButton.js +22 -22
- package/dist/components/close-button/index.js +1 -3
- package/dist/components/color-area/ColorArea.css +54 -54
- package/dist/components/color-area/ColorArea.js +16 -16
- package/dist/components/color-area/index.js +3 -3
- package/dist/components/color-field/ColorField.css +88 -88
- package/dist/components/color-field/ColorField.js +21 -21
- package/dist/components/color-field/index.js +3 -3
- package/dist/components/color-picker/ColorPicker.css +28 -28
- package/dist/components/color-picker/ColorPicker.js +46 -45
- package/dist/components/color-picker/index.js +3 -8
- package/dist/components/color-slider/ColorSlider.css +57 -57
- package/dist/components/color-slider/ColorSlider.js +19 -19
- package/dist/components/color-slider/index.js +3 -3
- package/dist/components/color-swatch/ColorSwatch.css +84 -84
- package/dist/components/color-swatch/ColorSwatch.js +12 -12
- package/dist/components/color-swatch/index.js +3 -3
- package/dist/components/color-swatch-picker/ColorSwatchPicker.css +12 -12
- package/dist/components/color-swatch-picker/ColorSwatchPicker.js +16 -15
- package/dist/components/color-swatch-picker/index.js +1 -5
- package/dist/components/color-wheel-flower/ColorWheelFlower.css +147 -147
- package/dist/components/color-wheel-flower/ColorWheelFlower.js +84 -84
- package/dist/components/color-wheel-flower/colorWheelFlowerContext.js +3 -3
- package/dist/components/color-wheel-flower/index.js +2 -6
- package/dist/components/combo-box/ComboBox.css +344 -344
- package/dist/components/combo-box/ComboBox.js +92 -91
- package/dist/components/combo-box/index.js +3 -10
- package/dist/components/date-field/DateField.css +215 -215
- package/dist/components/date-field/DateField.js +45 -44
- package/dist/components/date-field/index.js +3 -11
- package/dist/components/date-picker/DatePicker.css +143 -143
- package/dist/components/date-picker/DatePicker.js +38 -38
- package/dist/components/date-picker/index.js +1 -3
- package/dist/components/date-range-picker/DateRangePicker.css +149 -149
- package/dist/components/date-range-picker/DateRangePicker.js +53 -53
- package/dist/components/date-range-picker/index.js +1 -3
- package/dist/components/description/Description.css +10 -10
- package/dist/components/description/Description.js +11 -10
- package/dist/components/description/index.js +3 -5
- package/dist/components/disclosure/Disclosure.css +84 -84
- package/dist/components/disclosure/Disclosure.js +44 -43
- package/dist/components/disclosure/index.js +4 -9
- package/dist/components/disclosure-group/DisclosureGroup.css +9 -9
- package/dist/components/disclosure-group/DisclosureGroup.js +15 -14
- package/dist/components/disclosure-group/index.js +5 -6
- package/dist/components/disclosure-group/useDisclosureGroupNavigation.js +4 -4
- package/dist/components/drawer/Drawer.context.js +3 -3
- package/dist/components/drawer/Drawer.css +463 -463
- package/dist/components/drawer/Drawer.js +109 -108
- package/dist/components/drawer/index.js +1 -15
- package/dist/components/dropdown/Dropdown.css +211 -211
- package/dist/components/dropdown/Dropdown.js +68 -67
- package/dist/components/dropdown/index.js +3 -4
- package/dist/components/empty-state/EmptyState.css +39 -39
- package/dist/components/empty-state/EmptyState.js +27 -26
- package/dist/components/empty-state/index.js +1 -8
- package/dist/components/error-message/ErrorMessage.css +20 -20
- package/dist/components/error-message/ErrorMessage.js +13 -12
- package/dist/components/error-message/index.js +1 -5
- package/dist/components/field-error/FieldError.css +27 -27
- package/dist/components/field-error/FieldError.js +18 -17
- package/dist/components/field-error/index.js +1 -5
- package/dist/components/fieldset/Fieldset.css +30 -30
- package/dist/components/fieldset/Fieldset.js +23 -22
- package/dist/components/fieldset/index.js +3 -8
- package/dist/components/flex/Flex.css +5 -5
- package/dist/components/flex/Flex.js +14 -14
- package/dist/components/flex/index.js +1 -3
- package/dist/components/floating-dock/FloatingDock.css +208 -208
- package/dist/components/floating-dock/FloatingDock.js +78 -78
- package/dist/components/floating-dock/index.js +1 -3
- package/dist/components/footer/Footer.js +12 -12
- package/dist/components/footer/FooterTitle.js +9 -9
- package/dist/components/footer/footer.css +51 -51
- package/dist/components/footer/index.js +1 -3
- package/dist/components/form/FieldErrorMessage.js +10 -9
- package/dist/components/form/Form.css +5 -5
- package/dist/components/form/Form.js +18 -17
- package/dist/components/form/FormField.js +21 -20
- package/dist/components/form/FormSubmitButton.js +12 -11
- package/dist/components/form/index.js +6 -12
- package/dist/components/glass-panel/GlassPanel.classes.d.ts +3 -0
- package/dist/components/glass-panel/GlassPanel.classes.js +3 -0
- package/dist/components/glass-panel/GlassPanel.css +359 -282
- package/dist/components/glass-panel/GlassPanel.d.ts +3 -0
- package/dist/components/glass-panel/GlassPanel.js +30 -27
- package/dist/components/glass-panel/index.js +1 -3
- package/dist/components/glow-card/GlowCard.css +100 -100
- package/dist/components/glow-card/GlowCard.js +11 -11
- package/dist/components/glow-card/index.js +1 -3
- package/dist/components/grid/Grid.css +5 -5
- package/dist/components/grid/Grid.js +15 -15
- package/dist/components/grid/index.js +1 -3
- package/dist/components/header/Header.css +13 -13
- package/dist/components/header/Header.js +11 -10
- package/dist/components/header/index.js +3 -5
- package/dist/components/icon/Icon.css +10 -10
- package/dist/components/icon/Icon.js +9 -9
- package/dist/components/icon/index.js +1 -3
- package/dist/components/immersive-landing/ImmersiveLanding.css +565 -565
- package/dist/components/immersive-landing/ImmersiveLanding.js +45 -45
- package/dist/components/immersive-landing/ImmersiveLandingArrows.js +18 -18
- package/dist/components/immersive-landing/ImmersiveLandingContext.js +3 -3
- package/dist/components/immersive-landing/ImmersiveLandingNavigation.js +34 -34
- package/dist/components/immersive-landing/ImmersiveLandingPage.js +16 -16
- package/dist/components/immersive-landing/components/CookieConsent.js +71 -71
- package/dist/components/immersive-landing/components/FirefoxPWABanner.js +42 -42
- package/dist/components/immersive-landing/components/PWAInstallPrompt.js +40 -40
- package/dist/components/immersive-landing/index.js +6 -14
- package/dist/components/immersive-landing/useImmersiveLanding.js +8 -8
- package/dist/components/input/Input.css +155 -155
- package/dist/components/input/Input.js +46 -46
- package/dist/components/input/index.js +3 -3
- package/dist/components/input-group/InputGroup.css +172 -172
- package/dist/components/input-group/InputGroup.js +32 -31
- package/dist/components/input-group/index.js +3 -9
- package/dist/components/input-otp/InputOTP.css +170 -170
- package/dist/components/input-otp/InputOTP.js +52 -51
- package/dist/components/input-otp/index.js +1 -11
- package/dist/components/join/Join.js +15 -15
- package/dist/components/join/index.js +1 -3
- package/dist/components/kbd/Kbd.css +60 -60
- package/dist/components/kbd/Kbd.js +39 -38
- package/dist/components/kbd/index.js +1 -8
- package/dist/components/label/Label.css +30 -30
- package/dist/components/label/Label.js +11 -10
- package/dist/components/label/index.js +3 -5
- package/dist/components/language-switcher/LanguageSwitcher.css +56 -56
- package/dist/components/language-switcher/LanguageSwitcher.js +24 -24
- package/dist/components/language-switcher/createI18n.js +10 -10
- package/dist/components/language-switcher/index.js +2 -8
- package/dist/components/link/Link.css +131 -131
- package/dist/components/link/Link.js +21 -20
- package/dist/components/link/index.js +1 -5
- package/dist/components/list-box/ListBox.css +148 -148
- package/dist/components/list-box/ListBox.js +19 -18
- package/dist/components/list-box/ListBoxItem.js +31 -30
- package/dist/components/list-box/ListBoxSection.js +15 -14
- package/dist/components/list-box/context.js +2 -2
- package/dist/components/list-box/index.js +11 -16
- package/dist/components/live-chat/LiveChat.css +324 -324
- package/dist/components/live-chat/LiveChatBubble.js +28 -28
- package/dist/components/live-chat/LiveChatPanel.js +67 -67
- package/dist/components/live-chat/index.js +2 -5
- package/dist/components/menu/Menu.css +199 -199
- package/dist/components/menu/Menu.js +24 -28
- package/dist/components/menu/MenuItem.js +37 -36
- package/dist/components/menu/MenuSection.js +15 -14
- package/dist/components/menu/context.js +2 -2
- package/dist/components/menu/index.js +4 -12
- package/dist/components/meter/Meter.css +89 -89
- package/dist/components/meter/Meter.js +35 -34
- package/dist/components/meter/index.js +1 -8
- package/dist/components/modal/Modal.css +320 -320
- package/dist/components/modal/Modal.js +79 -78
- package/dist/components/modal/index.js +1 -13
- package/dist/components/navbar/Navbar.classes.d.ts +9 -0
- package/dist/components/navbar/Navbar.classes.js +9 -0
- package/dist/components/navbar/Navbar.css +110 -110
- package/dist/components/navbar/Navbar.js +16 -16
- package/dist/components/navbar/NavbarRow.js +11 -11
- package/dist/components/navbar/NavbarSection.js +10 -10
- package/dist/components/navbar/NavbarStack.js +11 -11
- package/dist/components/navbar/index.js +1 -3
- package/dist/components/noise-background/NoiseBackground.css +66 -66
- package/dist/components/noise-background/NoiseBackground.js +33 -33
- package/dist/components/noise-background/index.js +1 -3
- package/dist/components/number-field/NumberField.css +198 -198
- package/dist/components/number-field/NumberField.js +43 -42
- package/dist/components/number-field/index.js +1 -9
- package/dist/components/pagination/Pagination.css +121 -121
- package/dist/components/pagination/Pagination.js +32 -32
- package/dist/components/pagination/index.js +1 -3
- package/dist/components/password-field/PasswordField.js +18 -17
- package/dist/components/password-field/index.js +1 -3
- package/dist/components/password-requirements/PasswordRequirements.js +22 -22
- package/dist/components/password-requirements/index.js +1 -3
- package/dist/components/password-rules/index.js +1 -4
- package/dist/components/popover/Popover.css +117 -117
- package/dist/components/popover/Popover.js +52 -51
- package/dist/components/popover/index.js +4 -9
- package/dist/components/progress-bar/ProgressBar.css +104 -104
- package/dist/components/progress-bar/ProgressBar.js +28 -28
- package/dist/components/progress-bar/index.js +1 -3
- package/dist/components/progress-circle/ProgressCircle.css +82 -82
- package/dist/components/progress-circle/ProgressCircle.js +30 -30
- package/dist/components/progress-circle/index.js +1 -3
- package/dist/components/radio/Radio.css +129 -129
- package/dist/components/radio/Radio.js +28 -28
- package/dist/components/radio/index.js +1 -3
- package/dist/components/radio-group/RadioGroup.css +58 -58
- package/dist/components/radio-group/RadioGroup.js +31 -31
- package/dist/components/radio-group/context.js +2 -2
- package/dist/components/radio-group/index.js +4 -4
- package/dist/components/range-calendar/RangeCalendar.css +51 -51
- package/dist/components/range-calendar/RangeCalendar.js +18 -18
- package/dist/components/range-calendar/index.js +1 -3
- package/dist/components/scroll-shadow/ScrollShadow.css +93 -93
- package/dist/components/scroll-shadow/ScrollShadow.js +17 -17
- package/dist/components/scroll-shadow/index.js +1 -3
- package/dist/components/scroll-shadow/useScrollShadow.js +4 -4
- package/dist/components/search-field/SearchField.css +183 -183
- package/dist/components/search-field/SearchField.js +42 -41
- package/dist/components/search-field/index.js +1 -9
- package/dist/components/select/Select.css +284 -284
- package/dist/components/select/Select.js +130 -130
- package/dist/components/select/index.js +1 -3
- package/dist/components/separator/Separator.css +35 -35
- package/dist/components/separator/Separator.js +12 -11
- package/dist/components/separator/index.js +1 -4
- package/dist/components/size-picker/SizePicker.js +17 -17
- package/dist/components/size-picker/index.js +2 -6
- package/dist/components/size-picker/sizeStore.js +5 -5
- package/dist/components/skeleton/Skeleton.css +95 -95
- package/dist/components/skeleton/Skeleton.js +9 -9
- package/dist/components/skeleton/index.js +1 -3
- package/dist/components/slider/Slider.css +122 -122
- package/dist/components/slider/Slider.js +27 -27
- package/dist/components/slider/index.js +1 -3
- package/dist/components/spinner/Spinner.css +131 -131
- package/dist/components/spinner/Spinner.js +17 -17
- package/dist/components/spinner/index.js +1 -5
- package/dist/components/surface/Surface.css +37 -37
- package/dist/components/surface/Surface.js +11 -10
- package/dist/components/surface/index.js +1 -4
- package/dist/components/table/ExpandToggle.js +14 -14
- package/dist/components/table/InlineConfirm.js +12 -12
- package/dist/components/table/MobileListView.js +24 -24
- package/dist/components/table/SortIcon.js +11 -11
- package/dist/components/table/Table.css +426 -426
- package/dist/components/table/Table.js +82 -81
- package/dist/components/table/VirtualSpacerRow.js +9 -9
- package/dist/components/table/index.js +7 -38
- package/dist/components/tabs/Tabs.css +203 -203
- package/dist/components/tabs/Tabs.js +62 -61
- package/dist/components/tabs/index.js +1 -4
- package/dist/components/tag/Tag.css +121 -121
- package/dist/components/tag/Tag.js +41 -40
- package/dist/components/tag/index.js +3 -6
- package/dist/components/tag-group/TagGroup.css +22 -22
- package/dist/components/tag-group/TagGroup.js +24 -23
- package/dist/components/tag-group/context.js +2 -2
- package/dist/components/tag-group/index.js +1 -6
- package/dist/components/text/Text.css +66 -66
- package/dist/components/text/Text.js +11 -10
- package/dist/components/text/index.js +1 -5
- package/dist/components/text-area/TextArea.css +95 -95
- package/dist/components/text-area/TextArea.js +14 -13
- package/dist/components/text-area/index.js +1 -5
- package/dist/components/text-field/TextField.css +33 -33
- package/dist/components/text-field/TextField.js +14 -13
- package/dist/components/text-field/index.js +3 -7
- package/dist/components/textarea/Textarea.js +10 -11
- package/dist/components/textarea/index.js +1 -6
- package/dist/components/theme-color-picker/ThemeColorPicker.js +52 -52
- package/dist/components/theme-color-picker/hueShift.js +8 -8
- package/dist/components/theme-color-picker/index.js +2 -7
- package/dist/components/time-field/TimeField.css +215 -215
- package/dist/components/time-field/TimeField.js +43 -42
- package/dist/components/time-field/index.js +3 -11
- package/dist/components/toast/Toast.css +344 -344
- package/dist/components/toast/Toast.js +101 -100
- package/dist/components/toast/index.js +1 -19
- package/dist/components/toggle/Toggle.css +237 -237
- package/dist/components/toggle/Toggle.js +31 -31
- package/dist/components/toggle/index.js +1 -3
- package/dist/components/toolbar/Toolbar.css +55 -55
- package/dist/components/toolbar/Toolbar.js +12 -11
- package/dist/components/toolbar/index.js +1 -5
- package/dist/components/tooltip/Tooltip.css +153 -153
- package/dist/components/tooltip/Tooltip.js +40 -39
- package/dist/components/tooltip/index.js +1 -7
- package/dist/components/utils.js +6 -7
- package/dist/components/video-preview/VideoPreview.js +14 -13
- package/dist/components/video-preview/index.js +1 -3
- package/dist/hooks/date/useCalendarNavigation.js +18 -18
- package/dist/hooks/date/useCalendarState.js +19 -19
- package/dist/hooks/date/useDateSelection.js +7 -7
- package/dist/hooks/date/usePickerOpenState.js +8 -8
- package/dist/hooks/date/useRangeSelection.js +16 -16
- package/dist/hooks/form/FormContext.js +3 -3
- package/dist/hooks/form/createForm.js +4 -4
- package/dist/hooks/form/index.js +4 -10
- package/dist/hooks/form/useFieldNew.js +10 -10
- package/dist/hooks/layout/index.js +1 -3
- package/dist/hooks/layout/useDesktop.js +4 -4
- package/dist/hooks/table/index.js +8 -18
- package/dist/hooks/table/useAnchoredOverlayPosition.js +5 -5
- package/dist/hooks/table/useTableExpansion.js +4 -4
- package/dist/hooks/table/useTableFiltering.js +8 -8
- package/dist/hooks/table/useTableModel.js +10 -10
- package/dist/hooks/table/useTablePagination.js +4 -4
- package/dist/hooks/table/useTableSelection.js +4 -4
- package/dist/hooks/table/useTableSorting.js +6 -6
- package/dist/index.css +74 -74
- package/dist/index.js +108 -398
- package/dist/lib/refs/index.js +1 -3
- package/dist/lib/refs/mergeRefs.js +2 -2
- package/dist/lib/style/index.js +1 -4
- package/dist/lib/tag/createIsButton.js +4 -4
- package/dist/lib/tag/createTagName.js +2 -2
- package/dist/lib/tag/index.js +2 -7
- package/dist/motion/engine.js +4 -4
- package/dist/motion/index.js +10 -39
- package/dist/motion/popmotion.js +2 -2
- package/dist/motion/presets.js +4 -4
- package/dist/motion/route.js +7 -7
- package/dist/motion/solid/AnimatedCollapse.js +27 -26
- package/dist/motion/solid/MotionDiv.js +17 -16
- package/dist/motion/solid/Presence.js +13 -12
- package/dist/motion/solid/index.js +3 -10
- package/dist/motion/system.js +9 -9
- package/dist/primitives/streaming/index.js +2 -5
- package/dist/primitives/streaming/useStreamingBuffer.js +2 -2
- package/dist/primitives/streaming/useStreamingSubscription.js +7 -7
- package/dist/primitives/virtualizer/index.js +1 -3
- package/dist/primitives/virtualizer/useVirtualRows.js +7 -7
- package/dist/purge-manifest.json +15350 -15141
- package/dist/styles/base/index.css +43 -43
- package/dist/styles/icons/generated-icons.css +1 -173
- package/dist/styles/themes/dark.css +141 -141
- package/dist/styles/themes/light.css +143 -143
- package/package.json +31 -31
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createComponent, insert, mergeProps, setAttribute, spread, template, use } from "solid-js/web";
|
|
2
2
|
import "./Calendar.css";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
var _tmpl$ = /*#__PURE__*/
|
|
8
|
-
const
|
|
9
|
-
const [local, others] =
|
|
3
|
+
import { For, Show, createEffect, createMemo, createUniqueId, splitProps } from "solid-js";
|
|
4
|
+
import { twMerge } from "tailwind-merge";
|
|
5
|
+
import { DAYS_PER_WEEK, addDays, compareDates, getToday, normalizeDate, parseDate, shiftDateByMonths, toISODate, useCalendarNavigation, useCalendarState, useDateSelection } from "../../hooks/date/index.js";
|
|
6
|
+
import { CLASSES } from "./Calendar.classes.js";
|
|
7
|
+
var _tmpl$ = /*#__PURE__*/ template('<div><div><div><button type=button><svg><path d="m15 18-6-6 6-6"></path></svg></button></div><div></div><div><button type=button><svg><path d="m9 18 6-6-6-6"></path></svg></button></div></div><div><div><div></div></div><div>'), _tmpl$2 = /*#__PURE__*/ template("<span>"), _tmpl$3 = /*#__PURE__*/ template("<div>"), _tmpl$4 = /*#__PURE__*/ template("<button type=button><span>");
|
|
8
|
+
const Calendar = (props)=>{
|
|
9
|
+
const [local, others] = splitProps(props, [
|
|
10
10
|
"class",
|
|
11
11
|
"className",
|
|
12
12
|
"dataTheme",
|
|
@@ -30,43 +30,43 @@ const Calendar_Calendar = (props)=>{
|
|
|
30
30
|
"isDisabled",
|
|
31
31
|
"disabled"
|
|
32
32
|
]);
|
|
33
|
-
const selectionMode =
|
|
34
|
-
const dateSelection =
|
|
33
|
+
const selectionMode = createMemo(()=>local.selectionMode ?? "single");
|
|
34
|
+
const dateSelection = useDateSelection({
|
|
35
35
|
value: ()=>local.value,
|
|
36
36
|
defaultValue: ()=>local.defaultValue,
|
|
37
37
|
onChange: ()=>local.onChange
|
|
38
38
|
});
|
|
39
|
-
const selectedDate =
|
|
40
|
-
const rangeStart =
|
|
41
|
-
const rangeEnd =
|
|
42
|
-
const rangePreview =
|
|
43
|
-
const defaultReferenceDate =
|
|
44
|
-
const focusReferenceDate =
|
|
45
|
-
const minDate =
|
|
46
|
-
const maxDate =
|
|
47
|
-
const locale =
|
|
48
|
-
const weekdayFormat =
|
|
49
|
-
const showOutsideDays =
|
|
50
|
-
const isCalendarDisabled =
|
|
39
|
+
const selectedDate = createMemo(()=>"single" === selectionMode() ? dateSelection.selectedDate() : null);
|
|
40
|
+
const rangeStart = createMemo(()=>normalizeDate(local.rangeStart));
|
|
41
|
+
const rangeEnd = createMemo(()=>normalizeDate(local.rangeEnd));
|
|
42
|
+
const rangePreview = createMemo(()=>normalizeDate(local.rangePreview));
|
|
43
|
+
const defaultReferenceDate = createMemo(()=>normalizeDate(local.defaultValue) ?? getToday());
|
|
44
|
+
const focusReferenceDate = createMemo(()=>selectedDate() ?? rangeEnd() ?? rangeStart() ?? normalizeDate(local.value) ?? defaultReferenceDate());
|
|
45
|
+
const minDate = createMemo(()=>normalizeDate(local.minValue));
|
|
46
|
+
const maxDate = createMemo(()=>normalizeDate(local.maxValue));
|
|
47
|
+
const locale = createMemo(()=>local.locale ?? "en-US");
|
|
48
|
+
const weekdayFormat = createMemo(()=>local.weekdayFormat ?? "short");
|
|
49
|
+
const showOutsideDays = createMemo(()=>local.showOutsideDays ?? true);
|
|
50
|
+
const isCalendarDisabled = createMemo(()=>Boolean(local.isDisabled) || Boolean(local.disabled));
|
|
51
51
|
const isDateUnavailable = (date)=>Boolean(local.isDateUnavailable?.(date));
|
|
52
52
|
const isDateDisabled = (date)=>{
|
|
53
53
|
if (isCalendarDisabled()) return true;
|
|
54
54
|
const min = minDate();
|
|
55
|
-
if (min &&
|
|
55
|
+
if (min && compareDates(date, min) < 0) return true;
|
|
56
56
|
const max = maxDate();
|
|
57
|
-
if (max &&
|
|
57
|
+
if (max && compareDates(date, max) > 0) return true;
|
|
58
58
|
return isDateUnavailable(date);
|
|
59
59
|
};
|
|
60
|
-
const navigation =
|
|
60
|
+
const navigation = useCalendarNavigation({
|
|
61
61
|
initialFocusedDate: ()=>focusReferenceDate(),
|
|
62
62
|
minDate,
|
|
63
63
|
maxDate,
|
|
64
64
|
isDateDisabled
|
|
65
65
|
});
|
|
66
|
-
|
|
66
|
+
createEffect(()=>{
|
|
67
67
|
navigation.syncFocusedDate(focusReferenceDate());
|
|
68
68
|
});
|
|
69
|
-
const calendarState =
|
|
69
|
+
const calendarState = useCalendarState({
|
|
70
70
|
selectionMode: ()=>selectionMode(),
|
|
71
71
|
locale,
|
|
72
72
|
weekdayFormat,
|
|
@@ -81,7 +81,7 @@ const Calendar_Calendar = (props)=>{
|
|
|
81
81
|
});
|
|
82
82
|
let rootRef;
|
|
83
83
|
const focusDateButton = (date)=>{
|
|
84
|
-
const dateValue =
|
|
84
|
+
const dateValue = toISODate(date);
|
|
85
85
|
queueMicrotask(()=>{
|
|
86
86
|
const target = rootRef?.querySelector(`[data-slot=\"calendar-cell\"][data-date=\"${dateValue}\"]`);
|
|
87
87
|
target?.focus();
|
|
@@ -101,7 +101,7 @@ const Calendar_Calendar = (props)=>{
|
|
|
101
101
|
};
|
|
102
102
|
const handleCellKeyDown = (event)=>{
|
|
103
103
|
if (isCalendarDisabled()) return;
|
|
104
|
-
const dateValue =
|
|
104
|
+
const dateValue = parseDate(event.currentTarget.dataset.date);
|
|
105
105
|
if (!dateValue) return;
|
|
106
106
|
if ("Enter" === event.key || " " === event.key) {
|
|
107
107
|
event.preventDefault();
|
|
@@ -112,35 +112,35 @@ const Calendar_Calendar = (props)=>{
|
|
|
112
112
|
let direction = 1;
|
|
113
113
|
switch(event.key){
|
|
114
114
|
case "ArrowLeft":
|
|
115
|
-
nextDate =
|
|
115
|
+
nextDate = addDays(dateValue, -1);
|
|
116
116
|
direction = -1;
|
|
117
117
|
break;
|
|
118
118
|
case "ArrowRight":
|
|
119
|
-
nextDate =
|
|
119
|
+
nextDate = addDays(dateValue, 1);
|
|
120
120
|
direction = 1;
|
|
121
121
|
break;
|
|
122
122
|
case "ArrowUp":
|
|
123
|
-
nextDate =
|
|
123
|
+
nextDate = addDays(dateValue, -DAYS_PER_WEEK);
|
|
124
124
|
direction = -1;
|
|
125
125
|
break;
|
|
126
126
|
case "ArrowDown":
|
|
127
|
-
nextDate =
|
|
127
|
+
nextDate = addDays(dateValue, DAYS_PER_WEEK);
|
|
128
128
|
direction = 1;
|
|
129
129
|
break;
|
|
130
130
|
case "Home":
|
|
131
|
-
nextDate =
|
|
131
|
+
nextDate = addDays(dateValue, -dateValue.getDay());
|
|
132
132
|
direction = -1;
|
|
133
133
|
break;
|
|
134
134
|
case "End":
|
|
135
|
-
nextDate =
|
|
135
|
+
nextDate = addDays(dateValue, DAYS_PER_WEEK - 1 - dateValue.getDay());
|
|
136
136
|
direction = 1;
|
|
137
137
|
break;
|
|
138
138
|
case "PageUp":
|
|
139
|
-
nextDate =
|
|
139
|
+
nextDate = shiftDateByMonths(dateValue, -1);
|
|
140
140
|
direction = -1;
|
|
141
141
|
break;
|
|
142
142
|
case "PageDown":
|
|
143
|
-
nextDate =
|
|
143
|
+
nextDate = shiftDateByMonths(dateValue, 1);
|
|
144
144
|
direction = 1;
|
|
145
145
|
break;
|
|
146
146
|
default:
|
|
@@ -151,16 +151,16 @@ const Calendar_Calendar = (props)=>{
|
|
|
151
151
|
const nextFocus = navigation.moveFocusToDate(nextDate, direction);
|
|
152
152
|
focusDateButton(nextFocus);
|
|
153
153
|
};
|
|
154
|
-
const uniqueId =
|
|
154
|
+
const uniqueId = createUniqueId();
|
|
155
155
|
const headingId = `calendar-heading-${uniqueId}`;
|
|
156
156
|
return (()=>{
|
|
157
157
|
var _el$ = _tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$3.nextSibling, _el$7 = _el$6.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$8.firstChild, _el$0 = _el$2.nextSibling, _el$1 = _el$0.firstChild, _el$10 = _el$1.firstChild, _el$11 = _el$1.nextSibling;
|
|
158
|
-
|
|
158
|
+
use((node)=>{
|
|
159
159
|
rootRef = node;
|
|
160
160
|
if ("function" == typeof local.ref) local.ref(node);
|
|
161
161
|
}, _el$);
|
|
162
|
-
|
|
163
|
-
class:
|
|
162
|
+
spread(_el$, mergeProps(others, ()=>({
|
|
163
|
+
class: twMerge(CLASSES.Root.base, isCalendarDisabled() && CLASSES.Root.flag.disabled, local.class, local.className)
|
|
164
164
|
}), {
|
|
165
165
|
"data-slot": "calendar",
|
|
166
166
|
get ["data-selection-mode"] () {
|
|
@@ -179,18 +179,18 @@ const Calendar_Calendar = (props)=>{
|
|
|
179
179
|
return isCalendarDisabled() ? "true" : void 0;
|
|
180
180
|
}
|
|
181
181
|
}), false, true);
|
|
182
|
-
|
|
183
|
-
class:
|
|
182
|
+
spread(_el$2, mergeProps(()=>({
|
|
183
|
+
class: CLASSES.Header.base
|
|
184
184
|
}), {
|
|
185
185
|
"data-slot": "calendar-header"
|
|
186
186
|
}), false, true);
|
|
187
|
-
|
|
188
|
-
class:
|
|
187
|
+
spread(_el$3, mergeProps(()=>({
|
|
188
|
+
class: CLASSES.Nav.base
|
|
189
189
|
}), {
|
|
190
190
|
"data-slot": "calendar-nav"
|
|
191
191
|
}), false, true);
|
|
192
|
-
|
|
193
|
-
class:
|
|
192
|
+
spread(_el$4, mergeProps(()=>({
|
|
193
|
+
class: CLASSES.NavButton.base
|
|
194
194
|
}), {
|
|
195
195
|
"data-slot": "calendar-nav-button",
|
|
196
196
|
"aria-label": "Previous month",
|
|
@@ -202,8 +202,8 @@ const Calendar_Calendar = (props)=>{
|
|
|
202
202
|
return isCalendarDisabled() || !navigation.canNavigatePrevious() ? "true" : void 0;
|
|
203
203
|
}
|
|
204
204
|
}), false, true);
|
|
205
|
-
|
|
206
|
-
class:
|
|
205
|
+
spread(_el$5, mergeProps(()=>({
|
|
206
|
+
class: CLASSES.NavButtonIcon.base
|
|
207
207
|
}), {
|
|
208
208
|
"data-slot": "calendar-nav-button-icon",
|
|
209
209
|
viewBox: "0 0 24 24",
|
|
@@ -214,21 +214,21 @@ const Calendar_Calendar = (props)=>{
|
|
|
214
214
|
"stroke-linecap": "round",
|
|
215
215
|
"stroke-linejoin": "round"
|
|
216
216
|
}), true, true);
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
class:
|
|
217
|
+
setAttribute(_el$6, "id", headingId);
|
|
218
|
+
spread(_el$6, mergeProps(()=>({
|
|
219
|
+
class: CLASSES.Heading.base
|
|
220
220
|
}), {
|
|
221
221
|
"data-slot": "calendar-heading",
|
|
222
222
|
"aria-live": "polite"
|
|
223
223
|
}), false, true);
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
class:
|
|
224
|
+
insert(_el$6, ()=>calendarState.monthFormatter().format(navigation.visibleMonth()));
|
|
225
|
+
spread(_el$7, mergeProps(()=>({
|
|
226
|
+
class: CLASSES.Nav.base
|
|
227
227
|
}), {
|
|
228
228
|
"data-slot": "calendar-nav"
|
|
229
229
|
}), false, true);
|
|
230
|
-
|
|
231
|
-
class:
|
|
230
|
+
spread(_el$8, mergeProps(()=>({
|
|
231
|
+
class: CLASSES.NavButton.base
|
|
232
232
|
}), {
|
|
233
233
|
"data-slot": "calendar-nav-button",
|
|
234
234
|
"aria-label": "Next month",
|
|
@@ -240,8 +240,8 @@ const Calendar_Calendar = (props)=>{
|
|
|
240
240
|
return isCalendarDisabled() || !navigation.canNavigateNext() ? "true" : void 0;
|
|
241
241
|
}
|
|
242
242
|
}), false, true);
|
|
243
|
-
|
|
244
|
-
class:
|
|
243
|
+
spread(_el$9, mergeProps(()=>({
|
|
244
|
+
class: CLASSES.NavButtonIcon.base
|
|
245
245
|
}), {
|
|
246
246
|
"data-slot": "calendar-nav-button-icon",
|
|
247
247
|
viewBox: "0 0 24 24",
|
|
@@ -252,8 +252,8 @@ const Calendar_Calendar = (props)=>{
|
|
|
252
252
|
"stroke-linecap": "round",
|
|
253
253
|
"stroke-linejoin": "round"
|
|
254
254
|
}), true, true);
|
|
255
|
-
|
|
256
|
-
class:
|
|
255
|
+
spread(_el$0, mergeProps(()=>({
|
|
256
|
+
class: CLASSES.Grid.base
|
|
257
257
|
}), {
|
|
258
258
|
"data-slot": "calendar-grid",
|
|
259
259
|
role: "grid",
|
|
@@ -262,75 +262,75 @@ const Calendar_Calendar = (props)=>{
|
|
|
262
262
|
return isCalendarDisabled() ? "true" : void 0;
|
|
263
263
|
}
|
|
264
264
|
}), false, true);
|
|
265
|
-
|
|
266
|
-
class:
|
|
265
|
+
spread(_el$1, mergeProps(()=>({
|
|
266
|
+
class: CLASSES.GridHeader.base
|
|
267
267
|
}), {
|
|
268
268
|
"data-slot": "calendar-grid-header",
|
|
269
269
|
role: "rowgroup"
|
|
270
270
|
}), false, true);
|
|
271
|
-
|
|
272
|
-
class:
|
|
271
|
+
spread(_el$10, mergeProps(()=>({
|
|
272
|
+
class: CLASSES.GridRow.base
|
|
273
273
|
}), {
|
|
274
274
|
"data-slot": "calendar-grid-row",
|
|
275
275
|
role: "row"
|
|
276
276
|
}), false, true);
|
|
277
|
-
|
|
277
|
+
insert(_el$10, createComponent(For, {
|
|
278
278
|
get each () {
|
|
279
279
|
return calendarState.weekdayLabels();
|
|
280
280
|
},
|
|
281
281
|
children: (label)=>(()=>{
|
|
282
282
|
var _el$12 = _tmpl$2();
|
|
283
|
-
|
|
284
|
-
class:
|
|
283
|
+
spread(_el$12, mergeProps(()=>({
|
|
284
|
+
class: CLASSES.HeaderCell.base
|
|
285
285
|
}), {
|
|
286
286
|
"data-slot": "calendar-header-cell",
|
|
287
287
|
role: "columnheader"
|
|
288
288
|
}), false, true);
|
|
289
|
-
|
|
289
|
+
insert(_el$12, label);
|
|
290
290
|
return _el$12;
|
|
291
291
|
})()
|
|
292
292
|
}));
|
|
293
|
-
|
|
294
|
-
class:
|
|
293
|
+
spread(_el$11, mergeProps(()=>({
|
|
294
|
+
class: CLASSES.GridBody.base
|
|
295
295
|
}), {
|
|
296
296
|
"data-slot": "calendar-grid-body",
|
|
297
297
|
role: "rowgroup",
|
|
298
298
|
onMouseLeave: ()=>local.onDayHover?.(void 0)
|
|
299
299
|
}), false, true);
|
|
300
|
-
|
|
300
|
+
insert(_el$11, createComponent(For, {
|
|
301
301
|
get each () {
|
|
302
302
|
return calendarState.calendarWeeks();
|
|
303
303
|
},
|
|
304
304
|
children: (week)=>(()=>{
|
|
305
305
|
var _el$13 = _tmpl$3();
|
|
306
|
-
|
|
307
|
-
class:
|
|
306
|
+
spread(_el$13, mergeProps(()=>({
|
|
307
|
+
class: CLASSES.GridRow.base
|
|
308
308
|
}), {
|
|
309
309
|
"data-slot": "calendar-grid-row",
|
|
310
310
|
role: "row"
|
|
311
311
|
}), false, true);
|
|
312
|
-
|
|
312
|
+
insert(_el$13, createComponent(For, {
|
|
313
313
|
each: week,
|
|
314
314
|
children: (date)=>{
|
|
315
315
|
const cellState = calendarState.getCellState(date);
|
|
316
|
-
const isoDate =
|
|
316
|
+
const isoDate = toISODate(date);
|
|
317
317
|
return (()=>{
|
|
318
318
|
var _el$14 = _tmpl$3();
|
|
319
|
-
|
|
320
|
-
class:
|
|
319
|
+
spread(_el$14, mergeProps(()=>({
|
|
320
|
+
class: CLASSES.DayWrapper.base
|
|
321
321
|
}), {
|
|
322
322
|
"data-slot": "calendar-day-wrapper",
|
|
323
323
|
role: "presentation"
|
|
324
324
|
}), false, true);
|
|
325
|
-
|
|
325
|
+
insert(_el$14, createComponent(Show, {
|
|
326
326
|
get when () {
|
|
327
327
|
return showOutsideDays() || !cellState.isOutsideMonth;
|
|
328
328
|
},
|
|
329
329
|
get fallback () {
|
|
330
330
|
return (()=>{
|
|
331
331
|
var _el$17 = _tmpl$2();
|
|
332
|
-
|
|
333
|
-
class:
|
|
332
|
+
spread(_el$17, mergeProps(()=>({
|
|
333
|
+
class: CLASSES.DayPlaceholder.base
|
|
334
334
|
}), {
|
|
335
335
|
"data-slot": "calendar-day-placeholder",
|
|
336
336
|
"aria-hidden": "true"
|
|
@@ -340,8 +340,8 @@ const Calendar_Calendar = (props)=>{
|
|
|
340
340
|
},
|
|
341
341
|
get children () {
|
|
342
342
|
var _el$15 = _tmpl$4(), _el$16 = _el$15.firstChild;
|
|
343
|
-
|
|
344
|
-
class:
|
|
343
|
+
spread(_el$15, mergeProps(()=>({
|
|
344
|
+
class: twMerge(CLASSES.Cell.base, cellState.isSelected && CLASSES.Cell.flag.selected, cellState.isRangeStart && CLASSES.Cell.flag.rangeStart, cellState.isRangeEnd && CLASSES.Cell.flag.rangeEnd, cellState.isInCommittedRange && CLASSES.Cell.flag.inRange, cellState.isInPreviewRange && !cellState.isInCommittedRange && CLASSES.Cell.flag.inPreviewRange, cellState.isToday && CLASSES.Cell.flag.today, cellState.isOutsideMonth && CLASSES.Cell.flag.outsideMonth, cellState.isDisabled && CLASSES.Cell.flag.disabled, cellState.isUnavailable && CLASSES.Cell.flag.unavailable, cellState.isFocused && CLASSES.Cell.flag.focused)
|
|
345
345
|
}), {
|
|
346
346
|
"data-slot": "calendar-cell",
|
|
347
347
|
"data-date": isoDate,
|
|
@@ -396,12 +396,12 @@ const Calendar_Calendar = (props)=>{
|
|
|
396
396
|
},
|
|
397
397
|
onKeyDown: handleCellKeyDown
|
|
398
398
|
}), false, true);
|
|
399
|
-
|
|
400
|
-
class:
|
|
399
|
+
spread(_el$16, mergeProps(()=>({
|
|
400
|
+
class: CLASSES.Day.base
|
|
401
401
|
}), {
|
|
402
402
|
"data-slot": "calendar-day"
|
|
403
403
|
}), false, true);
|
|
404
|
-
|
|
404
|
+
insert(_el$16, ()=>date.getDate());
|
|
405
405
|
return _el$15;
|
|
406
406
|
}
|
|
407
407
|
}));
|
|
@@ -415,5 +415,5 @@ const Calendar_Calendar = (props)=>{
|
|
|
415
415
|
return _el$;
|
|
416
416
|
})();
|
|
417
417
|
};
|
|
418
|
-
const
|
|
419
|
-
export
|
|
418
|
+
const calendar_Calendar = Calendar;
|
|
419
|
+
export default calendar_Calendar;
|
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
@layer components {
|
|
2
|
-
.card {
|
|
3
|
-
position: relative;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
gap: 0.75rem;
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
border-radius: var(--card-radius, calc(var(--radius-box, 0.75rem) + var(--card-padding, 1rem)));
|
|
9
|
-
padding: var(--card-padding, 1rem);
|
|
10
|
-
color: var(--card-fg, var(--color-base-content));
|
|
11
|
-
background-color: var(--card-bg, var(--color-base-100));
|
|
12
|
-
border: 1px solid var(--card-border, transparent);
|
|
13
|
-
box-shadow:
|
|
14
|
-
var(
|
|
15
|
-
--card-shadow,
|
|
16
|
-
0 8px 24px -18px rgb(0 0 0 / 0.45),
|
|
17
|
-
0 6px 14px -10px rgb(0 0 0 / 0.28)
|
|
18
|
-
);
|
|
19
|
-
transition:
|
|
20
|
-
background-color 160ms ease,
|
|
21
|
-
border-color 160ms ease,
|
|
22
|
-
box-shadow 200ms ease,
|
|
23
|
-
transform 200ms ease;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.card:focus-visible {
|
|
27
|
-
outline: 2px solid currentColor;
|
|
28
|
-
outline-offset: 2px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.card--default {
|
|
32
|
-
--card-bg: var(--color-base-100);
|
|
33
|
-
--card-border: transparent;
|
|
34
|
-
--card-shadow:
|
|
35
|
-
0 8px 24px -18px rgb(0 0 0 / 0.45),
|
|
36
|
-
0 6px 14px -10px rgb(0 0 0 / 0.28);
|
|
37
|
-
--card-hover-shadow:
|
|
38
|
-
0 16px 30px -20px rgb(0 0 0 / 0.5),
|
|
39
|
-
0 8px 18px -12px rgb(0 0 0 / 0.35);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.card--flat {
|
|
43
|
-
--card-bg: var(--color-base-200);
|
|
44
|
-
--card-border: transparent;
|
|
45
|
-
--card-shadow: none;
|
|
46
|
-
--card-hover-shadow: none;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.card--bordered {
|
|
50
|
-
--card-bg: var(--color-base-100);
|
|
51
|
-
--card-border: var(--color-base-300);
|
|
52
|
-
--card-shadow: none;
|
|
53
|
-
--card-hover-shadow:
|
|
54
|
-
0 6px 20px -16px rgb(0 0 0 / 0.4),
|
|
55
|
-
0 5px 12px -10px rgb(0 0 0 / 0.28);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.card--shadow {
|
|
59
|
-
--card-bg: var(--color-base-100);
|
|
60
|
-
--card-border: transparent;
|
|
61
|
-
--card-shadow:
|
|
62
|
-
0 20px 40px -24px rgb(0 0 0 / 0.55),
|
|
63
|
-
0 12px 20px -14px rgb(0 0 0 / 0.35);
|
|
64
|
-
--card-hover-shadow:
|
|
65
|
-
0 26px 44px -26px rgb(0 0 0 / 0.6),
|
|
66
|
-
0 14px 24px -15px rgb(0 0 0 / 0.4);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.card--hoverable,
|
|
70
|
-
.card--pressable {
|
|
71
|
-
cursor: pointer;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
@media (hover: hover) {
|
|
75
|
-
.card--hoverable:hover,
|
|
76
|
-
.card--pressable:hover {
|
|
77
|
-
box-shadow: var(--card-hover-shadow, var(--card-shadow));
|
|
78
|
-
transform: translateY(-1px);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.card--pressable:active,
|
|
83
|
-
.card--pressable[data-pressed="true"] {
|
|
84
|
-
transform: scale(0.99);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.card__header,
|
|
88
|
-
.card__body,
|
|
89
|
-
.card__footer {
|
|
90
|
-
display: flex;
|
|
91
|
-
width: 100%;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.card__header {
|
|
95
|
-
flex-direction: column;
|
|
96
|
-
gap: 0.25rem;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.card__body {
|
|
100
|
-
flex: 1 1 auto;
|
|
101
|
-
flex-direction: column;
|
|
102
|
-
gap: 0.5rem;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.card__footer {
|
|
106
|
-
align-items: center;
|
|
107
|
-
flex-wrap: wrap;
|
|
108
|
-
gap: 0.5rem;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
1
|
+
@layer components {
|
|
2
|
+
.card {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: 0.75rem;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
border-radius: var(--card-radius, calc(var(--radius-box, 0.75rem) + var(--card-padding, 1rem)));
|
|
9
|
+
padding: var(--card-padding, 1rem);
|
|
10
|
+
color: var(--card-fg, var(--color-base-content));
|
|
11
|
+
background-color: var(--card-bg, var(--color-base-100));
|
|
12
|
+
border: 1px solid var(--card-border, transparent);
|
|
13
|
+
box-shadow:
|
|
14
|
+
var(
|
|
15
|
+
--card-shadow,
|
|
16
|
+
0 8px 24px -18px rgb(0 0 0 / 0.45),
|
|
17
|
+
0 6px 14px -10px rgb(0 0 0 / 0.28)
|
|
18
|
+
);
|
|
19
|
+
transition:
|
|
20
|
+
background-color 160ms ease,
|
|
21
|
+
border-color 160ms ease,
|
|
22
|
+
box-shadow 200ms ease,
|
|
23
|
+
transform 200ms ease;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.card:focus-visible {
|
|
27
|
+
outline: 2px solid currentColor;
|
|
28
|
+
outline-offset: 2px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.card--default {
|
|
32
|
+
--card-bg: var(--color-base-100);
|
|
33
|
+
--card-border: transparent;
|
|
34
|
+
--card-shadow:
|
|
35
|
+
0 8px 24px -18px rgb(0 0 0 / 0.45),
|
|
36
|
+
0 6px 14px -10px rgb(0 0 0 / 0.28);
|
|
37
|
+
--card-hover-shadow:
|
|
38
|
+
0 16px 30px -20px rgb(0 0 0 / 0.5),
|
|
39
|
+
0 8px 18px -12px rgb(0 0 0 / 0.35);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.card--flat {
|
|
43
|
+
--card-bg: var(--color-base-200);
|
|
44
|
+
--card-border: transparent;
|
|
45
|
+
--card-shadow: none;
|
|
46
|
+
--card-hover-shadow: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.card--bordered {
|
|
50
|
+
--card-bg: var(--color-base-100);
|
|
51
|
+
--card-border: var(--color-base-300);
|
|
52
|
+
--card-shadow: none;
|
|
53
|
+
--card-hover-shadow:
|
|
54
|
+
0 6px 20px -16px rgb(0 0 0 / 0.4),
|
|
55
|
+
0 5px 12px -10px rgb(0 0 0 / 0.28);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.card--shadow {
|
|
59
|
+
--card-bg: var(--color-base-100);
|
|
60
|
+
--card-border: transparent;
|
|
61
|
+
--card-shadow:
|
|
62
|
+
0 20px 40px -24px rgb(0 0 0 / 0.55),
|
|
63
|
+
0 12px 20px -14px rgb(0 0 0 / 0.35);
|
|
64
|
+
--card-hover-shadow:
|
|
65
|
+
0 26px 44px -26px rgb(0 0 0 / 0.6),
|
|
66
|
+
0 14px 24px -15px rgb(0 0 0 / 0.4);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.card--hoverable,
|
|
70
|
+
.card--pressable {
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@media (hover: hover) {
|
|
75
|
+
.card--hoverable:hover,
|
|
76
|
+
.card--pressable:hover {
|
|
77
|
+
box-shadow: var(--card-hover-shadow, var(--card-shadow));
|
|
78
|
+
transform: translateY(-1px);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.card--pressable:active,
|
|
83
|
+
.card--pressable[data-pressed="true"] {
|
|
84
|
+
transform: scale(0.99);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.card__header,
|
|
88
|
+
.card__body,
|
|
89
|
+
.card__footer {
|
|
90
|
+
display: flex;
|
|
91
|
+
width: 100%;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.card__header {
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
gap: 0.25rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.card__body {
|
|
100
|
+
flex: 1 1 auto;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
gap: 0.5rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.card__footer {
|
|
106
|
+
align-items: center;
|
|
107
|
+
flex-wrap: wrap;
|
|
108
|
+
gap: 0.5rem;
|
|
109
|
+
}
|
|
110
|
+
}
|