@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
|
@@ -121,11 +121,12 @@ const AccordionIcon = withContext(({ children = /* @__PURE__ */ (0, react_jsx_ru
|
|
|
121
121
|
const { iconHidden } = useComponentContext();
|
|
122
122
|
const { getIconProps } = require_use_accordion.useAccordionItemContext();
|
|
123
123
|
if (iconHidden) return null;
|
|
124
|
-
|
|
124
|
+
const child = require_children.getResolvedChild(children);
|
|
125
|
+
if ((0, react.isValidElement)(child)) return (0, react.cloneElement)(child, getIconProps({
|
|
125
126
|
...rest,
|
|
126
|
-
...
|
|
127
|
+
...child.props
|
|
127
128
|
}));
|
|
128
|
-
return react.Children.count(
|
|
129
|
+
return react.Children.count(child) > 1 ? react.Children.only(null) : null;
|
|
129
130
|
}, "icon")();
|
|
130
131
|
const AccordionPanel = withContext(({ animationOpacity, children, delay, duration, endingHeight, startingHeight, transition, transitionEnd, unmountOnExit, ...rest }) => {
|
|
131
132
|
const { open, getPanelProps } = require_use_accordion.useAccordionItemContext();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.cjs","names":["createContext","createSlotComponent","accordionStyle","useAccordion","useMemo","AccordionDescendantsContext","AccordionContext","styled","useAccordionItem","useSplitChildren","AccordionItemContext","useAccordionItemContext","ChevronDownIcon","isValidElement","cloneElement","Children","Collapse"],"sources":["../../../../src/components/accordion/accordion.tsx"],"sourcesContent":["\"use client\"\n\nimport type { HTMLProps, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport type { CollapseProps } from \"../collapse\"\nimport type { WithTransitionProps } from \"../motion\"\nimport type { AccordionStyle } from \"./accordion.style\"\nimport type { UseAccordionItemProps, UseAccordionProps } from \"./use-accordion\"\nimport { Children, cloneElement, isValidElement, useMemo } from \"react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { createContext, isString, runIfFn, useSplitChildren } from \"../../utils\"\nimport { Collapse } from \"../collapse\"\nimport { ChevronDownIcon } from \"../icon\"\nimport { accordionStyle } from \"./accordion.style\"\nimport {\n AccordionContext,\n AccordionDescendantsContext,\n AccordionItemContext,\n useAccordion,\n useAccordionItem,\n useAccordionItemContext,\n} from \"./use-accordion\"\n\ninterface AccordionCallBackProps {\n disabled?: boolean\n expanded?: boolean\n}\n\nexport interface AccordionItem extends Omit<AccordionItemProps, \"index\"> {}\n\ninterface ComponentContext extends Pick<\n AccordionRootProps,\n \"icon\" | \"iconHidden\"\n> {}\n\nexport interface AccordionRootProps\n extends\n Omit<HTMLStyledProps, \"onChange\">,\n ThemeProps<AccordionStyle>,\n UseAccordionProps {\n /**\n * The accordion icon for all items to use.\n */\n icon?: ReactNodeOrFunction<AccordionCallBackProps>\n /**\n * If `true`, hide the accordion icon for all items.\n *\n * @default false\n */\n iconHidden?: boolean\n /**\n * If provided, generate elements based on items.\n */\n items?: AccordionItem[]\n}\n\ninterface ItemComponentContext extends Pick<AccordionItemProps, \"icon\"> {}\n\nconst [ItemComponentContext, useItemComponentContext] =\n createContext<ItemComponentContext>({\n name: \"ItemComponentContext\",\n })\n\nconst {\n ComponentContext,\n PropsContext: AccordionPropsContext,\n useComponentContext,\n usePropsContext: useAccordionPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<AccordionRootProps, AccordionStyle, ComponentContext>(\n \"accordion\",\n accordionStyle,\n)\n\nexport { AccordionPropsContext, useAccordionPropsContext }\n\n/**\n * `Accordion` is a component for a list that displays information in an expandable or collapsible manner.\n *\n * @see https://yamada-ui.com/docs/components/accordion\n */\nexport const AccordionRoot = withProvider<\"div\", AccordionRootProps>(\n ({ children, icon, iconHidden, items, ...props }) => {\n const {\n descendants,\n focusedIndex,\n index,\n multiple,\n setFocusedIndex,\n setIndex,\n toggle,\n getRootProps,\n } = useAccordion(props)\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return items?.map((props, index) => (\n <AccordionItem key={index} index={index} {...props} />\n ))\n }, [children, items])\n const context = useMemo(\n () => ({\n focusedIndex,\n index,\n multiple,\n setFocusedIndex,\n setIndex,\n toggle,\n }),\n [focusedIndex, index, multiple, setFocusedIndex, setIndex, toggle],\n )\n const componentContext = useMemo(\n () => ({ icon, iconHidden }),\n [icon, iconHidden],\n )\n\n return (\n <AccordionDescendantsContext value={descendants}>\n <AccordionContext value={context}>\n <ComponentContext value={componentContext}>\n <styled.div {...getRootProps()}>{computedChildren}</styled.div>\n </ComponentContext>\n </AccordionContext>\n </AccordionDescendantsContext>\n )\n },\n \"root\",\n)()\n\nexport interface AccordionItemProps\n extends\n Omit<HTMLStyledProps, \"children\">,\n Omit<UseAccordionItemProps, \"children\"> {\n /**\n * The accordion button to use.\n */\n button?: ReactNodeOrFunction<AccordionCallBackProps>\n /**\n * The accordion children to use.\n */\n children?: ReactNodeOrFunction<AccordionCallBackProps>\n /**\n * The accordion icon to use.\n */\n icon?: ReactNodeOrFunction<AccordionCallBackProps>\n}\n\nexport const AccordionItem = withContext<\"div\", AccordionItemProps>(\n ({ button, children, icon, ...rest }) => {\n const {\n disabled,\n open,\n getButtonProps,\n getIconProps,\n getItemProps,\n getPanelProps,\n } = useAccordionItem(rest)\n const computedChildren = useMemo(\n () => runIfFn(children, { disabled, expanded: open }),\n [children, disabled, open],\n )\n const [omittedChildren, customAccordionButton, customAccordionPanel] =\n useSplitChildren(computedChildren, AccordionButton, AccordionPanel)\n const context = useMemo(\n () => ({\n disabled,\n icon,\n open,\n getButtonProps,\n getIconProps,\n getPanelProps,\n }),\n [disabled, getButtonProps, getPanelProps, getIconProps, icon, open],\n )\n const componentContext = useMemo(() => ({ icon }), [icon])\n\n return (\n <AccordionItemContext value={context}>\n <ItemComponentContext value={componentContext}>\n <styled.div {...getItemProps()}>\n {customAccordionButton ?? (\n <AccordionButton>\n {runIfFn(button, { disabled, expanded: open })}\n </AccordionButton>\n )}\n {customAccordionPanel ?? (\n <AccordionPanel>{omittedChildren}</AccordionPanel>\n )}\n </styled.div>\n </ItemComponentContext>\n </AccordionItemContext>\n )\n },\n \"item\",\n)()\n\nexport interface AccordionButtonProps extends HTMLStyledProps<\"button\"> {\n /**\n * The accordion icon to use.\n */\n icon?: ReactNodeOrFunction<AccordionCallBackProps>\n /**\n * Props the container element.\n */\n containerProps?: HTMLStyledProps\n}\n\nexport const AccordionButton = withContext<\"button\", AccordionButtonProps>(\n ({ children, icon: customIcon, containerProps, ...rest }) => {\n const { icon: rootIcon } = useComponentContext()\n const { icon: itemIcon } = useItemComponentContext()\n const { disabled, open, getButtonProps } = useAccordionItemContext()\n const props = { disabled, expanded: open }\n\n return (\n <styled.h3 {...containerProps}>\n <styled.button {...getButtonProps(rest)}>\n {children}\n\n <AccordionIcon>\n {runIfFn(customIcon, props) ??\n runIfFn(itemIcon, props) ??\n runIfFn(rootIcon, props)}\n </AccordionIcon>\n </styled.button>\n </styled.h3>\n )\n },\n \"button\",\n)()\n\ninterface AccordionIconProps extends HTMLStyledProps<\"svg\"> {}\n\nexport const AccordionIcon = withContext<\"svg\", AccordionIconProps>(\n ({ children = <ChevronDownIcon />, ...rest }) => {\n const { iconHidden } = useComponentContext()\n const { getIconProps } = useAccordionItemContext()\n\n if (iconHidden) return null\n\n if (isValidElement<HTMLProps<\"svg\">>(children))\n return cloneElement(\n children,\n getIconProps({\n ...rest,\n ...children.props,\n }),\n )\n\n return Children.count(children) > 1 ? Children.only(null) : null\n },\n \"icon\",\n)()\n\nexport interface AccordionPanelProps\n extends\n Omit<HTMLStyledProps, \"transition\">,\n Pick<\n CollapseProps,\n | \"animationOpacity\"\n | \"endingHeight\"\n | \"startingHeight\"\n | keyof WithTransitionProps\n > {}\n\nexport const AccordionPanel = withContext<\"div\", AccordionPanelProps>(\n ({\n animationOpacity,\n children,\n delay,\n duration,\n endingHeight,\n startingHeight,\n transition,\n transitionEnd,\n unmountOnExit,\n ...rest\n }) => {\n const { open, getPanelProps } = useAccordionItemContext()\n\n return (\n <Collapse\n {...{\n animationOpacity,\n delay,\n duration,\n endingHeight,\n open,\n startingHeight,\n transition,\n transitionEnd,\n unmountOnExit,\n }}\n >\n <styled.div {...getPanelProps(rest)}>\n {isString(children) ? <styled.p>{children}</styled.p> : children}\n </styled.div>\n </Collapse>\n )\n },\n \"panel\",\n)()\n"],"mappings":";;;;;;;;;;;;;AA0DA,MAAM,CAAC,sBAAsB,2BAC3BA,gBAAAA,cAAoC,EAClC,MAAM,uBACR,CAAC;AAEH,MAAM,EACJ,kBACA,cAAc,uBACd,qBACA,iBAAiB,0BACjB,aACA,iBACEC,yBAAAA,oBACF,aACAC,wBAAAA,cACF;;;;;;AASA,MAAa,gBAAgB,cAC1B,EAAE,UAAU,MAAM,YAAY,OAAO,GAAG,YAAY;CACnD,MAAM,EACJ,aACA,cACA,OACA,UACA,iBACA,UACA,QACA,iBACEC,sBAAAA,aAAa,KAAK;CACtB,MAAM,oBAAA,GAAmBC,MAAAA,QAAAA,OAAc;EACrC,IAAI,UAAU,OAAO;EAErB,OAAO,OAAO,KAAK,OAAO,UACxB,iBAAA,GAAA,kBAAA,IAAA,CAAC,eAAD;GAAkC;GAAO,GAAI;EAAQ,GAAjC,KAAiC,CACtD;CACH,GAAG,CAAC,UAAU,KAAK,CAAC;CACpB,MAAM,WAAA,GAAUA,MAAAA,QAAAA,QACP;EACL;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EAAC;EAAc;EAAO;EAAU;EAAiB;EAAU;CAAM,CACnE;CACA,MAAM,oBAAA,GAAmBA,MAAAA,QAAAA,QAChB;EAAE;EAAM;CAAW,IAC1B,CAAC,MAAM,UAAU,CACnB;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,6BAAD;EAA6B,OAAO;EAClC,UAAA,iBAAA,GAAA,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EF,OAAOC,MAAAA,SAAS,MAAM,QAAQ,IAAI,IAAIA,MAAAA,SAAS,KAAK,IAAI,IAAI;AAC9D,GACA,MACF,CAAC,CAAC;AAaF,MAAa,iBAAiB,aAC3B,EACC,kBACA,UACA,OACA,UACA,cACA,gBACA,YACA,eACA,eACA,GAAG,WACC;CACJ,MAAM,EAAE,MAAM,kBAAkBJ,sBAAAA,wBAAwB;CAExD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACK,iBAAAA,UAAD;EAEI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAGF,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACT,gBAAAA,OAAO,KAAR;GAAY,GAAI,cAAc,IAAI;GAC/B,WAAA,GAAA,oBAAA,cAAA,SAAA,CAAS,QAAQ,IAAI,iBAAA,GAAA,kBAAA,IAAA,CAACA,gBAAAA,OAAO,GAAR,EAAW,SAAmB,CAAA,IAAI;EAC9C,CAAA;CACJ,CAAA;AAEd,GACA,OACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"accordion.cjs","names":["createContext","createSlotComponent","accordionStyle","useAccordion","useMemo","AccordionDescendantsContext","AccordionContext","styled","useAccordionItem","useSplitChildren","AccordionItemContext","useAccordionItemContext","ChevronDownIcon","getResolvedChild","isValidElement","cloneElement","Children","Collapse"],"sources":["../../../../src/components/accordion/accordion.tsx"],"sourcesContent":["\"use client\"\n\nimport type { HTMLProps, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport type { CollapseProps } from \"../collapse\"\nimport type { WithTransitionProps } from \"../motion\"\nimport type { AccordionStyle } from \"./accordion.style\"\nimport type { UseAccordionItemProps, UseAccordionProps } from \"./use-accordion\"\nimport { Children, cloneElement, isValidElement, useMemo } from \"react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport {\n createContext,\n getResolvedChild,\n isString,\n runIfFn,\n useSplitChildren,\n} from \"../../utils\"\nimport { Collapse } from \"../collapse\"\nimport { ChevronDownIcon } from \"../icon\"\nimport { accordionStyle } from \"./accordion.style\"\nimport {\n AccordionContext,\n AccordionDescendantsContext,\n AccordionItemContext,\n useAccordion,\n useAccordionItem,\n useAccordionItemContext,\n} from \"./use-accordion\"\n\ninterface AccordionCallBackProps {\n disabled?: boolean\n expanded?: boolean\n}\n\nexport interface AccordionItem extends Omit<AccordionItemProps, \"index\"> {}\n\ninterface ComponentContext extends Pick<\n AccordionRootProps,\n \"icon\" | \"iconHidden\"\n> {}\n\nexport interface AccordionRootProps\n extends\n Omit<HTMLStyledProps, \"onChange\">,\n ThemeProps<AccordionStyle>,\n UseAccordionProps {\n /**\n * The accordion icon for all items to use.\n */\n icon?: ReactNodeOrFunction<AccordionCallBackProps>\n /**\n * If `true`, hide the accordion icon for all items.\n *\n * @default false\n */\n iconHidden?: boolean\n /**\n * If provided, generate elements based on items.\n */\n items?: AccordionItem[]\n}\n\ninterface ItemComponentContext extends Pick<AccordionItemProps, \"icon\"> {}\n\nconst [ItemComponentContext, useItemComponentContext] =\n createContext<ItemComponentContext>({\n name: \"ItemComponentContext\",\n })\n\nconst {\n ComponentContext,\n PropsContext: AccordionPropsContext,\n useComponentContext,\n usePropsContext: useAccordionPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<AccordionRootProps, AccordionStyle, ComponentContext>(\n \"accordion\",\n accordionStyle,\n)\n\nexport { AccordionPropsContext, useAccordionPropsContext }\n\n/**\n * `Accordion` is a component for a list that displays information in an expandable or collapsible manner.\n *\n * @see https://yamada-ui.com/docs/components/accordion\n */\nexport const AccordionRoot = withProvider<\"div\", AccordionRootProps>(\n ({ children, icon, iconHidden, items, ...props }) => {\n const {\n descendants,\n focusedIndex,\n index,\n multiple,\n setFocusedIndex,\n setIndex,\n toggle,\n getRootProps,\n } = useAccordion(props)\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return items?.map((props, index) => (\n <AccordionItem key={index} index={index} {...props} />\n ))\n }, [children, items])\n const context = useMemo(\n () => ({\n focusedIndex,\n index,\n multiple,\n setFocusedIndex,\n setIndex,\n toggle,\n }),\n [focusedIndex, index, multiple, setFocusedIndex, setIndex, toggle],\n )\n const componentContext = useMemo(\n () => ({ icon, iconHidden }),\n [icon, iconHidden],\n )\n\n return (\n <AccordionDescendantsContext value={descendants}>\n <AccordionContext value={context}>\n <ComponentContext value={componentContext}>\n <styled.div {...getRootProps()}>{computedChildren}</styled.div>\n </ComponentContext>\n </AccordionContext>\n </AccordionDescendantsContext>\n )\n },\n \"root\",\n)()\n\nexport interface AccordionItemProps\n extends\n Omit<HTMLStyledProps, \"children\">,\n Omit<UseAccordionItemProps, \"children\"> {\n /**\n * The accordion button to use.\n */\n button?: ReactNodeOrFunction<AccordionCallBackProps>\n /**\n * The accordion children to use.\n */\n children?: ReactNodeOrFunction<AccordionCallBackProps>\n /**\n * The accordion icon to use.\n */\n icon?: ReactNodeOrFunction<AccordionCallBackProps>\n}\n\nexport const AccordionItem = withContext<\"div\", AccordionItemProps>(\n ({ button, children, icon, ...rest }) => {\n const {\n disabled,\n open,\n getButtonProps,\n getIconProps,\n getItemProps,\n getPanelProps,\n } = useAccordionItem(rest)\n const computedChildren = useMemo(\n () => runIfFn(children, { disabled, expanded: open }),\n [children, disabled, open],\n )\n const [omittedChildren, customAccordionButton, customAccordionPanel] =\n useSplitChildren(computedChildren, AccordionButton, AccordionPanel)\n const context = useMemo(\n () => ({\n disabled,\n icon,\n open,\n getButtonProps,\n getIconProps,\n getPanelProps,\n }),\n [disabled, getButtonProps, getPanelProps, getIconProps, icon, open],\n )\n const componentContext = useMemo(() => ({ icon }), [icon])\n\n return (\n <AccordionItemContext value={context}>\n <ItemComponentContext value={componentContext}>\n <styled.div {...getItemProps()}>\n {customAccordionButton ?? (\n <AccordionButton>\n {runIfFn(button, { disabled, expanded: open })}\n </AccordionButton>\n )}\n {customAccordionPanel ?? (\n <AccordionPanel>{omittedChildren}</AccordionPanel>\n )}\n </styled.div>\n </ItemComponentContext>\n </AccordionItemContext>\n )\n },\n \"item\",\n)()\n\nexport interface AccordionButtonProps extends HTMLStyledProps<\"button\"> {\n /**\n * The accordion icon to use.\n */\n icon?: ReactNodeOrFunction<AccordionCallBackProps>\n /**\n * Props the container element.\n */\n containerProps?: HTMLStyledProps\n}\n\nexport const AccordionButton = withContext<\"button\", AccordionButtonProps>(\n ({ children, icon: customIcon, containerProps, ...rest }) => {\n const { icon: rootIcon } = useComponentContext()\n const { icon: itemIcon } = useItemComponentContext()\n const { disabled, open, getButtonProps } = useAccordionItemContext()\n const props = { disabled, expanded: open }\n\n return (\n <styled.h3 {...containerProps}>\n <styled.button {...getButtonProps(rest)}>\n {children}\n\n <AccordionIcon>\n {runIfFn(customIcon, props) ??\n runIfFn(itemIcon, props) ??\n runIfFn(rootIcon, props)}\n </AccordionIcon>\n </styled.button>\n </styled.h3>\n )\n },\n \"button\",\n)()\n\ninterface AccordionIconProps extends HTMLStyledProps<\"svg\"> {}\n\nexport const AccordionIcon = withContext<\"svg\", AccordionIconProps>(\n ({ children = <ChevronDownIcon />, ...rest }) => {\n const { iconHidden } = useComponentContext()\n const { getIconProps } = useAccordionItemContext()\n\n if (iconHidden) return null\n\n const child = getResolvedChild(children)\n\n if (isValidElement<HTMLProps<\"svg\">>(child))\n return cloneElement(child, getIconProps({ ...rest, ...child.props }))\n\n return Children.count(child) > 1 ? Children.only(null) : null\n },\n \"icon\",\n)()\n\nexport interface AccordionPanelProps\n extends\n Omit<HTMLStyledProps, \"transition\">,\n Pick<\n CollapseProps,\n | \"animationOpacity\"\n | \"endingHeight\"\n | \"startingHeight\"\n | keyof WithTransitionProps\n > {}\n\nexport const AccordionPanel = withContext<\"div\", AccordionPanelProps>(\n ({\n animationOpacity,\n children,\n delay,\n duration,\n endingHeight,\n startingHeight,\n transition,\n transitionEnd,\n unmountOnExit,\n ...rest\n }) => {\n const { open, getPanelProps } = useAccordionItemContext()\n\n return (\n <Collapse\n {...{\n animationOpacity,\n delay,\n duration,\n endingHeight,\n open,\n startingHeight,\n transition,\n transitionEnd,\n unmountOnExit,\n }}\n >\n <styled.div {...getPanelProps(rest)}>\n {isString(children) ? <styled.p>{children}</styled.p> : children}\n </styled.div>\n </Collapse>\n )\n },\n \"panel\",\n)()\n"],"mappings":";;;;;;;;;;;;;AAgEA,MAAM,CAAC,sBAAsB,2BAC3BA,gBAAAA,cAAoC,EAClC,MAAM,uBACR,CAAC;AAEH,MAAM,EACJ,kBACA,cAAc,uBACd,qBACA,iBAAiB,0BACjB,aACA,iBACEC,yBAAAA,oBACF,aACAC,wBAAAA,cACF;;;;;;AASA,MAAa,gBAAgB,cAC1B,EAAE,UAAU,MAAM,YAAY,OAAO,GAAG,YAAY;CACnD,MAAM,EACJ,aACA,cACA,OACA,UACA,iBACA,UACA,QACA,iBACEC,sBAAAA,aAAa,KAAK;CACtB,MAAM,oBAAA,GAAmBC,MAAAA,QAAAA,OAAc;EACrC,IAAI,UAAU,OAAO;EAErB,OAAO,OAAO,KAAK,OAAO,UACxB,iBAAA,GAAA,kBAAA,IAAA,CAAC,eAAD;GAAkC;GAAO,GAAI;EAAQ,GAAjC,KAAiC,CACtD;CACH,GAAG,CAAC,UAAU,KAAK,CAAC;CACpB,MAAM,WAAA,GAAUA,MAAAA,QAAAA,QACP;EACL;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EAAC;EAAc;EAAO;EAAU;EAAiB;EAAU;CAAM,CACnE;CACA,MAAM,oBAAA,GAAmBA,MAAAA,QAAAA,QAChB;EAAE;EAAM;CAAW,IAC1B,CAAC,MAAM,UAAU,CACnB;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,6BAAD;EAA6B,OAAO;EAClC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,kBAAD;GAAkB,OAAO;GACvB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD;IAAkB,OAAO;IACvB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,gBAAAA,OA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Aa,iBAAiB,aAC3B,EACC,kBACA,UACA,OACA,UACA,cACA,gBACA,YACA,eACA,eACA,GAAG,WACC;CACJ,MAAM,EAAE,MAAM,kBAAkBL,sBAAAA,wBAAwB;CAExD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACM,iBAAAA,UAAD;EAEI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAGF,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACV,gBAAAA,OAAO,KAAR;GAAY,GAAI,cAAc,IAAI;GAC/B,WAAA,GAAA,oBAAA,cAAA,SAAA,CAAS,QAAQ,IAAI,iBAAA,GAAA,kBAAA,IAAA,CAACA,gBAAAA,OAAO,GAAR,EAAW,SAAmB,CAAA,IAAI;EAC9C,CAAA;CACJ,CAAA;AAEd,GACA,OACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
const require_children = require("../../utils/children.cjs");
|
|
2
3
|
const require_utils_index = require("../../utils/index.cjs");
|
|
3
4
|
const require_create_component = require("../../core/components/create-component.cjs");
|
|
4
5
|
const require_aspect_ratio_style = require("./aspect-ratio.style.cjs");
|
|
@@ -11,10 +12,9 @@ const { PropsContext: AspectRatioPropsContext, usePropsContext: useAspectRatioPr
|
|
|
11
12
|
* @see https://yamada-ui.com/docs/components/aspect-ratio
|
|
12
13
|
*/
|
|
13
14
|
const AspectRatio = withContext("div")(void 0, ({ children, ratio = 4 / 3, ...rest }) => {
|
|
14
|
-
const child = react.Children.only(children);
|
|
15
15
|
return {
|
|
16
16
|
...rest,
|
|
17
|
-
children:
|
|
17
|
+
children: react.Children.only(require_children.getResolvedChild(children)),
|
|
18
18
|
_before: {
|
|
19
19
|
display: "block",
|
|
20
20
|
h: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aspect-ratio.cjs","names":["createComponent","aspectRatioStyle","Children"],"sources":["../../../../src/components/aspect-ratio/aspect-ratio.tsx"],"sourcesContent":["\"use client\"\n\nimport type { HTMLStyledProps, StyleValue } from \"../../core\"\nimport type { AspectRatioStyle } from \"./aspect-ratio.style\"\nimport { Children } from \"react\"\nimport { createComponent } from \"../../core\"\nimport { replaceObject } from \"../../utils\"\nimport { aspectRatioStyle } from \"./aspect-ratio.style\"\n\nexport interface AspectRatioProps extends HTMLStyledProps {\n /**\n * The aspect ratio of the Box.\n *\n * @default '4 / 3'\n */\n ratio?: StyleValue<number>\n}\n\nconst {\n PropsContext: AspectRatioPropsContext,\n usePropsContext: useAspectRatioPropsContext,\n withContext,\n} = createComponent<AspectRatioProps, AspectRatioStyle>(\n \"aspect-ratio\",\n aspectRatioStyle,\n)\n\nexport { AspectRatioPropsContext, useAspectRatioPropsContext }\n\n/**\n * `AspectRatio` is a component for embedding things like videos and maps while maintaining the aspect ratio.\n *\n * @see https://yamada-ui.com/docs/components/aspect-ratio\n */\nexport const AspectRatio = withContext(\"div\")(\n undefined,\n ({ children, ratio = 4 / 3, ...rest }) => {\n
|
|
1
|
+
{"version":3,"file":"aspect-ratio.cjs","names":["createComponent","aspectRatioStyle","Children","getResolvedChild"],"sources":["../../../../src/components/aspect-ratio/aspect-ratio.tsx"],"sourcesContent":["\"use client\"\n\nimport type { HTMLStyledProps, StyleValue } from \"../../core\"\nimport type { AspectRatioStyle } from \"./aspect-ratio.style\"\nimport { Children } from \"react\"\nimport { createComponent } from \"../../core\"\nimport { getResolvedChild, replaceObject } from \"../../utils\"\nimport { aspectRatioStyle } from \"./aspect-ratio.style\"\n\nexport interface AspectRatioProps extends HTMLStyledProps {\n /**\n * The aspect ratio of the Box.\n *\n * @default '4 / 3'\n */\n ratio?: StyleValue<number>\n}\n\nconst {\n PropsContext: AspectRatioPropsContext,\n usePropsContext: useAspectRatioPropsContext,\n withContext,\n} = createComponent<AspectRatioProps, AspectRatioStyle>(\n \"aspect-ratio\",\n aspectRatioStyle,\n)\n\nexport { AspectRatioPropsContext, useAspectRatioPropsContext }\n\n/**\n * `AspectRatio` is a component for embedding things like videos and maps while maintaining the aspect ratio.\n *\n * @see https://yamada-ui.com/docs/components/aspect-ratio\n */\nexport const AspectRatio = withContext(\"div\")(\n undefined,\n ({ children, ratio = 4 / 3, ...rest }) => {\n return {\n ...rest,\n children: Children.only(getResolvedChild(children)),\n _before: {\n display: \"block\",\n h: 0,\n pb: replaceObject(ratio, (r) => `${(1 / r) * 100}%`),\n },\n }\n },\n)\n"],"mappings":";;;;;;;AAkBA,MAAM,EACJ,cAAc,yBACd,iBAAiB,4BACjB,gBACEA,yBAAAA,gBACF,gBACAC,2BAAAA,gBACF;;;;;;AASA,MAAa,cAAc,YAAY,KAAK,CAAC,CAC3C,KAAA,IACC,EAAE,UAAU,QAAQ,IAAI,GAAG,GAAG,WAAW;CACxC,OAAO;EACL,GAAG;EACH,UAAUC,MAAAA,SAAS,KAAKC,iBAAAA,iBAAiB,QAAQ,CAAC;EAClD,SAAS;GACP,SAAS;GACT,GAAG;GACH,KAAA,GAAA,oBAAA,cAAI,cAAA,CAAc,QAAQ,MAAM,GAAI,IAAI,IAAK,IAAI,EAAE;EACrD;CACF;AACF,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockquote.style.cjs","names":["defineComponentSlotStyle"],"sources":["../../../../src/components/blockquote/blockquote.style.ts"],"sourcesContent":["import { defineComponentSlotStyle } from \"../../core\"\n\nexport const blockquoteStyle = defineComponentSlotStyle({\n base: {\n caption: {\n color: \"muted\",\n fontSize: \"sm\",\n },\n cite: {},\n content: {},\n icon: {\n fontSize: \"xl\",\n left: \"0\",\n position: \"absolute\",\n top: \"0.5\",\n },\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"sm\",\n position: \"relative\",\n },\n },\n\n props: {\n /**\n * The alignment of the blockquote.\n *\n * @default 'start'\n */\n justify: {\n center: {\n root: {\n alignItems: \"center\",\n textAlign: \"center\",\n },\n },\n end: {\n root: {\n alignItems: \"end\",\n textAlign: \"end\",\n },\n },\n start: {\n root: {\n alignItems: \"start\",\n textAlign: \"start\",\n },\n },\n },\n },\n\n variants: {\n plain: {\n icon: {\n color: \"colorScheme.solid\",\n },\n root: {\n _hasIcon: {\n ps: \"lg\",\n },\n },\n },\n solid: {\n icon: {\n color: \"colorScheme.solid\",\n },\n root: {\n borderStart: \"4px solid {colorScheme.solid}\",\n px: \"md\",\n },\n },\n subtle: {\n icon: {\n color: \"colorScheme.fg\",\n },\n root: {\n borderStart: \"4px solid {colorScheme.muted}\",\n px: \"md\",\n },\n },\n },\n\n defaultProps: {\n variant: \"subtle\",\n justify: \"start\",\n },\n})\n\nexport type BlockquoteStyle = typeof blockquoteStyle\n"],"mappings":";AAEA,MAAa,wDAAkBA,CAAAA,CAAAA,yBAAyB;CACtD,MAAM;EACJ,SAAS;GACP,OAAO;GACP,UAAU;EACZ;EACA,MAAM,CAAC;EACP,SAAS,CAAC;EACV,MAAM;GACJ,UAAU;GACV,MAAM;GACN,UAAU;GACV,KAAK;EACP;EACA,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACL,UAAU;EACZ;CACF;CAEA,OAAO;;;;;;AAML,SAAS;EACP,QAAQ,EACN,MAAM;GACJ,YAAY;GACZ,WAAW;EACb,EACF;EACA,KAAK,EACH,MAAM;GACJ,YAAY;GACZ,WAAW;EACb,EACF;EACA,OAAO,EACL,MAAM;GACJ,YAAY;GACZ,WAAW;EACb,EACF;CACF,EACF;CAEA,UAAU;EACR,OAAO;GACL,MAAM,EACJ,OAAO,oBACT;GACA,MAAM,EACJ,UAAU,EACR,IAAI,KACN,EACF;EACF;EACA,OAAO;GACL,MAAM,EACJ,OAAO,oBACT;GACA,MAAM;IACJ,aAAa;IACb,IAAI;GACN;EACF;EACA,QAAQ;GACN,MAAM,EACJ,OAAO,iBACT;GACA,MAAM;IACJ,aAAa;IACb,IAAI;GACN;EACF;CACF;CAEA,cAAc;EACZ,SAAS;EACT,SAAS;CACX;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"blockquote.style.cjs","names":["defineComponentSlotStyle"],"sources":["../../../../src/components/blockquote/blockquote.style.ts"],"sourcesContent":["import { defineComponentSlotStyle } from \"../../core\"\n\nexport const blockquoteStyle = defineComponentSlotStyle({\n base: {\n caption: {\n color: \"fg.muted\",\n fontSize: \"sm\",\n },\n cite: {},\n content: {},\n icon: {\n fontSize: \"xl\",\n left: \"0\",\n position: \"absolute\",\n top: \"0.5\",\n },\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"sm\",\n position: \"relative\",\n },\n },\n\n props: {\n /**\n * The alignment of the blockquote.\n *\n * @default 'start'\n */\n justify: {\n center: {\n root: {\n alignItems: \"center\",\n textAlign: \"center\",\n },\n },\n end: {\n root: {\n alignItems: \"end\",\n textAlign: \"end\",\n },\n },\n start: {\n root: {\n alignItems: \"start\",\n textAlign: \"start\",\n },\n },\n },\n },\n\n variants: {\n plain: {\n icon: {\n color: \"colorScheme.solid\",\n },\n root: {\n _hasIcon: {\n ps: \"lg\",\n },\n },\n },\n solid: {\n icon: {\n color: \"colorScheme.solid\",\n },\n root: {\n borderStart: \"4px solid {colorScheme.solid}\",\n px: \"md\",\n },\n },\n subtle: {\n icon: {\n color: \"colorScheme.fg\",\n },\n root: {\n borderStart: \"4px solid {colorScheme.muted}\",\n px: \"md\",\n },\n },\n },\n\n defaultProps: {\n variant: \"subtle\",\n justify: \"start\",\n },\n})\n\nexport type BlockquoteStyle = typeof blockquoteStyle\n"],"mappings":";AAEA,MAAa,wDAAkBA,CAAAA,CAAAA,yBAAyB;CACtD,MAAM;EACJ,SAAS;GACP,OAAO;GACP,UAAU;EACZ;EACA,MAAM,CAAC;EACP,SAAS,CAAC;EACV,MAAM;GACJ,UAAU;GACV,MAAM;GACN,UAAU;GACV,KAAK;EACP;EACA,MAAM;GACJ,SAAS;GACT,eAAe;GACf,KAAK;GACL,UAAU;EACZ;CACF;CAEA,OAAO;;;;;;AAML,SAAS;EACP,QAAQ,EACN,MAAM;GACJ,YAAY;GACZ,WAAW;EACb,EACF;EACA,KAAK,EACH,MAAM;GACJ,YAAY;GACZ,WAAW;EACb,EACF;EACA,OAAO,EACL,MAAM;GACJ,YAAY;GACZ,WAAW;EACb,EACF;CACF,EACF;CAEA,UAAU;EACR,OAAO;GACL,MAAM,EACJ,OAAO,oBACT;GACA,MAAM,EACJ,UAAU,EACR,IAAI,KACN,EACF;EACF;EACA,OAAO;GACL,MAAM,EACJ,OAAO,oBACT;GACA,MAAM;IACJ,aAAa;IACb,IAAI;GACN;EACF;EACA,QAAQ;GACN,MAAM,EACJ,OAAO,iBACT;GACA,MAAM;IACJ,aAAa;IACb,IAAI;GACN;EACF;CACF;CAEA,cAAc;EACZ,SAAS;EACT,SAAS;CACX;AACF,CAAC"}
|
|
@@ -5,8 +5,9 @@ const require_props = require("../../core/components/props.cjs");
|
|
|
5
5
|
const require_i18n_provider = require("../../providers/i18n-provider/i18n-provider.cjs");
|
|
6
6
|
let react = require("react");
|
|
7
7
|
//#region src/components/breadcrumb/use-breadcrumb.tsx
|
|
8
|
-
const useBreadcrumb = ({ children, ellipsis, endBoundaries = 0, items = [], link, startBoundaries = 0, ...rest } = {}) => {
|
|
8
|
+
const useBreadcrumb = ({ children, ellipsis, endBoundaries = 0, items = [], link: linkProp, startBoundaries = 0, ...rest } = {}) => {
|
|
9
9
|
const validChildren = require_children.useValidChildren(children);
|
|
10
|
+
const [link] = require_children.useValidChildren(linkProp);
|
|
10
11
|
const length = validChildren.length || items.length;
|
|
11
12
|
const { t } = require_i18n_provider.useI18n("breadcrumb");
|
|
12
13
|
const hasBoundaries = startBoundaries + endBoundaries > 0 && length > startBoundaries + endBoundaries;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-breadcrumb.cjs","names":["useValidChildren","useI18n","useCallback","cloneElement","useMemo","mergeProps"],"sources":["../../../../src/components/breadcrumb/use-breadcrumb.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport { cloneElement, useCallback, useMemo } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport { runIfFn, useValidChildren } from \"../../utils\"\n\nexport interface BreadcrumbItem extends HTMLProps<\"a\"> {\n currentPage?: boolean\n label?: ReactNode\n}\n\nexport interface UseBreadcrumbProps extends HTMLProps<\"nav\"> {\n /**\n * The icon to be used in the ellipsis.\n */\n ellipsis?: ReactNodeOrFunction<{ items: BreadcrumbItem[] }>\n /**\n * Number of elements visible on the end(right) edges.\n *\n * @default 0\n */\n endBoundaries?: number\n /**\n * If provided, generate breadcrumb items based on items.\n */\n items?: BreadcrumbItem[]\n /**\n * The component to be used for the link.\n */\n link?: ReactElement<any>\n /**\n * Number of elements visible on the start(left) edges.\n *\n * @default 0\n */\n startBoundaries?: number\n}\n\nexport const useBreadcrumb = ({\n children,\n ellipsis,\n endBoundaries = 0,\n items = [],\n link,\n startBoundaries = 0,\n ...rest\n}: UseBreadcrumbProps = {}) => {\n const validChildren = useValidChildren(children)\n const length = validChildren.length || items.length\n const { t } = useI18n(\"breadcrumb\")\n\n const hasBoundaries =\n startBoundaries + endBoundaries > 0 &&\n length > startBoundaries + endBoundaries\n\n const renderLink = useCallback(\n (items: BreadcrumbItem[]) => {\n if (!link) return []\n\n return items.map(({ label, ...rest }) =>\n cloneElement<any>(link, { ...link.props, children: label, ...rest }),\n )\n },\n [link],\n )\n\n const renderEllipsis = useCallback(\n (items: BreadcrumbItem[]) => {\n if (!ellipsis) return null\n\n return runIfFn(ellipsis, { items })\n },\n [ellipsis],\n )\n\n const splitItems = useCallback(\n (items: BreadcrumbItem[]) => {\n const length = items.length\n const firstItems = items.slice(0, startBoundaries)\n const ellipsisItems = items.slice(startBoundaries, length - endBoundaries)\n const lastItems = items.slice(length - endBoundaries)\n\n return [firstItems, ellipsisItems, lastItems] as const\n },\n [startBoundaries, endBoundaries],\n )\n\n const cloneChildren = useMemo(() => {\n const hasChildren = !!validChildren.length\n\n if (hasChildren) {\n return validChildren\n } else if (hasBoundaries) {\n const [firstItems, ellipsisItems, lastItems] = splitItems(items)\n\n return [\n ...renderLink(firstItems),\n renderEllipsis(ellipsisItems),\n ...renderLink(lastItems),\n ]\n } else {\n return renderLink(items)\n }\n }, [\n validChildren,\n items,\n hasBoundaries,\n renderEllipsis,\n renderLink,\n splitItems,\n ])\n\n const getRootProps: PropGetter<\"nav\"> = useCallback(\n (props) => mergeProps({ \"aria-label\": t(\"Breadcrumb\") }, rest, props)(),\n [rest, t],\n )\n\n const getListProps: PropGetter<\"ol\"> = useCallback(\n (props) => ({ ...props }),\n [],\n )\n\n const getLinkProps: PropGetter<\"a\", { currentPage?: boolean }> = useCallback(\n ({ href, currentPage, ...props } = {}) => ({\n href: !currentPage ? href : undefined,\n \"aria-current\": currentPage ? \"page\" : undefined,\n ...props,\n }),\n [],\n )\n\n const getEllipsisProps: PropGetter<\"svg\"> = useCallback(\n (props) => ({\n \"aria-label\": t(\"Ellipsis\"),\n role: \"presentation\",\n ...props,\n }),\n [t],\n )\n\n return {\n children: cloneChildren,\n getEllipsisProps,\n getLinkProps,\n getListProps,\n getRootProps,\n }\n}\n\nexport type UseBreadcrumbReturn = ReturnType<typeof useBreadcrumb>\n"],"mappings":";;;;;;;AA0CA,MAAa,iBAAiB,EAC5B,UACA,UACA,gBAAgB,GAChB,QAAQ,CAAC,GACT,
|
|
1
|
+
{"version":3,"file":"use-breadcrumb.cjs","names":["useValidChildren","useI18n","useCallback","cloneElement","useMemo","mergeProps"],"sources":["../../../../src/components/breadcrumb/use-breadcrumb.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport { cloneElement, useCallback, useMemo } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport { runIfFn, useValidChildren } from \"../../utils\"\n\nexport interface BreadcrumbItem extends HTMLProps<\"a\"> {\n currentPage?: boolean\n label?: ReactNode\n}\n\nexport interface UseBreadcrumbProps extends HTMLProps<\"nav\"> {\n /**\n * The icon to be used in the ellipsis.\n */\n ellipsis?: ReactNodeOrFunction<{ items: BreadcrumbItem[] }>\n /**\n * Number of elements visible on the end(right) edges.\n *\n * @default 0\n */\n endBoundaries?: number\n /**\n * If provided, generate breadcrumb items based on items.\n */\n items?: BreadcrumbItem[]\n /**\n * The component to be used for the link.\n */\n link?: ReactElement<any>\n /**\n * Number of elements visible on the start(left) edges.\n *\n * @default 0\n */\n startBoundaries?: number\n}\n\nexport const useBreadcrumb = ({\n children,\n ellipsis,\n endBoundaries = 0,\n items = [],\n link: linkProp,\n startBoundaries = 0,\n ...rest\n}: UseBreadcrumbProps = {}) => {\n const validChildren = useValidChildren(children)\n const [link] = useValidChildren(linkProp)\n const length = validChildren.length || items.length\n const { t } = useI18n(\"breadcrumb\")\n\n const hasBoundaries =\n startBoundaries + endBoundaries > 0 &&\n length > startBoundaries + endBoundaries\n\n const renderLink = useCallback(\n (items: BreadcrumbItem[]) => {\n if (!link) return []\n\n return items.map(({ label, ...rest }) =>\n cloneElement<any>(link, { ...link.props, children: label, ...rest }),\n )\n },\n [link],\n )\n\n const renderEllipsis = useCallback(\n (items: BreadcrumbItem[]) => {\n if (!ellipsis) return null\n\n return runIfFn(ellipsis, { items })\n },\n [ellipsis],\n )\n\n const splitItems = useCallback(\n (items: BreadcrumbItem[]) => {\n const length = items.length\n const firstItems = items.slice(0, startBoundaries)\n const ellipsisItems = items.slice(startBoundaries, length - endBoundaries)\n const lastItems = items.slice(length - endBoundaries)\n\n return [firstItems, ellipsisItems, lastItems] as const\n },\n [startBoundaries, endBoundaries],\n )\n\n const cloneChildren = useMemo(() => {\n const hasChildren = !!validChildren.length\n\n if (hasChildren) {\n return validChildren\n } else if (hasBoundaries) {\n const [firstItems, ellipsisItems, lastItems] = splitItems(items)\n\n return [\n ...renderLink(firstItems),\n renderEllipsis(ellipsisItems),\n ...renderLink(lastItems),\n ]\n } else {\n return renderLink(items)\n }\n }, [\n validChildren,\n items,\n hasBoundaries,\n renderEllipsis,\n renderLink,\n splitItems,\n ])\n\n const getRootProps: PropGetter<\"nav\"> = useCallback(\n (props) => mergeProps({ \"aria-label\": t(\"Breadcrumb\") }, rest, props)(),\n [rest, t],\n )\n\n const getListProps: PropGetter<\"ol\"> = useCallback(\n (props) => ({ ...props }),\n [],\n )\n\n const getLinkProps: PropGetter<\"a\", { currentPage?: boolean }> = useCallback(\n ({ href, currentPage, ...props } = {}) => ({\n href: !currentPage ? href : undefined,\n \"aria-current\": currentPage ? \"page\" : undefined,\n ...props,\n }),\n [],\n )\n\n const getEllipsisProps: PropGetter<\"svg\"> = useCallback(\n (props) => ({\n \"aria-label\": t(\"Ellipsis\"),\n role: \"presentation\",\n ...props,\n }),\n [t],\n )\n\n return {\n children: cloneChildren,\n getEllipsisProps,\n getLinkProps,\n getListProps,\n getRootProps,\n }\n}\n\nexport type UseBreadcrumbReturn = ReturnType<typeof useBreadcrumb>\n"],"mappings":";;;;;;;AA0CA,MAAa,iBAAiB,EAC5B,UACA,UACA,gBAAgB,GAChB,QAAQ,CAAC,GACT,MAAM,UACN,kBAAkB,GAClB,GAAG,SACmB,CAAC,MAAM;CAC7B,MAAM,gBAAgBA,iBAAAA,iBAAiB,QAAQ;CAC/C,MAAM,CAAC,QAAQA,iBAAAA,iBAAiB,QAAQ;CACxC,MAAM,SAAS,cAAc,UAAU,MAAM;CAC7C,MAAM,EAAE,MAAMC,sBAAAA,QAAQ,YAAY;CAElC,MAAM,gBACJ,kBAAkB,gBAAgB,KAClC,SAAS,kBAAkB;CAE7B,MAAM,cAAA,GAAaC,MAAAA,YAAAA,EAChB,UAA4B;EAC3B,IAAI,CAAC,MAAM,OAAO,CAAC;EAEnB,OAAO,MAAM,KAAK,EAAE,OAAO,GAAG,YAAA,GAC5BC,MAAAA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5B,gBAAgB,cAAc,SAAS,KAAA;EACvC,GAAG;CACL,IACA,CAAC,CACH;CAWA,OAAO;EACL,UAAU;EACV,mBAAA,GAX0CA,MAAAA,YAAAA,EACzC,WAAW;GACV,cAAc,EAAE,UAAU;GAC1B,MAAM;GACN,GAAG;EACL,IACA,CAAC,CAAC,CAKa;EACf;EACA;EACA;CACF;AACF"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_children = require("../../utils/children.cjs");
|
|
3
|
+
const require_factory = require("../../core/system/factory.cjs");
|
|
4
|
+
const require_props = require("../../core/components/props.cjs");
|
|
5
|
+
const require_create_component = require("../../core/components/create-component.cjs");
|
|
6
|
+
const require_bubble_style = require("./bubble.style.cjs");
|
|
7
|
+
let react = require("react");
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
//#region src/components/bubble/bubble.tsx
|
|
10
|
+
const { component, ComponentContext, PropsContext: BubblePropsContext, useComponentContext, usePropsContext: useBubblePropsContext, withContext, withProvider, useRootComponentProps } = require_create_component.createSlotComponent("bubble", require_bubble_style.bubbleStyle);
|
|
11
|
+
/**
|
|
12
|
+
* `Bubble` is a component that displays conversational content in a message bubble.
|
|
13
|
+
*
|
|
14
|
+
* @see https://yamada-ui.com/docs/components/bubble
|
|
15
|
+
*/
|
|
16
|
+
const BubbleRoot = component((props) => {
|
|
17
|
+
const [, { colorScheme, size, variant, children, items, contentProps, endGroupProps, endItemProps, groupProps, itemProps, reactionsProps, startGroupProps, startItemProps, ...rest }] = useRootComponentProps(props, "root", { transferProps: [
|
|
18
|
+
"variant",
|
|
19
|
+
"colorScheme",
|
|
20
|
+
"size"
|
|
21
|
+
] });
|
|
22
|
+
const computedChildren = (0, react.useMemo)(() => {
|
|
23
|
+
if (children) return children;
|
|
24
|
+
return items?.map((props, index) => {
|
|
25
|
+
if ("children" in props) {
|
|
26
|
+
const { children, reactions, contentProps, reactionsProps, ...rest } = props;
|
|
27
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(BubbleItem, {
|
|
28
|
+
...rest,
|
|
29
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleContent, {
|
|
30
|
+
...contentProps,
|
|
31
|
+
children
|
|
32
|
+
}), reactions ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleReactions, {
|
|
33
|
+
...reactionsProps,
|
|
34
|
+
children: reactions
|
|
35
|
+
}) : null]
|
|
36
|
+
}, index);
|
|
37
|
+
} else return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleGroup, { ...props }, index);
|
|
38
|
+
});
|
|
39
|
+
}, [children, items]);
|
|
40
|
+
const context = (0, react.useMemo)(() => ({
|
|
41
|
+
colorScheme,
|
|
42
|
+
size,
|
|
43
|
+
variant
|
|
44
|
+
}), [
|
|
45
|
+
colorScheme,
|
|
46
|
+
size,
|
|
47
|
+
variant
|
|
48
|
+
]);
|
|
49
|
+
const componentContext = (0, react.useMemo)(() => ({
|
|
50
|
+
contentProps,
|
|
51
|
+
endGroupProps,
|
|
52
|
+
endItemProps,
|
|
53
|
+
groupProps,
|
|
54
|
+
itemProps,
|
|
55
|
+
reactionsProps,
|
|
56
|
+
startGroupProps,
|
|
57
|
+
startItemProps
|
|
58
|
+
}), [
|
|
59
|
+
groupProps,
|
|
60
|
+
itemProps,
|
|
61
|
+
contentProps,
|
|
62
|
+
reactionsProps,
|
|
63
|
+
startItemProps,
|
|
64
|
+
endItemProps,
|
|
65
|
+
startGroupProps,
|
|
66
|
+
endGroupProps
|
|
67
|
+
]);
|
|
68
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubblePropsContext, {
|
|
69
|
+
value: context,
|
|
70
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComponentContext, {
|
|
71
|
+
value: componentContext,
|
|
72
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.styled.div, {
|
|
73
|
+
...rest,
|
|
74
|
+
children: computedChildren
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
}, "root")();
|
|
79
|
+
const BubbleGroup = component((props) => {
|
|
80
|
+
const [, { colorScheme, size, variant, children, direction, items, ...rest }] = useRootComponentProps(props, "group", { transferProps: [
|
|
81
|
+
"variant",
|
|
82
|
+
"colorScheme",
|
|
83
|
+
"size"
|
|
84
|
+
] });
|
|
85
|
+
const computedChildren = (0, react.useMemo)(() => {
|
|
86
|
+
if (children) return children;
|
|
87
|
+
return items?.map(({ children, reactions, contentProps, reactionsProps, ...rest }, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(BubbleItem, {
|
|
88
|
+
...rest,
|
|
89
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleContent, {
|
|
90
|
+
...contentProps,
|
|
91
|
+
children
|
|
92
|
+
}), reactions ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleReactions, {
|
|
93
|
+
...reactionsProps,
|
|
94
|
+
children: reactions
|
|
95
|
+
}) : null]
|
|
96
|
+
}, index));
|
|
97
|
+
}, [children, items]);
|
|
98
|
+
const context = (0, react.useMemo)(() => ({
|
|
99
|
+
colorScheme,
|
|
100
|
+
size,
|
|
101
|
+
variant,
|
|
102
|
+
direction
|
|
103
|
+
}), [
|
|
104
|
+
colorScheme,
|
|
105
|
+
size,
|
|
106
|
+
variant,
|
|
107
|
+
direction
|
|
108
|
+
]);
|
|
109
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubblePropsContext, {
|
|
110
|
+
value: context,
|
|
111
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.styled.div, {
|
|
112
|
+
...rest,
|
|
113
|
+
children: computedChildren
|
|
114
|
+
})
|
|
115
|
+
});
|
|
116
|
+
}, "group")(({ direction = "start", ...rest }) => {
|
|
117
|
+
const { endGroupProps, groupProps, startGroupProps } = useComponentContext();
|
|
118
|
+
return require_props.mergeProps(groupProps, direction === "start" ? startGroupProps : endGroupProps, {
|
|
119
|
+
direction,
|
|
120
|
+
...rest
|
|
121
|
+
})();
|
|
122
|
+
});
|
|
123
|
+
const BubbleItem = withProvider(({ children, direction, contentProps, ...rest }) => {
|
|
124
|
+
const [content, customContent, reactions] = require_children.useSplitChildren(children, BubbleContent, BubbleReactions);
|
|
125
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_factory.styled.div, {
|
|
126
|
+
"data-direction": direction,
|
|
127
|
+
...rest,
|
|
128
|
+
children: [customContent ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleContent, {
|
|
129
|
+
...contentProps,
|
|
130
|
+
children: content
|
|
131
|
+
}), reactions]
|
|
132
|
+
});
|
|
133
|
+
}, "item")((props) => {
|
|
134
|
+
const contextProps = useBubblePropsContext();
|
|
135
|
+
const { endItemProps, itemProps, startItemProps } = useComponentContext();
|
|
136
|
+
const direction = props.direction ?? contextProps?.direction ?? "start";
|
|
137
|
+
return require_props.mergeProps(contextProps, itemProps, direction === "start" ? startItemProps : endItemProps, {
|
|
138
|
+
...props,
|
|
139
|
+
direction
|
|
140
|
+
})();
|
|
141
|
+
});
|
|
142
|
+
const BubbleContent = withContext("div", "content")(void 0, (props) => {
|
|
143
|
+
const { contentProps } = useComponentContext();
|
|
144
|
+
return require_props.mergeProps(contentProps, props)();
|
|
145
|
+
});
|
|
146
|
+
const BubbleReactions = withContext("div", "reactions")(void 0, (props) => {
|
|
147
|
+
const { reactionsProps } = useComponentContext();
|
|
148
|
+
const { placement = "end-end", ...rest } = require_props.mergeProps(reactionsProps, props)();
|
|
149
|
+
return {
|
|
150
|
+
"data-placement": placement,
|
|
151
|
+
...rest
|
|
152
|
+
};
|
|
153
|
+
});
|
|
154
|
+
//#endregion
|
|
155
|
+
exports.BubbleContent = BubbleContent;
|
|
156
|
+
exports.BubbleGroup = BubbleGroup;
|
|
157
|
+
exports.BubbleItem = BubbleItem;
|
|
158
|
+
exports.BubblePropsContext = BubblePropsContext;
|
|
159
|
+
exports.BubbleReactions = BubbleReactions;
|
|
160
|
+
exports.BubbleRoot = BubbleRoot;
|
|
161
|
+
exports.useBubblePropsContext = useBubblePropsContext;
|
|
162
|
+
|
|
163
|
+
//# sourceMappingURL=bubble.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bubble.cjs","names":["createSlotComponent","bubbleStyle","useMemo","styled","mergeProps","useSplitChildren"],"sources":["../../../../src/components/bubble/bubble.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type {\n Direction,\n HTMLStyledProps,\n SimpleDirection,\n ThemeProps,\n} from \"../../core\"\nimport type { Merge } from \"../../utils\"\nimport type { BubbleStyle } from \"./bubble.style\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport { useSplitChildren } from \"../../utils\"\nimport { bubbleStyle } from \"./bubble.style\"\n\nexport interface BubbleItemWithContent extends Omit<\n BubbleItemProps,\n \"children\"\n> {\n children: ReactNode\n reactions?: ReactNode\n reactionsProps?: Omit<BubbleReactionsProps, \"children\">\n}\n\nexport interface BubbleItemWithGroup\n extends\n Required<Pick<BubbleGroupProps, \"items\">>,\n Omit<BubbleGroupProps, \"children\" | \"items\"> {}\n\nexport type BubbleItem =\n | BubbleItemWithContent\n | Omit<BubbleGroupProps, \"children\" | \"direction\">\n\ninterface ComponentContext extends Pick<\n BubbleRootProps,\n | \"contentProps\"\n | \"endGroupProps\"\n | \"endItemProps\"\n | \"groupProps\"\n | \"itemProps\"\n | \"reactionsProps\"\n | \"startGroupProps\"\n | \"startItemProps\"\n> {}\n\nexport interface BubbleRootProps extends Merge<\n HTMLStyledProps,\n ThemeProps<BubbleStyle>\n> {\n /**\n * If provided, generate elements based on items.\n */\n items?: BubbleItem[]\n /**\n * The props for content component.\n */\n contentProps?: Omit<BubbleContentProps, \"children\">\n /**\n * The theme props for group component in end direction.\n */\n endGroupProps?: Omit<BubbleGroupProps, \"children\" | \"direction\" | \"items\">\n /**\n * The theme props for item component in end direction.\n */\n endItemProps?: Omit<BubbleItemProps, \"children\" | \"direction\">\n /**\n * The props for group component.\n */\n groupProps?: Omit<BubbleGroupProps, \"children\" | \"direction\" | \"items\">\n /**\n * The props for item component.\n */\n itemProps?: Omit<BubbleItemProps, \"children\" | \"direction\">\n /**\n * The props for reactions component.\n */\n reactionsProps?: Omit<BubbleReactionsProps, \"children\">\n /**\n * The theme props for group component in start direction.\n */\n startGroupProps?: Omit<BubbleGroupProps, \"children\" | \"direction\" | \"items\">\n /**\n * The theme props for item component in start direction.\n */\n startItemProps?: Omit<BubbleItemProps, \"children\" | \"direction\">\n}\n\nconst {\n component,\n ComponentContext,\n PropsContext: BubblePropsContext,\n useComponentContext,\n usePropsContext: useBubblePropsContext,\n withContext,\n withProvider,\n useRootComponentProps,\n} = createSlotComponent<BubbleItemProps, BubbleStyle, ComponentContext>(\n \"bubble\",\n bubbleStyle,\n)\n\nexport { BubblePropsContext, useBubblePropsContext }\n\n/**\n * `Bubble` is a component that displays conversational content in a message bubble.\n *\n * @see https://yamada-ui.com/docs/components/bubble\n */\nexport const BubbleRoot = component<\"div\", BubbleRootProps>((props) => {\n const [\n ,\n {\n colorScheme,\n size,\n variant,\n children,\n items,\n contentProps,\n endGroupProps,\n endItemProps,\n groupProps,\n itemProps,\n reactionsProps,\n startGroupProps,\n startItemProps,\n ...rest\n },\n ] = useRootComponentProps(props, \"root\", {\n transferProps: [\"variant\", \"colorScheme\", \"size\"],\n })\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return items?.map((props, index) => {\n if (\"children\" in props) {\n const { children, reactions, contentProps, reactionsProps, ...rest } =\n props\n\n return (\n <BubbleItem key={index} {...rest}>\n <BubbleContent {...contentProps}>{children}</BubbleContent>\n {reactions ? (\n <BubbleReactions {...reactionsProps}>{reactions}</BubbleReactions>\n ) : null}\n </BubbleItem>\n )\n } else {\n return <BubbleGroup key={index} {...props} />\n }\n })\n }, [children, items])\n const context = useMemo(\n () => ({ colorScheme, size, variant }),\n [colorScheme, size, variant],\n )\n const componentContext = useMemo(\n () => ({\n contentProps,\n endGroupProps,\n endItemProps,\n groupProps,\n itemProps,\n reactionsProps,\n startGroupProps,\n startItemProps,\n }),\n [\n groupProps,\n itemProps,\n contentProps,\n reactionsProps,\n startItemProps,\n endItemProps,\n startGroupProps,\n endGroupProps,\n ],\n )\n\n return (\n <BubblePropsContext value={context}>\n <ComponentContext value={componentContext}>\n <styled.div {...rest}>{computedChildren}</styled.div>\n </ComponentContext>\n </BubblePropsContext>\n )\n}, \"root\")()\n\nexport interface BubbleGroupProps\n extends\n Merge<HTMLStyledProps, Pick<BubbleItemProps, \"direction\">>,\n ThemeProps<BubbleStyle> {\n /**\n * If provided, generate elements based on items.\n */\n items?: BubbleItemWithContent[]\n}\n\nexport const BubbleGroup = component<\"div\", BubbleGroupProps>((props) => {\n const [\n ,\n { colorScheme, size, variant, children, direction, items, ...rest },\n ] = useRootComponentProps(props, \"group\", {\n transferProps: [\"variant\", \"colorScheme\", \"size\"],\n })\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return items?.map(\n (\n { children, reactions, contentProps, reactionsProps, ...rest },\n index,\n ) => (\n <BubbleItem key={index} {...rest}>\n <BubbleContent {...contentProps}>{children}</BubbleContent>\n {reactions ? (\n <BubbleReactions {...reactionsProps}>{reactions}</BubbleReactions>\n ) : null}\n </BubbleItem>\n ),\n )\n }, [children, items])\n\n const context = useMemo(\n () => ({ colorScheme, size, variant, direction }),\n [colorScheme, size, variant, direction],\n )\n\n return (\n <BubblePropsContext value={context}>\n <styled.div {...rest}>{computedChildren}</styled.div>\n </BubblePropsContext>\n )\n}, \"group\")(({ direction = \"start\", ...rest }) => {\n const { endGroupProps, groupProps, startGroupProps } = useComponentContext()\n const directionProps = direction === \"start\" ? startGroupProps : endGroupProps\n\n return mergeProps(groupProps, directionProps, { direction, ...rest })()\n})\n\nexport interface BubbleItemProps\n extends\n Omit<HTMLStyledProps, \"direction\">,\n Pick<BubbleRootProps, \"contentProps\">,\n ThemeProps<BubbleStyle> {\n /**\n * The inline direction of the bubble.\n *\n * @default 'start'\n */\n direction?: SimpleDirection\n}\n\nexport const BubbleItem = withProvider<\"div\", BubbleItemProps>(\n ({ children, direction, contentProps, ...rest }) => {\n const [content, customContent, reactions] = useSplitChildren(\n children,\n BubbleContent,\n BubbleReactions,\n )\n\n return (\n <styled.div data-direction={direction} {...rest}>\n {customContent ?? (\n <BubbleContent {...contentProps}>{content}</BubbleContent>\n )}\n\n {reactions}\n </styled.div>\n )\n },\n \"item\",\n)((props) => {\n const contextProps = useBubblePropsContext()\n const { endItemProps, itemProps, startItemProps } = useComponentContext()\n const direction = props.direction ?? contextProps?.direction ?? \"start\"\n const directionProps = direction === \"start\" ? startItemProps : endItemProps\n\n return mergeProps(contextProps, itemProps, directionProps, {\n ...props,\n direction,\n })()\n})\n\nexport interface BubbleContentProps extends HTMLStyledProps {}\n\nexport const BubbleContent = withContext<\"div\", BubbleContentProps>(\n \"div\",\n \"content\",\n)(undefined, (props) => {\n const { contentProps } = useComponentContext()\n\n return mergeProps(contentProps, props)()\n})\n\nexport interface BubbleReactionsProps extends HTMLStyledProps {\n /**\n * The placement of the reactions.\n *\n * @default 'end-end'\n */\n placement?: Exclude<Direction, \"end\" | \"start\" | `center-${string}`>\n}\n\nexport const BubbleReactions = withContext<\"div\", BubbleReactionsProps>(\n \"div\",\n \"reactions\",\n)(undefined, (props) => {\n const { reactionsProps } = useComponentContext()\n const { placement = \"end-end\", ...rest } = mergeProps(reactionsProps, props)()\n\n return { \"data-placement\": placement, ...rest }\n})\n"],"mappings":";;;;;;;;;AAwFA,MAAM,EACJ,WACA,kBACA,cAAc,oBACd,qBACA,iBAAiB,uBACjB,aACA,cACA,0BACEA,yBAAAA,oBACF,UACAC,qBAAAA,WACF;;;;;;AASA,MAAa,aAAa,WAAmC,UAAU;CACrE,MAAM,GAEJ,EACE,aACA,MACA,SACA,UACA,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ClD,MAAM,CAAC,SAAS,eAAe,aAAaC,iBAAAA,iBAC1C,UACA,eACA,eACF;CAEA,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACF,gBAAAA,OAAO,KAAR;EAAY,kBAAgB;EAAW,GAAI;EAA3C,UAAA,CACG,iBACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,eAAD;GAAe,GAAI;GAAe,UAAA;EAAuB,CAAA,GAG1D,SACS;;AAEhB,GACA,MACF,CAAC,EAAE,UAAU;CACX,MAAM,eAAe,sBAAsB;CAC3C,MAAM,EAAE,cAAc,WAAW,mBAAmB,oBAAoB;CACxE,MAAM,YAAY,MAAM,aAAa,cAAc,aAAa;CAGhE,OAAOC,cAAAA,WAAW,cAAc,WAFT,cAAc,UAAU,iBAAiB,cAEL;EACzD,GAAG;EACH;CACF,CAAC,CAAC,CAAC;AACL,CAAC;AAID,MAAa,gBAAgB,YAC3B,OACA,SACF,CAAC,CAAC,KAAA,IAAY,UAAU;CACtB,MAAM,EAAE,iBAAiB,oBAAoB;CAE7C,OAAOA,cAAAA,WAAW,cAAc,KAAK,CAAC,CAAC;AACzC,CAAC;AAWD,MAAa,kBAAkB,YAC7B,OACA,WACF,CAAC,CAAC,KAAA,IAAY,UAAU;CACtB,MAAM,EAAE,mBAAmB,oBAAoB;CAC/C,MAAM,EAAE,YAAY,WAAW,GAAG,SAASA,cAAAA,WAAW,gBAAgB,KAAK,CAAC,CAAC;CAE7E,OAAO;EAAE,kBAAkB;EAAW,GAAG;CAAK;AAChD,CAAC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
//#region src/components/bubble/bubble.style.ts
|
|
2
|
+
const bubbleStyle = require("../../core/system/config.cjs").defineComponentSlotStyle({
|
|
3
|
+
base: {
|
|
4
|
+
content: {
|
|
5
|
+
maxW: "full",
|
|
6
|
+
minW: "0",
|
|
7
|
+
overflowWrap: "anywhere",
|
|
8
|
+
py: "{space-y}",
|
|
9
|
+
rounded: "calc(0.5lh + {space-y} + 1px)",
|
|
10
|
+
textAlign: "start",
|
|
11
|
+
whiteSpace: "pre-wrap"
|
|
12
|
+
},
|
|
13
|
+
group: {
|
|
14
|
+
display: "flex",
|
|
15
|
+
flexDirection: "column",
|
|
16
|
+
gap: "sm",
|
|
17
|
+
minW: "0",
|
|
18
|
+
w: "full"
|
|
19
|
+
},
|
|
20
|
+
item: {
|
|
21
|
+
display: "flex",
|
|
22
|
+
flexDirection: "column",
|
|
23
|
+
maxW: "4/5",
|
|
24
|
+
minW: "0",
|
|
25
|
+
position: "relative",
|
|
26
|
+
w: "fit-content",
|
|
27
|
+
_end: {
|
|
28
|
+
alignSelf: "flex-end",
|
|
29
|
+
me: "0",
|
|
30
|
+
ms: "auto"
|
|
31
|
+
},
|
|
32
|
+
_start: {
|
|
33
|
+
alignSelf: "flex-start",
|
|
34
|
+
me: "auto",
|
|
35
|
+
ms: "0"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
reactions: {
|
|
39
|
+
"&[data-placement$=center]": {
|
|
40
|
+
insetInline: "0",
|
|
41
|
+
mx: "auto"
|
|
42
|
+
},
|
|
43
|
+
"&[data-placement$=end]": { insetInlineEnd: "3" },
|
|
44
|
+
"&[data-placement$=start]": { insetInlineStart: "3" },
|
|
45
|
+
"&[data-placement^=end]": {
|
|
46
|
+
insetBlockEnd: "-2",
|
|
47
|
+
translateY: "50%"
|
|
48
|
+
},
|
|
49
|
+
"&[data-placement^=start]": {
|
|
50
|
+
insetBlockStart: "-2",
|
|
51
|
+
translateY: "-50%"
|
|
52
|
+
},
|
|
53
|
+
alignItems: "center",
|
|
54
|
+
bg: "bg.panel",
|
|
55
|
+
borderColor: "bg",
|
|
56
|
+
display: "flex",
|
|
57
|
+
gap: "xs",
|
|
58
|
+
lineHeight: "normal",
|
|
59
|
+
position: "absolute",
|
|
60
|
+
px: "1.5",
|
|
61
|
+
py: "0.5",
|
|
62
|
+
rounded: "full",
|
|
63
|
+
w: "max-content",
|
|
64
|
+
zIndex: "1"
|
|
65
|
+
},
|
|
66
|
+
root: {
|
|
67
|
+
alignItems: "flex-start",
|
|
68
|
+
display: "flex",
|
|
69
|
+
flexDirection: "column",
|
|
70
|
+
gap: "xl",
|
|
71
|
+
minW: "0",
|
|
72
|
+
w: "full"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
variants: {
|
|
76
|
+
ghost: {
|
|
77
|
+
content: {
|
|
78
|
+
bg: "transparent",
|
|
79
|
+
borderColor: "transparent",
|
|
80
|
+
rounded: "0"
|
|
81
|
+
},
|
|
82
|
+
item: {
|
|
83
|
+
maxW: "full",
|
|
84
|
+
w: "full"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
outline: { content: { layerStyle: "outline" } },
|
|
88
|
+
panel: { content: { bg: "bg.panel" } },
|
|
89
|
+
solid: { content: { layerStyle: "solid" } },
|
|
90
|
+
subtle: { content: { layerStyle: "subtle" } },
|
|
91
|
+
surface: { content: { layerStyle: "surface" } }
|
|
92
|
+
},
|
|
93
|
+
sizes: {
|
|
94
|
+
sm: {
|
|
95
|
+
content: {
|
|
96
|
+
"--space-y": "spaces.2",
|
|
97
|
+
fontSize: "sm",
|
|
98
|
+
px: "3"
|
|
99
|
+
},
|
|
100
|
+
reactions: {
|
|
101
|
+
borderWidth: "3px",
|
|
102
|
+
fontSize: "xs"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
md: {
|
|
106
|
+
content: {
|
|
107
|
+
"--space-y": "spaces.3",
|
|
108
|
+
fontSize: "md",
|
|
109
|
+
px: "4"
|
|
110
|
+
},
|
|
111
|
+
reactions: {
|
|
112
|
+
borderWidth: "5px",
|
|
113
|
+
fontSize: "sm"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
lg: {
|
|
117
|
+
content: {
|
|
118
|
+
"--space-y": "spaces.4",
|
|
119
|
+
fontSize: "lg",
|
|
120
|
+
px: "5"
|
|
121
|
+
},
|
|
122
|
+
reactions: {
|
|
123
|
+
borderWidth: "5px",
|
|
124
|
+
fontSize: "md"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
compounds: [{
|
|
129
|
+
css: { content: {
|
|
130
|
+
px: "0",
|
|
131
|
+
py: "0"
|
|
132
|
+
} },
|
|
133
|
+
variant: "ghost"
|
|
134
|
+
}],
|
|
135
|
+
defaultProps: {
|
|
136
|
+
size: "md",
|
|
137
|
+
variant: "panel"
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
//#endregion
|
|
141
|
+
exports.bubbleStyle = bubbleStyle;
|
|
142
|
+
|
|
143
|
+
//# sourceMappingURL=bubble.style.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bubble.style.cjs","names":["defineComponentSlotStyle"],"sources":["../../../../src/components/bubble/bubble.style.ts"],"sourcesContent":["import { defineComponentSlotStyle } from \"../../core\"\n\nexport const bubbleStyle = defineComponentSlotStyle({\n base: {\n content: {\n maxW: \"full\",\n minW: \"0\",\n overflowWrap: \"anywhere\",\n py: \"{space-y}\",\n rounded: \"calc(0.5lh + {space-y} + 1px)\",\n textAlign: \"start\",\n whiteSpace: \"pre-wrap\",\n },\n group: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"sm\",\n minW: \"0\",\n w: \"full\",\n },\n item: {\n display: \"flex\",\n flexDirection: \"column\",\n maxW: \"4/5\",\n minW: \"0\",\n position: \"relative\",\n w: \"fit-content\",\n _end: {\n alignSelf: \"flex-end\",\n me: \"0\",\n ms: \"auto\",\n },\n _start: {\n alignSelf: \"flex-start\",\n me: \"auto\",\n ms: \"0\",\n },\n },\n reactions: {\n \"&[data-placement$=center]\": {\n insetInline: \"0\",\n mx: \"auto\",\n },\n \"&[data-placement$=end]\": {\n insetInlineEnd: \"3\",\n },\n \"&[data-placement$=start]\": {\n insetInlineStart: \"3\",\n },\n \"&[data-placement^=end]\": {\n insetBlockEnd: \"-2\",\n translateY: \"50%\",\n },\n \"&[data-placement^=start]\": {\n insetBlockStart: \"-2\",\n translateY: \"-50%\",\n },\n alignItems: \"center\",\n bg: \"bg.panel\",\n borderColor: \"bg\",\n display: \"flex\",\n gap: \"xs\",\n lineHeight: \"normal\",\n position: \"absolute\",\n px: \"1.5\",\n py: \"0.5\",\n rounded: \"full\",\n w: \"max-content\",\n zIndex: \"1\",\n },\n root: {\n alignItems: \"flex-start\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"xl\",\n minW: \"0\",\n w: \"full\",\n },\n },\n\n variants: {\n ghost: {\n content: {\n bg: \"transparent\",\n borderColor: \"transparent\",\n rounded: \"0\",\n },\n item: { maxW: \"full\", w: \"full\" },\n },\n outline: { content: { layerStyle: \"outline\" } },\n panel: { content: { bg: \"bg.panel\" } },\n solid: { content: { layerStyle: \"solid\" } },\n subtle: { content: { layerStyle: \"subtle\" } },\n surface: { content: { layerStyle: \"surface\" } },\n },\n\n sizes: {\n sm: {\n content: { \"--space-y\": \"spaces.2\", fontSize: \"sm\", px: \"3\" },\n reactions: { borderWidth: \"3px\", fontSize: \"xs\" },\n },\n md: {\n content: { \"--space-y\": \"spaces.3\", fontSize: \"md\", px: \"4\" },\n reactions: { borderWidth: \"5px\", fontSize: \"sm\" },\n },\n lg: {\n content: { \"--space-y\": \"spaces.4\", fontSize: \"lg\", px: \"5\" },\n reactions: { borderWidth: \"5px\", fontSize: \"md\" },\n },\n },\n\n compounds: [\n {\n css: { content: { px: \"0\", py: \"0\" } },\n variant: \"ghost\",\n },\n ],\n\n defaultProps: {\n size: \"md\",\n variant: \"panel\",\n },\n})\n\nexport type BubbleStyle = typeof bubbleStyle\n"],"mappings":";AAEA,MAAa,oDAAcA,CAAAA,CAAAA,yBAAyB;CAClD,MAAM;EACJ,SAAS;GACP,MAAM;GACN,MAAM;GACN,cAAc;GACd,IAAI;GACJ,SAAS;GACT,WAAW;GACX,YAAY;EACd;EACA,OAAO;GACL,SAAS;GACT,eAAe;GACf,KAAK;GACL,MAAM;GACN,GAAG;EACL;EACA,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AAI;GACF,SAAS;IAAE,aAAa;IAAY,UAAU;IAAM,IAAI;GAAI;GAC5D,WAAW;IAAE,aAAa;IAAO,UAAU;GAAK;EAClD;CACF;CAEA,WAAW,CACT;EACE,KAAK,EAAE,SAAS;GAAE,IAAI;GAAK,IAAI;EAAI,EAAE;EACrC,SAAS;CACX,CACF;CAEA,cAAc;EACZ,MAAM;EACN,SAAS;CACX;AACF,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_bubble_style = require("./bubble.style.cjs");
|
|
3
|
+
const require_bubble = require("./bubble.cjs");
|
|
4
|
+
const require_namespace = require("./namespace.cjs");
|
|
5
|
+
Object.defineProperty(exports, "Bubble", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return require_namespace.namespace_exports;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
exports.BubbleContent = require_bubble.BubbleContent;
|
|
12
|
+
exports.BubbleGroup = require_bubble.BubbleGroup;
|
|
13
|
+
exports.BubbleItem = require_bubble.BubbleItem;
|
|
14
|
+
exports.BubblePropsContext = require_bubble.BubblePropsContext;
|
|
15
|
+
exports.BubbleReactions = require_bubble.BubbleReactions;
|
|
16
|
+
exports.BubbleRoot = require_bubble.BubbleRoot;
|
|
17
|
+
exports.bubbleStyle = require_bubble_style.bubbleStyle;
|
|
18
|
+
exports.useBubblePropsContext = require_bubble.useBubblePropsContext;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_bubble = require("./bubble.cjs");
|
|
3
|
+
//#region src/components/bubble/namespace.ts
|
|
4
|
+
var namespace_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
5
|
+
Content: () => require_bubble.BubbleContent,
|
|
6
|
+
Group: () => require_bubble.BubbleGroup,
|
|
7
|
+
Item: () => require_bubble.BubbleItem,
|
|
8
|
+
PropsContext: () => require_bubble.BubblePropsContext,
|
|
9
|
+
Reactions: () => require_bubble.BubbleReactions,
|
|
10
|
+
Root: () => require_bubble.BubbleRoot,
|
|
11
|
+
usePropsContext: () => require_bubble.useBubblePropsContext
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
exports.Content = require_bubble.BubbleContent;
|
|
15
|
+
exports.Group = require_bubble.BubbleGroup;
|
|
16
|
+
exports.Item = require_bubble.BubbleItem;
|
|
17
|
+
exports.PropsContext = require_bubble.BubblePropsContext;
|
|
18
|
+
exports.Reactions = require_bubble.BubbleReactions;
|
|
19
|
+
exports.Root = require_bubble.BubbleRoot;
|
|
20
|
+
Object.defineProperty(exports, "namespace_exports", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function() {
|
|
23
|
+
return namespace_exports;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
exports.usePropsContext = require_bubble.useBubblePropsContext;
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=namespace.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace.cjs","names":[],"sources":["../../../../src/components/bubble/namespace.ts"],"sourcesContent":["export type {\n BubbleContentProps as ContentProps,\n BubbleGroupProps as GroupProps,\n BubbleItemProps as ItemProps,\n BubbleItem as ItemType,\n BubbleReactionsProps as ReactionsProps,\n BubbleRootProps as RootProps,\n} from \"./bubble\"\nexport {\n BubbleContent as Content,\n BubbleGroup as Group,\n BubbleItem as Item,\n BubblePropsContext as PropsContext,\n BubbleReactions as Reactions,\n BubbleRoot as Root,\n useBubblePropsContext as usePropsContext,\n} from \"./bubble\"\n"],"mappings":""}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
const require_children = require("../../utils/children.cjs");
|
|
2
3
|
const require_ref = require("../../utils/ref.cjs");
|
|
3
4
|
const require_utils_index = require("../../utils/index.cjs");
|
|
4
5
|
const require_factory = require("../../core/system/factory.cjs");
|
|
@@ -92,18 +93,19 @@ const ButtonContent = component(({ children }) => {
|
|
|
92
93
|
const ButtonLoading = component((props) => {
|
|
93
94
|
const { loadingIcon, loadingMessage } = useComponentContext();
|
|
94
95
|
const css = (0, react.useMemo)(() => ({ position: loadingMessage ? "relative" : "absolute" }), [loadingMessage]);
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
const child = require_children.getResolvedChild(loadingIcon);
|
|
97
|
+
if (require_use_loading_component.isLoadingScheme(child)) {
|
|
98
|
+
const Component = require_use_loading_component.getLoadingComponent(child);
|
|
97
99
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
|
|
98
100
|
color: "currentColor",
|
|
99
101
|
...props,
|
|
100
102
|
css: require_merge_css.mergeCSS(css, props.css)
|
|
101
103
|
});
|
|
102
104
|
}
|
|
103
|
-
if ((0, react.isValidElement)(
|
|
105
|
+
if ((0, react.isValidElement)(child)) return (0, react.cloneElement)(child, {
|
|
104
106
|
...props,
|
|
105
|
-
...
|
|
106
|
-
css: require_merge_css.mergeCSS(css, props.css,
|
|
107
|
+
...child.props,
|
|
108
|
+
css: require_merge_css.mergeCSS(css, props.css, child.props.css)
|
|
107
109
|
});
|
|
108
110
|
return null;
|
|
109
111
|
}, {
|
|
@@ -119,13 +121,14 @@ const ButtonEndLoading = component(ButtonLoading, {
|
|
|
119
121
|
className: require_utils.getClassName((0, require_utils_index.utils_exports.bem)("button", "loading", "end"))
|
|
120
122
|
})();
|
|
121
123
|
const ButtonIcon = component(({ children, ...rest }) => {
|
|
122
|
-
|
|
124
|
+
const child = require_children.getResolvedChild(children);
|
|
125
|
+
if ((0, react.isValidElement)(child)) return (0, react.cloneElement)(child, {
|
|
123
126
|
"aria-hidden": true,
|
|
124
127
|
role: "img",
|
|
125
128
|
...rest,
|
|
126
|
-
...
|
|
129
|
+
...child.props
|
|
127
130
|
});
|
|
128
|
-
return react.Children.count(
|
|
131
|
+
return react.Children.count(child) > 1 ? react.Children.only(null) : null;
|
|
129
132
|
}, {
|
|
130
133
|
name: "ButtonIcon",
|
|
131
134
|
className: require_utils.getClassName((0, require_utils_index.utils_exports.bem)("button", "icon"))
|