@yamada-ui/react 2.3.0-next-20261009073533 → 2.3.1-dev-20261030022105
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 +4 -3
- package/dist/cjs/components/accordion/accordion.cjs.map +1 -1
- package/dist/cjs/components/aspect-ratio/aspect-ratio.cjs +2 -2
- package/dist/cjs/components/aspect-ratio/aspect-ratio.cjs.map +1 -1
- package/dist/cjs/components/blockquote/blockquote.style.cjs +1 -1
- package/dist/cjs/components/blockquote/blockquote.style.cjs.map +1 -1
- package/dist/cjs/components/breadcrumb/use-breadcrumb.cjs +2 -1
- package/dist/cjs/components/breadcrumb/use-breadcrumb.cjs.map +1 -1
- package/dist/cjs/components/bubble/bubble.cjs +163 -0
- package/dist/cjs/components/bubble/bubble.cjs.map +1 -0
- package/dist/cjs/components/bubble/bubble.style.cjs +143 -0
- package/dist/cjs/components/bubble/bubble.style.cjs.map +1 -0
- package/dist/cjs/components/bubble/index.cjs +18 -0
- package/dist/cjs/components/bubble/namespace.cjs +28 -0
- package/dist/cjs/components/bubble/namespace.cjs.map +1 -0
- package/dist/cjs/components/button/button.cjs +11 -8
- package/dist/cjs/components/button/button.cjs.map +1 -1
- package/dist/cjs/components/calendar/calendar.cjs +3 -1
- package/dist/cjs/components/calendar/calendar.cjs.map +1 -1
- package/dist/cjs/components/calendar/use-calendar.cjs +11 -6
- package/dist/cjs/components/calendar/use-calendar.cjs.map +1 -1
- package/dist/cjs/components/code/code.style.cjs +2 -1
- package/dist/cjs/components/code/code.style.cjs.map +1 -1
- package/dist/cjs/components/date-picker/use-date-picker.cjs +10 -10
- package/dist/cjs/components/date-picker/use-date-picker.cjs.map +1 -1
- package/dist/cjs/components/drawer/drawer.cjs +13 -1
- package/dist/cjs/components/drawer/drawer.cjs.map +1 -1
- package/dist/cjs/components/drawer/index.cjs +1 -0
- package/dist/cjs/components/drawer/namespace.cjs +2 -0
- package/dist/cjs/components/drawer/namespace.cjs.map +1 -1
- package/dist/cjs/components/drawer/use-drawer.cjs +139 -11
- package/dist/cjs/components/drawer/use-drawer.cjs.map +1 -1
- package/dist/cjs/components/field/field.cjs +4 -3
- package/dist/cjs/components/field/field.cjs.map +1 -1
- package/dist/cjs/components/file-input/use-file-input.cjs.map +1 -1
- package/dist/cjs/components/icon/icons/armenian-dram-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/armenian-dram-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/bangladeshi-taka-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/bangladeshi-taka-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/belarusian-ruble-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/belarusian-ruble-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/calendar-chevrons-left-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/calendar-chevrons-left-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/certificate-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/certificate-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/circle-fading-play-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/circle-fading-play-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/cpu-ai-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/cpu-ai-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/door-closed-cog-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/door-closed-cog-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/eighth-note-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/eighth-note-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/eighth-notes-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/eighth-notes-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/folder-user-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/folder-user-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/folder-users-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/folder-users-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/graph-star-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/graph-star-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/groceries-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/groceries-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/guitar-electric-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/guitar-electric-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/half-note-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/half-note-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/handle-bottom-right-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/handle-bottom-right-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/hiking-stick-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/hiking-stick-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/index.cjs +123 -12
- package/dist/cjs/components/icon/icons/index.cjs.map +1 -1
- package/dist/cjs/components/icon/icons/kazakh-tenge-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/kazakh-tenge-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/layout-grid-circles-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/layout-grid-circles-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/lens-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/lens-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/letters-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/letters-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/mail-dot-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/mail-dot-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/message-circle-text-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/message-circle-text-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/perfume-bottle-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/perfume-bottle-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/phone-log-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/phone-log-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/printer3d-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/printer3d-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/rugby-ball-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/rugby-ball-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/scratch-blocks-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/scratch-blocks-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/screw-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/screw-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/server-nas-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/server-nas-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/shield-house-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/shield-house-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/sixteenth-notes-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/sixteenth-notes-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/text-align-justify-center-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/text-align-justify-center-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/text-align-justify-end-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/text-align-justify-end-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/text-align-justify-start-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/text-align-justify-start-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/user-round-star-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/user-round-star-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/users-collaboration-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/users-collaboration-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/users-round-collaboration-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/users-round-collaboration-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/wifi-lock-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/wifi-lock-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/wind-arrow-up-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/wind-arrow-up-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/index.cjs +82 -8
- package/dist/cjs/components/kbd/kbd.style.cjs +2 -1
- package/dist/cjs/components/kbd/kbd.style.cjs.map +1 -1
- package/dist/cjs/components/list/list.cjs +5 -3
- package/dist/cjs/components/list/list.cjs.map +1 -1
- package/dist/cjs/components/marquee/index.cjs +21 -0
- package/dist/cjs/components/marquee/marquee.cjs +74 -0
- package/dist/cjs/components/marquee/marquee.cjs.map +1 -0
- package/dist/cjs/components/marquee/marquee.style.cjs +121 -0
- package/dist/cjs/components/marquee/marquee.style.cjs.map +1 -0
- package/dist/cjs/components/marquee/namespace.cjs +26 -0
- package/dist/cjs/components/marquee/namespace.cjs.map +1 -0
- package/dist/cjs/components/marquee/use-marquee.cjs +183 -0
- package/dist/cjs/components/marquee/use-marquee.cjs.map +1 -0
- package/dist/cjs/components/native-accordion/native-accordion.cjs +4 -3
- package/dist/cjs/components/native-accordion/native-accordion.cjs.map +1 -1
- package/dist/cjs/components/prose/index.cjs +7 -0
- package/dist/cjs/components/prose/prose.cjs +17 -0
- package/dist/cjs/components/prose/prose.cjs.map +1 -0
- package/dist/cjs/components/prose/prose.style.cjs +205 -0
- package/dist/cjs/components/prose/prose.style.cjs.map +1 -0
- package/dist/cjs/components/reorder/use-reorder.cjs +2 -1
- package/dist/cjs/components/reorder/use-reorder.cjs.map +1 -1
- package/dist/cjs/components/resizable/index.cjs +6 -1
- package/dist/cjs/components/resizable/namespace.cjs +6 -1
- package/dist/cjs/components/resizable/use-resizable.cjs +6 -1
- package/dist/cjs/components/select/use-select.cjs.map +1 -1
- package/dist/cjs/components/sidebar/sidebar.cjs +4 -3
- package/dist/cjs/components/sidebar/sidebar.cjs.map +1 -1
- package/dist/cjs/components/slot/slot.cjs +10 -9
- package/dist/cjs/components/slot/slot.cjs.map +1 -1
- package/dist/cjs/components/stack/stack.cjs +2 -1
- package/dist/cjs/components/stack/stack.cjs.map +1 -1
- package/dist/cjs/components/table/index.cjs +6 -1
- package/dist/cjs/components/toggle/toggle.style.cjs +2 -0
- package/dist/cjs/components/toggle/toggle.style.cjs.map +1 -1
- package/dist/cjs/components/tree/tree.cjs +5 -3
- package/dist/cjs/components/tree/tree.cjs.map +1 -1
- package/dist/cjs/core/components/create-component.cjs +1 -1
- package/dist/cjs/core/components/create-component.cjs.map +1 -1
- package/dist/cjs/core/css/conditions.cjs +4 -4
- package/dist/cjs/core/css/conditions.cjs.map +1 -1
- package/dist/cjs/core/css/styles.cjs.map +1 -1
- package/dist/cjs/hooks/use-focus/index.cjs +7 -14
- package/dist/cjs/hooks/use-focus/index.cjs.map +1 -1
- package/dist/cjs/index.cjs +306 -112
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/utils/children.cjs +22 -9
- package/dist/cjs/utils/children.cjs.map +1 -1
- package/dist/cjs/utils/index.cjs +4 -0
- package/dist/esm/components/accordion/accordion.js +5 -4
- package/dist/esm/components/accordion/accordion.js.map +1 -1
- package/dist/esm/components/aspect-ratio/aspect-ratio.js +2 -2
- package/dist/esm/components/aspect-ratio/aspect-ratio.js.map +1 -1
- package/dist/esm/components/blockquote/blockquote.style.js +1 -1
- package/dist/esm/components/blockquote/blockquote.style.js.map +1 -1
- package/dist/esm/components/box/index.js +1 -2
- package/dist/esm/components/breadcrumb/use-breadcrumb.js +2 -1
- package/dist/esm/components/breadcrumb/use-breadcrumb.js.map +1 -1
- package/dist/esm/components/bubble/bubble.js +157 -0
- package/dist/esm/components/bubble/bubble.js.map +1 -0
- package/dist/esm/components/bubble/bubble.style.js +144 -0
- package/dist/esm/components/bubble/bubble.style.js.map +1 -0
- package/dist/esm/components/bubble/index.js +4 -0
- package/dist/esm/components/bubble/namespace.js +16 -0
- package/dist/esm/components/bubble/namespace.js.map +1 -0
- package/dist/esm/components/button/button.js +11 -8
- package/dist/esm/components/button/button.js.map +1 -1
- package/dist/esm/components/calendar/calendar.js +3 -1
- package/dist/esm/components/calendar/calendar.js.map +1 -1
- package/dist/esm/components/calendar/use-calendar.js +12 -7
- package/dist/esm/components/calendar/use-calendar.js.map +1 -1
- package/dist/esm/components/client-only/index.js +1 -2
- package/dist/esm/components/code/code.style.js +2 -1
- package/dist/esm/components/code/code.style.js.map +1 -1
- package/dist/esm/components/date-picker/use-date-picker.js +10 -10
- package/dist/esm/components/date-picker/use-date-picker.js.map +1 -1
- package/dist/esm/components/drawer/drawer.js +13 -2
- package/dist/esm/components/drawer/drawer.js.map +1 -1
- package/dist/esm/components/drawer/index.js +2 -2
- package/dist/esm/components/drawer/namespace.js +3 -2
- package/dist/esm/components/drawer/namespace.js.map +1 -1
- package/dist/esm/components/drawer/use-drawer.js +140 -12
- package/dist/esm/components/drawer/use-drawer.js.map +1 -1
- package/dist/esm/components/field/field.js +5 -4
- package/dist/esm/components/field/field.js.map +1 -1
- package/dist/esm/components/file-input/use-file-input.js.map +1 -1
- package/dist/esm/components/focus-lock/index.js +1 -2
- package/dist/esm/components/for/index.js +1 -2
- package/dist/esm/components/icon/icons/armenian-dram-icon.js +14 -0
- package/dist/esm/components/icon/icons/armenian-dram-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/bangladeshi-taka-icon.js +14 -0
- package/dist/esm/components/icon/icons/bangladeshi-taka-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/belarusian-ruble-icon.js +14 -0
- package/dist/esm/components/icon/icons/belarusian-ruble-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/calendar-chevrons-left-icon.js +14 -0
- package/dist/esm/components/icon/icons/calendar-chevrons-left-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/certificate-icon.js +14 -0
- package/dist/esm/components/icon/icons/certificate-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/circle-fading-play-icon.js +14 -0
- package/dist/esm/components/icon/icons/circle-fading-play-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/cpu-ai-icon.js +14 -0
- package/dist/esm/components/icon/icons/cpu-ai-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/door-closed-cog-icon.js +14 -0
- package/dist/esm/components/icon/icons/door-closed-cog-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/eighth-note-icon.js +14 -0
- package/dist/esm/components/icon/icons/eighth-note-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/eighth-notes-icon.js +14 -0
- package/dist/esm/components/icon/icons/eighth-notes-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/folder-user-icon.js +14 -0
- package/dist/esm/components/icon/icons/folder-user-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/folder-users-icon.js +14 -0
- package/dist/esm/components/icon/icons/folder-users-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/graph-star-icon.js +14 -0
- package/dist/esm/components/icon/icons/graph-star-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/groceries-icon.js +14 -0
- package/dist/esm/components/icon/icons/groceries-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/guitar-electric-icon.js +14 -0
- package/dist/esm/components/icon/icons/guitar-electric-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/half-note-icon.js +14 -0
- package/dist/esm/components/icon/icons/half-note-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/handle-bottom-right-icon.js +14 -0
- package/dist/esm/components/icon/icons/handle-bottom-right-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/hiking-stick-icon.js +14 -0
- package/dist/esm/components/icon/icons/hiking-stick-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/index.js +83 -9
- package/dist/esm/components/icon/icons/index.js.map +1 -1
- package/dist/esm/components/icon/icons/kazakh-tenge-icon.js +14 -0
- package/dist/esm/components/icon/icons/kazakh-tenge-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/layout-grid-circles-icon.js +14 -0
- package/dist/esm/components/icon/icons/layout-grid-circles-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/lens-icon.js +14 -0
- package/dist/esm/components/icon/icons/lens-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/letters-icon.js +14 -0
- package/dist/esm/components/icon/icons/letters-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/mail-dot-icon.js +14 -0
- package/dist/esm/components/icon/icons/mail-dot-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/message-circle-text-icon.js +14 -0
- package/dist/esm/components/icon/icons/message-circle-text-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/perfume-bottle-icon.js +14 -0
- package/dist/esm/components/icon/icons/perfume-bottle-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/phone-log-icon.js +14 -0
- package/dist/esm/components/icon/icons/phone-log-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/printer3d-icon.js +14 -0
- package/dist/esm/components/icon/icons/printer3d-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/rugby-ball-icon.js +14 -0
- package/dist/esm/components/icon/icons/rugby-ball-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/scratch-blocks-icon.js +14 -0
- package/dist/esm/components/icon/icons/scratch-blocks-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/screw-icon.js +14 -0
- package/dist/esm/components/icon/icons/screw-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/server-nas-icon.js +14 -0
- package/dist/esm/components/icon/icons/server-nas-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/shield-house-icon.js +14 -0
- package/dist/esm/components/icon/icons/shield-house-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/sixteenth-notes-icon.js +14 -0
- package/dist/esm/components/icon/icons/sixteenth-notes-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/text-align-justify-center-icon.js +14 -0
- package/dist/esm/components/icon/icons/text-align-justify-center-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/text-align-justify-end-icon.js +14 -0
- package/dist/esm/components/icon/icons/text-align-justify-end-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/text-align-justify-start-icon.js +14 -0
- package/dist/esm/components/icon/icons/text-align-justify-start-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/user-round-star-icon.js +14 -0
- package/dist/esm/components/icon/icons/user-round-star-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/users-collaboration-icon.js +14 -0
- package/dist/esm/components/icon/icons/users-collaboration-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/users-round-collaboration-icon.js +14 -0
- package/dist/esm/components/icon/icons/users-round-collaboration-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/wifi-lock-icon.js +14 -0
- package/dist/esm/components/icon/icons/wifi-lock-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/wind-arrow-up-icon.js +14 -0
- package/dist/esm/components/icon/icons/wind-arrow-up-icon.js.map +1 -0
- package/dist/esm/components/icon/index.js +42 -5
- package/dist/esm/components/kbd/kbd.style.js +2 -1
- package/dist/esm/components/kbd/kbd.style.js.map +1 -1
- package/dist/esm/components/list/list.js +5 -3
- package/dist/esm/components/list/list.js.map +1 -1
- package/dist/esm/components/marquee/index.js +5 -0
- package/dist/esm/components/marquee/marquee.js +69 -0
- package/dist/esm/components/marquee/marquee.js.map +1 -0
- package/dist/esm/components/marquee/marquee.style.js +122 -0
- package/dist/esm/components/marquee/marquee.style.js.map +1 -0
- package/dist/esm/components/marquee/namespace.js +15 -0
- package/dist/esm/components/marquee/namespace.js.map +1 -0
- package/dist/esm/components/marquee/use-marquee.js +181 -0
- package/dist/esm/components/marquee/use-marquee.js.map +1 -0
- package/dist/esm/components/native-accordion/native-accordion.js +5 -4
- package/dist/esm/components/native-accordion/native-accordion.js.map +1 -1
- package/dist/esm/components/picture/index.js +1 -2
- package/dist/esm/components/portal/index.js +1 -2
- package/dist/esm/components/prose/index.js +3 -0
- package/dist/esm/components/prose/prose.js +15 -0
- package/dist/esm/components/prose/prose.js.map +1 -0
- package/dist/esm/components/prose/prose.style.js +205 -0
- package/dist/esm/components/prose/prose.style.js.map +1 -0
- package/dist/esm/components/reorder/use-reorder.js +2 -1
- package/dist/esm/components/reorder/use-reorder.js.map +1 -1
- package/dist/esm/components/select/use-select.js.map +1 -1
- package/dist/esm/components/show/index.js +1 -2
- package/dist/esm/components/sidebar/sidebar.js +5 -4
- package/dist/esm/components/sidebar/sidebar.js.map +1 -1
- package/dist/esm/components/slot/index.js +1 -2
- package/dist/esm/components/slot/slot.js +11 -10
- package/dist/esm/components/slot/slot.js.map +1 -1
- package/dist/esm/components/stack/stack.js +2 -1
- package/dist/esm/components/stack/stack.js.map +1 -1
- package/dist/esm/components/table/index.js +1 -2
- package/dist/esm/components/tip/index.js +1 -2
- package/dist/esm/components/toggle/toggle.style.js +2 -0
- package/dist/esm/components/toggle/toggle.style.js.map +1 -1
- package/dist/esm/components/tree/tree.js +5 -3
- package/dist/esm/components/tree/tree.js.map +1 -1
- package/dist/esm/core/components/create-component.js +1 -1
- package/dist/esm/core/components/create-component.js.map +1 -1
- package/dist/esm/core/css/conditions.js +4 -4
- package/dist/esm/core/css/conditions.js.map +1 -1
- package/dist/esm/core/css/styles.js.map +1 -1
- package/dist/esm/hooks/use-focus/index.js +8 -15
- package/dist/esm/hooks/use-focus/index.js.map +1 -1
- package/dist/esm/index.js +215 -105
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/providers/ui-provider/index.js +1 -2
- package/dist/esm/utils/children.js +22 -11
- package/dist/esm/utils/children.js.map +1 -1
- package/dist/esm/utils/index.js +4 -2
- package/dist/types/components/alert/alert.d.ts +0 -1
- package/dist/types/components/alpha-slider/alpha-slider.d.ts +0 -1
- package/dist/types/components/autocomplete/autocomplete.d.ts +0 -1
- package/dist/types/components/breadcrumb/use-breadcrumb.d.ts +1 -1
- package/dist/types/components/bubble/bubble.d.ts +89 -0
- package/dist/types/components/bubble/bubble.style.d.ts +79 -0
- package/dist/types/components/bubble/index.d.ts +4 -0
- package/dist/types/components/bubble/namespace.d.ts +7 -0
- package/dist/types/components/button/button.d.ts +0 -1
- package/dist/types/components/calendar/calendar.d.ts +0 -1
- package/dist/types/components/calendar/use-calendar.d.ts +4 -3
- package/dist/types/components/color-picker/color-picker.d.ts +0 -3
- package/dist/types/components/color-selector/color-selector.d.ts +0 -1
- package/dist/types/components/color-selector/use-color-selector.d.ts +1 -0
- package/dist/types/components/date-picker/date-picker.d.ts +0 -3
- package/dist/types/components/date-picker/use-date-picker.d.ts +1 -0
- package/dist/types/components/drawer/drawer.d.ts +2 -0
- package/dist/types/components/drawer/index.d.ts +2 -2
- package/dist/types/components/drawer/namespace.d.ts +3 -3
- package/dist/types/components/drawer/use-drawer.d.ts +9 -2
- package/dist/types/components/dropzone/dropzone.d.ts +0 -1
- package/dist/types/components/field/use-field-props.d.ts +1 -1
- package/dist/types/components/hue-slider/hue-slider.d.ts +0 -1
- package/dist/types/components/icon/icons/armenian-dram-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/bangladeshi-taka-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/belarusian-ruble-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/calendar-chevrons-left-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/certificate-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/circle-fading-play-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/cpu-ai-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/door-closed-cog-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/eighth-note-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/eighth-notes-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/folder-user-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/folder-users-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/graph-star-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/groceries-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/guitar-electric-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/half-note-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/handle-bottom-right-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/hiking-stick-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/index.d.ts +43 -6
- package/dist/types/components/icon/icons/index.type.d.ts +1 -1
- package/dist/types/components/icon/icons/kazakh-tenge-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/layout-grid-circles-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/lens-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/letters-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/mail-dot-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/message-circle-text-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/perfume-bottle-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/phone-log-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/printer3d-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/rugby-ball-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/scratch-blocks-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/{music-icon.d.ts → screw-icon.d.ts} +4 -4
- package/dist/types/components/icon/icons/server-nas-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/shield-house-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/sixteenth-notes-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/text-align-justify-center-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/text-align-justify-end-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/text-align-justify-start-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/user-round-star-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/users-collaboration-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/users-round-collaboration-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/wifi-lock-icon.d.ts +12 -0
- package/dist/types/components/icon/icons/wind-arrow-up-icon.d.ts +12 -0
- package/dist/types/components/icon/index.d.ts +42 -5
- package/dist/types/components/loading/loading-provider.d.ts +1 -0
- package/dist/types/components/loading/use-loading-component.d.ts +0 -1
- package/dist/types/components/marquee/index.d.ts +5 -0
- package/dist/types/components/marquee/marquee.d.ts +50 -0
- package/dist/types/components/marquee/marquee.style.d.ts +8 -0
- package/dist/types/components/marquee/namespace.d.ts +8 -0
- package/dist/types/components/marquee/use-marquee.d.ts +127 -0
- package/dist/types/components/menu/menu.d.ts +0 -1
- package/dist/types/components/motion/factory.d.ts +1 -0
- package/dist/types/components/motion/index.type.d.ts +4 -3
- package/dist/types/components/native-select/native-select.d.ts +0 -1
- package/dist/types/components/native-select/use-native-select.d.ts +1 -0
- package/dist/types/components/notice/use-notice.d.ts +0 -1
- package/dist/types/components/number-input/number-input.d.ts +0 -1
- package/dist/types/components/pagination/pagination.d.ts +0 -1
- package/dist/types/components/password-input/password-input.d.ts +0 -1
- package/dist/types/components/prose/index.d.ts +3 -0
- package/dist/types/components/prose/prose.d.ts +17 -0
- package/dist/types/components/prose/prose.style.d.ts +121 -0
- package/dist/types/components/rating/rating.d.ts +1 -0
- package/dist/types/components/reorder/use-reorder.d.ts +1 -1
- package/dist/types/components/select/select.d.ts +0 -1
- package/dist/types/components/sidebar/sidebar.d.ts +0 -2
- package/dist/types/components/sidebar/sidebar.style.d.ts +1 -0
- package/dist/types/components/snacks/use-snacks.d.ts +1 -1
- package/dist/types/components/table/table.d.ts +0 -1
- package/dist/types/components/toggle/toggle.d.ts +6 -0
- package/dist/types/components/toggle/toggle.style.d.ts +2 -0
- package/dist/types/components/tree/tree.d.ts +0 -1
- package/dist/types/core/components/create-component.d.ts +1 -0
- package/dist/types/core/components/index.type.d.ts +4 -2
- package/dist/types/core/components/props.d.ts +1 -0
- package/dist/types/core/components/use-component-style.d.ts +1 -0
- package/dist/types/core/css/conditions.d.ts +10 -10
- package/dist/types/core/css/styles.d.ts +36 -16
- package/dist/types/core/system/breakpoint.d.ts +1 -0
- package/dist/types/core/system/config.d.ts +1 -0
- package/dist/types/core/system/create-system.d.ts +1 -0
- package/dist/types/core/system/factory.d.ts +1 -0
- package/dist/types/core/system/index.type.d.ts +1 -0
- package/dist/types/core/system/system-provider.d.ts +1 -0
- package/dist/types/hooks/use-async/index.d.ts +1 -0
- package/dist/types/hooks/use-async-callback/index.d.ts +1 -1
- package/dist/types/hooks/use-controllable-state/index.d.ts +1 -0
- package/dist/types/hooks/use-descendants/index.d.ts +1 -0
- package/dist/types/hooks/use-eye-dropper/index.d.ts +1 -0
- package/dist/types/hooks/use-popper/index.d.ts +1 -0
- package/dist/types/hooks/use-window-event/index.d.ts +1 -0
- package/dist/types/index.d.ts +103 -54
- package/dist/types/providers/i18n-provider/i18n-cache.d.ts +1 -0
- package/dist/types/providers/i18n-provider/icu.type.d.ts +1 -0
- package/dist/types/utils/children.d.ts +11 -2
- package/dist/types/utils/context.d.ts +1 -0
- package/dist/types/utils/dom.d.ts +1 -0
- package/dist/types/utils/index.d.ts +3 -3
- package/dist/types/utils/store.d.ts +1 -0
- package/package.json +21 -18
- package/dist/cjs/components/icon/icons/music-icon.cjs +0 -14
- package/dist/cjs/components/icon/icons/music-icon.cjs.map +0 -1
- package/dist/cjs/components/icon/icons/music2-icon.cjs +0 -14
- package/dist/cjs/components/icon/icons/music2-icon.cjs.map +0 -1
- package/dist/cjs/components/icon/icons/music3-icon.cjs +0 -14
- package/dist/cjs/components/icon/icons/music3-icon.cjs.map +0 -1
- package/dist/cjs/components/icon/icons/music4-icon.cjs +0 -14
- package/dist/cjs/components/icon/icons/music4-icon.cjs.map +0 -1
- package/dist/esm/components/icon/icons/music-icon.js +0 -14
- package/dist/esm/components/icon/icons/music-icon.js.map +0 -1
- package/dist/esm/components/icon/icons/music2-icon.js +0 -14
- package/dist/esm/components/icon/icons/music2-icon.js.map +0 -1
- package/dist/esm/components/icon/icons/music3-icon.js +0 -14
- package/dist/esm/components/icon/icons/music3-icon.js.map +0 -1
- package/dist/esm/components/icon/icons/music4-icon.js +0 -14
- package/dist/esm/components/icon/icons/music4-icon.js.map +0 -1
- package/dist/types/components/icon/icons/music2-icon.d.ts +0 -12
- package/dist/types/components/icon/icons/music3-icon.d.ts +0 -12
- package/dist/types/components/icon/icons/music4-icon.d.ts +0 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.cjs","names":["useRef","useCallback","createComponent","buttonStyle","useRipple","useMemo","styled","mergeRefs","Ripple","getClassName","isLoadingScheme","getLoadingComponent","mergeCSS","isValidElement","cloneElement","Children"],"sources":["../../../../src/components/button/button.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ElementType, PropsWithChildren, ReactNode } from \"react\"\nimport type {\n CSSObject,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Loading } from \"../loading\"\nimport type { ButtonStyle } from \"./button.style\"\nimport {\n Children,\n cloneElement,\n isValidElement,\n useCallback,\n useMemo,\n useRef,\n} from \"react\"\nimport { createComponent, getClassName, mergeCSS, styled } from \"../../core\"\nimport { bem, dataAttr, mergeRefs } from \"../../utils\"\nimport { getLoadingComponent, isLoadingScheme } from \"../loading\"\nimport { Ripple, useRipple } from \"../ripple\"\nimport { buttonStyle } from \"./button.style\"\n\ninterface ComponentContext extends Pick<\n ButtonProps,\n \"endIcon\" | \"iconProps\" | \"loadingIcon\" | \"loadingMessage\" | \"startIcon\"\n> {}\n\nconst useButtonType = (value?: ElementType) => {\n const buttonRef = useRef(!value)\n\n const ref = useCallback((node: HTMLElement | null) => {\n if (node) buttonRef.current = node.tagName === \"BUTTON\"\n }, [])\n\n const type = buttonRef.current ? \"button\" : undefined\n\n return { ref, type } as const\n}\n\nexport interface ButtonProps\n extends HTMLStyledProps<\"button\">, ThemeProps<ButtonStyle> {\n /**\n * If `true`, the button is represented as active.\n *\n * @default false\n */\n active?: boolean\n /**\n * If `true`, the button is disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * If `true`, disable ripple effects when pressing a element.\n *\n * @default false\n */\n disableRipple?: boolean\n /**\n * The icon to display at the end side of the button.\n */\n endIcon?: ReactNode\n /**\n * If `true`, the loading state of the button is represented.\n *\n * @default false\n */\n loading?: boolean\n /**\n * The icon to display when the button is loading.\n *\n * @default 'oval'\n */\n loadingIcon?: Loading.Scheme | ReactNode\n /**\n * The message to display when the button is loading.\n */\n loadingMessage?: ReactNode\n /**\n * The placement of the loading indicator. Accepts `start` or `end`.\n *\n * @default 'start'\n */\n loadingPlacement?: \"end\" | \"start\"\n /**\n * The icon to display at the start side of the button.\n */\n startIcon?: ReactNode\n /**\n * The type of button. Accepts `button`, `reset`, or `submit`.\n *\n * @default 'button'\n */\n type?: HTMLProps<\"button\">[\"type\"]\n /**\n * The props of the icon element.\n */\n iconProps?: ButtonIconProps\n /**\n * The props of the loading icon element.\n */\n loadingProps?: ButtonLoadingProps\n}\n\nconst {\n component,\n ComponentContext,\n PropsContext: ButtonPropsContext,\n useComponentContext,\n usePropsContext: useButtonPropsContext,\n withContext,\n} = createComponent<ButtonProps, ButtonStyle, ComponentContext>(\n \"button\",\n buttonStyle,\n)\n\nexport { ButtonPropsContext, useButtonPropsContext }\n\n/**\n * `Button` is an interactive component that allows users to perform actions such as submitting forms and toggling modals.\n *\n * @see https://yamada-ui.com/docs/components/button\n */\nexport const Button = withContext<\"button\", ButtonProps>(\n ({\n ref,\n as,\n active,\n children,\n disabled,\n disableRipple,\n endIcon = null,\n loading,\n loadingIcon = \"oval\",\n loadingMessage,\n loadingPlacement = \"start\",\n startIcon = null,\n iconProps,\n loadingProps,\n ...rest\n }) => {\n const trulyDisabled = disabled || loading\n const { ref: buttonRef, type } = useButtonType(as)\n const { onClick, ...rippleProps } = useRipple({\n ...rest,\n disabled: disableRipple || trulyDisabled,\n })\n const startLoading = loading && loadingPlacement === \"start\"\n const endLoading = loading && loadingPlacement === \"end\"\n\n const context = useMemo(\n () => ({ endIcon, loadingIcon, loadingMessage, startIcon, iconProps }),\n [loadingIcon, loadingMessage, startIcon, endIcon, iconProps],\n )\n\n return (\n <ComponentContext value={context}>\n <styled.button\n ref={mergeRefs(ref, buttonRef)}\n as={as}\n type={type}\n data-active={dataAttr(active)}\n data-loading={dataAttr(loading)}\n disabled={trulyDisabled}\n {...rest}\n onClick={onClick}\n >\n {startLoading ? <ButtonStartLoading {...loadingProps} /> : null}\n\n {loading ? (\n loadingMessage || (\n <styled.span opacity={0}>\n <ButtonContent>{children}</ButtonContent>\n </styled.span>\n )\n ) : (\n <ButtonContent>{children}</ButtonContent>\n )}\n\n {endLoading ? <ButtonEndLoading {...loadingProps} /> : null}\n\n <Ripple {...rippleProps} />\n </styled.button>\n </ComponentContext>\n )\n },\n)()\n\nconst ButtonContent = component<\"fragment\", PropsWithChildren>(\n ({ children }) => {\n const { endIcon, startIcon, iconProps } = useComponentContext()\n\n return (\n <>\n {startIcon ? (\n <ButtonStartIcon {...iconProps}>{startIcon}</ButtonStartIcon>\n ) : null}\n {children}\n {endIcon ? (\n <ButtonEndIcon {...iconProps}>{endIcon}</ButtonEndIcon>\n ) : null}\n </>\n )\n },\n { name: \"ButtonContent\", className: getClassName(bem(\"button\", \"content\")) },\n)()\n\ninterface ButtonLoadingProps extends HTMLStyledProps<\"svg\"> {}\n\nconst ButtonLoading = component<\"svg\", ButtonLoadingProps>(\n (props) => {\n const { loadingIcon, loadingMessage } = useComponentContext()\n\n const css = useMemo<CSSObject>(\n () => ({\n position: loadingMessage ? \"relative\" : \"absolute\",\n }),\n [loadingMessage],\n )\n\n if (isLoadingScheme(loadingIcon)) {\n const Component = getLoadingComponent(loadingIcon)\n\n return (\n <Component\n color=\"currentColor\"\n {...props}\n css={mergeCSS(css, props.css)}\n />\n )\n }\n\n if (isValidElement<HTMLStyledProps<\"svg\">>(loadingIcon))\n return cloneElement(loadingIcon, {\n ...props,\n ...loadingIcon.props,\n css: mergeCSS(css, props.css, loadingIcon.props.css),\n })\n\n return null\n },\n { name: \"ButtonLoading\", className: getClassName(bem(\"button\", \"loading\")) },\n)()\n\nconst ButtonStartLoading = component<\"svg\", ButtonLoadingProps>(ButtonLoading, {\n name: \"ButtonStartLoading\",\n className: getClassName(bem(\"button\", \"loading\", \"start\")),\n})()\n\nconst ButtonEndLoading = component<\"svg\", ButtonLoadingProps>(ButtonLoading, {\n name: \"ButtonEndLoading\",\n className: getClassName(bem(\"button\", \"loading\", \"end\")),\n})()\n\ninterface ButtonIconProps extends HTMLStyledProps<\"svg\"> {}\n\nconst ButtonIcon = component<\"svg\", ButtonIconProps>(\n ({ children, ...rest }) => {\n if (isValidElement<HTMLProps<\"svg\">>(children))\n return cloneElement(children, {\n \"aria-hidden\": true,\n role: \"img\",\n ...rest,\n ...children.props,\n })\n\n return Children.count(children) > 1 ? Children.only(null) : null\n },\n { name: \"ButtonIcon\", className: getClassName(bem(\"button\", \"icon\")) },\n)()\n\nconst ButtonStartIcon = component<\"svg\", ButtonIconProps>(ButtonIcon, {\n name: \"ButtonStartIcon\",\n className: getClassName(bem(\"button\", \"icon\", \"start\")),\n})()\n\nconst ButtonEndIcon = component<\"svg\", ButtonIconProps>(ButtonIcon, {\n name: \"ButtonEndIcon\",\n className: getClassName(bem(\"button\", \"icon\", \"end\")),\n})()\n"],"mappings":";;;;;;;;;;;;;;AA8BA,MAAM,iBAAiB,UAAwB;CAC7C,MAAM,aAAA,GAAYA,MAAAA,OAAAA,CAAO,CAAC,KAAK;CAQ/B,OAAO;EAAE,MAAA,GANGC,MAAAA,YAAAA,EAAa,SAA6B;GACpD,IAAI,MAAM,UAAU,UAAU,KAAK,YAAY;EACjD,GAAG,CAAC,CAIO;EAAG,MAFD,UAAU,UAAU,WAAW,KAAA;CAEzB;AACrB;AAoEA,MAAM,EACJ,WACA,kBACA,cAAc,oBACd,qBACA,iBAAiB,uBACjB,gBACEC,yBAAAA,gBACF,UACAC,qBAAAA,WACF;;;;;;AASA,MAAa,SAAS,aACnB,EACC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GAAAA,oBAAAA,cAAa,IAAA,CAAI,UAAU,SAAS,CAAC;AAAE,CAC7E,CAAC,CAAC;AAEF,MAAM,qBAAqB,UAAqC,eAAe;CAC7E,MAAM;CACN,WAAWA,cAAAA,cAAAA,GAAAA,oBAAAA,cAAa,IAAA,CAAI,UAAU,WAAW,OAAO,CAAC;AAC3D,CAAC,CAAC,CAAC;AAEH,MAAM,mBAAmB,UAAqC,eAAe;CAC3E,MAAM;CACN,WAAWA,cAAAA,cAAAA,GAAAA,oBAAAA,cAAa,IAAA,CAAI,UAAU,WAAW,KAAK,CAAC;AACzD,CAAC,CAAC,CAAC;AAIH,MAAM,aAAa,WAChB,EAAE,UAAU,GAAG,WAAW;CACzB,KAAA,GAAII,MAAAA,eAAAA,CAAiC,QAAQ,GAC3C,QAAA,GAAOC,MAAAA,aAAAA,CAAa,UAAU;EAC5B,eAAe;EACf,MAAM;EACN,GAAG;EACH,GAAG,SAAS;CACd,CAAC;CAEH,OAAOC,MAAAA,SAAS,MAAM,QAAQ,IAAI,IAAIA,MAAAA,SAAS,KAAK,IAAI,IAAI;AAC9D,GACA;CAAE,MAAM;CAAc,WAAWN,cAAAA,cAAAA,GAAAA,oBAAAA,cAAa,IAAA,CAAI,UAAU,MAAM,CAAC;AAAE,CACvE,CAAC,CAAC;AAEF,MAAM,kBAAkB,UAAkC,YAAY;CACpE,MAAM;CACN,WAAWA,cAAAA,cAAAA,GAAAA,oBAAAA,cAAa,IAAA,CAAI,UAAU,QAAQ,OAAO,CAAC;AACxD,CAAC,CAAC,CAAC;AAEH,MAAM,gBAAgB,UAAkC,YAAY;CAClE,MAAM;CACN,WAAWA,cAAAA,cAAAA,GAAAA,oBAAAA,cAAa,IAAA,CAAI,UAAU,QAAQ,KAAK,CAAC;AACtD,CAAC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"button.cjs","names":["useRef","useCallback","createComponent","buttonStyle","useRipple","useMemo","styled","mergeRefs","Ripple","getClassName","getResolvedChild","isLoadingScheme","getLoadingComponent","mergeCSS","isValidElement","cloneElement","Children"],"sources":["../../../../src/components/button/button.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ElementType, PropsWithChildren, ReactNode } from \"react\"\nimport type {\n CSSObject,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Loading } from \"../loading\"\nimport type { ButtonStyle } from \"./button.style\"\nimport {\n Children,\n cloneElement,\n isValidElement,\n useCallback,\n useMemo,\n useRef,\n} from \"react\"\nimport { createComponent, getClassName, mergeCSS, styled } from \"../../core\"\nimport { bem, dataAttr, getResolvedChild, mergeRefs } from \"../../utils\"\nimport { getLoadingComponent, isLoadingScheme } from \"../loading\"\nimport { Ripple, useRipple } from \"../ripple\"\nimport { buttonStyle } from \"./button.style\"\n\ninterface ComponentContext extends Pick<\n ButtonProps,\n \"endIcon\" | \"iconProps\" | \"loadingIcon\" | \"loadingMessage\" | \"startIcon\"\n> {}\n\nconst useButtonType = (value?: ElementType) => {\n const buttonRef = useRef(!value)\n\n const ref = useCallback((node: HTMLElement | null) => {\n if (node) buttonRef.current = node.tagName === \"BUTTON\"\n }, [])\n\n const type = buttonRef.current ? \"button\" : undefined\n\n return { ref, type } as const\n}\n\nexport interface ButtonProps\n extends HTMLStyledProps<\"button\">, ThemeProps<ButtonStyle> {\n /**\n * If `true`, the button is represented as active.\n *\n * @default false\n */\n active?: boolean\n /**\n * If `true`, the button is disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * If `true`, disable ripple effects when pressing a element.\n *\n * @default false\n */\n disableRipple?: boolean\n /**\n * The icon to display at the end side of the button.\n */\n endIcon?: ReactNode\n /**\n * If `true`, the loading state of the button is represented.\n *\n * @default false\n */\n loading?: boolean\n /**\n * The icon to display when the button is loading.\n *\n * @default 'oval'\n */\n loadingIcon?: Loading.Scheme | ReactNode\n /**\n * The message to display when the button is loading.\n */\n loadingMessage?: ReactNode\n /**\n * The placement of the loading indicator. Accepts `start` or `end`.\n *\n * @default 'start'\n */\n loadingPlacement?: \"end\" | \"start\"\n /**\n * The icon to display at the start side of the button.\n */\n startIcon?: ReactNode\n /**\n * The type of button. Accepts `button`, `reset`, or `submit`.\n *\n * @default 'button'\n */\n type?: HTMLProps<\"button\">[\"type\"]\n /**\n * The props of the icon element.\n */\n iconProps?: ButtonIconProps\n /**\n * The props of the loading icon element.\n */\n loadingProps?: ButtonLoadingProps\n}\n\nconst {\n component,\n ComponentContext,\n PropsContext: ButtonPropsContext,\n useComponentContext,\n usePropsContext: useButtonPropsContext,\n withContext,\n} = createComponent<ButtonProps, ButtonStyle, ComponentContext>(\n \"button\",\n buttonStyle,\n)\n\nexport { ButtonPropsContext, useButtonPropsContext }\n\n/**\n * `Button` is an interactive component that allows users to perform actions such as submitting forms and toggling modals.\n *\n * @see https://yamada-ui.com/docs/components/button\n */\nexport const Button = withContext<\"button\", ButtonProps>(\n ({\n ref,\n as,\n active,\n children,\n disabled,\n disableRipple,\n endIcon = null,\n loading,\n loadingIcon = \"oval\",\n loadingMessage,\n loadingPlacement = \"start\",\n startIcon = null,\n iconProps,\n loadingProps,\n ...rest\n }) => {\n const trulyDisabled = disabled || loading\n const { ref: buttonRef, type } = useButtonType(as)\n const { onClick, ...rippleProps } = useRipple({\n ...rest,\n disabled: disableRipple || trulyDisabled,\n })\n const startLoading = loading && loadingPlacement === \"start\"\n const endLoading = loading && loadingPlacement === \"end\"\n\n const context = useMemo(\n () => ({ endIcon, loadingIcon, loadingMessage, startIcon, iconProps }),\n [loadingIcon, loadingMessage, startIcon, endIcon, iconProps],\n )\n\n return (\n <ComponentContext value={context}>\n <styled.button\n ref={mergeRefs(ref, buttonRef)}\n as={as}\n type={type}\n data-active={dataAttr(active)}\n data-loading={dataAttr(loading)}\n disabled={trulyDisabled}\n {...rest}\n onClick={onClick}\n >\n {startLoading ? <ButtonStartLoading {...loadingProps} /> : null}\n\n {loading ? (\n loadingMessage || (\n <styled.span opacity={0}>\n <ButtonContent>{children}</ButtonContent>\n </styled.span>\n )\n ) : (\n <ButtonContent>{children}</ButtonContent>\n )}\n\n {endLoading ? <ButtonEndLoading {...loadingProps} /> : null}\n\n <Ripple {...rippleProps} />\n </styled.button>\n </ComponentContext>\n )\n },\n)()\n\nconst ButtonContent = component<\"fragment\", PropsWithChildren>(\n ({ children }) => {\n const { endIcon, startIcon, iconProps } = useComponentContext()\n\n return (\n <>\n {startIcon ? (\n <ButtonStartIcon {...iconProps}>{startIcon}</ButtonStartIcon>\n ) : null}\n {children}\n {endIcon ? (\n <ButtonEndIcon {...iconProps}>{endIcon}</ButtonEndIcon>\n ) : null}\n </>\n )\n },\n { name: \"ButtonContent\", className: getClassName(bem(\"button\", \"content\")) },\n)()\n\ninterface ButtonLoadingProps extends HTMLStyledProps<\"svg\"> {}\n\nconst ButtonLoading = component<\"svg\", ButtonLoadingProps>(\n (props) => {\n const { loadingIcon, loadingMessage } = useComponentContext()\n const css = useMemo<CSSObject>(\n () => ({\n position: loadingMessage ? \"relative\" : \"absolute\",\n }),\n [loadingMessage],\n )\n const child = getResolvedChild(loadingIcon)\n\n if (isLoadingScheme(child)) {\n const Component = getLoadingComponent(child)\n\n return (\n <Component\n color=\"currentColor\"\n {...props}\n css={mergeCSS(css, props.css)}\n />\n )\n }\n\n if (isValidElement<HTMLStyledProps<\"svg\">>(child))\n return cloneElement(child, {\n ...props,\n ...child.props,\n css: mergeCSS(css, props.css, child.props.css),\n })\n\n return null\n },\n { name: \"ButtonLoading\", className: getClassName(bem(\"button\", \"loading\")) },\n)()\n\nconst ButtonStartLoading = component<\"svg\", ButtonLoadingProps>(ButtonLoading, {\n name: \"ButtonStartLoading\",\n className: getClassName(bem(\"button\", \"loading\", \"start\")),\n})()\n\nconst ButtonEndLoading = component<\"svg\", ButtonLoadingProps>(ButtonLoading, {\n name: \"ButtonEndLoading\",\n className: getClassName(bem(\"button\", \"loading\", \"end\")),\n})()\n\ninterface ButtonIconProps extends HTMLStyledProps<\"svg\"> {}\n\nconst ButtonIcon = component<\"svg\", ButtonIconProps>(\n ({ children, ...rest }) => {\n const child = getResolvedChild(children)\n\n if (isValidElement<HTMLProps<\"svg\">>(child))\n return cloneElement(child, {\n \"aria-hidden\": true,\n role: \"img\",\n ...rest,\n ...child.props,\n })\n\n return Children.count(child) > 1 ? Children.only(null) : null\n },\n { name: \"ButtonIcon\", className: getClassName(bem(\"button\", \"icon\")) },\n)()\n\nconst ButtonStartIcon = component<\"svg\", ButtonIconProps>(ButtonIcon, {\n name: \"ButtonStartIcon\",\n className: getClassName(bem(\"button\", \"icon\", \"start\")),\n})()\n\nconst ButtonEndIcon = component<\"svg\", ButtonIconProps>(ButtonIcon, {\n name: \"ButtonEndIcon\",\n className: getClassName(bem(\"button\", \"icon\", \"end\")),\n})()\n"],"mappings":";;;;;;;;;;;;;;;AA8BA,MAAM,iBAAiB,UAAwB;CAC7C,MAAM,aAAA,GAAYA,MAAAA,OAAAA,CAAO,CAAC,KAAK;CAQ/B,OAAO;EAAE,MAAA,GANGC,MAAAA,YAAAA,EAAa,SAA6B;GACpD,IAAI,MAAM,UAAU,UAAU,KAAK,YAAY;EACjD,GAAG,CAAC,CAIO;EAAG,MAFD,UAAU,UAAU,WAAW,KAAA;CAEzB;AACrB;AAoEA,MAAM,EACJ,WACA,kBACA,cAAc,oBACd,qBACA,iBAAiB,uBACjB,gBACEC,yBAAAA,gBACF,UACAC,qBAAAA,WACF;;;;;;AASA,MAAa,SAAS,aACnB,EACC,KACA,IACA,QACA,UACA,UACA,eACA,UAAU,MACV,SACA,cAAc,QACd,gBACA,mBAAmB,SACnB,YAAY,MACZ,WACA,cACA,GAAG,WACC;CACJ,MAAM,gBAAgB,YAAY;CAClC,MAAM,EAAE,KAAK,WAAW,SAAS,cAAc,EAAE;CACjD,MAAM,EAAE,SAAS,GAAG,gBAAgBC,mBAAAA,UAAU;EAC5C,GAAG;EACH,UAAU,iBAAiB;CAC7B,CAAC;CACD,MAAM,eAAe,WAAW,qBAAqB;CACrD,MAAM,aAAa,WAAW,qBAA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,cAAAA,GAAAA,oBAAAA,cAAa,IAAA,CAAI,UAAU,WAAW,KAAK,CAAC;AACzD,CAAC,CAAC,CAAC;AAIH,MAAM,aAAa,WAChB,EAAE,UAAU,GAAG,WAAW;CACzB,MAAM,QAAQC,iBAAAA,iBAAiB,QAAQ;CAEvC,KAAA,GAAII,MAAAA,eAAAA,CAAiC,KAAK,GACxC,QAAA,GAAOC,MAAAA,aAAAA,CAAa,OAAO;EACzB,eAAe;EACf,MAAM;EACN,GAAG;EACH,GAAG,MAAM;CACX,CAAC;CAEH,OAAOC,MAAAA,SAAS,MAAM,KAAK,IAAI,IAAIA,MAAAA,SAAS,KAAK,IAAI,IAAI;AAC3D,GACA;CAAE,MAAM;CAAc,WAAWP,cAAAA,cAAAA,GAAAA,oBAAAA,cAAa,IAAA,CAAI,UAAU,MAAM,CAAC;AAAE,CACvE,CAAC,CAAC;AAEF,MAAM,kBAAkB,UAAkC,YAAY;CACpE,MAAM;CACN,WAAWA,cAAAA,cAAAA,GAAAA,oBAAAA,cAAa,IAAA,CAAI,UAAU,QAAQ,OAAO,CAAC;AACxD,CAAC,CAAC,CAAC;AAEH,MAAM,gBAAgB,UAAkC,YAAY;CAClE,MAAM;CACN,WAAWA,cAAAA,cAAAA,GAAAA,oBAAAA,cAAa,IAAA,CAAI,UAAU,QAAQ,KAAK,CAAC;AACtD,CAAC,CAAC,CAAC"}
|
|
@@ -19,8 +19,9 @@ const { ComponentContext, PropsContext: CalendarPropsContext, useComponentContex
|
|
|
19
19
|
* @see https://yamada-ui.com/docs/components/calendar
|
|
20
20
|
*/
|
|
21
21
|
const CalendarRoot = withProvider(({ children, day, buttonProps, controlProps, dayProps, monthProps, monthSelectProps, navigationProps, nextButtonProps, prevButtonProps, selectProps, weekdayProps, weekdaysProps, weekProps, weeksProps, yearSelectProps, ...props }) => {
|
|
22
|
-
const { descendants, disabled, endOfMonth, excludeDate, holidays, locale, max, maxDate, minDate, month, monthDays, monthItems, multiple, range, startDayOfWeek, startOfMonth, today, value, weekdays, weekendDays, yearItems, getMonthProps, getMonthSelectProps, getNavigationProps, getNextButtonProps, getPrevButtonProps, getRootProps, getStatusProps, getWeekdayProps, getYearSelectProps, onChange, onMonthChange, onNextMonth, onPrevMonth } = require_use_calendar.useCalendar(props);
|
|
22
|
+
const { currentDate, descendants, disabled, endOfMonth, excludeDate, holidays, locale, max, maxDate, minDate, month, monthDays, monthItems, multiple, range, startDayOfWeek, startOfMonth, today, value, weekdays, weekendDays, yearItems, getMonthProps, getMonthSelectProps, getNavigationProps, getNextButtonProps, getPrevButtonProps, getRootProps, getStatusProps, getWeekdayProps, getYearSelectProps, onChange, onMonthChange, onNextMonth, onPrevMonth } = require_use_calendar.useCalendar(props);
|
|
23
23
|
const calendarContext = (0, react.useMemo)(() => ({
|
|
24
|
+
currentDate,
|
|
24
25
|
disabled,
|
|
25
26
|
endOfMonth,
|
|
26
27
|
excludeDate,
|
|
@@ -42,6 +43,7 @@ const CalendarRoot = withProvider(({ children, day, buttonProps, controlProps, d
|
|
|
42
43
|
onNextMonth,
|
|
43
44
|
onPrevMonth
|
|
44
45
|
}), [
|
|
46
|
+
currentDate,
|
|
45
47
|
disabled,
|
|
46
48
|
endOfMonth,
|
|
47
49
|
excludeDate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.cjs","names":["createSlotComponent","calendarStyle","useCalendar","useMemo","CalendarDescendantsContext","CalendarContext","styled","mergeProps","useCalendarContext","ChevronLeftIcon","ChevronRightIcon","resetFieldProps","useCalendarDay"],"sources":["../../../../src/components/calendar/calendar.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type { GenericsComponent, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport type { CalendarStyle } from \"./calendar.style\"\nimport type {\n UseCalendarDayProps,\n UseCalendarProps,\n UseCalendarReturn,\n} from \"./use-calendar\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport { runIfFn } from \"../../utils\"\nimport { resetFieldProps } from \"../field\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../icon\"\nimport { Select } from \"../select\"\nimport { calendarStyle } from \"./calendar.style\"\nimport {\n CalendarContext,\n CalendarDescendantsContext,\n useCalendar,\n useCalendarContext,\n useCalendarDay,\n} from \"./use-calendar\"\n\ninterface ComponentContext\n extends\n Pick<\n UseCalendarReturn,\n | \"getMonthProps\"\n | \"getMonthSelectProps\"\n | \"getNavigationProps\"\n | \"getNextButtonProps\"\n | \"getPrevButtonProps\"\n | \"getStatusProps\"\n | \"getWeekdayProps\"\n | \"getYearSelectProps\"\n | \"monthDays\"\n | \"monthItems\"\n | \"weekdays\"\n | \"yearItems\"\n >,\n Pick<\n CalendarRootProps,\n | \"buttonProps\"\n | \"controlProps\"\n | \"day\"\n | \"dayProps\"\n | \"monthProps\"\n | \"monthSelectProps\"\n | \"navigationProps\"\n | \"nextButtonProps\"\n | \"prevButtonProps\"\n | \"selectProps\"\n | \"weekdayProps\"\n | \"weekdaysProps\"\n | \"weekProps\"\n | \"weeksProps\"\n | \"yearSelectProps\"\n > {}\n\nexport interface CalendarRootProps<\n Multiple extends boolean = false,\n Range extends boolean = false,\n>\n extends\n Omit<HTMLStyledProps, \"defaultValue\" | \"onChange\">,\n ThemeProps<CalendarStyle>,\n UseCalendarProps<Multiple, Range>,\n Pick<CalendarMonthProps, \"day\"> {\n /**\n * Props for the button component.\n */\n buttonProps?: HTMLStyledProps<\"button\">\n /**\n * Props for the control component.\n */\n controlProps?: CalendarControlProps\n /**\n * Props for the day component.\n */\n dayProps?: Omit<CalendarDayProps, \"value\">\n /**\n * Props for the month component.\n */\n monthProps?: CalendarMonthProps\n /**\n * Props for the month select component.\n */\n monthSelectProps?: CalendarMonthSelectProps\n /**\n * Props for the navigation component.\n */\n navigationProps?: Omit<CalendarNavigationProps, \"children\">\n /**\n * Props for the next button component.\n */\n nextButtonProps?: CalendarNextButtonProps\n /**\n * Props for the prev button component.\n */\n prevButtonProps?: CalendarPrevButtonProps\n /**\n * Props for the select component.\n */\n selectProps?: Select.RootProps\n /**\n * Props for the weekday component.\n */\n weekdayProps?: HTMLStyledProps<\"th\">\n /**\n * Props for the weekdays component.\n */\n weekdaysProps?: HTMLStyledProps<\"tr\">\n /**\n * Props for the week component.\n */\n weekProps?: HTMLStyledProps<\"tr\">\n /**\n * Props for the weeks component.\n */\n weeksProps?: HTMLStyledProps<\"tbody\">\n /**\n * Props for the year select component.\n */\n yearSelectProps?: CalendarYearSelectProps\n}\n\nconst {\n ComponentContext,\n PropsContext: CalendarPropsContext,\n useComponentContext,\n usePropsContext: useCalendarPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<CalendarRootProps, CalendarStyle, ComponentContext>(\n \"calendar\",\n calendarStyle,\n)\n\nexport { CalendarPropsContext, useCalendarPropsContext }\n\n/**\n * `Calendar` is a component for displaying or selecting dates in a calendar.\n *\n * @see https://yamada-ui.com/docs/components/calendar\n */\nexport const CalendarRoot = withProvider(\n <Multiple extends boolean = false, Range extends boolean = false>({\n children,\n day,\n buttonProps,\n controlProps,\n dayProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n ...props\n }: CalendarRootProps<Multiple, Range>) => {\n const {\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 } = useCalendar(props)\n const calendarContext = useMemo(\n () => ({\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n }),\n [\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n ],\n )\n const componentContext = useMemo(\n () => ({\n day,\n monthDays,\n monthItems,\n weekdays,\n yearItems,\n buttonProps,\n controlProps,\n dayProps,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n }),\n [\n day,\n monthDays,\n monthItems,\n weekdays,\n yearItems,\n buttonProps,\n controlProps,\n dayProps,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n ],\n )\n\n return (\n <CalendarDescendantsContext value={descendants}>\n <CalendarContext value={calendarContext}>\n <ComponentContext value={componentContext}>\n <styled.div {...getRootProps()}>\n {children ?? (\n <>\n <CalendarNavigation />\n <CalendarMonth />\n </>\n )}\n </styled.div>\n </ComponentContext>\n </CalendarContext>\n </CalendarDescendantsContext>\n )\n },\n \"root\",\n)() as GenericsComponent<{\n <Multiple extends boolean = false, Range extends boolean = false>(\n props: CalendarRootProps<Multiple, Range>,\n ): ReactElement\n}>\n\nexport interface CalendarNavigationProps extends HTMLStyledProps {}\n\nexport const CalendarNavigation = withContext<\"div\", CalendarNavigationProps>(\n \"div\",\n [\"row\", \"navigation\"],\n)(undefined, ({ children, ...rest }) => {\n const { getNavigationProps, navigationProps } = useComponentContext()\n\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (\n <>\n <CalendarPrevButton />\n <CalendarControl />\n <CalendarNextButton />\n </>\n )\n }, [children])\n\n return {\n ...getNavigationProps(mergeProps(navigationProps, rest)()),\n children: computedChildren,\n }\n})\n\nexport interface CalendarControlProps extends Omit<\n HTMLStyledProps,\n \"children\"\n> {\n /**\n * The control children to use.\n */\n children?: ReactNodeOrFunction<{ month: Date }>\n}\n\nexport const CalendarControl = withContext<\"div\", CalendarControlProps>(\n \"div\",\n \"control\",\n)(undefined, ({ children, ...rest }) => {\n const { month } = useCalendarContext()\n const { controlProps, getStatusProps } = useComponentContext()\n\n const computedChildren = useMemo(() => {\n if (children) return runIfFn(children, { month })\n\n return (\n <>\n <CalendarMonthSelect />\n <CalendarYearSelect />\n </>\n )\n }, [children, month])\n\n return {\n ...mergeProps(controlProps, rest)(),\n children: (\n <>\n {computedChildren}\n <styled.div {...getStatusProps()} />\n </>\n ),\n }\n})\n\nexport interface CalendarPrevButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const CalendarPrevButton = withContext<\n \"button\",\n CalendarPrevButtonProps\n>(\"button\", [\"button\", \"prev\"])(\n undefined,\n ({ children = <ChevronLeftIcon />, ...rest }) => {\n const { buttonProps, getPrevButtonProps, prevButtonProps } =\n useComponentContext()\n\n return {\n children,\n ...getPrevButtonProps(mergeProps(buttonProps, prevButtonProps, rest)()),\n }\n },\n)\n\nexport interface CalendarNextButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const CalendarNextButton = withContext<\n \"button\",\n CalendarNextButtonProps\n>(\"button\", [\"button\", \"next\"])(\n undefined,\n ({ children = <ChevronRightIcon />, ...rest }) => {\n const { buttonProps, getNextButtonProps, nextButtonProps } =\n useComponentContext()\n\n return {\n children,\n ...getNextButtonProps(mergeProps(buttonProps, nextButtonProps, rest)()),\n }\n },\n)\n\nexport interface CalendarSeparatorProps extends HTMLStyledProps<\"span\"> {}\n\nexport const CalendarSeparator = withContext<\"span\", CalendarSeparatorProps>(\n \"span\",\n \"separator\",\n)({ children: \"/\", role: \"separator\" })\n\nexport interface CalendarYearSelectProps extends Select.RootProps {}\n\nexport const CalendarYearSelect = withContext<\"div\", CalendarYearSelectProps>(\n (props) => {\n const { yearItems, getYearSelectProps, selectProps, yearSelectProps } =\n useComponentContext()\n const { contentProps, rootProps, ...rest } = mergeProps(\n selectProps,\n yearSelectProps,\n props,\n )()\n\n return (\n <Select.Root\n variant=\"plain\"\n items={yearItems}\n minH=\"{cell-size}\"\n contentProps={{ minW: \"{select-content-size}\", ...contentProps }}\n rootProps={{\n fontSize: \"{select-font-size}\",\n w: \"{select-root-size}\",\n ...rootProps,\n }}\n {...resetFieldProps}\n {...getYearSelectProps(rest)}\n />\n )\n },\n [\"select\", \"years\"],\n)()\n\nexport interface CalendarMonthSelectProps extends Select.RootProps {}\n\nexport const CalendarMonthSelect = withContext<\"div\", CalendarMonthSelectProps>(\n (props) => {\n const { monthItems, getMonthSelectProps, monthSelectProps, selectProps } =\n useComponentContext()\n const { contentProps, rootProps, ...rest } = mergeProps(\n selectProps,\n monthSelectProps,\n props,\n )()\n\n return (\n <Select.Root\n variant=\"plain\"\n items={monthItems}\n minH=\"{cell-size}\"\n contentProps={{ minW: \"{select-content-size}\", ...contentProps }}\n rootProps={{\n fontSize: \"{select-font-size}\",\n w: \"{select-root-size}\",\n ...rootProps,\n }}\n {...resetFieldProps}\n {...getMonthSelectProps(rest)}\n />\n )\n },\n [\"select\", \"months\"],\n)()\n\nexport interface CalendarMonthProps extends Omit<\n HTMLStyledProps<\"table\">,\n \"children\"\n> {\n /**\n * The day component to use.\n */\n day?: ReactNodeOrFunction<{ value: Date }>\n}\n\nexport const CalendarMonth = withContext<\"table\", CalendarMonthProps>(\n \"table\",\n \"month\",\n)(undefined, ({ day: dayProp, ...rest }) => {\n const {\n day,\n monthDays,\n weekdays,\n dayProps,\n getMonthProps,\n getWeekdayProps,\n monthProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n } = useComponentContext()\n\n dayProp ??= day\n\n const children = (\n <>\n <styled.thead aria-hidden>\n <CalendarWeekDays {...weekdaysProps}>\n {weekdays.map(({ label, value }, index) => (\n <CalendarWeekday\n key={index}\n {...getWeekdayProps({ ...weekdayProps, value })}\n >\n {label}\n </CalendarWeekday>\n ))}\n </CalendarWeekDays>\n </styled.thead>\n\n <CalendarWeeks {...weeksProps}>\n {monthDays.map((week, index) => (\n <CalendarWeek key={index} {...weekProps}>\n {week.map(({ label, value }) => (\n <CalendarDay\n key={value.toDateString()}\n {...{ ...dayProps, value }}\n >\n {runIfFn(dayProp, { value }) ?? (\n <styled.span>{label}</styled.span>\n )}\n </CalendarDay>\n ))}\n </CalendarWeek>\n ))}\n </CalendarWeeks>\n </>\n )\n\n return {\n ...getMonthProps(mergeProps(monthProps, rest)()),\n children,\n }\n})\n\nconst CalendarWeekDays = withContext(\"tr\", [\"row\", \"weekdays\"])()\n\nconst CalendarWeekday = withContext(\"th\", [\"cell\", \"weekday\"])()\n\nconst CalendarWeeks = withContext(\"tbody\", \"weeks\")()\n\nconst CalendarWeek = withContext(\"tr\", [\"row\", \"week\"])()\n\ninterface CalendarDayProps\n extends Omit<HTMLStyledProps<\"td\">, \"value\">, UseCalendarDayProps {}\n\nconst CalendarDay = withContext<\"td\", CalendarDayProps>(\"td\", [\"cell\", \"day\"])(\n undefined,\n (props) => {\n const { getDayProps } = useCalendarDay(props)\n\n return getDayProps()\n },\n)\n"],"mappings":";;;;;;;;;;;;;;AAiIA,MAAM,EACJ,kBACA,cAAc,sBACd,qBACA,iBAAiB,yBACjB,aACA,iBACEA,yBAAAA,oBACF,YACAC,uBAAAA,aACF;;;;;;AASA,MAAa,eAAe,cACwC,EAChE,UACA,KACA,aACA,cACA,UACA,YACA,kBACA,iBACA,iBACA,iBACA,aACA,cACA,eACA,WACA,YACA,iBACA,GAAG,YACqC;CACxC,MAAM,EACJ,aACA,UACA,YACA,aACA,UACA,QACA,KACA,SACA,SACA,OACA,WACA,YACA,UACA,OACA,gBACA,cACA,OACA,OACA,UACA,aACA,WACA,eACA,qBACA,oBACA,oBACA,oBACA,cACA,gBACA,iBACA,oBACA,UACA,eACA,aACA,gBACEC,qBAAAA,YAAY,KAAK;CACrB,MAAM,mBAAA,GAAkBC,MAAAA,QAAAA,QACf;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CACA,MAAM,oBAAA,GAAmBA,MAAAA,QAAAA,QAChB;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,4BAAD;EAA4B,OAAO;EACjC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,iBAAD;GAAiB,OAAO;GACtB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD;IAAkB,OAAO;IACvB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OAAO,KAAR;KAAY,GAAI,aAAa;KAC1B,UAAA,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ACF"}
|
|
1
|
+
{"version":3,"file":"calendar.cjs","names":["createSlotComponent","calendarStyle","useCalendar","useMemo","CalendarDescendantsContext","CalendarContext","styled","mergeProps","useCalendarContext","ChevronLeftIcon","ChevronRightIcon","resetFieldProps","useCalendarDay"],"sources":["../../../../src/components/calendar/calendar.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type { GenericsComponent, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport type { CalendarStyle } from \"./calendar.style\"\nimport type {\n UseCalendarDayProps,\n UseCalendarProps,\n UseCalendarReturn,\n} from \"./use-calendar\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport { runIfFn } from \"../../utils\"\nimport { resetFieldProps } from \"../field\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../icon\"\nimport { Select } from \"../select\"\nimport { calendarStyle } from \"./calendar.style\"\nimport {\n CalendarContext,\n CalendarDescendantsContext,\n useCalendar,\n useCalendarContext,\n useCalendarDay,\n} from \"./use-calendar\"\n\ninterface ComponentContext\n extends\n Pick<\n UseCalendarReturn,\n | \"getMonthProps\"\n | \"getMonthSelectProps\"\n | \"getNavigationProps\"\n | \"getNextButtonProps\"\n | \"getPrevButtonProps\"\n | \"getStatusProps\"\n | \"getWeekdayProps\"\n | \"getYearSelectProps\"\n | \"monthDays\"\n | \"monthItems\"\n | \"weekdays\"\n | \"yearItems\"\n >,\n Pick<\n CalendarRootProps,\n | \"buttonProps\"\n | \"controlProps\"\n | \"day\"\n | \"dayProps\"\n | \"monthProps\"\n | \"monthSelectProps\"\n | \"navigationProps\"\n | \"nextButtonProps\"\n | \"prevButtonProps\"\n | \"selectProps\"\n | \"weekdayProps\"\n | \"weekdaysProps\"\n | \"weekProps\"\n | \"weeksProps\"\n | \"yearSelectProps\"\n > {}\n\nexport interface CalendarRootProps<\n Multiple extends boolean = false,\n Range extends boolean = false,\n>\n extends\n Omit<HTMLStyledProps, \"defaultValue\" | \"onChange\">,\n ThemeProps<CalendarStyle>,\n UseCalendarProps<Multiple, Range>,\n Pick<CalendarMonthProps, \"day\"> {\n /**\n * Props for the button component.\n */\n buttonProps?: HTMLStyledProps<\"button\">\n /**\n * Props for the control component.\n */\n controlProps?: CalendarControlProps\n /**\n * Props for the day component.\n */\n dayProps?: Omit<CalendarDayProps, \"value\">\n /**\n * Props for the month component.\n */\n monthProps?: CalendarMonthProps\n /**\n * Props for the month select component.\n */\n monthSelectProps?: CalendarMonthSelectProps\n /**\n * Props for the navigation component.\n */\n navigationProps?: Omit<CalendarNavigationProps, \"children\">\n /**\n * Props for the next button component.\n */\n nextButtonProps?: CalendarNextButtonProps\n /**\n * Props for the prev button component.\n */\n prevButtonProps?: CalendarPrevButtonProps\n /**\n * Props for the select component.\n */\n selectProps?: Select.RootProps\n /**\n * Props for the weekday component.\n */\n weekdayProps?: HTMLStyledProps<\"th\">\n /**\n * Props for the weekdays component.\n */\n weekdaysProps?: HTMLStyledProps<\"tr\">\n /**\n * Props for the week component.\n */\n weekProps?: HTMLStyledProps<\"tr\">\n /**\n * Props for the weeks component.\n */\n weeksProps?: HTMLStyledProps<\"tbody\">\n /**\n * Props for the year select component.\n */\n yearSelectProps?: CalendarYearSelectProps\n}\n\nconst {\n ComponentContext,\n PropsContext: CalendarPropsContext,\n useComponentContext,\n usePropsContext: useCalendarPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<CalendarRootProps, CalendarStyle, ComponentContext>(\n \"calendar\",\n calendarStyle,\n)\n\nexport { CalendarPropsContext, useCalendarPropsContext }\n\n/**\n * `Calendar` is a component for displaying or selecting dates in a calendar.\n *\n * @see https://yamada-ui.com/docs/components/calendar\n */\nexport const CalendarRoot = withProvider(\n <Multiple extends boolean = false, Range extends boolean = false>({\n children,\n day,\n buttonProps,\n controlProps,\n dayProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n ...props\n }: CalendarRootProps<Multiple, Range>) => {\n const {\n currentDate,\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 } = useCalendar(props)\n const calendarContext = useMemo(\n () => ({\n currentDate,\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n }),\n [\n currentDate,\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n ],\n )\n const componentContext = useMemo(\n () => ({\n day,\n monthDays,\n monthItems,\n weekdays,\n yearItems,\n buttonProps,\n controlProps,\n dayProps,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n }),\n [\n day,\n monthDays,\n monthItems,\n weekdays,\n yearItems,\n buttonProps,\n controlProps,\n dayProps,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n ],\n )\n\n return (\n <CalendarDescendantsContext value={descendants}>\n <CalendarContext value={calendarContext}>\n <ComponentContext value={componentContext}>\n <styled.div {...getRootProps()}>\n {children ?? (\n <>\n <CalendarNavigation />\n <CalendarMonth />\n </>\n )}\n </styled.div>\n </ComponentContext>\n </CalendarContext>\n </CalendarDescendantsContext>\n )\n },\n \"root\",\n)() as GenericsComponent<{\n <Multiple extends boolean = false, Range extends boolean = false>(\n props: CalendarRootProps<Multiple, Range>,\n ): ReactElement\n}>\n\nexport interface CalendarNavigationProps extends HTMLStyledProps {}\n\nexport const CalendarNavigation = withContext<\"div\", CalendarNavigationProps>(\n \"div\",\n [\"row\", \"navigation\"],\n)(undefined, ({ children, ...rest }) => {\n const { getNavigationProps, navigationProps } = useComponentContext()\n\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (\n <>\n <CalendarPrevButton />\n <CalendarControl />\n <CalendarNextButton />\n </>\n )\n }, [children])\n\n return {\n ...getNavigationProps(mergeProps(navigationProps, rest)()),\n children: computedChildren,\n }\n})\n\nexport interface CalendarControlProps extends Omit<\n HTMLStyledProps,\n \"children\"\n> {\n /**\n * The control children to use.\n */\n children?: ReactNodeOrFunction<{ month: Date }>\n}\n\nexport const CalendarControl = withContext<\"div\", CalendarControlProps>(\n \"div\",\n \"control\",\n)(undefined, ({ children, ...rest }) => {\n const { month } = useCalendarContext()\n const { controlProps, getStatusProps } = useComponentContext()\n\n const computedChildren = useMemo(() => {\n if (children) return runIfFn(children, { month })\n\n return (\n <>\n <CalendarMonthSelect />\n <CalendarYearSelect />\n </>\n )\n }, [children, month])\n\n return {\n ...mergeProps(controlProps, rest)(),\n children: (\n <>\n {computedChildren}\n <styled.div {...getStatusProps()} />\n </>\n ),\n }\n})\n\nexport interface CalendarPrevButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const CalendarPrevButton = withContext<\n \"button\",\n CalendarPrevButtonProps\n>(\"button\", [\"button\", \"prev\"])(\n undefined,\n ({ children = <ChevronLeftIcon />, ...rest }) => {\n const { buttonProps, getPrevButtonProps, prevButtonProps } =\n useComponentContext()\n\n return {\n children,\n ...getPrevButtonProps(mergeProps(buttonProps, prevButtonProps, rest)()),\n }\n },\n)\n\nexport interface CalendarNextButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const CalendarNextButton = withContext<\n \"button\",\n CalendarNextButtonProps\n>(\"button\", [\"button\", \"next\"])(\n undefined,\n ({ children = <ChevronRightIcon />, ...rest }) => {\n const { buttonProps, getNextButtonProps, nextButtonProps } =\n useComponentContext()\n\n return {\n children,\n ...getNextButtonProps(mergeProps(buttonProps, nextButtonProps, rest)()),\n }\n },\n)\n\nexport interface CalendarSeparatorProps extends HTMLStyledProps<\"span\"> {}\n\nexport const CalendarSeparator = withContext<\"span\", CalendarSeparatorProps>(\n \"span\",\n \"separator\",\n)({ children: \"/\", role: \"separator\" })\n\nexport interface CalendarYearSelectProps extends Select.RootProps {}\n\nexport const CalendarYearSelect = withContext<\"div\", CalendarYearSelectProps>(\n (props) => {\n const { yearItems, getYearSelectProps, selectProps, yearSelectProps } =\n useComponentContext()\n const { contentProps, rootProps, ...rest } = mergeProps(\n selectProps,\n yearSelectProps,\n props,\n )()\n\n return (\n <Select.Root\n variant=\"plain\"\n items={yearItems}\n minH=\"{cell-size}\"\n contentProps={{ minW: \"{select-content-size}\", ...contentProps }}\n rootProps={{\n fontSize: \"{select-font-size}\",\n w: \"{select-root-size}\",\n ...rootProps,\n }}\n {...resetFieldProps}\n {...getYearSelectProps(rest)}\n />\n )\n },\n [\"select\", \"years\"],\n)()\n\nexport interface CalendarMonthSelectProps extends Select.RootProps {}\n\nexport const CalendarMonthSelect = withContext<\"div\", CalendarMonthSelectProps>(\n (props) => {\n const { monthItems, getMonthSelectProps, monthSelectProps, selectProps } =\n useComponentContext()\n const { contentProps, rootProps, ...rest } = mergeProps(\n selectProps,\n monthSelectProps,\n props,\n )()\n\n return (\n <Select.Root\n variant=\"plain\"\n items={monthItems}\n minH=\"{cell-size}\"\n contentProps={{ minW: \"{select-content-size}\", ...contentProps }}\n rootProps={{\n fontSize: \"{select-font-size}\",\n w: \"{select-root-size}\",\n ...rootProps,\n }}\n {...resetFieldProps}\n {...getMonthSelectProps(rest)}\n />\n )\n },\n [\"select\", \"months\"],\n)()\n\nexport interface CalendarMonthProps extends Omit<\n HTMLStyledProps<\"table\">,\n \"children\"\n> {\n /**\n * The day component to use.\n */\n day?: ReactNodeOrFunction<{ value: Date }>\n}\n\nexport const CalendarMonth = withContext<\"table\", CalendarMonthProps>(\n \"table\",\n \"month\",\n)(undefined, ({ day: dayProp, ...rest }) => {\n const {\n day,\n monthDays,\n weekdays,\n dayProps,\n getMonthProps,\n getWeekdayProps,\n monthProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n } = useComponentContext()\n\n dayProp ??= day\n\n const children = (\n <>\n <styled.thead aria-hidden>\n <CalendarWeekDays {...weekdaysProps}>\n {weekdays.map(({ label, value }, index) => (\n <CalendarWeekday\n key={index}\n {...getWeekdayProps({ ...weekdayProps, value })}\n >\n {label}\n </CalendarWeekday>\n ))}\n </CalendarWeekDays>\n </styled.thead>\n\n <CalendarWeeks {...weeksProps}>\n {monthDays.map((week, index) => (\n <CalendarWeek key={index} {...weekProps}>\n {week.map(({ label, value }) => (\n <CalendarDay\n key={value.toDateString()}\n {...{ ...dayProps, value }}\n >\n {runIfFn(dayProp, { value }) ?? (\n <styled.span>{label}</styled.span>\n )}\n </CalendarDay>\n ))}\n </CalendarWeek>\n ))}\n </CalendarWeeks>\n </>\n )\n\n return {\n ...getMonthProps(mergeProps(monthProps, rest)()),\n children,\n }\n})\n\nconst CalendarWeekDays = withContext(\"tr\", [\"row\", \"weekdays\"])()\n\nconst CalendarWeekday = withContext(\"th\", [\"cell\", \"weekday\"])()\n\nconst CalendarWeeks = withContext(\"tbody\", \"weeks\")()\n\nconst CalendarWeek = withContext(\"tr\", [\"row\", \"week\"])()\n\ninterface CalendarDayProps\n extends Omit<HTMLStyledProps<\"td\">, \"value\">, UseCalendarDayProps {}\n\nconst CalendarDay = withContext<\"td\", CalendarDayProps>(\"td\", [\"cell\", \"day\"])(\n undefined,\n (props) => {\n const { getDayProps } = useCalendarDay(props)\n\n return getDayProps()\n },\n)\n"],"mappings":";;;;;;;;;;;;;;AAiIA,MAAM,EACJ,kBACA,cAAc,sBACd,qBACA,iBAAiB,yBACjB,aACA,iBACEA,yBAAAA,oBACF,YACAC,uBAAAA,aACF;;;;;;AASA,MAAa,eAAe,cACwC,EAChE,UACA,KACA,aACA,cACA,UACA,YACA,kBACA,iBACA,iBACA,iBACA,aACA,cACA,eACA,WACA,YACA,iBACA,GAAG,YACqC;CACxC,MAAM,EACJ,aACA,aACA,UACA,YACA,aACA,UACA,QACA,KACA,SACA,SACA,OACA,WACA,YACA,UACA,OACA,gBACA,cACA,OACA,OACA,UACA,aACA,WACA,eACA,qBACA,oBACA,oBACA,oBACA,cACA,gBACA,iBACA,oBACA,UACA,eACA,aACA,gBACEC,qBAAAA,YAAY,KAAK;CACrB,MAAM,mBAAA,GAAkBC,MAAAA,QAAAA,QACf;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CACA,MAAM,oBAAA,GAAmBA,MAAAA,QAAAA,QAChB;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;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cAAAA,WAAW,YAAY,IAAI,CAAC,CAAC,CAAC;EAC/C;CACF;AACF,CAAC;AAED,MAAM,mBAAmB,YAAY,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;AAEhE,MAAM,kBAAkB,YAAY,MAAM,CAAC,QAAQ,SAAS,CAAC,CAAC,CAAC;AAE/D,MAAM,gBAAgB,YAAY,SAAS,OAAO,CAAC,CAAC;AAEpD,MAAM,eAAe,YAAY,MAAM,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC;AAKxD,MAAM,cAAc,YAAoC,MAAM,CAAC,QAAQ,KAAK,CAAC,CAAC,CAC5E,KAAA,IACC,UAAU;CACT,MAAM,EAAE,gBAAgBK,qBAAAA,eAAe,KAAK;CAE5C,OAAO,YAAY;AACrB,CACF"}
|
|
@@ -124,7 +124,7 @@ const getAdjustedMonth = (value, month) => {
|
|
|
124
124
|
};
|
|
125
125
|
const { DescendantsContext: CalendarDescendantsContext, useDescendant: useCalendarDescendant, useDescendants: useCalendarDescendants } = require_hooks_use_descendants_index.createDescendants();
|
|
126
126
|
const [CalendarContext, useCalendarContext] = require_context.createContext({ name: "CalendarContext" });
|
|
127
|
-
const useCalendar = ({ defaultMonth = /* @__PURE__ */ new Date(), multiple = false, range = false, defaultValue = range ? {
|
|
127
|
+
const useCalendar = ({ defaultMonth = () => /* @__PURE__ */ new Date(), multiple = false, range = false, defaultValue = range ? {
|
|
128
128
|
end: void 0,
|
|
129
129
|
start: void 0
|
|
130
130
|
} : multiple ? [] : void 0, disabled = false, excludeDate, format = {}, holidays = DEFAULT_HOLIDAYS, locale: localeProp, max, maxDate = DEFAULT_MAX_DATE, minDate = DEFAULT_MIN_DATE, month: monthProp, startDayOfWeek = DEFAULT_FIRST_DAY_OF_WEEK, today = true, value: valueProp, weekendDays = DEFAULT_WEEKEND_DAYS, onChange: onChangeProp, onChangeMonth: onChangeMonthProp, ...rest } = {}) => {
|
|
@@ -155,6 +155,7 @@ const useCalendar = ({ defaultMonth = /* @__PURE__ */ new Date(), multiple = fal
|
|
|
155
155
|
}, [dateTimeFormat, format.day]);
|
|
156
156
|
const descendants = useCalendarDescendants();
|
|
157
157
|
const monthRef = (0, react.useRef)(null);
|
|
158
|
+
const [currentDate] = (0, react.useState)(() => /* @__PURE__ */ new Date());
|
|
158
159
|
const [value, setValue] = require_hooks_use_controllable_state_index.useControllableState({
|
|
159
160
|
defaultValue,
|
|
160
161
|
value: valueProp,
|
|
@@ -162,10 +163,9 @@ const useCalendar = ({ defaultMonth = /* @__PURE__ */ new Date(), multiple = fal
|
|
|
162
163
|
});
|
|
163
164
|
const [month, setMonth] = require_hooks_use_controllable_state_index.useControllableState({
|
|
164
165
|
defaultValue: () => {
|
|
166
|
+
defaultMonth = (0, require_utils_index.utils_exports.runIfFn)(defaultMonth);
|
|
165
167
|
if ((0, dayjs.default)(minDate).isAfter((0, dayjs.default)(defaultMonth))) defaultMonth = (0, dayjs.default)(minDate).set("date", 1).toDate();
|
|
166
|
-
|
|
167
|
-
else if (defaultValue) defaultMonth = getAdjustedMonth(defaultValue, defaultMonth);
|
|
168
|
-
return defaultMonth;
|
|
168
|
+
return getAdjustedMonth(value, defaultMonth);
|
|
169
169
|
},
|
|
170
170
|
value: monthProp,
|
|
171
171
|
onChange: onChangeMonthProp
|
|
@@ -385,6 +385,7 @@ const useCalendar = ({ defaultMonth = /* @__PURE__ */ new Date(), multiple = fal
|
|
|
385
385
|
t
|
|
386
386
|
]);
|
|
387
387
|
return {
|
|
388
|
+
currentDate,
|
|
388
389
|
descendants,
|
|
389
390
|
disabled,
|
|
390
391
|
endOfMonth,
|
|
@@ -423,13 +424,17 @@ const useCalendar = ({ defaultMonth = /* @__PURE__ */ new Date(), multiple = fal
|
|
|
423
424
|
};
|
|
424
425
|
const useCalendarDay = ({ value, ...rest }) => {
|
|
425
426
|
const { t } = require_i18n_provider.useI18n("calendar");
|
|
426
|
-
const { disabled: rootDisabled, excludeDate, holidays, locale, max, maxDate, minDate, month, startDayOfWeek, today: highlightToday, value: selectedValue, weekendDays, onChange, onMonthChange, onNextMonth, onPrevMonth } = useCalendarContext();
|
|
427
|
+
const { currentDate, disabled: rootDisabled, excludeDate, holidays, locale, max, maxDate, minDate, month, startDayOfWeek, today: highlightToday, value: selectedValue, weekendDays, onChange, onMonthChange, onNextMonth, onPrevMonth } = useCalendarContext();
|
|
427
428
|
const dateTimeFormat = require_use_format_date_time.useDateTimeFormat({ locale });
|
|
428
429
|
const cellRef = (0, react.useRef)(null);
|
|
429
430
|
const outside = (0, react.useMemo)(() => !isSameMonth(month, value), [month, value]);
|
|
430
431
|
const holiday = (0, react.useMemo)(() => holidays.some((holiday) => isSameDate(holiday, value)), [holidays, value]);
|
|
431
432
|
const weekend = (0, react.useMemo)(() => weekendDays.includes(value.getDay()), [weekendDays, value]);
|
|
432
|
-
const today = (0, react.useMemo)(() => highlightToday && isSameDate(value,
|
|
433
|
+
const today = (0, react.useMemo)(() => highlightToday && isSameDate(value, currentDate), [
|
|
434
|
+
highlightToday,
|
|
435
|
+
value,
|
|
436
|
+
currentDate
|
|
437
|
+
]);
|
|
433
438
|
const selected = (0, react.useMemo)(() => {
|
|
434
439
|
if ((0, require_utils_index.utils_exports.isDate)(selectedValue)) return isSameDate(selectedValue, value);
|
|
435
440
|
else if ((0, require_utils_index.utils_exports.isArray)(selectedValue)) return selectedValue.some((selectedValue) => isSameDate(selectedValue, value));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-calendar.cjs","names":["createDescendants","createContext","useI18n","useDateTimeFormat","useCallback","useRef","useControllableState","useMemo","mergeProps","visuallyHiddenAttributes","mergeRefs","useSplitProps"],"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,MA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A,CAAS,QAAQ;IAC7B,iBAAA,GAAA,oBAAA,cAAgB,SAAA,CAAS,OAAO;IAChC,iBAAA,GAAA,oBAAA,cAAgB,SAAA,CAAS,OAAO;IAChC,kBAAA,GAAA,oBAAA,cAAiB,SAAA,CAAS,QAAQ;IAClC,eAAA,GAAA,oBAAA,cAAc,SAAA,CAAS,UAAU;IACjC,eAAA,GAAA,oBAAA,cAAc,SAAA,CAAS,KAAK;IAC5B,eAAA,GAAc,MAAA,QAAA,CAAM,KAAK,CAAC,CAAC,OAAO,YAAY;IAC9C,iBAAA,GAAA,oBAAA,cAAgB,SAAA,CAAS,OAAO;IAChC,UAAU;GACZ,GACA,MACA,OACA;IACE,KAAKE,YAAAA,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,OAAOC,cAAAA,cACL,OACA,cAAc,QAAQ,QAAQ,CAAC,UAAU,SAAS,GAAQ,CAAC,CAC7D;AAWF"}
|
|
1
|
+
{"version":3,"file":"use-calendar.cjs","names":["createDescendants","createContext","useI18n","useDateTimeFormat","useCallback","useRef","useState","useControllableState","useMemo","mergeProps","visuallyHiddenAttributes","mergeRefs","useSplitProps"],"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, ToFunction } from \"../../utils\"\nimport dayjs from \"dayjs\"\nimport { useCallback, useMemo, useRef, useState } 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 runIfFn,\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) | Date\n /**\n * The initial value of the calendar.\n */\n defaultValue?:\n | MaybeDateValue<Multiple, Range>\n | ToFunction<Exclude<MaybeDateValue<Multiple, Range>, undefined>>\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 [currentDate] = useState<Date>(() => new Date())\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n const [month, setMonth] = useControllableState({\n defaultValue: () => {\n defaultMonth = runIfFn(defaultMonth)\n\n if (dayjs(minDate).isAfter(dayjs(defaultMonth)))\n defaultMonth = dayjs(minDate).set(\"date\", 1).toDate()\n\n return getAdjustedMonth(value, 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 currentDate,\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 currentDate,\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, currentDate),\n [highlightToday, value, currentDate],\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":";;;;;;;;;;;;;;;;AA+BA,MAAa,mBAA2B,CAAC;AACzC,MAAa,uBAAi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,CAAS,QAAQ;IAClC,iBAAA,GAAA,oBAAA,cAAgB,SAAA,CAAS,OAAO;IAChC,kBAAA,GAAA,oBAAA,cAAiB,SAAA,CAAS,QAAQ;IAClC,aAAA,GAAA,oBAAA,cAAY,SAAA,CAAS,QAAQ;IAC7B,iBAAA,GAAA,oBAAA,cAAgB,SAAA,CAAS,OAAO;IAChC,iBAAA,GAAA,oBAAA,cAAgB,SAAA,CAAS,OAAO;IAChC,kBAAA,GAAA,oBAAA,cAAiB,SAAA,CAAS,QAAQ;IAClC,eAAA,GAAA,oBAAA,cAAc,SAAA,CAAS,UAAU;IACjC,eAAA,GAAA,oBAAA,cAAc,SAAA,CAAS,KAAK;IAC5B,eAAA,GAAc,MAAA,QAAA,CAAM,KAAK,CAAC,CAAC,OAAO,YAAY;IAC9C,iBAAA,GAAA,oBAAA,cAAgB,SAAA,CAAS,OAAO;IAChC,UAAU;GACZ,GACA,MACA,OACA;IACE,KAAKE,YAAAA,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,OAAOC,cAAAA,cACL,OACA,cAAc,QAAQ,QAAQ,CAAC,UAAU,SAAS,GAAQ,CAAC,CAC7D;AAWF"}
|
|
@@ -4,7 +4,8 @@ const codeStyle = require("../../core/system/config.cjs").defineComponentStyle({
|
|
|
4
4
|
alignItems: "center",
|
|
5
5
|
display: "inline-flex",
|
|
6
6
|
fontFamily: "mono",
|
|
7
|
-
rounded: "l1"
|
|
7
|
+
rounded: "l1",
|
|
8
|
+
verticalAlign: "middle"
|
|
8
9
|
},
|
|
9
10
|
variants: {
|
|
10
11
|
outline: { layerStyle: "outline" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code.style.cjs","names":["defineComponentStyle"],"sources":["../../../../src/components/code/code.style.ts"],"sourcesContent":["import { defineComponentStyle } from \"../../core\"\n\nexport const codeStyle = defineComponentStyle({\n base: {\n alignItems: \"center\",\n display: \"inline-flex\",\n fontFamily: \"mono\",\n rounded: \"l1\",\n },\n\n variants: {\n outline: {\n layerStyle: \"outline\",\n },\n solid: {\n layerStyle: \"solid\",\n },\n subtle: {\n layerStyle: \"subtle\",\n },\n surface: {\n layerStyle: \"surface\",\n },\n },\n\n sizes: {\n xs: {\n fontSize: \"2xs\",\n lineHeight: \"{sizes.4}\",\n minH: \"4\",\n px: \"1\",\n },\n sm: {\n fontSize: \"xs\",\n lineHeight: \"{sizes.5}\",\n minH: \"5\",\n px: \"1.5\",\n },\n md: {\n fontSize: \"sm\",\n lineHeight: \"{sizes.6}\",\n minH: \"6\",\n px: \"2\",\n },\n lg: {\n fontSize: \"sm\",\n lineHeight: \"{sizes.7}\",\n minH: \"7\",\n px: \"2.5\",\n },\n },\n\n defaultProps: {\n size: \"sm\",\n variant: \"subtle\",\n },\n})\n\nexport type CodeStyle = typeof codeStyle\n"],"mappings":";AAEA,MAAa,kDAAYA,CAAAA,CAAAA,qBAAqB;CAC5C,MAAM;EACJ,YAAY;EACZ,SAAS;EACT,YAAY;EACZ,SAAS;
|
|
1
|
+
{"version":3,"file":"code.style.cjs","names":["defineComponentStyle"],"sources":["../../../../src/components/code/code.style.ts"],"sourcesContent":["import { defineComponentStyle } from \"../../core\"\n\nexport const codeStyle = defineComponentStyle({\n base: {\n alignItems: \"center\",\n display: \"inline-flex\",\n fontFamily: \"mono\",\n rounded: \"l1\",\n verticalAlign: \"middle\",\n },\n\n variants: {\n outline: {\n layerStyle: \"outline\",\n },\n solid: {\n layerStyle: \"solid\",\n },\n subtle: {\n layerStyle: \"subtle\",\n },\n surface: {\n layerStyle: \"surface\",\n },\n },\n\n sizes: {\n xs: {\n fontSize: \"2xs\",\n lineHeight: \"{sizes.4}\",\n minH: \"4\",\n px: \"1\",\n },\n sm: {\n fontSize: \"xs\",\n lineHeight: \"{sizes.5}\",\n minH: \"5\",\n px: \"1.5\",\n },\n md: {\n fontSize: \"sm\",\n lineHeight: \"{sizes.6}\",\n minH: \"6\",\n px: \"2\",\n },\n lg: {\n fontSize: \"sm\",\n lineHeight: \"{sizes.7}\",\n minH: \"7\",\n px: \"2.5\",\n },\n },\n\n defaultProps: {\n size: \"sm\",\n variant: \"subtle\",\n },\n})\n\nexport type CodeStyle = typeof codeStyle\n"],"mappings":";AAEA,MAAa,kDAAYA,CAAAA,CAAAA,qBAAqB;CAC5C,MAAM;EACJ,YAAY;EACZ,SAAS;EACT,YAAY;EACZ,SAAS;EACT,eAAe;CACjB;CAEA,UAAU;EACR,SAAS,EACP,YAAY,UACd;EACA,OAAO,EACL,YAAY,QACd;EACA,QAAQ,EACN,YAAY,SACd;EACA,SAAS,EACP,YAAY,UACd;CACF;CAEA,OAAO;EACL,IAAI;GACF,UAAU;GACV,YAAY;GACZ,MAAM;GACN,IAAI;EACN;EACA,IAAI;GACF,UAAU;GACV,YAAY;GACZ,MAAM;GACN,IAAI;EACN;EACA,IAAI;GACF,UAAU;GACV,YAAY;GACZ,MAAM;GACN,IAAI;EACN;EACA,IAAI;GACF,UAAU;GACV,YAAY;GACZ,MAAM;GACN,IAAI;EACN;CACF;CAEA,cAAc;EACZ,MAAM;EACN,SAAS;CACX;AACF,CAAC"}
|
|
@@ -27,7 +27,7 @@ const useDatePicker = ({ maxDate = require_use_calendar.DEFAULT_MAX_DATE, minDat
|
|
|
27
27
|
if ((0, dayjs.default)(minDate).isAfter((0, dayjs.default)(maxDate))) maxDate = minDate;
|
|
28
28
|
const { getDocument } = require_environment_provider.useEnvironment();
|
|
29
29
|
const { locale: defaultLocale, t } = require_i18n_provider.useI18n("datePicker");
|
|
30
|
-
const { props: { id, ref, name, allowInput = true, allowInputBeyond = false, closeOnChange = false, multiple = false, closeOnSelect = !multiple, defaultInputValue, defaultMonth = /* @__PURE__ */ new Date(), range = false, defaultValue = range ? {
|
|
30
|
+
const { props: { id, ref, name, allowInput = true, allowInputBeyond = false, closeOnChange = false, multiple = false, closeOnSelect = !multiple, defaultInputValue, defaultMonth = () => /* @__PURE__ */ new Date(), range = false, defaultValue = range ? {
|
|
31
31
|
end: void 0,
|
|
32
32
|
start: void 0
|
|
33
33
|
} : multiple ? [] : void 0, disabled, focusOnClear = true, format, inputValue: inputValueProp, locale = defaultLocale, max, month: monthProp, openOnChange = true, openOnClick = true, openOnFocus = true, parseDate, pattern, placeholder: placeholderProp, placement = "end-start", readOnly, render = defaultRender, required, separator = range ? "-" : ",", value: valueProp, onChange: onChangeProp, onChangeMonth: onChangeMonthProp, onInputChange: onInputChangeProp, ...computedProps }, ariaProps, dataProps, eventProps } = require_use_field_props.useFieldProps(props);
|
|
@@ -50,6 +50,7 @@ const useDatePicker = ({ maxDate = require_use_calendar.DEFAULT_MAX_DATE, minDat
|
|
|
50
50
|
const startInputRef = (0, react.useRef)(null);
|
|
51
51
|
const endInputRef = (0, react.useRef)(null);
|
|
52
52
|
const focusByClickRef = (0, react.useRef)(false);
|
|
53
|
+
const [currentDate] = (0, react.useState)(() => /* @__PURE__ */ new Date());
|
|
53
54
|
const [focused, setFocused] = (0, react.useState)(false);
|
|
54
55
|
const [value, setValue] = require_hooks_use_controllable_state_index.useControllableState({
|
|
55
56
|
defaultValue,
|
|
@@ -58,11 +59,9 @@ const useDatePicker = ({ maxDate = require_use_calendar.DEFAULT_MAX_DATE, minDat
|
|
|
58
59
|
});
|
|
59
60
|
const [month, setMonth] = require_hooks_use_controllable_state_index.useControllableState({
|
|
60
61
|
defaultValue: () => {
|
|
61
|
-
let
|
|
62
|
-
if ((0, dayjs.default)(minDate).isAfter((0, dayjs.default)(
|
|
63
|
-
|
|
64
|
-
else if (defaultValue) value = require_use_calendar.getAdjustedMonth(defaultValue, value);
|
|
65
|
-
return value;
|
|
62
|
+
let defaultValue = (0, require_utils_index.utils_exports.runIfFn)(defaultMonth);
|
|
63
|
+
if ((0, dayjs.default)(minDate).isAfter((0, dayjs.default)(defaultValue))) defaultValue = (0, dayjs.default)(minDate).set("date", 1).toDate();
|
|
64
|
+
return require_use_calendar.getAdjustedMonth(value, defaultValue);
|
|
66
65
|
},
|
|
67
66
|
value: monthProp,
|
|
68
67
|
onChange: onChangeMonthProp
|
|
@@ -158,13 +157,13 @@ const useDatePicker = ({ maxDate = require_use_calendar.DEFAULT_MAX_DATE, minDat
|
|
|
158
157
|
]);
|
|
159
158
|
const { endPlaceholder, startPlaceholder } = (0, react.useMemo)(() => {
|
|
160
159
|
if (range) {
|
|
161
|
-
const startPlaceholder = placeholderProp ?? dateTimeFormat(
|
|
160
|
+
const startPlaceholder = placeholderProp ?? dateTimeFormat(currentDate, inputFormat);
|
|
162
161
|
return {
|
|
163
|
-
endPlaceholder: placeholderProp ?? dateTimeFormat((0, dayjs.default)().add(1, "day").toDate(), inputFormat),
|
|
162
|
+
endPlaceholder: placeholderProp ?? dateTimeFormat((0, dayjs.default)(currentDate).add(1, "day").toDate(), inputFormat),
|
|
164
163
|
startPlaceholder
|
|
165
164
|
};
|
|
166
165
|
} else {
|
|
167
|
-
const placeholder = placeholderProp ?? dateTimeFormat(
|
|
166
|
+
const placeholder = placeholderProp ?? dateTimeFormat(currentDate, inputFormat);
|
|
168
167
|
return {
|
|
169
168
|
endPlaceholder: placeholder,
|
|
170
169
|
startPlaceholder: placeholder
|
|
@@ -174,7 +173,8 @@ const useDatePicker = ({ maxDate = require_use_calendar.DEFAULT_MAX_DATE, minDat
|
|
|
174
173
|
dateTimeFormat,
|
|
175
174
|
inputFormat,
|
|
176
175
|
placeholderProp,
|
|
177
|
-
range
|
|
176
|
+
range,
|
|
177
|
+
currentDate
|
|
178
178
|
]);
|
|
179
179
|
const onChange = (0, react.useCallback)((value) => {
|
|
180
180
|
setValue(value);
|