@yamada-ui/react 2.2.5-dev-20260727044042 → 2.2.5-dev-20260727071034
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/dist/cjs/components/accordion/accordion.cjs.map +1 -1
- package/dist/cjs/components/action-bar/action-bar.cjs.map +1 -1
- package/dist/cjs/components/airy/airy.cjs.map +1 -1
- package/dist/cjs/components/alert/alert.cjs.map +1 -1
- package/dist/cjs/components/alpha-slider/alpha-slider.cjs.map +1 -1
- package/dist/cjs/components/autocomplete/autocomplete.cjs.map +1 -1
- package/dist/cjs/components/autocomplete/use-autocomplete.cjs.map +1 -1
- package/dist/cjs/components/avatar/avatar-group.cjs.map +1 -1
- package/dist/cjs/components/avatar/avatar.cjs.map +1 -1
- package/dist/cjs/components/blockquote/blockquote.cjs.map +1 -1
- package/dist/cjs/components/breadcrumb/breadcrumb.cjs.map +1 -1
- package/dist/cjs/components/button/button-group.cjs.map +1 -1
- package/dist/cjs/components/button/button.cjs.map +1 -1
- package/dist/cjs/components/calendar/calendar.cjs.map +1 -1
- package/dist/cjs/components/calendar/use-calendar.cjs.map +1 -1
- package/dist/cjs/components/carousel/carousel.cjs.map +1 -1
- package/dist/cjs/components/chart/cartesian-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/chart.cjs.map +1 -1
- package/dist/cjs/components/chart/polar-chart.cjs.map +1 -1
- package/dist/cjs/components/checkbox/checkbox-group.cjs.map +1 -1
- package/dist/cjs/components/checkbox/checkbox.cjs.map +1 -1
- package/dist/cjs/components/checkbox-card/checkbox-card-group.cjs.map +1 -1
- package/dist/cjs/components/checkbox-card/checkbox-card.cjs.map +1 -1
- package/dist/cjs/components/circle-progress/circle-progress.cjs.map +1 -1
- package/dist/cjs/components/collapse/collapse.cjs.map +1 -1
- package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
- package/dist/cjs/components/color-selector/color-selector.cjs.map +1 -1
- package/dist/cjs/components/color-swatch/color-swatch-group.cjs.map +1 -1
- package/dist/cjs/components/color-swatch/color-swatch.cjs.map +1 -1
- package/dist/cjs/components/data-list/data-list.cjs.map +1 -1
- package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
- package/dist/cjs/components/date-picker/use-date-picker.cjs.map +1 -1
- package/dist/cjs/components/drawer/drawer.cjs.map +1 -1
- package/dist/cjs/components/dropzone/dropzone.cjs.map +1 -1
- package/dist/cjs/components/editable/editable.cjs.map +1 -1
- package/dist/cjs/components/empty-state/empty-state.cjs.map +1 -1
- package/dist/cjs/components/fade/fade.cjs.map +1 -1
- package/dist/cjs/components/fade-scale/fade-scale.cjs.map +1 -1
- package/dist/cjs/components/field/field.cjs.map +1 -1
- package/dist/cjs/components/fieldset/fieldset.cjs.map +1 -1
- package/dist/cjs/components/file-input/file-input.cjs.map +1 -1
- package/dist/cjs/components/flip/flip.cjs.map +1 -1
- package/dist/cjs/components/focus-lock/focus-lock.cjs.map +1 -1
- package/dist/cjs/components/form/form.cjs.map +1 -1
- package/dist/cjs/components/format/format-byte.cjs.map +1 -1
- package/dist/cjs/components/format/format-date-time.cjs.map +1 -1
- package/dist/cjs/components/format/format-number.cjs.map +1 -1
- package/dist/cjs/components/highlight/highlight.cjs.map +1 -1
- package/dist/cjs/components/hue-slider/hue-slider.cjs.map +1 -1
- package/dist/cjs/components/icon/icons/circle-euro-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/circle-euro-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/index.cjs +9 -3
- package/dist/cjs/components/icon/icons/index.cjs.map +1 -1
- package/dist/cjs/components/icon/icons/scan-box-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/scan-box-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/server-plus-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/server-plus-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/index.cjs +6 -2
- package/dist/cjs/components/indicator/indicator.cjs.map +1 -1
- package/dist/cjs/components/infinite-scroll-area/infinite-scroll-area.cjs.map +1 -1
- package/dist/cjs/components/input/input-group.cjs.map +1 -1
- package/dist/cjs/components/link-box/link-box.cjs.map +1 -1
- package/dist/cjs/components/list/list.cjs.map +1 -1
- package/dist/cjs/components/loading/audio.cjs.map +1 -1
- package/dist/cjs/components/loading/background.cjs.map +1 -1
- package/dist/cjs/components/loading/circles.cjs.map +1 -1
- package/dist/cjs/components/loading/dots.cjs.map +1 -1
- package/dist/cjs/components/loading/grid.cjs.map +1 -1
- package/dist/cjs/components/loading/loading-provider.cjs.map +1 -1
- package/dist/cjs/components/loading/oval.cjs.map +1 -1
- package/dist/cjs/components/loading/page.cjs.map +1 -1
- package/dist/cjs/components/loading/puff.cjs.map +1 -1
- package/dist/cjs/components/loading/rings.cjs.map +1 -1
- package/dist/cjs/components/loading/screen.cjs.map +1 -1
- package/dist/cjs/components/loading/suspense.cjs.map +1 -1
- package/dist/cjs/components/menu/menu.cjs.map +1 -1
- package/dist/cjs/components/menu/use-menu.cjs.map +1 -1
- package/dist/cjs/components/modal/modal.cjs.map +1 -1
- package/dist/cjs/components/native-accordion/native-accordion.cjs.map +1 -1
- package/dist/cjs/components/native-popover/native-popover.cjs.map +1 -1
- package/dist/cjs/components/native-select/native-select.cjs.map +1 -1
- package/dist/cjs/components/native-select/use-native-select.cjs.map +1 -1
- package/dist/cjs/components/native-table/native-table.cjs.map +1 -1
- package/dist/cjs/components/notice/notice-provider.cjs.map +1 -1
- package/dist/cjs/components/notice/notice.cjs.map +1 -1
- package/dist/cjs/components/notice/use-notice.cjs.map +1 -1
- package/dist/cjs/components/number-input/number-input.cjs.map +1 -1
- package/dist/cjs/components/pagination/pagination.cjs.map +1 -1
- package/dist/cjs/components/password-input/password-input.cjs.map +1 -1
- package/dist/cjs/components/password-input/strength-meter.cjs.map +1 -1
- package/dist/cjs/components/picture/picture.cjs.map +1 -1
- package/dist/cjs/components/pin-input/pin-input.cjs.map +1 -1
- package/dist/cjs/components/popover/popover.cjs.map +1 -1
- package/dist/cjs/components/progress/progress.cjs.map +1 -1
- package/dist/cjs/components/qr-code/qr-code.cjs.map +1 -1
- package/dist/cjs/components/radio/radio-group.cjs.map +1 -1
- package/dist/cjs/components/radio/radio.cjs.map +1 -1
- package/dist/cjs/components/radio-card/radio-card-group.cjs.map +1 -1
- package/dist/cjs/components/radio-card/radio-card.cjs.map +1 -1
- package/dist/cjs/components/rating/rating.cjs.map +1 -1
- package/dist/cjs/components/reorder/reorder.cjs.map +1 -1
- package/dist/cjs/components/resizable/resizable.cjs.map +1 -1
- package/dist/cjs/components/ripple/ripple.cjs.map +1 -1
- package/dist/cjs/components/rotate/rotate.cjs.map +1 -1
- package/dist/cjs/components/saturation-slider/saturation-slider.cjs.map +1 -1
- package/dist/cjs/components/saturation-slider/use-saturation-slider.cjs.map +1 -1
- package/dist/cjs/components/segmented-control/segmented-control.cjs.map +1 -1
- package/dist/cjs/components/select/select.cjs.map +1 -1
- package/dist/cjs/components/select/use-select.cjs.map +1 -1
- package/dist/cjs/components/sidebar/sidebar.cjs.map +1 -1
- package/dist/cjs/components/skeleton/skeleton-text.cjs.map +1 -1
- package/dist/cjs/components/slide/slide.cjs.map +1 -1
- package/dist/cjs/components/slide-fade/slide-fade.cjs.map +1 -1
- package/dist/cjs/components/slider/slider.cjs.map +1 -1
- package/dist/cjs/components/slot/slot.cjs.map +1 -1
- package/dist/cjs/components/snacks/snacks.cjs.map +1 -1
- package/dist/cjs/components/stack/stack.cjs.map +1 -1
- package/dist/cjs/components/stack/z-stack.cjs.map +1 -1
- package/dist/cjs/components/stat/stat.cjs.map +1 -1
- package/dist/cjs/components/status/status.cjs.map +1 -1
- package/dist/cjs/components/steps/steps.cjs.map +1 -1
- package/dist/cjs/components/switch/switch.cjs.map +1 -1
- package/dist/cjs/components/table/table.cjs.map +1 -1
- package/dist/cjs/components/tabs/tabs.cjs.map +1 -1
- package/dist/cjs/components/tag/tag.cjs.map +1 -1
- package/dist/cjs/components/timeline/timeline.cjs.map +1 -1
- package/dist/cjs/components/tip/tip.cjs.map +1 -1
- package/dist/cjs/components/toggle/toggle-group.cjs.map +1 -1
- package/dist/cjs/components/tooltip/tooltip.cjs.map +1 -1
- package/dist/cjs/components/tree/tree.cjs.map +1 -1
- package/dist/cjs/components/tree/use-tree.cjs.map +1 -1
- package/dist/cjs/core/components/create-component.cjs.map +1 -1
- package/dist/cjs/core/system/breakpoint.cjs.map +1 -1
- package/dist/cjs/core/system/environment-provider.cjs.map +1 -1
- package/dist/cjs/core/system/styled.cjs.map +1 -1
- package/dist/cjs/core/system/theme-provider.cjs.map +1 -1
- package/dist/cjs/hooks/use-async-callback/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-breakpoint/use-breakpoint.cjs.map +1 -1
- package/dist/cjs/hooks/use-combobox/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-field-sizing/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-outside-click/index.cjs.map +1 -1
- package/dist/cjs/index.cjs +9 -3
- package/dist/cjs/providers/ui-provider/ui-provider.cjs.map +1 -1
- package/dist/cjs/utils/store.cjs.map +1 -1
- package/dist/esm/components/accordion/accordion.js.map +1 -1
- package/dist/esm/components/action-bar/action-bar.js.map +1 -1
- package/dist/esm/components/airy/airy.js.map +1 -1
- package/dist/esm/components/alert/alert.js.map +1 -1
- package/dist/esm/components/alpha-slider/alpha-slider.js.map +1 -1
- package/dist/esm/components/autocomplete/autocomplete.js.map +1 -1
- package/dist/esm/components/autocomplete/use-autocomplete.js.map +1 -1
- package/dist/esm/components/avatar/avatar-group.js.map +1 -1
- package/dist/esm/components/avatar/avatar.js.map +1 -1
- package/dist/esm/components/blockquote/blockquote.js.map +1 -1
- package/dist/esm/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/esm/components/button/button-group.js.map +1 -1
- package/dist/esm/components/button/button.js.map +1 -1
- package/dist/esm/components/calendar/calendar.js.map +1 -1
- package/dist/esm/components/calendar/use-calendar.js.map +1 -1
- package/dist/esm/components/carousel/carousel.js.map +1 -1
- package/dist/esm/components/chart/cartesian-chart.js.map +1 -1
- package/dist/esm/components/chart/chart.js.map +1 -1
- package/dist/esm/components/chart/polar-chart.js.map +1 -1
- package/dist/esm/components/checkbox/checkbox-group.js.map +1 -1
- package/dist/esm/components/checkbox/checkbox.js.map +1 -1
- package/dist/esm/components/checkbox-card/checkbox-card-group.js.map +1 -1
- package/dist/esm/components/checkbox-card/checkbox-card.js.map +1 -1
- package/dist/esm/components/circle-progress/circle-progress.js.map +1 -1
- package/dist/esm/components/collapse/collapse.js.map +1 -1
- package/dist/esm/components/color-picker/color-picker.js.map +1 -1
- package/dist/esm/components/color-selector/color-selector.js.map +1 -1
- package/dist/esm/components/color-swatch/color-swatch-group.js.map +1 -1
- package/dist/esm/components/color-swatch/color-swatch.js.map +1 -1
- package/dist/esm/components/data-list/data-list.js.map +1 -1
- package/dist/esm/components/date-picker/date-picker.js.map +1 -1
- package/dist/esm/components/date-picker/use-date-picker.js.map +1 -1
- package/dist/esm/components/drawer/drawer.js.map +1 -1
- package/dist/esm/components/dropzone/dropzone.js.map +1 -1
- package/dist/esm/components/editable/editable.js.map +1 -1
- package/dist/esm/components/empty-state/empty-state.js.map +1 -1
- package/dist/esm/components/fade/fade.js.map +1 -1
- package/dist/esm/components/fade-scale/fade-scale.js.map +1 -1
- package/dist/esm/components/field/field.js.map +1 -1
- package/dist/esm/components/fieldset/fieldset.js.map +1 -1
- package/dist/esm/components/file-input/file-input.js.map +1 -1
- package/dist/esm/components/flip/flip.js.map +1 -1
- package/dist/esm/components/focus-lock/focus-lock.js.map +1 -1
- package/dist/esm/components/form/form.js.map +1 -1
- package/dist/esm/components/format/format-byte.js.map +1 -1
- package/dist/esm/components/format/format-date-time.js.map +1 -1
- package/dist/esm/components/format/format-number.js.map +1 -1
- package/dist/esm/components/highlight/highlight.js.map +1 -1
- package/dist/esm/components/hue-slider/hue-slider.js.map +1 -1
- package/dist/esm/components/icon/icons/circle-euro-icon.js +14 -0
- package/dist/esm/components/icon/icons/circle-euro-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/index.js +7 -3
- package/dist/esm/components/icon/icons/index.js.map +1 -1
- package/dist/esm/components/icon/icons/scan-box-icon.js +14 -0
- package/dist/esm/components/icon/icons/scan-box-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/server-plus-icon.js +14 -0
- package/dist/esm/components/icon/icons/server-plus-icon.js.map +1 -0
- package/dist/esm/components/icon/index.js +4 -2
- package/dist/esm/components/indicator/indicator.js.map +1 -1
- package/dist/esm/components/infinite-scroll-area/infinite-scroll-area.js.map +1 -1
- package/dist/esm/components/input/input-group.js.map +1 -1
- package/dist/esm/components/link-box/link-box.js.map +1 -1
- package/dist/esm/components/list/list.js.map +1 -1
- package/dist/esm/components/loading/audio.js.map +1 -1
- package/dist/esm/components/loading/background.js.map +1 -1
- package/dist/esm/components/loading/circles.js.map +1 -1
- package/dist/esm/components/loading/dots.js.map +1 -1
- package/dist/esm/components/loading/grid.js.map +1 -1
- package/dist/esm/components/loading/loading-provider.js.map +1 -1
- package/dist/esm/components/loading/oval.js.map +1 -1
- package/dist/esm/components/loading/page.js.map +1 -1
- package/dist/esm/components/loading/puff.js.map +1 -1
- package/dist/esm/components/loading/rings.js.map +1 -1
- package/dist/esm/components/loading/screen.js.map +1 -1
- package/dist/esm/components/loading/suspense.js.map +1 -1
- package/dist/esm/components/menu/menu.js.map +1 -1
- package/dist/esm/components/menu/use-menu.js.map +1 -1
- package/dist/esm/components/modal/modal.js.map +1 -1
- package/dist/esm/components/native-accordion/native-accordion.js.map +1 -1
- package/dist/esm/components/native-popover/native-popover.js.map +1 -1
- package/dist/esm/components/native-select/native-select.js.map +1 -1
- package/dist/esm/components/native-select/use-native-select.js.map +1 -1
- package/dist/esm/components/native-table/native-table.js.map +1 -1
- package/dist/esm/components/notice/notice-provider.js.map +1 -1
- package/dist/esm/components/notice/notice.js.map +1 -1
- package/dist/esm/components/notice/use-notice.js.map +1 -1
- package/dist/esm/components/number-input/number-input.js.map +1 -1
- package/dist/esm/components/pagination/pagination.js.map +1 -1
- package/dist/esm/components/password-input/password-input.js.map +1 -1
- package/dist/esm/components/password-input/strength-meter.js.map +1 -1
- package/dist/esm/components/picture/picture.js.map +1 -1
- package/dist/esm/components/pin-input/pin-input.js.map +1 -1
- package/dist/esm/components/popover/popover.js.map +1 -1
- package/dist/esm/components/progress/progress.js.map +1 -1
- package/dist/esm/components/qr-code/qr-code.js.map +1 -1
- package/dist/esm/components/radio/radio-group.js.map +1 -1
- package/dist/esm/components/radio/radio.js.map +1 -1
- package/dist/esm/components/radio-card/radio-card-group.js.map +1 -1
- package/dist/esm/components/radio-card/radio-card.js.map +1 -1
- package/dist/esm/components/rating/rating.js.map +1 -1
- package/dist/esm/components/reorder/reorder.js.map +1 -1
- package/dist/esm/components/resizable/resizable.js.map +1 -1
- package/dist/esm/components/ripple/ripple.js.map +1 -1
- package/dist/esm/components/rotate/rotate.js.map +1 -1
- package/dist/esm/components/saturation-slider/saturation-slider.js.map +1 -1
- package/dist/esm/components/saturation-slider/use-saturation-slider.js.map +1 -1
- package/dist/esm/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/esm/components/select/select.js.map +1 -1
- package/dist/esm/components/select/use-select.js.map +1 -1
- package/dist/esm/components/sidebar/sidebar.js.map +1 -1
- package/dist/esm/components/skeleton/skeleton-text.js.map +1 -1
- package/dist/esm/components/slide/slide.js.map +1 -1
- package/dist/esm/components/slide-fade/slide-fade.js.map +1 -1
- package/dist/esm/components/slider/slider.js.map +1 -1
- package/dist/esm/components/slot/slot.js.map +1 -1
- package/dist/esm/components/snacks/snacks.js.map +1 -1
- package/dist/esm/components/stack/stack.js.map +1 -1
- package/dist/esm/components/stack/z-stack.js.map +1 -1
- package/dist/esm/components/stat/stat.js.map +1 -1
- package/dist/esm/components/status/status.js.map +1 -1
- package/dist/esm/components/steps/steps.js.map +1 -1
- package/dist/esm/components/switch/switch.js.map +1 -1
- package/dist/esm/components/table/table.js.map +1 -1
- package/dist/esm/components/tabs/tabs.js.map +1 -1
- package/dist/esm/components/tag/tag.js.map +1 -1
- package/dist/esm/components/timeline/timeline.js.map +1 -1
- package/dist/esm/components/tip/tip.js.map +1 -1
- package/dist/esm/components/toggle/toggle-group.js.map +1 -1
- package/dist/esm/components/tooltip/tooltip.js.map +1 -1
- package/dist/esm/components/tree/tree.js.map +1 -1
- package/dist/esm/components/tree/use-tree.js.map +1 -1
- package/dist/esm/core/components/create-component.js.map +1 -1
- package/dist/esm/core/system/breakpoint.js.map +1 -1
- package/dist/esm/core/system/environment-provider.js.map +1 -1
- package/dist/esm/core/system/styled.js.map +1 -1
- package/dist/esm/core/system/theme-provider.js.map +1 -1
- package/dist/esm/hooks/use-breakpoint/use-breakpoint.js.map +1 -1
- package/dist/esm/hooks/use-combobox/index.js.map +1 -1
- package/dist/esm/hooks/use-field-sizing/index.js.map +1 -1
- package/dist/esm/hooks/use-outside-click/index.js.map +1 -1
- package/dist/esm/index.js +7 -3
- package/dist/esm/providers/ui-provider/ui-provider.js.map +1 -1
- package/dist/esm/utils/store.js.map +1 -1
- package/dist/types/components/avatar/avatar.d.ts +3 -3
- package/dist/types/components/avatar/avatar.style.d.ts +1 -1
- package/dist/types/components/data-list/data-list.style.d.ts +1 -1
- package/dist/types/components/field/field.style.d.ts +2 -2
- package/dist/types/components/fieldset/fieldset.style.d.ts +1 -1
- package/dist/types/components/icon/icons/circle-euro-icon.d.ts +13 -0
- package/dist/types/components/icon/icons/index.d.ts +5 -3
- package/dist/types/components/icon/icons/index.types.d.ts +1 -1
- package/dist/types/components/icon/icons/scan-box-icon.d.ts +13 -0
- package/dist/types/components/icon/icons/server-plus-icon.d.ts +13 -0
- package/dist/types/components/icon/index.d.ts +4 -2
- package/dist/types/components/menu/use-menu.d.ts +1 -1
- package/dist/types/components/number-input/number-input.style.d.ts +1 -1
- package/dist/types/components/steps/steps.style.d.ts +1 -1
- package/dist/types/components/timeline/timeline.d.ts +1 -1
- package/dist/types/components/timeline/timeline.style.d.ts +1 -1
- package/dist/types/index.d.ts +5 -3
- package/package.json +5 -5
- package/dist/cjs/components/icon/icons/circle-euro-sign-icon.cjs +0 -14
- package/dist/cjs/components/icon/icons/circle-euro-sign-icon.cjs.map +0 -1
- package/dist/esm/components/icon/icons/circle-euro-sign-icon.js +0 -14
- package/dist/esm/components/icon/icons/circle-euro-sign-icon.js.map +0 -1
- package/dist/types/components/icon/icons/circle-euro-sign-icon.d.ts +0 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-calendar.js","names":["createContext"],"sources":["../../../../src/components/calendar/use-calendar.ts"],"sourcesContent":["\"use client\"\n\nimport type { FocusEvent, KeyboardEvent } from \"react\"\nimport type { HTMLProps, PropGetter, RequiredPropGetter } from \"../../core\"\nimport type { Descendant } from \"../../hooks/use-descendants\"\nimport type { Locale } from \"../../providers/i18n-provider\"\nimport type { AnyString, Dict } from \"../../utils\"\nimport dayjs from \"dayjs\"\nimport { useCallback, useMemo, useRef } from \"react\"\nimport { mergeProps, useSplitProps } from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { createDescendants } from \"../../hooks/use-descendants\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport {\n ariaAttr,\n contains,\n createContext,\n dataAttr,\n handlerAll,\n isArray,\n isDate,\n isNumber,\n isObject,\n mergeRefs,\n runKeyAction,\n useUpdateEffect,\n visuallyHiddenAttributes,\n} from \"../../utils\"\nimport { useDateTimeFormat } from \"../format\"\n\nexport const DEFAULT_HOLIDAYS: Date[] = []\nexport const DEFAULT_WEEKEND_DAYS: number[] = [0, 6]\nexport const DEFAULT_FIRST_DAY_OF_WEEK: StartDayOfWeek = \"sunday\"\nexport const DEFAULT_MAX_DATE: Date = new Date(\"2099-12-31\")\nexport const DEFAULT_MIN_DATE: Date = new Date(\"1900-01-01\")\n\nexport type MaybeDate = Date | Date[] | undefined | { end?: Date; start?: Date }\nexport type MaybeDateValue<\n Multiple extends boolean = false,\n Range extends boolean = false,\n> = Range extends true\n ? { end?: Date; start?: Date }\n : Multiple extends true\n ? Date[]\n : Date | undefined\nexport type StartDayOfWeek = \"monday\" | \"sunday\"\nexport interface CalendarFormat {\n day?: Intl.DateTimeFormatOptions[\"day\"] | null\n month?: Intl.DateTimeFormatOptions[\"month\"] | null\n weekday?: Intl.DateTimeFormatOptions[\"weekday\"] | null\n year?: Intl.DateTimeFormatOptions[\"year\"] | null\n}\n\nexport const getStartOfWeek = (\n date: Date,\n startDayOfWeek: StartDayOfWeek,\n): Date =>\n dayjs(date)\n .subtract(startDayOfWeek === \"monday\" ? 1 : 0, \"day\")\n .startOf(\"week\")\n .add(startDayOfWeek === \"monday\" ? 1 : 0, \"day\")\n .toDate()\n\nexport const getEndOfWeek = (\n date: Date,\n startDayOfWeek: StartDayOfWeek,\n): Date =>\n dayjs(date)\n .subtract(startDayOfWeek === \"monday\" ? 1 : 0, \"day\")\n .endOf(\"week\")\n .add(startDayOfWeek === \"monday\" ? 1 : 0, \"day\")\n .toDate()\n\nexport const getWeekdays = (\n startDayOfWeek: StartDayOfWeek,\n format: (value: Date) => string,\n): { label: string; value: number }[] => {\n let weekdays: { label: string; value: number }[] = []\n\n const date = getStartOfWeek(new Date(), startDayOfWeek)\n\n for (let i = 0; i < 7; i += 1) {\n const label = format(date)\n const value = date.getDay()\n\n weekdays = [...weekdays, { label, value }]\n\n date.setDate(date.getDate() + 1)\n }\n\n return weekdays\n}\n\nexport const getMonthDays = (\n date: Date,\n startDayOfWeek: StartDayOfWeek,\n format: (value: Date) => string,\n): { label: string; value: Date }[][] => {\n const currentMonth = date.getMonth()\n const startOfMonth = new Date(date.getFullYear(), currentMonth, 1)\n const endOfMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0)\n const startDate = getStartOfWeek(startOfMonth, startDayOfWeek)\n const endDate = getEndOfWeek(endOfMonth, startDayOfWeek)\n\n const weeks: { label: string; value: Date }[][] = []\n\n while (startDate <= endDate) {\n const days: { label: string; value: Date }[] = []\n\n for (let i = 0; i < 7; i += 1) {\n const value = new Date(startDate)\n const label = format(value)\n\n days.push({ label, value })\n\n startDate.setDate(startDate.getDate() + 1)\n }\n\n weeks.push(days)\n }\n\n return weeks\n}\n\nexport const isSameYear = (\n date: Date | undefined,\n comparison: Date | undefined,\n): boolean =>\n date instanceof Date &&\n comparison instanceof Date &&\n dayjs(date).isSame(comparison, \"year\")\n\nexport const isSameMonth = (\n date: Date | undefined,\n comparison: Date | undefined,\n): boolean =>\n date instanceof Date &&\n comparison instanceof Date &&\n dayjs(date).isSame(comparison, \"month\")\n\nexport const isSameDate = (\n date: Date | undefined,\n comparison: Date | undefined,\n) =>\n date instanceof Date &&\n comparison instanceof Date &&\n dayjs(date).isSame(comparison, \"date\")\n\nexport const isAfterDate = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isAfter(date, \"date\")\n\nexport const isBeforeDate = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isBefore(date, \"date\")\n\nexport const isSameAfterDate = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"date\") || dayjs(value).isAfter(date, \"date\"))\n\nexport const isSameBeforeDate = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"date\") || dayjs(value).isBefore(date, \"date\"))\n\nexport const isAfterMonth = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isAfter(date, \"month\")\n\nexport const isBeforeMonth = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isBefore(date, \"month\")\n\nexport const isSameAfterMonth = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"month\") || dayjs(value).isAfter(date, \"month\"))\n\nexport const isSameBeforeMonth = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"month\") || dayjs(value).isBefore(date, \"month\"))\n\nexport const isAfterYear = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isAfter(date, \"year\")\n\nexport const isBeforeYear = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isBefore(date, \"year\")\n\nexport const isSameAfterYear = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"year\") || dayjs(value).isAfter(date, \"year\"))\n\nexport const isSameBeforeYear = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"year\") || dayjs(value).isBefore(date, \"year\"))\n\nexport const isIncludeDates = (comparison: Date, dates: Date[]) =>\n dates.some((date) => dayjs(date).isSame(comparison, \"date\"))\n\nexport const isInRange = (date: Date, minDate?: Date, maxDate?: Date) => {\n const hasMinDate = minDate instanceof Date\n const hasMaxDate = maxDate instanceof Date\n\n if (!hasMaxDate && !hasMinDate) return false\n\n const minInRange = hasMinDate ? isAfterDate(date, minDate) : false\n const maxInRange = hasMaxDate ? isBeforeDate(date, maxDate) : false\n\n return maxInRange && minInRange\n}\n\nexport const sortDates = (dates: Date[], type: \"asc\" | \"desc\" = \"asc\") => {\n if (type === \"asc\")\n return dates.sort((a, b) => (dayjs(a).isAfter(b, \"date\") ? 1 : -1))\n else return dates.sort((a, b) => (dayjs(a).isBefore(b, \"date\") ? 1 : -1))\n}\n\nexport const updateMaybeDateValue =\n (value: Date, max?: number) =>\n (prev: MaybeDate): MaybeDate => {\n if (isArray(prev)) {\n if (isIncludeDates(value, prev))\n return prev.filter((prevValue) => !isSameDate(prevValue, value))\n else if (!isNumber(max) || prev.length < max) return [...prev, value]\n else return prev\n } else if (isObject(prev) && !isDate(prev)) {\n const { end, start } = prev\n\n if ((start && end) || !start) return { end: undefined, start: value }\n else if (isSameDate(start, value))\n return { end: undefined, start: undefined }\n else if (isBeforeDate(value, start)) return { end: start, start: value }\n else return { end: value, start }\n } else {\n if (isSameDate(prev, value)) return undefined\n else return value\n }\n }\n\nexport const getAdjustedMonth = (value: MaybeDate, month: Date) => {\n if (isDate(value)) {\n if (!isSameMonth(value, month)) month = dayjs(value).set(\"date\", 1).toDate()\n } else if (isArray(value)) {\n const lastValue = value.at(-1)\n\n if (lastValue && !isSameMonth(lastValue, month))\n month = dayjs(lastValue).set(\"date\", 1).toDate()\n } else if (isObject(value)) {\n if (value.end) month = dayjs(value.end).set(\"date\", 1).toDate()\n else if (value.start) month = dayjs(value.start).set(\"date\", 1).toDate()\n }\n\n return month\n}\n\nconst {\n DescendantsContext: CalendarDescendantsContext,\n useDescendant: useCalendarDescendant,\n useDescendants: useCalendarDescendants,\n} = createDescendants<HTMLTableCellElement>()\n\nexport {\n CalendarDescendantsContext,\n useCalendarDescendant,\n useCalendarDescendants,\n}\n\ninterface CalendarContext extends Omit<\n UseCalendarReturn,\n | \"descendants\"\n | \"getMonthProps\"\n | \"getMonthSelectProps\"\n | \"getNavigationProps\"\n | \"getNextButtonProps\"\n | \"getPrevButtonProps\"\n | \"getRootProps\"\n | \"getStatusProps\"\n | \"getWeekdayProps\"\n | \"getYearSelectProps\"\n | \"monthDays\"\n | \"monthItems\"\n | \"weekdays\"\n | \"yearItems\"\n> {}\n\nconst [CalendarContext, useCalendarContext] = createContext<CalendarContext>({\n name: \"CalendarContext\",\n})\n\nexport { CalendarContext, useCalendarContext }\n\nexport interface UseCalendarProps<\n Multiple extends boolean = false,\n Range extends boolean = false,\n> extends Omit<HTMLProps, \"defaultValue\" | \"onChange\"> {\n /**\n * The initial month of the calendar.\n *\n * @default new Date()\n */\n defaultMonth?: Date\n /**\n * The initial value of the calendar.\n */\n defaultValue?: MaybeDateValue<Multiple, Range>\n /**\n * If `true`, disables the calendar.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * The format used for conversion.\n * Check the docs to see the format of possible modifiers you can pass.\n *\n * @see https://day.js.org/docs/en/display/format#list-of-localized-formats\n */\n format?: CalendarFormat\n /**\n * Define holidays.\n */\n holidays?: Date[]\n /**\n * The locale of the calendar.\n *\n * @default 'en-US'\n */\n locale?: AnyString | Locale\n /**\n * The maximum selectable value.\n */\n max?: number\n /**\n * The maximum possible date.\n *\n * @default new Date(2099, 11, 31)\n */\n maxDate?: Date\n /**\n * The minimum possible date.\n *\n * @default new Date(1900, 0, 1)\n */\n minDate?: Date\n /**\n * The month of the calendar.\n */\n month?: Date\n /**\n * If `true`, the calendar will be multiple.\n *\n * @default false\n */\n multiple?: Multiple\n /**\n * If `true`, enables date range selection.\n *\n * @default false\n */\n range?: Range\n /**\n * Define the start day of the week.\n *\n * @default 'monday'\n */\n startDayOfWeek?: StartDayOfWeek\n /**\n * If `true`, highlight today.\n *\n * @default true\n */\n today?: boolean\n /**\n * The value of the calendar.\n */\n value?: MaybeDateValue<Multiple, Range>\n /**\n * Define weekend days.\n *\n * @default [0, 6]\n */\n weekendDays?: number[]\n /**\n * Callback function to determine whether the day should be disabled.\n */\n excludeDate?: (date: Date) => boolean\n /**\n * The callback invoked when value state changes.\n */\n onChange?: (value: MaybeDateValue<Multiple, Range>) => void\n /**\n * The callback invoked when month state changes.\n */\n onChangeMonth?: (value: Date) => void\n}\n\nexport const useCalendar = <\n Multiple extends boolean = false,\n Range extends boolean = false,\n>({\n defaultMonth = new Date(),\n multiple = false as Multiple,\n range = false as Range,\n defaultValue = (range\n ? { end: undefined, start: undefined }\n : multiple\n ? []\n : undefined) as MaybeDateValue<Multiple, Range>,\n disabled = false,\n excludeDate,\n format = {},\n holidays = DEFAULT_HOLIDAYS,\n locale: localeProp,\n max,\n maxDate = DEFAULT_MAX_DATE,\n minDate = DEFAULT_MIN_DATE,\n month: monthProp,\n startDayOfWeek = DEFAULT_FIRST_DAY_OF_WEEK,\n today = true,\n value: valueProp,\n weekendDays = DEFAULT_WEEKEND_DAYS,\n onChange: onChangeProp,\n onChangeMonth: onChangeMonthProp,\n ...rest\n}: UseCalendarProps<Multiple, Range> = {}) => {\n if (dayjs(minDate).isAfter(dayjs(maxDate))) maxDate = minDate\n\n const { locale: defaultLocale, t } = useI18n(\"calendar\")\n const locale = localeProp ?? defaultLocale\n const dateTimeFormat = useDateTimeFormat({ locale })\n const yearFormat = useCallback(\n (value: Date) => {\n if (format.year === null) {\n return value.getFullYear().toString()\n } else {\n const year = format.year ?? \"numeric\"\n\n return dateTimeFormat(value, { year })\n }\n },\n [dateTimeFormat, format.year],\n )\n const monthFormat = useCallback(\n (value: Date) => {\n if (format.month === null) {\n return (value.getMonth() + 1).toString()\n } else {\n const month = format.month ?? \"short\"\n\n return dateTimeFormat(value, { month })\n }\n },\n [dateTimeFormat, format.month],\n )\n const weekdayFormat = useCallback(\n (value: Date) => {\n return dateTimeFormat(value, {\n weekday: format.weekday ?? \"short\",\n })\n },\n [dateTimeFormat, format.weekday],\n )\n const dayFormat = useCallback(\n (value: Date) => {\n if (format.day)\n return dateTimeFormat(value, {\n day: format.day,\n })\n else return value.getDate().toString()\n },\n [dateTimeFormat, format.day],\n )\n const descendants = useCalendarDescendants()\n const monthRef = useRef<HTMLTableElement>(null)\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n const [month, setMonth] = useControllableState({\n defaultValue: () => {\n if (dayjs(minDate).isAfter(dayjs(defaultMonth)))\n defaultMonth = dayjs(minDate).set(\"date\", 1).toDate()\n\n if (valueProp) defaultMonth = getAdjustedMonth(valueProp, defaultMonth)\n else if (defaultValue)\n defaultMonth = getAdjustedMonth(defaultValue, defaultMonth)\n\n return defaultMonth\n },\n value: monthProp,\n onChange: onChangeMonthProp,\n })\n const { endOfMonth, startOfMonth } = useMemo(() => {\n const startOfMonth = dayjs(month).startOf(\"month\").toDate()\n const endOfMonth = dayjs(month).endOf(\"month\").toDate()\n\n return { endOfMonth, startOfMonth }\n }, [month])\n const weekdays = useMemo(\n () => getWeekdays(startDayOfWeek, weekdayFormat),\n [startDayOfWeek, weekdayFormat],\n )\n const monthDays = useMemo(\n () => getMonthDays(month, startDayOfWeek, dayFormat),\n [month, startDayOfWeek, dayFormat],\n )\n const yearItems = useMemo(() => {\n const minYear = dayjs(minDate).year()\n const maxYear = dayjs(maxDate).year()\n const yearItems: { label: string; value: string }[] = []\n\n for (let year = minYear; year <= maxYear; year++) {\n const label = yearFormat(dayjs().set(\"year\", year).toDate())\n const value = year.toString()\n\n yearItems.push({ label, value })\n }\n\n return yearItems\n }, [maxDate, minDate, yearFormat])\n const monthItems = useMemo(() => {\n const monthItems: { label: string; value: string }[] = []\n const date = dayjs(month).toDate()\n\n for (let month = 0; month < 12; month++) {\n date.setMonth(month)\n\n if (isAfterMonth(date, maxDate)) continue\n if (isBeforeMonth(date, minDate)) continue\n\n const label = monthFormat(dayjs().set(\"month\", month).toDate())\n const value = month.toString()\n\n monthItems.push({ label, value })\n }\n\n return monthItems\n }, [month, maxDate, minDate, monthFormat])\n\n const onChange = useCallback(\n (value: Date) => {\n if (isBeforeDate(value, minDate)) return\n if (isAfterDate(value, maxDate)) return\n\n setValue(\n (prev) =>\n updateMaybeDateValue(value, max)(prev) as MaybeDateValue<\n Multiple,\n Range\n >,\n )\n },\n [max, maxDate, minDate, setValue],\n )\n\n const onMonthChange = useCallback(\n (month: Date) => {\n if (isAfterMonth(month, maxDate))\n setMonth(dayjs(maxDate).set(\"date\", 1).toDate())\n else if (isBeforeMonth(month, minDate))\n setMonth(dayjs(minDate).set(\"date\", 1).toDate())\n else\n setMonth((prev) => {\n if (isSameMonth(prev, month)) return prev\n\n return month\n })\n },\n [maxDate, minDate, setMonth],\n )\n\n const onPrevMonth = useCallback(() => {\n setMonth((prev) => {\n if (isSameMonth(prev, minDate)) return prev\n\n return dayjs(prev).subtract(1, \"month\").toDate()\n })\n }, [minDate, setMonth])\n\n const onNextMonth = useCallback(() => {\n setMonth((prev) => {\n if (isSameMonth(prev, maxDate)) return prev\n\n return dayjs(prev).add(1, \"month\").toDate()\n })\n }, [maxDate, setMonth])\n\n const onFocus = useCallback(() => {\n let index: null | number = null\n let descendant: Descendant<HTMLTableCellElement> | undefined\n\n if (value) {\n if (isDate(value)) {\n if (isSameMonth(month, new Date())) index = new Date().getDate() - 1\n } else if (isArray(value)) {\n const firstValue = value[0]\n\n if (firstValue && isSameMonth(month, firstValue))\n index = firstValue.getDate() - 1\n } else if (isObject(value)) {\n if (value.start && isSameMonth(month, value.start))\n index = value.start.getDate() - 1\n else if (value.end && isSameMonth(month, value.end))\n index = value.end.getDate() - 1\n }\n } else if (isSameMonth(month, new Date())) {\n index = new Date().getDate() - 1\n }\n\n descendant = descendants.value(index)\n\n if (!descendant) descendant = descendants.enabledFirstValue()\n\n if (!descendant) return\n\n descendant.node.focus()\n descendant.node.tabIndex = 0\n\n if (monthRef.current) monthRef.current.tabIndex = -1\n }, [descendants, month, value])\n\n const onBlur = useCallback((ev: FocusEvent<HTMLTableElement>) => {\n if (contains(monthRef.current, ev.relatedTarget)) return\n\n if (monthRef.current) monthRef.current.tabIndex = 0\n }, [])\n\n useUpdateEffect(() => {\n setMonth((prev) => getAdjustedMonth(value, prev))\n }, [value])\n\n const getRootProps: PropGetter = useCallback(\n (props = {}) =>\n mergeProps({ \"data-disabled\": dataAttr(disabled) }, rest, props)(),\n [disabled, rest],\n )\n\n const getNavigationProps: PropGetter<\"nav\"> = useCallback(\n (props = {}) => ({ \"data-disabled\": dataAttr(disabled), ...props }),\n [disabled],\n )\n\n const getYearSelectProps: PropGetter<\n \"div\",\n { value?: string; onChange?: (value: string) => void },\n { value?: string; onChange?: (value: string) => void }\n > = useCallback(\n (props = {}) => ({\n \"aria-label\": t(\"Choose the year\"),\n disabled,\n value: dayjs(month).get(\"year\").toString(),\n ...props,\n onChange: handlerAll(props.onChange, (value) =>\n onMonthChange(dayjs(month).set(\"year\", parseInt(value)).toDate()),\n ),\n }),\n [disabled, month, onMonthChange, t],\n )\n\n const getMonthSelectProps: PropGetter<\n \"div\",\n { value?: string; onChange?: (value: string) => void },\n { value?: string; onChange?: (value: string) => void }\n > = useCallback(\n (props = {}) => ({\n \"aria-label\": t(\"Choose the month\"),\n disabled,\n value: dayjs(month).get(\"month\").toString(),\n ...props,\n onChange: handlerAll(props.onChange, (value) =>\n onMonthChange(dayjs(month).set(\"month\", parseInt(value)).toDate()),\n ),\n }),\n [disabled, month, onMonthChange, t],\n )\n\n const getStatusProps: PropGetter = useCallback(\n (props = {}) => ({\n style: visuallyHiddenAttributes.style,\n \"aria-live\": \"polite\",\n children: dateTimeFormat(dayjs(month).toDate(), {\n month: \"long\",\n year: \"numeric\",\n }),\n role: \"status\",\n ...props,\n }),\n [dateTimeFormat, month],\n )\n\n const getMonthProps: PropGetter<\"table\"> = useCallback(\n ({ ref, ...props } = {}) => ({\n ref: mergeRefs(ref, monthRef),\n \"aria-label\": dateTimeFormat(dayjs(month).toDate(), {\n month: \"long\",\n year: \"numeric\",\n }),\n \"aria-multiselectable\": ariaAttr(multiple || range),\n \"data-disabled\": dataAttr(disabled),\n role: \"grid\",\n tabIndex: disabled ? -1 : 0,\n ...props,\n onBlur: handlerAll(props.onBlur, onBlur),\n onFocus: handlerAll(props.onFocus, onFocus),\n }),\n [dateTimeFormat, disabled, month, multiple, onBlur, onFocus, range],\n )\n\n const getWeekdayProps: RequiredPropGetter<\"th\", { value: number }> =\n useCallback(\n ({ value, ...props }) => ({\n \"data-disabled\": dataAttr(disabled),\n \"data-value\": value.toString(),\n abbr: dateTimeFormat(dayjs().set(\"day\", value).toDate(), {\n weekday: \"long\",\n }),\n ...props,\n }),\n [dateTimeFormat, disabled],\n )\n\n const getButtonProps: PropGetter<\"button\"> = useCallback(\n (props) => ({\n type: \"button\",\n \"data-disabled\": dataAttr(disabled),\n ...props,\n }),\n [disabled],\n )\n\n const getPrevButtonProps: PropGetter<\"button\"> = useCallback(\n (props = {}) =>\n getButtonProps({\n \"aria-label\": t(\"Go to the previous month\"),\n disabled: isSameBeforeMonth(month, minDate),\n ...props,\n onClick: handlerAll(props.onClick, onPrevMonth),\n }),\n [getButtonProps, minDate, month, onPrevMonth, t],\n )\n\n const getNextButtonProps: PropGetter<\"button\"> = useCallback(\n (props = {}) =>\n getButtonProps({\n \"aria-label\": t(\"Go to the next month\"),\n disabled: isSameAfterMonth(month, maxDate),\n ...props,\n onClick: handlerAll(props.onClick, onNextMonth),\n }),\n [getButtonProps, maxDate, month, onNextMonth, t],\n )\n\n return {\n descendants,\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n monthDays,\n monthItems,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekdays,\n weekendDays,\n yearItems,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getRootProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n }\n}\n\nexport type UseCalendarReturn = ReturnType<typeof useCalendar>\n\nexport interface UseCalendarDayProps extends Omit<HTMLProps<\"td\">, \"value\"> {\n value: Date\n}\n\nexport const useCalendarDay = ({ value, ...rest }: UseCalendarDayProps) => {\n const { t } = useI18n(\"calendar\")\n const {\n disabled: rootDisabled,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n startDayOfWeek,\n today: highlightToday,\n value: selectedValue,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n } = useCalendarContext()\n const dateTimeFormat = useDateTimeFormat({ locale })\n const cellRef = useRef<HTMLTableCellElement>(null)\n const outside = useMemo(() => !isSameMonth(month, value), [month, value])\n const holiday = useMemo(\n () => holidays.some((holiday) => isSameDate(holiday, value)),\n [holidays, value],\n )\n const weekend = useMemo(\n () => weekendDays.includes(value.getDay()),\n [weekendDays, value],\n )\n const today = useMemo(\n () => highlightToday && isSameDate(value, new Date()),\n [highlightToday, value],\n )\n const selected = useMemo(() => {\n if (isDate(selectedValue)) return isSameDate(selectedValue, value)\n else if (isArray(selectedValue))\n return selectedValue.some((selectedValue) =>\n isSameDate(selectedValue, value),\n )\n else if (isObject(selectedValue))\n return (\n isSameDate(selectedValue.start, value) ||\n isSameDate(selectedValue.end, value)\n )\n }, [selectedValue, value])\n const disabled = useMemo(() => {\n if (rootDisabled) return true\n if (isAfterDate(value, maxDate)) return true\n if (isBeforeDate(value, minDate)) return true\n if (excludeDate?.(value)) return true\n if (\n isArray(selectedValue) &&\n isNumber(max) &&\n selectedValue.length >= max &&\n !isIncludeDates(value, selectedValue)\n )\n return true\n\n return false\n }, [excludeDate, max, maxDate, minDate, rootDisabled, selectedValue, value])\n const between = useMemo(() => {\n if (isDate(selectedValue) || isArray(selectedValue)) return false\n\n return isInRange(value, selectedValue?.start, selectedValue?.end)\n }, [selectedValue, value])\n const startValue = useMemo(() => {\n if (isDate(selectedValue) || isArray(selectedValue)) return false\n\n const { end, start } = selectedValue ?? {}\n\n return start && end && isSameDate(value, start)\n }, [selectedValue, value])\n const endValue = useMemo(() => {\n if (isDate(selectedValue) || isArray(selectedValue)) return false\n\n const { end, start } = selectedValue ?? {}\n\n return start && end && isSameDate(value, end)\n }, [selectedValue, value])\n const { descendants, register } = useCalendarDescendant({\n disabled: disabled,\n })\n\n const onFocusDescendant = useCallback(\n (descendant?: Descendant<HTMLTableCellElement>) => {\n if (!descendant) return\n\n descendant.node.focus()\n descendant.node.tabIndex = 0\n },\n [],\n )\n\n const onBlur = useCallback(() => {\n if (cellRef.current) cellRef.current.tabIndex = -1\n }, [])\n\n const onClick = useCallback(() => {\n if (disabled) return\n\n onChange(value)\n }, [disabled, onChange, value])\n\n const onPrevDate = useCallback(() => {\n const descendant = descendants.enabledPrevValue(cellRef.current, false)\n\n if (descendant) {\n onFocusDescendant(descendant)\n } else if (!isSameBeforeDate(value, minDate)) {\n onPrevMonth()\n\n setTimeout(() => onFocusDescendant(descendants.enabledLastValue()))\n }\n }, [descendants, minDate, onFocusDescendant, onPrevMonth, value])\n\n const onNextDate = useCallback(() => {\n const descendant = descendants.enabledNextValue(cellRef.current, false)\n\n if (descendant) {\n onFocusDescendant(descendant)\n } else if (!isSameAfterDate(value, maxDate)) {\n onNextMonth()\n\n setTimeout(() => onFocusDescendant(descendants.enabledFirstValue()))\n }\n }, [descendants, maxDate, onFocusDescendant, onNextMonth, value])\n\n const onPrevTraverseDate = useCallback(\n (date: Date) => {\n onMonthChange(dayjs(date).set(\"date\", 1).toDate())\n\n setTimeout(() => {\n const descendant = isBeforeDate(date, minDate)\n ? descendants.enabledFirstValue()\n : descendants.value(date.getDate() - 1)\n\n if (!descendant) return\n\n if (descendant.disabled)\n onFocusDescendant(descendants.enabledNextValue(descendant, false))\n else onFocusDescendant(descendant)\n })\n },\n [descendants, minDate, onFocusDescendant, onMonthChange],\n )\n\n const onNextTraverseDate = useCallback(\n (date: Date) => {\n onMonthChange(dayjs(date).set(\"date\", 1).toDate())\n\n setTimeout(() => {\n const descendant = isAfterDate(date, maxDate)\n ? descendants.enabledLastValue()\n : descendants.value(date.getDate() - 1)\n\n if (!descendant) return\n\n if (descendant.disabled)\n onFocusDescendant(descendants.enabledPrevValue(descendant, false))\n else onFocusDescendant(descendant)\n })\n },\n [descendants, maxDate, onFocusDescendant, onMonthChange],\n )\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLTableCellElement>) => {\n runKeyAction(ev, {\n ArrowDown: () =>\n onNextTraverseDate(dayjs(value).add(1, \"week\").toDate()),\n ArrowLeft: onPrevDate,\n ArrowRight: onNextDate,\n ArrowUp: () =>\n onPrevTraverseDate(dayjs(value).subtract(1, \"week\").toDate()),\n End: () => onNextTraverseDate(getEndOfWeek(value, startDayOfWeek)),\n Enter: onClick,\n Home: () => onPrevTraverseDate(getStartOfWeek(value, startDayOfWeek)),\n PageDown: (ev) => {\n if (ev.shiftKey)\n onNextTraverseDate(dayjs(value).add(1, \"year\").toDate())\n else onNextTraverseDate(dayjs(value).add(1, \"month\").toDate())\n },\n PageUp: (ev) => {\n if (ev.shiftKey)\n onPrevTraverseDate(dayjs(value).subtract(1, \"year\").toDate())\n else onPrevTraverseDate(dayjs(value).subtract(1, \"month\").toDate())\n },\n Space: onClick,\n })\n },\n [\n onClick,\n onNextDate,\n onNextTraverseDate,\n onPrevDate,\n onPrevTraverseDate,\n startDayOfWeek,\n value,\n ],\n )\n\n const getDayProps: PropGetter<\"td\"> = useCallback(\n ({ \"aria-label\": ariaLabel, ...props } = {}) => {\n let resolvedAriaLabel = ariaLabel\n if (!resolvedAriaLabel) {\n resolvedAriaLabel = dateTimeFormat(dayjs(value).toDate(), {\n day: \"numeric\",\n month: \"long\",\n weekday: \"long\",\n year: \"numeric\",\n })\n\n if (today) resolvedAriaLabel = `${t(\"Today\")}, ${resolvedAriaLabel}`\n }\n\n return mergeProps(\n {\n \"aria-disabled\": ariaAttr(disabled),\n \"aria-label\": resolvedAriaLabel,\n \"aria-selected\": ariaAttr(selected),\n \"data-between\": dataAttr(between),\n \"data-disabled\": dataAttr(disabled),\n \"data-end\": dataAttr(endValue),\n \"data-holiday\": dataAttr(holiday),\n \"data-outside\": dataAttr(outside),\n \"data-selected\": dataAttr(selected),\n \"data-start\": dataAttr(startValue),\n \"data-today\": dataAttr(today),\n \"data-value\": dayjs(value).format(\"YYYY-MM-DD\"),\n \"data-weekend\": dataAttr(weekend),\n tabIndex: -1,\n },\n rest,\n props,\n {\n ref: mergeRefs(cellRef, outside ? null : register),\n onBlur,\n onClick,\n onFocus: (ev) => ev.preventDefault(),\n onKeyDown,\n },\n )()\n },\n [\n between,\n dateTimeFormat,\n disabled,\n endValue,\n holiday,\n onBlur,\n onClick,\n onKeyDown,\n outside,\n register,\n rest,\n selected,\n startValue,\n t,\n today,\n value,\n weekend,\n ],\n )\n\n return { outside, getDayProps }\n}\n\nexport type UseCalendarDayReturn = ReturnType<typeof useCalendarDay>\n\nconst calendarProps: (keyof UseCalendarProps)[] = [\n \"defaultMonth\",\n \"defaultValue\",\n \"disabled\",\n \"excludeDate\",\n \"format\",\n \"holidays\",\n \"locale\",\n \"max\",\n \"maxDate\",\n \"minDate\",\n \"month\",\n \"range\",\n \"startDayOfWeek\",\n \"today\",\n \"value\",\n \"weekendDays\",\n \"onChange\",\n \"onChangeMonth\",\n]\n\nexport const useCalendarProps = <\n Y extends boolean = false,\n M extends boolean = false,\n D extends Dict = Dict,\n H extends keyof UseCalendarProps<Y, M> = keyof UseCalendarProps<Y, M>,\n>(\n props: D,\n omitKeys?: H[],\n) => {\n return useSplitProps(\n props,\n calendarProps.filter((key) => !omitKeys?.includes(key as H)),\n ) as unknown as [\n keyof UseCalendarProps<Y, M> extends H\n ? UseCalendarProps<Y, M>\n : Omit<UseCalendarProps<Y, M>, H>,\n Omit<\n M,\n keyof UseCalendarProps<Y, M> extends H\n ? keyof UseCalendarProps<Y, M>\n : Exclude<keyof UseCalendarProps<Y, M>, H>\n >,\n ]\n}\n"],"mappings":";;;;;;;;;;;;;;AA8BA,MAAa,mBAA2B,CAAC;AACzC,MAAa,uBAAiC,CAAC,GAAG,CAAC;AACnD,MAAa,4BAA4C;AACzD,MAAa,mCAAyB,IAAI,KAAK,YAAY;AAC3D,MAAa,mCAAyB,IAAI,KAAK,YAAY;AAmB3D,MAAa,kBACX,MACA,mBAEA,MAAM,IAAI,CAAC,CACR,SAAS,mBAAmB,WAAW,IAAI,GAAG,KAAK,CAAC,CACpD,QAAQ,MAAM,CAAC,CACf,IAAI,mBAAmB,WAAW,IAAI,GAAG,KAAK,CAAC,CAC/C,OAAO;AAEZ,MAAa,gBACX,MACA,mBAEA,MAAM,IAAI,CAAC,CACR,SAAS,mBAAmB,WAAW,IAAI,GAAG,KAAK,CAAC,CACpD,MAAM,MAAM,CAAC,CACb,IAAI,mBAAmB,WAAW,IAAI,GAAG,KAAK,CAAC,CAC/C,OAAO;AAEZ,MAAa,eACX,gBACA,WACuC;CACvC,IAAI,WAA+C,CAAC;CAEpD,MAAM,OAAO,+BAAe,IAAI,KAAK,GAAG,cAAc;CAEtD,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG;EAC7B,MAAM,QAAQ,OAAO,IAAI;EACzB,MAAM,QAAQ,KAAK,OAAO;EAE1B,WAAW,CAAC,GAAG,UAAU;GAAE;GAAO;EAAM,CAAC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CAAC,CAC7D;AAWF"}
|
|
1
|
+
{"version":3,"file":"use-calendar.js","names":["createContext"],"sources":["../../../../src/components/calendar/use-calendar.ts"],"sourcesContent":["\"use client\"\n\nimport type { FocusEvent, KeyboardEvent } from \"react\"\nimport type { HTMLProps, PropGetter, RequiredPropGetter } from \"../../core\"\nimport type { Descendant } from \"../../hooks/use-descendants\"\nimport type { Locale } from \"../../providers/i18n-provider\"\nimport type { AnyString, Dict } from \"../../utils\"\nimport dayjs from \"dayjs\"\nimport { useCallback, useMemo, useRef } from \"react\"\nimport { mergeProps, useSplitProps } from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { createDescendants } from \"../../hooks/use-descendants\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport {\n ariaAttr,\n contains,\n createContext,\n dataAttr,\n handlerAll,\n isArray,\n isDate,\n isNumber,\n isObject,\n mergeRefs,\n runKeyAction,\n useUpdateEffect,\n visuallyHiddenAttributes,\n} from \"../../utils\"\nimport { useDateTimeFormat } from \"../format\"\n\nexport const DEFAULT_HOLIDAYS: Date[] = []\nexport const DEFAULT_WEEKEND_DAYS: number[] = [0, 6]\nexport const DEFAULT_FIRST_DAY_OF_WEEK: StartDayOfWeek = \"sunday\"\nexport const DEFAULT_MAX_DATE: Date = new Date(\"2099-12-31\")\nexport const DEFAULT_MIN_DATE: Date = new Date(\"1900-01-01\")\n\nexport type MaybeDate = Date | Date[] | undefined | { end?: Date; start?: Date }\nexport type MaybeDateValue<\n Multiple extends boolean = false,\n Range extends boolean = false,\n> = Range extends true\n ? { end?: Date; start?: Date }\n : Multiple extends true\n ? Date[]\n : Date | undefined\nexport type StartDayOfWeek = \"monday\" | \"sunday\"\nexport interface CalendarFormat {\n day?: Intl.DateTimeFormatOptions[\"day\"] | null\n month?: Intl.DateTimeFormatOptions[\"month\"] | null\n weekday?: Intl.DateTimeFormatOptions[\"weekday\"] | null\n year?: Intl.DateTimeFormatOptions[\"year\"] | null\n}\n\nexport const getStartOfWeek = (\n date: Date,\n startDayOfWeek: StartDayOfWeek,\n): Date =>\n dayjs(date)\n .subtract(startDayOfWeek === \"monday\" ? 1 : 0, \"day\")\n .startOf(\"week\")\n .add(startDayOfWeek === \"monday\" ? 1 : 0, \"day\")\n .toDate()\n\nexport const getEndOfWeek = (\n date: Date,\n startDayOfWeek: StartDayOfWeek,\n): Date =>\n dayjs(date)\n .subtract(startDayOfWeek === \"monday\" ? 1 : 0, \"day\")\n .endOf(\"week\")\n .add(startDayOfWeek === \"monday\" ? 1 : 0, \"day\")\n .toDate()\n\nexport const getWeekdays = (\n startDayOfWeek: StartDayOfWeek,\n format: (value: Date) => string,\n): { label: string; value: number }[] => {\n let weekdays: { label: string; value: number }[] = []\n\n const date = getStartOfWeek(new Date(), startDayOfWeek)\n\n for (let i = 0; i < 7; i += 1) {\n const label = format(date)\n const value = date.getDay()\n\n weekdays = [...weekdays, { label, value }]\n\n date.setDate(date.getDate() + 1)\n }\n\n return weekdays\n}\n\nexport const getMonthDays = (\n date: Date,\n startDayOfWeek: StartDayOfWeek,\n format: (value: Date) => string,\n): { label: string; value: Date }[][] => {\n const currentMonth = date.getMonth()\n const startOfMonth = new Date(date.getFullYear(), currentMonth, 1)\n const endOfMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0)\n const startDate = getStartOfWeek(startOfMonth, startDayOfWeek)\n const endDate = getEndOfWeek(endOfMonth, startDayOfWeek)\n\n const weeks: { label: string; value: Date }[][] = []\n\n while (startDate <= endDate) {\n const days: { label: string; value: Date }[] = []\n\n for (let i = 0; i < 7; i += 1) {\n const value = new Date(startDate)\n const label = format(value)\n\n days.push({ label, value })\n\n startDate.setDate(startDate.getDate() + 1)\n }\n\n weeks.push(days)\n }\n\n return weeks\n}\n\nexport const isSameYear = (\n date: Date | undefined,\n comparison: Date | undefined,\n): boolean =>\n date instanceof Date &&\n comparison instanceof Date &&\n dayjs(date).isSame(comparison, \"year\")\n\nexport const isSameMonth = (\n date: Date | undefined,\n comparison: Date | undefined,\n): boolean =>\n date instanceof Date &&\n comparison instanceof Date &&\n dayjs(date).isSame(comparison, \"month\")\n\nexport const isSameDate = (\n date: Date | undefined,\n comparison: Date | undefined,\n) =>\n date instanceof Date &&\n comparison instanceof Date &&\n dayjs(date).isSame(comparison, \"date\")\n\nexport const isAfterDate = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isAfter(date, \"date\")\n\nexport const isBeforeDate = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isBefore(date, \"date\")\n\nexport const isSameAfterDate = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"date\") || dayjs(value).isAfter(date, \"date\"))\n\nexport const isSameBeforeDate = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"date\") || dayjs(value).isBefore(date, \"date\"))\n\nexport const isAfterMonth = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isAfter(date, \"month\")\n\nexport const isBeforeMonth = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isBefore(date, \"month\")\n\nexport const isSameAfterMonth = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"month\") || dayjs(value).isAfter(date, \"month\"))\n\nexport const isSameBeforeMonth = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"month\") || dayjs(value).isBefore(date, \"month\"))\n\nexport const isAfterYear = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isAfter(date, \"year\")\n\nexport const isBeforeYear = (value: Date, date: Date | undefined) =>\n date instanceof Date && dayjs(value).isBefore(date, \"year\")\n\nexport const isSameAfterYear = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"year\") || dayjs(value).isAfter(date, \"year\"))\n\nexport const isSameBeforeYear = (value: Date, date: Date | undefined) =>\n date instanceof Date &&\n (dayjs(date).isSame(value, \"year\") || dayjs(value).isBefore(date, \"year\"))\n\nexport const isIncludeDates = (comparison: Date, dates: Date[]) =>\n dates.some((date) => dayjs(date).isSame(comparison, \"date\"))\n\nexport const isInRange = (date: Date, minDate?: Date, maxDate?: Date) => {\n const hasMinDate = minDate instanceof Date\n const hasMaxDate = maxDate instanceof Date\n\n if (!hasMaxDate && !hasMinDate) return false\n\n const minInRange = hasMinDate ? isAfterDate(date, minDate) : false\n const maxInRange = hasMaxDate ? isBeforeDate(date, maxDate) : false\n\n return maxInRange && minInRange\n}\n\nexport const sortDates = (dates: Date[], type: \"asc\" | \"desc\" = \"asc\") => {\n if (type === \"asc\")\n return dates.sort((a, b) => (dayjs(a).isAfter(b, \"date\") ? 1 : -1))\n else return dates.sort((a, b) => (dayjs(a).isBefore(b, \"date\") ? 1 : -1))\n}\n\nexport const updateMaybeDateValue =\n (value: Date, max?: number) =>\n (prev: MaybeDate): MaybeDate => {\n if (isArray(prev)) {\n if (isIncludeDates(value, prev))\n return prev.filter((prevValue) => !isSameDate(prevValue, value))\n else if (!isNumber(max) || prev.length < max) return [...prev, value]\n else return prev\n } else if (isObject(prev) && !isDate(prev)) {\n const { end, start } = prev\n\n if ((start && end) || !start) return { end: undefined, start: value }\n else if (isSameDate(start, value))\n return { end: undefined, start: undefined }\n else if (isBeforeDate(value, start)) return { end: start, start: value }\n else return { end: value, start }\n } else {\n if (isSameDate(prev, value)) return undefined\n else return value\n }\n }\n\nexport const getAdjustedMonth = (value: MaybeDate, month: Date) => {\n if (isDate(value)) {\n if (!isSameMonth(value, month)) month = dayjs(value).set(\"date\", 1).toDate()\n } else if (isArray(value)) {\n const lastValue = value.at(-1)\n\n if (lastValue && !isSameMonth(lastValue, month))\n month = dayjs(lastValue).set(\"date\", 1).toDate()\n } else if (isObject(value)) {\n if (value.end) month = dayjs(value.end).set(\"date\", 1).toDate()\n else if (value.start) month = dayjs(value.start).set(\"date\", 1).toDate()\n }\n\n return month\n}\n\nconst {\n DescendantsContext: CalendarDescendantsContext,\n useDescendant: useCalendarDescendant,\n useDescendants: useCalendarDescendants,\n} = createDescendants<HTMLTableCellElement>()\n\nexport {\n CalendarDescendantsContext,\n useCalendarDescendant,\n useCalendarDescendants,\n}\n\ninterface CalendarContext extends Omit<\n UseCalendarReturn,\n | \"descendants\"\n | \"getMonthProps\"\n | \"getMonthSelectProps\"\n | \"getNavigationProps\"\n | \"getNextButtonProps\"\n | \"getPrevButtonProps\"\n | \"getRootProps\"\n | \"getStatusProps\"\n | \"getWeekdayProps\"\n | \"getYearSelectProps\"\n | \"monthDays\"\n | \"monthItems\"\n | \"weekdays\"\n | \"yearItems\"\n> {}\n\nconst [CalendarContext, useCalendarContext] = createContext<CalendarContext>({\n name: \"CalendarContext\",\n})\n\nexport { CalendarContext, useCalendarContext }\n\nexport interface UseCalendarProps<\n Multiple extends boolean = false,\n Range extends boolean = false,\n> extends Omit<HTMLProps, \"defaultValue\" | \"onChange\"> {\n /**\n * The initial month of the calendar.\n *\n * @default new Date()\n */\n defaultMonth?: Date\n /**\n * The initial value of the calendar.\n */\n defaultValue?: MaybeDateValue<Multiple, Range>\n /**\n * If `true`, disables the calendar.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * The format used for conversion.\n * Check the docs to see the format of possible modifiers you can pass.\n *\n * @see https://day.js.org/docs/en/display/format#list-of-localized-formats\n */\n format?: CalendarFormat\n /**\n * Define holidays.\n */\n holidays?: Date[]\n /**\n * The locale of the calendar.\n *\n * @default 'en-US'\n */\n locale?: AnyString | Locale\n /**\n * The maximum selectable value.\n */\n max?: number\n /**\n * The maximum possible date.\n *\n * @default new Date(2099, 11, 31)\n */\n maxDate?: Date\n /**\n * The minimum possible date.\n *\n * @default new Date(1900, 0, 1)\n */\n minDate?: Date\n /**\n * The month of the calendar.\n */\n month?: Date\n /**\n * If `true`, the calendar will be multiple.\n *\n * @default false\n */\n multiple?: Multiple\n /**\n * If `true`, enables date range selection.\n *\n * @default false\n */\n range?: Range\n /**\n * Define the start day of the week.\n *\n * @default 'monday'\n */\n startDayOfWeek?: StartDayOfWeek\n /**\n * If `true`, highlight today.\n *\n * @default true\n */\n today?: boolean\n /**\n * The value of the calendar.\n */\n value?: MaybeDateValue<Multiple, Range>\n /**\n * Define weekend days.\n *\n * @default [0, 6]\n */\n weekendDays?: number[]\n /**\n * Callback function to determine whether the day should be disabled.\n */\n excludeDate?: (date: Date) => boolean\n /**\n * The callback invoked when value state changes.\n */\n onChange?: (value: MaybeDateValue<Multiple, Range>) => void\n /**\n * The callback invoked when month state changes.\n */\n onChangeMonth?: (value: Date) => void\n}\n\nexport const useCalendar = <\n Multiple extends boolean = false,\n Range extends boolean = false,\n>({\n defaultMonth = new Date(),\n multiple = false as Multiple,\n range = false as Range,\n defaultValue = (range\n ? { end: undefined, start: undefined }\n : multiple\n ? []\n : undefined) as MaybeDateValue<Multiple, Range>,\n disabled = false,\n excludeDate,\n format = {},\n holidays = DEFAULT_HOLIDAYS,\n locale: localeProp,\n max,\n maxDate = DEFAULT_MAX_DATE,\n minDate = DEFAULT_MIN_DATE,\n month: monthProp,\n startDayOfWeek = DEFAULT_FIRST_DAY_OF_WEEK,\n today = true,\n value: valueProp,\n weekendDays = DEFAULT_WEEKEND_DAYS,\n onChange: onChangeProp,\n onChangeMonth: onChangeMonthProp,\n ...rest\n}: UseCalendarProps<Multiple, Range> = {}) => {\n if (dayjs(minDate).isAfter(dayjs(maxDate))) maxDate = minDate\n\n const { locale: defaultLocale, t } = useI18n(\"calendar\")\n const locale = localeProp ?? defaultLocale\n const dateTimeFormat = useDateTimeFormat({ locale })\n const yearFormat = useCallback(\n (value: Date) => {\n if (format.year === null) {\n return value.getFullYear().toString()\n } else {\n const year = format.year ?? \"numeric\"\n\n return dateTimeFormat(value, { year })\n }\n },\n [dateTimeFormat, format.year],\n )\n const monthFormat = useCallback(\n (value: Date) => {\n if (format.month === null) {\n return (value.getMonth() + 1).toString()\n } else {\n const month = format.month ?? \"short\"\n\n return dateTimeFormat(value, { month })\n }\n },\n [dateTimeFormat, format.month],\n )\n const weekdayFormat = useCallback(\n (value: Date) => {\n return dateTimeFormat(value, {\n weekday: format.weekday ?? \"short\",\n })\n },\n [dateTimeFormat, format.weekday],\n )\n const dayFormat = useCallback(\n (value: Date) => {\n if (format.day)\n return dateTimeFormat(value, {\n day: format.day,\n })\n else return value.getDate().toString()\n },\n [dateTimeFormat, format.day],\n )\n const descendants = useCalendarDescendants()\n const monthRef = useRef<HTMLTableElement>(null)\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n const [month, setMonth] = useControllableState({\n defaultValue: () => {\n if (dayjs(minDate).isAfter(dayjs(defaultMonth)))\n defaultMonth = dayjs(minDate).set(\"date\", 1).toDate()\n\n if (valueProp) defaultMonth = getAdjustedMonth(valueProp, defaultMonth)\n else if (defaultValue)\n defaultMonth = getAdjustedMonth(defaultValue, defaultMonth)\n\n return defaultMonth\n },\n value: monthProp,\n onChange: onChangeMonthProp,\n })\n const { endOfMonth, startOfMonth } = useMemo(() => {\n const startOfMonth = dayjs(month).startOf(\"month\").toDate()\n const endOfMonth = dayjs(month).endOf(\"month\").toDate()\n\n return { endOfMonth, startOfMonth }\n }, [month])\n const weekdays = useMemo(\n () => getWeekdays(startDayOfWeek, weekdayFormat),\n [startDayOfWeek, weekdayFormat],\n )\n const monthDays = useMemo(\n () => getMonthDays(month, startDayOfWeek, dayFormat),\n [month, startDayOfWeek, dayFormat],\n )\n const yearItems = useMemo(() => {\n const minYear = dayjs(minDate).year()\n const maxYear = dayjs(maxDate).year()\n const yearItems: { label: string; value: string }[] = []\n\n for (let year = minYear; year <= maxYear; year++) {\n const label = yearFormat(dayjs().set(\"year\", year).toDate())\n const value = year.toString()\n\n yearItems.push({ label, value })\n }\n\n return yearItems\n }, [maxDate, minDate, yearFormat])\n const monthItems = useMemo(() => {\n const monthItems: { label: string; value: string }[] = []\n const date = dayjs(month).toDate()\n\n for (let month = 0; month < 12; month++) {\n date.setMonth(month)\n\n if (isAfterMonth(date, maxDate)) continue\n if (isBeforeMonth(date, minDate)) continue\n\n const label = monthFormat(dayjs().set(\"month\", month).toDate())\n const value = month.toString()\n\n monthItems.push({ label, value })\n }\n\n return monthItems\n }, [month, maxDate, minDate, monthFormat])\n\n const onChange = useCallback(\n (value: Date) => {\n if (isBeforeDate(value, minDate)) return\n if (isAfterDate(value, maxDate)) return\n\n setValue(\n (prev) =>\n updateMaybeDateValue(value, max)(prev) as MaybeDateValue<\n Multiple,\n Range\n >,\n )\n },\n [max, maxDate, minDate, setValue],\n )\n\n const onMonthChange = useCallback(\n (month: Date) => {\n if (isAfterMonth(month, maxDate))\n setMonth(dayjs(maxDate).set(\"date\", 1).toDate())\n else if (isBeforeMonth(month, minDate))\n setMonth(dayjs(minDate).set(\"date\", 1).toDate())\n else\n setMonth((prev) => {\n if (isSameMonth(prev, month)) return prev\n\n return month\n })\n },\n [maxDate, minDate, setMonth],\n )\n\n const onPrevMonth = useCallback(() => {\n setMonth((prev) => {\n if (isSameMonth(prev, minDate)) return prev\n\n return dayjs(prev).subtract(1, \"month\").toDate()\n })\n }, [minDate, setMonth])\n\n const onNextMonth = useCallback(() => {\n setMonth((prev) => {\n if (isSameMonth(prev, maxDate)) return prev\n\n return dayjs(prev).add(1, \"month\").toDate()\n })\n }, [maxDate, setMonth])\n\n const onFocus = useCallback(() => {\n let index: null | number = null\n let descendant: Descendant<HTMLTableCellElement> | undefined\n\n if (value) {\n if (isDate(value)) {\n if (isSameMonth(month, new Date())) index = new Date().getDate() - 1\n } else if (isArray(value)) {\n const firstValue = value[0]\n\n if (firstValue && isSameMonth(month, firstValue))\n index = firstValue.getDate() - 1\n } else if (isObject(value)) {\n if (value.start && isSameMonth(month, value.start))\n index = value.start.getDate() - 1\n else if (value.end && isSameMonth(month, value.end))\n index = value.end.getDate() - 1\n }\n } else if (isSameMonth(month, new Date())) {\n index = new Date().getDate() - 1\n }\n\n descendant = descendants.value(index)\n\n if (!descendant) descendant = descendants.enabledFirstValue()\n\n if (!descendant) return\n\n descendant.node.focus()\n descendant.node.tabIndex = 0\n\n if (monthRef.current) monthRef.current.tabIndex = -1\n }, [descendants, month, value])\n\n const onBlur = useCallback((ev: FocusEvent<HTMLTableElement>) => {\n if (contains(monthRef.current, ev.relatedTarget)) return\n\n if (monthRef.current) monthRef.current.tabIndex = 0\n }, [])\n\n useUpdateEffect(() => {\n setMonth((prev) => getAdjustedMonth(value, prev))\n }, [value])\n\n const getRootProps: PropGetter = useCallback(\n (props = {}) =>\n mergeProps({ \"data-disabled\": dataAttr(disabled) }, rest, props)(),\n [disabled, rest],\n )\n\n const getNavigationProps: PropGetter<\"nav\"> = useCallback(\n (props = {}) => ({ \"data-disabled\": dataAttr(disabled), ...props }),\n [disabled],\n )\n\n const getYearSelectProps: PropGetter<\n \"div\",\n { value?: string; onChange?: (value: string) => void },\n { value?: string; onChange?: (value: string) => void }\n > = useCallback(\n (props = {}) => ({\n \"aria-label\": t(\"Choose the year\"),\n disabled,\n value: dayjs(month).get(\"year\").toString(),\n ...props,\n onChange: handlerAll(props.onChange, (value) =>\n onMonthChange(dayjs(month).set(\"year\", parseInt(value)).toDate()),\n ),\n }),\n [disabled, month, onMonthChange, t],\n )\n\n const getMonthSelectProps: PropGetter<\n \"div\",\n { value?: string; onChange?: (value: string) => void },\n { value?: string; onChange?: (value: string) => void }\n > = useCallback(\n (props = {}) => ({\n \"aria-label\": t(\"Choose the month\"),\n disabled,\n value: dayjs(month).get(\"month\").toString(),\n ...props,\n onChange: handlerAll(props.onChange, (value) =>\n onMonthChange(dayjs(month).set(\"month\", parseInt(value)).toDate()),\n ),\n }),\n [disabled, month, onMonthChange, t],\n )\n\n const getStatusProps: PropGetter = useCallback(\n (props = {}) => ({\n style: visuallyHiddenAttributes.style,\n \"aria-live\": \"polite\",\n children: dateTimeFormat(dayjs(month).toDate(), {\n month: \"long\",\n year: \"numeric\",\n }),\n role: \"status\",\n ...props,\n }),\n [dateTimeFormat, month],\n )\n\n const getMonthProps: PropGetter<\"table\"> = useCallback(\n ({ ref, ...props } = {}) => ({\n ref: mergeRefs(ref, monthRef),\n \"aria-label\": dateTimeFormat(dayjs(month).toDate(), {\n month: \"long\",\n year: \"numeric\",\n }),\n \"aria-multiselectable\": ariaAttr(multiple || range),\n \"data-disabled\": dataAttr(disabled),\n role: \"grid\",\n tabIndex: disabled ? -1 : 0,\n ...props,\n onBlur: handlerAll(props.onBlur, onBlur),\n onFocus: handlerAll(props.onFocus, onFocus),\n }),\n [dateTimeFormat, disabled, month, multiple, onBlur, onFocus, range],\n )\n\n const getWeekdayProps: RequiredPropGetter<\"th\", { value: number }> =\n useCallback(\n ({ value, ...props }) => ({\n \"data-disabled\": dataAttr(disabled),\n \"data-value\": value.toString(),\n abbr: dateTimeFormat(dayjs().set(\"day\", value).toDate(), {\n weekday: \"long\",\n }),\n ...props,\n }),\n [dateTimeFormat, disabled],\n )\n\n const getButtonProps: PropGetter<\"button\"> = useCallback(\n (props) => ({\n type: \"button\",\n \"data-disabled\": dataAttr(disabled),\n ...props,\n }),\n [disabled],\n )\n\n const getPrevButtonProps: PropGetter<\"button\"> = useCallback(\n (props = {}) =>\n getButtonProps({\n \"aria-label\": t(\"Go to the previous month\"),\n disabled: isSameBeforeMonth(month, minDate),\n ...props,\n onClick: handlerAll(props.onClick, onPrevMonth),\n }),\n [getButtonProps, minDate, month, onPrevMonth, t],\n )\n\n const getNextButtonProps: PropGetter<\"button\"> = useCallback(\n (props = {}) =>\n getButtonProps({\n \"aria-label\": t(\"Go to the next month\"),\n disabled: isSameAfterMonth(month, maxDate),\n ...props,\n onClick: handlerAll(props.onClick, onNextMonth),\n }),\n [getButtonProps, maxDate, month, onNextMonth, t],\n )\n\n return {\n descendants,\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n monthDays,\n monthItems,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekdays,\n weekendDays,\n yearItems,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getRootProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n }\n}\n\nexport type UseCalendarReturn = ReturnType<typeof useCalendar>\n\nexport interface UseCalendarDayProps extends Omit<HTMLProps<\"td\">, \"value\"> {\n value: Date\n}\n\nexport const useCalendarDay = ({ value, ...rest }: UseCalendarDayProps) => {\n const { t } = useI18n(\"calendar\")\n const {\n disabled: rootDisabled,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n startDayOfWeek,\n today: highlightToday,\n value: selectedValue,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n } = useCalendarContext()\n const dateTimeFormat = useDateTimeFormat({ locale })\n const cellRef = useRef<HTMLTableCellElement>(null)\n const outside = useMemo(() => !isSameMonth(month, value), [month, value])\n const holiday = useMemo(\n () => holidays.some((holiday) => isSameDate(holiday, value)),\n [holidays, value],\n )\n const weekend = useMemo(\n () => weekendDays.includes(value.getDay()),\n [weekendDays, value],\n )\n const today = useMemo(\n () => highlightToday && isSameDate(value, new Date()),\n [highlightToday, value],\n )\n const selected = useMemo(() => {\n if (isDate(selectedValue)) return isSameDate(selectedValue, value)\n else if (isArray(selectedValue))\n return selectedValue.some((selectedValue) =>\n isSameDate(selectedValue, value),\n )\n else if (isObject(selectedValue))\n return (\n isSameDate(selectedValue.start, value) ||\n isSameDate(selectedValue.end, value)\n )\n }, [selectedValue, value])\n const disabled = useMemo(() => {\n if (rootDisabled) return true\n if (isAfterDate(value, maxDate)) return true\n if (isBeforeDate(value, minDate)) return true\n if (excludeDate?.(value)) return true\n if (\n isArray(selectedValue) &&\n isNumber(max) &&\n selectedValue.length >= max &&\n !isIncludeDates(value, selectedValue)\n )\n return true\n\n return false\n }, [excludeDate, max, maxDate, minDate, rootDisabled, selectedValue, value])\n const between = useMemo(() => {\n if (isDate(selectedValue) || isArray(selectedValue)) return false\n\n return isInRange(value, selectedValue?.start, selectedValue?.end)\n }, [selectedValue, value])\n const startValue = useMemo(() => {\n if (isDate(selectedValue) || isArray(selectedValue)) return false\n\n const { end, start } = selectedValue ?? {}\n\n return start && end && isSameDate(value, start)\n }, [selectedValue, value])\n const endValue = useMemo(() => {\n if (isDate(selectedValue) || isArray(selectedValue)) return false\n\n const { end, start } = selectedValue ?? {}\n\n return start && end && isSameDate(value, end)\n }, [selectedValue, value])\n const { descendants, register } = useCalendarDescendant({\n disabled: disabled,\n })\n\n const onFocusDescendant = useCallback(\n (descendant?: Descendant<HTMLTableCellElement>) => {\n if (!descendant) return\n\n descendant.node.focus()\n descendant.node.tabIndex = 0\n },\n [],\n )\n\n const onBlur = useCallback(() => {\n if (cellRef.current) cellRef.current.tabIndex = -1\n }, [])\n\n const onClick = useCallback(() => {\n if (disabled) return\n\n onChange(value)\n }, [disabled, onChange, value])\n\n const onPrevDate = useCallback(() => {\n const descendant = descendants.enabledPrevValue(cellRef.current, false)\n\n if (descendant) {\n onFocusDescendant(descendant)\n } else if (!isSameBeforeDate(value, minDate)) {\n onPrevMonth()\n\n setTimeout(() => onFocusDescendant(descendants.enabledLastValue()))\n }\n }, [descendants, minDate, onFocusDescendant, onPrevMonth, value])\n\n const onNextDate = useCallback(() => {\n const descendant = descendants.enabledNextValue(cellRef.current, false)\n\n if (descendant) {\n onFocusDescendant(descendant)\n } else if (!isSameAfterDate(value, maxDate)) {\n onNextMonth()\n\n setTimeout(() => onFocusDescendant(descendants.enabledFirstValue()))\n }\n }, [descendants, maxDate, onFocusDescendant, onNextMonth, value])\n\n const onPrevTraverseDate = useCallback(\n (date: Date) => {\n onMonthChange(dayjs(date).set(\"date\", 1).toDate())\n\n setTimeout(() => {\n const descendant = isBeforeDate(date, minDate)\n ? descendants.enabledFirstValue()\n : descendants.value(date.getDate() - 1)\n\n if (!descendant) return\n\n if (descendant.disabled)\n onFocusDescendant(descendants.enabledNextValue(descendant, false))\n else onFocusDescendant(descendant)\n })\n },\n [descendants, minDate, onFocusDescendant, onMonthChange],\n )\n\n const onNextTraverseDate = useCallback(\n (date: Date) => {\n onMonthChange(dayjs(date).set(\"date\", 1).toDate())\n\n setTimeout(() => {\n const descendant = isAfterDate(date, maxDate)\n ? descendants.enabledLastValue()\n : descendants.value(date.getDate() - 1)\n\n if (!descendant) return\n\n if (descendant.disabled)\n onFocusDescendant(descendants.enabledPrevValue(descendant, false))\n else onFocusDescendant(descendant)\n })\n },\n [descendants, maxDate, onFocusDescendant, onMonthChange],\n )\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLTableCellElement>) => {\n runKeyAction(ev, {\n ArrowDown: () =>\n onNextTraverseDate(dayjs(value).add(1, \"week\").toDate()),\n ArrowLeft: onPrevDate,\n ArrowRight: onNextDate,\n ArrowUp: () =>\n onPrevTraverseDate(dayjs(value).subtract(1, \"week\").toDate()),\n End: () => onNextTraverseDate(getEndOfWeek(value, startDayOfWeek)),\n Enter: onClick,\n Home: () => onPrevTraverseDate(getStartOfWeek(value, startDayOfWeek)),\n PageDown: (ev) => {\n if (ev.shiftKey)\n onNextTraverseDate(dayjs(value).add(1, \"year\").toDate())\n else onNextTraverseDate(dayjs(value).add(1, \"month\").toDate())\n },\n PageUp: (ev) => {\n if (ev.shiftKey)\n onPrevTraverseDate(dayjs(value).subtract(1, \"year\").toDate())\n else onPrevTraverseDate(dayjs(value).subtract(1, \"month\").toDate())\n },\n Space: onClick,\n })\n },\n [\n onClick,\n onNextDate,\n onNextTraverseDate,\n onPrevDate,\n onPrevTraverseDate,\n startDayOfWeek,\n value,\n ],\n )\n\n const getDayProps: PropGetter<\"td\"> = useCallback(\n ({ \"aria-label\": ariaLabel, ...props } = {}) => {\n let resolvedAriaLabel = ariaLabel\n if (!resolvedAriaLabel) {\n resolvedAriaLabel = dateTimeFormat(dayjs(value).toDate(), {\n day: \"numeric\",\n month: \"long\",\n weekday: \"long\",\n year: \"numeric\",\n })\n\n if (today) resolvedAriaLabel = `${t(\"Today\")}, ${resolvedAriaLabel}`\n }\n\n return mergeProps(\n {\n \"aria-disabled\": ariaAttr(disabled),\n \"aria-label\": resolvedAriaLabel,\n \"aria-selected\": ariaAttr(selected),\n \"data-between\": dataAttr(between),\n \"data-disabled\": dataAttr(disabled),\n \"data-end\": dataAttr(endValue),\n \"data-holiday\": dataAttr(holiday),\n \"data-outside\": dataAttr(outside),\n \"data-selected\": dataAttr(selected),\n \"data-start\": dataAttr(startValue),\n \"data-today\": dataAttr(today),\n \"data-value\": dayjs(value).format(\"YYYY-MM-DD\"),\n \"data-weekend\": dataAttr(weekend),\n tabIndex: -1,\n },\n rest,\n props,\n {\n ref: mergeRefs(cellRef, outside ? null : register),\n onBlur,\n onClick,\n onFocus: (ev) => ev.preventDefault(),\n onKeyDown,\n },\n )()\n },\n [\n between,\n dateTimeFormat,\n disabled,\n endValue,\n holiday,\n onBlur,\n onClick,\n onKeyDown,\n outside,\n register,\n rest,\n selected,\n startValue,\n t,\n today,\n value,\n weekend,\n ],\n )\n\n return { outside, getDayProps }\n}\n\nexport type UseCalendarDayReturn = ReturnType<typeof useCalendarDay>\n\nconst calendarProps: (keyof UseCalendarProps)[] = [\n \"defaultMonth\",\n \"defaultValue\",\n \"disabled\",\n \"excludeDate\",\n \"format\",\n \"holidays\",\n \"locale\",\n \"max\",\n \"maxDate\",\n \"minDate\",\n \"month\",\n \"range\",\n \"startDayOfWeek\",\n \"today\",\n \"value\",\n \"weekendDays\",\n \"onChange\",\n \"onChangeMonth\",\n]\n\nexport const useCalendarProps = <\n Y extends boolean = false,\n M extends boolean = false,\n D extends Dict = Dict,\n H extends keyof UseCalendarProps<Y, M> = keyof UseCalendarProps<Y, M>,\n>(\n props: D,\n omitKeys?: H[],\n) => {\n return useSplitProps(\n props,\n calendarProps.filter((key) => !omitKeys?.includes(key as H)),\n ) as unknown as [\n keyof UseCalendarProps<Y, M> extends H\n ? UseCalendarProps<Y, M>\n : Omit<UseCalendarProps<Y, M>, H>,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GAAA,cAAA,SAAA,CAA0B,QAAQ;IAClC,cAAc;IACd,kBAAA,GAAA,cAAA,SAAA,CAA0B,QAAQ;IAClC,iBAAA,GAAA,cAAA,SAAA,CAAyB,OAAO;IAChC,kBAAA,GAAA,cAAA,SAAA,CAA0B,QAAQ;IAClC,aAAA,GAAA,cAAA,SAAA,CAAqB,QAAQ;IAC7B,iBAAA,GAAA,cAAA,SAAA,CAAyB,OAAO;IAChC,iBAAA,GAAA,cAAA,SAAA,CAAyB,OAAO;IAChC,kBAAA,GAAA,cAAA,SAAA,CAA0B,QAAQ;IAClC,eAAA,GAAA,cAAA,SAAA,CAAuB,UAAU;IACjC,eAAA,GAAA,cAAA,SAAA,CAAuB,KAAK;IAC5B,cAAc,MAAM,KAAK,CAAC,CAAC,OAAO,YAAY;IAC9C,iBAAA,GAAA,cAAA,SAAA,CAAyB,OAAO;IAChC,UAAU;GACZ,GACA,MACA,OACA;IACE,KAAK,UAAU,SAAS,UAAU,OAAO,QAAQ;IACjD;IACA;IACA,UAAU,OAAO,GAAG,eAAe;IACnC;GACF,CACF,CAAC,CAAC;EACJ,GACA;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAG0B;CAAE;AAChC;AAIA,MAAM,gBAA4C;CAChD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,oBAMX,OACA,aACG;CACH,OAAO,cACL,OACA,cAAc,QAAQ,QAAQ,CAAC,UAAU,SAAS,GAAQ,CAAC,CAC7D;AAWF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.js","names":[],"sources":["../../../../src/components/carousel/carousel.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type {\n CSSProps,\n HTMLProps,\n HTMLStyledProps,\n Orientation,\n ThemeProps,\n} from \"../../core\"\nimport type { IconButtonProps } from \"../button\"\nimport type { CarouselStyle } from \"./carousel.style\"\nimport type {\n CarouselAlign,\n CarouselContainScroll,\n CarouselInViewThreshold,\n UseCarouselProps,\n} from \"./use-carousel\"\nimport { cloneElement, isValidElement, useMemo } from \"react\"\nimport { createSlotComponent, styled, varAttr } from \"../../core\"\nimport { dataAttr } from \"../../utils\"\nimport { IconButton } from \"../button\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../icon\"\nimport { carouselStyle } from \"./carousel.style\"\nimport {\n CarouselContext,\n useCarousel,\n useCarouselContext,\n} from \"./use-carousel\"\n\ninterface ComponentContext extends Pick<\n CarouselRootProps,\n \"includeGapInSize\"\n> {}\n\nexport interface CarouselRootProps\n extends\n Omit<HTMLStyledProps<\"section\">, \"draggable\" | \"onChange\">,\n Omit<\n UseCarouselProps,\n | \"align\"\n | \"autoplay\"\n | \"containScroll\"\n | \"delay\"\n | \"dragFree\"\n | \"draggable\"\n | \"duration\"\n | \"inViewThreshold\"\n | \"loop\"\n | \"orientation\"\n | \"skipSnaps\"\n | \"slidesToScroll\"\n | \"stopMouseEnterAutoplay\"\n >,\n ThemeProps<CarouselStyle> {\n /**\n * The alignment of the carousel.\n *\n * @default 'center'\n */\n align?: CarouselAlign\n /**\n * If `true`, the carousel will be autoplay.\n *\n * @default false\n */\n autoplay?: boolean\n /**\n * Clear leading and trailing empty space that causes excessive scrolling.\n * Use trimSnaps to only use snap points that trigger scrolling or keepSnaps to keep them.\n *\n * @default false\n */\n containScroll?: CarouselContainScroll\n /**\n * The number for the autoplay interval of the carousel.\n *\n * @default 4000\n */\n delay?: number\n /**\n * If `true`, momentum scrolling will be enabled.\n *\n * @default false\n */\n dragFree?: boolean\n /**\n * If `true`, carousel can be scrolled with mouse and touch interactions.\n *\n * @default true\n */\n draggable?: boolean\n /**\n * Set scroll duration when triggered by any of the API methods.\n * Higher numbers enables slower scrolling.\n * Drag interactions are not affected because duration is then determined by the drag force.\n *\n * @default 25\n */\n duration?: number\n /**\n * If `true`, gap will be treated as part of the carousel slide size.\n *\n * @default true\n */\n includeGapInSize?: boolean\n /**\n * Choose a fraction representing the percentage portion of a slide that needs to be visible in order to be considered in view.\n *\n * @default 0\n */\n inViewThreshold?: CarouselInViewThreshold\n /**\n * If `true`, infinite looping.\n * Automatically falls back to false if slide content isn't enough to loop.\n *\n * @default true\n */\n loop?: boolean\n /**\n * The orientation of the carousel.\n *\n * @default 'horizontal'\n */\n orientation?: Orientation\n /**\n * If `true`, allow the carousel to skip scroll snaps if it's dragged vigorously.\n * Note that this option will be ignored if the dragFree option is set to true.\n *\n * @default false\n */\n skipSnaps?: boolean\n /**\n * The size of the carousel item.\n */\n slideSize?: CSSProps[\"width\"]\n /**\n * The number of slides that should be scrolled with next or previous buttons.\n *\n * @default 1\n */\n slidesToScroll?: number\n /**\n * If `true`, autoplay will pause when the mouse entries over.\n *\n * @default true\n */\n stopMouseEnterAutoplay?: boolean\n}\n\nconst {\n ComponentContext,\n PropsContext: CarouselPropsContext,\n useComponentContext,\n usePropsContext: useCarouselPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<CarouselRootProps, CarouselStyle>(\n \"carousel\",\n carouselStyle,\n)\n\nexport { CarouselPropsContext, useCarouselPropsContext }\n\n/**\n * `Carousel` is a component that displays multiple elements like a slideshow.\n *\n * @see https://yamada-ui.com/docs/components/carousel\n */\nexport const CarouselRoot = withProvider<\"section\", CarouselRootProps>(\n ({ includeGapInSize = true, ...rest }) => {\n const {\n carousel,\n index,\n setIndex,\n snapCount,\n total,\n getIndicatorProps,\n getIndicatorsProps,\n getItemProps,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n getRootProps,\n } = useCarousel(rest)\n const componentContext = useMemo(\n () => ({ includeGapInSize }),\n [includeGapInSize],\n )\n const carouselContext = useMemo(\n () => ({\n carousel,\n index,\n setIndex,\n snapCount,\n total,\n getIndicatorProps,\n getIndicatorsProps,\n getItemProps,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n }),\n [\n carousel,\n total,\n index,\n setIndex,\n snapCount,\n getIndicatorProps,\n getIndicatorsProps,\n getItemProps,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n ],\n )\n\n return (\n <CarouselContext value={carouselContext}>\n <ComponentContext value={componentContext}>\n <styled.section {...getRootProps()} />\n </ComponentContext>\n </CarouselContext>\n )\n },\n \"root\",\n)(undefined, ({ gap, slideSize, ...rest }) => {\n return {\n ...rest,\n \"--slide-gap\": varAttr(gap, \"spaces\"),\n \"--slide-size\": varAttr(slideSize, \"sizes\"),\n }\n})\n\nexport interface CarouselListProps extends HTMLStyledProps {}\n\nexport const CarouselList = withContext<\"div\", CarouselListProps>(\n \"div\",\n \"list\",\n)(undefined, (props) => {\n const { includeGapInSize } = useComponentContext()\n const { getListProps } = useCarouselContext()\n\n return {\n \"data-include-gap-in-size\": dataAttr(includeGapInSize),\n ...getListProps(props),\n }\n})\n\nexport interface CarouselItemProps extends HTMLStyledProps {\n /**\n * The index of the carousel item.\n */\n index: number\n /**\n * The size of the carousel item.\n */\n slideSize?: CSSProps[\"width\"]\n}\n\nexport const CarouselItem = withContext<\"div\", CarouselItemProps>(\n \"div\",\n \"item\",\n)(undefined, ({ slideSize, ...rest }) => {\n const { includeGapInSize } = useComponentContext()\n const { getItemProps } = useCarouselContext()\n\n return {\n \"data-include-gap-in-size\": dataAttr(includeGapInSize),\n \"--slide-size\": varAttr(slideSize, \"sizes\"),\n ...getItemProps(rest),\n }\n})\n\nexport interface CarouselPrevTriggerProps extends IconButtonProps {}\n\nexport const CarouselPrevTrigger = withContext<\n \"button\",\n CarouselPrevTriggerProps\n>(IconButton, { name: \"PrevTrigger\", slot: [\"trigger\", \"prev\"] })(\n undefined,\n (props) => {\n const { getPrevTriggerProps } = useCarouselContext()\n\n return {\n fullRounded: true,\n icon: <ChevronLeftIcon />,\n ...getPrevTriggerProps(props),\n }\n },\n)\n\nexport interface CarouselNextTriggerProps extends IconButtonProps {}\n\nexport const CarouselNextTrigger = withContext<\n \"button\",\n CarouselNextTriggerProps\n>(IconButton, { name: \"NextTrigger\", slot: [\"trigger\", \"next\"] })(\n undefined,\n (props) => {\n const { getNextTriggerProps } = useCarouselContext()\n\n return {\n fullRounded: true,\n icon: <ChevronRightIcon />,\n ...getNextTriggerProps(props),\n }\n },\n)\n\nexport interface CarouselIndicatorsProps extends HTMLStyledProps {\n /**\n * The function used to generate children.\n * it will be called with `{ index: number; selected: boolean }`.\n */\n render?: (props: { index: number; selected: boolean }) => ReactNode\n}\n\nexport const CarouselIndicators = withContext<\"div\", CarouselIndicatorsProps>(\n \"div\",\n \"indicators\",\n)(undefined, ({ children, render, ...rest }) => {\n const {\n index: selectedIndex,\n snapCount,\n getIndicatorProps,\n getIndicatorsProps,\n } = useCarouselContext()\n const computedChildren = useMemo(() => {\n if (children) return children\n else\n return Array.from({ length: snapCount }, (_, index) => {\n if (render) {\n const component = render({ index, selected: index === selectedIndex })\n\n if (isValidElement<HTMLProps<\"button\">>(component))\n return cloneElement(component, {\n ...getIndicatorProps({ key: index, index }),\n })\n else return component\n } else {\n return <CarouselIndicator key={index} index={index} />\n }\n })\n }, [children, getIndicatorProps, render, selectedIndex, snapCount])\n\n return {\n children: computedChildren,\n ...getIndicatorsProps(rest),\n }\n})\n\nexport interface CarouselIndicatorProps extends HTMLStyledProps<\"button\"> {\n /**\n * The index of the carousel indicator.\n */\n index: number\n}\n\nexport const CarouselIndicator = withContext<\"button\", CarouselIndicatorProps>(\n \"button\",\n \"indicator\",\n)(undefined, (props) => {\n const { getIndicatorProps } = useCarouselContext()\n\n return getIndicatorProps(props)\n})\n"],"mappings":";;;;;;;;;;;;;AAsJA,MAAM,EACJ,kBACA,cAAc,sBACd,qBACA,iBAAiB,yBACjB,aACA,iBACE,oBACF,YACA,aACF;;;;;;AASA,MAAa,eAAe,cACzB,EAAE,mBAAmB,MAAM,GAAG,WAAW;CACxC,MAAM,EACJ,UACA,OACA,UACA,WACA,OACA,mBACA,o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"],"sourcesContent":["\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type {\n CSSProps,\n HTMLProps,\n HTMLStyledProps,\n Orientation,\n ThemeProps,\n} from \"../../core\"\nimport type { IconButtonProps } from \"../button\"\nimport type { CarouselStyle } from \"./carousel.style\"\nimport type {\n CarouselAlign,\n CarouselContainScroll,\n CarouselInViewThreshold,\n UseCarouselProps,\n} from \"./use-carousel\"\nimport { cloneElement, isValidElement, useMemo } from \"react\"\nimport { createSlotComponent, styled, varAttr } from \"../../core\"\nimport { dataAttr } from \"../../utils\"\nimport { IconButton } from \"../button\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../icon\"\nimport { carouselStyle } from \"./carousel.style\"\nimport {\n CarouselContext,\n useCarousel,\n useCarouselContext,\n} from \"./use-carousel\"\n\ninterface ComponentContext extends Pick<\n CarouselRootProps,\n \"includeGapInSize\"\n> {}\n\nexport interface CarouselRootProps\n extends\n Omit<HTMLStyledProps<\"section\">, \"draggable\" | \"onChange\">,\n Omit<\n UseCarouselProps,\n | \"align\"\n | \"autoplay\"\n | \"containScroll\"\n | \"delay\"\n | \"dragFree\"\n | \"draggable\"\n | \"duration\"\n | \"inViewThreshold\"\n | \"loop\"\n | \"orientation\"\n | \"skipSnaps\"\n | \"slidesToScroll\"\n | \"stopMouseEnterAutoplay\"\n >,\n ThemeProps<CarouselStyle> {\n /**\n * The alignment of the carousel.\n *\n * @default 'center'\n */\n align?: CarouselAlign\n /**\n * If `true`, the carousel will be autoplay.\n *\n * @default false\n */\n autoplay?: boolean\n /**\n * Clear leading and trailing empty space that causes excessive scrolling.\n * Use trimSnaps to only use snap points that trigger scrolling or keepSnaps to keep them.\n *\n * @default false\n */\n containScroll?: CarouselContainScroll\n /**\n * The number for the autoplay interval of the carousel.\n *\n * @default 4000\n */\n delay?: number\n /**\n * If `true`, momentum scrolling will be enabled.\n *\n * @default false\n */\n dragFree?: boolean\n /**\n * If `true`, carousel can be scrolled with mouse and touch interactions.\n *\n * @default true\n */\n draggable?: boolean\n /**\n * Set scroll duration when triggered by any of the API methods.\n * Higher numbers enables slower scrolling.\n * Drag interactions are not affected because duration is then determined by the drag force.\n *\n * @default 25\n */\n duration?: number\n /**\n * If `true`, gap will be treated as part of the carousel slide size.\n *\n * @default true\n */\n includeGapInSize?: boolean\n /**\n * Choose a fraction representing the percentage portion of a slide that needs to be visible in order to be considered in view.\n *\n * @default 0\n */\n inViewThreshold?: CarouselInViewThreshold\n /**\n * If `true`, infinite looping.\n * Automatically falls back to false if slide content isn't enough to loop.\n *\n * @default true\n */\n loop?: boolean\n /**\n * The orientation of the carousel.\n *\n * @default 'horizontal'\n */\n orientation?: Orientation\n /**\n * If `true`, allow the carousel to skip scroll snaps if it's dragged vigorously.\n * Note that this option will be ignored if the dragFree option is set to true.\n *\n * @default false\n */\n skipSnaps?: boolean\n /**\n * The size of the carousel item.\n */\n slideSize?: CSSProps[\"width\"]\n /**\n * The number of slides that should be scrolled with next or previous buttons.\n *\n * @default 1\n */\n slidesToScroll?: number\n /**\n * If `true`, autoplay will pause when the mouse entries over.\n *\n * @default true\n */\n stopMouseEnterAutoplay?: boolean\n}\n\nconst {\n ComponentContext,\n PropsContext: CarouselPropsContext,\n useComponentContext,\n usePropsContext: useCarouselPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<CarouselRootProps, CarouselStyle>(\n \"carousel\",\n carouselStyle,\n)\n\nexport { CarouselPropsContext, useCarouselPropsContext }\n\n/**\n * `Carousel` is a component that displays multiple elements like a slideshow.\n *\n * @see https://yamada-ui.com/docs/components/carousel\n */\nexport const CarouselRoot = withProvider<\"section\", CarouselRootProps>(\n ({ includeGapInSize = true, ...rest }) => {\n const {\n carousel,\n index,\n setIndex,\n snapCount,\n total,\n getIndicatorProps,\n getIndicatorsProps,\n getItemProps,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n getRootProps,\n } = useCarousel(rest)\n const componentContext = useMemo(\n () => ({ includeGapInSize }),\n [includeGapInSize],\n )\n const carouselContext = useMemo(\n () => ({\n carousel,\n index,\n setIndex,\n snapCount,\n total,\n getIndicatorProps,\n getIndicatorsProps,\n getItemProps,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n }),\n [\n carousel,\n total,\n index,\n setIndex,\n snapCount,\n getIndicatorProps,\n getIndicatorsProps,\n getItemProps,\n getListProps,\n getNextTriggerProps,\n getPrevTriggerProps,\n ],\n )\n\n return (\n <CarouselContext value={carouselContext}>\n <ComponentContext value={componentContext}>\n <styled.section {...getRootProps()} />\n </ComponentContext>\n </CarouselContext>\n )\n },\n \"root\",\n)(undefined, ({ gap, slideSize, ...rest }) => {\n return {\n ...rest,\n \"--slide-gap\": varAttr(gap, \"spaces\"),\n \"--slide-size\": varAttr(slideSize, \"sizes\"),\n }\n})\n\nexport interface CarouselListProps extends HTMLStyledProps {}\n\nexport const CarouselList = withContext<\"div\", CarouselListProps>(\n \"div\",\n \"list\",\n)(undefined, (props) => {\n const { includeGapInSize } = useComponentContext()\n const { getListProps } = useCarouselContext()\n\n return {\n \"data-include-gap-in-size\": dataAttr(includeGapInSize),\n ...getListProps(props),\n }\n})\n\nexport interface CarouselItemProps extends HTMLStyledProps {\n /**\n * The index of the carousel item.\n */\n index: number\n /**\n * The size of the carousel item.\n */\n slideSize?: CSSProps[\"width\"]\n}\n\nexport const CarouselItem = withContext<\"div\", CarouselItemProps>(\n \"div\",\n \"item\",\n)(undefined, ({ slideSize, ...rest }) => {\n const { includeGapInSize } = useComponentContext()\n const { getItemProps } = useCarouselContext()\n\n return {\n \"data-include-gap-in-size\": dataAttr(includeGapInSize),\n \"--slide-size\": varAttr(slideSize, \"sizes\"),\n ...getItemProps(rest),\n }\n})\n\nexport interface CarouselPrevTriggerProps extends IconButtonProps {}\n\nexport const CarouselPrevTrigger = withContext<\n \"button\",\n CarouselPrevTriggerProps\n>(IconButton, { name: \"PrevTrigger\", slot: [\"trigger\", \"prev\"] })(\n undefined,\n (props) => {\n const { getPrevTriggerProps } = useCarouselContext()\n\n return {\n fullRounded: true,\n icon: <ChevronLeftIcon />,\n ...getPrevTriggerProps(props),\n }\n },\n)\n\nexport interface CarouselNextTriggerProps extends IconButtonProps {}\n\nexport const CarouselNextTrigger = withContext<\n \"button\",\n CarouselNextTriggerProps\n>(IconButton, { name: \"NextTrigger\", slot: [\"trigger\", \"next\"] })(\n undefined,\n (props) => {\n const { getNextTriggerProps } = useCarouselContext()\n\n return {\n fullRounded: true,\n icon: <ChevronRightIcon />,\n ...getNextTriggerProps(props),\n }\n },\n)\n\nexport interface CarouselIndicatorsProps extends HTMLStyledProps {\n /**\n * The function used to generate children.\n * it will be called with `{ index: number; selected: boolean }`.\n */\n render?: (props: { index: number; selected: boolean }) => ReactNode\n}\n\nexport const CarouselIndicators = withContext<\"div\", CarouselIndicatorsProps>(\n \"div\",\n \"indicators\",\n)(undefined, ({ children, render, ...rest }) => {\n const {\n index: selectedIndex,\n snapCount,\n getIndicatorProps,\n getIndicatorsProps,\n } = useCarouselContext()\n const computedChildren = useMemo(() => {\n if (children) return children\n else\n return Array.from({ length: snapCount }, (_, index) => {\n if (render) {\n const component = render({ index, selected: index === selectedIndex })\n\n if (isValidElement<HTMLProps<\"button\">>(component))\n return cloneElement(component, {\n ...getIndicatorProps({ key: index, index }),\n })\n else return component\n } else {\n return <CarouselIndicator key={index} index={index} />\n }\n })\n }, [children, getIndicatorProps, render, selectedIndex, snapCount])\n\n return {\n children: computedChildren,\n ...getIndicatorsProps(rest),\n }\n})\n\nexport interface CarouselIndicatorProps extends HTMLStyledProps<\"button\"> {\n /**\n * The index of the carousel indicator.\n */\n index: number\n}\n\nexport const CarouselIndicator = withContext<\"button\", CarouselIndicatorProps>(\n \"button\",\n \"indicator\",\n)(undefined, (props) => {\n const { getIndicatorProps } = useCarouselContext()\n\n return getIndicatorProps(props)\n})\n"],"mappings":";;;;;;;;;;;;;AAsJA,MAAM,EACJ,kBACA,cAAc,sBACd,qBACA,iBAAiB,yBACjB,aACA,iBACE,oBACF,YACA,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AE,sBAAsB,mBAAmB;CAEjD,OAAO,kBAAkB,KAAK;AAChC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cartesian-chart.js","names":[],"sources":["../../../../src/components/chart/cartesian-chart.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type {\n ActiveDotProps,\n DotProps,\n LabelListProps,\n LabelProps,\n} from \"recharts\"\nimport type {\n CartesianChartProps as OriginalCartesianChartProps,\n XAxisTickContentProps,\n YAxisTickContentProps,\n} from \"recharts/types/util/types\"\nimport type {\n CSSObject,\n CSSProps,\n GenericsComponent,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Dict, Merge } from \"../../utils\"\nimport type { CartesianChartStyle } from \"./cartesian-chart.style\"\nimport type {\n ChartActiveDot,\n ChartDot,\n ChartLabel,\n ChartLabelList,\n ChartProps,\n ChartTickLine,\n} from \"./chart\"\nimport type {\n UseCartesianChartProps,\n UseChartAreaProps,\n UseChartBarProps,\n UseChartGridProps,\n UseChartLineProps,\n UseChartReferenceLineProps,\n UseChartXAxisProps,\n UseChartYAxisProps,\n} from \"./use-cartesian-chart\"\nimport { cloneElement, isValidElement, useId, useMemo } from \"react\"\nimport {\n Area,\n Bar,\n CartesianGrid,\n Line,\n ReferenceLine,\n XAxis,\n YAxis,\n} from \"recharts\"\nimport {\n createShouldForwardProp,\n createSlotComponent,\n getCSS,\n mergeProps,\n styled,\n useSystem,\n useTheme,\n varAttr,\n} from \"../../core\"\nimport { cx, isFunction, isObject, splitObject } from \"../../utils\"\nimport { cartesianChartStyle } from \"./cartesian-chart.style\"\nimport { Chart } from \"./chart\"\nimport {\n useCartesianChart,\n useChartArea,\n useChartBar,\n useChartGrid,\n useChartLine,\n useChartReferenceLine,\n useChartXAxis,\n useChartYAxis,\n} from \"./use-cartesian-chart\"\n\nconst shouldForwardProp = createShouldForwardProp()\n\ninterface ComponentContext extends Pick<\n CartesianChartProps,\n | \"areaProps\"\n | \"barProps\"\n | \"gridProps\"\n | \"lineProps\"\n | \"referenceLineProps\"\n | \"xAxisProps\"\n | \"yAxisProps\"\n> {}\n\nexport interface CartesianChartProps<Y extends Dict = Dict>\n extends\n ChartProps,\n UseCartesianChartProps<Y>,\n ThemeProps<CartesianChartStyle> {\n /**\n * The fill color of the active dots.\n */\n activeDotFill?: CSSProps[\"fill\"]\n /**\n * The radius of the active dots.\n */\n activeDotRadius?: CSSProps[\"r\"]\n /**\n * The stroke color of the active dots.\n */\n activeDotStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the active dots.\n */\n activeDotStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The fill opacity of the area end.\n */\n areaEndFillOpacity?: CSSProps[\"fillOpacity\"]\n /**\n * The fill opacity of the area.\n */\n areaFillOpacity?: CSSProps[\"fillOpacity\"]\n /**\n * The fill opacity of the area start.\n */\n areaStartFillOpacity?: CSSProps[\"fillOpacity\"]\n /**\n * The color of the bars.\n */\n barColor?: CSSProps[\"color\"]\n /**\n * The fill color of the bars.\n */\n barFill?: CSSProps[\"fill\"]\n /**\n * The fill opacity of the bars.\n */\n barFillOpacity?: CSSProps[\"fillOpacity\"]\n /**\n * The stroke color of the bars.\n */\n barStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the bars.\n */\n barStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The fill color of the dots.\n */\n dotFill?: CSSProps[\"fill\"]\n /**\n * The radius of the dots.\n */\n dotRadius?: CSSProps[\"r\"]\n /**\n * The stroke color of the dots.\n */\n dotStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the dots.\n */\n dotStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The stroke color of the grid.\n */\n gridStroke?: CSSProps[\"stroke\"]\n /**\n * The opacity of the inactive bars.\n */\n inactiveBarOpacity?: CSSProps[\"opacity\"]\n /**\n * The opacity of the inactive lines.\n */\n inactiveLineOpacity?: CSSProps[\"opacity\"]\n /**\n * The color of the lines.\n */\n lineColor?: CSSProps[\"color\"]\n /**\n * The stroke color of the lines.\n */\n lineStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the lines.\n */\n lineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The color of the reference lines.\n */\n referenceLineColor?: CSSProps[\"color\"]\n /**\n * The stroke color of the reference lines.\n */\n referenceLineStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the reference lines.\n */\n referenceLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The text color of the reference lines.\n */\n referenceLineTextColor?: CSSProps[\"color\"]\n /**\n * The text fill color of the reference lines.\n */\n referenceLineTextFill?: CSSProps[\"fill\"]\n /**\n * If `true`, grid is visible.\n *\n * @default true\n */\n withGrid?: boolean\n /**\n * If `true`, X axis is visible.\n *\n * @default true\n */\n withXAxis?: boolean\n /**\n * If `true`, Y axis is visible.\n *\n * @default false\n */\n withYAxis?: boolean\n /**\n * The stroke color of the x-axis lines.\n */\n xAxisLineStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the x-axis lines.\n */\n xAxisLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The text color of the x-axis.\n */\n xAxisTextColor?: CSSProps[\"color\"]\n /**\n * The text fill color of the x-axis.\n */\n xAxisTextFill?: CSSProps[\"fill\"]\n /**\n * The stroke color of the y-axis lines.\n */\n yAxisLineStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the y-axis lines.\n */\n yAxisLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The text color of the y-axis.\n */\n yAxisTextColor?: CSSProps[\"color\"]\n /**\n * The text fill color of the y-axis.\n */\n yAxisTextFill?: CSSProps[\"fill\"]\n /**\n * Props for the area component.\n */\n areaProps?: Omit<ChartAreaProps, \"data\" | \"dataKey\">\n /**\n * Props for the bar component.\n */\n barProps?: Omit<ChartBarProps, \"dataKey\">\n /**\n * Props for the line chart component.\n */\n chartProps?: Omit<OriginalCartesianChartProps, \"data\">\n /**\n * Props for the grid component.\n */\n gridProps?: ChartGridProps\n /**\n * Props for the line component.\n */\n lineProps?: Omit<ChartLineProps, \"data\" | \"dataKey\">\n /**\n * Props for the reference line component.\n */\n referenceLineProps?: ChartReferenceLineProps\n /**\n * Props for the x axis component.\n */\n xAxisProps?: ChartXAxisProps\n /**\n * Props for the y axis component.\n */\n yAxisProps?: ChartYAxisProps\n}\n\nconst {\n ComponentContext,\n PropsContext: CartesianChartPropsContext,\n useComponentContext,\n usePropsContext: useCartesianChartPropsContext,\n withContext,\n withProvider,\n useSlotComponentProps,\n} = createSlotComponent<\n CartesianChartProps,\n CartesianChartStyle,\n ComponentContext\n>(\"cartesian-chart\", cartesianChartStyle)\n\nexport { CartesianChartPropsContext, useCartesianChartPropsContext }\n\nexport const CartesianChart = withProvider(\n <Y extends Dict = Dict>({\n components: componentsProp,\n render,\n withGrid = true,\n withXAxis = true,\n withYAxis = false,\n areaProps,\n barProps,\n chartProps,\n gridProps,\n lineProps,\n referenceLineProps,\n xAxisProps,\n yAxisProps,\n ...rest\n }: CartesianChartProps<Y>) => {\n const { getChartProps, getRootProps } = useCartesianChart(rest)\n const components = useMemo(\n () => [\n {\n component: ChartGrid,\n fallback: withGrid ? <ChartGrid /> : null,\n },\n {\n component: ChartXAxis,\n fallback: <ChartXAxis hide={!withXAxis} />,\n },\n {\n component: ChartYAxis,\n fallback: <ChartYAxis hide={!withYAxis} />,\n },\n ...componentsProp,\n ],\n [componentsProp, withGrid, withXAxis, withYAxis],\n )\n const componentContext = useMemo(\n () => ({\n areaProps,\n barProps,\n gridProps,\n lineProps,\n referenceLineProps,\n xAxisProps,\n yAxisProps,\n }),\n [\n areaProps,\n barProps,\n gridProps,\n lineProps,\n referenceLineProps,\n xAxisProps,\n yAxisProps,\n ],\n )\n\n return (\n <ComponentContext value={componentContext}>\n <Chart\n components={components}\n render={(props) => render(getChartProps({ ...props, ...chartProps }))}\n {...getRootProps()}\n />\n </ComponentContext>\n )\n },\n \"root\",\n)(\n undefined,\n ({\n activeDotFill,\n activeDotRadius,\n activeDotStroke,\n activeDotStrokeWidth,\n areaEndFillOpacity,\n areaFillOpacity,\n areaStartFillOpacity,\n barColor,\n barFill,\n barFillOpacity,\n barStroke,\n barStrokeWidth,\n dotFill,\n dotRadius,\n dotStroke,\n dotStrokeWidth,\n gridStroke,\n inactiveBarOpacity,\n inactiveLineOpacity,\n lineColor,\n lineStroke,\n lineStrokeWidth,\n referenceLineColor,\n referenceLineStroke,\n referenceLineStrokeWidth,\n referenceLineTextColor,\n referenceLineTextFill,\n xAxisLineStroke,\n xAxisLineStrokeWidth,\n xAxisTextColor,\n xAxisTextFill,\n yAxisLineStroke,\n yAxisLineStrokeWidth,\n yAxisTextColor,\n yAxisTextFill,\n ...rest\n }) => ({\n \"--active-dot-fill\": varAttr(activeDotFill, \"colors\"),\n \"--active-dot-r\": activeDotRadius,\n \"--active-dot-stroke\": varAttr(activeDotStroke, \"colors\"),\n \"--active-dot-stroke-width\": activeDotStrokeWidth,\n \"--area-end-fill-opacity\": areaEndFillOpacity,\n \"--area-fill-opacity\": areaFillOpacity,\n \"--area-start-fill-opacity\": areaStartFillOpacity,\n \"--bar-color\": varAttr(barColor, \"colors\"),\n \"--bar-fill\": varAttr(barFill, \"colors\"),\n \"--bar-fill-opacity\": barFillOpacity,\n \"--bar-stroke\": varAttr(barStroke, \"colors\"),\n \"--bar-stroke-width\": barStrokeWidth,\n \"--dot-fill\": varAttr(dotFill, \"colors\"),\n \"--dot-r\": dotRadius,\n \"--dot-stroke\": varAttr(dotStroke, \"colors\"),\n \"--dot-stroke-width\": dotStrokeWidth,\n \"--grid-stroke\": varAttr(gridStroke, \"colors\"),\n \"--inactive-bar-opacity\": inactiveBarOpacity,\n \"--inactive-line-opacity\": inactiveLineOpacity,\n \"--line-color\": varAttr(lineColor, \"colors\"),\n \"--line-stroke\": varAttr(lineStroke, \"colors\"),\n \"--line-stroke-width\": lineStrokeWidth,\n \"--reference-line-color\": varAttr(referenceLineColor, \"colors\"),\n \"--reference-line-stroke\": varAttr(referenceLineStroke, \"colors\"),\n \"--reference-line-stroke-width\": referenceLineStrokeWidth,\n \"--reference-line-text-color\": varAttr(referenceLineTextColor, \"colors\"),\n \"--reference-line-text-fill\": varAttr(referenceLineTextFill, \"colors\"),\n \"--x-axis-line-stroke\": varAttr(xAxisLineStroke, \"colors\"),\n \"--x-axis-line-stroke-width\": xAxisLineStrokeWidth,\n \"--x-axis-text-color\": varAttr(xAxisTextColor, \"colors\"),\n \"--x-axis-text-fill\": varAttr(xAxisTextFill, \"colors\"),\n \"--y-axis-line-stroke\": varAttr(yAxisLineStroke, \"colors\"),\n \"--y-axis-line-stroke-width\": yAxisLineStrokeWidth,\n \"--y-axis-text-color\": varAttr(yAxisTextColor, \"colors\"),\n \"--y-axis-text-fill\": varAttr(yAxisTextFill, \"colors\"),\n ...rest,\n }),\n) as GenericsComponent<{\n <Y extends Dict = Dict>(props: CartesianChartProps<Y>): ReactElement\n}>\n\nexport type ChartXAxisTick =\n | ((props: XAxisTickContentProps) => ReactNode)\n | boolean\n | HTMLStyledProps<\"text\">\n | ReactElement\n\nexport interface ChartXAxisProps extends Merge<\n HTMLStyledProps<\"svg\">,\n Omit<UseChartXAxisProps, \"label\" | \"tick\" | \"tickLine\">\n> {\n /**\n * The label to use for the axis.\n *\n * @default false\n */\n label?: ChartLabel\n /**\n * The tick to use for the axis.\n *\n * @default true\n */\n tick?: ChartXAxisTick\n /**\n * The tick line to use for the axis.\n *\n * @default false\n */\n tickLine?: ChartTickLine\n}\n\nexport const ChartXAxis = withContext<\"svg\", ChartXAxisProps>((props) => {\n const { xAxisProps } = useComponentContext()\n const {\n children,\n label: labelProp = false,\n tick: tickProp = true,\n tickLine: tickLineProp = false,\n ...rest\n } = mergeProps(xAxisProps, props)()\n const system = useSystem()\n const { theme } = useTheme()\n const tickProps = useSlotComponentProps({}, \"xAxisTick\")\n const labelProps = useSlotComponentProps({}, \"xAxisLabel\")\n const tickLineProps = useSlotComponentProps({}, \"xAxisTickLine\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const tick = useMemo<UseChartXAxisProps[\"tick\"]>(() => {\n if (!tickProp) return tickProp\n\n const className = cx(tickProps.className, css(tickProps.css))\n\n if (isFunction(tickProp)) {\n return (props) =>\n tickProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(tickProp)) {\n return cloneElement<any>(tickProp, { className })\n } else if (isObject(tickProp)) {\n const [omittedProps, styleProps] = splitObject<\n XAxisTickContentProps,\n CSSObject\n >(tickProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [tickProp, tickProps.className, tickProps.css, css])\n const tickLine = useMemo<UseChartXAxisProps[\"tickLine\"]>(() => {\n if (!tickLineProp) return tickLineProp\n\n const className = cx(tickLineProps.className, css(tickLineProps.css))\n\n if (isObject(tickLineProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"line\">,\n CSSObject\n >(tickLineProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [tickLineProp, tickLineProps.className, tickLineProps.css, css])\n const label = useMemo<UseChartXAxisProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className, children: labelProp }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getRootProps, getXAxisProps } = useChartXAxis({\n label,\n tick,\n tickLine,\n ...rest,\n })\n\n return (\n <styled.svg asChild {...getRootProps()}>\n <XAxis {...getXAxisProps()}>{children}</XAxis>\n </styled.svg>\n )\n}, \"xAxis\")()\n\nexport type ChartYAxisTick =\n | ((props: YAxisTickContentProps) => ReactNode)\n | boolean\n | HTMLStyledProps<\"text\">\n | ReactElement\n\nexport interface ChartYAxisProps extends Merge<\n HTMLStyledProps<\"svg\">,\n Omit<UseChartYAxisProps, \"label\" | \"tick\" | \"tickLine\">\n> {\n /**\n * The label to use for the axis.\n *\n * @default false\n */\n label?: ChartLabel\n /**\n * The tick to use for the axis.\n *\n * @default true\n */\n tick?: ChartYAxisTick\n /**\n * The tick line to use for the axis.\n *\n * @default false\n */\n tickLine?: ChartTickLine\n}\n\nexport const ChartYAxis = withContext<\"svg\", ChartYAxisProps>((props) => {\n const { yAxisProps } = useComponentContext()\n const {\n children,\n label: labelProp = false,\n tick: tickProp = true,\n tickLine: tickLineProp = false,\n ...rest\n } = mergeProps(yAxisProps, props)()\n const system = useSystem()\n const { theme } = useTheme()\n const tickProps = useSlotComponentProps({}, \"yAxisTick\")\n const labelProps = useSlotComponentProps({}, \"yAxisLabel\")\n const tickLineProps = useSlotComponentProps({}, \"yAxisTickLine\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const tick = useMemo<UseChartYAxisProps[\"tick\"]>(() => {\n if (!tickProp) return tickProp\n\n const className = cx(tickProps.className, css(tickProps.css))\n\n if (isFunction(tickProp)) {\n return (props) =>\n tickProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(tickProp)) {\n return cloneElement<any>(tickProp, { className })\n } else if (isObject(tickProp)) {\n const [omittedProps, styleProps] = splitObject<\n YAxisTickContentProps,\n CSSObject\n >(tickProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [tickProp, tickProps.className, tickProps.css, css])\n const tickLine = useMemo<UseChartXAxisProps[\"tickLine\"]>(() => {\n if (!tickLineProp) return tickLineProp\n\n const className = cx(tickLineProps.className, css(tickLineProps.css))\n\n if (isObject(tickLineProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"line\">,\n CSSObject\n >(tickLineProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [tickLineProp, tickLineProps.className, tickLineProps.css, css])\n const label = useMemo<UseChartYAxisProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className, children: labelProp }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getRootProps, getYAxisProps } = useChartYAxis({\n label,\n tick,\n tickLine,\n ...rest,\n })\n\n return (\n <styled.svg asChild {...getRootProps()}>\n <YAxis {...getYAxisProps()}>{children}</YAxis>\n </styled.svg>\n )\n}, \"yAxis\")()\n\nexport interface ChartGridProps extends Merge<\n HTMLStyledProps<\"line\">,\n UseChartGridProps\n> {}\n\nexport const ChartGrid = withContext<\"line\", ChartGridProps>((props) => {\n const { gridProps } = useComponentContext()\n const { getGridProps, getRootProps } = useChartGrid({\n ...gridProps,\n ...props,\n })\n\n return (\n <styled.line asChild {...getRootProps()}>\n <CartesianGrid {...getGridProps()} />\n </styled.line>\n )\n}, \"grid\")()\n\nexport interface ChartLineProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"line\">,\n Omit<\n UseChartLineProps,\n \"activeDot\" | \"data\" | \"dataKey\" | \"dot\" | \"label\" | \"stroke\"\n >\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: keyof Y\n /**\n * The active dot to use for the line.\n *\n * @default true\n */\n activeDot?: ChartActiveDot\n /**\n * The data to use for the line.\n */\n data?: Y[]\n /**\n * The dot to use for the line.\n *\n * @default false\n */\n dot?: ChartDot\n /**\n * The label list to use for the line.\n *\n * @default false\n */\n label?: ChartLabelList\n}\n\nexport const ChartLine = withContext<\"line\", ChartLineProps>((props) => {\n const { lineProps } = useComponentContext()\n const {\n activeDot: activeDotProp = true,\n children,\n dataKey,\n dot: dotProp = false,\n label: labelProp = false,\n stroke: strokeProp,\n ...rest\n } = mergeProps(lineProps, props)()\n const system = useSystem()\n const { theme } = useTheme()\n const color = strokeProp ?? rest.color\n const stroke = JSON.stringify(color)\n const dotProps = useSlotComponentProps({}, \"dot\")\n const activeDotProps = useSlotComponentProps({}, \"activeDot\")\n const labelProps = useSlotComponentProps({}, \"labelList\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const dot = useMemo<UseChartLineProps[\"dot\"]>(() => {\n if (!dotProp) return dotProp\n\n const className = cx(\n dotProps.className,\n css(dotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(dotProp)) {\n return (props) =>\n dotProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(dotProp)) {\n return cloneElement<any>(dotProp, { className })\n } else if (isObject(dotProp)) {\n const [omittedProps, styleProps] = splitObject<DotProps, CSSObject>(\n dotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [dotProp, dotProps.className, dotProps.css, css, color])\n const activeDot = useMemo<UseChartLineProps[\"activeDot\"]>(() => {\n if (!activeDotProp) return activeDotProp\n\n const className = cx(\n activeDotProps.className,\n css(activeDotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(activeDotProp)) {\n return (props) =>\n activeDotProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(activeDotProp)) {\n return cloneElement<any>(activeDotProp, { className })\n } else if (isObject(activeDotProp)) {\n const [omittedProps, styleProps] = splitObject<ActiveDotProps, CSSObject>(\n activeDotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [activeDotProp, activeDotProps.className, activeDotProps.css, css, color])\n const label = useMemo<UseChartLineProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelListProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getLineProps, getRootProps } = useChartLine({\n activeDot,\n dataKey,\n dot,\n label,\n stroke,\n ...rest,\n })\n\n return (\n <styled.line asChild {...getRootProps()}>\n <Line {...getLineProps()}>{children}</Line>\n </styled.line>\n )\n}, \"line\")() as GenericsComponent<{\n <Y extends Dict>(props: ChartLineProps<Y>): ReactElement\n}>\n\nexport interface ChartAreaGradient {\n end?: CSSProps[\"stopColor\"]\n start?: CSSProps[\"stopColor\"]\n}\n\nexport interface ChartAreaProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"line\">,\n Omit<\n UseChartAreaProps,\n \"activeDot\" | \"data\" | \"dataKey\" | \"dot\" | \"label\" | \"stroke\"\n >\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: keyof Y\n /**\n * The active dot to use for the line.\n *\n * @default true\n */\n activeDot?: ChartActiveDot\n /**\n * The data to use for the area.\n */\n data?: Y[]\n /**\n * The dot to use for the line.\n *\n * @default false\n */\n dot?: ChartDot\n /**\n * The gradient to use for the area.\n */\n gradient?: ChartAreaGradient\n /**\n * The label list to use for the line.\n *\n * @default false\n */\n label?: ChartLabelList\n /**\n * Determines whether the chart area should be represented with a gradient instead of the solid color.\n */\n withGradient?: boolean\n}\n\nexport const ChartArea = withContext<\"line\", ChartAreaProps>((props) => {\n const { areaProps } = useComponentContext()\n const {\n activeDot: activeDotProp = true,\n children,\n dataKey,\n dot: dotProp = false,\n gradient,\n label: labelProp = false,\n stroke: strokeProp,\n withGradient,\n ...rest\n } = mergeProps(areaProps, props)()\n const id = useId()\n const system = useSystem()\n const { theme } = useTheme()\n const color = strokeProp ?? rest.fill ?? rest.color\n const stroke = JSON.stringify(color)\n const dotProps = useSlotComponentProps({}, \"dot\")\n const activeDotProps = useSlotComponentProps({}, \"activeDot\")\n const labelProps = useSlotComponentProps({}, \"labelList\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const dot = useMemo<UseChartLineProps[\"dot\"]>(() => {\n if (!dotProp) return dotProp\n\n const className = cx(\n dotProps.className,\n css(dotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(dotProp)) {\n return (props) =>\n dotProp({\n ...props,\n className: cx(className, props.className),\n })\n } else if (isValidElement(dotProp)) {\n return cloneElement<any>(dotProp, {\n className,\n })\n } else if (isObject(dotProp)) {\n const [omittedProps, styleProps] = splitObject<DotProps, CSSObject>(\n dotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [dotProp, dotProps.className, dotProps.css, css, color])\n const activeDot = useMemo<UseChartLineProps[\"activeDot\"]>(() => {\n if (!activeDotProp) return activeDotProp\n\n const className = cx(\n activeDotProps.className,\n css(activeDotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(activeDotProp)) {\n return (props) =>\n activeDotProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(activeDotProp)) {\n return cloneElement<any>(activeDotProp, { className })\n } else if (isObject(activeDotProp)) {\n const [omittedProps, styleProps] = splitObject<ActiveDotProps, CSSObject>(\n activeDotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [activeDotProp, activeDotProps.className, activeDotProps.css, css, color])\n const label = useMemo<UseChartLineProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelListProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getAreaProps, getRootProps } = useChartArea({\n activeDot,\n dataKey,\n dot,\n fill: color ? `url(#${id})` : \"\",\n label,\n stroke,\n ...rest,\n })\n\n return (\n <>\n <styled.line asChild {...getRootProps()}>\n <Area {...getAreaProps()}>{children}</Area>\n </styled.line>\n\n <defs>\n {withGradient ? (\n <linearGradient id={id} x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <styled.stop\n asChild\n stopColor={color}\n stopOpacity={gradient?.start ?? \"{area-start-fill-opacity}\"}\n >\n <stop offset=\"5%\" />\n </styled.stop>\n <styled.stop\n asChild\n stopColor={color}\n stopOpacity={gradient?.end ?? \"{area-end-fill-opacity}\"}\n >\n <stop offset=\"95%\" />\n </styled.stop>\n </linearGradient>\n ) : (\n <linearGradient id={id} x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <styled.stop\n stopColor={color}\n stopOpacity={rest.fillOpacity ?? \"{area-fill-opacity}\"}\n />\n </linearGradient>\n )}\n </defs>\n </>\n )\n}, \"area\")() as GenericsComponent<{\n <Y extends Dict>(props: ChartAreaProps<Y>): ReactElement\n}>\n\nexport interface ChartBarProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"path\">,\n Omit<UseChartBarProps, \"dataKey\" | \"fill\" | \"label\">\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: keyof Y\n /**\n * The label list to use for the bar.\n *\n * @default false\n */\n label?: ChartLabelList\n}\n\nexport const ChartBar = withContext<\"path\", ChartBarProps>((props) => {\n const { barProps } = useComponentContext()\n const {\n children,\n dataKey,\n fill: fillProp,\n label: labelProp = false,\n ...rest\n } = mergeProps(barProps, props)()\n const system = useSystem()\n const { theme } = useTheme()\n const color = fillProp ?? rest.color\n const fill = JSON.stringify(color)\n const labelProps = useSlotComponentProps({}, \"labelList\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const label = useMemo<UseChartBarProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelListProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getBarProps, getRootProps } = useChartBar({\n dataKey,\n fill,\n label,\n ...rest,\n })\n\n return (\n <styled.path asChild {...getRootProps()}>\n <Bar {...getBarProps()}>{children}</Bar>\n </styled.path>\n )\n}, \"bar\")() as GenericsComponent<{\n <Y extends Dict>(props: ChartBarProps<Y>): ReactElement\n}>\n\nexport interface ChartReferenceLineProps extends Omit<\n Merge<HTMLStyledProps<\"line\">, UseChartReferenceLineProps>,\n \"label\"\n> {\n /**\n * The label to use for the reference line.\n *\n * @default false\n */\n label?: ChartLabel\n}\n\nexport const ChartReferenceLine = withContext<\"line\", ChartReferenceLineProps>(\n (props) => {\n const { referenceLineProps } = useComponentContext()\n const { label: labelProp = false, ...rest } = {\n ...referenceLineProps,\n ...props,\n }\n const system = useSystem()\n const { theme } = useTheme()\n const labelProps = useSlotComponentProps({}, \"referenceLineLabel\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const label = useMemo<UseChartReferenceLineProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className, children: labelProp }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getReferenceLineProps, getRootProps } = useChartReferenceLine({\n label,\n ...rest,\n })\n\n return (\n <styled.line asChild {...getRootProps()}>\n <ReferenceLine {...getReferenceLineProps()} />\n </styled.line>\n )\n },\n \"referenceLine\",\n)()\n"],"mappings":";;;;;;;;;;;;;;;;AA4EA,MAAM,oBAAoB,wBAAwB;AAkNlD,MAAM,EACJ,kBACA,cAAc,4BACd,qBACA,iBAAiB,+BACjB,aACA,cACA,0BACE,oBAIF,mBAAmB,mBAAmB;AAIxC,MAAa,iBAAiB,cACJ,EACtB,YAAY,gBACZ,QACA,WAAW,MACX,YAAY,MACZ,YAAY,OACZ,WACA,UACA,YACA,WACA,WACA,oBACA,YACA,YACA,GAAG,WACyB;CAC5B,MAAM,EAAE,eAAe,iBAAiB,kBAAkB,IAAI;CAC9D,MAAM,aAAa,cACX;EACJ;GACE,WAAW;GACX,UAAU,WAAW,oBAAC,WAAD,CAAY,CAAA,IAAI;EACvC;EACA;GACE,WAAW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ACjE,MAAM,MAAM,cAAc,OAAO,QAAQ,KAAK,GAAG,CAAC,QAAQ,KAAK,CAAC;CAyBhE,MAAM,EAAE,uBAAuB,iBAAiB,sBAAsB;EACpE,OAzBY,cAAmD;GAC/D,IAAI,CAAC,WAAW,OAAO;GAEvB,MAAM,aAAA,GAAA,cAAA,GAAA,CAAe,WAAW,WAAW,IAAI,WAAW,GAAG,CAAC;GAE9D,KAAA,GAAA,cAAA,WAAA,CAAe,SAAS,GACtB,QAAQ,UACN,UAAU;IAAE,GAAG;IAAO,YAAA,GAAA,cAAA,GAAA,CAAc,WAAW,MAAM,SAAS;GAAE,CAAC;QAC9D,IAAI,eAAe,SAAS,GACjC,OAAO,aAAkB,WAAW,EAAE,UAAU,CAAC;QAC5C,KAAA,GAAA,cAAA,SAAA,CAAa,SAAS,GAAG;IAC9B,MAAM,CAAC,cAAc,eAAA,GAAA,cAAA,YAAA,CACnB,WACA,iBACF;IAEA,OAAO;KACL,GAAG;KACH,YAAA,GAAA,cAAA,GAAA,CAAc,WAAW,aAAa,WAAW,IAAI,UAAU,CAAC;IAClE;GACF,OACE,OAAO;IAAE;IAAW,UAAU;GAAU;EAE5C,GAAG;GAAC;GAAW,WAAW;GAAW,WAAW;GAAK;EAAG,CAElD;EACJ,GAAG;CACL,CAAC;CAED,OACE,oBAAC,OAAO,MAAR;EAAa,SAAA;EAAQ,GAAI,aAAa;YACpC,oBAAC,eAAD,EAAe,GAAI,sBAAsB,EAAI,CAAA;CAClC,CAAA;AAEjB,GACA,eACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"cartesian-chart.js","names":[],"sources":["../../../../src/components/chart/cartesian-chart.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type {\n ActiveDotProps,\n DotProps,\n LabelListProps,\n LabelProps,\n} from \"recharts\"\nimport type {\n CartesianChartProps as OriginalCartesianChartProps,\n XAxisTickContentProps,\n YAxisTickContentProps,\n} from \"recharts/types/util/types\"\nimport type {\n CSSObject,\n CSSProps,\n GenericsComponent,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Dict, Merge } from \"../../utils\"\nimport type { CartesianChartStyle } from \"./cartesian-chart.style\"\nimport type {\n ChartActiveDot,\n ChartDot,\n ChartLabel,\n ChartLabelList,\n ChartProps,\n ChartTickLine,\n} from \"./chart\"\nimport type {\n UseCartesianChartProps,\n UseChartAreaProps,\n UseChartBarProps,\n UseChartGridProps,\n UseChartLineProps,\n UseChartReferenceLineProps,\n UseChartXAxisProps,\n UseChartYAxisProps,\n} from \"./use-cartesian-chart\"\nimport { cloneElement, isValidElement, useId, useMemo } from \"react\"\nimport {\n Area,\n Bar,\n CartesianGrid,\n Line,\n ReferenceLine,\n XAxis,\n YAxis,\n} from \"recharts\"\nimport {\n createShouldForwardProp,\n createSlotComponent,\n getCSS,\n mergeProps,\n styled,\n useSystem,\n useTheme,\n varAttr,\n} from \"../../core\"\nimport { cx, isFunction, isObject, splitObject } from \"../../utils\"\nimport { cartesianChartStyle } from \"./cartesian-chart.style\"\nimport { Chart } from \"./chart\"\nimport {\n useCartesianChart,\n useChartArea,\n useChartBar,\n useChartGrid,\n useChartLine,\n useChartReferenceLine,\n useChartXAxis,\n useChartYAxis,\n} from \"./use-cartesian-chart\"\n\nconst shouldForwardProp = createShouldForwardProp()\n\ninterface ComponentContext extends Pick<\n CartesianChartProps,\n | \"areaProps\"\n | \"barProps\"\n | \"gridProps\"\n | \"lineProps\"\n | \"referenceLineProps\"\n | \"xAxisProps\"\n | \"yAxisProps\"\n> {}\n\nexport interface CartesianChartProps<Y extends Dict = Dict>\n extends\n ChartProps,\n UseCartesianChartProps<Y>,\n ThemeProps<CartesianChartStyle> {\n /**\n * The fill color of the active dots.\n */\n activeDotFill?: CSSProps[\"fill\"]\n /**\n * The radius of the active dots.\n */\n activeDotRadius?: CSSProps[\"r\"]\n /**\n * The stroke color of the active dots.\n */\n activeDotStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the active dots.\n */\n activeDotStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The fill opacity of the area end.\n */\n areaEndFillOpacity?: CSSProps[\"fillOpacity\"]\n /**\n * The fill opacity of the area.\n */\n areaFillOpacity?: CSSProps[\"fillOpacity\"]\n /**\n * The fill opacity of the area start.\n */\n areaStartFillOpacity?: CSSProps[\"fillOpacity\"]\n /**\n * The color of the bars.\n */\n barColor?: CSSProps[\"color\"]\n /**\n * The fill color of the bars.\n */\n barFill?: CSSProps[\"fill\"]\n /**\n * The fill opacity of the bars.\n */\n barFillOpacity?: CSSProps[\"fillOpacity\"]\n /**\n * The stroke color of the bars.\n */\n barStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the bars.\n */\n barStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The fill color of the dots.\n */\n dotFill?: CSSProps[\"fill\"]\n /**\n * The radius of the dots.\n */\n dotRadius?: CSSProps[\"r\"]\n /**\n * The stroke color of the dots.\n */\n dotStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the dots.\n */\n dotStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The stroke color of the grid.\n */\n gridStroke?: CSSProps[\"stroke\"]\n /**\n * The opacity of the inactive bars.\n */\n inactiveBarOpacity?: CSSProps[\"opacity\"]\n /**\n * The opacity of the inactive lines.\n */\n inactiveLineOpacity?: CSSProps[\"opacity\"]\n /**\n * The color of the lines.\n */\n lineColor?: CSSProps[\"color\"]\n /**\n * The stroke color of the lines.\n */\n lineStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the lines.\n */\n lineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The color of the reference lines.\n */\n referenceLineColor?: CSSProps[\"color\"]\n /**\n * The stroke color of the reference lines.\n */\n referenceLineStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the reference lines.\n */\n referenceLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The text color of the reference lines.\n */\n referenceLineTextColor?: CSSProps[\"color\"]\n /**\n * The text fill color of the reference lines.\n */\n referenceLineTextFill?: CSSProps[\"fill\"]\n /**\n * If `true`, grid is visible.\n *\n * @default true\n */\n withGrid?: boolean\n /**\n * If `true`, X axis is visible.\n *\n * @default true\n */\n withXAxis?: boolean\n /**\n * If `true`, Y axis is visible.\n *\n * @default false\n */\n withYAxis?: boolean\n /**\n * The stroke color of the x-axis lines.\n */\n xAxisLineStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the x-axis lines.\n */\n xAxisLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The text color of the x-axis.\n */\n xAxisTextColor?: CSSProps[\"color\"]\n /**\n * The text fill color of the x-axis.\n */\n xAxisTextFill?: CSSProps[\"fill\"]\n /**\n * The stroke color of the y-axis lines.\n */\n yAxisLineStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the y-axis lines.\n */\n yAxisLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The text color of the y-axis.\n */\n yAxisTextColor?: CSSProps[\"color\"]\n /**\n * The text fill color of the y-axis.\n */\n yAxisTextFill?: CSSProps[\"fill\"]\n /**\n * Props for the area component.\n */\n areaProps?: Omit<ChartAreaProps, \"data\" | \"dataKey\">\n /**\n * Props for the bar component.\n */\n barProps?: Omit<ChartBarProps, \"dataKey\">\n /**\n * Props for the line chart component.\n */\n chartProps?: Omit<OriginalCartesianChartProps, \"data\">\n /**\n * Props for the grid component.\n */\n gridProps?: ChartGridProps\n /**\n * Props for the line component.\n */\n lineProps?: Omit<ChartLineProps, \"data\" | \"dataKey\">\n /**\n * Props for the reference line component.\n */\n referenceLineProps?: ChartReferenceLineProps\n /**\n * Props for the x axis component.\n */\n xAxisProps?: ChartXAxisProps\n /**\n * Props for the y axis component.\n */\n yAxisProps?: ChartYAxisProps\n}\n\nconst {\n ComponentContext,\n PropsContext: CartesianChartPropsContext,\n useComponentContext,\n usePropsContext: useCartesianChartPropsContext,\n withContext,\n withProvider,\n useSlotComponentProps,\n} = createSlotComponent<\n CartesianChartProps,\n CartesianChartStyle,\n ComponentContext\n>(\"cartesian-chart\", cartesianChartStyle)\n\nexport { CartesianChartPropsContext, useCartesianChartPropsContext }\n\nexport const CartesianChart = withProvider(\n <Y extends Dict = Dict>({\n components: componentsProp,\n render,\n withGrid = true,\n withXAxis = true,\n withYAxis = false,\n areaProps,\n barProps,\n chartProps,\n gridProps,\n lineProps,\n referenceLineProps,\n xAxisProps,\n yAxisProps,\n ...rest\n }: CartesianChartProps<Y>) => {\n const { getChartProps, getRootProps } = useCartesianChart(rest)\n const components = useMemo(\n () => [\n {\n component: ChartGrid,\n fallback: withGrid ? <ChartGrid /> : null,\n },\n {\n component: ChartXAxis,\n fallback: <ChartXAxis hide={!withXAxis} />,\n },\n {\n component: ChartYAxis,\n fallback: <ChartYAxis hide={!withYAxis} />,\n },\n ...componentsProp,\n ],\n [componentsProp, withGrid, withXAxis, withYAxis],\n )\n const componentContext = useMemo(\n () => ({\n areaProps,\n barProps,\n gridProps,\n lineProps,\n referenceLineProps,\n xAxisProps,\n yAxisProps,\n }),\n [\n areaProps,\n barProps,\n gridProps,\n lineProps,\n referenceLineProps,\n xAxisProps,\n yAxisProps,\n ],\n )\n\n return (\n <ComponentContext value={componentContext}>\n <Chart\n components={components}\n render={(props) => render(getChartProps({ ...props, ...chartProps }))}\n {...getRootProps()}\n />\n </ComponentContext>\n )\n },\n \"root\",\n)(\n undefined,\n ({\n activeDotFill,\n activeDotRadius,\n activeDotStroke,\n activeDotStrokeWidth,\n areaEndFillOpacity,\n areaFillOpacity,\n areaStartFillOpacity,\n barColor,\n barFill,\n barFillOpacity,\n barStroke,\n barStrokeWidth,\n dotFill,\n dotRadius,\n dotStroke,\n dotStrokeWidth,\n gridStroke,\n inactiveBarOpacity,\n inactiveLineOpacity,\n lineColor,\n lineStroke,\n lineStrokeWidth,\n referenceLineColor,\n referenceLineStroke,\n referenceLineStrokeWidth,\n referenceLineTextColor,\n referenceLineTextFill,\n xAxisLineStroke,\n xAxisLineStrokeWidth,\n xAxisTextColor,\n xAxisTextFill,\n yAxisLineStroke,\n yAxisLineStrokeWidth,\n yAxisTextColor,\n yAxisTextFill,\n ...rest\n }) => ({\n \"--active-dot-fill\": varAttr(activeDotFill, \"colors\"),\n \"--active-dot-r\": activeDotRadius,\n \"--active-dot-stroke\": varAttr(activeDotStroke, \"colors\"),\n \"--active-dot-stroke-width\": activeDotStrokeWidth,\n \"--area-end-fill-opacity\": areaEndFillOpacity,\n \"--area-fill-opacity\": areaFillOpacity,\n \"--area-start-fill-opacity\": areaStartFillOpacity,\n \"--bar-color\": varAttr(barColor, \"colors\"),\n \"--bar-fill\": varAttr(barFill, \"colors\"),\n \"--bar-fill-opacity\": barFillOpacity,\n \"--bar-stroke\": varAttr(barStroke, \"colors\"),\n \"--bar-stroke-width\": barStrokeWidth,\n \"--dot-fill\": varAttr(dotFill, \"colors\"),\n \"--dot-r\": dotRadius,\n \"--dot-stroke\": varAttr(dotStroke, \"colors\"),\n \"--dot-stroke-width\": dotStrokeWidth,\n \"--grid-stroke\": varAttr(gridStroke, \"colors\"),\n \"--inactive-bar-opacity\": inactiveBarOpacity,\n \"--inactive-line-opacity\": inactiveLineOpacity,\n \"--line-color\": varAttr(lineColor, \"colors\"),\n \"--line-stroke\": varAttr(lineStroke, \"colors\"),\n \"--line-stroke-width\": lineStrokeWidth,\n \"--reference-line-color\": varAttr(referenceLineColor, \"colors\"),\n \"--reference-line-stroke\": varAttr(referenceLineStroke, \"colors\"),\n \"--reference-line-stroke-width\": referenceLineStrokeWidth,\n \"--reference-line-text-color\": varAttr(referenceLineTextColor, \"colors\"),\n \"--reference-line-text-fill\": varAttr(referenceLineTextFill, \"colors\"),\n \"--x-axis-line-stroke\": varAttr(xAxisLineStroke, \"colors\"),\n \"--x-axis-line-stroke-width\": xAxisLineStrokeWidth,\n \"--x-axis-text-color\": varAttr(xAxisTextColor, \"colors\"),\n \"--x-axis-text-fill\": varAttr(xAxisTextFill, \"colors\"),\n \"--y-axis-line-stroke\": varAttr(yAxisLineStroke, \"colors\"),\n \"--y-axis-line-stroke-width\": yAxisLineStrokeWidth,\n \"--y-axis-text-color\": varAttr(yAxisTextColor, \"colors\"),\n \"--y-axis-text-fill\": varAttr(yAxisTextFill, \"colors\"),\n ...rest,\n }),\n) as GenericsComponent<{\n <Y extends Dict = Dict>(props: CartesianChartProps<Y>): ReactElement\n}>\n\nexport type ChartXAxisTick =\n | ((props: XAxisTickContentProps) => ReactNode)\n | boolean\n | HTMLStyledProps<\"text\">\n | ReactElement\n\nexport interface ChartXAxisProps extends Merge<\n HTMLStyledProps<\"svg\">,\n Omit<UseChartXAxisProps, \"label\" | \"tick\" | \"tickLine\">\n> {\n /**\n * The label to use for the axis.\n *\n * @default false\n */\n label?: ChartLabel\n /**\n * The tick to use for the axis.\n *\n * @default true\n */\n tick?: ChartXAxisTick\n /**\n * The tick line to use for the axis.\n *\n * @default false\n */\n tickLine?: ChartTickLine\n}\n\nexport const ChartXAxis = withContext<\"svg\", ChartXAxisProps>((props) => {\n const { xAxisProps } = useComponentContext()\n const {\n children,\n label: labelProp = false,\n tick: tickProp = true,\n tickLine: tickLineProp = false,\n ...rest\n } = mergeProps(xAxisProps, props)()\n const system = useSystem()\n const { theme } = useTheme()\n const tickProps = useSlotComponentProps({}, \"xAxisTick\")\n const labelProps = useSlotComponentProps({}, \"xAxisLabel\")\n const tickLineProps = useSlotComponentProps({}, \"xAxisTickLine\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const tick = useMemo<UseChartXAxisProps[\"tick\"]>(() => {\n if (!tickProp) return tickProp\n\n const className = cx(tickProps.className, css(tickProps.css))\n\n if (isFunction(tickProp)) {\n return (props) =>\n tickProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(tickProp)) {\n return cloneElement<any>(tickProp, { className })\n } else if (isObject(tickProp)) {\n const [omittedProps, styleProps] = splitObject<\n XAxisTickContentProps,\n CSSObject\n >(tickProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [tickProp, tickProps.className, tickProps.css, css])\n const tickLine = useMemo<UseChartXAxisProps[\"tickLine\"]>(() => {\n if (!tickLineProp) return tickLineProp\n\n const className = cx(tickLineProps.className, css(tickLineProps.css))\n\n if (isObject(tickLineProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"line\">,\n CSSObject\n >(tickLineProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [tickLineProp, tickLineProps.className, tickLineProps.css, css])\n const label = useMemo<UseChartXAxisProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className, children: labelProp }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getRootProps, getXAxisProps } = useChartXAxis({\n label,\n tick,\n tickLine,\n ...rest,\n })\n\n return (\n <styled.svg asChild {...getRootProps()}>\n <XAxis {...getXAxisProps()}>{children}</XAxis>\n </styled.svg>\n )\n}, \"xAxis\")()\n\nexport type ChartYAxisTick =\n | ((props: YAxisTickContentProps) => ReactNode)\n | boolean\n | HTMLStyledProps<\"text\">\n | ReactElement\n\nexport interface ChartYAxisProps extends Merge<\n HTMLStyledProps<\"svg\">,\n Omit<UseChartYAxisProps, \"label\" | \"tick\" | \"tickLine\">\n> {\n /**\n * The label to use for the axis.\n *\n * @default false\n */\n label?: ChartLabel\n /**\n * The tick to use for the axis.\n *\n * @default true\n */\n tick?: ChartYAxisTick\n /**\n * The tick line to use for the axis.\n *\n * @default false\n */\n tickLine?: ChartTickLine\n}\n\nexport const ChartYAxis = withContext<\"svg\", ChartYAxisProps>((props) => {\n const { yAxisProps } = useComponentContext()\n const {\n children,\n label: labelProp = false,\n tick: tickProp = true,\n tickLine: tickLineProp = false,\n ...rest\n } = mergeProps(yAxisProps, props)()\n const system = useSystem()\n const { theme } = useTheme()\n const tickProps = useSlotComponentProps({}, \"yAxisTick\")\n const labelProps = useSlotComponentProps({}, \"yAxisLabel\")\n const tickLineProps = useSlotComponentProps({}, \"yAxisTickLine\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const tick = useMemo<UseChartYAxisProps[\"tick\"]>(() => {\n if (!tickProp) return tickProp\n\n const className = cx(tickProps.className, css(tickProps.css))\n\n if (isFunction(tickProp)) {\n return (props) =>\n tickProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(tickProp)) {\n return cloneElement<any>(tickProp, { className })\n } else if (isObject(tickProp)) {\n const [omittedProps, styleProps] = splitObject<\n YAxisTickContentProps,\n CSSObject\n >(tickProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [tickProp, tickProps.className, tickProps.css, css])\n const tickLine = useMemo<UseChartXAxisProps[\"tickLine\"]>(() => {\n if (!tickLineProp) return tickLineProp\n\n const className = cx(tickLineProps.className, css(tickLineProps.css))\n\n if (isObject(tickLineProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"line\">,\n CSSObject\n >(tickLineProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [tickLineProp, tickLineProps.className, tickLineProps.css, css])\n const label = useMemo<UseChartYAxisProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className, children: labelProp }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getRootProps, getYAxisProps } = useChartYAxis({\n label,\n tick,\n tickLine,\n ...rest,\n })\n\n return (\n <styled.svg asChild {...getRootProps()}>\n <YAxis {...getYAxisProps()}>{children}</YAxis>\n </styled.svg>\n )\n}, \"yAxis\")()\n\nexport interface ChartGridProps extends Merge<\n HTMLStyledProps<\"line\">,\n UseChartGridProps\n> {}\n\nexport const ChartGrid = withContext<\"line\", ChartGridProps>((props) => {\n const { gridProps } = useComponentContext()\n const { getGridProps, getRootProps } = useChartGrid({\n ...gridProps,\n ...props,\n })\n\n return (\n <styled.line asChild {...getRootProps()}>\n <CartesianGrid {...getGridProps()} />\n </styled.line>\n )\n}, \"grid\")()\n\nexport interface ChartLineProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"line\">,\n Omit<\n UseChartLineProps,\n \"activeDot\" | \"data\" | \"dataKey\" | \"dot\" | \"label\" | \"stroke\"\n >\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: keyof Y\n /**\n * The active dot to use for the line.\n *\n * @default true\n */\n activeDot?: ChartActiveDot\n /**\n * The data to use for the line.\n */\n data?: Y[]\n /**\n * The dot to use for the line.\n *\n * @default false\n */\n dot?: ChartDot\n /**\n * The label list to use for the line.\n *\n * @default false\n */\n label?: ChartLabelList\n}\n\nexport const ChartLine = withContext<\"line\", ChartLineProps>((props) => {\n const { lineProps } = useComponentContext()\n const {\n activeDot: activeDotProp = true,\n children,\n dataKey,\n dot: dotProp = false,\n label: labelProp = false,\n stroke: strokeProp,\n ...rest\n } = mergeProps(lineProps, props)()\n const system = useSystem()\n const { theme } = useTheme()\n const color = strokeProp ?? rest.color\n const stroke = JSON.stringify(color)\n const dotProps = useSlotComponentProps({}, \"dot\")\n const activeDotProps = useSlotComponentProps({}, \"activeDot\")\n const labelProps = useSlotComponentProps({}, \"labelList\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const dot = useMemo<UseChartLineProps[\"dot\"]>(() => {\n if (!dotProp) return dotProp\n\n const className = cx(\n dotProps.className,\n css(dotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(dotProp)) {\n return (props) =>\n dotProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(dotProp)) {\n return cloneElement<any>(dotProp, { className })\n } else if (isObject(dotProp)) {\n const [omittedProps, styleProps] = splitObject<DotProps, CSSObject>(\n dotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [dotProp, dotProps.className, dotProps.css, css, color])\n const activeDot = useMemo<UseChartLineProps[\"activeDot\"]>(() => {\n if (!activeDotProp) return activeDotProp\n\n const className = cx(\n activeDotProps.className,\n css(activeDotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(activeDotProp)) {\n return (props) =>\n activeDotProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(activeDotProp)) {\n return cloneElement<any>(activeDotProp, { className })\n } else if (isObject(activeDotProp)) {\n const [omittedProps, styleProps] = splitObject<ActiveDotProps, CSSObject>(\n activeDotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [activeDotProp, activeDotProps.className, activeDotProps.css, css, color])\n const label = useMemo<UseChartLineProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelListProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getLineProps, getRootProps } = useChartLine({\n activeDot,\n dataKey,\n dot,\n label,\n stroke,\n ...rest,\n })\n\n return (\n <styled.line asChild {...getRootProps()}>\n <Line {...getLineProps()}>{children}</Line>\n </styled.line>\n )\n}, \"line\")() as GenericsComponent<{\n <Y extends Dict>(props: ChartLineProps<Y>): ReactElement\n}>\n\nexport interface ChartAreaGradient {\n end?: CSSProps[\"stopColor\"]\n start?: CSSProps[\"stopColor\"]\n}\n\nexport interface ChartAreaProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"line\">,\n Omit<\n UseChartAreaProps,\n \"activeDot\" | \"data\" | \"dataKey\" | \"dot\" | \"label\" | \"stroke\"\n >\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: keyof Y\n /**\n * The active dot to use for the line.\n *\n * @default true\n */\n activeDot?: ChartActiveDot\n /**\n * The data to use for the area.\n */\n data?: Y[]\n /**\n * The dot to use for the line.\n *\n * @default false\n */\n dot?: ChartDot\n /**\n * The gradient to use for the area.\n */\n gradient?: ChartAreaGradient\n /**\n * The label list to use for the line.\n *\n * @default false\n */\n label?: ChartLabelList\n /**\n * Determines whether the chart area should be represented with a gradient instead of the solid color.\n */\n withGradient?: boolean\n}\n\nexport const ChartArea = withContext<\"line\", ChartAreaProps>((props) => {\n const { areaProps } = useComponentContext()\n const {\n activeDot: activeDotProp = true,\n children,\n dataKey,\n dot: dotProp = false,\n gradient,\n label: labelProp = false,\n stroke: strokeProp,\n withGradient,\n ...rest\n } = mergeProps(areaProps, props)()\n const id = useId()\n const system = useSystem()\n const { theme } = useTheme()\n const color = strokeProp ?? rest.fill ?? rest.color\n const stroke = JSON.stringify(color)\n const dotProps = useSlotComponentProps({}, \"dot\")\n const activeDotProps = useSlotComponentProps({}, \"activeDot\")\n const labelProps = useSlotComponentProps({}, \"labelList\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const dot = useMemo<UseChartLineProps[\"dot\"]>(() => {\n if (!dotProp) return dotProp\n\n const className = cx(\n dotProps.className,\n css(dotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(dotProp)) {\n return (props) =>\n dotProp({\n ...props,\n className: cx(className, props.className),\n })\n } else if (isValidElement(dotProp)) {\n return cloneElement<any>(dotProp, {\n className,\n })\n } else if (isObject(dotProp)) {\n const [omittedProps, styleProps] = splitObject<DotProps, CSSObject>(\n dotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [dotProp, dotProps.className, dotProps.css, css, color])\n const activeDot = useMemo<UseChartLineProps[\"activeDot\"]>(() => {\n if (!activeDotProp) return activeDotProp\n\n const className = cx(\n activeDotProps.className,\n css(activeDotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(activeDotProp)) {\n return (props) =>\n activeDotProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(activeDotProp)) {\n return cloneElement<any>(activeDotProp, { className })\n } else if (isObject(activeDotProp)) {\n const [omittedProps, styleProps] = splitObject<ActiveDotProps, CSSObject>(\n activeDotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [activeDotProp, activeDotProps.className, activeDotProps.css, css, color])\n const label = useMemo<UseChartLineProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelListProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getAreaProps, getRootProps } = useChartArea({\n activeDot,\n dataKey,\n dot,\n fill: color ? `url(#${id})` : \"\",\n label,\n stroke,\n ...rest,\n })\n\n return (\n <>\n <styled.line asChild {...getRootProps()}>\n <Area {...getAreaProps()}>{children}</Area>\n </styled.line>\n\n <defs>\n {withGradient ? (\n <linearGradient id={id} x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <styled.stop\n asChild\n stopColor={color}\n stopOpacity={gradient?.start ?? \"{area-start-fill-opacity}\"}\n >\n <stop offset=\"5%\" />\n </styled.stop>\n <styled.stop\n asChild\n stopColor={color}\n stopOpacity={gradient?.end ?? \"{area-end-fill-opacity}\"}\n >\n <stop offset=\"95%\" />\n </styled.stop>\n </linearGradient>\n ) : (\n <linearGradient id={id} x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <styled.stop\n stopColor={color}\n stopOpacity={rest.fillOpacity ?? \"{area-fill-opacity}\"}\n />\n </linearGradient>\n )}\n </defs>\n </>\n )\n}, \"area\")() as GenericsComponent<{\n <Y extends Dict>(props: ChartAreaProps<Y>): ReactElement\n}>\n\nexport interface ChartBarProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"path\">,\n Omit<UseChartBarProps, \"dataKey\" | \"fill\" | \"label\">\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: keyof Y\n /**\n * The label list to use for the bar.\n *\n * @default false\n */\n label?: ChartLabelList\n}\n\nexport const ChartBar = withContext<\"path\", ChartBarProps>((props) => {\n const { barProps } = useComponentContext()\n const {\n children,\n dataKey,\n fill: fillProp,\n label: labelProp = false,\n ...rest\n } = mergeProps(barProps, props)()\n const system = useSystem()\n const { theme } = useTheme()\n const color = fillProp ?? rest.color\n const fill = JSON.stringify(color)\n const labelProps = useSlotComponentProps({}, \"labelList\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const label = useMemo<UseChartBarProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelListProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getBarProps, getRootProps } = useChartBar({\n dataKey,\n fill,\n label,\n ...rest,\n })\n\n return (\n <styled.path asChild {...getRootProps()}>\n <Bar {...getBarProps()}>{children}</Bar>\n </styled.path>\n )\n}, \"bar\")() as GenericsComponent<{\n <Y extends Dict>(props: ChartBarProps<Y>): ReactElement\n}>\n\nexport interface ChartReferenceLineProps extends Omit<\n Merge<HTMLStyledProps<\"line\">, UseChartReferenceLineProps>,\n \"label\"\n> {\n /**\n * The label to use for the reference line.\n *\n * @default false\n */\n label?: ChartLabel\n}\n\nexport const ChartReferenceLine = withContext<\"line\", ChartReferenceLineProps>(\n (props) => {\n const { referenceLineProps } = useComponentContext()\n const { label: labelProp = false, ...rest } = {\n ...referenceLineProps,\n ...props,\n }\n const system = useSystem()\n const { theme } = useTheme()\n const labelProps = useSlotComponentProps({}, \"referenceLineLabel\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const label = useMemo<UseChartReferenceLineProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className, children: labelProp }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getReferenceLineProps, getRootProps } = useChartReferenceLine({\n label,\n ...rest,\n })\n\n return (\n <styled.line asChild {...getRootProps()}>\n <ReferenceLine {...getReferenceLineProps()} />\n </styled.line>\n )\n },\n \"referenceLine\",\n)()\n"],"mappings":";;;;;;;;;;;;;;;;AA4EA,MAAM,oBAAoB,wBAAwB;AAkNlD,MAAM,EACJ,kBACA,cAAc,4BACd,qBACA,iBAAiB,+BACjB,aACA,cACA,0BACE,oBAIF,mBAAmB,mBAAmB;AAIxC,MAAa,iBAAiB,cACJ,EACtB,YAAY,gBACZ,QACA,WAAW,MACX,YAAY,MACZ,YAAY,OACZ,WACA,UACA,YACA,WACA,WACA,oBACA,YACA,YACA,GAAG,WACyB;CAC5B,MAAM,EAAE,eAAe,iBAAiB,kBAAkB,IAAI;CAC9D,MAAM,aAAa,cACX;EACJ;GACE,WAAW;GACX,UAAU,WAAW,oBAAC,WAAD,CAAY,CAAA,IAAI;EACvC;EACA;GACE,WAAW;GACX,UAAU,oBAAC,YAAD,EAAY,MAAM,CAAC,UAAY,CAAA;EAC3C;EACA;GACE,WAAW;GACX,UAAU,oBAAC,YAAD,EAAY,MAAM,CAAC,UAAY,CAAA;EAC3C;EACA,GAAG;CACL,GACA;EAAC;EAAgB;EAAU;EAAW;CAAS,CACjD;CACA,MAAM,mBAAmB,eAChB;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,oBAAC,kBAAD;EAAkB,OAAO;EACvB,UAA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