@yamada-ui/react 2.2.6 → 2.2.7-dev-20260804111744
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/_virtual/_rolldown/runtime.cjs +1 -1
- package/dist/cjs/components/accordion/accordion.cjs +4 -2
- package/dist/cjs/components/accordion/accordion.cjs.map +1 -1
- package/dist/cjs/components/accordion/use-accordion.cjs +1 -0
- package/dist/cjs/components/accordion/use-accordion.cjs.map +1 -1
- package/dist/cjs/components/action-bar/action-bar.cjs +1 -0
- package/dist/cjs/components/action-bar/action-bar.cjs.map +1 -1
- package/dist/cjs/components/action-bar/use-action-bar.cjs +1 -0
- package/dist/cjs/components/action-bar/use-action-bar.cjs.map +1 -1
- package/dist/cjs/components/airy/airy.cjs +1 -0
- package/dist/cjs/components/airy/airy.cjs.map +1 -1
- package/dist/cjs/components/alert/alert.cjs +5 -2
- package/dist/cjs/components/alert/alert.cjs.map +1 -1
- package/dist/cjs/components/alpha-slider/alpha-slider.cjs +1 -0
- package/dist/cjs/components/alpha-slider/alpha-slider.cjs.map +1 -1
- package/dist/cjs/components/aspect-ratio/aspect-ratio.cjs +1 -0
- package/dist/cjs/components/aspect-ratio/aspect-ratio.cjs.map +1 -1
- package/dist/cjs/components/autocomplete/autocomplete.cjs +14 -10
- package/dist/cjs/components/autocomplete/autocomplete.cjs.map +1 -1
- package/dist/cjs/components/autocomplete/use-autocomplete.cjs +1 -0
- package/dist/cjs/components/autocomplete/use-autocomplete.cjs.map +1 -1
- package/dist/cjs/components/avatar/avatar-group.cjs +13 -11
- package/dist/cjs/components/avatar/avatar-group.cjs.map +1 -1
- package/dist/cjs/components/avatar/use-avatar-group.cjs +1 -0
- package/dist/cjs/components/avatar/use-avatar-group.cjs.map +1 -1
- package/dist/cjs/components/avatar/use-avatar.cjs +1 -0
- package/dist/cjs/components/avatar/use-avatar.cjs.map +1 -1
- package/dist/cjs/components/blockquote/blockquote.cjs +1 -0
- package/dist/cjs/components/blockquote/blockquote.cjs.map +1 -1
- package/dist/cjs/components/breadcrumb/breadcrumb.cjs +1 -0
- package/dist/cjs/components/breadcrumb/breadcrumb.cjs.map +1 -1
- package/dist/cjs/components/breadcrumb/use-breadcrumb.cjs +1 -0
- package/dist/cjs/components/breadcrumb/use-breadcrumb.cjs.map +1 -1
- package/dist/cjs/components/button/button-group.cjs +1 -0
- package/dist/cjs/components/button/button-group.cjs.map +1 -1
- package/dist/cjs/components/button/button.cjs +9 -5
- package/dist/cjs/components/button/button.cjs.map +1 -1
- package/dist/cjs/components/calendar/calendar.cjs +1 -0
- package/dist/cjs/components/calendar/calendar.cjs.map +1 -1
- package/dist/cjs/components/calendar/use-calendar.cjs.map +1 -1
- package/dist/cjs/components/carousel/carousel.cjs +27 -25
- package/dist/cjs/components/carousel/carousel.cjs.map +1 -1
- package/dist/cjs/components/carousel/use-carousel.cjs.map +1 -1
- package/dist/cjs/components/chart/area-chart.cjs +6 -4
- package/dist/cjs/components/chart/area-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/bar-chart.cjs +6 -4
- package/dist/cjs/components/chart/bar-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/cartesian-chart.cjs +146 -139
- package/dist/cjs/components/chart/cartesian-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/chart.cjs +3 -1
- package/dist/cjs/components/chart/chart.cjs.map +1 -1
- package/dist/cjs/components/chart/composed-chart.cjs +16 -14
- package/dist/cjs/components/chart/composed-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/donut-chart.cjs +8 -5
- package/dist/cjs/components/chart/donut-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/line-chart.cjs +6 -4
- package/dist/cjs/components/chart/line-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/pie-chart.cjs +8 -5
- package/dist/cjs/components/chart/pie-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/polar-chart.cjs +119 -111
- package/dist/cjs/components/chart/polar-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/radar-chart.cjs +6 -4
- package/dist/cjs/components/chart/radar-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/radial-chart.cjs +1 -0
- package/dist/cjs/components/chart/radial-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/use-cartesian-chart.cjs +1 -0
- package/dist/cjs/components/chart/use-cartesian-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/use-chart.cjs +1 -0
- package/dist/cjs/components/chart/use-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/use-polar-chart.cjs +1 -0
- package/dist/cjs/components/chart/use-polar-chart.cjs.map +1 -1
- package/dist/cjs/components/checkbox/checkbox-group.cjs +39 -36
- package/dist/cjs/components/checkbox/checkbox-group.cjs.map +1 -1
- package/dist/cjs/components/checkbox/checkbox.cjs +1 -0
- package/dist/cjs/components/checkbox/checkbox.cjs.map +1 -1
- package/dist/cjs/components/checkbox/use-checkbox-group.cjs +1 -0
- package/dist/cjs/components/checkbox/use-checkbox-group.cjs.map +1 -1
- package/dist/cjs/components/checkbox/use-checkbox.cjs +3 -1
- package/dist/cjs/components/checkbox/use-checkbox.cjs.map +1 -1
- package/dist/cjs/components/checkbox-card/checkbox-card-group.cjs +43 -40
- package/dist/cjs/components/checkbox-card/checkbox-card-group.cjs.map +1 -1
- package/dist/cjs/components/checkbox-card/checkbox-card.cjs +1 -0
- package/dist/cjs/components/checkbox-card/checkbox-card.cjs.map +1 -1
- package/dist/cjs/components/circle-progress/circle-progress.cjs.map +1 -1
- package/dist/cjs/components/client-only/client-only.cjs +2 -1
- package/dist/cjs/components/client-only/client-only.cjs.map +1 -1
- package/dist/cjs/components/collapse/collapse.cjs +1 -0
- package/dist/cjs/components/collapse/collapse.cjs.map +1 -1
- package/dist/cjs/components/color-picker/color-picker.cjs +3 -1
- package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
- package/dist/cjs/components/color-picker/use-color-picker.cjs +1 -0
- package/dist/cjs/components/color-picker/use-color-picker.cjs.map +1 -1
- package/dist/cjs/components/color-selector/color-selector.cjs +3 -1
- package/dist/cjs/components/color-selector/color-selector.cjs.map +1 -1
- package/dist/cjs/components/color-selector/use-color-selector.cjs +1 -0
- package/dist/cjs/components/color-selector/use-color-selector.cjs.map +1 -1
- package/dist/cjs/components/color-swatch/color-swatch.cjs.map +1 -1
- package/dist/cjs/components/data-list/data-list.cjs +9 -5
- package/dist/cjs/components/data-list/data-list.cjs.map +1 -1
- package/dist/cjs/components/date-picker/date-picker.cjs +3 -1
- package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
- package/dist/cjs/components/date-picker/use-date-picker.cjs.map +1 -1
- package/dist/cjs/components/drawer/drawer.cjs +1 -0
- package/dist/cjs/components/drawer/drawer.cjs.map +1 -1
- package/dist/cjs/components/drawer/use-drawer.cjs +2 -3
- package/dist/cjs/components/drawer/use-drawer.cjs.map +1 -1
- package/dist/cjs/components/dropzone/dropzone.cjs +3 -1
- package/dist/cjs/components/dropzone/dropzone.cjs.map +1 -1
- package/dist/cjs/components/dropzone/use-dropzone.cjs +1 -0
- package/dist/cjs/components/dropzone/use-dropzone.cjs.map +1 -1
- package/dist/cjs/components/editable/editable.cjs.map +1 -1
- package/dist/cjs/components/editable/use-editable.cjs +1 -0
- package/dist/cjs/components/editable/use-editable.cjs.map +1 -1
- package/dist/cjs/components/fade/fade.cjs +1 -0
- package/dist/cjs/components/fade/fade.cjs.map +1 -1
- package/dist/cjs/components/fade-scale/fade-scale.cjs +1 -0
- package/dist/cjs/components/fade-scale/fade-scale.cjs.map +1 -1
- package/dist/cjs/components/field/field.cjs +1 -0
- package/dist/cjs/components/field/field.cjs.map +1 -1
- package/dist/cjs/components/field/use-field-props.cjs +1 -0
- package/dist/cjs/components/field/use-field-props.cjs.map +1 -1
- package/dist/cjs/components/fieldset/fieldset.cjs +1 -0
- package/dist/cjs/components/fieldset/fieldset.cjs.map +1 -1
- package/dist/cjs/components/file-button/use-file-button.cjs +1 -0
- package/dist/cjs/components/file-button/use-file-button.cjs.map +1 -1
- package/dist/cjs/components/file-input/file-input.cjs +3 -1
- package/dist/cjs/components/file-input/file-input.cjs.map +1 -1
- package/dist/cjs/components/file-input/use-file-input.cjs +1 -0
- package/dist/cjs/components/file-input/use-file-input.cjs.map +1 -1
- package/dist/cjs/components/flip/flip.cjs +1 -0
- package/dist/cjs/components/flip/flip.cjs.map +1 -1
- package/dist/cjs/components/float/float.cjs.map +1 -1
- package/dist/cjs/components/focus-lock/focus-lock.cjs.map +1 -1
- package/dist/cjs/components/for/for.cjs.map +1 -1
- package/dist/cjs/components/form/form.cjs +1 -0
- package/dist/cjs/components/form/form.cjs.map +1 -1
- package/dist/cjs/components/format/use-format-byte.cjs +1 -0
- package/dist/cjs/components/format/use-format-byte.cjs.map +1 -1
- package/dist/cjs/components/format/use-format-date-time.cjs +1 -0
- package/dist/cjs/components/format/use-format-date-time.cjs.map +1 -1
- package/dist/cjs/components/format/use-format-number.cjs +1 -0
- package/dist/cjs/components/format/use-format-number.cjs.map +1 -1
- package/dist/cjs/components/grid/grid-item.cjs.map +1 -1
- package/dist/cjs/components/group/group.cjs.map +1 -1
- package/dist/cjs/components/group/use-group.cjs +1 -0
- package/dist/cjs/components/group/use-group.cjs.map +1 -1
- package/dist/cjs/components/highlight/highlight.cjs +1 -0
- package/dist/cjs/components/highlight/highlight.cjs.map +1 -1
- package/dist/cjs/components/highlight/use-highlight.cjs +1 -0
- package/dist/cjs/components/highlight/use-highlight.cjs.map +1 -1
- package/dist/cjs/components/hue-slider/hue-slider.cjs +1 -0
- package/dist/cjs/components/hue-slider/hue-slider.cjs.map +1 -1
- package/dist/cjs/components/icon/icons/index.cjs +30 -6
- package/dist/cjs/components/icon/icons/index.cjs.map +1 -1
- package/dist/cjs/components/icon/icons/layout-freeform-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/layout-freeform-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/mic-audio-lines-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/mic-audio-lines-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/mic-signal-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/mic-signal-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/mosque-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/mosque-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/rotate-ccw-clock-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/rotate-ccw-clock-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/rotate-cw-fading-clock-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/rotate-cw-fading-clock-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/scan-square-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/scan-square-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/shield-keyhole-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/shield-keyhole-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/square-off-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/square-off-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/user-shield-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/user-shield-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/index.cjs +20 -4
- package/dist/cjs/components/indicator/indicator.cjs +1 -0
- package/dist/cjs/components/indicator/indicator.cjs.map +1 -1
- package/dist/cjs/components/infinite-scroll-area/infinite-scroll-area.cjs +3 -1
- package/dist/cjs/components/infinite-scroll-area/infinite-scroll-area.cjs.map +1 -1
- package/dist/cjs/components/infinite-scroll-area/use-infinite-scroll.cjs +1 -0
- package/dist/cjs/components/infinite-scroll-area/use-infinite-scroll.cjs.map +1 -1
- package/dist/cjs/components/input/input-group.cjs +14 -12
- package/dist/cjs/components/input/input-group.cjs.map +1 -1
- package/dist/cjs/components/input/input.style.cjs.map +1 -1
- package/dist/cjs/components/input/use-input-border.cjs +1 -0
- package/dist/cjs/components/input/use-input-border.cjs.map +1 -1
- package/dist/cjs/components/link-box/link-box.cjs.map +1 -1
- package/dist/cjs/components/list/list.cjs +1 -0
- package/dist/cjs/components/list/list.cjs.map +1 -1
- package/dist/cjs/components/loading/audio.cjs.map +1 -1
- package/dist/cjs/components/loading/background.cjs +1 -0
- package/dist/cjs/components/loading/background.cjs.map +1 -1
- package/dist/cjs/components/loading/circles.cjs.map +1 -1
- package/dist/cjs/components/loading/dots.cjs.map +1 -1
- package/dist/cjs/components/loading/grid.cjs.map +1 -1
- package/dist/cjs/components/loading/loading-provider.cjs +1 -0
- package/dist/cjs/components/loading/loading-provider.cjs.map +1 -1
- package/dist/cjs/components/loading/oval.cjs.map +1 -1
- package/dist/cjs/components/loading/page.cjs +1 -0
- package/dist/cjs/components/loading/page.cjs.map +1 -1
- package/dist/cjs/components/loading/puff.cjs.map +1 -1
- package/dist/cjs/components/loading/rings.cjs.map +1 -1
- package/dist/cjs/components/loading/screen.cjs +1 -0
- package/dist/cjs/components/loading/screen.cjs.map +1 -1
- package/dist/cjs/components/loading/suspense.cjs +1 -0
- package/dist/cjs/components/loading/suspense.cjs.map +1 -1
- package/dist/cjs/components/loading/use-loading-component.cjs +1 -0
- package/dist/cjs/components/loading/use-loading-component.cjs.map +1 -1
- package/dist/cjs/components/menu/menu.cjs +13 -10
- package/dist/cjs/components/menu/menu.cjs.map +1 -1
- package/dist/cjs/components/menu/use-menu.cjs +1 -0
- package/dist/cjs/components/menu/use-menu.cjs.map +1 -1
- package/dist/cjs/components/modal/modal.cjs +1 -0
- package/dist/cjs/components/modal/modal.cjs.map +1 -1
- package/dist/cjs/components/modal/use-modal.cjs +1 -0
- package/dist/cjs/components/modal/use-modal.cjs.map +1 -1
- package/dist/cjs/components/motion/motion.cjs +1 -0
- package/dist/cjs/components/motion/motion.cjs.map +1 -1
- package/dist/cjs/components/motion/transition.cjs.map +1 -1
- package/dist/cjs/components/native-accordion/native-accordion.cjs +1 -0
- package/dist/cjs/components/native-accordion/native-accordion.cjs.map +1 -1
- package/dist/cjs/components/native-accordion/use-native-accordion.cjs +1 -0
- package/dist/cjs/components/native-accordion/use-native-accordion.cjs.map +1 -1
- package/dist/cjs/components/native-popover/native-popover.cjs +1 -0
- package/dist/cjs/components/native-popover/native-popover.cjs.map +1 -1
- package/dist/cjs/components/native-popover/use-native-popover.cjs +1 -0
- package/dist/cjs/components/native-popover/use-native-popover.cjs.map +1 -1
- package/dist/cjs/components/native-select/native-select.cjs +2 -1
- package/dist/cjs/components/native-select/native-select.cjs.map +1 -1
- package/dist/cjs/components/native-select/use-native-select.cjs +1 -0
- package/dist/cjs/components/native-select/use-native-select.cjs.map +1 -1
- package/dist/cjs/components/notice/notice-provider.cjs +1 -0
- package/dist/cjs/components/notice/notice-provider.cjs.map +1 -1
- package/dist/cjs/components/notice/notice.cjs +1 -0
- package/dist/cjs/components/notice/notice.cjs.map +1 -1
- package/dist/cjs/components/notice/use-notice.cjs +1 -0
- package/dist/cjs/components/notice/use-notice.cjs.map +1 -1
- package/dist/cjs/components/number-input/number-input.cjs +2 -1
- package/dist/cjs/components/number-input/number-input.cjs.map +1 -1
- package/dist/cjs/components/number-input/use-number-counter.cjs +1 -0
- package/dist/cjs/components/number-input/use-number-counter.cjs.map +1 -1
- package/dist/cjs/components/number-input/use-number-input.cjs +1 -0
- package/dist/cjs/components/number-input/use-number-input.cjs.map +1 -1
- package/dist/cjs/components/number-input/use-spinner.cjs +1 -0
- package/dist/cjs/components/number-input/use-spinner.cjs.map +1 -1
- package/dist/cjs/components/pagination/pagination.cjs +1 -0
- package/dist/cjs/components/pagination/pagination.cjs.map +1 -1
- package/dist/cjs/components/pagination/use-pagination.cjs +1 -0
- package/dist/cjs/components/pagination/use-pagination.cjs.map +1 -1
- package/dist/cjs/components/password-input/password-input.cjs +2 -1
- package/dist/cjs/components/password-input/password-input.cjs.map +1 -1
- package/dist/cjs/components/password-input/use-password-input.cjs +1 -0
- package/dist/cjs/components/password-input/use-password-input.cjs.map +1 -1
- package/dist/cjs/components/password-input/use-strength-meter.cjs +1 -0
- package/dist/cjs/components/password-input/use-strength-meter.cjs.map +1 -1
- package/dist/cjs/components/picture/picture.cjs +1 -0
- package/dist/cjs/components/picture/picture.cjs.map +1 -1
- package/dist/cjs/components/pin-input/pin-input.cjs +1 -0
- package/dist/cjs/components/pin-input/pin-input.cjs.map +1 -1
- package/dist/cjs/components/pin-input/use-pin-input.cjs +1 -0
- package/dist/cjs/components/pin-input/use-pin-input.cjs.map +1 -1
- package/dist/cjs/components/popover/popover.cjs +1 -0
- package/dist/cjs/components/popover/popover.cjs.map +1 -1
- package/dist/cjs/components/popover/use-popover.cjs +1 -0
- package/dist/cjs/components/popover/use-popover.cjs.map +1 -1
- package/dist/cjs/components/portal/portal.cjs +1 -0
- package/dist/cjs/components/portal/portal.cjs.map +1 -1
- package/dist/cjs/components/progress/progress.cjs.map +1 -1
- package/dist/cjs/components/progress/use-progress.cjs +1 -0
- package/dist/cjs/components/progress/use-progress.cjs.map +1 -1
- package/dist/cjs/components/qr-code/qr-code.cjs +1 -0
- package/dist/cjs/components/qr-code/qr-code.cjs.map +1 -1
- package/dist/cjs/components/qr-code/use-qr-code.cjs +1 -0
- package/dist/cjs/components/qr-code/use-qr-code.cjs.map +1 -1
- package/dist/cjs/components/radio/radio-group.cjs +37 -34
- package/dist/cjs/components/radio/radio-group.cjs.map +1 -1
- package/dist/cjs/components/radio/radio.cjs +1 -0
- package/dist/cjs/components/radio/radio.cjs.map +1 -1
- package/dist/cjs/components/radio/use-radio-group.cjs +1 -0
- package/dist/cjs/components/radio/use-radio-group.cjs.map +1 -1
- package/dist/cjs/components/radio/use-radio.cjs +3 -1
- package/dist/cjs/components/radio/use-radio.cjs.map +1 -1
- package/dist/cjs/components/radio-card/radio-card-group.cjs +41 -38
- package/dist/cjs/components/radio-card/radio-card-group.cjs.map +1 -1
- package/dist/cjs/components/radio-card/radio-card.cjs +1 -0
- package/dist/cjs/components/radio-card/radio-card.cjs.map +1 -1
- package/dist/cjs/components/rating/rating.cjs +1 -0
- package/dist/cjs/components/rating/rating.cjs.map +1 -1
- package/dist/cjs/components/rating/use-rating.cjs +1 -0
- package/dist/cjs/components/rating/use-rating.cjs.map +1 -1
- package/dist/cjs/components/reorder/use-reorder.cjs +1 -0
- package/dist/cjs/components/reorder/use-reorder.cjs.map +1 -1
- package/dist/cjs/components/resizable/resizable.cjs +13 -10
- package/dist/cjs/components/resizable/resizable.cjs.map +1 -1
- package/dist/cjs/components/resizable/use-resizable.cjs +1 -0
- package/dist/cjs/components/resizable/use-resizable.cjs.map +1 -1
- package/dist/cjs/components/ripple/ripple.cjs.map +1 -1
- package/dist/cjs/components/ripple/use-ripple.cjs +1 -0
- package/dist/cjs/components/ripple/use-ripple.cjs.map +1 -1
- package/dist/cjs/components/rotate/rotate.cjs +1 -0
- package/dist/cjs/components/rotate/rotate.cjs.map +1 -1
- package/dist/cjs/components/saturation-slider/saturation-slider.cjs +1 -0
- package/dist/cjs/components/saturation-slider/saturation-slider.cjs.map +1 -1
- package/dist/cjs/components/saturation-slider/use-saturation-slider.cjs +1 -0
- package/dist/cjs/components/saturation-slider/use-saturation-slider.cjs.map +1 -1
- package/dist/cjs/components/scroll-area/use-scroll-area.cjs +1 -0
- package/dist/cjs/components/scroll-area/use-scroll-area.cjs.map +1 -1
- package/dist/cjs/components/segmented-control/segmented-control.cjs +3 -1
- package/dist/cjs/components/segmented-control/segmented-control.cjs.map +1 -1
- package/dist/cjs/components/segmented-control/use-segmented-control.cjs +1 -0
- package/dist/cjs/components/segmented-control/use-segmented-control.cjs.map +1 -1
- package/dist/cjs/components/select/select.cjs +14 -10
- package/dist/cjs/components/select/select.cjs.map +1 -1
- package/dist/cjs/components/select/use-select.cjs +1 -0
- package/dist/cjs/components/select/use-select.cjs.map +1 -1
- package/dist/cjs/components/show/show.cjs +1 -0
- package/dist/cjs/components/show/show.cjs.map +1 -1
- package/dist/cjs/components/sidebar/sidebar.cjs +6 -3
- package/dist/cjs/components/sidebar/sidebar.cjs.map +1 -1
- package/dist/cjs/components/sidebar/use-sidebar.cjs +1 -0
- package/dist/cjs/components/sidebar/use-sidebar.cjs.map +1 -1
- package/dist/cjs/components/simple-grid/simple-grid.cjs +1 -0
- package/dist/cjs/components/simple-grid/simple-grid.cjs.map +1 -1
- package/dist/cjs/components/skeleton/skeleton.cjs.map +1 -1
- package/dist/cjs/components/slide/slide.cjs +1 -0
- package/dist/cjs/components/slide/slide.cjs.map +1 -1
- package/dist/cjs/components/slide-fade/slide-fade.cjs +1 -0
- package/dist/cjs/components/slide-fade/slide-fade.cjs.map +1 -1
- package/dist/cjs/components/slider/slider.cjs +3 -1
- package/dist/cjs/components/slider/slider.cjs.map +1 -1
- package/dist/cjs/components/slider/use-slider.cjs +3 -1
- package/dist/cjs/components/slider/use-slider.cjs.map +1 -1
- package/dist/cjs/components/slot/slot.cjs +1 -0
- package/dist/cjs/components/slot/slot.cjs.map +1 -1
- package/dist/cjs/components/snacks/snacks.cjs +1 -0
- package/dist/cjs/components/snacks/snacks.cjs.map +1 -1
- package/dist/cjs/components/snacks/use-snacks.cjs +1 -0
- package/dist/cjs/components/snacks/use-snacks.cjs.map +1 -1
- package/dist/cjs/components/stack/stack.cjs +1 -0
- package/dist/cjs/components/stack/stack.cjs.map +1 -1
- package/dist/cjs/components/stack/z-stack.cjs +5 -2
- package/dist/cjs/components/stack/z-stack.cjs.map +1 -1
- package/dist/cjs/components/steps/steps.cjs +51 -47
- package/dist/cjs/components/steps/steps.cjs.map +1 -1
- package/dist/cjs/components/steps/use-steps.cjs +1 -0
- package/dist/cjs/components/steps/use-steps.cjs.map +1 -1
- package/dist/cjs/components/switch/switch.cjs.map +1 -1
- package/dist/cjs/components/switch/use-switch.cjs +1 -0
- package/dist/cjs/components/switch/use-switch.cjs.map +1 -1
- package/dist/cjs/components/table/table.cjs +51 -49
- package/dist/cjs/components/table/table.cjs.map +1 -1
- package/dist/cjs/components/tabs/tabs.cjs +23 -20
- package/dist/cjs/components/tabs/tabs.cjs.map +1 -1
- package/dist/cjs/components/tabs/use-tabs.cjs +1 -0
- package/dist/cjs/components/tabs/use-tabs.cjs.map +1 -1
- package/dist/cjs/components/tag/tag.cjs +1 -0
- package/dist/cjs/components/tag/tag.cjs.map +1 -1
- package/dist/cjs/components/textarea/use-autosize.cjs +1 -0
- package/dist/cjs/components/textarea/use-autosize.cjs.map +1 -1
- package/dist/cjs/components/textarea/use-textarea.cjs +1 -0
- package/dist/cjs/components/textarea/use-textarea.cjs.map +1 -1
- package/dist/cjs/components/timeline/timeline.cjs +1 -0
- package/dist/cjs/components/timeline/timeline.cjs.map +1 -1
- package/dist/cjs/components/tip/tip.cjs.map +1 -1
- package/dist/cjs/components/toggle/toggle-group.cjs +27 -24
- package/dist/cjs/components/toggle/toggle-group.cjs.map +1 -1
- package/dist/cjs/components/toggle/use-toggle-group.cjs +1 -0
- package/dist/cjs/components/toggle/use-toggle-group.cjs.map +1 -1
- package/dist/cjs/components/toggle/use-toggle.cjs +1 -0
- package/dist/cjs/components/toggle/use-toggle.cjs.map +1 -1
- package/dist/cjs/components/tooltip/tooltip.cjs.map +1 -1
- package/dist/cjs/components/tooltip/use-tooltip.cjs +1 -0
- package/dist/cjs/components/tooltip/use-tooltip.cjs.map +1 -1
- package/dist/cjs/components/tree/tree.cjs +1 -0
- package/dist/cjs/components/tree/tree.cjs.map +1 -1
- package/dist/cjs/components/tree/use-tree.cjs +1 -0
- package/dist/cjs/components/tree/use-tree.cjs.map +1 -1
- package/dist/cjs/core/components/create-component.cjs +5 -2
- package/dist/cjs/core/components/create-component.cjs.map +1 -1
- package/dist/cjs/core/components/props.cjs.map +1 -1
- package/dist/cjs/core/components/use-component-style.cjs +11 -6
- package/dist/cjs/core/components/use-component-style.cjs.map +1 -1
- package/dist/cjs/core/components/utils.cjs.map +1 -1
- package/dist/cjs/core/css/animation.cjs.map +1 -1
- package/dist/cjs/core/css/at-rule.cjs.map +1 -1
- package/dist/cjs/core/css/calc.cjs.map +1 -1
- package/dist/cjs/core/css/color-mix.cjs.map +1 -1
- package/dist/cjs/core/css/color-scheme.cjs.map +1 -1
- package/dist/cjs/core/css/config.cjs.map +1 -1
- package/dist/cjs/core/css/css.cjs +5 -3
- package/dist/cjs/core/css/css.cjs.map +1 -1
- package/dist/cjs/core/css/gradient.cjs.map +1 -1
- package/dist/cjs/core/css/merge-css.cjs.map +1 -1
- package/dist/cjs/core/css/style.cjs.map +1 -1
- package/dist/cjs/core/css/use-css.cjs +1 -0
- package/dist/cjs/core/css/use-css.cjs.map +1 -1
- package/dist/cjs/core/css/use-inject-vars.cjs +1 -0
- package/dist/cjs/core/css/use-inject-vars.cjs.map +1 -1
- package/dist/cjs/core/css/utils.cjs.map +1 -1
- package/dist/cjs/core/system/breakpoint.cjs.map +1 -1
- package/dist/cjs/core/system/color-mode-provider.cjs +1 -0
- package/dist/cjs/core/system/color-mode-provider.cjs.map +1 -1
- package/dist/cjs/core/system/create-system.cjs.map +1 -1
- package/dist/cjs/core/system/environment-provider.cjs +1 -0
- package/dist/cjs/core/system/environment-provider.cjs.map +1 -1
- package/dist/cjs/core/system/layer.cjs.map +1 -1
- package/dist/cjs/core/system/storage-script.cjs.map +1 -1
- package/dist/cjs/core/system/styled.cjs.map +1 -1
- package/dist/cjs/core/system/system-provider.cjs +1 -0
- package/dist/cjs/core/system/system-provider.cjs.map +1 -1
- package/dist/cjs/core/system/theme-provider.cjs +5 -3
- package/dist/cjs/core/system/theme-provider.cjs.map +1 -1
- package/dist/cjs/core/system/use-system-color-mode.cjs +1 -0
- package/dist/cjs/core/system/use-system-color-mode.cjs.map +1 -1
- package/dist/cjs/core/system/var.cjs +2 -1
- package/dist/cjs/core/system/var.cjs.map +1 -1
- package/dist/cjs/hooks/use-animation/index.cjs +4 -2
- package/dist/cjs/hooks/use-animation/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-async/index.cjs +1 -0
- package/dist/cjs/hooks/use-async/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-async-callback/index.cjs +1 -0
- package/dist/cjs/hooks/use-async-callback/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-boolean/index.cjs +1 -0
- package/dist/cjs/hooks/use-boolean/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-breakpoint/use-breakpoint-effect.cjs +1 -0
- package/dist/cjs/hooks/use-breakpoint/use-breakpoint-effect.cjs.map +1 -1
- package/dist/cjs/hooks/use-breakpoint/use-breakpoint-state.cjs +3 -1
- package/dist/cjs/hooks/use-breakpoint/use-breakpoint-state.cjs.map +1 -1
- package/dist/cjs/hooks/use-breakpoint/use-breakpoint-value.cjs +1 -0
- package/dist/cjs/hooks/use-breakpoint/use-breakpoint-value.cjs.map +1 -1
- package/dist/cjs/hooks/use-breakpoint/use-breakpoint.cjs +1 -0
- package/dist/cjs/hooks/use-breakpoint/use-breakpoint.cjs.map +1 -1
- package/dist/cjs/hooks/use-clickable/index.cjs +1 -0
- package/dist/cjs/hooks/use-clickable/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-clipboard/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-combobox/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-controllable-state/index.cjs +1 -0
- package/dist/cjs/hooks/use-controllable-state/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-counter/index.cjs +1 -0
- package/dist/cjs/hooks/use-counter/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-descendants/index.cjs +1 -0
- package/dist/cjs/hooks/use-descendants/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-disclosure/use-disclosure.cjs +1 -0
- package/dist/cjs/hooks/use-disclosure/use-disclosure.cjs.map +1 -1
- package/dist/cjs/hooks/use-disclosure/use-promise-disclosure.cjs +1 -0
- package/dist/cjs/hooks/use-disclosure/use-promise-disclosure.cjs.map +1 -1
- package/dist/cjs/hooks/use-event-listener/index.cjs +1 -0
- package/dist/cjs/hooks/use-event-listener/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-eye-dropper/index.cjs +1 -0
- package/dist/cjs/hooks/use-eye-dropper/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-field-sizing/index.cjs +1 -0
- package/dist/cjs/hooks/use-field-sizing/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-focus/index.cjs +3 -1
- package/dist/cjs/hooks/use-focus/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-hover/index.cjs +1 -0
- package/dist/cjs/hooks/use-hover/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-idle/index.cjs +1 -0
- package/dist/cjs/hooks/use-idle/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-interval/index.cjs +1 -0
- package/dist/cjs/hooks/use-interval/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-lazy-mount/index.cjs +1 -0
- package/dist/cjs/hooks/use-lazy-mount/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-local-storage/index.cjs +1 -0
- package/dist/cjs/hooks/use-local-storage/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-media-query/index.cjs +1 -0
- package/dist/cjs/hooks/use-media-query/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-mounted/index.cjs +1 -0
- package/dist/cjs/hooks/use-mounted/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-online/index.cjs +1 -0
- package/dist/cjs/hooks/use-online/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-os/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-outside-click/index.cjs +1 -0
- package/dist/cjs/hooks/use-outside-click/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-pan-event/index.cjs +1 -0
- package/dist/cjs/hooks/use-pan-event/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-popper/index.cjs +1 -0
- package/dist/cjs/hooks/use-popper/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-previous/index.cjs +1 -0
- package/dist/cjs/hooks/use-previous/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-processing/index.cjs +1 -0
- package/dist/cjs/hooks/use-processing/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-resize-observer/index.cjs +1 -0
- package/dist/cjs/hooks/use-resize-observer/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-timeout/index.cjs +1 -0
- package/dist/cjs/hooks/use-timeout/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-value/index.cjs +1 -0
- package/dist/cjs/hooks/use-value/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-window-event/index.cjs +1 -0
- package/dist/cjs/hooks/use-window-event/index.cjs.map +1 -1
- package/dist/cjs/index.cjs +30 -6
- package/dist/cjs/providers/i18n-provider/i18n-provider.cjs.map +1 -1
- package/dist/cjs/providers/ui-provider/ui-provider.cjs.map +1 -1
- package/dist/cjs/utils/children.cjs.map +1 -1
- package/dist/cjs/utils/context.cjs.map +1 -1
- package/dist/cjs/utils/dom.cjs.map +1 -1
- package/dist/cjs/utils/ref.cjs.map +1 -1
- package/dist/cjs/utils/ssr.cjs +1 -0
- package/dist/cjs/utils/ssr.cjs.map +1 -1
- package/dist/cjs/utils/store.cjs +1 -0
- package/dist/cjs/utils/store.cjs.map +1 -1
- package/dist/esm/components/accordion/accordion.js +3 -2
- package/dist/esm/components/accordion/accordion.js.map +1 -1
- package/dist/esm/components/accordion/use-accordion.js.map +1 -1
- package/dist/esm/components/action-bar/action-bar.js.map +1 -1
- package/dist/esm/components/action-bar/use-action-bar.js.map +1 -1
- package/dist/esm/components/airy/airy.js.map +1 -1
- package/dist/esm/components/alert/alert.js +4 -2
- package/dist/esm/components/alert/alert.js.map +1 -1
- package/dist/esm/components/alpha-slider/alpha-slider.js.map +1 -1
- package/dist/esm/components/aspect-ratio/aspect-ratio.js.map +1 -1
- package/dist/esm/components/autocomplete/autocomplete.js +13 -10
- package/dist/esm/components/autocomplete/autocomplete.js.map +1 -1
- package/dist/esm/components/autocomplete/use-autocomplete.js.map +1 -1
- package/dist/esm/components/avatar/avatar-group.js +12 -11
- package/dist/esm/components/avatar/avatar-group.js.map +1 -1
- package/dist/esm/components/avatar/use-avatar-group.js.map +1 -1
- package/dist/esm/components/avatar/use-avatar.js.map +1 -1
- package/dist/esm/components/breadcrumb/use-breadcrumb.js.map +1 -1
- package/dist/esm/components/button/button.js +8 -5
- package/dist/esm/components/button/button.js.map +1 -1
- package/dist/esm/components/calendar/calendar.js.map +1 -1
- package/dist/esm/components/calendar/use-calendar.js.map +1 -1
- package/dist/esm/components/carousel/carousel.js +26 -25
- package/dist/esm/components/carousel/carousel.js.map +1 -1
- package/dist/esm/components/carousel/use-carousel.js.map +1 -1
- package/dist/esm/components/chart/area-chart.js +5 -4
- package/dist/esm/components/chart/area-chart.js.map +1 -1
- package/dist/esm/components/chart/bar-chart.js +5 -4
- package/dist/esm/components/chart/bar-chart.js.map +1 -1
- package/dist/esm/components/chart/cartesian-chart.js +145 -139
- package/dist/esm/components/chart/cartesian-chart.js.map +1 -1
- package/dist/esm/components/chart/chart.js +2 -1
- package/dist/esm/components/chart/chart.js.map +1 -1
- package/dist/esm/components/chart/composed-chart.js +15 -14
- package/dist/esm/components/chart/composed-chart.js.map +1 -1
- package/dist/esm/components/chart/donut-chart.js +7 -5
- package/dist/esm/components/chart/donut-chart.js.map +1 -1
- package/dist/esm/components/chart/line-chart.js +5 -4
- package/dist/esm/components/chart/line-chart.js.map +1 -1
- package/dist/esm/components/chart/pie-chart.js +7 -5
- package/dist/esm/components/chart/pie-chart.js.map +1 -1
- package/dist/esm/components/chart/polar-chart.js +118 -111
- package/dist/esm/components/chart/polar-chart.js.map +1 -1
- package/dist/esm/components/chart/radar-chart.js +5 -4
- package/dist/esm/components/chart/radar-chart.js.map +1 -1
- package/dist/esm/components/chart/use-cartesian-chart.js.map +1 -1
- package/dist/esm/components/chart/use-chart.js.map +1 -1
- package/dist/esm/components/chart/use-polar-chart.js.map +1 -1
- package/dist/esm/components/checkbox/checkbox-group.js +38 -36
- package/dist/esm/components/checkbox/checkbox-group.js.map +1 -1
- package/dist/esm/components/checkbox/use-checkbox-group.js.map +1 -1
- package/dist/esm/components/checkbox/use-checkbox.js +2 -1
- package/dist/esm/components/checkbox/use-checkbox.js.map +1 -1
- package/dist/esm/components/checkbox-card/checkbox-card-group.js +42 -40
- package/dist/esm/components/checkbox-card/checkbox-card-group.js.map +1 -1
- package/dist/esm/components/circle-progress/circle-progress.js.map +1 -1
- package/dist/esm/components/client-only/client-only.js +2 -1
- package/dist/esm/components/client-only/client-only.js.map +1 -1
- package/dist/esm/components/collapse/collapse.js.map +1 -1
- package/dist/esm/components/color-picker/color-picker.js +2 -1
- package/dist/esm/components/color-picker/color-picker.js.map +1 -1
- package/dist/esm/components/color-picker/use-color-picker.js.map +1 -1
- package/dist/esm/components/color-selector/color-selector.js +2 -1
- package/dist/esm/components/color-selector/color-selector.js.map +1 -1
- package/dist/esm/components/color-selector/use-color-selector.js.map +1 -1
- package/dist/esm/components/color-swatch/color-swatch.js.map +1 -1
- package/dist/esm/components/data-list/data-list.js +8 -5
- package/dist/esm/components/data-list/data-list.js.map +1 -1
- package/dist/esm/components/date-picker/date-picker.js +2 -1
- package/dist/esm/components/date-picker/date-picker.js.map +1 -1
- package/dist/esm/components/date-picker/use-date-picker.js.map +1 -1
- package/dist/esm/components/drawer/drawer.js.map +1 -1
- package/dist/esm/components/drawer/use-drawer.js +1 -3
- package/dist/esm/components/drawer/use-drawer.js.map +1 -1
- package/dist/esm/components/dropzone/dropzone.js +2 -1
- package/dist/esm/components/dropzone/dropzone.js.map +1 -1
- package/dist/esm/components/dropzone/use-dropzone.js.map +1 -1
- package/dist/esm/components/editable/editable.js.map +1 -1
- package/dist/esm/components/editable/use-editable.js.map +1 -1
- package/dist/esm/components/field/field.js.map +1 -1
- package/dist/esm/components/field/use-field-props.js.map +1 -1
- package/dist/esm/components/fieldset/fieldset.js.map +1 -1
- package/dist/esm/components/file-input/file-input.js +2 -1
- package/dist/esm/components/file-input/file-input.js.map +1 -1
- package/dist/esm/components/file-input/use-file-input.js.map +1 -1
- package/dist/esm/components/flip/flip.js.map +1 -1
- package/dist/esm/components/float/float.js.map +1 -1
- package/dist/esm/components/focus-lock/focus-lock.js.map +1 -1
- package/dist/esm/components/for/for.js.map +1 -1
- package/dist/esm/components/form/form.js.map +1 -1
- package/dist/esm/components/grid/grid-item.js.map +1 -1
- package/dist/esm/components/group/group.js.map +1 -1
- package/dist/esm/components/group/use-group.js.map +1 -1
- package/dist/esm/components/highlight/use-highlight.js.map +1 -1
- package/dist/esm/components/icon/icons/index.js +21 -5
- package/dist/esm/components/icon/icons/index.js.map +1 -1
- package/dist/esm/components/icon/icons/layout-freeform-icon.js +14 -0
- package/dist/esm/components/icon/icons/layout-freeform-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/mic-audio-lines-icon.js +14 -0
- package/dist/esm/components/icon/icons/mic-audio-lines-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/mic-signal-icon.js +14 -0
- package/dist/esm/components/icon/icons/mic-signal-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/mosque-icon.js +14 -0
- package/dist/esm/components/icon/icons/mosque-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/rotate-ccw-clock-icon.js +14 -0
- package/dist/esm/components/icon/icons/rotate-ccw-clock-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/rotate-cw-fading-clock-icon.js +14 -0
- package/dist/esm/components/icon/icons/rotate-cw-fading-clock-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/scan-square-icon.js +14 -0
- package/dist/esm/components/icon/icons/scan-square-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/shield-keyhole-icon.js +14 -0
- package/dist/esm/components/icon/icons/shield-keyhole-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/square-off-icon.js +14 -0
- package/dist/esm/components/icon/icons/square-off-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/user-shield-icon.js +14 -0
- package/dist/esm/components/icon/icons/user-shield-icon.js.map +1 -0
- package/dist/esm/components/icon/index.js +11 -3
- package/dist/esm/components/indicator/indicator.js.map +1 -1
- package/dist/esm/components/infinite-scroll-area/infinite-scroll-area.js +2 -1
- package/dist/esm/components/infinite-scroll-area/infinite-scroll-area.js.map +1 -1
- package/dist/esm/components/input/input-group.js +13 -12
- package/dist/esm/components/input/input-group.js.map +1 -1
- package/dist/esm/components/input/input.style.js.map +1 -1
- package/dist/esm/components/link-box/link-box.js.map +1 -1
- package/dist/esm/components/loading/audio.js.map +1 -1
- package/dist/esm/components/loading/circles.js.map +1 -1
- package/dist/esm/components/loading/dots.js.map +1 -1
- package/dist/esm/components/loading/grid.js.map +1 -1
- package/dist/esm/components/loading/loading-provider.js.map +1 -1
- package/dist/esm/components/loading/oval.js.map +1 -1
- package/dist/esm/components/loading/puff.js.map +1 -1
- package/dist/esm/components/loading/rings.js.map +1 -1
- package/dist/esm/components/loading/use-loading-component.js.map +1 -1
- package/dist/esm/components/menu/menu.js +12 -10
- package/dist/esm/components/menu/menu.js.map +1 -1
- package/dist/esm/components/menu/use-menu.js.map +1 -1
- package/dist/esm/components/modal/modal.js.map +1 -1
- package/dist/esm/components/modal/use-modal.js.map +1 -1
- package/dist/esm/components/motion/motion.js.map +1 -1
- package/dist/esm/components/motion/transition.js.map +1 -1
- package/dist/esm/components/native-accordion/use-native-accordion.js.map +1 -1
- package/dist/esm/components/native-popover/native-popover.js.map +1 -1
- package/dist/esm/components/native-popover/use-native-popover.js.map +1 -1
- package/dist/esm/components/native-select/native-select.js +2 -1
- package/dist/esm/components/native-select/native-select.js.map +1 -1
- package/dist/esm/components/native-select/use-native-select.js.map +1 -1
- package/dist/esm/components/notice/notice.js.map +1 -1
- package/dist/esm/components/notice/use-notice.js.map +1 -1
- package/dist/esm/components/number-input/number-input.js +2 -1
- package/dist/esm/components/number-input/number-input.js.map +1 -1
- package/dist/esm/components/number-input/use-number-counter.js.map +1 -1
- package/dist/esm/components/number-input/use-number-input.js.map +1 -1
- package/dist/esm/components/pagination/pagination.js.map +1 -1
- package/dist/esm/components/pagination/use-pagination.js.map +1 -1
- package/dist/esm/components/password-input/password-input.js +2 -1
- package/dist/esm/components/password-input/password-input.js.map +1 -1
- package/dist/esm/components/password-input/use-password-input.js.map +1 -1
- package/dist/esm/components/password-input/use-strength-meter.js.map +1 -1
- package/dist/esm/components/picture/picture.js.map +1 -1
- package/dist/esm/components/pin-input/use-pin-input.js.map +1 -1
- package/dist/esm/components/popover/popover.js.map +1 -1
- package/dist/esm/components/popover/use-popover.js.map +1 -1
- package/dist/esm/components/portal/portal.js.map +1 -1
- package/dist/esm/components/progress/progress.js.map +1 -1
- package/dist/esm/components/progress/use-progress.js.map +1 -1
- package/dist/esm/components/radio/radio-group.js +36 -34
- package/dist/esm/components/radio/radio-group.js.map +1 -1
- package/dist/esm/components/radio/use-radio-group.js.map +1 -1
- package/dist/esm/components/radio/use-radio.js +2 -1
- package/dist/esm/components/radio/use-radio.js.map +1 -1
- package/dist/esm/components/radio-card/radio-card-group.js +40 -38
- package/dist/esm/components/radio-card/radio-card-group.js.map +1 -1
- package/dist/esm/components/rating/rating.js.map +1 -1
- package/dist/esm/components/rating/use-rating.js.map +1 -1
- package/dist/esm/components/reorder/use-reorder.js.map +1 -1
- package/dist/esm/components/resizable/resizable.js +12 -10
- package/dist/esm/components/resizable/resizable.js.map +1 -1
- package/dist/esm/components/resizable/use-resizable.js.map +1 -1
- package/dist/esm/components/ripple/ripple.js.map +1 -1
- package/dist/esm/components/ripple/use-ripple.js.map +1 -1
- package/dist/esm/components/rotate/rotate.js.map +1 -1
- package/dist/esm/components/saturation-slider/use-saturation-slider.js.map +1 -1
- package/dist/esm/components/scroll-area/use-scroll-area.js.map +1 -1
- package/dist/esm/components/segmented-control/segmented-control.js +2 -1
- package/dist/esm/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/esm/components/segmented-control/use-segmented-control.js.map +1 -1
- package/dist/esm/components/select/select.js +13 -10
- package/dist/esm/components/select/select.js.map +1 -1
- package/dist/esm/components/select/use-select.js.map +1 -1
- package/dist/esm/components/show/show.js.map +1 -1
- package/dist/esm/components/sidebar/sidebar.js +5 -3
- package/dist/esm/components/sidebar/sidebar.js.map +1 -1
- package/dist/esm/components/sidebar/use-sidebar.js.map +1 -1
- package/dist/esm/components/simple-grid/simple-grid.js.map +1 -1
- package/dist/esm/components/skeleton/skeleton.js.map +1 -1
- package/dist/esm/components/slider/slider.js +2 -1
- package/dist/esm/components/slider/slider.js.map +1 -1
- package/dist/esm/components/slider/use-slider.js +2 -1
- package/dist/esm/components/slider/use-slider.js.map +1 -1
- package/dist/esm/components/snacks/snacks.js.map +1 -1
- package/dist/esm/components/stack/stack.js.map +1 -1
- package/dist/esm/components/stack/z-stack.js +4 -2
- package/dist/esm/components/stack/z-stack.js.map +1 -1
- package/dist/esm/components/steps/steps.js +50 -47
- package/dist/esm/components/steps/steps.js.map +1 -1
- package/dist/esm/components/steps/use-steps.js.map +1 -1
- package/dist/esm/components/switch/switch.js.map +1 -1
- package/dist/esm/components/switch/use-switch.js.map +1 -1
- package/dist/esm/components/table/table.js +50 -49
- package/dist/esm/components/table/table.js.map +1 -1
- package/dist/esm/components/tabs/tabs.js +22 -20
- package/dist/esm/components/tabs/tabs.js.map +1 -1
- package/dist/esm/components/tabs/use-tabs.js.map +1 -1
- package/dist/esm/components/tag/tag.js.map +1 -1
- package/dist/esm/components/textarea/use-autosize.js.map +1 -1
- package/dist/esm/components/timeline/timeline.js.map +1 -1
- package/dist/esm/components/tip/tip.js.map +1 -1
- package/dist/esm/components/toggle/toggle-group.js +26 -24
- package/dist/esm/components/toggle/toggle-group.js.map +1 -1
- package/dist/esm/components/toggle/use-toggle-group.js.map +1 -1
- package/dist/esm/components/toggle/use-toggle.js.map +1 -1
- package/dist/esm/components/tooltip/tooltip.js.map +1 -1
- package/dist/esm/components/tooltip/use-tooltip.js.map +1 -1
- package/dist/esm/components/tree/tree.js.map +1 -1
- package/dist/esm/components/tree/use-tree.js.map +1 -1
- package/dist/esm/core/components/create-component.js +4 -2
- package/dist/esm/core/components/create-component.js.map +1 -1
- package/dist/esm/core/components/props.js.map +1 -1
- package/dist/esm/core/components/use-component-style.js +10 -6
- package/dist/esm/core/components/use-component-style.js.map +1 -1
- package/dist/esm/core/components/utils.js.map +1 -1
- package/dist/esm/core/css/animation.js.map +1 -1
- package/dist/esm/core/css/at-rule.js.map +1 -1
- package/dist/esm/core/css/calc.js.map +1 -1
- package/dist/esm/core/css/color-mix.js.map +1 -1
- package/dist/esm/core/css/color-scheme.js.map +1 -1
- package/dist/esm/core/css/config.js.map +1 -1
- package/dist/esm/core/css/css.js +5 -3
- package/dist/esm/core/css/css.js.map +1 -1
- package/dist/esm/core/css/gradient.js.map +1 -1
- package/dist/esm/core/css/merge-css.js.map +1 -1
- package/dist/esm/core/css/style.js.map +1 -1
- package/dist/esm/core/css/use-css.js.map +1 -1
- package/dist/esm/core/css/utils.js.map +1 -1
- package/dist/esm/core/system/breakpoint.js.map +1 -1
- package/dist/esm/core/system/color-mode-provider.js.map +1 -1
- package/dist/esm/core/system/create-system.js.map +1 -1
- package/dist/esm/core/system/environment-provider.js.map +1 -1
- package/dist/esm/core/system/layer.js.map +1 -1
- package/dist/esm/core/system/storage-script.js.map +1 -1
- package/dist/esm/core/system/styled.js.map +1 -1
- package/dist/esm/core/system/theme-provider.js +4 -3
- package/dist/esm/core/system/theme-provider.js.map +1 -1
- package/dist/esm/core/system/use-system-color-mode.js.map +1 -1
- package/dist/esm/core/system/var.js +2 -1
- package/dist/esm/core/system/var.js.map +1 -1
- package/dist/esm/hooks/use-animation/index.js +3 -2
- package/dist/esm/hooks/use-animation/index.js.map +1 -1
- package/dist/esm/hooks/use-breakpoint/use-breakpoint-state.js +2 -1
- package/dist/esm/hooks/use-breakpoint/use-breakpoint-state.js.map +1 -1
- package/dist/esm/hooks/use-breakpoint/use-breakpoint.js.map +1 -1
- package/dist/esm/hooks/use-clickable/index.js.map +1 -1
- package/dist/esm/hooks/use-clipboard/index.js.map +1 -1
- package/dist/esm/hooks/use-combobox/index.js.map +1 -1
- package/dist/esm/hooks/use-controllable-state/index.js.map +1 -1
- package/dist/esm/hooks/use-counter/index.js.map +1 -1
- package/dist/esm/hooks/use-descendants/index.js.map +1 -1
- package/dist/esm/hooks/use-event-listener/index.js.map +1 -1
- package/dist/esm/hooks/use-focus/index.js +2 -1
- package/dist/esm/hooks/use-focus/index.js.map +1 -1
- package/dist/esm/hooks/use-local-storage/index.js.map +1 -1
- package/dist/esm/hooks/use-os/index.js.map +1 -1
- package/dist/esm/hooks/use-outside-click/index.js.map +1 -1
- package/dist/esm/hooks/use-pan-event/index.js.map +1 -1
- package/dist/esm/hooks/use-resize-observer/index.js.map +1 -1
- package/dist/esm/hooks/use-value/index.js.map +1 -1
- package/dist/esm/index.js +21 -5
- package/dist/esm/providers/i18n-provider/i18n-provider.js.map +1 -1
- package/dist/esm/providers/ui-provider/ui-provider.js.map +1 -1
- package/dist/types/components/chart/polar-chart.style.d.ts +1 -1
- package/dist/types/components/color-picker/color-picker.style.d.ts +1 -1
- package/dist/types/components/color-selector/color-selector.style.d.ts +2 -2
- package/dist/types/components/drawer/drawer.style.d.ts +2 -2
- package/dist/types/components/file-input/file-input.style.d.ts +1 -1
- package/dist/types/components/icon/icons/index.d.ts +12 -4
- package/dist/types/components/icon/icons/index.types.d.ts +1 -1
- package/dist/types/components/icon/icons/layout-freeform-icon.d.ts +13 -0
- package/dist/types/components/icon/icons/mic-audio-lines-icon.d.ts +13 -0
- package/dist/types/components/icon/icons/mic-signal-icon.d.ts +13 -0
- package/dist/types/components/icon/icons/mosque-icon.d.ts +13 -0
- package/dist/types/components/icon/icons/rotate-ccw-clock-icon.d.ts +13 -0
- package/dist/types/components/icon/icons/rotate-cw-fading-clock-icon.d.ts +13 -0
- package/dist/types/components/icon/icons/scan-square-icon.d.ts +13 -0
- package/dist/types/components/icon/icons/shield-keyhole-icon.d.ts +13 -0
- package/dist/types/components/icon/icons/{history-icon.d.ts → square-off-icon.d.ts} +5 -5
- package/dist/types/components/icon/icons/user-shield-icon.d.ts +13 -0
- package/dist/types/components/icon/index.d.ts +11 -3
- package/dist/types/components/modal/modal.style.d.ts +2 -2
- package/dist/types/components/notice/notice.style.d.ts +1 -1
- package/dist/types/components/tag/tag.style.d.ts +1 -1
- package/dist/types/index.d.ts +12 -4
- package/package.json +9 -9
- package/dist/cjs/components/icon/icons/history-icon.cjs +0 -14
- package/dist/cjs/components/icon/icons/history-icon.cjs.map +0 -1
- package/dist/cjs/components/icon/icons/podcast-icon.cjs +0 -14
- package/dist/cjs/components/icon/icons/podcast-icon.cjs.map +0 -1
- package/dist/esm/components/icon/icons/history-icon.js +0 -14
- package/dist/esm/components/icon/icons/history-icon.js.map +0 -1
- package/dist/esm/components/icon/icons/podcast-icon.js +0 -14
- package/dist/esm/components/icon/icons/podcast-icon.js.map +0 -1
- package/dist/types/components/icon/icons/podcast-icon.d.ts +0 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.js","names":["createContext","Drawer.Root","Drawer.Content"],"sources":["../../../../src/components/sidebar/sidebar.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, PropsWithChildren, ReactNode } from \"react\"\nimport type {\n Breakpoint,\n ExtractStyleValue,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport type { CollapseProps } from \"../collapse\"\nimport type { Loading } from \"../loading\"\nimport type { WithTransitionProps } from \"../motion\"\nimport type {\n UseSidebarGroupProps,\n UseSidebarGroupReturn,\n UseSidebarItemProps,\n UseSidebarItemReturn,\n UseSidebarProps,\n UseSidebarReturn,\n} from \"./use-sidebar\"\nimport {\n Children,\n cloneElement,\n isValidElement,\n useCallback,\n useMemo,\n} from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport { useBreakpointValue } from \"../../hooks/use-breakpoint\"\nimport { useValue } from \"../../hooks/use-value\"\nimport {\n cast,\n createContext,\n dataAttr,\n isObject,\n isString,\n runIfFn,\n useIncludesChildren,\n useSplitChildren,\n useValidChildren,\n} from \"../../utils\"\nimport { Collapse } from \"../collapse\"\nimport { Drawer } from \"../drawer\"\nimport { ChevronRightIcon } from \"../icon\"\nimport { useLoadingComponent } from \"../loading\"\nimport { Tooltip, type TooltipProps } from \"../tooltip\"\nimport { sidebarStyle, type SidebarStyle } from \"./sidebar.style\"\nimport {\n SidebarContext,\n SidebarDescendantsContext,\n SidebarItemContext,\n useSidebar,\n useSidebarContext,\n useSidebarGroup,\n useSidebarItem,\n} from \"./use-sidebar\"\n\ninterface SidebarItemCallBackProps {\n disabled?: boolean\n expanded?: boolean\n}\n\ntype SidebarItemReactNode =\n | ReactNodeOrFunction<SidebarItemCallBackProps>\n | {\n group: ReactNodeOrFunction<SidebarItemCallBackProps>\n item?: ReactNodeOrFunction<SidebarItemCallBackProps>\n }\n | {\n item: ReactNodeOrFunction<SidebarItemCallBackProps>\n group?: ReactNodeOrFunction<SidebarItemCallBackProps>\n }\n\ninterface SidebarItemSharedRenderProps\n extends\n Pick<SidebarItemProps, \"label\">,\n Pick<\n UseSidebarItemReturn,\n | \"expanded\"\n | \"expandedValue\"\n | \"onExpandedChange\"\n | \"onSelectedChange\"\n | \"selected\"\n | \"selectedValue\"\n | \"value\"\n > {\n itemProps: HTMLStyledProps<\"li\">\n linkProps: HTMLStyledProps<\"a\">\n triggerProps: HTMLStyledProps<\"button\">\n endElement?: ReactNode\n startElement?: ReactNode\n}\n\ninterface SidebarItemRenderProps\n extends\n PropsWithChildren,\n Omit<SidebarItemSharedRenderProps, \"endElement\" | \"startElement\">,\n Pick<\n UseSidebarItemReturn,\n | \"group\"\n | \"groupLoading\"\n | \"groupOpen\"\n | \"onGroupClose\"\n | \"onGroupOpen\"\n | \"onGroupToggle\"\n > {\n endElement: { group?: ReactNode; item?: ReactNode }\n startElement: { group?: ReactNode; item?: ReactNode }\n indicator?: ReactNode\n link?: ReactNode\n trigger?: ReactNode\n}\n\ninterface SidebarItemLinkRenderProps extends Omit<\n SidebarItemSharedRenderProps,\n \"itemProps\" | \"triggerProps\"\n> {}\n\ninterface SidebarItemTriggerRenderProps\n extends\n Omit<SidebarItemSharedRenderProps, \"itemProps\" | \"linkProps\">,\n Pick<\n UseSidebarItemReturn,\n | \"groupLoading\"\n | \"groupOpen\"\n | \"onGroupClose\"\n | \"onGroupOpen\"\n | \"onGroupToggle\"\n > {\n indicator?: ReactNode\n}\n\ninterface SidebarItemRender {\n item?: ReactNodeOrFunction<SidebarItemRenderProps>\n link?: ReactNodeOrFunction<SidebarItemLinkRenderProps>\n trigger?: ReactNodeOrFunction<SidebarItemTriggerRenderProps>\n}\n\ninterface SidebarGroup extends Omit<SidebarGroupProps, \"children\" | \"value\"> {\n children: SidebarItemWithValue[]\n group: true\n}\n\nexport interface SidebarItemWithValue extends Omit<\n SidebarItemProps,\n \"children\"\n> {\n children?: SidebarItemWithValue[]\n}\n\nexport type SidebarItem = SidebarGroup | SidebarItemWithValue\n\nconst createKey = (props: SidebarItem, index: number) => {\n return \"value\" in props ? props.value || index : index\n}\n\nconst getReactNodeOrFunction = (\n type: \"group\" | \"item\",\n custom?: SidebarItemReactNode,\n root?: SidebarItemReactNode,\n): ReactNodeOrFunction<SidebarItemCallBackProps> => {\n if (isObject(custom) && (\"group\" in custom || \"item\" in custom))\n return custom[type]\n else if (custom) return custom\n else if (isObject(root) && (\"group\" in root || \"item\" in root))\n return root[type]\n else return root\n}\n\ninterface ComponentContext extends Pick<\n UseSidebarReturn,\n | \"getContentProps\"\n | \"getFooterProps\"\n | \"getHeaderProps\"\n | \"getSidePanelProps\"\n | \"getTriggerProps\"\n> {\n breakpoint: ExtractStyleValue<NonNullable<SidebarRootProps[\"breakpoint\"]>>\n mode: ExtractStyleValue<NonNullable<SidebarRootProps[\"mode\"]>>\n placement: ExtractStyleValue<NonNullable<SidebarRootProps[\"placement\"]>>\n}\n\ninterface GroupComponentContext\n extends\n Pick<SidebarGroupProps, \"contentProps\" | \"labelProps\">,\n Pick<UseSidebarGroupReturn, \"getContentProps\" | \"getLabelProps\"> {}\n\nconst [GroupComponentContext, useGroupComponentContext] =\n createContext<GroupComponentContext>({ name: \"GroupComponentContext\" })\n\ninterface ItemComponentContext {\n contentProps: SidebarItemContentProps\n endElementProps: SidebarItemEndElementProps\n indicatorProps: SidebarItemIndicatorProps\n labelProps: SidebarItemLabelProps\n startElementProps: SidebarItemStartElementProps\n tooltipProps: SidebarItemTooltipProps\n}\n\nconst [ItemComponentContext, useItemComponentContext] =\n createContext<ItemComponentContext>({ name: \"ItemComponentContext\" })\n\ninterface SidePanelComponentContext extends Pick<\n SidebarSidePanelProps,\n | \"animated\"\n | \"contentProps\"\n | \"endElement\"\n | \"endElementProps\"\n | \"footerProps\"\n | \"groupContentProps\"\n | \"groupProps\"\n | \"handleProps\"\n | \"headerProps\"\n | \"indicator\"\n | \"indicatorHidden\"\n | \"indicatorProps\"\n | \"itemContentProps\"\n | \"itemProps\"\n | \"items\"\n | \"labelProps\"\n | \"linkProps\"\n | \"loadingScheme\"\n | \"menuProps\"\n | \"render\"\n | \"startElement\"\n | \"startElementProps\"\n | \"tooltipProps\"\n | \"triggerProps\"\n> {}\n\nconst [SidePanelComponentContext, useSidePanelComponentContext] =\n createContext<SidePanelComponentContext>({\n name: \"SidePanelComponentContext\",\n })\n\nexport interface SidebarRootProps\n extends\n HTMLStyledProps<\"div\">,\n ThemeProps<SidebarStyle>,\n Omit<UseSidebarProps, \"mobile\"> {\n /**\n * The breakpoint to use for the sidebar. If `false`, the sidebar will be always visible.\n *\n * @default 'md'\n */\n breakpoint?: Exclude<Breakpoint, \"base\"> | false\n}\n\nconst {\n ComponentContext,\n PropsContext: SidebarPropsContext,\n useComponentContext,\n usePropsContext: useSidebarPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<SidebarRootProps, SidebarStyle, ComponentContext>(\n \"sidebar\",\n sidebarStyle,\n)\n\nexport { SidebarPropsContext, useSidebarPropsContext }\n\n/**\n * `Sidebar` is a component that is used to display a list of items in a sidebar.\n *\n * @see https://yamada-ui.com/docs/components/sidebar\n */\nexport const SidebarRoot = withProvider<\n \"div\",\n SidebarRootProps,\n \"mode\" | \"placement\"\n>(\n ({\n breakpoint = \"md\",\n mode: modeProp = \"offcanvas\",\n placement: placementProp = \"start\",\n ...rest\n }) => {\n const mobile =\n useBreakpointValue<boolean | undefined>(\n breakpoint ? { [breakpoint]: true } : { base: false },\n ) ?? false\n const mode = useValue(modeProp)\n const placement = useValue(placementProp)\n const {\n descendants,\n expandedValue,\n open,\n selectedValue,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getRootProps,\n getSidePanelProps,\n getTriggerProps,\n onClose,\n onExpandedChange,\n onOpen,\n onSelectedChange,\n onToggle,\n } = useSidebar({ mobile, ...rest })\n const context = useMemo(\n () => ({\n expandedValue,\n mobile,\n open,\n selectedValue,\n onClose,\n onExpandedChange,\n onOpen,\n onSelectedChange,\n onToggle,\n }),\n [\n mobile,\n expandedValue,\n open,\n selectedValue,\n onClose,\n onExpandedChange,\n onOpen,\n onSelectedChange,\n onToggle,\n ],\n )\n const componentContext = useMemo(\n () => ({\n breakpoint,\n mode,\n placement,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getSidePanelProps,\n getTriggerProps,\n }),\n [\n breakpoint,\n mode,\n placement,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getSidePanelProps,\n getTriggerProps,\n ],\n )\n\n return (\n <SidebarDescendantsContext value={descendants}>\n <SidebarContext value={context}>\n <ComponentContext value={componentContext}>\n <styled.div data-group {...getRootProps()} />\n </ComponentContext>\n </SidebarContext>\n </SidebarDescendantsContext>\n )\n },\n \"root\",\n { transferProps: [\"mode\", \"placement\"] },\n)()\n\nexport interface SidebarMainPanelProps extends HTMLStyledProps {}\n\nexport const SidebarMainPanel = withContext<\"div\", SidebarMainPanelProps>(\n \"div\",\n \"mainPanel\",\n)()\n\nexport interface SidebarTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const SidebarTrigger = withContext<\"button\", SidebarTriggerProps>(\n \"button\",\n \"trigger\",\n)(undefined, (props) => {\n const { getTriggerProps } = useComponentContext()\n\n return { asChild: true, ...getTriggerProps(props) }\n})\n\nexport interface SidebarSidePanelProps\n extends\n Omit<HTMLStyledProps<\"aside\">, \"content\">,\n Pick<SidebarContentProps, \"items\">,\n Pick<\n SidebarItemProps,\n | \"animated\"\n | \"endElement\"\n | \"endElementProps\"\n | \"indicator\"\n | \"indicatorProps\"\n | \"labelProps\"\n | \"linkProps\"\n | \"loadingScheme\"\n | \"render\"\n | \"startElement\"\n | \"startElementProps\"\n | \"tooltipProps\"\n | \"triggerProps\"\n > {\n /**\n * The content of the sidebar.\n */\n content?: ReactNode\n /**\n * The footer of the sidebar.\n */\n footer?: ReactNode\n /**\n * The header of the sidebar.\n */\n header?: ReactNode\n /**\n * If `true`, hide the tree indicator icon for all items.\n *\n * @default false\n */\n indicatorHidden?: boolean\n /**\n * If `true`, the sidebar will be rendered with a handle.\n *\n * @default true\n */\n withHandle?: boolean\n /**\n * Props for the content component.\n */\n contentProps?: SidebarContentProps\n /**\n * Props for the drawer component.\n */\n drawerProps?: Omit<\n Drawer.RootProps,\n | \"body\"\n | \"cancel\"\n | \"children\"\n | \"footer\"\n | \"header\"\n | \"middle\"\n | \"onCancel\"\n | \"onClose\"\n | \"onMiddle\"\n | \"onOpen\"\n | \"onSuccess\"\n | \"open\"\n | \"success\"\n | \"title\"\n | \"trigger\"\n >\n /**\n * Props for the footer component.\n */\n footerProps?: SidebarFooterProps\n /**\n * Props for the group content component.\n */\n groupContentProps?: Omit<SidebarGroupContentProps, \"children\">\n /**\n * Props for the group component.\n */\n groupProps?: Omit<SidebarGroupProps, \"children\" | \"label\" | \"value\">\n /**\n * Props for the handle component.\n */\n handleProps?: SidebarHandleProps\n /**\n * Props for the header component.\n */\n headerProps?: SidebarHeaderProps\n /**\n * Props for the item content component.\n */\n itemContentProps?: SidebarItemContentProps\n /**\n * Props for the item component.\n */\n itemProps?: Omit<\n SidebarItemProps,\n \"children\" | \"items\" | \"label\" | \"open\" | \"value\"\n >\n /**\n * Props for the menu component.\n *\n * @default 'md'\n */\n menuProps?: SidebarMenuProps\n}\n\nexport const SidebarSidePanel = withContext<\"aside\", SidebarSidePanelProps>(\n ({\n animated = true,\n children,\n content,\n endElement,\n footer,\n header,\n indicator,\n indicatorHidden,\n items,\n loadingScheme,\n render,\n startElement,\n withHandle = true,\n contentProps,\n drawerProps,\n endElementProps,\n footerProps,\n groupContentProps,\n groupProps,\n handleProps,\n headerProps,\n indicatorProps,\n itemContentProps,\n itemProps,\n labelProps,\n linkProps,\n menuProps,\n startElementProps,\n tooltipProps,\n triggerProps,\n ...rest\n }) => {\n const { mobile, open, onClose } = useSidebarContext()\n const { breakpoint, placement, getSidePanelProps } = useComponentContext()\n const [\n omittedChildren,\n customHeader,\n customContent,\n customFooter,\n customHandle,\n ] = useSplitChildren(\n children,\n SidebarHeader,\n SidebarContent,\n SidebarFooter,\n SidebarHandle,\n )\n const context = useMemo(\n () => ({\n animated,\n endElement,\n indicator,\n indicatorHidden,\n items,\n loadingScheme,\n render,\n startElement,\n contentProps,\n endElementProps,\n footerProps,\n groupContentProps,\n groupProps,\n handleProps,\n headerProps,\n indicatorProps,\n itemContentProps,\n itemProps,\n labelProps,\n linkProps,\n menuProps,\n startElementProps,\n tooltipProps,\n triggerProps,\n }),\n [\n animated,\n endElement,\n indicator,\n indicatorHidden,\n items,\n render,\n loadingScheme,\n startElement,\n contentProps,\n endElementProps,\n footerProps,\n groupContentProps,\n groupProps,\n handleProps,\n headerProps,\n indicatorProps,\n itemContentProps,\n itemProps,\n labelProps,\n linkProps,\n menuProps,\n startElementProps,\n tooltipProps,\n triggerProps,\n ],\n )\n\n return (\n <SidePanelComponentContext value={context}>\n {mobile ? (\n <Drawer.Root\n size=\"sm\"\n autoFocus={false}\n duration={!animated ? 0 : undefined}\n open={open}\n placement={`inline-${placement}`}\n withCloseButton={false}\n portalProps={{ disabled: true }}\n onClose={onClose}\n {...drawerProps}\n >\n <Drawer.Content>\n {customHeader ??\n (header ? <SidebarHeader>{header}</SidebarHeader> : null)}\n\n {customContent ??\n (content || items ? (\n <SidebarContent>{content}</SidebarContent>\n ) : null)}\n\n {customFooter ??\n (footer ? <SidebarFooter>{footer}</SidebarFooter> : null)}\n </Drawer.Content>\n </Drawer.Root>\n ) : (\n <>\n <SidebarGap\n data-animated={dataAttr(animated)}\n display={\n breakpoint\n ? { base: undefined, [breakpoint]: \"none\" }\n : undefined\n }\n />\n\n <styled.aside\n data-animated={dataAttr(animated)}\n data-group\n display={\n breakpoint\n ? { base: undefined, [breakpoint]: \"none\" }\n : undefined\n }\n {...getSidePanelProps(rest)}\n >\n {customHeader ??\n (header ? <SidebarHeader>{header}</SidebarHeader> : null)}\n {customContent ??\n (content || items ? (\n <SidebarContent>{content}</SidebarContent>\n ) : null)}\n {customFooter ??\n (footer ? <SidebarFooter>{footer}</SidebarFooter> : null)}\n {customHandle ?? (withHandle ? <SidebarHandle /> : null)}\n\n {omittedChildren}\n </styled.aside>\n </>\n )}\n </SidePanelComponentContext>\n )\n },\n \"sidePanel\",\n)()\n\ninterface SidebarGapProps extends HTMLStyledProps<\"div\"> {}\n\nconst SidebarGap = withContext<\"div\", SidebarGapProps>(\"div\", \"gap\")()\n\nexport interface SidebarHeaderProps extends HTMLStyledProps<\"header\"> {}\n\nexport const SidebarHeader = withContext<\"header\", SidebarHeaderProps>(\n \"header\",\n \"header\",\n)(undefined, (props) => {\n const { getHeaderProps } = useComponentContext()\n const { headerProps } = useSidePanelComponentContext()\n\n return getHeaderProps(mergeProps(headerProps, props)())\n})\n\nexport interface SidebarFooterProps extends HTMLStyledProps<\"footer\"> {}\n\nexport const SidebarFooter = withContext<\"footer\", SidebarFooterProps>(\n \"footer\",\n \"footer\",\n)(undefined, (props) => {\n const { getFooterProps } = useComponentContext()\n const { footerProps } = useSidePanelComponentContext()\n\n return getFooterProps(mergeProps(footerProps, props)())\n})\n\nexport interface SidebarContentProps extends HTMLStyledProps<\"ul\"> {\n /**\n * If provided, generate elements based on items.\n */\n items?: SidebarItem[]\n}\n\nexport const SidebarContent = withContext<\"ul\", SidebarContentProps>(\n ({ children, items, ...rest }) => {\n const { getContentProps } = useComponentContext()\n const { items: rootItems, contentProps } = useSidePanelComponentContext()\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (items ?? rootItems)?.map((props, index) => {\n const key = createKey(props, index)\n\n if (\"group\" in props) {\n const { children, group: _, ...rest } = props\n\n return <SidebarGroup key={key} items={children} {...rest} />\n } else {\n const { children, ...rest } = props\n\n return <SidebarItem key={key} items={children} {...rest} />\n }\n })\n }, [children, items, rootItems])\n\n return (\n <styled.ul {...getContentProps(mergeProps(contentProps, rest)())}>\n {computedChildren}\n </styled.ul>\n )\n },\n \"content\",\n)()\n\nexport interface SidebarHandleProps extends HTMLStyledProps<\"button\"> {}\n\nexport const SidebarHandle = withContext<\"button\", SidebarHandleProps>(\n (props) => {\n const { handleProps } = useSidePanelComponentContext()\n\n return (\n <SidebarTrigger {...mergeProps(handleProps, props)()}>\n <styled.button tabIndex={-1} />\n </SidebarTrigger>\n )\n },\n \"handle\",\n)()\n\nexport interface SidebarGroupProps\n extends\n Omit<HTMLStyledProps<\"li\">, \"content\" | \"value\">,\n UseSidebarGroupProps {\n /**\n * If provided, generate elements based on items.\n */\n items?: SidebarItemWithValue[]\n /**\n * The label of the group.\n */\n label?: ReactNode\n /**\n * Props for the content component.\n */\n contentProps?: Omit<SidebarGroupContentProps, \"children\">\n /**\n * Props for the label component.\n */\n labelProps?: HTMLStyledProps<\"span\">\n}\n\nexport const SidebarGroup = withContext<\"li\", SidebarGroupProps>(\n ({\n children,\n items,\n label,\n value: valueProp = isString(label) ? label : undefined,\n contentProps,\n labelProps,\n ...rest\n }) => {\n const { groupProps } = useSidePanelComponentContext()\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return items?.map(({ children, ...rest }, index) => {\n const key = createKey(rest, index)\n\n return <SidebarItem key={key} items={children} {...rest} />\n })\n }, [children, items])\n const [omittedChildren, customLabel, customContent] = useSplitChildren(\n computedChildren,\n SidebarGroupLabel,\n SidebarGroupContent,\n )\n const { getContentProps, getLabelProps, getRootProps } = useSidebarGroup({\n ...mergeProps(groupProps, rest)(),\n value: valueProp,\n })\n const context = useMemo(\n () => ({ contentProps, getContentProps, getLabelProps, labelProps }),\n [getLabelProps, labelProps, getContentProps, contentProps],\n )\n\n return (\n <GroupComponentContext value={context}>\n <styled.li {...getRootProps()}>\n {customLabel ??\n (label ? <SidebarGroupLabel>{label}</SidebarGroupLabel> : null)}\n {customContent ?? (\n <SidebarGroupContent>{omittedChildren}</SidebarGroupContent>\n )}\n </styled.li>\n </GroupComponentContext>\n )\n },\n \"group\",\n)()\n\nexport interface SidebarGroupLabelProps extends HTMLStyledProps<\"span\"> {}\n\nexport const SidebarGroupLabel = withContext<\"span\", SidebarGroupLabelProps>(\n \"span\",\n \"groupLabel\",\n)(undefined, (props) => {\n const { getLabelProps, labelProps } = useGroupComponentContext()\n\n return getLabelProps(mergeProps(labelProps, props)())\n})\n\nexport interface SidebarGroupContentProps extends HTMLStyledProps<\"div\"> {}\n\nexport const SidebarGroupContent = withContext<\"div\", SidebarGroupContentProps>(\n \"div\",\n \"groupContent\",\n)(undefined, ({ children, ...rest }) => {\n const validChildren = useValidChildren(children)\n const list = useIncludesChildren(validChildren, SidebarItem)\n const { groupContentProps } = useSidePanelComponentContext()\n const { contentProps, getContentProps } = useGroupComponentContext()\n\n return {\n as: list ? \"ul\" : \"div\",\n children,\n ...getContentProps(mergeProps(groupContentProps, contentProps, rest)()),\n }\n})\n\nexport interface SidebarMenuProps extends HTMLStyledProps<\"div\"> {}\n\nexport const SidebarMenu = withContext<\"div\", SidebarMenuProps>(\"div\", \"menu\")(\n undefined,\n (props) => {\n const { menuProps } = useSidePanelComponentContext()\n\n return { \"data-menu\": \"\", ...mergeProps(menuProps, props)() }\n },\n)\n\nexport interface SidebarMenuButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const SidebarMenuButton = withContext<\"button\", SidebarMenuButtonProps>(\n \"button\",\n [\"menu\", \"button\"],\n)(undefined, (props) => {\n const { open } = useSidebarContext()\n const { mode } = useComponentContext()\n const { menuProps } = useSidePanelComponentContext()\n const offcanvas = mode === \"offcanvas\"\n const { disabled, ...rest } = mergeProps(menuProps, props)()\n\n return {\n \"data-menu\": \"\",\n disabled,\n ...rest,\n tabIndex: (!offcanvas || open) && !disabled ? 0 : -1,\n }\n})\n\nexport interface SidebarItemProps\n extends\n Omit<HTMLStyledProps<\"li\">, \"value\">,\n Omit<UseSidebarItemProps, \"asyncChildren\"> {\n /**\n * The label to display in the item.\n */\n label: ReactNode\n /**\n * If `true`, the sidebar item will be animated.\n *\n * @default true\n */\n animated?: boolean\n /**\n * The element to display at the end of the item.\n */\n endElement?: SidebarItemReactNode\n /**\n * The sidebar item indicator icon to use.\n */\n indicator?: ReactNodeOrFunction<SidebarItemCallBackProps>\n /**\n * If provided, generate elements based on items.\n */\n items?: SidebarItemWithValue[]\n /**\n * The loading scheme.\n *\n * @default 'oval'\n */\n loadingScheme?: Loading.Scheme\n /**\n * If provided, the sidebar item will be rendered with custom components.\n */\n render?: SidebarItemRender\n /**\n * The element to display at the start of the item.\n */\n startElement?: SidebarItemReactNode\n /**\n * Props for the content component.\n */\n contentProps?: Omit<SidebarItemContentProps, \"children\">\n /**\n * Props for the end component.\n */\n endElementProps?: SidebarItemEndElementProps\n /**\n * Props for the indicator component.\n */\n indicatorProps?: SidebarItemIndicatorProps\n /**\n * Props for the label component.\n */\n labelProps?: SidebarItemLabelProps\n /**\n * Props for the link component.\n */\n linkProps?: SidebarItemLinkProps\n /**\n * Props for the start component.\n */\n startElementProps?: SidebarItemStartElementProps\n /**\n * Props for the tooltip component.\n */\n tooltipProps?: Omit<SidebarItemTooltipProps, \"children\" | \"content\">\n /**\n * Props for the trigger component.\n */\n triggerProps?: SidebarItemTriggerProps\n /**\n * If provided, the sidebar item will be rendered as an async sidebar item.\n */\n asyncChildren?: () => Promise<SidebarItemWithValue[]>\n}\n\nexport const SidebarItem = withContext<\"li\", SidebarItemProps>(\n ({\n animated: animatedProp,\n asyncChildren: asyncChildrenProp,\n children: childrenProp,\n endElement,\n indicator: indicatorProp,\n items,\n label,\n loadingScheme,\n render,\n startElement,\n contentProps,\n endElementProps,\n indicatorProps,\n labelProps,\n linkProps,\n startElementProps,\n tooltipProps,\n triggerProps,\n ...rest\n }) => {\n const { mode } = useComponentContext()\n const offcanvas = mode === \"offcanvas\"\n const componentContext = useSidePanelComponentContext()\n const Loading = useLoadingComponent(\n loadingScheme ?? componentContext.loadingScheme ?? \"oval\",\n )\n const computedChildren = useMemo(() => {\n if (childrenProp) return childrenProp\n\n return items?.map(({ children, ...rest }, index) => {\n const key = createKey(rest, index)\n\n return <SidebarItem key={key} items={children} {...rest} />\n })\n }, [childrenProp, items])\n const asyncChildren = useCallback(async () => {\n const items = await asyncChildrenProp?.()\n\n return items?.map(({ children, ...rest }, index) => {\n const key = createKey(rest, index)\n\n return <SidebarItem key={key} items={children} {...rest} />\n })\n }, [asyncChildrenProp])\n const {\n branchOpen,\n children,\n disabled,\n expanded,\n expandedValue,\n group,\n groupLoading,\n groupOpen,\n open,\n selected,\n selectedValue,\n value,\n getContentProps,\n getIndicatorProps,\n getItemProps,\n getLabelProps,\n getLinkProps,\n getTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n } = useSidebarItem({\n ...mergeProps(componentContext.itemProps, rest)(),\n asyncChildren: asyncChildrenProp ? asyncChildren : undefined,\n children: computedChildren,\n })\n const animated = animatedProp ?? componentContext.animated ?? true\n const tabIndex = offcanvas\n ? open && expanded && !disabled\n ? 0\n : -1\n : expanded && !disabled\n ? 0\n : -1\n const callbackProps = useMemo(\n () => ({ disabled, expanded: groupOpen }),\n [disabled, groupOpen],\n )\n const mergedTriggerProps = useMemo(() => {\n return getTriggerProps({\n tabIndex,\n ...mergeProps(componentContext.triggerProps, triggerProps)(),\n }) as SidebarItemTriggerProps\n }, [getTriggerProps, tabIndex, componentContext.triggerProps, triggerProps])\n const mergedLinkProps = useMemo(() => {\n return getLinkProps({\n tabIndex,\n ...mergeProps(componentContext.linkProps, linkProps)(),\n }) as SidebarItemLinkProps\n }, [getLinkProps, tabIndex, componentContext.linkProps, linkProps])\n const indicator = useMemo<ReactNode>(\n () => runIfFn(indicatorProp ?? componentContext.indicator, callbackProps),\n [indicatorProp, componentContext.indicator, callbackProps],\n )\n const groupStartElement = useMemo<ReactNode>(\n () =>\n runIfFn(\n getReactNodeOrFunction(\n \"group\",\n startElement,\n componentContext.startElement,\n ),\n callbackProps,\n ),\n [startElement, componentContext.startElement, callbackProps],\n )\n const groupEndElement = useMemo<ReactNode>(\n () =>\n runIfFn(\n getReactNodeOrFunction(\n \"group\",\n endElement,\n componentContext.endElement,\n ),\n callbackProps,\n ),\n [endElement, componentContext.endElement, callbackProps],\n )\n const itemStartElement = useMemo<ReactNode>(\n () =>\n runIfFn(\n getReactNodeOrFunction(\n \"item\",\n startElement,\n componentContext.startElement,\n ),\n callbackProps,\n ),\n [startElement, componentContext.startElement, callbackProps],\n )\n const itemEndElement = useMemo<ReactNode>(\n () =>\n runIfFn(\n getReactNodeOrFunction(\n \"item\",\n endElement,\n componentContext.endElement,\n ),\n callbackProps,\n ),\n [endElement, componentContext.endElement, callbackProps],\n )\n const trigger = useMemo<ReactNode>(\n () =>\n runIfFn(render?.trigger ?? componentContext.render?.trigger, {\n endElement: groupEndElement,\n expanded,\n expandedValue,\n groupLoading,\n groupOpen,\n indicator,\n label,\n selected,\n selectedValue,\n startElement: groupStartElement,\n value,\n triggerProps: mergedTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n }),\n [\n render?.trigger,\n componentContext.render?.trigger,\n groupEndElement,\n expanded,\n expandedValue,\n groupLoading,\n groupOpen,\n indicator,\n label,\n selected,\n selectedValue,\n groupStartElement,\n value,\n mergedTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n ],\n )\n const link = useMemo<ReactNode>(\n () =>\n runIfFn(render?.link ?? componentContext.render?.link, {\n endElement: itemEndElement,\n expanded,\n expandedValue,\n label,\n selected,\n selectedValue,\n startElement: itemStartElement,\n value,\n linkProps: mergedLinkProps,\n onExpandedChange,\n onSelectedChange,\n }),\n [\n render?.link,\n componentContext.render?.link,\n itemEndElement,\n expanded,\n expandedValue,\n label,\n selected,\n selectedValue,\n itemStartElement,\n value,\n mergedLinkProps,\n onExpandedChange,\n onSelectedChange,\n ],\n )\n const item = useMemo<ReactNode>(\n () =>\n runIfFn(render?.item ?? componentContext.render?.item, {\n children,\n endElement: { group: groupEndElement, item: itemEndElement },\n expanded,\n expandedValue,\n group,\n groupLoading,\n groupOpen,\n indicator,\n label,\n link,\n selected,\n selectedValue,\n startElement: { group: groupStartElement, item: itemStartElement },\n trigger,\n value,\n itemProps: getItemProps() as HTMLStyledProps<\"li\">,\n linkProps: mergedLinkProps,\n triggerProps: mergedTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n }),\n [\n render?.item,\n componentContext.render?.item,\n children,\n groupEndElement,\n itemEndElement,\n expanded,\n expandedValue,\n group,\n groupLoading,\n groupOpen,\n indicator,\n label,\n link,\n selected,\n selectedValue,\n groupStartElement,\n itemStartElement,\n trigger,\n value,\n getItemProps,\n mergedLinkProps,\n mergedTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n ],\n )\n const context = useMemo(\n () => ({ branchOpen, groupOpen }),\n [branchOpen, groupOpen],\n )\n const itemComponentContext = useMemo(\n () => ({\n contentProps: {\n duration: !animated ? 0 : undefined,\n open: groupOpen,\n ...getContentProps(\n mergeProps(componentContext.itemContentProps, contentProps)(),\n ),\n },\n endElementProps: mergeProps(\n componentContext.endElementProps,\n endElementProps,\n )(),\n indicatorProps: getIndicatorProps({\n \"data-animated\": dataAttr(animated),\n ...mergeProps(componentContext.indicatorProps, indicatorProps)(),\n }) as SidebarItemIndicatorProps,\n labelProps: getLabelProps(\n mergeProps(componentContext.labelProps, labelProps)(),\n ) as SidebarItemLabelProps,\n startElementProps: mergeProps(\n componentContext.startElementProps,\n startElementProps,\n )(),\n tooltipProps: {\n content: label,\n disabled: open,\n ...mergeProps(componentContext.tooltipProps, tooltipProps)(),\n },\n }),\n [\n animated,\n componentContext.endElementProps,\n componentContext.indicatorProps,\n componentContext.itemContentProps,\n componentContext.labelProps,\n componentContext.startElementProps,\n componentContext.tooltipProps,\n contentProps,\n endElementProps,\n getContentProps,\n getIndicatorProps,\n getLabelProps,\n groupOpen,\n indicatorProps,\n label,\n labelProps,\n open,\n startElementProps,\n tooltipProps,\n ],\n )\n\n return (\n <SidebarItemContext value={context}>\n <ItemComponentContext value={itemComponentContext}>\n {item ?? (\n <styled.li {...getItemProps()}>\n {group ? (\n <>\n {trigger ?? (\n <SidebarItemTrigger {...mergedTriggerProps}>\n {groupStartElement ? (\n <SidebarItemStartElement>\n {groupStartElement}\n </SidebarItemStartElement>\n ) : null}\n {label ? (\n <SidebarItemLabel>{label}</SidebarItemLabel>\n ) : null}\n {groupEndElement ? (\n <SidebarItemEndElement>\n {groupEndElement}\n </SidebarItemEndElement>\n ) : null}\n <SidebarItemIndicator>\n {groupLoading ? (\n <Loading />\n ) : (\n runIfFn(indicator, callbackProps)\n )}\n </SidebarItemIndicator>\n </SidebarItemTrigger>\n )}\n\n <SidebarItemContent>{children}</SidebarItemContent>\n </>\n ) : (\n (link ?? (\n <SidebarItemLink {...mergedLinkProps}>\n {itemStartElement ? (\n <SidebarItemStartElement>\n {itemStartElement}\n </SidebarItemStartElement>\n ) : null}\n {label ? (\n <SidebarItemLabel>{label}</SidebarItemLabel>\n ) : null}\n {itemEndElement ? (\n <SidebarItemEndElement>\n {itemEndElement}\n </SidebarItemEndElement>\n ) : null}\n </SidebarItemLink>\n ))\n )}\n </styled.li>\n )}\n </ItemComponentContext>\n </SidebarItemContext>\n )\n },\n \"item\",\n)()\n\ninterface SidebarItemTooltipProps extends TooltipProps {}\n\nconst SidebarItemTooltip: FC<SidebarItemTooltipProps> = (props) => {\n const { tooltipProps } = useItemComponentContext()\n const { children, disabled, ...rest } = mergeProps(tooltipProps, props)()\n const { mode, placement } = useComponentContext()\n const offcanvas = mode === \"offcanvas\"\n\n if (offcanvas || disabled) return children\n else\n return (\n <Tooltip\n closeOnClick={false}\n gutter={16}\n placement={`center-${placement === \"start\" ? \"end\" : \"start\"}`}\n {...rest}\n >\n {children}\n </Tooltip>\n )\n}\n\nexport interface SidebarItemTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const SidebarItemTrigger = withContext<\n \"button\",\n SidebarItemTriggerProps\n>((props) => {\n return (\n <SidebarItemTooltip>\n <styled.button {...props} />\n </SidebarItemTooltip>\n )\n}, \"itemTrigger\")()\n\nexport interface SidebarItemLinkProps extends HTMLStyledProps<\"a\"> {}\n\nexport const SidebarItemLink = withContext<\"a\", SidebarItemLinkProps>(\n (props) => {\n return (\n <SidebarItemTooltip>\n <styled.a {...props} />\n </SidebarItemTooltip>\n )\n },\n \"itemLink\",\n)()\n\nexport interface SidebarItemContentProps\n extends\n Omit<HTMLStyledProps<\"ul\">, \"transition\">,\n Pick<CollapseProps, \"animationOpacity\" | keyof WithTransitionProps> {}\n\nexport const SidebarItemContent = withContext<\"ul\", SidebarItemContentProps>(\n (props) => {\n const { contentProps } = useItemComponentContext()\n\n return (\n <Collapse\n as=\"ul\"\n {...cast<CollapseProps>(mergeProps(contentProps, props)())}\n />\n )\n },\n \"itemContent\",\n)()\n\nexport interface SidebarItemIndicatorProps extends HTMLStyledProps<\"svg\"> {}\n\nexport const SidebarItemIndicator = withContext<\n \"svg\",\n SidebarItemIndicatorProps\n>(({ children = <ChevronRightIcon />, ...rest }) => {\n const { indicatorHidden } = useSidePanelComponentContext()\n\n if (indicatorHidden) return null\n\n if (isValidElement<HTMLProps<\"svg\">>(children))\n return cloneElement(children, { ...rest, ...children.props })\n\n return Children.count(children) > 1 ? Children.only(null) : null\n}, \"itemIndicator\")(undefined, (props) => {\n const { indicatorProps } = useItemComponentContext()\n\n return mergeProps(indicatorProps, props)()\n})\n\nexport interface SidebarItemStartElementProps extends HTMLStyledProps {}\n\nexport const SidebarItemStartElement = withContext<\n \"div\",\n SidebarItemStartElementProps\n>(\"div\", {\n name: \"ItemStartElement\",\n slot: [\"itemElement\", \"start\"],\n})(undefined, (props) => {\n const { startElementProps } = useItemComponentContext()\n\n return mergeProps(startElementProps, props)()\n})\n\nexport interface SidebarItemEndElementProps extends HTMLStyledProps {}\n\nexport const SidebarItemEndElement = withContext<\n \"div\",\n SidebarItemEndElementProps\n>(\"div\", {\n name: \"ItemEndElement\",\n slot: [\"itemElement\", \"end\"],\n})(undefined, (props) => {\n const { endElementProps } = useItemComponentContext()\n\n return mergeProps(endElementProps, props)()\n})\n\nexport interface SidebarItemLabelProps extends HTMLStyledProps<\"span\"> {}\n\nexport const SidebarItemLabel = withContext<\"span\", SidebarItemLabelProps>(\n \"span\",\n \"itemLabel\",\n)(undefined, (props) => {\n const { labelProps } = useItemComponentContext()\n\n return mergeProps(labelProps, props)()\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0JA,MAAM,aAAa,OAAoB,UAAkB;CACvD,OAAO,WAAW,QAAQ,MAAM,SAAS,QAAQ;AACnD;AAEA,MAAM,0BACJ,MACA,QACA,SACkD;CAClD,KAAA,GAAA,cAAA,SAAA,CAAa,MAAM,MAAM,WAAW,UAAU,UAAU,SACtD,OAAO,OAAO;MACX,IAAI,QAAQ,OAAO;MACnB,KAAA,GAAA,cAAA,SAAA,CAAa,IAAI,MAAM,WAAW,QAAQ,UAAU,OACvD,OAAO,KAAK;MACT,OAAO;AACd;AAoBA,MAAM,CAAC,uBAAuB,4BAC5BA,gBAAqC,EAAE,MAAM,wBAAwB,CAAC;AAWxE,MAAM,CAAC,sBAAsB,2BAC3BA,gBAAoC,EAAE,MAAM,uBAAu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,oBAAoB;CAEhD,OAAO;EAAE,SAAS;EAAM,GAAG,gBAAgB,KAAK;CAAE;AACpD,CAAC;AA8GD,MAAa,mBAAmB,aAC7B,EACC,WAAW,MACX,UACA,SACA,YACA,QACA,QACA,WACA,iBACA,OACA,eACA,QACA,cACA,aAAa,MACb,cACA,aACA,iBACA,aACA,mBACA,YACA,aACA,aACA,gBACA,kBACA,WACA,YACA,WACA,WACA,mBACA,cACA,cACA,GAAG,WACC;CACJ,MAAM,EAAE,QAAQ,MAAM,YAAY,kBAAkB;CACpD,MAAM,EAAE,YAAY,WAAW,sBAAsB,oBAAoB;CACzE,MAAM,CACJ,iBACA,cACA,eACA,cACA,gBACE,iBACF,UACA,eACA,gBACA,eACA,aACF;CACA,MAAM,UAAU,eACP;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,oBAAC,2BAAD;EAA2B,OAAO;EAC/B,UAAA,SACC,oBAACC,YAAD;GACE,MAAK;GACL,WAAW;GACX,UAAU,CAAC,WAAW,IAAI,KAAA;GACpB;GACN,WAAW,UAAU;GACrB,iBAAiB;GACjB,aAAa,EAAE,UAAU,KAAK;GACrB;GACT,GAAI;GAEJ,UAAA,qBAACC,eAAD,EAAA,UAAA;IACG,iBACE,SAAS,oBAAC,eAAD,EAAA,UAAgB,OAAsB,CAAA,IAAI;IAErD,kBACE,WAAW,QACV,oBAAC,gBAAD,EAAA,UAAiB,QAAwB,CAAA,IACvC;IAEL,iBACE,SAAS,oBAAC,eAAD,EAAA,UAAgB,OAAsB,CAAA,IAAI;GACxC,EAAA,CAAA;EACL,CAAA,IAEb,qBAAA,YAAA,EAAA,UAAA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nB,uBACE,QACA,cACA,iBAAiB,YACnB,GACA,aACF,GACF;EAAC;EAAc,iBAAiB;EAAc;CAAa,CAC7D;CACA,MAAM,iBAAiB,eAAA,GAAA,cAAA,QAAA,CAGjB,uBACE,QACA,YACA,iBAAiB,UACnB,GACA,aACF,GACF;EAAC;EAAY,iBAAiB;EAAY;CAAa,CACzD;CACA,MAAM,UAAU,eAAA,GAAA,cAAA,QAAA,CAEJ,QAAQ,WAAW,iBAAiB,QAAQ,SAAS;EAC3D,YAAY;EACZ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA,cAAc;EACd;EACA;EACA;EACA;EACA;CACF,CAAC,GACH;EACE,QAAQ;EACR,iBAAiB,QAAQ;EACzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CACA,MAAM,OAAO,eAAA,GAAA,cAAA,QAAA,CAED,QAAQ,QAAQ,iBAAiB,QAAQ,MAAM;EACrD,YAAY;EACZ;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA,WAAW;EACX;EACA;CACF,CAAC,GACH;EACE,QAAQ;EACR,iBAAiB,QAAQ;EACzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CACA,MAAM,OAAO,eAAA,GAAA,cAAA,QAAA,CAED,QAAQ,QAAQ,iBAAiB,QAAQ,MAAM;EACrD;EACA,YAAY;GAAE,OAAO;GAAiB,MAAM;EAAe;EAC3D;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;GAAE,OAAO;GAAmB,MAAM;EAAiB;EACjE;EACA;EACA,WAAW,aAAa;EACxB,WAAW;EACX,cAAc;EACd;EACA;EACA;EACA;EACA;CACF,CAAC,GACH;EACE,QAAQ;EACR,iBAAiB,QAAQ;EACzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;E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AA,GAAA,cAAA,KAAA,CAAwB,WAAW,cAAc,KAAK,CAAC,CAAC,CAAC;CAC1D,CAAA;AAEL,GACA,aACF,CAAC,CAAC;AAIF,MAAa,uBAAuB,aAGjC,EAAE,WAAW,oBAAC,kBAAD,CAAmB,CAAA,GAAG,GAAG,WAAW;CAClD,MAAM,EAAE,oBAAoB,6BAA6B;CAEzD,IAAI,iBAAiB,OAAO;CAE5B,IAAI,eAAiC,QAAQ,GAC3C,OAAO,aAAa,UAAU;EAAE,GAAG;EAAM,GAAG,SAAS;CAAM,CAAC;CAE9D,OAAO,SAAS,MAAM,QAAQ,IAAI,IAAI,SAAS,KAAK,IAAI,IAAI;AAC9D,GAAG,eAAe,CAAC,CAAC,KAAA,IAAY,UAAU;CACxC,MAAM,EAAE,mBAAmB,wBAAwB;CAEnD,OAAO,WAAW,gBAAgB,KAAK,CAAC,CAAC;AAC3C,CAAC;AAID,MAAa,0BAA0B,YAGrC,OAAO;CACP,MAAM;CACN,MAAM,CAAC,eAAe,OAAO;AAC/B,CAAC,CAAC,CAAC,KAAA,IAAY,UAAU;CACvB,MAAM,EAAE,sBAAsB,wBAAwB;CAEtD,OAAO,WAAW,mBAAmB,KAAK,CAAC,CAAC;AAC9C,CAAC;AAID,MAAa,wBAAwB,YAGnC,OAAO;CACP,MAAM;CACN,MAAM,CAAC,eAAe,KAAK;AAC7B,CAAC,CAAC,CAAC,KAAA,IAAY,UAAU;CACvB,MAAM,EAAE,oBAAoB,wBAAwB;CAEpD,OAAO,WAAW,iBAAiB,KAAK,CAAC,CAAC;AAC5C,CAAC;AAID,MAAa,mBAAmB,YAC9B,QACA,WACF,CAAC,CAAC,KAAA,IAAY,UAAU;CACtB,MAAM,EAAE,eAAe,wBAAwB;CAE/C,OAAO,WAAW,YAAY,KAAK,CAAC,CAAC;AACvC,CAAC"}
|
|
1
|
+
{"version":3,"file":"sidebar.js","names":["isObject","createContext","Drawer.Root","Drawer.Content","dataAttr","isString","runIfFn","cast"],"sources":["../../../../src/components/sidebar/sidebar.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, PropsWithChildren, ReactNode } from \"react\"\nimport type {\n Breakpoint,\n ExtractStyleValue,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport type { CollapseProps } from \"../collapse\"\nimport type { Loading } from \"../loading\"\nimport type { WithTransitionProps } from \"../motion\"\nimport type {\n UseSidebarGroupProps,\n UseSidebarGroupReturn,\n UseSidebarItemProps,\n UseSidebarItemReturn,\n UseSidebarProps,\n UseSidebarReturn,\n} from \"./use-sidebar\"\nimport {\n Children,\n cloneElement,\n isValidElement,\n useCallback,\n useMemo,\n} from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport { useBreakpointValue } from \"../../hooks/use-breakpoint\"\nimport { useValue } from \"../../hooks/use-value\"\nimport {\n cast,\n createContext,\n dataAttr,\n isObject,\n isString,\n runIfFn,\n useIncludesChildren,\n useSplitChildren,\n useValidChildren,\n} from \"../../utils\"\nimport { Collapse } from \"../collapse\"\nimport { Drawer } from \"../drawer\"\nimport { ChevronRightIcon } from \"../icon\"\nimport { useLoadingComponent } from \"../loading\"\nimport { Tooltip, type TooltipProps } from \"../tooltip\"\nimport { sidebarStyle, type SidebarStyle } from \"./sidebar.style\"\nimport {\n SidebarContext,\n SidebarDescendantsContext,\n SidebarItemContext,\n useSidebar,\n useSidebarContext,\n useSidebarGroup,\n useSidebarItem,\n} from \"./use-sidebar\"\n\ninterface SidebarItemCallBackProps {\n disabled?: boolean\n expanded?: boolean\n}\n\ntype SidebarItemReactNode =\n | ReactNodeOrFunction<SidebarItemCallBackProps>\n | {\n group: ReactNodeOrFunction<SidebarItemCallBackProps>\n item?: ReactNodeOrFunction<SidebarItemCallBackProps>\n }\n | {\n item: ReactNodeOrFunction<SidebarItemCallBackProps>\n group?: ReactNodeOrFunction<SidebarItemCallBackProps>\n }\n\ninterface SidebarItemSharedRenderProps\n extends\n Pick<SidebarItemProps, \"label\">,\n Pick<\n UseSidebarItemReturn,\n | \"expanded\"\n | \"expandedValue\"\n | \"onExpandedChange\"\n | \"onSelectedChange\"\n | \"selected\"\n | \"selectedValue\"\n | \"value\"\n > {\n itemProps: HTMLStyledProps<\"li\">\n linkProps: HTMLStyledProps<\"a\">\n triggerProps: HTMLStyledProps<\"button\">\n endElement?: ReactNode\n startElement?: ReactNode\n}\n\ninterface SidebarItemRenderProps\n extends\n PropsWithChildren,\n Omit<SidebarItemSharedRenderProps, \"endElement\" | \"startElement\">,\n Pick<\n UseSidebarItemReturn,\n | \"group\"\n | \"groupLoading\"\n | \"groupOpen\"\n | \"onGroupClose\"\n | \"onGroupOpen\"\n | \"onGroupToggle\"\n > {\n endElement: { group?: ReactNode; item?: ReactNode }\n startElement: { group?: ReactNode; item?: ReactNode }\n indicator?: ReactNode\n link?: ReactNode\n trigger?: ReactNode\n}\n\ninterface SidebarItemLinkRenderProps extends Omit<\n SidebarItemSharedRenderProps,\n \"itemProps\" | \"triggerProps\"\n> {}\n\ninterface SidebarItemTriggerRenderProps\n extends\n Omit<SidebarItemSharedRenderProps, \"itemProps\" | \"linkProps\">,\n Pick<\n UseSidebarItemReturn,\n | \"groupLoading\"\n | \"groupOpen\"\n | \"onGroupClose\"\n | \"onGroupOpen\"\n | \"onGroupToggle\"\n > {\n indicator?: ReactNode\n}\n\ninterface SidebarItemRender {\n item?: ReactNodeOrFunction<SidebarItemRenderProps>\n link?: ReactNodeOrFunction<SidebarItemLinkRenderProps>\n trigger?: ReactNodeOrFunction<SidebarItemTriggerRenderProps>\n}\n\ninterface SidebarGroup extends Omit<SidebarGroupProps, \"children\" | \"value\"> {\n children: SidebarItemWithValue[]\n group: true\n}\n\nexport interface SidebarItemWithValue extends Omit<\n SidebarItemProps,\n \"children\"\n> {\n children?: SidebarItemWithValue[]\n}\n\nexport type SidebarItem = SidebarGroup | SidebarItemWithValue\n\nconst createKey = (props: SidebarItem, index: number) => {\n return \"value\" in props ? props.value || index : index\n}\n\nconst getReactNodeOrFunction = (\n type: \"group\" | \"item\",\n custom?: SidebarItemReactNode,\n root?: SidebarItemReactNode,\n): ReactNodeOrFunction<SidebarItemCallBackProps> => {\n if (isObject(custom) && (\"group\" in custom || \"item\" in custom))\n return custom[type]\n else if (custom) return custom\n else if (isObject(root) && (\"group\" in root || \"item\" in root))\n return root[type]\n else return root\n}\n\ninterface ComponentContext extends Pick<\n UseSidebarReturn,\n | \"getContentProps\"\n | \"getFooterProps\"\n | \"getHeaderProps\"\n | \"getSidePanelProps\"\n | \"getTriggerProps\"\n> {\n breakpoint: ExtractStyleValue<NonNullable<SidebarRootProps[\"breakpoint\"]>>\n mode: ExtractStyleValue<NonNullable<SidebarRootProps[\"mode\"]>>\n placement: ExtractStyleValue<NonNullable<SidebarRootProps[\"placement\"]>>\n}\n\ninterface GroupComponentContext\n extends\n Pick<SidebarGroupProps, \"contentProps\" | \"labelProps\">,\n Pick<UseSidebarGroupReturn, \"getContentProps\" | \"getLabelProps\"> {}\n\nconst [GroupComponentContext, useGroupComponentContext] =\n createContext<GroupComponentContext>({ name: \"GroupComponentContext\" })\n\ninterface ItemComponentContext {\n contentProps: SidebarItemContentProps\n endElementProps: SidebarItemEndElementProps\n indicatorProps: SidebarItemIndicatorProps\n labelProps: SidebarItemLabelProps\n startElementProps: SidebarItemStartElementProps\n tooltipProps: SidebarItemTooltipProps\n}\n\nconst [ItemComponentContext, useItemComponentContext] =\n createContext<ItemComponentContext>({ name: \"ItemComponentContext\" })\n\ninterface SidePanelComponentContext extends Pick<\n SidebarSidePanelProps,\n | \"animated\"\n | \"contentProps\"\n | \"endElement\"\n | \"endElementProps\"\n | \"footerProps\"\n | \"groupContentProps\"\n | \"groupProps\"\n | \"handleProps\"\n | \"headerProps\"\n | \"indicator\"\n | \"indicatorHidden\"\n | \"indicatorProps\"\n | \"itemContentProps\"\n | \"itemProps\"\n | \"items\"\n | \"labelProps\"\n | \"linkProps\"\n | \"loadingScheme\"\n | \"menuProps\"\n | \"render\"\n | \"startElement\"\n | \"startElementProps\"\n | \"tooltipProps\"\n | \"triggerProps\"\n> {}\n\nconst [SidePanelComponentContext, useSidePanelComponentContext] =\n createContext<SidePanelComponentContext>({\n name: \"SidePanelComponentContext\",\n })\n\nexport interface SidebarRootProps\n extends\n HTMLStyledProps<\"div\">,\n ThemeProps<SidebarStyle>,\n Omit<UseSidebarProps, \"mobile\"> {\n /**\n * The breakpoint to use for the sidebar. If `false`, the sidebar will be always visible.\n *\n * @default 'md'\n */\n breakpoint?: Exclude<Breakpoint, \"base\"> | false\n}\n\nconst {\n ComponentContext,\n PropsContext: SidebarPropsContext,\n useComponentContext,\n usePropsContext: useSidebarPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<SidebarRootProps, SidebarStyle, ComponentContext>(\n \"sidebar\",\n sidebarStyle,\n)\n\nexport { SidebarPropsContext, useSidebarPropsContext }\n\n/**\n * `Sidebar` is a component that is used to display a list of items in a sidebar.\n *\n * @see https://yamada-ui.com/docs/components/sidebar\n */\nexport const SidebarRoot = withProvider<\n \"div\",\n SidebarRootProps,\n \"mode\" | \"placement\"\n>(\n ({\n breakpoint = \"md\",\n mode: modeProp = \"offcanvas\",\n placement: placementProp = \"start\",\n ...rest\n }) => {\n const mobile =\n useBreakpointValue<boolean | undefined>(\n breakpoint ? { [breakpoint]: true } : { base: false },\n ) ?? false\n const mode = useValue(modeProp)\n const placement = useValue(placementProp)\n const {\n descendants,\n expandedValue,\n open,\n selectedValue,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getRootProps,\n getSidePanelProps,\n getTriggerProps,\n onClose,\n onExpandedChange,\n onOpen,\n onSelectedChange,\n onToggle,\n } = useSidebar({ mobile, ...rest })\n const context = useMemo(\n () => ({\n expandedValue,\n mobile,\n open,\n selectedValue,\n onClose,\n onExpandedChange,\n onOpen,\n onSelectedChange,\n onToggle,\n }),\n [\n mobile,\n expandedValue,\n open,\n selectedValue,\n onClose,\n onExpandedChange,\n onOpen,\n onSelectedChange,\n onToggle,\n ],\n )\n const componentContext = useMemo(\n () => ({\n breakpoint,\n mode,\n placement,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getSidePanelProps,\n getTriggerProps,\n }),\n [\n breakpoint,\n mode,\n placement,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getSidePanelProps,\n getTriggerProps,\n ],\n )\n\n return (\n <SidebarDescendantsContext value={descendants}>\n <SidebarContext value={context}>\n <ComponentContext value={componentContext}>\n <styled.div data-group {...getRootProps()} />\n </ComponentContext>\n </SidebarContext>\n </SidebarDescendantsContext>\n )\n },\n \"root\",\n { transferProps: [\"mode\", \"placement\"] },\n)()\n\nexport interface SidebarMainPanelProps extends HTMLStyledProps {}\n\nexport const SidebarMainPanel = withContext<\"div\", SidebarMainPanelProps>(\n \"div\",\n \"mainPanel\",\n)()\n\nexport interface SidebarTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const SidebarTrigger = withContext<\"button\", SidebarTriggerProps>(\n \"button\",\n \"trigger\",\n)(undefined, (props) => {\n const { getTriggerProps } = useComponentContext()\n\n return { asChild: true, ...getTriggerProps(props) }\n})\n\nexport interface SidebarSidePanelProps\n extends\n Omit<HTMLStyledProps<\"aside\">, \"content\">,\n Pick<SidebarContentProps, \"items\">,\n Pick<\n SidebarItemProps,\n | \"animated\"\n | \"endElement\"\n | \"endElementProps\"\n | \"indicator\"\n | \"indicatorProps\"\n | \"labelProps\"\n | \"linkProps\"\n | \"loadingScheme\"\n | \"render\"\n | \"startElement\"\n | \"startElementProps\"\n | \"tooltipProps\"\n | \"triggerProps\"\n > {\n /**\n * The content of the sidebar.\n */\n content?: ReactNode\n /**\n * The footer of the sidebar.\n */\n footer?: ReactNode\n /**\n * The header of the sidebar.\n */\n header?: ReactNode\n /**\n * If `true`, hide the tree indicator icon for all items.\n *\n * @default false\n */\n indicatorHidden?: boolean\n /**\n * If `true`, the sidebar will be rendered with a handle.\n *\n * @default true\n */\n withHandle?: boolean\n /**\n * Props for the content component.\n */\n contentProps?: SidebarContentProps\n /**\n * Props for the drawer component.\n */\n drawerProps?: Omit<\n Drawer.RootProps,\n | \"body\"\n | \"cancel\"\n | \"children\"\n | \"footer\"\n | \"header\"\n | \"middle\"\n | \"onCancel\"\n | \"onClose\"\n | \"onMiddle\"\n | \"onOpen\"\n | \"onSuccess\"\n | \"open\"\n | \"success\"\n | \"title\"\n | \"trigger\"\n >\n /**\n * Props for the footer component.\n */\n footerProps?: SidebarFooterProps\n /**\n * Props for the group content component.\n */\n groupContentProps?: Omit<SidebarGroupContentProps, \"children\">\n /**\n * Props for the group component.\n */\n groupProps?: Omit<SidebarGroupProps, \"children\" | \"label\" | \"value\">\n /**\n * Props for the handle component.\n */\n handleProps?: SidebarHandleProps\n /**\n * Props for the header component.\n */\n headerProps?: SidebarHeaderProps\n /**\n * Props for the item content component.\n */\n itemContentProps?: SidebarItemContentProps\n /**\n * Props for the item component.\n */\n itemProps?: Omit<\n SidebarItemProps,\n \"children\" | \"items\" | \"label\" | \"open\" | \"value\"\n >\n /**\n * Props for the menu component.\n *\n * @default 'md'\n */\n menuProps?: SidebarMenuProps\n}\n\nexport const SidebarSidePanel = withContext<\"aside\", SidebarSidePanelProps>(\n ({\n animated = true,\n children,\n content,\n endElement,\n footer,\n header,\n indicator,\n indicatorHidden,\n items,\n loadingScheme,\n render,\n startElement,\n withHandle = true,\n contentProps,\n drawerProps,\n endElementProps,\n footerProps,\n groupContentProps,\n groupProps,\n handleProps,\n headerProps,\n indicatorProps,\n itemContentProps,\n itemProps,\n labelProps,\n linkProps,\n menuProps,\n startElementProps,\n tooltipProps,\n triggerProps,\n ...rest\n }) => {\n const { mobile, open, onClose } = useSidebarContext()\n const { breakpoint, placement, getSidePanelProps } = useComponentContext()\n const [\n omittedChildren,\n customHeader,\n customContent,\n customFooter,\n customHandle,\n ] = useSplitChildren(\n children,\n SidebarHeader,\n SidebarContent,\n SidebarFooter,\n SidebarHandle,\n )\n const context = useMemo(\n () => ({\n animated,\n endElement,\n indicator,\n indicatorHidden,\n items,\n loadingScheme,\n render,\n startElement,\n contentProps,\n endElementProps,\n footerProps,\n groupContentProps,\n groupProps,\n handleProps,\n headerProps,\n indicatorProps,\n itemContentProps,\n itemProps,\n labelProps,\n linkProps,\n menuProps,\n startElementProps,\n tooltipProps,\n triggerProps,\n }),\n [\n animated,\n endElement,\n indicator,\n indicatorHidden,\n items,\n render,\n loadingScheme,\n startElement,\n contentProps,\n endElementProps,\n footerProps,\n groupContentProps,\n groupProps,\n handleProps,\n headerProps,\n indicatorProps,\n itemContentProps,\n itemProps,\n labelProps,\n linkProps,\n menuProps,\n startElementProps,\n tooltipProps,\n triggerProps,\n ],\n )\n\n return (\n <SidePanelComponentContext value={context}>\n {mobile ? (\n <Drawer.Root\n size=\"sm\"\n autoFocus={false}\n duration={!animated ? 0 : undefined}\n open={open}\n placement={`inline-${placement}`}\n withCloseButton={false}\n portalProps={{ disabled: true }}\n onClose={onClose}\n {...drawerProps}\n >\n <Drawer.Content>\n {customHeader ??\n (header ? <SidebarHeader>{header}</SidebarHeader> : null)}\n\n {customContent ??\n (content || items ? (\n <SidebarContent>{content}</SidebarContent>\n ) : null)}\n\n {customFooter ??\n (footer ? <SidebarFooter>{footer}</SidebarFooter> : null)}\n </Drawer.Content>\n </Drawer.Root>\n ) : (\n <>\n <SidebarGap\n data-animated={dataAttr(animated)}\n display={\n breakpoint\n ? { base: undefined, [breakpoint]: \"none\" }\n : undefined\n }\n />\n\n <styled.aside\n data-animated={dataAttr(animated)}\n data-group\n display={\n breakpoint\n ? { base: undefined, [breakpoint]: \"none\" }\n : undefined\n }\n {...getSidePanelProps(rest)}\n >\n {customHeader ??\n (header ? <SidebarHeader>{header}</SidebarHeader> : null)}\n {customContent ??\n (content || items ? (\n <SidebarContent>{content}</SidebarContent>\n ) : null)}\n {customFooter ??\n (footer ? <SidebarFooter>{footer}</SidebarFooter> : null)}\n {customHandle ?? (withHandle ? <SidebarHandle /> : null)}\n\n {omittedChildren}\n </styled.aside>\n </>\n )}\n </SidePanelComponentContext>\n )\n },\n \"sidePanel\",\n)()\n\ninterface SidebarGapProps extends HTMLStyledProps<\"div\"> {}\n\nconst SidebarGap = withContext<\"div\", SidebarGapProps>(\"div\", \"gap\")()\n\nexport interface SidebarHeaderProps extends HTMLStyledProps<\"header\"> {}\n\nexport const SidebarHeader = withContext<\"header\", SidebarHeaderProps>(\n \"header\",\n \"header\",\n)(undefined, (props) => {\n const { getHeaderProps } = useComponentContext()\n const { headerProps } = useSidePanelComponentContext()\n\n return getHeaderProps(mergeProps(headerProps, props)())\n})\n\nexport interface SidebarFooterProps extends HTMLStyledProps<\"footer\"> {}\n\nexport const SidebarFooter = withContext<\"footer\", SidebarFooterProps>(\n \"footer\",\n \"footer\",\n)(undefined, (props) => {\n const { getFooterProps } = useComponentContext()\n const { footerProps } = useSidePanelComponentContext()\n\n return getFooterProps(mergeProps(footerProps, props)())\n})\n\nexport interface SidebarContentProps extends HTMLStyledProps<\"ul\"> {\n /**\n * If provided, generate elements based on items.\n */\n items?: SidebarItem[]\n}\n\nexport const SidebarContent = withContext<\"ul\", SidebarContentProps>(\n ({ children, items, ...rest }) => {\n const { getContentProps } = useComponentContext()\n const { items: rootItems, contentProps } = useSidePanelComponentContext()\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (items ?? rootItems)?.map((props, index) => {\n const key = createKey(props, index)\n\n if (\"group\" in props) {\n const { children, group: _, ...rest } = props\n\n return <SidebarGroup key={key} items={children} {...rest} />\n } else {\n const { children, ...rest } = props\n\n return <SidebarItem key={key} items={children} {...rest} />\n }\n })\n }, [children, items, rootItems])\n\n return (\n <styled.ul {...getContentProps(mergeProps(contentProps, rest)())}>\n {computedChildren}\n </styled.ul>\n )\n },\n \"content\",\n)()\n\nexport interface SidebarHandleProps extends HTMLStyledProps<\"button\"> {}\n\nexport const SidebarHandle = withContext<\"button\", SidebarHandleProps>(\n (props) => {\n const { handleProps } = useSidePanelComponentContext()\n\n return (\n <SidebarTrigger {...mergeProps(handleProps, props)()}>\n <styled.button tabIndex={-1} />\n </SidebarTrigger>\n )\n },\n \"handle\",\n)()\n\nexport interface SidebarGroupProps\n extends\n Omit<HTMLStyledProps<\"li\">, \"content\" | \"value\">,\n UseSidebarGroupProps {\n /**\n * If provided, generate elements based on items.\n */\n items?: SidebarItemWithValue[]\n /**\n * The label of the group.\n */\n label?: ReactNode\n /**\n * Props for the content component.\n */\n contentProps?: Omit<SidebarGroupContentProps, \"children\">\n /**\n * Props for the label component.\n */\n labelProps?: HTMLStyledProps<\"span\">\n}\n\nexport const SidebarGroup = withContext<\"li\", SidebarGroupProps>(\n ({\n children,\n items,\n label,\n value: valueProp = isString(label) ? label : undefined,\n contentProps,\n labelProps,\n ...rest\n }) => {\n const { groupProps } = useSidePanelComponentContext()\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return items?.map(({ children, ...rest }, index) => {\n const key = createKey(rest, index)\n\n return <SidebarItem key={key} items={children} {...rest} />\n })\n }, [children, items])\n const [omittedChildren, customLabel, customContent] = useSplitChildren(\n computedChildren,\n SidebarGroupLabel,\n SidebarGroupContent,\n )\n const { getContentProps, getLabelProps, getRootProps } = useSidebarGroup({\n ...mergeProps(groupProps, rest)(),\n value: valueProp,\n })\n const context = useMemo(\n () => ({ contentProps, getContentProps, getLabelProps, labelProps }),\n [getLabelProps, labelProps, getContentProps, contentProps],\n )\n\n return (\n <GroupComponentContext value={context}>\n <styled.li {...getRootProps()}>\n {customLabel ??\n (label ? <SidebarGroupLabel>{label}</SidebarGroupLabel> : null)}\n {customContent ?? (\n <SidebarGroupContent>{omittedChildren}</SidebarGroupContent>\n )}\n </styled.li>\n </GroupComponentContext>\n )\n },\n \"group\",\n)()\n\nexport interface SidebarGroupLabelProps extends HTMLStyledProps<\"span\"> {}\n\nexport const SidebarGroupLabel = withContext<\"span\", SidebarGroupLabelProps>(\n \"span\",\n \"groupLabel\",\n)(undefined, (props) => {\n const { getLabelProps, labelProps } = useGroupComponentContext()\n\n return getLabelProps(mergeProps(labelProps, props)())\n})\n\nexport interface SidebarGroupContentProps extends HTMLStyledProps<\"div\"> {}\n\nexport const SidebarGroupContent = withContext<\"div\", SidebarGroupContentProps>(\n \"div\",\n \"groupContent\",\n)(undefined, ({ children, ...rest }) => {\n const validChildren = useValidChildren(children)\n const list = useIncludesChildren(validChildren, SidebarItem)\n const { groupContentProps } = useSidePanelComponentContext()\n const { contentProps, getContentProps } = useGroupComponentContext()\n\n return {\n as: list ? \"ul\" : \"div\",\n children,\n ...getContentProps(mergeProps(groupContentProps, contentProps, rest)()),\n }\n})\n\nexport interface SidebarMenuProps extends HTMLStyledProps<\"div\"> {}\n\nexport const SidebarMenu = withContext<\"div\", SidebarMenuProps>(\"div\", \"menu\")(\n undefined,\n (props) => {\n const { menuProps } = useSidePanelComponentContext()\n\n return { \"data-menu\": \"\", ...mergeProps(menuProps, props)() }\n },\n)\n\nexport interface SidebarMenuButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const SidebarMenuButton = withContext<\"button\", SidebarMenuButtonProps>(\n \"button\",\n [\"menu\", \"button\"],\n)(undefined, (props) => {\n const { open } = useSidebarContext()\n const { mode } = useComponentContext()\n const { menuProps } = useSidePanelComponentContext()\n const offcanvas = mode === \"offcanvas\"\n const { disabled, ...rest } = mergeProps(menuProps, props)()\n\n return {\n \"data-menu\": \"\",\n disabled,\n ...rest,\n tabIndex: (!offcanvas || open) && !disabled ? 0 : -1,\n }\n})\n\nexport interface SidebarItemProps\n extends\n Omit<HTMLStyledProps<\"li\">, \"value\">,\n Omit<UseSidebarItemProps, \"asyncChildren\"> {\n /**\n * The label to display in the item.\n */\n label: ReactNode\n /**\n * If `true`, the sidebar item will be animated.\n *\n * @default true\n */\n animated?: boolean\n /**\n * The element to display at the end of the item.\n */\n endElement?: SidebarItemReactNode\n /**\n * The sidebar item indicator icon to use.\n */\n indicator?: ReactNodeOrFunction<SidebarItemCallBackProps>\n /**\n * If provided, generate elements based on items.\n */\n items?: SidebarItemWithValue[]\n /**\n * The loading scheme.\n *\n * @default 'oval'\n */\n loadingScheme?: Loading.Scheme\n /**\n * If provided, the sidebar item will be rendered with custom components.\n */\n render?: SidebarItemRender\n /**\n * The element to display at the start of the item.\n */\n startElement?: SidebarItemReactNode\n /**\n * Props for the content component.\n */\n contentProps?: Omit<SidebarItemContentProps, \"children\">\n /**\n * Props for the end component.\n */\n endElementProps?: SidebarItemEndElementProps\n /**\n * Props for the indicator component.\n */\n indicatorProps?: SidebarItemIndicatorProps\n /**\n * Props for the label component.\n */\n labelProps?: SidebarItemLabelProps\n /**\n * Props for the link component.\n */\n linkProps?: SidebarItemLinkProps\n /**\n * Props for the start component.\n */\n startElementProps?: SidebarItemStartElementProps\n /**\n * Props for the tooltip component.\n */\n tooltipProps?: Omit<SidebarItemTooltipProps, \"children\" | \"content\">\n /**\n * Props for the trigger component.\n */\n triggerProps?: SidebarItemTriggerProps\n /**\n * If provided, the sidebar item will be rendered as an async sidebar item.\n */\n asyncChildren?: () => Promise<SidebarItemWithValue[]>\n}\n\nexport const SidebarItem = withContext<\"li\", SidebarItemProps>(\n ({\n animated: animatedProp,\n asyncChildren: asyncChildrenProp,\n children: childrenProp,\n endElement,\n indicator: indicatorProp,\n items,\n label,\n loadingScheme,\n render,\n startElement,\n contentProps,\n endElementProps,\n indicatorProps,\n labelProps,\n linkProps,\n startElementProps,\n tooltipProps,\n triggerProps,\n ...rest\n }) => {\n const { mode } = useComponentContext()\n const offcanvas = mode === \"offcanvas\"\n const componentContext = useSidePanelComponentContext()\n const Loading = useLoadingComponent(\n loadingScheme ?? componentContext.loadingScheme ?? \"oval\",\n )\n const computedChildren = useMemo(() => {\n if (childrenProp) return childrenProp\n\n return items?.map(({ children, ...rest }, index) => {\n const key = createKey(rest, index)\n\n return <SidebarItem key={key} items={children} {...rest} />\n })\n }, [childrenProp, items])\n const asyncChildren = useCallback(async () => {\n const items = await asyncChildrenProp?.()\n\n return items?.map(({ children, ...rest }, index) => {\n const key = createKey(rest, index)\n\n return <SidebarItem key={key} items={children} {...rest} />\n })\n }, [asyncChildrenProp])\n const {\n branchOpen,\n children,\n disabled,\n expanded,\n expandedValue,\n group,\n groupLoading,\n groupOpen,\n open,\n selected,\n selectedValue,\n value,\n getContentProps,\n getIndicatorProps,\n getItemProps,\n getLabelProps,\n getLinkProps,\n getTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n } = useSidebarItem({\n ...mergeProps(componentContext.itemProps, rest)(),\n asyncChildren: asyncChildrenProp ? asyncChildren : undefined,\n children: computedChildren,\n })\n const animated = animatedProp ?? componentContext.animated ?? true\n const tabIndex = offcanvas\n ? open && expanded && !disabled\n ? 0\n : -1\n : expanded && !disabled\n ? 0\n : -1\n const callbackProps = useMemo(\n () => ({ disabled, expanded: groupOpen }),\n [disabled, groupOpen],\n )\n const mergedTriggerProps = useMemo(() => {\n return getTriggerProps({\n tabIndex,\n ...mergeProps(componentContext.triggerProps, triggerProps)(),\n }) as SidebarItemTriggerProps\n }, [getTriggerProps, tabIndex, componentContext.triggerProps, triggerProps])\n const mergedLinkProps = useMemo(() => {\n return getLinkProps({\n tabIndex,\n ...mergeProps(componentContext.linkProps, linkProps)(),\n }) as SidebarItemLinkProps\n }, [getLinkProps, tabIndex, componentContext.linkProps, linkProps])\n const indicator = useMemo<ReactNode>(\n () => runIfFn(indicatorProp ?? componentContext.indicator, callbackProps),\n [indicatorProp, componentContext.indicator, callbackProps],\n )\n const groupStartElement = useMemo<ReactNode>(\n () =>\n runIfFn(\n getReactNodeOrFunction(\n \"group\",\n startElement,\n componentContext.startElement,\n ),\n callbackProps,\n ),\n [startElement, componentContext.startElement, callbackProps],\n )\n const groupEndElement = useMemo<ReactNode>(\n () =>\n runIfFn(\n getReactNodeOrFunction(\n \"group\",\n endElement,\n componentContext.endElement,\n ),\n callbackProps,\n ),\n [endElement, componentContext.endElement, callbackProps],\n )\n const itemStartElement = useMemo<ReactNode>(\n () =>\n runIfFn(\n getReactNodeOrFunction(\n \"item\",\n startElement,\n componentContext.startElement,\n ),\n callbackProps,\n ),\n [startElement, componentContext.startElement, callbackProps],\n )\n const itemEndElement = useMemo<ReactNode>(\n () =>\n runIfFn(\n getReactNodeOrFunction(\n \"item\",\n endElement,\n componentContext.endElement,\n ),\n callbackProps,\n ),\n [endElement, componentContext.endElement, callbackProps],\n )\n const trigger = useMemo<ReactNode>(\n () =>\n runIfFn(render?.trigger ?? componentContext.render?.trigger, {\n endElement: groupEndElement,\n expanded,\n expandedValue,\n groupLoading,\n groupOpen,\n indicator,\n label,\n selected,\n selectedValue,\n startElement: groupStartElement,\n value,\n triggerProps: mergedTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n }),\n [\n render?.trigger,\n componentContext.render?.trigger,\n groupEndElement,\n expanded,\n expandedValue,\n groupLoading,\n groupOpen,\n indicator,\n label,\n selected,\n selectedValue,\n groupStartElement,\n value,\n mergedTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n ],\n )\n const link = useMemo<ReactNode>(\n () =>\n runIfFn(render?.link ?? componentContext.render?.link, {\n endElement: itemEndElement,\n expanded,\n expandedValue,\n label,\n selected,\n selectedValue,\n startElement: itemStartElement,\n value,\n linkProps: mergedLinkProps,\n onExpandedChange,\n onSelectedChange,\n }),\n [\n render?.link,\n componentContext.render?.link,\n itemEndElement,\n expanded,\n expandedValue,\n label,\n selected,\n selectedValue,\n itemStartElement,\n value,\n mergedLinkProps,\n onExpandedChange,\n onSelectedChange,\n ],\n )\n const item = useMemo<ReactNode>(\n () =>\n runIfFn(render?.item ?? componentContext.render?.item, {\n children,\n endElement: { group: groupEndElement, item: itemEndElement },\n expanded,\n expandedValue,\n group,\n groupLoading,\n groupOpen,\n indicator,\n label,\n link,\n selected,\n selectedValue,\n startElement: { group: groupStartElement, item: itemStartElement },\n trigger,\n value,\n itemProps: getItemProps() as HTMLStyledProps<\"li\">,\n linkProps: mergedLinkProps,\n triggerProps: mergedTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n }),\n [\n render?.item,\n componentContext.render?.item,\n children,\n groupEndElement,\n itemEndElement,\n expanded,\n expandedValue,\n group,\n groupLoading,\n groupOpen,\n indicator,\n label,\n link,\n selected,\n selectedValue,\n groupStartElement,\n itemStartElement,\n trigger,\n value,\n getItemProps,\n mergedLinkProps,\n mergedTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n ],\n )\n const context = useMemo(\n () => ({ branchOpen, groupOpen }),\n [branchOpen, groupOpen],\n )\n const itemComponentContext = useMemo(\n () => ({\n contentProps: {\n duration: !animated ? 0 : undefined,\n open: groupOpen,\n ...getContentProps(\n mergeProps(componentContext.itemContentProps, contentProps)(),\n ),\n },\n endElementProps: mergeProps(\n componentContext.endElementProps,\n endElementProps,\n )(),\n indicatorProps: getIndicatorProps({\n \"data-animated\": dataAttr(animated),\n ...mergeProps(componentContext.indicatorProps, indicatorProps)(),\n }) as SidebarItemIndicatorProps,\n labelProps: getLabelProps(\n mergeProps(componentContext.labelProps, labelProps)(),\n ) as SidebarItemLabelProps,\n startElementProps: mergeProps(\n componentContext.startElementProps,\n startElementProps,\n )(),\n tooltipProps: {\n content: label,\n disabled: open,\n ...mergeProps(componentContext.tooltipProps, tooltipProps)(),\n },\n }),\n [\n animated,\n componentContext.endElementProps,\n componentContext.indicatorProps,\n componentContext.itemContentProps,\n componentContext.labelProps,\n componentContext.startElementProps,\n componentContext.tooltipProps,\n contentProps,\n endElementProps,\n getContentProps,\n getIndicatorProps,\n getLabelProps,\n groupOpen,\n indicatorProps,\n label,\n labelProps,\n open,\n startElementProps,\n tooltipProps,\n ],\n )\n\n return (\n <SidebarItemContext value={context}>\n <ItemComponentContext value={itemComponentContext}>\n {item ?? (\n <styled.li {...getItemProps()}>\n {group ? (\n <>\n {trigger ?? (\n <SidebarItemTrigger {...mergedTriggerProps}>\n {groupStartElement ? (\n <SidebarItemStartElement>\n {groupStartElement}\n </SidebarItemStartElement>\n ) : null}\n {label ? (\n <SidebarItemLabel>{label}</SidebarItemLabel>\n ) : null}\n {groupEndElement ? (\n <SidebarItemEndElement>\n {groupEndElement}\n </SidebarItemEndElement>\n ) : null}\n <SidebarItemIndicator>\n {groupLoading ? (\n <Loading />\n ) : (\n runIfFn(indicator, callbackProps)\n )}\n </SidebarItemIndicator>\n </SidebarItemTrigger>\n )}\n\n <SidebarItemContent>{children}</SidebarItemContent>\n </>\n ) : (\n (link ?? (\n <SidebarItemLink {...mergedLinkProps}>\n {itemStartElement ? (\n <SidebarItemStartElement>\n {itemStartElement}\n </SidebarItemStartElement>\n ) : null}\n {label ? (\n <SidebarItemLabel>{label}</SidebarItemLabel>\n ) : null}\n {itemEndElement ? (\n <SidebarItemEndElement>\n {itemEndElement}\n </SidebarItemEndElement>\n ) : null}\n </SidebarItemLink>\n ))\n )}\n </styled.li>\n )}\n </ItemComponentContext>\n </SidebarItemContext>\n )\n },\n \"item\",\n)()\n\ninterface SidebarItemTooltipProps extends TooltipProps {}\n\nconst SidebarItemTooltip: FC<SidebarItemTooltipProps> = (props) => {\n const { tooltipProps } = useItemComponentContext()\n const { children, disabled, ...rest } = mergeProps(tooltipProps, props)()\n const { mode, placement } = useComponentContext()\n const offcanvas = mode === \"offcanvas\"\n\n if (offcanvas || disabled) return children\n else\n return (\n <Tooltip\n closeOnClick={false}\n gutter={16}\n placement={`center-${placement === \"start\" ? \"end\" : \"start\"}`}\n {...rest}\n >\n {children}\n </Tooltip>\n )\n}\n\nexport interface SidebarItemTriggerProps extends HTMLStyledProps<\"button\"> {}\n\nexport const SidebarItemTrigger = withContext<\n \"button\",\n SidebarItemTriggerProps\n>((props) => {\n return (\n <SidebarItemTooltip>\n <styled.button {...props} />\n </SidebarItemTooltip>\n )\n}, \"itemTrigger\")()\n\nexport interface SidebarItemLinkProps extends HTMLStyledProps<\"a\"> {}\n\nexport const SidebarItemLink = withContext<\"a\", SidebarItemLinkProps>(\n (props) => {\n return (\n <SidebarItemTooltip>\n <styled.a {...props} />\n </SidebarItemTooltip>\n )\n },\n \"itemLink\",\n)()\n\nexport interface SidebarItemContentProps\n extends\n Omit<HTMLStyledProps<\"ul\">, \"transition\">,\n Pick<CollapseProps, \"animationOpacity\" | keyof WithTransitionProps> {}\n\nexport const SidebarItemContent = withContext<\"ul\", SidebarItemContentProps>(\n (props) => {\n const { contentProps } = useItemComponentContext()\n\n return (\n <Collapse\n as=\"ul\"\n {...cast<CollapseProps>(mergeProps(contentProps, props)())}\n />\n )\n },\n \"itemContent\",\n)()\n\nexport interface SidebarItemIndicatorProps extends HTMLStyledProps<\"svg\"> {}\n\nexport const SidebarItemIndicator = withContext<\n \"svg\",\n SidebarItemIndicatorProps\n>(({ children = <ChevronRightIcon />, ...rest }) => {\n const { indicatorHidden } = useSidePanelComponentContext()\n\n if (indicatorHidden) return null\n\n if (isValidElement<HTMLProps<\"svg\">>(children))\n return cloneElement(children, { ...rest, ...children.props })\n\n return Children.count(children) > 1 ? Children.only(null) : null\n}, \"itemIndicator\")(undefined, (props) => {\n const { indicatorProps } = useItemComponentContext()\n\n return mergeProps(indicatorProps, props)()\n})\n\nexport interface SidebarItemStartElementProps extends HTMLStyledProps {}\n\nexport const SidebarItemStartElement = withContext<\n \"div\",\n SidebarItemStartElementProps\n>(\"div\", {\n name: \"ItemStartElement\",\n slot: [\"itemElement\", \"start\"],\n})(undefined, (props) => {\n const { startElementProps } = useItemComponentContext()\n\n return mergeProps(startElementProps, props)()\n})\n\nexport interface SidebarItemEndElementProps extends HTMLStyledProps {}\n\nexport const SidebarItemEndElement = withContext<\n \"div\",\n SidebarItemEndElementProps\n>(\"div\", {\n name: \"ItemEndElement\",\n slot: [\"itemElement\", \"end\"],\n})(undefined, (props) => {\n const { endElementProps } = useItemComponentContext()\n\n return mergeProps(endElementProps, props)()\n})\n\nexport interface SidebarItemLabelProps extends HTMLStyledProps<\"span\"> {}\n\nexport const SidebarItemLabel = withContext<\"span\", SidebarItemLabelProps>(\n \"span\",\n \"itemLabel\",\n)(undefined, (props) => {\n const { labelProps } = useItemComponentContext()\n\n return mergeProps(labelProps, props)()\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0JA,MAAM,aAAa,OAAoB,UAAkB;CACvD,OAAO,WAAW,QAAQ,MAAM,SAAS,QAAQ;AACnD;AAEA,MAAM,0BACJ,MACA,QACA,SACkD;CAClD,KAAA,GAAIA,cAAAA,SAAAA,CAAS,MAAM,MAAM,WAAW,UAAU,UAAU,SACtD,OAAO,OAAO;MACX,IAAI,QAAQ,OAAO;MACnB,KAAA,GAAIA,cAAAA,SAAAA,CAAS,IAAI,MAAM,WAAW,QAAQ,UAAU,OACvD,OAAO,KAAK;MACT,OAAO;AACd;AAoBA,MAAM,CAAC,uBAAuB,4BAC5BC,gBAAqC,EAAE,MAAM,wBAAwB,CAAC;AAWxE,MAAM,CAAC,sBAAsB,2BAC3BA,gBAAoC,EAAE,MAAM,uBAAuB,CAAC;AA8BtE,MAAM,CAAC,2BAA2B,gCAChCA,gBAAyC,EACvC,MAAM,4BACR,CAAC;AAeH,MAAM,EACJ,kBACA,cAAc,qBACd,qBACA,iBAAiB,wBACjB,aACA,iBACE,oBACF,WACA,YACF;;;;;;AASA,MAAa,cAAc,cAKxB,EACC,aAAa,MACb,MAAM,WAAW,aACjB,WAAW,gBAAgB,SAC3B,GAAG,WACC;CACJ,MAAM,SACJ,mBACE,aAAa,GAAG,aAAa,KAAK,IAAI,EAAE,MAAM,MAAM,CACtD,KAAK;CACP,MAAM,OAAO,SAAS,QAAQ;CAC9B,MAAM,YAAY,SAAS,aAAa;CACxC,MAAM,EACJ,aACA,eACA,MACA,eACA,iBACA,gBACA,gBACA,cACA,mBACA,iBACA,SACA,kBACA,QACA,kBACA,aACE,WAAW;EAAE;EAAQ,GAAG;CAAK,CAAC;CAClC,MAAM,UAAU,eACP;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CACA,MAAM,mBAAmB,eAChB;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,oBAAC,2BAAD;EAA2B,OAAO;EAChC,UAAA,oBAAC,gBAAD;GAAgB,OAAO;GACrB,UAAA,oBAAC,kBAAD;IAAkB,OAAO;IACvB,UAAA,oBAAC,OAAO,KAAR;KAAY,cAAA;KAAW,GAAI,aAAa;IAAI,CAAA;GAC5B,CAAA;EACJ,CAAA;CACS,CAAA;AAE/B,GACA,QACA,EAAE,eAAe,CAAC,QAAQ,WAAW,EAAE,CACzC,CAAC,CAAC;AAIF,MAAa,mBAAmB,YAC9B,OACA,WACF,CAAC,CAAC;AAIF,MAAa,iBAAiB,YAC5B,UACA,SACF,CAAC,CAAC,KAAA,IAAY,UAAU;CACtB,MAAM,EAAE,oBAAoB,oBAAoB;CAEhD,OAAO;EAAE,SAAS;EAAM,GAAG,gBAAgB,KAAK;CAAE;AACpD,CAAC;AA8GD,MAAa,mBAAmB,aAC7B,EACC,WAAW,MACX,UACA,SACA,YACA,QACA,QACA,WACA,iBACA,OACA,eACA,QACA,cACA,aAAa,MACb,cACA,aACA,iBACA,aACA,mBACA,YACA,aACA,aACA,gBACA,kBACA,WACA,YACA,WACA,WACA,mBACA,cACA,cACA,GAAG,WACC;CACJ,MAAM,EAAE,QAAQ,MAAM,YAAY,kBAAkB;CACpD,MAAM,EAAE,YAAY,WAAW,sBAAsB,oBAAoB;CACzE,MAAM,CACJ,iBACA,cACA,eACA,cACA,gBACE,iBACF,UACA,eACA,gBACA,eACA,aACF;CACA,MAAM,UAAU,eACP;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA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;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CACA,MAAM,OAAO,eAAA,GAETA,cAAAA,QAAAA,CAAQ,QAAQ,QAAQ,iBAAiB,QAAQ,MAAM;EACrD,YAAY;EACZ;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA,WAAW;EACX;EACA;CACF,CAAC,GACH;EACE,QAAQ;EACR,iBAAiB,QAAQ;EACzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CACA,MAAM,OAAO,eAAA,GAETA,cAAAA,QAAAA,CAAQ,QAAQ,QAAQ,iBAAiB,QAAQ,MAAM;EACrD;EACA,YAAY;GAAE,OAAO;GAAiB,MAAM;EAAe;EAC3D;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;GAAE,OAAO;GAAmB,MAAM;EAAiB;EACjE;EACA;EACA,WAAW,aAAa;EACxB,WAAW;EACX,cAAc;EACd;EACA;EACA;EACA;EACA;CACF,CAAC,GACH;EACE,QAAQ;EACR,iBAAiB,QAAQ;EACzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CACA,MAAM,UAAU,eACP;EAAE;EAAY;CAAU,IAC/B,CAAC,YAAY,SAAS,CACxB;CACA,MAAM,uBAAuB,eACpB;EACL,cAAc;GACZ,UAAU,CAAC,WAAW,IAAI,KAAA;GAC1B,MAAM;GACN,GAAG,gBACD,WAAW,iBAAiB,kBAAkB,YAAY,CAAC,CAAC,CAC9D;EACF;EACA,iBAAiB,WACf,iBAAiB,iBACjB,eACF,CAAC,CAAC;EACF,gBAAgB,kBAAkB;GAChC,kBAAA,GAAiBF,cAAAA,SAAAA,CAAS,QAAQ;GAClC,GAAG,WAAW,iBAAiB,gBAAgB,cAAc,CAAC,CAAC;EACj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,IAAY,UAAU;CACxC,MAAM,EAAE,mBAAmB,wBAAwB;CAEnD,OAAO,WAAW,gBAAgB,KAAK,CAAC,CAAC;AAC3C,CAAC;AAID,MAAa,0BAA0B,YAGrC,OAAO;CACP,MAAM;CACN,MAAM,CAAC,eAAe,OAAO;AAC/B,CAAC,CAAC,CAAC,KAAA,IAAY,UAAU;CACvB,MAAM,EAAE,sBAAsB,wBAAwB;CAEtD,OAAO,WAAW,mBAAmB,KAAK,CAAC,CAAC;AAC9C,CAAC;AAID,MAAa,wBAAwB,YAGnC,OAAO;CACP,MAAM;CACN,MAAM,CAAC,eAAe,KAAK;AAC7B,CAAC,CAAC,CAAC,KAAA,IAAY,UAAU;CACvB,MAAM,EAAE,oBAAoB,wBAAwB;CAEpD,OAAO,WAAW,iBAAiB,KAAK,CAAC,CAAC;AAC5C,CAAC;AAID,MAAa,mBAAmB,YAC9B,QACA,WACF,CAAC,CAAC,KAAA,IAAY,UAAU;CACtB,MAAM,EAAE,eAAe,wBAAwB;CAE/C,OAAO,WAAW,YAAY,KAAK,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-sidebar.js","names":["createContext"],"sources":["../../../../src/components/sidebar/use-sidebar.ts"],"sourcesContent":["\"use client\"\n\nimport type { ReactNode, RefObject } from \"react\"\nimport { Children, useCallback, useId, useRef, useState } from \"react\"\nimport {\n type HTMLProps,\n mergeProps,\n type PropGetter,\n useEnvironment,\n} from \"../../core\"\nimport { useAsyncCallback } from \"../../hooks/use-async-callback\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { createDescendants } from \"../../hooks/use-descendants\"\nimport {\n useDisclosure,\n type UseDisclosureProps,\n} from \"../../hooks/use-disclosure\"\nimport { useWindowEvent } from \"../../hooks/use-window-event\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport {\n ariaAttr,\n assignRef,\n createContext,\n cx,\n dataAttr,\n handlerAll,\n mergeRefs,\n setAttribute,\n useIds,\n useSafeLayoutEffect,\n} from \"../../utils\"\n\nexport interface SidebarControl {\n collapse: () => void\n expand: () => void\n}\n\ninterface SidebarDescendantProps {\n expanded: boolean\n group: boolean\n id: string\n value: string\n}\n\nconst {\n DescendantsContext: SidebarDescendantsContext,\n useDescendant: useSidebarDescendant,\n useDescendants: useSidebarDescendants,\n} = createDescendants<HTMLElement, SidebarDescendantProps>()\n\nexport {\n SidebarDescendantsContext,\n useSidebarDescendant,\n useSidebarDescendants,\n}\n\ninterface SidebarContext extends Pick<\n UseSidebarReturn,\n | \"expandedValue\"\n | \"mobile\"\n | \"onClose\"\n | \"onExpandedChange\"\n | \"onOpen\"\n | \"onSelectedChange\"\n | \"onToggle\"\n | \"open\"\n | \"selectedValue\"\n> {}\n\nconst [SidebarContext, useSidebarContext] = createContext<SidebarContext>({\n name: \"SidebarContext\",\n})\n\nexport { SidebarContext, useSidebarContext }\n\ninterface SidebarItemContext extends Pick<\n UseSidebarItemReturn,\n \"branchOpen\" | \"groupOpen\"\n> {}\n\nconst [SidebarItemContext, useSidebarItemContext] =\n createContext<SidebarItemContext>({\n name: \"SidebarItemContext\",\n strict: false,\n })\n\nexport { SidebarItemContext, useSidebarItemContext }\n\nexport interface UseSidebarProps extends HTMLProps<\"div\"> {\n /**\n * Ref of the sidebar callbacks.\n */\n controlRef?: RefObject<null | SidebarControl>\n /**\n * The initial expanded value of the sidebar.\n */\n defaultExpandedValue?: string[]\n /**\n * The initial selected value of the sidebar.\n */\n defaultSelectedValue?: string\n /**\n * The disclosure props for the desktop and mobile.\n */\n disclosure?: {\n desktop?: Omit<UseDisclosureProps, \"timing\">\n mobile?: Omit<UseDisclosureProps, \"timing\">\n }\n /**\n * The expanded value of the sidebar.\n */\n expandedValue?: string[]\n /**\n * If `true`, the trigger click event will be switched to mobile.\n *\n * @default false\n */\n mobile?: boolean\n /**\n * The selected value of the sidebar.\n */\n selectedValue?: string\n /**\n * The callback invoked when expanded value changes.\n */\n onExpandedChange?: (value: string[]) => void\n /**\n * The callback invoked when selected value changes.\n */\n onSelectedChange?: (value: string) => void\n}\n\nexport const useSidebar = ({\n controlRef,\n defaultExpandedValue = [],\n defaultSelectedValue,\n disclosure,\n expandedValue: expandedValueProp,\n mobile = false,\n selectedValue: selectedValueProp,\n onExpandedChange: onExpandedChangeProp,\n onSelectedChange: onSelectedChangeProp,\n ...rest\n}: UseSidebarProps = {}) => {\n const { t } = useI18n(\"sidebar\")\n const desktopDisclosure = useDisclosure({\n defaultOpen: disclosure?.desktop?.defaultOpen ?? true,\n open: disclosure?.desktop?.open,\n onClose: disclosure?.desktop?.onClose,\n onOpen: disclosure?.desktop?.onOpen,\n })\n const mobileDisclosure = useDisclosure({\n defaultOpen: disclosure?.mobile?.defaultOpen ?? false,\n open: disclosure?.mobile?.open,\n onClose: disclosure?.mobile?.onClose,\n onOpen: disclosure?.mobile?.onOpen,\n })\n const [selectedValue, setSelectedValue] = useControllableState({\n defaultValue: defaultSelectedValue,\n value: selectedValueProp,\n onChange: onSelectedChangeProp,\n })\n const [expandedValue, setExpandedValue] = useControllableState({\n defaultValue: defaultExpandedValue,\n value: expandedValueProp,\n onChange: onExpandedChangeProp,\n })\n const descendants = useSidebarDescendants()\n const open = mobile ? mobileDisclosure.open : desktopDisclosure.open\n const onOpen = mobile ? mobileDisclosure.onOpen : desktopDisclosure.onOpen\n const onClose = mobile ? mobileDisclosure.onClose : desktopDisclosure.onClose\n const onToggle = mobile\n ? mobileDisclosure.onToggle\n : desktopDisclosure.onToggle\n\n const onSelectedChange = useCallback(\n (value: string) => {\n setSelectedValue(value)\n },\n [setSelectedValue],\n )\n\n const onExpandAll = useCallback(() => {\n const values = descendants.enabledValues()\n const group = values.filter(({ group }) => group)\n const value = group.map(({ value }) => value)\n\n setExpandedValue(value)\n }, [descendants, setExpandedValue])\n\n const onCollapseAll = useCallback(() => {\n setExpandedValue([])\n }, [setExpandedValue])\n\n const onExpandedChange = useCallback(\n (value: string) => {\n setExpandedValue((prev) => {\n if (prev.includes(value))\n return prev.filter((prevValue) => prevValue !== value)\n else return [...prev, value]\n })\n },\n [setExpandedValue],\n )\n\n assignRef(controlRef, { collapse: onCollapseAll, expand: onExpandAll })\n\n useWindowEvent(\"keydown\", (ev) => {\n if (ev.key !== \"b\") return\n if (!ev.metaKey && !ev.ctrlKey) return\n\n ev.preventDefault()\n\n desktopDisclosure.onToggle()\n })\n\n const getRootProps: PropGetter<\"div\"> = useCallback(\n (props = {}) =>\n mergeProps({ \"data-expanded\": dataAttr(open) }, rest, props)(),\n [open, rest],\n )\n\n const getTriggerProps: PropGetter<\"button\"> = useCallback(\n (props = {}) => ({\n \"aria-expanded\": open,\n \"aria-label\": t(open ? \"Close sidebar\" : \"Open sidebar\"),\n ...props,\n onClick: handlerAll(props.onClick, onToggle),\n }),\n [open, t, onToggle],\n )\n\n const getSidePanelProps: PropGetter<\"aside\"> = useCallback(\n (props = {}) => ({ \"data-expanded\": dataAttr(open), ...props }),\n [open],\n )\n\n const getHeaderProps: PropGetter<\"header\"> = useCallback(\n (props = {}) => ({ ...props }),\n [],\n )\n\n const getFooterProps: PropGetter<\"footer\"> = useCallback(\n (props = {}) => ({ ...props }),\n [],\n )\n\n const getContentProps: PropGetter<\"ul\"> = useCallback(\n (props = {}) => ({ ...props }),\n [],\n )\n\n return {\n descendants,\n expandedValue,\n mobile,\n open,\n selectedValue,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getRootProps,\n getSidePanelProps,\n getTriggerProps,\n onClose,\n onExpandedChange,\n onOpen,\n onSelectedChange,\n onToggle,\n }\n}\n\nexport type UseSidebarReturn = ReturnType<typeof useSidebar>\n\nexport interface UseSidebarGroupProps extends HTMLProps<\"li\"> {}\n\nexport const useSidebarGroup = ({ ...rest }: UseSidebarGroupProps = {}) => {\n const { getDocument } = useEnvironment()\n const rootRef = useRef<HTMLLIElement>(null)\n const contentRef = useRef<HTMLDivElement>(null)\n const labelId = useId()\n\n useSafeLayoutEffect(() => {\n const el = getDocument()?.getElementById(labelId)\n\n if (!el) return\n\n if (rootRef.current)\n setAttribute(rootRef.current, \"aria-labelledby\", labelId)\n if (contentRef.current)\n setAttribute(contentRef.current, \"aria-labelledby\", labelId)\n }, [])\n\n const getRootProps: PropGetter<\"li\"> = useCallback(\n ({ ref, ...props } = {}) =>\n mergeProps({ ref }, rest, props, { ref: rootRef })(),\n [rest, rootRef],\n )\n\n const getLabelProps: PropGetter<\"span\"> = useCallback(\n (props = {}) => ({ id: labelId, ...props }),\n [labelId],\n )\n\n const getContentProps: PropGetter<\"div\"> = useCallback(\n ({ ref, ...props } = {}) => ({\n ref: mergeRefs(ref, contentRef),\n ...props,\n }),\n [],\n )\n\n return { getContentProps, getLabelProps, getRootProps }\n}\n\nexport type UseSidebarGroupReturn = ReturnType<typeof useSidebarGroup>\n\nexport interface UseSidebarItemProps\n extends HTMLProps<\"li\">, Omit<UseDisclosureProps, \"timing\"> {\n /**\n * The value of the item.\n */\n value: string\n /**\n * If `true`, the tree item will be disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * If `true`, the link will open in new tab.\n *\n * @default false\n */\n external?: boolean\n /**\n * If provided, the sidebar item will be rendered as an async sidebar item.\n */\n asyncChildren?: () => Promise<ReactNode>\n}\n\nexport const useSidebarItem = ({\n asyncChildren,\n children: childrenProp,\n defaultOpen,\n disabled = false,\n external,\n open: openProp,\n value,\n onClose: onCloseProp,\n onOpen: onOpenProp,\n ...rest\n}: UseSidebarItemProps) => {\n const context = useSidebarItemContext()\n const {\n expandedValue,\n open,\n selectedValue,\n onExpandedChange,\n onSelectedChange,\n } = useSidebarContext()\n const [children, setChildren] = useState<ReactNode>(childrenProp)\n const [itemId, labelId, contentId] = useIds()\n const initialAsyncRef = useRef(false)\n const async = !!asyncChildren\n const group = async || Children.count(children) > 0\n const nested = !!context\n const selected = !!value && selectedValue === value\n const defaultExpanded = !!value && expandedValue.includes(value)\n const {\n open: groupOpen,\n onClose,\n onOpen,\n } = useDisclosure({\n defaultOpen: defaultOpen ?? defaultExpanded,\n open: openProp,\n onClose: onCloseProp,\n onOpen: onOpenProp,\n })\n const branchOpen: boolean[] = nested\n ? [...context.branchOpen, groupOpen]\n : [groupOpen]\n const expanded = branchOpen.slice(0, -1).every(Boolean)\n const { register } = useSidebarDescendant({\n id: itemId!,\n disabled,\n expanded,\n group,\n value,\n })\n\n const [groupLoading, onGroupChildren] = useAsyncCallback(async () => {\n const children = await asyncChildren?.()\n\n setChildren(children)\n }, [asyncChildren])\n\n const onGroupOpen = useCallback(() => {\n if (disabled || !group || !value || groupLoading) return\n\n if (async && !initialAsyncRef.current) {\n initialAsyncRef.current = true\n\n onGroupChildren()\n .then(() => {\n onOpen()\n onExpandedChange(value)\n })\n .catch(() => {\n initialAsyncRef.current = false\n })\n } else {\n onOpen()\n onExpandedChange(value)\n }\n }, [\n disabled,\n group,\n value,\n groupLoading,\n async,\n onGroupChildren,\n onOpen,\n onExpandedChange,\n ])\n\n const onGroupClose = useCallback(() => {\n if (disabled || !group || !value) return\n\n onClose()\n onExpandedChange(value)\n }, [disabled, group, value, onClose, onExpandedChange])\n\n const onGroupToggle = useCallback(() => {\n if (groupOpen) onGroupClose()\n else onGroupOpen()\n }, [groupOpen, onGroupClose, onGroupOpen])\n\n useSafeLayoutEffect(() => {\n if (defaultExpanded)\n if (async && !initialAsyncRef.current) {\n initialAsyncRef.current = true\n\n onGroupChildren()\n .then(() => {\n onOpen()\n })\n .catch(() => {\n initialAsyncRef.current = false\n })\n } else {\n onOpen()\n }\n else onClose()\n }, [defaultExpanded])\n\n const getItemProps: PropGetter<\"li\"> = useCallback(\n ({ ref, \"aria-labelledby\": ariaLabelledby, ...props } = {}) => {\n const merged = mergeProps(\n {\n id: itemId,\n \"aria-current\": selected ? \"page\" : undefined,\n \"aria-disabled\": ariaAttr(disabled),\n \"aria-labelledby\": cx(ariaLabelledby, labelId),\n \"data-disabled\": dataAttr(disabled),\n \"data-selected\": dataAttr(selected),\n },\n rest,\n props,\n { ref },\n { ref: register },\n )()\n\n return {\n ...merged,\n onClick: handlerAll(\n merged.onClick,\n !group ? () => onSelectedChange(value) : undefined,\n ),\n }\n },\n [\n itemId,\n register,\n selected,\n disabled,\n labelId,\n rest,\n group,\n onSelectedChange,\n value,\n ],\n )\n\n const getIndicatorProps: PropGetter<\"svg\"> = useCallback(\n (props) => ({\n \"aria-disabled\": ariaAttr(disabled),\n \"aria-expanded\": groupOpen,\n \"aria-hidden\": true,\n \"data-disabled\": dataAttr(disabled),\n \"data-loading\": dataAttr(groupLoading),\n \"data-selected\": dataAttr(selected),\n role: \"presentation\",\n ...props,\n }),\n [disabled, groupOpen, groupLoading, selected],\n )\n\n const getTriggerProps: PropGetter<\"button\"> = useCallback(\n (props = {}) => ({\n \"aria-controls\": contentId,\n \"aria-disabled\": ariaAttr(disabled),\n \"aria-expanded\": groupOpen,\n \"data-disabled\": dataAttr(disabled),\n \"data-expanded\": dataAttr(groupOpen),\n \"data-selected\": dataAttr(selected),\n tabIndex: open && expanded && !disabled ? 0 : -1,\n ...props,\n onClick: handlerAll(props.onClick, onGroupToggle),\n }),\n [contentId, disabled, groupOpen, selected, open, expanded, onGroupToggle],\n )\n\n const getLinkProps: PropGetter<\"a\"> = useCallback(\n (props = {}) => ({\n href: value,\n rel: external ? \"noopener\" : undefined,\n target: external ? \"_blank\" : undefined,\n \"data-disabled\": dataAttr(disabled),\n \"data-selected\": dataAttr(selected),\n tabIndex: open && expanded && !disabled ? 0 : -1,\n ...props,\n onClick: handlerAll(props.onClick, (ev) => {\n if (!disabled) return\n\n ev.preventDefault()\n ev.stopPropagation()\n }),\n }),\n [disabled, expanded, external, open, selected, value],\n )\n\n const getContentProps: PropGetter<\"ul\"> = useCallback(\n ({ \"aria-labelledby\": ariaLabelledby, ...props } = {}) => ({\n id: contentId,\n \"aria-busy\": ariaAttr(groupLoading),\n \"aria-labelledby\": cx(ariaLabelledby, labelId),\n \"data-disabled\": dataAttr(disabled),\n ...props,\n }),\n [contentId, labelId, disabled, groupLoading],\n )\n\n const getLabelProps: PropGetter<\"span\"> = useCallback(\n (props = {}) => ({ id: labelId, ...props }),\n [labelId],\n )\n\n return {\n branchOpen,\n children,\n disabled,\n expanded,\n expandedValue,\n group,\n groupLoading,\n groupOpen,\n open,\n selected,\n selectedValue,\n value,\n getContentProps,\n getIndicatorProps,\n getItemProps,\n getLabelProps,\n getLinkProps,\n getTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n }\n}\n\nexport type UseSidebarItemReturn = ReturnType<typeof useSidebarItem>\n"],"mappings":";;;;;;;;;;;;;;;;AA4CA,MAAM,EACJ,oBAAoB,2BACpB,eAAe,sBACf,gBAAgB,0BACd,kBAAuD;AAqB3D,MAAM,CAAC,gBAAgB,qBAAqBA,gBAA8B,EACxE,MAAM,iBACR,CAAC;AASD,MAAM,CAAC,oBAAoB,yBACzBA,gBAAkC;CAChC,MAAM;CACN,QAAQ;AACV,CAAC;AAgDH,MAAa,cAAc,EACzB,YACA,uBAAuB,CAAC,GACxB,sBACA,YACA,eAAe,mBACf,SAAS,OACT,eAAe,mBACf,kBAAkB,sBAClB,kBAAkB,sBAClB,GAAG,SACgB,CAAC,MAAM;CAC1B,MAAM,EAAE,MAAM,QAAQ,SAAS;CAC/B,MAAM,oBAAoB,cAAc;EACtC,aAAa,YAAY,SAAS,eAAe;EACjD,MAAM,YAAY,SAAS;EAC3B,SAAS,YAAY,SAAS;EAC9B,QAAQ,YAAY,SAAS;CAC/B,CAAC;CACD,MAAM,mBAAmB,cAAc;EACrC,aAAa,YAAY,QAAQ,eAAe;EAChD,MAAM,YAAY,QAAQ;EAC1B,SAAS,YAAY,QAAQ;EAC7B,QAAQ,YAAY,QAAQ;CAC9B,CAAC;CACD,MAAM,CAAC,eAAe,oBAAoB,qBAAqB;EAC7D,cAAc;EACd,OAAO;EACP,UAAU;CACZ,CAAC;CACD,MAAM,CAAC,eAAe,oBAAoB,qBAAqB;EAC7D,cAAc;EACd,OAAO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EAC9C,GAAG;EACH,UAAA,GAAA,cAAA,WAAA,CAAoB,MAAM,UAAU,OAAO;GACzC,IAAI,CAAC,UAAU;GAEf,GAAG,eAAe;GAClB,GAAG,gBAAgB;EACrB,CAAC;CACH,IACA;EAAC;EAAU;EAAU;EAAU;EAAM;EAAU;CAAK,CACtD;CAkBA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBA7BwC,aACvC,EAAE,mBAAmB,gBAAgB,GAAG,UAAU,CAAC,OAAO;GACzD,IAAI;GACJ,cAAA,GAAA,cAAA,SAAA,CAAsB,YAAY;GAClC,oBAAA,GAAA,cAAA,GAAA,CAAsB,gBAAgB,OAAO;GAC7C,kBAAA,GAAA,cAAA,SAAA,CAA0B,QAAQ;GAClC,GAAG;EACL,IACA;GAAC;GAAW;GAAS;GAAU;EAAY,CAqB7B;EACd;EACA;EACA,eArBwC,aACvC,QAAQ,CAAC,OAAO;GAAE,IAAI;GAAS,GAAG;EAAM,IACzC,CAAC,OAAO,CAmBI;EACZ;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"use-sidebar.js","names":["createContext","dataAttr","handlerAll","ariaAttr","cx"],"sources":["../../../../src/components/sidebar/use-sidebar.ts"],"sourcesContent":["\"use client\"\n\nimport type { ReactNode, RefObject } from \"react\"\nimport { Children, useCallback, useId, useRef, useState } from \"react\"\nimport {\n type HTMLProps,\n mergeProps,\n type PropGetter,\n useEnvironment,\n} from \"../../core\"\nimport { useAsyncCallback } from \"../../hooks/use-async-callback\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { createDescendants } from \"../../hooks/use-descendants\"\nimport {\n useDisclosure,\n type UseDisclosureProps,\n} from \"../../hooks/use-disclosure\"\nimport { useWindowEvent } from \"../../hooks/use-window-event\"\nimport { useI18n } from \"../../providers/i18n-provider\"\nimport {\n ariaAttr,\n assignRef,\n createContext,\n cx,\n dataAttr,\n handlerAll,\n mergeRefs,\n setAttribute,\n useIds,\n useSafeLayoutEffect,\n} from \"../../utils\"\n\nexport interface SidebarControl {\n collapse: () => void\n expand: () => void\n}\n\ninterface SidebarDescendantProps {\n expanded: boolean\n group: boolean\n id: string\n value: string\n}\n\nconst {\n DescendantsContext: SidebarDescendantsContext,\n useDescendant: useSidebarDescendant,\n useDescendants: useSidebarDescendants,\n} = createDescendants<HTMLElement, SidebarDescendantProps>()\n\nexport {\n SidebarDescendantsContext,\n useSidebarDescendant,\n useSidebarDescendants,\n}\n\ninterface SidebarContext extends Pick<\n UseSidebarReturn,\n | \"expandedValue\"\n | \"mobile\"\n | \"onClose\"\n | \"onExpandedChange\"\n | \"onOpen\"\n | \"onSelectedChange\"\n | \"onToggle\"\n | \"open\"\n | \"selectedValue\"\n> {}\n\nconst [SidebarContext, useSidebarContext] = createContext<SidebarContext>({\n name: \"SidebarContext\",\n})\n\nexport { SidebarContext, useSidebarContext }\n\ninterface SidebarItemContext extends Pick<\n UseSidebarItemReturn,\n \"branchOpen\" | \"groupOpen\"\n> {}\n\nconst [SidebarItemContext, useSidebarItemContext] =\n createContext<SidebarItemContext>({\n name: \"SidebarItemContext\",\n strict: false,\n })\n\nexport { SidebarItemContext, useSidebarItemContext }\n\nexport interface UseSidebarProps extends HTMLProps<\"div\"> {\n /**\n * Ref of the sidebar callbacks.\n */\n controlRef?: RefObject<null | SidebarControl>\n /**\n * The initial expanded value of the sidebar.\n */\n defaultExpandedValue?: string[]\n /**\n * The initial selected value of the sidebar.\n */\n defaultSelectedValue?: string\n /**\n * The disclosure props for the desktop and mobile.\n */\n disclosure?: {\n desktop?: Omit<UseDisclosureProps, \"timing\">\n mobile?: Omit<UseDisclosureProps, \"timing\">\n }\n /**\n * The expanded value of the sidebar.\n */\n expandedValue?: string[]\n /**\n * If `true`, the trigger click event will be switched to mobile.\n *\n * @default false\n */\n mobile?: boolean\n /**\n * The selected value of the sidebar.\n */\n selectedValue?: string\n /**\n * The callback invoked when expanded value changes.\n */\n onExpandedChange?: (value: string[]) => void\n /**\n * The callback invoked when selected value changes.\n */\n onSelectedChange?: (value: string) => void\n}\n\nexport const useSidebar = ({\n controlRef,\n defaultExpandedValue = [],\n defaultSelectedValue,\n disclosure,\n expandedValue: expandedValueProp,\n mobile = false,\n selectedValue: selectedValueProp,\n onExpandedChange: onExpandedChangeProp,\n onSelectedChange: onSelectedChangeProp,\n ...rest\n}: UseSidebarProps = {}) => {\n const { t } = useI18n(\"sidebar\")\n const desktopDisclosure = useDisclosure({\n defaultOpen: disclosure?.desktop?.defaultOpen ?? true,\n open: disclosure?.desktop?.open,\n onClose: disclosure?.desktop?.onClose,\n onOpen: disclosure?.desktop?.onOpen,\n })\n const mobileDisclosure = useDisclosure({\n defaultOpen: disclosure?.mobile?.defaultOpen ?? false,\n open: disclosure?.mobile?.open,\n onClose: disclosure?.mobile?.onClose,\n onOpen: disclosure?.mobile?.onOpen,\n })\n const [selectedValue, setSelectedValue] = useControllableState({\n defaultValue: defaultSelectedValue,\n value: selectedValueProp,\n onChange: onSelectedChangeProp,\n })\n const [expandedValue, setExpandedValue] = useControllableState({\n defaultValue: defaultExpandedValue,\n value: expandedValueProp,\n onChange: onExpandedChangeProp,\n })\n const descendants = useSidebarDescendants()\n const open = mobile ? mobileDisclosure.open : desktopDisclosure.open\n const onOpen = mobile ? mobileDisclosure.onOpen : desktopDisclosure.onOpen\n const onClose = mobile ? mobileDisclosure.onClose : desktopDisclosure.onClose\n const onToggle = mobile\n ? mobileDisclosure.onToggle\n : desktopDisclosure.onToggle\n\n const onSelectedChange = useCallback(\n (value: string) => {\n setSelectedValue(value)\n },\n [setSelectedValue],\n )\n\n const onExpandAll = useCallback(() => {\n const values = descendants.enabledValues()\n const group = values.filter(({ group }) => group)\n const value = group.map(({ value }) => value)\n\n setExpandedValue(value)\n }, [descendants, setExpandedValue])\n\n const onCollapseAll = useCallback(() => {\n setExpandedValue([])\n }, [setExpandedValue])\n\n const onExpandedChange = useCallback(\n (value: string) => {\n setExpandedValue((prev) => {\n if (prev.includes(value))\n return prev.filter((prevValue) => prevValue !== value)\n else return [...prev, value]\n })\n },\n [setExpandedValue],\n )\n\n assignRef(controlRef, { collapse: onCollapseAll, expand: onExpandAll })\n\n useWindowEvent(\"keydown\", (ev) => {\n if (ev.key !== \"b\") return\n if (!ev.metaKey && !ev.ctrlKey) return\n\n ev.preventDefault()\n\n desktopDisclosure.onToggle()\n })\n\n const getRootProps: PropGetter<\"div\"> = useCallback(\n (props = {}) =>\n mergeProps({ \"data-expanded\": dataAttr(open) }, rest, props)(),\n [open, rest],\n )\n\n const getTriggerProps: PropGetter<\"button\"> = useCallback(\n (props = {}) => ({\n \"aria-expanded\": open,\n \"aria-label\": t(open ? \"Close sidebar\" : \"Open sidebar\"),\n ...props,\n onClick: handlerAll(props.onClick, onToggle),\n }),\n [open, t, onToggle],\n )\n\n const getSidePanelProps: PropGetter<\"aside\"> = useCallback(\n (props = {}) => ({ \"data-expanded\": dataAttr(open), ...props }),\n [open],\n )\n\n const getHeaderProps: PropGetter<\"header\"> = useCallback(\n (props = {}) => ({ ...props }),\n [],\n )\n\n const getFooterProps: PropGetter<\"footer\"> = useCallback(\n (props = {}) => ({ ...props }),\n [],\n )\n\n const getContentProps: PropGetter<\"ul\"> = useCallback(\n (props = {}) => ({ ...props }),\n [],\n )\n\n return {\n descendants,\n expandedValue,\n mobile,\n open,\n selectedValue,\n getContentProps,\n getFooterProps,\n getHeaderProps,\n getRootProps,\n getSidePanelProps,\n getTriggerProps,\n onClose,\n onExpandedChange,\n onOpen,\n onSelectedChange,\n onToggle,\n }\n}\n\nexport type UseSidebarReturn = ReturnType<typeof useSidebar>\n\nexport interface UseSidebarGroupProps extends HTMLProps<\"li\"> {}\n\nexport const useSidebarGroup = ({ ...rest }: UseSidebarGroupProps = {}) => {\n const { getDocument } = useEnvironment()\n const rootRef = useRef<HTMLLIElement>(null)\n const contentRef = useRef<HTMLDivElement>(null)\n const labelId = useId()\n\n useSafeLayoutEffect(() => {\n const el = getDocument()?.getElementById(labelId)\n\n if (!el) return\n\n if (rootRef.current)\n setAttribute(rootRef.current, \"aria-labelledby\", labelId)\n if (contentRef.current)\n setAttribute(contentRef.current, \"aria-labelledby\", labelId)\n }, [])\n\n const getRootProps: PropGetter<\"li\"> = useCallback(\n ({ ref, ...props } = {}) =>\n mergeProps({ ref }, rest, props, { ref: rootRef })(),\n [rest, rootRef],\n )\n\n const getLabelProps: PropGetter<\"span\"> = useCallback(\n (props = {}) => ({ id: labelId, ...props }),\n [labelId],\n )\n\n const getContentProps: PropGetter<\"div\"> = useCallback(\n ({ ref, ...props } = {}) => ({\n ref: mergeRefs(ref, contentRef),\n ...props,\n }),\n [],\n )\n\n return { getContentProps, getLabelProps, getRootProps }\n}\n\nexport type UseSidebarGroupReturn = ReturnType<typeof useSidebarGroup>\n\nexport interface UseSidebarItemProps\n extends HTMLProps<\"li\">, Omit<UseDisclosureProps, \"timing\"> {\n /**\n * The value of the item.\n */\n value: string\n /**\n * If `true`, the tree item will be disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * If `true`, the link will open in new tab.\n *\n * @default false\n */\n external?: boolean\n /**\n * If provided, the sidebar item will be rendered as an async sidebar item.\n */\n asyncChildren?: () => Promise<ReactNode>\n}\n\nexport const useSidebarItem = ({\n asyncChildren,\n children: childrenProp,\n defaultOpen,\n disabled = false,\n external,\n open: openProp,\n value,\n onClose: onCloseProp,\n onOpen: onOpenProp,\n ...rest\n}: UseSidebarItemProps) => {\n const context = useSidebarItemContext()\n const {\n expandedValue,\n open,\n selectedValue,\n onExpandedChange,\n onSelectedChange,\n } = useSidebarContext()\n const [children, setChildren] = useState<ReactNode>(childrenProp)\n const [itemId, labelId, contentId] = useIds()\n const initialAsyncRef = useRef(false)\n const async = !!asyncChildren\n const group = async || Children.count(children) > 0\n const nested = !!context\n const selected = !!value && selectedValue === value\n const defaultExpanded = !!value && expandedValue.includes(value)\n const {\n open: groupOpen,\n onClose,\n onOpen,\n } = useDisclosure({\n defaultOpen: defaultOpen ?? defaultExpanded,\n open: openProp,\n onClose: onCloseProp,\n onOpen: onOpenProp,\n })\n const branchOpen: boolean[] = nested\n ? [...context.branchOpen, groupOpen]\n : [groupOpen]\n const expanded = branchOpen.slice(0, -1).every(Boolean)\n const { register } = useSidebarDescendant({\n id: itemId!,\n disabled,\n expanded,\n group,\n value,\n })\n\n const [groupLoading, onGroupChildren] = useAsyncCallback(async () => {\n const children = await asyncChildren?.()\n\n setChildren(children)\n }, [asyncChildren])\n\n const onGroupOpen = useCallback(() => {\n if (disabled || !group || !value || groupLoading) return\n\n if (async && !initialAsyncRef.current) {\n initialAsyncRef.current = true\n\n onGroupChildren()\n .then(() => {\n onOpen()\n onExpandedChange(value)\n })\n .catch(() => {\n initialAsyncRef.current = false\n })\n } else {\n onOpen()\n onExpandedChange(value)\n }\n }, [\n disabled,\n group,\n value,\n groupLoading,\n async,\n onGroupChildren,\n onOpen,\n onExpandedChange,\n ])\n\n const onGroupClose = useCallback(() => {\n if (disabled || !group || !value) return\n\n onClose()\n onExpandedChange(value)\n }, [disabled, group, value, onClose, onExpandedChange])\n\n const onGroupToggle = useCallback(() => {\n if (groupOpen) onGroupClose()\n else onGroupOpen()\n }, [groupOpen, onGroupClose, onGroupOpen])\n\n useSafeLayoutEffect(() => {\n if (defaultExpanded)\n if (async && !initialAsyncRef.current) {\n initialAsyncRef.current = true\n\n onGroupChildren()\n .then(() => {\n onOpen()\n })\n .catch(() => {\n initialAsyncRef.current = false\n })\n } else {\n onOpen()\n }\n else onClose()\n }, [defaultExpanded])\n\n const getItemProps: PropGetter<\"li\"> = useCallback(\n ({ ref, \"aria-labelledby\": ariaLabelledby, ...props } = {}) => {\n const merged = mergeProps(\n {\n id: itemId,\n \"aria-current\": selected ? \"page\" : undefined,\n \"aria-disabled\": ariaAttr(disabled),\n \"aria-labelledby\": cx(ariaLabelledby, labelId),\n \"data-disabled\": dataAttr(disabled),\n \"data-selected\": dataAttr(selected),\n },\n rest,\n props,\n { ref },\n { ref: register },\n )()\n\n return {\n ...merged,\n onClick: handlerAll(\n merged.onClick,\n !group ? () => onSelectedChange(value) : undefined,\n ),\n }\n },\n [\n itemId,\n register,\n selected,\n disabled,\n labelId,\n rest,\n group,\n onSelectedChange,\n value,\n ],\n )\n\n const getIndicatorProps: PropGetter<\"svg\"> = useCallback(\n (props) => ({\n \"aria-disabled\": ariaAttr(disabled),\n \"aria-expanded\": groupOpen,\n \"aria-hidden\": true,\n \"data-disabled\": dataAttr(disabled),\n \"data-loading\": dataAttr(groupLoading),\n \"data-selected\": dataAttr(selected),\n role: \"presentation\",\n ...props,\n }),\n [disabled, groupOpen, groupLoading, selected],\n )\n\n const getTriggerProps: PropGetter<\"button\"> = useCallback(\n (props = {}) => ({\n \"aria-controls\": contentId,\n \"aria-disabled\": ariaAttr(disabled),\n \"aria-expanded\": groupOpen,\n \"data-disabled\": dataAttr(disabled),\n \"data-expanded\": dataAttr(groupOpen),\n \"data-selected\": dataAttr(selected),\n tabIndex: open && expanded && !disabled ? 0 : -1,\n ...props,\n onClick: handlerAll(props.onClick, onGroupToggle),\n }),\n [contentId, disabled, groupOpen, selected, open, expanded, onGroupToggle],\n )\n\n const getLinkProps: PropGetter<\"a\"> = useCallback(\n (props = {}) => ({\n href: value,\n rel: external ? \"noopener\" : undefined,\n target: external ? \"_blank\" : undefined,\n \"data-disabled\": dataAttr(disabled),\n \"data-selected\": dataAttr(selected),\n tabIndex: open && expanded && !disabled ? 0 : -1,\n ...props,\n onClick: handlerAll(props.onClick, (ev) => {\n if (!disabled) return\n\n ev.preventDefault()\n ev.stopPropagation()\n }),\n }),\n [disabled, expanded, external, open, selected, value],\n )\n\n const getContentProps: PropGetter<\"ul\"> = useCallback(\n ({ \"aria-labelledby\": ariaLabelledby, ...props } = {}) => ({\n id: contentId,\n \"aria-busy\": ariaAttr(groupLoading),\n \"aria-labelledby\": cx(ariaLabelledby, labelId),\n \"data-disabled\": dataAttr(disabled),\n ...props,\n }),\n [contentId, labelId, disabled, groupLoading],\n )\n\n const getLabelProps: PropGetter<\"span\"> = useCallback(\n (props = {}) => ({ id: labelId, ...props }),\n [labelId],\n )\n\n return {\n branchOpen,\n children,\n disabled,\n expanded,\n expandedValue,\n group,\n groupLoading,\n groupOpen,\n open,\n selected,\n selectedValue,\n value,\n getContentProps,\n getIndicatorProps,\n getItemProps,\n getLabelProps,\n getLinkProps,\n getTriggerProps,\n onExpandedChange,\n onGroupClose,\n onGroupOpen,\n onGroupToggle,\n onSelectedChange,\n }\n}\n\nexport type UseSidebarItemReturn = ReturnType<typeof useSidebarItem>\n"],"mappings":";;;;;;;;;;;;;;;;AA4CA,MAAM,EACJ,oBAAoB,2BACpB,eAAe,sBACf,gBAAgB,0BACd,kBAAuD;AAqB3D,MAAM,CAAC,gBAAgB,qBAAqBA,gBAA8B,EACxE,MAAM,iBACR,CAAC;AASD,MAAM,CAAC,oBAAoB,yBACzBA,gBAAkC;CAChC,MAAM;CACN,QAAQ;AACV,CAAC;AAgDH,MAAa,cAAc,EACzB,YACA,uBAAuB,CAAC,GACxB,sBACA,YACA,eAAe,mBACf,SAAS,OACT,eAAe,mBACf,kBAAkB,sBAClB,kBAAkB,sBAClB,GAAG,SACgB,CAAC,MAAM;CAC1B,MAAM,EAAE,MAAM,QAAQ,SAAS;CAC/B,MAAM,oBAAoB,cAAc;EACtC,aAAa,YAAY,SAAS,eAAe;EACjD,MAAM,YAAY,SAAS;EAC3B,SAAS,YAAY,SAAS;EAC9B,QAAQ,YAAY,SAAS;CAC/B,CAAC;CACD,MAAM,mBAAmB,cAAc;EACrC,aAAa,YAAY,QAAQ,eAAe;EAChD,MAAM,YAAY,QAAQ;EAC1B,SAAS,YAAY,QAAQ;EAC7B,QAAQ,YAAY,QAAQ;CAC9B,CAAC;CACD,MAAM,CAAC,eAAe,oBAAoB,qBAAqB;EAC7D,cAAc;EACd,OAAO;EACP,UAAU;CACZ,CAAC;CACD,MAAM,CAAC,eAAe,oBAAoB,qBAAq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,kBAAA,GAAiBA,cAAAA,SAAAA,CAAS,QAAQ;EAClC,UAAU,QAAQ,YAAY,CAAC,WAAW,IAAI;EAC9C,GAAG;EACH,UAAA,GAASC,cAAAA,WAAAA,CAAW,MAAM,UAAU,OAAO;GACzC,IAAI,CAAC,UAAU;GAEf,GAAG,eAAe;GAClB,GAAG,gBAAgB;EACrB,CAAC;CACH,IACA;EAAC;EAAU;EAAU;EAAU;EAAM;EAAU;CAAK,CACtD;CAkBA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBA7BwC,aACvC,EAAE,mBAAmB,gBAAgB,GAAG,UAAU,CAAC,OAAO;GACzD,IAAI;GACJ,cAAA,GAAaC,cAAAA,SAAAA,CAAS,YAAY;GAClC,oBAAA,GAAmBC,cAAAA,GAAAA,CAAG,gBAAgB,OAAO;GAC7C,kBAAA,GAAiBH,cAAAA,SAAAA,CAAS,QAAQ;GAClC,GAAG;EACL,IACA;GAAC;GAAW;GAAS;GAAU;EAAY,CAqB7B;EACd;EACA;EACA,eArBwC,aACvC,QAAQ,CAAC,OAAO;GAAE,IAAI;GAAS,GAAG;EAAM,IACzC,CAAC,OAAO,CAmBI;EACZ;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-grid.js","names":[],"sources":["../../../../src/components/simple-grid/simple-grid.tsx"],"sourcesContent":["\"use client\"\n\nimport type {\n CSSProps,\n StyleValue,\n ThemeProps,\n WithoutThemeProps,\n} from \"../../core\"\nimport type { GridProps } from \"../grid\"\nimport type { SimpleGridStyle } from \"./simple-grid.style\"\nimport { useMemo } from \"react\"\nimport { createComponent } from \"../../core\"\nimport { replaceObject } from \"../../utils\"\nimport { Grid } from \"../grid\"\nimport { simpleGridStyle } from \"./simple-grid.style\"\n\nexport interface SimpleGridProps\n extends\n Omit<WithoutThemeProps<GridProps, SimpleGridStyle>, \"columns\">,\n ThemeProps<SimpleGridStyle> {\n /**\n * The number of columns.\n */\n columns?: StyleValue<number>\n /**\n * The width at which child elements will break into columns.\n * Pass a number for pixel values or a string for any other valid CSS length.\n */\n minChildWidth?: CSSProps[\"minWidth\"]\n}\n\nconst {\n PropsContext: SimpleGridPropsContext,\n usePropsContext: useSimpleGridPropsContext,\n withContext,\n} = createComponent<SimpleGridProps, SimpleGridStyle>(\n \"simple-grid\",\n simpleGridStyle,\n)\n\nexport { SimpleGridPropsContext, useSimpleGridPropsContext }\n\n/**\n * `SimpleGrid` is a component that makes `Grid` simpler and more user-friendly.\n *\n * @see https://yamada-ui.com/docs/components/simple-grid\n */\nexport const SimpleGrid = withContext<\"div\", SimpleGridProps>(Grid)(\n undefined,\n ({ columns, minChildWidth, ...rest }) => {\n const templateColumns = useMemo(() => {\n if (minChildWidth)\n return replaceObject(minChildWidth, (value) => {\n return value != null\n ? `repeat(auto-fit, minmax({sizes.${value}, ${value}}, 1fr))`\n : undefined\n })\n else\n return replaceObject(columns, (value) =>\n value != null ? `repeat(${value}, minmax(0, 1fr))` : undefined,\n )\n }, [minChildWidth, columns])\n\n return { templateColumns, ...rest }\n },\n)\n"],"mappings":";;;;;;;AA+BA,MAAM,EACJ,cAAc,wBACd,iBAAiB,2BACjB,gBACE,gBACF,eACA,eACF;;;;;;AASA,MAAa,aAAa,YAAoC,IAAI,CAAC,CACjE,KAAA,IACC,EAAE,SAAS,eAAe,GAAG,WAAW;CAcvC,OAAO;EAAE,iBAbe,cAAc;GACpC,IAAI,eACF,QAAA,
|
|
1
|
+
{"version":3,"file":"simple-grid.js","names":["replaceObject"],"sources":["../../../../src/components/simple-grid/simple-grid.tsx"],"sourcesContent":["\"use client\"\n\nimport type {\n CSSProps,\n StyleValue,\n ThemeProps,\n WithoutThemeProps,\n} from \"../../core\"\nimport type { GridProps } from \"../grid\"\nimport type { SimpleGridStyle } from \"./simple-grid.style\"\nimport { useMemo } from \"react\"\nimport { createComponent } from \"../../core\"\nimport { replaceObject } from \"../../utils\"\nimport { Grid } from \"../grid\"\nimport { simpleGridStyle } from \"./simple-grid.style\"\n\nexport interface SimpleGridProps\n extends\n Omit<WithoutThemeProps<GridProps, SimpleGridStyle>, \"columns\">,\n ThemeProps<SimpleGridStyle> {\n /**\n * The number of columns.\n */\n columns?: StyleValue<number>\n /**\n * The width at which child elements will break into columns.\n * Pass a number for pixel values or a string for any other valid CSS length.\n */\n minChildWidth?: CSSProps[\"minWidth\"]\n}\n\nconst {\n PropsContext: SimpleGridPropsContext,\n usePropsContext: useSimpleGridPropsContext,\n withContext,\n} = createComponent<SimpleGridProps, SimpleGridStyle>(\n \"simple-grid\",\n simpleGridStyle,\n)\n\nexport { SimpleGridPropsContext, useSimpleGridPropsContext }\n\n/**\n * `SimpleGrid` is a component that makes `Grid` simpler and more user-friendly.\n *\n * @see https://yamada-ui.com/docs/components/simple-grid\n */\nexport const SimpleGrid = withContext<\"div\", SimpleGridProps>(Grid)(\n undefined,\n ({ columns, minChildWidth, ...rest }) => {\n const templateColumns = useMemo(() => {\n if (minChildWidth)\n return replaceObject(minChildWidth, (value) => {\n return value != null\n ? `repeat(auto-fit, minmax({sizes.${value}, ${value}}, 1fr))`\n : undefined\n })\n else\n return replaceObject(columns, (value) =>\n value != null ? `repeat(${value}, minmax(0, 1fr))` : undefined,\n )\n }, [minChildWidth, columns])\n\n return { templateColumns, ...rest }\n },\n)\n"],"mappings":";;;;;;;AA+BA,MAAM,EACJ,cAAc,wBACd,iBAAiB,2BACjB,gBACE,gBACF,eACA,eACF;;;;;;AASA,MAAa,aAAa,YAAoC,IAAI,CAAC,CACjE,KAAA,IACC,EAAE,SAAS,eAAe,GAAG,WAAW;CAcvC,OAAO;EAAE,iBAbe,cAAc;GACpC,IAAI,eACF,QAAA,GAAOA,cAAAA,cAAAA,CAAc,gBAAgB,UAAU;IAC7C,OAAO,SAAS,OACZ,kCAAkC,MAAM,IAAI,MAAM,YAClD,KAAA;GACN,CAAC;QAED,QAAA,GAAOA,cAAAA,cAAAA,CAAc,UAAU,UAC7B,SAAS,OAAO,UAAU,MAAM,qBAAqB,KAAA,CACvD;EACJ,GAAG,CAAC,eAAe,OAAO,CAEH;EAAG,GAAG;CAAK;AACpC,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.js","names":[],"sources":["../../../../src/components/skeleton/skeleton.tsx"],"sourcesContent":["\"use client\"\n\nimport type { CSSProps, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { SkeletonStyle } from \"./skeleton.style\"\nimport { createComponent, varAttr } from \"../../core\"\nimport { dataAttr, isNumber, useValidChildren } from \"../../utils\"\nimport { skeletonStyle } from \"./skeleton.style\"\n\nexport interface SkeletonProps\n extends HTMLStyledProps, ThemeProps<SkeletonStyle> {\n /**\n * The animation duration in seconds.\n */\n duration?: number | string\n /**\n * The color at the animation end.\n */\n endColor?: CSSProps[\"color\"]\n /**\n * The fade in duration in seconds. Requires `loaded` toggled to `true` in order to see the transition.\n */\n fadeDuration?: number | string\n /**\n * If `true`, the skeleton will take the width of it's children.\n *\n * @default false\n */\n fitContent?: boolean\n /**\n * The color at the animation start.\n */\n startColor?: CSSProps[\"color\"]\n}\n\nconst {\n PropsContext: SkeletonPropsContext,\n usePropsContext: useSkeletonPropsContext,\n withContext,\n} = createComponent<SkeletonProps, SkeletonStyle>(\"skeleton\", skeletonStyle)\n\nexport { SkeletonPropsContext, useSkeletonPropsContext }\n\n/**\n * `Skeleton` is a component that acts as a placeholder until content is loaded.\n *\n * @see https://yamada-ui.com/docs/components/skeleton\n */\nexport const Skeleton = withContext(\"div\", { transferProps: [\"loading\"] })(\n undefined,\n ({\n children,\n duration,\n endColor,\n fadeDuration,\n fitContent,\n loading,\n startColor,\n ...rest\n }) => {\n const validChildren = useValidChildren(children)\n const hasChildren = !!validChildren.length\n\n fitContent ??= hasChildren\n\n return {\n \"aria-busy\": loading,\n \"data-loaded\": dataAttr(!loading),\n \"data-loading\": dataAttr(loading),\n \"--duration\": isNumber(duration) ? `${duration}s` : duration,\n \"--end-color\": varAttr(endColor, \"colors\"),\n \"--fade-duration\": isNumber(fadeDuration)\n ? `${fadeDuration}s`\n : fadeDuration,\n \"--height\": fitContent ? \"fit-content\" : undefined,\n \"--start-color\": varAttr(startColor, \"colors\"),\n \"--width\": fitContent ? \"fit-content\" : undefined,\n children,\n ...rest,\n }\n },\n)\n"],"mappings":";;;;;;;AAkCA,MAAM,EACJ,cAAc,sBACd,iBAAiB,yBACjB,gBACE,gBAA8C,YAAY,aAAa;;;;;;AAS3E,MAAa,WAAW,YAAY,OAAO,EAAE,eAAe,CAAC,SAAS,EAAE,CAAC,CAAC,CACxE,KAAA,IACC,EACC,UACA,UACA,UACA,cACA,YACA,SACA,YACA,GAAG,WACC;CAEJ,MAAM,cAAc,CAAC,CADC,iBAAiB,QACL,CAAC,CAAC;CAEpC,eAAe;CAEf,OAAO;EACL,aAAa;EACb,gBAAA,
|
|
1
|
+
{"version":3,"file":"skeleton.js","names":["dataAttr","isNumber"],"sources":["../../../../src/components/skeleton/skeleton.tsx"],"sourcesContent":["\"use client\"\n\nimport type { CSSProps, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { SkeletonStyle } from \"./skeleton.style\"\nimport { createComponent, varAttr } from \"../../core\"\nimport { dataAttr, isNumber, useValidChildren } from \"../../utils\"\nimport { skeletonStyle } from \"./skeleton.style\"\n\nexport interface SkeletonProps\n extends HTMLStyledProps, ThemeProps<SkeletonStyle> {\n /**\n * The animation duration in seconds.\n */\n duration?: number | string\n /**\n * The color at the animation end.\n */\n endColor?: CSSProps[\"color\"]\n /**\n * The fade in duration in seconds. Requires `loaded` toggled to `true` in order to see the transition.\n */\n fadeDuration?: number | string\n /**\n * If `true`, the skeleton will take the width of it's children.\n *\n * @default false\n */\n fitContent?: boolean\n /**\n * The color at the animation start.\n */\n startColor?: CSSProps[\"color\"]\n}\n\nconst {\n PropsContext: SkeletonPropsContext,\n usePropsContext: useSkeletonPropsContext,\n withContext,\n} = createComponent<SkeletonProps, SkeletonStyle>(\"skeleton\", skeletonStyle)\n\nexport { SkeletonPropsContext, useSkeletonPropsContext }\n\n/**\n * `Skeleton` is a component that acts as a placeholder until content is loaded.\n *\n * @see https://yamada-ui.com/docs/components/skeleton\n */\nexport const Skeleton = withContext(\"div\", { transferProps: [\"loading\"] })(\n undefined,\n ({\n children,\n duration,\n endColor,\n fadeDuration,\n fitContent,\n loading,\n startColor,\n ...rest\n }) => {\n const validChildren = useValidChildren(children)\n const hasChildren = !!validChildren.length\n\n fitContent ??= hasChildren\n\n return {\n \"aria-busy\": loading,\n \"data-loaded\": dataAttr(!loading),\n \"data-loading\": dataAttr(loading),\n \"--duration\": isNumber(duration) ? `${duration}s` : duration,\n \"--end-color\": varAttr(endColor, \"colors\"),\n \"--fade-duration\": isNumber(fadeDuration)\n ? `${fadeDuration}s`\n : fadeDuration,\n \"--height\": fitContent ? \"fit-content\" : undefined,\n \"--start-color\": varAttr(startColor, \"colors\"),\n \"--width\": fitContent ? \"fit-content\" : undefined,\n children,\n ...rest,\n }\n },\n)\n"],"mappings":";;;;;;;AAkCA,MAAM,EACJ,cAAc,sBACd,iBAAiB,yBACjB,gBACE,gBAA8C,YAAY,aAAa;;;;;;AAS3E,MAAa,WAAW,YAAY,OAAO,EAAE,eAAe,CAAC,SAAS,EAAE,CAAC,CAAC,CACxE,KAAA,IACC,EACC,UACA,UACA,UACA,cACA,YACA,SACA,YACA,GAAG,WACC;CAEJ,MAAM,cAAc,CAAC,CADC,iBAAiB,QACL,CAAC,CAAC;CAEpC,eAAe;CAEf,OAAO;EACL,aAAa;EACb,gBAAA,GAAeA,cAAAA,SAAAA,CAAS,CAAC,OAAO;EAChC,iBAAA,GAAgBA,cAAAA,SAAAA,CAAS,OAAO;EAChC,eAAA,GAAcC,cAAAA,SAAAA,CAAS,QAAQ,IAAI,GAAG,SAAS,KAAK;EACpD,eAAe,QAAQ,UAAU,QAAQ;EACzC,oBAAA,GAAmBA,cAAAA,SAAAA,CAAS,YAAY,IACpC,GAAG,aAAa,KAChB;EACJ,YAAY,aAAa,gBAAgB,KAAA;EACzC,iBAAiB,QAAQ,YAAY,QAAQ;EAC7C,WAAW,aAAa,gBAAgB,KAAA;EACxC;EACA,GAAG;CACL;AACF,CACF"}
|
|
@@ -16,8 +16,9 @@ const { ComponentContext, PropsContext: SliderPropsContext, useComponentContext,
|
|
|
16
16
|
* @see https://yamada-ui.com/docs/components/slider
|
|
17
17
|
*/
|
|
18
18
|
const SliderRoot = withProvider(({ children, marks, orientation: orientationProp, inputProps, marksProps, rangeProps, thumbProps, trackProps, ...rest }) => {
|
|
19
|
+
const orientation = useValue(orientationProp);
|
|
19
20
|
const { range, getInputProps, getMarkProps, getRangeProps, getRootProps, getThumbProps, getTrackProps } = useSlider({
|
|
20
|
-
orientation
|
|
21
|
+
orientation,
|
|
21
22
|
...rest
|
|
22
23
|
});
|
|
23
24
|
const computedChildren = useMemo(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.js","names":[],"sources":["../../../../src/components/slider/slider.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, ReactElement, ReactNode } from \"react\"\nimport type {\n CSSProps,\n GenericsComponent,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { SliderStyle } from \"./slider.style\"\nimport type { UseSliderProps, UseSliderReturn } from \"./use-slider\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, styled, varAttr } from \"../../core\"\nimport { useValue } from \"../../hooks/use-value\"\nimport { dataAttr, isNumber } from \"../../utils\"\nimport { sliderStyle } from \"./slider.style\"\nimport { useSlider } from \"./use-slider\"\n\ninterface ComponentContext extends Pick<\n UseSliderReturn,\n | \"getInputProps\"\n | \"getMarkProps\"\n | \"getRangeProps\"\n | \"getThumbProps\"\n | \"getTrackProps\"\n | \"range\"\n> {}\n\nexport interface SliderRootProps<Y extends [number, number] | number = number>\n extends\n Omit<HTMLStyledProps, \"defaultValue\" | \"onChange\" | \"ref\">,\n Omit<UseSliderProps<Y>, \"orientation\">,\n ThemeProps<SliderStyle> {\n /**\n * The fill color of the indicator.\n */\n indicatorFill?: CSSProps[\"color\"]\n /**\n * The rounded of the indicator.\n */\n indicatorRounded?: CSSProps[\"rounded\"]\n /**\n * The marks to display on the slider.\n */\n marks?: SliderMarksProps[\"marks\"]\n /**\n * The fill color of the range.\n */\n rangeFill?: CSSProps[\"color\"]\n /**\n * The fill color of the thumb.\n */\n thumbFill?: CSSProps[\"color\"]\n /**\n * The rounded of the thumb.\n */\n thumbRounded?: CSSProps[\"rounded\"]\n /**\n * The size of the thumb.\n */\n thumbSize?: CSSProps[\"boxSize\"]\n /**\n * The stroke color of the thumb.\n */\n thumbStroke?: CSSProps[\"color\"]\n /**\n * The fill color of the track.\n */\n trackFill?: CSSProps[\"color\"]\n /**\n * The rounded of the track.\n */\n trackRounded?: CSSProps[\"rounded\"]\n /**\n * The size of the track.\n */\n trackSize?: CSSProps[\"boxSize\"]\n /**\n * Props for the input element.\n */\n inputProps?: SliderInputProps\n /**\n * Props for the marks element.\n */\n marksProps?: Partial<SliderMarksProps>\n /**\n * Props for the range element.\n */\n rangeProps?: SliderRangeProps\n /**\n * Props for the thumb element.\n */\n thumbProps?: SliderThumbProps\n /**\n * Props for the track element.\n */\n trackProps?: SliderTrackProps\n}\n\nconst {\n ComponentContext,\n PropsContext: SliderPropsContext,\n useComponentContext,\n usePropsContext: useSliderPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<SliderRootProps, SliderStyle, ComponentContext>(\n \"slider\",\n sliderStyle,\n)\n\nexport { SliderPropsContext, useSliderPropsContext }\n\n/**\n * `Slider` is a component used for allowing users to select a value from a range.\n *\n * @see https://yamada-ui.com/docs/components/slider\n */\nexport const SliderRoot = withProvider<\"input\", SliderRootProps, \"orientation\">(\n <Y extends [number, number] | number = number>({\n children,\n marks,\n orientation: orientationProp,\n inputProps,\n marksProps,\n rangeProps,\n thumbProps,\n trackProps,\n ...rest\n }: SliderRootProps<Y>) => {\n const orientation = useValue(orientationProp)\n const {\n range,\n getInputProps,\n getMarkProps,\n getRangeProps,\n getRootProps,\n getThumbProps,\n getTrackProps,\n } = useSlider<Y>({ orientation, ...rest })\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (\n <>\n <SliderTrack {...trackProps}>\n <SliderRange {...rangeProps} />\n\n {range ? (\n <SliderThumbs {...thumbProps} />\n ) : (\n <SliderThumb {...thumbProps} />\n )}\n </SliderTrack>\n\n {marks ? <SliderMarks marks={marks} {...marksProps} /> : null}\n </>\n )\n }, [children, marks, marksProps, range, rangeProps, thumbProps, trackProps])\n const context = useMemo(\n () => ({\n range,\n getInputProps,\n getMarkProps,\n getRangeProps,\n getThumbProps,\n getTrackProps,\n }),\n [\n range,\n getInputProps,\n getMarkProps,\n getRangeProps,\n getThumbProps,\n getTrackProps,\n ],\n )\n\n return (\n <ComponentContext value={context}>\n <styled.div {...getRootProps()}>\n <SliderInput {...inputProps} />\n\n {computedChildren}\n </styled.div>\n </ComponentContext>\n )\n },\n \"root\",\n { transferProps: [\"orientation\"] },\n)(\n undefined,\n ({\n indicatorFill,\n indicatorRounded,\n rangeFill,\n thumbFill,\n thumbRounded,\n thumbSize,\n thumbStroke,\n trackFill,\n trackRounded,\n trackSize,\n ...rest\n }) => ({\n \"--indicator-fill\": varAttr(indicatorFill, \"colors\"),\n \"--indicator-rounded\": varAttr(indicatorRounded, \"radii\"),\n \"--range-fill\": varAttr(rangeFill, \"colors\"),\n \"--thumb-fill\": varAttr(thumbFill, \"colors\"),\n \"--thumb-rounded\": varAttr(thumbRounded, \"radii\"),\n \"--thumb-size\": varAttr(thumbSize, \"sizes\"),\n \"--thumb-stroke\": varAttr(thumbStroke, \"colors\"),\n \"--track-fill\": varAttr(trackFill, \"colors\"),\n \"--track-rounded\": varAttr(trackRounded, \"radii\"),\n \"--track-size\": varAttr(trackSize, \"sizes\"),\n ...rest,\n }),\n) as GenericsComponent<{\n <Y extends [number, number] | number = number>(\n props: SliderRootProps<Y>,\n ): ReactElement\n}>\n\ninterface SliderInputProps extends HTMLStyledProps<\"input\"> {}\n\nconst SliderInput: FC<SliderInputProps> = () => {\n const { range, getInputProps } = useComponentContext()\n\n return range ? (\n Array.from({ length: 2 }).map((_, index) => (\n <styled.input key={index} {...getInputProps({ index })} />\n ))\n ) : (\n <styled.input {...getInputProps()} />\n )\n}\n\nexport interface SliderTrackProps extends HTMLStyledProps {}\n\nexport const SliderTrack = withContext<\"div\", SliderTrackProps>(\"div\", \"track\")(\n undefined,\n (props) => {\n const { getTrackProps } = useComponentContext()\n\n return getTrackProps(props)\n },\n)\n\nexport interface SliderRangeProps extends HTMLStyledProps {}\n\nexport const SliderRange = withContext<\"div\", SliderRangeProps>(\"div\", \"range\")(\n undefined,\n (props) => {\n const { getRangeProps } = useComponentContext()\n\n return getRangeProps(props)\n },\n)\n\nexport interface SliderMarkProps extends HTMLStyledProps {\n /**\n * The value of the mark.\n */\n value: number\n /**\n * Whether the mark is an indicator.\n *\n * @default true\n */\n indicator?: boolean\n}\n\nexport const SliderMark = withContext<\"div\", SliderMarkProps>(\"div\", \"mark\")(\n undefined,\n ({ indicator = true, ...props }) => {\n const { getMarkProps } = useComponentContext()\n\n return getMarkProps({ \"data-indicator\": dataAttr(indicator), ...props })\n },\n)\n\nexport interface SliderMarksProps extends Omit<SliderMarkProps, \"value\"> {\n /**\n * The marks to display on the slider.\n */\n marks: (number | { label: ReactNode; value: number; indicator?: boolean })[]\n}\n\nexport const SliderMarks: FC<SliderMarksProps> = ({ marks, ...props }) => {\n return (\n <>\n {marks.map((mark, index) => {\n if (isNumber(mark)) {\n return <SliderMark key={index} value={mark} {...props} />\n } else {\n const { indicator, label, value } = mark\n\n return (\n <SliderMark key={index} indicator={indicator} value={value}>\n {label}\n </SliderMark>\n )\n }\n })}\n </>\n )\n}\n\nexport interface SliderThumbProps extends HTMLStyledProps {\n /**\n * The index of the thumb.\n */\n index?: number\n}\n\nexport const SliderThumb = withContext<\"div\", SliderThumbProps>(\"div\", \"thumb\")(\n undefined,\n (props) => {\n const { getThumbProps } = useComponentContext()\n\n return getThumbProps(props)\n },\n)\n\nexport interface SliderThumbsProps extends SliderThumbProps {}\n\nexport const SliderThumbs: FC<SliderThumbsProps> = (props) => {\n return (\n <>\n {Array.from({ length: 2 }).map((_, index) => (\n <SliderThumb key={index} index={index} {...props} />\n ))}\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;AAmGA,MAAM,EACJ,kBACA,cAAc,oBACd,qBACA,iBAAiB,uBACjB,aACA,iBACE,oBACF,UACA,WACF;;;;;;AASA,MAAa,aAAa,cACuB,EAC7C,UACA,OACA,aAAa,iBACb,YACA,YACA,YACA,YACA,YACA,GAAG,WACqB;CAExB,MAAM,EACJ,OACA,eACA,cACA,eACA,cACA,eACA,kBACE,UAAa;EAAE,aATC,SAAS,eASA;EAAG,GAAG;CAAK,CAAC;CACzC,MAAM,mBAAmB,cAAc;EACrC,IAAI,UAAU,OAAO;EAErB,OACE,qBAAA,YAAA,EAAA,UAAA,CACE,qBAAC,aAAD;GAAa,GAAI;GAAjB,UAAA,CACE,oBAAC,aAAD,EAAa,GAAI,WAAa,CAAA,GAE7B,QACC,oBAAC,cAAD,EAAc,GAAI,WAAa,CAAA,IAE/B,oBAAC,aAAD,EAAa,GAAI,WAAa,CAAA,CAErB;EAEZ,CAAA,GAAA,QAAQ,oBAAC,aAAD;GAAoB;GAAO,GAAI;EAAa,CAAA,IAAI,IACzD,EAAA,CAAA;CAEN,GAAG;EAAC;EAAU;EAAO;EAAY;EAAO;EAAY;EAAY;CAAU,CAAC;CAC3E,MAAM,UAAU,eACP;EACL;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,oBAAC,kBAAD;EAAkB,OAAO;EACvB,UAAA,qBAAC,OAAO,KAAR;GAAY,GAAI,aAAa;GAA7B,UAAA,CACE,oBAAC,aAAD,EAAa,GAAI,WAAa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BAAoB;CAE7C,OAAO,aAAa;EAAE,mBAAA,GAAA,cAAA,SAAA,CAA2B,SAAS;EAAG,GAAG;CAAM,CAAC;AACzE,CACF;AASA,MAAa,eAAqC,EAAE,OAAO,GAAG,YAAY;CACxE,OACE,oBAAA,YAAA,EAAA,UACG,MAAM,KAAK,MAAM,UAAU;EAC1B,KAAA,GAAA,cAAA,SAAA,CAAa,IAAI,GACf,OAAO,oBAAC,YAAD;GAAwB,OAAO;GAAM,GAAI;EAAQ,GAAhC,KAAgC;OACnD;GACL,MAAM,EAAE,WAAW,OAAO,UAAU;GAEpC,OACE,oBAAC,YAAD;IAAmC;IAAkB;IAClD,UAAA;GACS,GAFK,KAEL;EAEhB;CACF,CAAC,EACD,CAAA;AAEN;AASA,MAAa,cAAc,YAAqC,OAAO,OAAO,CAAC,CAC7E,KAAA,IACC,UAAU;CACT,MAAM,EAAE,kBAAkB,oBAAoB;CAE9C,OAAO,cAAc,KAAK;AAC5B,CACF;AAIA,MAAa,gBAAuC,UAAU;CAC5D,OACE,oBAAA,YAAA,EAAA,UACG,MAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,UACjC,oBAAC,aAAD;EAAgC;EAAO,GAAI;CAAQ,GAAjC,KAAiC,CACpD,EACD,CAAA;AAEN"}
|
|
1
|
+
{"version":3,"file":"slider.js","names":["dataAttr","isNumber"],"sources":["../../../../src/components/slider/slider.tsx"],"sourcesContent":["\"use client\"\n\nimport type { FC, ReactElement, ReactNode } from \"react\"\nimport type {\n CSSProps,\n GenericsComponent,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { SliderStyle } from \"./slider.style\"\nimport type { UseSliderProps, UseSliderReturn } from \"./use-slider\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, styled, varAttr } from \"../../core\"\nimport { useValue } from \"../../hooks/use-value\"\nimport { dataAttr, isNumber } from \"../../utils\"\nimport { sliderStyle } from \"./slider.style\"\nimport { useSlider } from \"./use-slider\"\n\ninterface ComponentContext extends Pick<\n UseSliderReturn,\n | \"getInputProps\"\n | \"getMarkProps\"\n | \"getRangeProps\"\n | \"getThumbProps\"\n | \"getTrackProps\"\n | \"range\"\n> {}\n\nexport interface SliderRootProps<Y extends [number, number] | number = number>\n extends\n Omit<HTMLStyledProps, \"defaultValue\" | \"onChange\" | \"ref\">,\n Omit<UseSliderProps<Y>, \"orientation\">,\n ThemeProps<SliderStyle> {\n /**\n * The fill color of the indicator.\n */\n indicatorFill?: CSSProps[\"color\"]\n /**\n * The rounded of the indicator.\n */\n indicatorRounded?: CSSProps[\"rounded\"]\n /**\n * The marks to display on the slider.\n */\n marks?: SliderMarksProps[\"marks\"]\n /**\n * The fill color of the range.\n */\n rangeFill?: CSSProps[\"color\"]\n /**\n * The fill color of the thumb.\n */\n thumbFill?: CSSProps[\"color\"]\n /**\n * The rounded of the thumb.\n */\n thumbRounded?: CSSProps[\"rounded\"]\n /**\n * The size of the thumb.\n */\n thumbSize?: CSSProps[\"boxSize\"]\n /**\n * The stroke color of the thumb.\n */\n thumbStroke?: CSSProps[\"color\"]\n /**\n * The fill color of the track.\n */\n trackFill?: CSSProps[\"color\"]\n /**\n * The rounded of the track.\n */\n trackRounded?: CSSProps[\"rounded\"]\n /**\n * The size of the track.\n */\n trackSize?: CSSProps[\"boxSize\"]\n /**\n * Props for the input element.\n */\n inputProps?: SliderInputProps\n /**\n * Props for the marks element.\n */\n marksProps?: Partial<SliderMarksProps>\n /**\n * Props for the range element.\n */\n rangeProps?: SliderRangeProps\n /**\n * Props for the thumb element.\n */\n thumbProps?: SliderThumbProps\n /**\n * Props for the track element.\n */\n trackProps?: SliderTrackProps\n}\n\nconst {\n ComponentContext,\n PropsContext: SliderPropsContext,\n useComponentContext,\n usePropsContext: useSliderPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<SliderRootProps, SliderStyle, ComponentContext>(\n \"slider\",\n sliderStyle,\n)\n\nexport { SliderPropsContext, useSliderPropsContext }\n\n/**\n * `Slider` is a component used for allowing users to select a value from a range.\n *\n * @see https://yamada-ui.com/docs/components/slider\n */\nexport const SliderRoot = withProvider<\"input\", SliderRootProps, \"orientation\">(\n <Y extends [number, number] | number = number>({\n children,\n marks,\n orientation: orientationProp,\n inputProps,\n marksProps,\n rangeProps,\n thumbProps,\n trackProps,\n ...rest\n }: SliderRootProps<Y>) => {\n const orientation = useValue(orientationProp)\n const {\n range,\n getInputProps,\n getMarkProps,\n getRangeProps,\n getRootProps,\n getThumbProps,\n getTrackProps,\n } = useSlider<Y>({ orientation, ...rest })\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (\n <>\n <SliderTrack {...trackProps}>\n <SliderRange {...rangeProps} />\n\n {range ? (\n <SliderThumbs {...thumbProps} />\n ) : (\n <SliderThumb {...thumbProps} />\n )}\n </SliderTrack>\n\n {marks ? <SliderMarks marks={marks} {...marksProps} /> : null}\n </>\n )\n }, [children, marks, marksProps, range, rangeProps, thumbProps, trackProps])\n const context = useMemo(\n () => ({\n range,\n getInputProps,\n getMarkProps,\n getRangeProps,\n getThumbProps,\n getTrackProps,\n }),\n [\n range,\n getInputProps,\n getMarkProps,\n getRangeProps,\n getThumbProps,\n getTrackProps,\n ],\n )\n\n return (\n <ComponentContext value={context}>\n <styled.div {...getRootProps()}>\n <SliderInput {...inputProps} />\n\n {computedChildren}\n </styled.div>\n </ComponentContext>\n )\n },\n \"root\",\n { transferProps: [\"orientation\"] },\n)(\n undefined,\n ({\n indicatorFill,\n indicatorRounded,\n rangeFill,\n thumbFill,\n thumbRounded,\n thumbSize,\n thumbStroke,\n trackFill,\n trackRounded,\n trackSize,\n ...rest\n }) => ({\n \"--indicator-fill\": varAttr(indicatorFill, \"colors\"),\n \"--indicator-rounded\": varAttr(indicatorRounded, \"radii\"),\n \"--range-fill\": varAttr(rangeFill, \"colors\"),\n \"--thumb-fill\": varAttr(thumbFill, \"colors\"),\n \"--thumb-rounded\": varAttr(thumbRounded, \"radii\"),\n \"--thumb-size\": varAttr(thumbSize, \"sizes\"),\n \"--thumb-stroke\": varAttr(thumbStroke, \"colors\"),\n \"--track-fill\": varAttr(trackFill, \"colors\"),\n \"--track-rounded\": varAttr(trackRounded, \"radii\"),\n \"--track-size\": varAttr(trackSize, \"sizes\"),\n ...rest,\n }),\n) as GenericsComponent<{\n <Y extends [number, number] | number = number>(\n props: SliderRootProps<Y>,\n ): ReactElement\n}>\n\ninterface SliderInputProps extends HTMLStyledProps<\"input\"> {}\n\nconst SliderInput: FC<SliderInputProps> = () => {\n const { range, getInputProps } = useComponentContext()\n\n return range ? (\n Array.from({ length: 2 }).map((_, index) => (\n <styled.input key={index} {...getInputProps({ index })} />\n ))\n ) : (\n <styled.input {...getInputProps()} />\n )\n}\n\nexport interface SliderTrackProps extends HTMLStyledProps {}\n\nexport const SliderTrack = withContext<\"div\", SliderTrackProps>(\"div\", \"track\")(\n undefined,\n (props) => {\n const { getTrackProps } = useComponentContext()\n\n return getTrackProps(props)\n },\n)\n\nexport interface SliderRangeProps extends HTMLStyledProps {}\n\nexport const SliderRange = withContext<\"div\", SliderRangeProps>(\"div\", \"range\")(\n undefined,\n (props) => {\n const { getRangeProps } = useComponentContext()\n\n return getRangeProps(props)\n },\n)\n\nexport interface SliderMarkProps extends HTMLStyledProps {\n /**\n * The value of the mark.\n */\n value: number\n /**\n * Whether the mark is an indicator.\n *\n * @default true\n */\n indicator?: boolean\n}\n\nexport const SliderMark = withContext<\"div\", SliderMarkProps>(\"div\", \"mark\")(\n undefined,\n ({ indicator = true, ...props }) => {\n const { getMarkProps } = useComponentContext()\n\n return getMarkProps({ \"data-indicator\": dataAttr(indicator), ...props })\n },\n)\n\nexport interface SliderMarksProps extends Omit<SliderMarkProps, \"value\"> {\n /**\n * The marks to display on the slider.\n */\n marks: (number | { label: ReactNode; value: number; indicator?: boolean })[]\n}\n\nexport const SliderMarks: FC<SliderMarksProps> = ({ marks, ...props }) => {\n return (\n <>\n {marks.map((mark, index) => {\n if (isNumber(mark)) {\n return <SliderMark key={index} value={mark} {...props} />\n } else {\n const { indicator, label, value } = mark\n\n return (\n <SliderMark key={index} indicator={indicator} value={value}>\n {label}\n </SliderMark>\n )\n }\n })}\n </>\n )\n}\n\nexport interface SliderThumbProps extends HTMLStyledProps {\n /**\n * The index of the thumb.\n */\n index?: number\n}\n\nexport const SliderThumb = withContext<\"div\", SliderThumbProps>(\"div\", \"thumb\")(\n undefined,\n (props) => {\n const { getThumbProps } = useComponentContext()\n\n return getThumbProps(props)\n },\n)\n\nexport interface SliderThumbsProps extends SliderThumbProps {}\n\nexport const SliderThumbs: FC<SliderThumbsProps> = (props) => {\n return (\n <>\n {Array.from({ length: 2 }).map((_, index) => (\n <SliderThumb key={index} index={index} {...props} />\n ))}\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;AAmGA,MAAM,EACJ,kBACA,cAAc,oBACd,qBACA,iBAAiB,uBACjB,aACA,iBACE,oBACF,UACA,WACF;;;;;;AASA,MAAa,aAAa,cACuB,EAC7C,UACA,OACA,aAAa,iBACb,YACA,YACA,YACA,YACA,YACA,GAAG,WACqB;CACxB,MAAM,cAAc,SAAS,eAAe;CAC5C,MAAM,EACJ,OACA,eACA,cACA,eACA,cACA,eACA,kBACE,UAAa;EAAE;EAAa,GAAG;CAAK,CAAC;CACzC,MAAM,mBAAmB,cAAc;EACrC,IAAI,UAAU,OAAO;EAErB,OACE,qBAAA,YAAA,EAAA,UAAA,CACE,qBAAC,aAAD;GAAa,GAAI;GAAjB,UAAA,CACE,oBAAC,aAAD,EAAa,GAAI,WAAa,CAAA,GAE7B,QACC,oBAAC,cAAD,EAAc,GAAI,WAAa,CAAA,IAE/B,oBAAC,aAAD,EAAa,GAAI,WAAa,CAAA,CAErB;EAEZ,CAAA,GAAA,QAAQ,oBAAC,aAAD;GAAoB;GAAO,GAAI;EAAa,CAAA,IAAI,IACzD,EAAA,CAAA;CAEN,GAAG;EAAC;EAAU;EAAO;EAAY;EAAO;EAAY;EAAY;CAAU,CAAC;CAC3E,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AO,OAAO,CAAC,CAC7E,KAAA,IACC,UAAU;CACT,MAAM,EAAE,kBAAkB,oBAAoB;CAE9C,OAAO,cAAc,KAAK;AAC5B,CACF;AAeA,MAAa,aAAa,YAAoC,OAAO,MAAM,CAAC,CAC1E,KAAA,IACC,EAAE,YAAY,MAAM,GAAG,YAAY;CAClC,MAAM,EAAE,iBAAiB,oBAAoB;CAE7C,OAAO,aAAa;EAAE,mBAAA,GAAkBA,cAAAA,SAAAA,CAAS,SAAS;EAAG,GAAG;CAAM,CAAC;AACzE,CACF;AASA,MAAa,eAAqC,EAAE,OAAO,GAAG,YAAY;CACxE,OACE,oBAAA,YAAA,EAAA,UACG,MAAM,KAAK,MAAM,UAAU;EAC1B,KAAA,GAAIC,cAAAA,SAAAA,CAAS,IAAI,GACf,OAAO,oBAAC,YAAD;GAAwB,OAAO;GAAM,GAAI;EAAQ,GAAhC,KAAgC;OACnD;GACL,MAAM,EAAE,WAAW,OAAO,UAAU;GAEpC,OACE,oBAAC,YAAD;IAAmC;IAAkB;IAClD,UAAA;GACS,GAFK,KAEL;EAEhB;CACF,CAAC,EACD,CAAA;AAEN;AASA,MAAa,cAAc,YAAqC,OAAO,OAAO,CAAC,CAC7E,KAAA,IACC,UAAU;CACT,MAAM,EAAE,kBAAkB,oBAAoB;CAE9C,OAAO,cAAc,KAAK;AAC5B,CACF;AAIA,MAAa,gBAAuC,UAAU;CAC5D,OACE,oBAAA,YAAA,EAAA,UACG,MAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,UACjC,oBAAC,aAAD;EAAgC;EAAO,GAAI;CAAQ,GAAjC,KAAiC,CACpD,EACD,CAAA;AAEN"}
|
|
@@ -73,7 +73,8 @@ const useSlider = (props = {}) => {
|
|
|
73
73
|
value
|
|
74
74
|
]);
|
|
75
75
|
const getPanValue = useCallback(({ x, y }, { bottom, height, left, width }) => {
|
|
76
|
-
|
|
76
|
+
const percent = (orientation === "horizontal" ? x - left : bottom - y) / (orientation === "horizontal" ? width : height);
|
|
77
|
+
let nextValue = (0, utils_exports.percentToValue)(percent, min, max);
|
|
77
78
|
nextValue = parseFloat((0, utils_exports.roundNumberToStep)(nextValue, min, step));
|
|
78
79
|
nextValue = (0, utils_exports.clampNumber)(nextValue, min, max);
|
|
79
80
|
return nextValue;
|