@yamada-ui/react 2.2.5-dev-20260727044042 → 2.2.5-dev-20260727071034
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/accordion/accordion.cjs.map +1 -1
- package/dist/cjs/components/action-bar/action-bar.cjs.map +1 -1
- package/dist/cjs/components/airy/airy.cjs.map +1 -1
- package/dist/cjs/components/alert/alert.cjs.map +1 -1
- package/dist/cjs/components/alpha-slider/alpha-slider.cjs.map +1 -1
- package/dist/cjs/components/autocomplete/autocomplete.cjs.map +1 -1
- package/dist/cjs/components/autocomplete/use-autocomplete.cjs.map +1 -1
- package/dist/cjs/components/avatar/avatar-group.cjs.map +1 -1
- package/dist/cjs/components/avatar/avatar.cjs.map +1 -1
- package/dist/cjs/components/blockquote/blockquote.cjs.map +1 -1
- package/dist/cjs/components/breadcrumb/breadcrumb.cjs.map +1 -1
- package/dist/cjs/components/button/button-group.cjs.map +1 -1
- package/dist/cjs/components/button/button.cjs.map +1 -1
- package/dist/cjs/components/calendar/calendar.cjs.map +1 -1
- package/dist/cjs/components/calendar/use-calendar.cjs.map +1 -1
- package/dist/cjs/components/carousel/carousel.cjs.map +1 -1
- package/dist/cjs/components/chart/cartesian-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/chart.cjs.map +1 -1
- package/dist/cjs/components/chart/polar-chart.cjs.map +1 -1
- package/dist/cjs/components/checkbox/checkbox-group.cjs.map +1 -1
- package/dist/cjs/components/checkbox/checkbox.cjs.map +1 -1
- package/dist/cjs/components/checkbox-card/checkbox-card-group.cjs.map +1 -1
- package/dist/cjs/components/checkbox-card/checkbox-card.cjs.map +1 -1
- package/dist/cjs/components/circle-progress/circle-progress.cjs.map +1 -1
- package/dist/cjs/components/collapse/collapse.cjs.map +1 -1
- package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
- package/dist/cjs/components/color-selector/color-selector.cjs.map +1 -1
- package/dist/cjs/components/color-swatch/color-swatch-group.cjs.map +1 -1
- package/dist/cjs/components/color-swatch/color-swatch.cjs.map +1 -1
- package/dist/cjs/components/data-list/data-list.cjs.map +1 -1
- package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
- package/dist/cjs/components/date-picker/use-date-picker.cjs.map +1 -1
- package/dist/cjs/components/drawer/drawer.cjs.map +1 -1
- package/dist/cjs/components/dropzone/dropzone.cjs.map +1 -1
- package/dist/cjs/components/editable/editable.cjs.map +1 -1
- package/dist/cjs/components/empty-state/empty-state.cjs.map +1 -1
- package/dist/cjs/components/fade/fade.cjs.map +1 -1
- package/dist/cjs/components/fade-scale/fade-scale.cjs.map +1 -1
- package/dist/cjs/components/field/field.cjs.map +1 -1
- package/dist/cjs/components/fieldset/fieldset.cjs.map +1 -1
- package/dist/cjs/components/file-input/file-input.cjs.map +1 -1
- package/dist/cjs/components/flip/flip.cjs.map +1 -1
- package/dist/cjs/components/focus-lock/focus-lock.cjs.map +1 -1
- package/dist/cjs/components/form/form.cjs.map +1 -1
- package/dist/cjs/components/format/format-byte.cjs.map +1 -1
- package/dist/cjs/components/format/format-date-time.cjs.map +1 -1
- package/dist/cjs/components/format/format-number.cjs.map +1 -1
- package/dist/cjs/components/highlight/highlight.cjs.map +1 -1
- package/dist/cjs/components/hue-slider/hue-slider.cjs.map +1 -1
- package/dist/cjs/components/icon/icons/circle-euro-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/circle-euro-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/index.cjs +9 -3
- package/dist/cjs/components/icon/icons/index.cjs.map +1 -1
- package/dist/cjs/components/icon/icons/scan-box-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/scan-box-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/server-plus-icon.cjs +14 -0
- package/dist/cjs/components/icon/icons/server-plus-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/index.cjs +6 -2
- package/dist/cjs/components/indicator/indicator.cjs.map +1 -1
- package/dist/cjs/components/infinite-scroll-area/infinite-scroll-area.cjs.map +1 -1
- package/dist/cjs/components/input/input-group.cjs.map +1 -1
- package/dist/cjs/components/link-box/link-box.cjs.map +1 -1
- package/dist/cjs/components/list/list.cjs.map +1 -1
- package/dist/cjs/components/loading/audio.cjs.map +1 -1
- package/dist/cjs/components/loading/background.cjs.map +1 -1
- package/dist/cjs/components/loading/circles.cjs.map +1 -1
- package/dist/cjs/components/loading/dots.cjs.map +1 -1
- package/dist/cjs/components/loading/grid.cjs.map +1 -1
- package/dist/cjs/components/loading/loading-provider.cjs.map +1 -1
- package/dist/cjs/components/loading/oval.cjs.map +1 -1
- package/dist/cjs/components/loading/page.cjs.map +1 -1
- package/dist/cjs/components/loading/puff.cjs.map +1 -1
- package/dist/cjs/components/loading/rings.cjs.map +1 -1
- package/dist/cjs/components/loading/screen.cjs.map +1 -1
- package/dist/cjs/components/loading/suspense.cjs.map +1 -1
- package/dist/cjs/components/menu/menu.cjs.map +1 -1
- package/dist/cjs/components/menu/use-menu.cjs.map +1 -1
- package/dist/cjs/components/modal/modal.cjs.map +1 -1
- package/dist/cjs/components/native-accordion/native-accordion.cjs.map +1 -1
- package/dist/cjs/components/native-popover/native-popover.cjs.map +1 -1
- package/dist/cjs/components/native-select/native-select.cjs.map +1 -1
- package/dist/cjs/components/native-select/use-native-select.cjs.map +1 -1
- package/dist/cjs/components/native-table/native-table.cjs.map +1 -1
- package/dist/cjs/components/notice/notice-provider.cjs.map +1 -1
- package/dist/cjs/components/notice/notice.cjs.map +1 -1
- package/dist/cjs/components/notice/use-notice.cjs.map +1 -1
- package/dist/cjs/components/number-input/number-input.cjs.map +1 -1
- package/dist/cjs/components/pagination/pagination.cjs.map +1 -1
- package/dist/cjs/components/password-input/password-input.cjs.map +1 -1
- package/dist/cjs/components/password-input/strength-meter.cjs.map +1 -1
- package/dist/cjs/components/picture/picture.cjs.map +1 -1
- package/dist/cjs/components/pin-input/pin-input.cjs.map +1 -1
- package/dist/cjs/components/popover/popover.cjs.map +1 -1
- package/dist/cjs/components/progress/progress.cjs.map +1 -1
- package/dist/cjs/components/qr-code/qr-code.cjs.map +1 -1
- package/dist/cjs/components/radio/radio-group.cjs.map +1 -1
- package/dist/cjs/components/radio/radio.cjs.map +1 -1
- package/dist/cjs/components/radio-card/radio-card-group.cjs.map +1 -1
- package/dist/cjs/components/radio-card/radio-card.cjs.map +1 -1
- package/dist/cjs/components/rating/rating.cjs.map +1 -1
- package/dist/cjs/components/reorder/reorder.cjs.map +1 -1
- package/dist/cjs/components/resizable/resizable.cjs.map +1 -1
- package/dist/cjs/components/ripple/ripple.cjs.map +1 -1
- package/dist/cjs/components/rotate/rotate.cjs.map +1 -1
- package/dist/cjs/components/saturation-slider/saturation-slider.cjs.map +1 -1
- package/dist/cjs/components/saturation-slider/use-saturation-slider.cjs.map +1 -1
- package/dist/cjs/components/segmented-control/segmented-control.cjs.map +1 -1
- package/dist/cjs/components/select/select.cjs.map +1 -1
- package/dist/cjs/components/select/use-select.cjs.map +1 -1
- package/dist/cjs/components/sidebar/sidebar.cjs.map +1 -1
- package/dist/cjs/components/skeleton/skeleton-text.cjs.map +1 -1
- package/dist/cjs/components/slide/slide.cjs.map +1 -1
- package/dist/cjs/components/slide-fade/slide-fade.cjs.map +1 -1
- package/dist/cjs/components/slider/slider.cjs.map +1 -1
- package/dist/cjs/components/slot/slot.cjs.map +1 -1
- package/dist/cjs/components/snacks/snacks.cjs.map +1 -1
- package/dist/cjs/components/stack/stack.cjs.map +1 -1
- package/dist/cjs/components/stack/z-stack.cjs.map +1 -1
- package/dist/cjs/components/stat/stat.cjs.map +1 -1
- package/dist/cjs/components/status/status.cjs.map +1 -1
- package/dist/cjs/components/steps/steps.cjs.map +1 -1
- package/dist/cjs/components/switch/switch.cjs.map +1 -1
- package/dist/cjs/components/table/table.cjs.map +1 -1
- package/dist/cjs/components/tabs/tabs.cjs.map +1 -1
- package/dist/cjs/components/tag/tag.cjs.map +1 -1
- package/dist/cjs/components/timeline/timeline.cjs.map +1 -1
- package/dist/cjs/components/tip/tip.cjs.map +1 -1
- package/dist/cjs/components/toggle/toggle-group.cjs.map +1 -1
- package/dist/cjs/components/tooltip/tooltip.cjs.map +1 -1
- package/dist/cjs/components/tree/tree.cjs.map +1 -1
- package/dist/cjs/components/tree/use-tree.cjs.map +1 -1
- package/dist/cjs/core/components/create-component.cjs.map +1 -1
- package/dist/cjs/core/system/breakpoint.cjs.map +1 -1
- package/dist/cjs/core/system/environment-provider.cjs.map +1 -1
- package/dist/cjs/core/system/styled.cjs.map +1 -1
- package/dist/cjs/core/system/theme-provider.cjs.map +1 -1
- package/dist/cjs/hooks/use-async-callback/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-breakpoint/use-breakpoint.cjs.map +1 -1
- package/dist/cjs/hooks/use-combobox/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-field-sizing/index.cjs.map +1 -1
- package/dist/cjs/hooks/use-outside-click/index.cjs.map +1 -1
- package/dist/cjs/index.cjs +9 -3
- package/dist/cjs/providers/ui-provider/ui-provider.cjs.map +1 -1
- package/dist/cjs/utils/store.cjs.map +1 -1
- package/dist/esm/components/accordion/accordion.js.map +1 -1
- package/dist/esm/components/action-bar/action-bar.js.map +1 -1
- package/dist/esm/components/airy/airy.js.map +1 -1
- package/dist/esm/components/alert/alert.js.map +1 -1
- package/dist/esm/components/alpha-slider/alpha-slider.js.map +1 -1
- package/dist/esm/components/autocomplete/autocomplete.js.map +1 -1
- package/dist/esm/components/autocomplete/use-autocomplete.js.map +1 -1
- package/dist/esm/components/avatar/avatar-group.js.map +1 -1
- package/dist/esm/components/avatar/avatar.js.map +1 -1
- package/dist/esm/components/blockquote/blockquote.js.map +1 -1
- package/dist/esm/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/esm/components/button/button-group.js.map +1 -1
- package/dist/esm/components/button/button.js.map +1 -1
- package/dist/esm/components/calendar/calendar.js.map +1 -1
- package/dist/esm/components/calendar/use-calendar.js.map +1 -1
- package/dist/esm/components/carousel/carousel.js.map +1 -1
- package/dist/esm/components/chart/cartesian-chart.js.map +1 -1
- package/dist/esm/components/chart/chart.js.map +1 -1
- package/dist/esm/components/chart/polar-chart.js.map +1 -1
- package/dist/esm/components/checkbox/checkbox-group.js.map +1 -1
- package/dist/esm/components/checkbox/checkbox.js.map +1 -1
- package/dist/esm/components/checkbox-card/checkbox-card-group.js.map +1 -1
- package/dist/esm/components/checkbox-card/checkbox-card.js.map +1 -1
- package/dist/esm/components/circle-progress/circle-progress.js.map +1 -1
- package/dist/esm/components/collapse/collapse.js.map +1 -1
- package/dist/esm/components/color-picker/color-picker.js.map +1 -1
- package/dist/esm/components/color-selector/color-selector.js.map +1 -1
- package/dist/esm/components/color-swatch/color-swatch-group.js.map +1 -1
- package/dist/esm/components/color-swatch/color-swatch.js.map +1 -1
- package/dist/esm/components/data-list/data-list.js.map +1 -1
- package/dist/esm/components/date-picker/date-picker.js.map +1 -1
- package/dist/esm/components/date-picker/use-date-picker.js.map +1 -1
- package/dist/esm/components/drawer/drawer.js.map +1 -1
- package/dist/esm/components/dropzone/dropzone.js.map +1 -1
- package/dist/esm/components/editable/editable.js.map +1 -1
- package/dist/esm/components/empty-state/empty-state.js.map +1 -1
- package/dist/esm/components/fade/fade.js.map +1 -1
- package/dist/esm/components/fade-scale/fade-scale.js.map +1 -1
- package/dist/esm/components/field/field.js.map +1 -1
- package/dist/esm/components/fieldset/fieldset.js.map +1 -1
- package/dist/esm/components/file-input/file-input.js.map +1 -1
- package/dist/esm/components/flip/flip.js.map +1 -1
- package/dist/esm/components/focus-lock/focus-lock.js.map +1 -1
- package/dist/esm/components/form/form.js.map +1 -1
- package/dist/esm/components/format/format-byte.js.map +1 -1
- package/dist/esm/components/format/format-date-time.js.map +1 -1
- package/dist/esm/components/format/format-number.js.map +1 -1
- package/dist/esm/components/highlight/highlight.js.map +1 -1
- package/dist/esm/components/hue-slider/hue-slider.js.map +1 -1
- package/dist/esm/components/icon/icons/circle-euro-icon.js +14 -0
- package/dist/esm/components/icon/icons/circle-euro-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/index.js +7 -3
- package/dist/esm/components/icon/icons/index.js.map +1 -1
- package/dist/esm/components/icon/icons/scan-box-icon.js +14 -0
- package/dist/esm/components/icon/icons/scan-box-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/server-plus-icon.js +14 -0
- package/dist/esm/components/icon/icons/server-plus-icon.js.map +1 -0
- package/dist/esm/components/icon/index.js +4 -2
- package/dist/esm/components/indicator/indicator.js.map +1 -1
- package/dist/esm/components/infinite-scroll-area/infinite-scroll-area.js.map +1 -1
- package/dist/esm/components/input/input-group.js.map +1 -1
- package/dist/esm/components/link-box/link-box.js.map +1 -1
- package/dist/esm/components/list/list.js.map +1 -1
- package/dist/esm/components/loading/audio.js.map +1 -1
- package/dist/esm/components/loading/background.js.map +1 -1
- package/dist/esm/components/loading/circles.js.map +1 -1
- package/dist/esm/components/loading/dots.js.map +1 -1
- package/dist/esm/components/loading/grid.js.map +1 -1
- package/dist/esm/components/loading/loading-provider.js.map +1 -1
- package/dist/esm/components/loading/oval.js.map +1 -1
- package/dist/esm/components/loading/page.js.map +1 -1
- package/dist/esm/components/loading/puff.js.map +1 -1
- package/dist/esm/components/loading/rings.js.map +1 -1
- package/dist/esm/components/loading/screen.js.map +1 -1
- package/dist/esm/components/loading/suspense.js.map +1 -1
- package/dist/esm/components/menu/menu.js.map +1 -1
- package/dist/esm/components/menu/use-menu.js.map +1 -1
- package/dist/esm/components/modal/modal.js.map +1 -1
- package/dist/esm/components/native-accordion/native-accordion.js.map +1 -1
- package/dist/esm/components/native-popover/native-popover.js.map +1 -1
- package/dist/esm/components/native-select/native-select.js.map +1 -1
- package/dist/esm/components/native-select/use-native-select.js.map +1 -1
- package/dist/esm/components/native-table/native-table.js.map +1 -1
- package/dist/esm/components/notice/notice-provider.js.map +1 -1
- package/dist/esm/components/notice/notice.js.map +1 -1
- package/dist/esm/components/notice/use-notice.js.map +1 -1
- package/dist/esm/components/number-input/number-input.js.map +1 -1
- package/dist/esm/components/pagination/pagination.js.map +1 -1
- package/dist/esm/components/password-input/password-input.js.map +1 -1
- package/dist/esm/components/password-input/strength-meter.js.map +1 -1
- package/dist/esm/components/picture/picture.js.map +1 -1
- package/dist/esm/components/pin-input/pin-input.js.map +1 -1
- package/dist/esm/components/popover/popover.js.map +1 -1
- package/dist/esm/components/progress/progress.js.map +1 -1
- package/dist/esm/components/qr-code/qr-code.js.map +1 -1
- package/dist/esm/components/radio/radio-group.js.map +1 -1
- package/dist/esm/components/radio/radio.js.map +1 -1
- package/dist/esm/components/radio-card/radio-card-group.js.map +1 -1
- package/dist/esm/components/radio-card/radio-card.js.map +1 -1
- package/dist/esm/components/rating/rating.js.map +1 -1
- package/dist/esm/components/reorder/reorder.js.map +1 -1
- package/dist/esm/components/resizable/resizable.js.map +1 -1
- package/dist/esm/components/ripple/ripple.js.map +1 -1
- package/dist/esm/components/rotate/rotate.js.map +1 -1
- package/dist/esm/components/saturation-slider/saturation-slider.js.map +1 -1
- package/dist/esm/components/saturation-slider/use-saturation-slider.js.map +1 -1
- package/dist/esm/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/esm/components/select/select.js.map +1 -1
- package/dist/esm/components/select/use-select.js.map +1 -1
- package/dist/esm/components/sidebar/sidebar.js.map +1 -1
- package/dist/esm/components/skeleton/skeleton-text.js.map +1 -1
- package/dist/esm/components/slide/slide.js.map +1 -1
- package/dist/esm/components/slide-fade/slide-fade.js.map +1 -1
- package/dist/esm/components/slider/slider.js.map +1 -1
- package/dist/esm/components/slot/slot.js.map +1 -1
- package/dist/esm/components/snacks/snacks.js.map +1 -1
- package/dist/esm/components/stack/stack.js.map +1 -1
- package/dist/esm/components/stack/z-stack.js.map +1 -1
- package/dist/esm/components/stat/stat.js.map +1 -1
- package/dist/esm/components/status/status.js.map +1 -1
- package/dist/esm/components/steps/steps.js.map +1 -1
- package/dist/esm/components/switch/switch.js.map +1 -1
- package/dist/esm/components/table/table.js.map +1 -1
- package/dist/esm/components/tabs/tabs.js.map +1 -1
- package/dist/esm/components/tag/tag.js.map +1 -1
- package/dist/esm/components/timeline/timeline.js.map +1 -1
- package/dist/esm/components/tip/tip.js.map +1 -1
- package/dist/esm/components/toggle/toggle-group.js.map +1 -1
- package/dist/esm/components/tooltip/tooltip.js.map +1 -1
- package/dist/esm/components/tree/tree.js.map +1 -1
- package/dist/esm/components/tree/use-tree.js.map +1 -1
- package/dist/esm/core/components/create-component.js.map +1 -1
- package/dist/esm/core/system/breakpoint.js.map +1 -1
- package/dist/esm/core/system/environment-provider.js.map +1 -1
- package/dist/esm/core/system/styled.js.map +1 -1
- package/dist/esm/core/system/theme-provider.js.map +1 -1
- package/dist/esm/hooks/use-breakpoint/use-breakpoint.js.map +1 -1
- package/dist/esm/hooks/use-combobox/index.js.map +1 -1
- package/dist/esm/hooks/use-field-sizing/index.js.map +1 -1
- package/dist/esm/hooks/use-outside-click/index.js.map +1 -1
- package/dist/esm/index.js +7 -3
- package/dist/esm/providers/ui-provider/ui-provider.js.map +1 -1
- package/dist/esm/utils/store.js.map +1 -1
- package/dist/types/components/avatar/avatar.d.ts +3 -3
- package/dist/types/components/avatar/avatar.style.d.ts +1 -1
- package/dist/types/components/data-list/data-list.style.d.ts +1 -1
- package/dist/types/components/field/field.style.d.ts +2 -2
- package/dist/types/components/fieldset/fieldset.style.d.ts +1 -1
- package/dist/types/components/icon/icons/circle-euro-icon.d.ts +13 -0
- package/dist/types/components/icon/icons/index.d.ts +5 -3
- package/dist/types/components/icon/icons/index.types.d.ts +1 -1
- package/dist/types/components/icon/icons/scan-box-icon.d.ts +13 -0
- package/dist/types/components/icon/icons/server-plus-icon.d.ts +13 -0
- package/dist/types/components/icon/index.d.ts +4 -2
- package/dist/types/components/menu/use-menu.d.ts +1 -1
- package/dist/types/components/number-input/number-input.style.d.ts +1 -1
- package/dist/types/components/steps/steps.style.d.ts +1 -1
- package/dist/types/components/timeline/timeline.d.ts +1 -1
- package/dist/types/components/timeline/timeline.style.d.ts +1 -1
- package/dist/types/index.d.ts +5 -3
- package/package.json +5 -5
- package/dist/cjs/components/icon/icons/circle-euro-sign-icon.cjs +0 -14
- package/dist/cjs/components/icon/icons/circle-euro-sign-icon.cjs.map +0 -1
- package/dist/esm/components/icon/icons/circle-euro-sign-icon.js +0 -14
- package/dist/esm/components/icon/icons/circle-euro-sign-icon.js.map +0 -1
- package/dist/types/components/icon/icons/circle-euro-sign-icon.d.ts +0 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.js","names":["createContext"],"sources":["../../../../src/components/chart/chart.tsx"],"sourcesContent":["\"use client\"\n\nimport type {\n JSXElementConstructor,\n PropsWithChildren,\n ReactElement,\n ReactNode,\n RefObject,\n} from \"react\"\nimport type {\n ActiveDotProps,\n DataKey,\n DefaultLegendContentProps,\n DotItemDotProps,\n DotProps,\n LabelProps,\n RenderableText,\n ResponsiveContainerProps,\n TooltipContentProps,\n TooltipProps,\n} from \"recharts\"\nimport type {\n CSSProps,\n ExtractStyleValueWithCondition,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Dict, Merge } from \"../../utils\"\nimport type { ChartStyle } from \"./chart.style\"\nimport type {\n UseChartLabelListProps,\n UseChartLabelProps,\n UseChartLegendProps,\n UseChartLegendReturn,\n UseChartTooltipProps,\n} from \"./use-chart\"\nimport { Fragment, isValidElement, useMemo, useRef } from \"react\"\nimport {\n Label,\n LabelList,\n Legend,\n ResponsiveContainer,\n Tooltip,\n} from \"recharts\"\nimport { createSlotComponent, mergeProps, styled, varAttr } from \"../../core\"\nimport {\n cast,\n createContext,\n isArray,\n isNull,\n isNumber,\n isObject,\n isString,\n isUndefined,\n useSplitChildren,\n} from \"../../utils\"\nimport { chartStyle } from \"./chart.style\"\nimport {\n ChartContext,\n useChart,\n useChartLabel,\n useChartLabelList,\n useChartLegend,\n useChartTooltip,\n} from \"./use-chart\"\n\nexport type ChartDot =\n | ((props: DotItemDotProps) => ReactNode)\n | boolean\n | Merge<Partial<DotProps>, HTMLStyledProps<\"circle\">>\n | ReactElement\n\nexport type ChartActiveDot =\n | ((props: ActiveDotProps) => ReactNode)\n | boolean\n | Merge<Partial<ActiveDotProps>, HTMLStyledProps<\"circle\">>\n | ReactElement\n\nexport type ChartLabel =\n | ((props: any) => ReactElement | RenderableText)\n | boolean\n | (Merge<\n HTMLStyledProps<\"text\">,\n Pick<\n LabelProps,\n | \"angle\"\n | \"content\"\n | \"formatter\"\n | \"index\"\n | \"labelRef\"\n | \"offset\"\n | \"parentViewBox\"\n | \"position\"\n | \"textBreakAll\"\n | \"value\"\n | \"viewBox\"\n | \"zIndex\"\n >\n > & { dataKey?: DataKey<any> })\n | number\n | ReactElement\n | string\n\nexport type ChartLabelList =\n | ((props: LabelProps) => ReactElement | RenderableText)\n | boolean\n | ChartLabelListProps\n | ReactElement\n\nexport type ChartTickLine = boolean | HTMLStyledProps<\"line\">\n\nexport type GradientStrategy = \"invert\" | \"shade\" | \"tint\"\n\nexport function mergeSeries<Y>(\n series: Y[],\n color: CSSProps[\"color\"] = \"mono\",\n strategy: GradientStrategy = \"invert\",\n): (Y & { color: CSSProps[\"color\"] })[] {\n const colors = gradients(series.length, color, strategy)\n\n return series.map((item, index) => ({ ...item, color: colors[index] }))\n}\n\nexport function mergeData<Y>(\n data: Y[],\n color: ExtractStyleValueWithCondition<CSSProps[\"fill\"]> = \"mono\",\n strategy: GradientStrategy = \"invert\",\n): (Y & { fill: CSSProps[\"fill\"] })[] {\n const colors = gradients(data.length, color, strategy)\n\n return data.map((item, index) => ({ ...item, fill: colors[index] }))\n}\n\nexport function gradients(\n length: number,\n color: ExtractStyleValueWithCondition<CSSProps[\"color\"]> = \"mono\",\n strategy: GradientStrategy = \"invert\",\n): CSSProps[\"color\"][] {\n return Array.from({ length }, (_, index) => {\n const value = Math.floor(100 - (100 / length) * index)\n const percent = `${value}%`\n\n if (strategy === \"invert\")\n return [\n `tint(colors.${color as string}, ${percent})`,\n `shade(colors.${color as string}, ${percent})`,\n ]\n else return `${strategy}(colors.${color as string}, ${percent})`\n })\n}\n\nfunction parseJSON(value: any) {\n try {\n return JSON.parse(value)\n } catch {\n return value\n }\n}\n\ninterface ComponentContext extends Pick<\n ChartProps,\n \"legendProps\" | \"tooltipProps\"\n> {\n nameKeyRef: RefObject<string | undefined>\n}\n\nexport interface ChartProps extends HTMLStyledProps, ThemeProps<ChartStyle> {\n /**\n * The components to render the chart components.\n */\n components: {\n component: JSXElementConstructor<any>\n fallback: ReactNode\n }[]\n /**\n * The function to render the chart.\n */\n render: (props: PropsWithChildren) => ReactNode\n /**\n * The color of the label list.\n */\n labelListColor?: CSSProps[\"color\"]\n /**\n * The fill of the label list.\n */\n labelListFill?: CSSProps[\"fill\"]\n /**\n * The fill of the tooltip cursor.\n */\n tooltipCursorFill?: CSSProps[\"fill\"]\n /**\n * The fill opacity of the tooltip cursor.\n */\n tooltipCursorFillOpacity?: CSSProps[\"fillOpacity\"]\n /**\n * The stroke of the tooltip cursor.\n */\n tooltipCursorStroke?: CSSProps[\"stroke\"]\n /**\n * If `true`, legend is visible.\n *\n * @default false\n */\n withLegend?: boolean\n /**\n * If `true`, tooltip is visible.\n *\n * @default true\n */\n withTooltip?: boolean\n /**\n * Props for the legend component.\n */\n legendProps?: ChartLegendProps\n /**\n * Props for the responsive container component.\n */\n responsiveContainerProps?: ResponsiveContainerProps\n /**\n * Props for the tooltip component.\n */\n tooltipProps?: ChartTooltipProps\n}\n\nconst {\n ComponentContext,\n PropsContext: ChartPropsContext,\n useComponentContext: useChartComponentContext,\n usePropsContext: useChartPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<ChartProps, ChartStyle, ComponentContext>(\n \"chart\",\n chartStyle,\n)\n\nexport { ChartPropsContext, useChartComponentContext, useChartPropsContext }\n\nexport const Chart = withProvider(\n ({\n children,\n components: componentsProp,\n render,\n withLegend = false,\n withTooltip = true,\n legendProps,\n responsiveContainerProps,\n tooltipProps,\n ...rest\n }: ChartProps) => {\n const { highlightedDataKey, onHighlight } = useChart()\n const nameKeyRef = useRef<string | undefined>(undefined)\n const components = useMemo(\n () => [\n ...componentsProp,\n {\n component: ChartLegend,\n fallback: withLegend ? <ChartLegend /> : null,\n },\n {\n component: ChartTooltip,\n fallback: withTooltip ? <ChartTooltip /> : null,\n },\n ],\n [componentsProp, withLegend, withTooltip],\n )\n const [omittedChildren, ...customComponents] = useSplitChildren(\n children,\n ...components.map(({ component }) => component),\n )\n const context = useMemo(\n () => ({\n highlightedDataKey,\n onHighlight,\n }),\n [highlightedDataKey, onHighlight],\n )\n const componentContext = useMemo(\n () => ({\n nameKeyRef,\n legendProps,\n tooltipProps,\n }),\n [legendProps, tooltipProps],\n )\n\n return (\n <ChartContext value={context}>\n <ComponentContext value={componentContext}>\n <styled.div {...rest}>\n <ResponsiveContainer {...responsiveContainerProps}>\n {render({\n children: (\n <>\n {components.map(({ fallback }, index) => (\n <Fragment key={index}>\n {customComponents[index] ?? fallback}\n </Fragment>\n ))}\n\n {omittedChildren}\n </>\n ),\n })}\n </ResponsiveContainer>\n </styled.div>\n </ComponentContext>\n </ChartContext>\n )\n },\n \"root\",\n)(\n undefined,\n ({\n labelListColor,\n labelListFill,\n tooltipCursorFill,\n tooltipCursorFillOpacity,\n tooltipCursorStroke,\n ...rest\n }) => ({\n \"--label-list-color\": varAttr(labelListColor, \"colors\"),\n \"--label-list-fill\": varAttr(labelListFill, \"colors\"),\n \"--tooltip-cursor-fill\": varAttr(tooltipCursorFill, \"colors\"),\n \"--tooltip-cursor-fill-opacity\": tooltipCursorFillOpacity,\n \"--tooltip-cursor-stroke\": varAttr(tooltipCursorStroke, \"colors\"),\n ...rest,\n }),\n)\n\ninterface ChartLegendContext extends Pick<\n UseChartLegendReturn,\n \"getLegendItemProps\"\n> {}\n\nconst [ChartLegendContext, useChartLegendContext] =\n createContext<ChartLegendContext>({\n name: \"ChartLegendContext\",\n })\n\nexport interface ChartLegendProps extends Merge<\n HTMLStyledProps,\n UseChartLegendProps\n> {\n /**\n * Props for the content component.\n */\n contentProps?: Omit<ChartLegendContentProps, \"formatter\" | \"payload\">\n}\n\nexport const ChartLegend = withContext<\"div\", ChartLegendProps>((props) => {\n const { legendProps } = useChartComponentContext()\n const { contentProps, ...rest } = mergeProps(legendProps, props)()\n const {\n getLegendContentProps,\n getLegendItemProps,\n getLegendProps,\n getRootProps,\n } = useChartLegend({\n content: ({ formatter, payload }) => (\n <ChartLegendContent\n formatter={formatter}\n payload={payload}\n {...getLegendContentProps(contentProps)}\n />\n ),\n ...rest,\n })\n const context = useMemo(() => ({ getLegendItemProps }), [getLegendItemProps])\n\n return (\n <ChartLegendContext value={context}>\n <styled.div asChild {...getRootProps()}>\n <Legend {...getLegendProps()} />\n </styled.div>\n </ChartLegendContext>\n )\n}, \"legend\")()\n\ninterface ChartLegendContentProps\n extends\n HTMLStyledProps,\n Pick<DefaultLegendContentProps, \"formatter\" | \"payload\"> {\n /**\n * If `true`, swatch is visible.\n */\n withSwatch?: boolean\n}\n\nconst ChartLegendContent = withContext<\"div\", ChartLegendContentProps>(\n ({ formatter, payload, withSwatch = true, ...rest }) => {\n const { nameKeyRef } = useChartComponentContext()\n const { getLegendItemProps } = useChartLegendContext()\n\n return (\n <styled.div {...rest}>\n {payload?.map((data, index) => {\n let value = data.value\n\n if (nameKeyRef.current)\n value = (data.payload as any)?.[nameKeyRef.current]\n\n const dataKey =\n isString(data.dataKey) || isNumber(data.dataKey)\n ? data.dataKey\n : value\n const color = parseJSON(data.color)\n const formattedValue = formatter?.(value, data, index) ?? value\n\n return (\n <ChartLegendItem key={index} {...getLegendItemProps({ dataKey })}>\n {withSwatch ? <ChartLegendSwatch bg={color} /> : null}\n <ChartLegendValue>{formattedValue}</ChartLegendValue>\n </ChartLegendItem>\n )\n })}\n </styled.div>\n )\n },\n \"legendContent\",\n)()\n\ninterface ChartLegendItemProps extends HTMLStyledProps {}\n\nconst ChartLegendItem = withContext<\"div\", ChartLegendItemProps>(\n \"div\",\n \"legendItem\",\n)()\n\ninterface ChartLegendSwatchProps extends HTMLStyledProps {}\n\nconst ChartLegendSwatch = withContext<\"div\", ChartLegendSwatchProps>(\n \"div\",\n \"legendSwatch\",\n)()\n\ninterface ChartLegendValueProps extends HTMLStyledProps<\"span\"> {}\n\nconst ChartLegendValue = withContext<\"span\", ChartLegendValueProps>(\n \"span\",\n \"legendValue\",\n)()\n\nexport interface ChartTooltipProps<\n Y extends (number | string)[] | number | string = number,\n M extends number | string = string,\n> extends Omit<Merge<HTMLStyledProps, UseChartTooltipProps<Y, M>>, \"cursor\"> {\n /**\n * Props for the cursor component.\n */\n cursor?: boolean | ChartTooltipCursorProps | ReactElement\n /**\n * Props for the content component.\n */\n contentProps?: Omit<\n ChartTooltipContentProps,\n \"formatter\" | \"label\" | \"labelFormatter\" | \"payload\"\n >\n}\n\nexport const ChartTooltip = <\n Y extends (number | string)[] | number | string,\n M extends number | string,\n>(\n props: ChartTooltipProps<Y, M>,\n) => {\n const { tooltipProps } = useChartComponentContext()\n const {\n cursor = false,\n contentProps,\n ...rest\n } = {\n ...tooltipProps,\n ...props,\n } as ChartTooltipProps<Y, M>\n const { getContentProps, getRootProps } = useChartTooltip<Y, M>({\n content: ({ formatter, label, labelFormatter, payload }) => (\n <ChartTooltipContent\n formatter={formatter}\n label={label}\n labelFormatter={labelFormatter}\n payload={payload}\n {...getContentProps(contentProps)}\n />\n ),\n cursor:\n isValidElement(cursor) || !cursor ? (\n cursor\n ) : (\n <ChartTooltipCursor {...(isObject(cursor) ? cursor : {})} />\n ),\n ...rest,\n })\n\n return <Tooltip {...cast<TooltipProps>(getRootProps())} />\n}\n\ninterface ChartTooltipCursorProps extends Omit<\n HTMLStyledProps<\"path\">,\n \"height\" | \"points\" | \"width\" | \"x\" | \"y\"\n> {\n brushBottom?: number\n height?: number\n payload?: Dict[]\n payloadIndex?: number\n points?: { x: number; y: number }[]\n width?: number\n x?: number\n y?: number\n}\n\nconst ChartTooltipCursor = withContext<\"path\", ChartTooltipCursorProps>(\n \"path\",\n \"tooltipCursor\",\n)(\n undefined,\n ({\n bottom: _bottom,\n brushBottom: _brushBottom,\n fill,\n height,\n left: _left,\n payload: _payload,\n payloadIndex: _payloadIndex,\n points,\n right: _right,\n stroke,\n top: _top,\n width,\n x,\n y,\n ...rest\n }) => {\n const d = points\n ? `M${points[0]?.x},${points[0]?.y}L${points[1]?.x},${points[1]?.y}`\n : `M ${x},${y} h ${width} v ${height} h -${width} Z`\n return {\n asChild: true,\n children: <path d={d} height={height} width={width} />,\n fill: fill === \"#ccc\" ? undefined : fill,\n stroke: stroke === \"#ccc\" ? undefined : stroke,\n ...rest,\n }\n },\n)\n\ninterface ChartTooltipContentProps\n extends\n HTMLStyledProps,\n Pick<\n TooltipContentProps<any, any>,\n \"formatter\" | \"label\" | \"labelFormatter\" | \"payload\"\n > {\n /**\n * If `true`, swatch is visible.\n */\n withSwatch?: boolean\n}\n\nconst ChartTooltipContent = withContext<\"div\", ChartTooltipContentProps>(\n ({\n formatter,\n label: labelProp,\n labelFormatter,\n payload,\n withSwatch = true,\n ...rest\n }) => {\n const { nameKeyRef } = useChartComponentContext()\n const label = labelFormatter\n ? labelFormatter(labelProp, payload)\n : labelProp\n\n return (\n <styled.div {...rest}>\n {!isUndefined(label) && !isNull(label) ? (\n <ChartTooltipLabel>{label}</ChartTooltipLabel>\n ) : null}\n\n <ChartTooltipList>\n {payload.map((data, index) => {\n if (nameKeyRef.current) data.name = data.payload[nameKeyRef.current]\n\n const color = parseJSON(data.color) || data.payload.fill\n const result =\n formatter?.(data.value, data.name, data, index, payload) ??\n (isArray(data.value) ? data.value.join(\", \") : data.value)\n const [value, name] = isArray(result) ? result : [result, data.name]\n\n return (\n <ChartTooltipItem key={index}>\n {withSwatch ? <ChartTooltipSwatch bg={color} /> : null}\n <ChartTooltipName>{name}</ChartTooltipName>\n <ChartTooltipValue>{value}</ChartTooltipValue>\n </ChartTooltipItem>\n )\n })}\n </ChartTooltipList>\n </styled.div>\n )\n },\n \"tooltipContent\",\n)()\n\ninterface ChartTooltipLabel extends HTMLStyledProps<\"p\"> {}\n\nconst ChartTooltipLabel = withContext<\"p\", ChartTooltipLabel>(\n \"p\",\n \"tooltipLabel\",\n)()\n\ninterface ChartTooltipList extends HTMLStyledProps {}\n\nconst ChartTooltipList = withContext<\"div\", ChartTooltipList>(\n \"div\",\n \"tooltipList\",\n)()\n\ninterface ChartTooltipItem extends HTMLStyledProps {}\n\nconst ChartTooltipItem = withContext<\"div\", ChartTooltipItem>(\n \"div\",\n \"tooltipItem\",\n)()\n\ninterface ChartTooltipSwatch extends HTMLStyledProps {}\n\nconst ChartTooltipSwatch = withContext<\"div\", ChartTooltipSwatch>(\n \"div\",\n \"tooltipSwatch\",\n)()\n\ninterface ChartTooltipName extends HTMLStyledProps<\"span\"> {}\n\nconst ChartTooltipName = withContext<\"span\", ChartTooltipName>(\n \"span\",\n \"tooltipName\",\n)()\n\ninterface ChartTooltipValue extends HTMLStyledProps<\"span\"> {}\n\nconst ChartTooltipValue = withContext<\"span\", ChartTooltipValue>(\n \"span\",\n \"tooltipValue\",\n)()\n\nexport interface ChartLabelListProps extends Merge<\n HTMLStyledProps<\"text\">,\n UseChartLabelListProps\n> {}\n\nexport const ChartLabelList = withContext<\"text\", ChartLabelListProps>(\n (props) => {\n const { getLabelListProps, getRootProps } = useChartLabelList(props)\n\n return (\n <styled.text asChild {...getRootProps()}>\n <LabelList {...getLabelListProps()} />\n </styled.text>\n )\n },\n \"labelList\",\n)()\n\nexport interface ChartLabelProps extends Merge<\n HTMLStyledProps<\"text\">,\n UseChartLabelProps\n> {}\n\nexport const ChartLabel = withContext<\"text\", ChartLabelProps>((props) => {\n const { getLabelProps, getRootProps } = useChartLabel(props)\n\n return (\n <styled.text asChild {...getRootProps()}>\n <Label {...getLabelProps()} />\n </styled.text>\n )\n}, \"label\")()\n"],"mappings":";;;;;;;;;;;;;;AAiHA,SAAgB,YACd,QACA,QAA2B,QAC3B,WAA6B,UACS;CACtC,MAAM,SAAS,UAA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SAAA;EAAQ,GAAI,aAAa;YACpC,oBAAC,WAAD,EAAW,GAAI,kBAAkB,EAAI,CAAA;CAC1B,CAAA;AAEjB,GACA,WACF,CAAC,CAAC;AAOF,MAAa,aAAa,aAAsC,UAAU;CACxE,MAAM,EAAE,eAAe,iBAAiB,cAAc,KAAK;CAE3D,OACE,oBAAC,OAAO,MAAR;EAAa,SAAA;EAAQ,GAAI,aAAa;YACpC,oBAAC,OAAD,EAAO,GAAI,cAAc,EAAI,CAAA;CAClB,CAAA;AAEjB,GAAG,OAAO,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"chart.js","names":["createContext"],"sources":["../../../../src/components/chart/chart.tsx"],"sourcesContent":["\"use client\"\n\nimport type {\n JSXElementConstructor,\n PropsWithChildren,\n ReactElement,\n ReactNode,\n RefObject,\n} from \"react\"\nimport type {\n ActiveDotProps,\n DataKey,\n DefaultLegendContentProps,\n DotItemDotProps,\n DotProps,\n LabelProps,\n RenderableText,\n ResponsiveContainerProps,\n TooltipContentProps,\n TooltipProps,\n} from \"recharts\"\nimport type {\n CSSProps,\n ExtractStyleValueWithCondition,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Dict, Merge } from \"../../utils\"\nimport type { ChartStyle } from \"./chart.style\"\nimport type {\n UseChartLabelListProps,\n UseChartLabelProps,\n UseChartLegendProps,\n UseChartLegendReturn,\n UseChartTooltipProps,\n} from \"./use-chart\"\nimport { Fragment, isValidElement, useMemo, useRef } from \"react\"\nimport {\n Label,\n LabelList,\n Legend,\n ResponsiveContainer,\n Tooltip,\n} from \"recharts\"\nimport { createSlotComponent, mergeProps, styled, varAttr } from \"../../core\"\nimport {\n cast,\n createContext,\n isArray,\n isNull,\n isNumber,\n isObject,\n isString,\n isUndefined,\n useSplitChildren,\n} from \"../../utils\"\nimport { chartStyle } from \"./chart.style\"\nimport {\n ChartContext,\n useChart,\n useChartLabel,\n useChartLabelList,\n useChartLegend,\n useChartTooltip,\n} from \"./use-chart\"\n\nexport type ChartDot =\n | ((props: DotItemDotProps) => ReactNode)\n | boolean\n | Merge<Partial<DotProps>, HTMLStyledProps<\"circle\">>\n | ReactElement\n\nexport type ChartActiveDot =\n | ((props: ActiveDotProps) => ReactNode)\n | boolean\n | Merge<Partial<ActiveDotProps>, HTMLStyledProps<\"circle\">>\n | ReactElement\n\nexport type ChartLabel =\n | ((props: any) => ReactElement | RenderableText)\n | boolean\n | (Merge<\n HTMLStyledProps<\"text\">,\n Pick<\n LabelProps,\n | \"angle\"\n | \"content\"\n | \"formatter\"\n | \"index\"\n | \"labelRef\"\n | \"offset\"\n | \"parentViewBox\"\n | \"position\"\n | \"textBreakAll\"\n | \"value\"\n | \"viewBox\"\n | \"zIndex\"\n >\n > & { dataKey?: DataKey<any> })\n | number\n | ReactElement\n | string\n\nexport type ChartLabelList =\n | ((props: LabelProps) => ReactElement | RenderableText)\n | boolean\n | ChartLabelListProps\n | ReactElement\n\nexport type ChartTickLine = boolean | HTMLStyledProps<\"line\">\n\nexport type GradientStrategy = \"invert\" | \"shade\" | \"tint\"\n\nexport function mergeSeries<Y>(\n series: Y[],\n color: CSSProps[\"color\"] = \"mono\",\n strategy: GradientStrategy = \"invert\",\n): (Y & { color: CSSProps[\"color\"] })[] {\n const colors = gradients(series.length, color, strategy)\n\n return series.map((item, index) => ({ ...item, color: colors[index] }))\n}\n\nexport function mergeData<Y>(\n data: Y[],\n color: ExtractStyleValueWithCondition<CSSProps[\"fill\"]> = \"mono\",\n strategy: GradientStrategy = \"invert\",\n): (Y & { fill: CSSProps[\"fill\"] })[] {\n const colors = gradients(data.length, color, strategy)\n\n return data.map((item, index) => ({ ...item, fill: colors[index] }))\n}\n\nexport function gradients(\n length: number,\n color: ExtractStyleValueWithCondition<CSSProps[\"color\"]> = \"mono\",\n strategy: GradientStrategy = \"invert\",\n): CSSProps[\"color\"][] {\n return Array.from({ length }, (_, index) => {\n const value = Math.floor(100 - (100 / length) * index)\n const percent = `${value}%`\n\n if (strategy === \"invert\")\n return [\n `tint(colors.${color as string}, ${percent})`,\n `shade(colors.${color as string}, ${percent})`,\n ]\n else return `${strategy}(colors.${color as string}, ${percent})`\n })\n}\n\nfunction parseJSON(value: any) {\n try {\n return JSON.parse(value)\n } catch {\n return value\n }\n}\n\ninterface ComponentContext extends Pick<\n ChartProps,\n \"legendProps\" | \"tooltipProps\"\n> {\n nameKeyRef: RefObject<string | undefined>\n}\n\nexport interface ChartProps extends HTMLStyledProps, ThemeProps<ChartStyle> {\n /**\n * The components to render the chart components.\n */\n components: {\n component: JSXElementConstructor<any>\n fallback: ReactNode\n }[]\n /**\n * The function to render the chart.\n */\n render: (props: PropsWithChildren) => ReactNode\n /**\n * The color of the label list.\n */\n labelListColor?: CSSProps[\"color\"]\n /**\n * The fill of the label list.\n */\n labelListFill?: CSSProps[\"fill\"]\n /**\n * The fill of the tooltip cursor.\n */\n tooltipCursorFill?: CSSProps[\"fill\"]\n /**\n * The fill opacity of the tooltip cursor.\n */\n tooltipCursorFillOpacity?: CSSProps[\"fillOpacity\"]\n /**\n * The stroke of the tooltip cursor.\n */\n tooltipCursorStroke?: CSSProps[\"stroke\"]\n /**\n * If `true`, legend is visible.\n *\n * @default false\n */\n withLegend?: boolean\n /**\n * If `true`, tooltip is visible.\n *\n * @default true\n */\n withTooltip?: boolean\n /**\n * Props for the legend component.\n */\n legendProps?: ChartLegendProps\n /**\n * Props for the responsive container component.\n */\n responsiveContainerProps?: ResponsiveContainerProps\n /**\n * Props for the tooltip component.\n */\n tooltipProps?: ChartTooltipProps\n}\n\nconst {\n ComponentContext,\n PropsContext: ChartPropsContext,\n useComponentContext: useChartComponentContext,\n usePropsContext: useChartPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<ChartProps, ChartStyle, ComponentContext>(\n \"chart\",\n chartStyle,\n)\n\nexport { ChartPropsContext, useChartComponentContext, useChartPropsContext }\n\nexport const Chart = withProvider(\n ({\n children,\n components: componentsProp,\n render,\n withLegend = false,\n withTooltip = true,\n legendProps,\n responsiveContainerProps,\n tooltipProps,\n ...rest\n }: ChartProps) => {\n const { highlightedDataKey, onHighlight } = useChart()\n const nameKeyRef = useRef<string | undefined>(undefined)\n const components = useMemo(\n () => [\n ...componentsProp,\n {\n component: ChartLegend,\n fallback: withLegend ? <ChartLegend /> : null,\n },\n {\n component: ChartTooltip,\n fallback: withTooltip ? <ChartTooltip /> : null,\n },\n ],\n [componentsProp, withLegend, withTooltip],\n )\n const [omittedChildren, ...customComponents] = useSplitChildren(\n children,\n ...components.map(({ component }) => component),\n )\n const context = useMemo(\n () => ({\n highlightedDataKey,\n onHighlight,\n }),\n [highlightedDataKey, onHighlight],\n )\n const componentContext = useMemo(\n () => ({\n nameKeyRef,\n legendProps,\n tooltipProps,\n }),\n [legendProps, tooltipProps],\n )\n\n return (\n <ChartContext value={context}>\n <ComponentContext value={componentContext}>\n <styled.div {...rest}>\n <ResponsiveContainer {...responsiveContainerProps}>\n {render({\n children: (\n <>\n {components.map(({ fallback }, index) => (\n <Fragment key={index}>\n {customComponents[index] ?? fallback}\n </Fragment>\n ))}\n\n {omittedChildren}\n </>\n ),\n })}\n </ResponsiveContainer>\n </styled.div>\n </ComponentContext>\n </ChartContext>\n )\n },\n \"root\",\n)(\n undefined,\n ({\n labelListColor,\n labelListFill,\n tooltipCursorFill,\n tooltipCursorFillOpacity,\n tooltipCursorStroke,\n ...rest\n }) => ({\n \"--label-list-color\": varAttr(labelListColor, \"colors\"),\n \"--label-list-fill\": varAttr(labelListFill, \"colors\"),\n \"--tooltip-cursor-fill\": varAttr(tooltipCursorFill, \"colors\"),\n \"--tooltip-cursor-fill-opacity\": tooltipCursorFillOpacity,\n \"--tooltip-cursor-stroke\": varAttr(tooltipCursorStroke, \"colors\"),\n ...rest,\n }),\n)\n\ninterface ChartLegendContext extends Pick<\n UseChartLegendReturn,\n \"getLegendItemProps\"\n> {}\n\nconst [ChartLegendContext, useChartLegendContext] =\n createContext<ChartLegendContext>({\n name: \"ChartLegendContext\",\n })\n\nexport interface ChartLegendProps extends Merge<\n HTMLStyledProps,\n UseChartLegendProps\n> {\n /**\n * Props for the content component.\n */\n contentProps?: Omit<ChartLegendContentProps, \"formatter\" | \"payload\">\n}\n\nexport const ChartLegend = withContext<\"div\", ChartLegendProps>((props) => {\n const { legendProps } = useChartComponentContext()\n const { contentProps, ...rest } = mergeProps(legendProps, props)()\n const {\n getLegendContentProps,\n getLegendItemProps,\n getLegendProps,\n getRootProps,\n } = useChartLegend({\n content: ({ formatter, payload }) => (\n <ChartLegendContent\n formatter={formatter}\n payload={payload}\n {...getLegendContentProps(contentProps)}\n />\n ),\n ...rest,\n })\n const context = useMemo(() => ({ getLegendItemProps }), [getLegendItemProps])\n\n return (\n <ChartLegendContext value={context}>\n <styled.div asChild {...getRootProps()}>\n <Legend {...getLegendProps()} />\n </styled.div>\n </ChartLegendContext>\n )\n}, \"legend\")()\n\ninterface ChartLegendContentProps\n extends\n HTMLStyledProps,\n Pick<DefaultLegendContentProps, \"formatter\" | \"payload\"> {\n /**\n * If `true`, swatch is visible.\n */\n withSwatch?: boolean\n}\n\nconst ChartLegendContent = withContext<\"div\", ChartLegendContentProps>(\n ({ formatter, payload, withSwatch = true, ...rest }) => {\n const { nameKeyRef } = useChartComponentContext()\n const { getLegendItemProps } = useChartLegendContext()\n\n return (\n <styled.div {...rest}>\n {payload?.map((data, index) => {\n let value = data.value\n\n if (nameKeyRef.current)\n value = (data.payload as any)?.[nameKeyRef.current]\n\n const dataKey =\n isString(data.dataKey) || isNumber(data.dataKey)\n ? data.dataKey\n : value\n const color = parseJSON(data.color)\n const formattedValue = formatter?.(value, data, index) ?? value\n\n return (\n <ChartLegendItem key={index} {...getLegendItemProps({ dataKey })}>\n {withSwatch ? <ChartLegendSwatch bg={color} /> : null}\n <ChartLegendValue>{formattedValue}</ChartLegendValue>\n </ChartLegendItem>\n )\n })}\n </styled.div>\n )\n },\n \"legendContent\",\n)()\n\ninterface ChartLegendItemProps extends HTMLStyledProps {}\n\nconst ChartLegendItem = withContext<\"div\", ChartLegendItemProps>(\n \"div\",\n \"legendItem\",\n)()\n\ninterface ChartLegendSwatchProps extends HTMLStyledProps {}\n\nconst ChartLegendSwatch = withContext<\"div\", ChartLegendSwatchProps>(\n \"div\",\n \"legendSwatch\",\n)()\n\ninterface ChartLegendValueProps extends HTMLStyledProps<\"span\"> {}\n\nconst ChartLegendValue = withContext<\"span\", ChartLegendValueProps>(\n \"span\",\n \"legendValue\",\n)()\n\nexport interface ChartTooltipProps<\n Y extends (number | string)[] | number | string = number,\n M extends number | string = string,\n> extends Omit<Merge<HTMLStyledProps, UseChartTooltipProps<Y, M>>, \"cursor\"> {\n /**\n * Props for the cursor component.\n */\n cursor?: boolean | ChartTooltipCursorProps | ReactElement\n /**\n * Props for the content component.\n */\n contentProps?: Omit<\n ChartTooltipContentProps,\n \"formatter\" | \"label\" | \"labelFormatter\" | \"payload\"\n >\n}\n\nexport const ChartTooltip = <\n Y extends (number | string)[] | number | string,\n M extends number | string,\n>(\n props: ChartTooltipProps<Y, M>,\n) => {\n const { tooltipProps } = useChartComponentContext()\n const {\n cursor = false,\n contentProps,\n ...rest\n } = {\n ...tooltipProps,\n ...props,\n } as ChartTooltipProps<Y, M>\n const { getContentProps, getRootProps } = useChartTooltip<Y, M>({\n content: ({ formatter, label, labelFormatter, payload }) => (\n <ChartTooltipContent\n formatter={formatter}\n label={label}\n labelFormatter={labelFormatter}\n payload={payload}\n {...getContentProps(contentProps)}\n />\n ),\n cursor:\n isValidElement(cursor) || !cursor ? (\n cursor\n ) : (\n <ChartTooltipCursor {...(isObject(cursor) ? cursor : {})} />\n ),\n ...rest,\n })\n\n return <Tooltip {...cast<TooltipProps>(getRootProps())} />\n}\n\ninterface ChartTooltipCursorProps extends Omit<\n HTMLStyledProps<\"path\">,\n \"height\" | \"points\" | \"width\" | \"x\" | \"y\"\n> {\n brushBottom?: number\n height?: number\n payload?: Dict[]\n payloadIndex?: number\n points?: { x: number; y: number }[]\n width?: number\n x?: number\n y?: number\n}\n\nconst ChartTooltipCursor = withContext<\"path\", ChartTooltipCursorProps>(\n \"path\",\n \"tooltipCursor\",\n)(\n undefined,\n ({\n bottom: _bottom,\n brushBottom: _brushBottom,\n fill,\n height,\n left: _left,\n payload: _payload,\n payloadIndex: _payloadIndex,\n points,\n right: _right,\n stroke,\n top: _top,\n width,\n x,\n y,\n ...rest\n }) => {\n const d = points\n ? `M${points[0]?.x},${points[0]?.y}L${points[1]?.x},${points[1]?.y}`\n : `M ${x},${y} h ${width} v ${height} h -${width} Z`\n return {\n asChild: true,\n children: <path d={d} height={height} width={width} />,\n fill: fill === \"#ccc\" ? undefined : fill,\n stroke: stroke === \"#ccc\" ? undefined : stroke,\n ...rest,\n }\n },\n)\n\ninterface ChartTooltipContentProps\n extends\n HTMLStyledProps,\n Pick<\n TooltipContentProps<any, any>,\n \"formatter\" | \"label\" | \"labelFormatter\" | \"payload\"\n > {\n /**\n * If `true`, swatch is visible.\n */\n withSwatch?: boolean\n}\n\nconst ChartTooltipContent = withContext<\"div\", ChartTooltipContentProps>(\n ({\n formatter,\n label: labelProp,\n labelFormatter,\n payload,\n withSwatch = true,\n ...rest\n }) => {\n const { nameKeyRef } = useChartComponentContext()\n const label = labelFormatter\n ? labelFormatter(labelProp, payload)\n : labelProp\n\n return (\n <styled.div {...rest}>\n {!isUndefined(label) && !isNull(label) ? (\n <ChartTooltipLabel>{label}</ChartTooltipLabel>\n ) : null}\n\n <ChartTooltipList>\n {payload.map((data, index) => {\n if (nameKeyRef.current) data.name = data.payload[nameKeyRef.current]\n\n const color = parseJSON(data.color) || data.payload.fill\n const result =\n formatter?.(data.value, data.name, data, index, payload) ??\n (isArray(data.value) ? data.value.join(\", \") : data.value)\n const [value, name] = isArray(result) ? result : [result, data.name]\n\n return (\n <ChartTooltipItem key={index}>\n {withSwatch ? <ChartTooltipSwatch bg={color} /> : null}\n <ChartTooltipName>{name}</ChartTooltipName>\n <ChartTooltipValue>{value}</ChartTooltipValue>\n </ChartTooltipItem>\n )\n })}\n </ChartTooltipList>\n </styled.div>\n )\n },\n \"tooltipContent\",\n)()\n\ninterface ChartTooltipLabel extends HTMLStyledProps<\"p\"> {}\n\nconst ChartTooltipLabel = withContext<\"p\", ChartTooltipLabel>(\n \"p\",\n \"tooltipLabel\",\n)()\n\ninterface ChartTooltipList extends HTMLStyledProps {}\n\nconst ChartTooltipList = withContext<\"div\", ChartTooltipList>(\n \"div\",\n \"tooltipList\",\n)()\n\ninterface ChartTooltipItem extends HTMLStyledProps {}\n\nconst ChartTooltipItem = withContext<\"div\", ChartTooltipItem>(\n \"div\",\n \"tooltipItem\",\n)()\n\ninterface ChartTooltipSwatch extends HTMLStyledProps {}\n\nconst ChartTooltipSwatch = withContext<\"div\", ChartTooltipSwatch>(\n \"div\",\n \"tooltipSwatch\",\n)()\n\ninterface ChartTooltipName extends HTMLStyledProps<\"span\"> {}\n\nconst ChartTooltipName = withContext<\"span\", ChartTooltipName>(\n \"span\",\n \"tooltipName\",\n)()\n\ninterface ChartTooltipValue extends HTMLStyledProps<\"span\"> {}\n\nconst ChartTooltipValue = withContext<\"span\", ChartTooltipValue>(\n \"span\",\n \"tooltipValue\",\n)()\n\nexport interface ChartLabelListProps extends Merge<\n HTMLStyledProps<\"text\">,\n UseChartLabelListProps\n> {}\n\nexport const ChartLabelList = withContext<\"text\", ChartLabelListProps>(\n (props) => {\n const { getLabelListProps, getRootProps } = useChartLabelList(props)\n\n return (\n <styled.text asChild {...getRootProps()}>\n <LabelList {...getLabelListProps()} />\n </styled.text>\n )\n },\n \"labelList\",\n)()\n\nexport interface ChartLabelProps extends Merge<\n HTMLStyledProps<\"text\">,\n UseChartLabelProps\n> {}\n\nexport const ChartLabel = withContext<\"text\", ChartLabelProps>((props) => {\n const { getLabelProps, getRootProps } = useChartLabel(props)\n\n return (\n <styled.text asChild {...getRootProps()}>\n <Label {...getLabelProps()} />\n </styled.text>\n )\n}, \"label\")()\n"],"mappings":";;;;;;;;;;;;;;AAiHA,SAAgB,YACd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,MAAa,iBAAiB,aAC3B,UAAU;CACT,MAAM,EAAE,mBAAmB,iBAAiB,kBAAkB,KAAK;CAEnE,OACE,oBAAC,OAAO,MAAR;EAAa,SAAA;EAAQ,GAAI,aAAa;EACpC,UAAA,oBAAC,WAAD,EAAW,GAAI,kBAAkB,EAAI,CAAA;CAC1B,CAAA;AAEjB,GACA,WACF,CAAC,CAAC;AAOF,MAAa,aAAa,aAAsC,UAAU;CACxE,MAAM,EAAE,eAAe,iBAAiB,cAAc,KAAK;CAE3D,OACE,oBAAC,OAAO,MAAR;EAAa,SAAA;EAAQ,GAAI,aAAa;EACpC,UAAA,oBAAC,OAAD,EAAO,GAAI,cAAc,EAAI,CAAA;CAClB,CAAA;AAEjB,GAAG,OAAO,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polar-chart.js","names":[],"sources":["../../../../src/components/chart/polar-chart.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\n\nimport type {\n ActiveDotProps,\n BaseTickContentProps,\n DataKey,\n DotProps,\n LabelListProps,\n LabelProps,\n PieLabelRenderProps,\n PieSectorShapeProps,\n RadialBarSectorProps,\n SectorProps,\n} from \"recharts\"\nimport type { PolarChartProps as OriginalPolarChartProps } from \"recharts/types/util/types\"\nimport type {\n CSSObject,\n CSSProps,\n GenericsComponent,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Dict, Merge } from \"../../utils\"\nimport type {\n ChartActiveDot,\n ChartDot,\n ChartLabel,\n ChartLabelListProps,\n ChartLabelList as ChartLabelListType,\n ChartProps,\n ChartTickLine,\n} from \"./chart\"\nimport type { PolarChartStyle } from \"./polar-chart.style\"\nimport type {\n UseAngleAxisProps,\n UseChartPieLabelLineProps,\n UseChartPieLabelProps,\n UseChartPieProps,\n UseChartRadarProps,\n UseChartRadialProps,\n UseChartSectorProps,\n UsePolarChartProps,\n UsePolarGridProps,\n UseRadiusAxisProps,\n} from \"./use-polar-chart\"\nimport {\n cloneElement,\n isValidElement,\n useCallback,\n useId,\n useMemo,\n} from \"react\"\nimport {\n Curve,\n Pie,\n PolarAngleAxis,\n PolarGrid,\n PolarRadiusAxis,\n Radar,\n RadialBar,\n Sector,\n Text,\n} from \"recharts\"\nimport {\n createShouldForwardProp,\n createSlotComponent,\n getCSS,\n mergeProps,\n styled,\n useSystem,\n useTheme,\n varAttr,\n} from \"../../core\"\nimport {\n assignRef,\n cx,\n isFunction,\n isNumber,\n isObject,\n runIfFn,\n splitObject,\n} from \"../../utils\"\nimport { Chart, ChartLabelList, useChartComponentContext } from \"./chart\"\nimport { polarChartStyle } from \"./polar-chart.style\"\nimport {\n useAngleAxis,\n useChartPie,\n useChartPieLabel,\n useChartPieLabelLine,\n useChartRadar,\n useChartRadial,\n useChartSector,\n usePolarChart,\n usePolarGrid,\n useRadiusAxis,\n} from \"./use-polar-chart\"\n\nconst shouldForwardProp = createShouldForwardProp()\n\ninterface ComponentContext extends Pick<\n PolarChartProps,\n | \"angleAxisProps\"\n | \"gridProps\"\n | \"nameKey\"\n | \"pieProps\"\n | \"radarProps\"\n | \"radialProps\"\n | \"radiusAxisProps\"\n | \"sectorProps\"\n> {}\n\nexport interface PolarChartProps<Y extends Dict = Dict>\n extends\n Omit<ChartProps, \"cx\" | \"cy\">,\n UsePolarChartProps<Y>,\n ThemeProps<PolarChartStyle> {\n /**\n * The fill of the active dot.\n */\n activeDotFill?: CSSProps[\"fill\"]\n /**\n * The radius of the active dot.\n */\n activeDotRadius?: CSSProps[\"r\"]\n /**\n * The stroke of the active dot.\n */\n activeDotStroke?: CSSProps[\"stroke\"]\n /**\n * The width of the active dot stroke.\n */\n activeDotStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The stroke of the angle axis line.\n */\n angleAxisLineStroke?: CSSProps[\"stroke\"]\n /**\n * The width of the angle axis line stroke.\n */\n angleAxisLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The color of the angle axis text.\n */\n angleAxisTextColor?: CSSProps[\"color\"]\n /**\n * The fill of the angle axis text.\n */\n angleAxisTextFill?: CSSProps[\"fill\"]\n /**\n * The fill of the dot.\n */\n dotFill?: CSSProps[\"fill\"]\n /**\n * The radius of the dot.\n */\n dotRadius?: CSSProps[\"r\"]\n /**\n * The stroke of the dot.\n */\n dotStroke?: CSSProps[\"stroke\"]\n /**\n * The width of the dot stroke.\n */\n dotStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The stroke of the grid.\n */\n gridStroke?: CSSProps[\"stroke\"]\n /**\n * The opacity of the inactive label line.\n */\n inactiveLabelLineOpacity?: CSSProps[\"opacity\"]\n /**\n * The opacity of the inactive label.\n */\n inactiveLabelOpacity?: CSSProps[\"opacity\"]\n /**\n * The opacity of the inactive radar.\n */\n inactiveRadarOpacity?: CSSProps[\"opacity\"]\n /**\n * The opacity of the inactive sector.\n */\n inactiveSectorOpacity?: CSSProps[\"opacity\"]\n /**\n * The color of the label.\n */\n labelColor?: CSSProps[\"color\"]\n /**\n * The fill of the label.\n */\n labelFill?: CSSProps[\"fill\"]\n /**\n * The stroke of the label line.\n */\n labelLineStroke?: CSSProps[\"stroke\"]\n /**\n * The width of the label line stroke.\n */\n labelLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The key to use for the angle axis.\n */\n nameKey?: keyof Y\n /**\n * The color of the radar.\n */\n radarColor?: CSSProps[\"color\"]\n /**\n * The fill opacity of the radar.\n */\n radarFillOpacity?: CSSProps[\"fillOpacity\"]\n /**\n * The stroke of the radar.\n */\n radarStroke?: CSSProps[\"stroke\"]\n /**\n * The width of the radar stroke.\n */\n radarStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The color of the radial background.\n */\n radialBackgroundColor?: CSSProps[\"color\"]\n /**\n * The fill of the radial background.\n */\n radialBackgroundFill?: CSSProps[\"fill\"]\n /**\n * The stroke of the radial background.\n */\n radialBackgroundStroke?: CSSProps[\"stroke\"]\n /**\n * The width of the radial background stroke.\n */\n radialBackgroundStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The stroke of the radius axis line.\n */\n radiusAxisLineStroke?: CSSProps[\"stroke\"]\n /**\n * The width of the radius axis line stroke.\n */\n radiusAxisLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The color of the radius axis text.\n */\n radiusAxisTextColor?: CSSProps[\"color\"]\n /**\n * The fill of the radius axis text.\n */\n radiusAxisTextFill?: CSSProps[\"fill\"]\n /**\n * The color of the sector.\n */\n sectorColor?: CSSProps[\"color\"]\n /**\n * The fill of the sector.\n */\n sectorFill?: CSSProps[\"fill\"]\n /**\n * The stroke of the sector.\n */\n sectorStroke?: CSSProps[\"stroke\"]\n /**\n * The width of the sector stroke.\n */\n sectorStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * If `true`, angle axis is visible.\n *\n * @default true\n */\n withAngleAxis?: boolean\n /**\n * If `true`, grid is visible.\n *\n * @default true\n */\n withGrid?: boolean\n /**\n * If `true`, radius axis is visible.\n *\n * @default false\n */\n withRadiusAxis?: boolean\n /**\n * Props for the angle axis component.\n */\n angleAxisProps?: UseAngleAxisProps\n /**\n * Props for the polar chart component.\n */\n chartProps?: Omit<OriginalPolarChartProps, \"data\">\n /**\n * Props for the donut component.\n */\n donutProps?: Omit<ChartPieProps, \"data\" | \"dataKey\" | \"nameKey\">\n /**\n * Props for the grid component.\n */\n gridProps?: ChartPolarGridProps\n /**\n * Props for the pie component.\n */\n pieProps?: Omit<ChartPieProps, \"data\" | \"dataKey\" | \"nameKey\">\n /**\n * Props for the radar component.\n */\n radarProps?: Omit<ChartRadarProps, \"data\" | \"dataKey\">\n /**\n * Props for the radial component.\n */\n radialProps?: Omit<ChartRadialProps, \"dataKey\" | \"nameKey\">\n /**\n * Props for the radius axis component.\n */\n radiusAxisProps?: UseRadiusAxisProps\n /**\n * Props for the sector component.\n */\n sectorProps?: ChartSectorProps\n}\n\nconst {\n component,\n ComponentContext,\n PropsContext: PolarChartPropsContext,\n useComponentContext,\n usePropsContext: usePolarChartPropsContext,\n withContext,\n withProvider,\n useSlotComponentProps,\n} = createSlotComponent<PolarChartProps, PolarChartStyle, ComponentContext>(\n \"polar-chart\",\n polarChartStyle,\n)\n\nexport { PolarChartPropsContext, usePolarChartPropsContext }\n\nexport const PolarChart = withProvider(\n <Y extends Dict>({\n components: componentsProp,\n nameKey,\n render,\n withAngleAxis = false,\n withGrid = false,\n withRadiusAxis = false,\n angleAxisProps,\n chartProps,\n donutProps,\n gridProps,\n pieProps = donutProps,\n radarProps,\n radialProps,\n radiusAxisProps,\n sectorProps,\n ...rest\n }: PolarChartProps<Y>) => {\n const { getChartProps, getRootProps } = usePolarChart(rest)\n const components = useMemo(\n () => [\n {\n component: ChartPolarGrid,\n fallback: withGrid ? <ChartPolarGrid /> : null,\n },\n {\n component: ChartAngleAxis,\n fallback: withAngleAxis ? <ChartAngleAxis /> : null,\n },\n {\n component: ChartRadiusAxis,\n fallback: withRadiusAxis ? <ChartRadiusAxis /> : null,\n },\n ...componentsProp,\n ],\n [componentsProp, withGrid, withAngleAxis, withRadiusAxis],\n )\n const componentContext = useMemo(\n () => ({\n nameKey: nameKey as string | undefined,\n angleAxisProps,\n gridProps,\n pieProps,\n radarProps,\n radialProps,\n radiusAxisProps,\n sectorProps,\n }),\n [\n pieProps,\n radarProps,\n sectorProps,\n angleAxisProps,\n radiusAxisProps,\n gridProps,\n nameKey,\n radialProps,\n ],\n )\n\n return (\n <ComponentContext value={componentContext}>\n <Chart\n components={components}\n render={(props) => render(getChartProps({ ...props, ...chartProps }))}\n {...getRootProps()}\n />\n </ComponentContext>\n )\n },\n \"root\",\n)(\n undefined,\n ({\n activeDotFill,\n activeDotRadius,\n activeDotStroke,\n activeDotStrokeWidth,\n angleAxisLineStroke,\n angleAxisLineStrokeWidth,\n angleAxisTextColor,\n angleAxisTextFill,\n dotFill,\n dotRadius,\n dotStroke,\n dotStrokeWidth,\n gridStroke,\n inactiveLabelLineOpacity,\n inactiveLabelOpacity,\n inactiveRadarOpacity,\n inactiveSectorOpacity,\n labelColor,\n labelFill,\n labelLineStroke,\n labelLineStrokeWidth,\n radarColor,\n radarFillOpacity,\n radarStroke,\n radarStrokeWidth,\n radialBackgroundColor,\n radialBackgroundFill,\n radialBackgroundStroke,\n radialBackgroundStrokeWidth,\n radiusAxisLineStroke,\n radiusAxisLineStrokeWidth,\n radiusAxisTextColor,\n radiusAxisTextFill,\n sectorColor,\n sectorFill,\n sectorStroke,\n sectorStrokeWidth,\n ...rest\n }) => ({\n \"--active-dot-fill\": varAttr(activeDotFill, \"colors\"),\n \"--active-dot-r\": activeDotRadius,\n \"--active-dot-stroke\": varAttr(activeDotStroke, \"colors\"),\n \"--active-dot-stroke-width\": activeDotStrokeWidth,\n \"--angle-axis-line-stroke\": varAttr(angleAxisLineStroke, \"colors\"),\n \"--angle-axis-line-stroke-width\": angleAxisLineStrokeWidth,\n \"--angle-axis-text-color\": varAttr(angleAxisTextColor, \"colors\"),\n \"--angle-axis-text-fill\": varAttr(angleAxisTextFill, \"colors\"),\n \"--dot-fill\": varAttr(dotFill, \"colors\"),\n \"--dot-r\": dotRadius,\n \"--dot-stroke\": varAttr(dotStroke, \"colors\"),\n \"--dot-stroke-width\": dotStrokeWidth,\n \"--grid-stroke\": varAttr(gridStroke, \"colors\"),\n \"--inactive-label-line-opacity\": inactiveLabelLineOpacity,\n \"--inactive-label-opacity\": inactiveLabelOpacity,\n \"--inactive-radar-opacity\": inactiveRadarOpacity,\n \"--inactive-sector-opacity\": inactiveSectorOpacity,\n \"--label-color\": varAttr(labelColor, \"colors\"),\n \"--label-fill\": varAttr(labelFill, \"colors\"),\n \"--label-line-stroke\": varAttr(labelLineStroke, \"colors\"),\n \"--label-line-stroke-width\": labelLineStrokeWidth,\n \"--radar-color\": varAttr(radarColor, \"colors\"),\n \"--radar-fill-opacity\": radarFillOpacity,\n \"--radar-stroke\": varAttr(radarStroke, \"colors\"),\n \"--radar-stroke-width\": radarStrokeWidth,\n \"--radial-background-color\": varAttr(radialBackgroundColor, \"colors\"),\n \"--radial-background-fill\": varAttr(radialBackgroundFill, \"colors\"),\n \"--radial-background-stroke\": varAttr(radialBackgroundStroke, \"colors\"),\n \"--radial-background-stroke-width\": radialBackgroundStrokeWidth,\n \"--radius-axis-line-stroke\": varAttr(radiusAxisLineStroke, \"colors\"),\n \"--radius-axis-line-stroke-width\": radiusAxisLineStrokeWidth,\n \"--radius-axis-text-color\": varAttr(radiusAxisTextColor, \"colors\"),\n \"--radius-axis-text-fill\": varAttr(radiusAxisTextFill, \"colors\"),\n \"--sector-color\": varAttr(sectorColor, \"colors\"),\n \"--sector-fill\": varAttr(sectorFill, \"colors\"),\n \"--sector-stroke\": varAttr(sectorStroke, \"colors\"),\n \"--sector-stroke-width\": sectorStrokeWidth,\n ...rest,\n }),\n) as GenericsComponent<{\n <Y extends Dict>(props: PolarChartProps<Y>): ReactElement\n}>\n\nexport type ChartPieLabel =\n | ((props: PieLabelRenderProps) => Partial<ChartPieLabelProps>)\n | boolean\n | Partial<ChartPieLabelProps>\n\nexport type ChartPieLabelLine =\n | ((props: any) => ChartPieLabelLineProps)\n | boolean\n | ChartPieLabelLineProps\n\nexport type ChartPieLabelList = boolean | ChartLabelListProps\n\nexport interface ChartPieProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"svg\">,\n Omit<UseChartPieProps, \"data\" | \"dataKey\" | \"label\" | \"labelLine\" | \"nameKey\">\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: Exclude<keyof Y, \"fill\">\n /**\n * The key of the name of the data.\n */\n nameKey: Exclude<keyof Y, \"fill\">\n /**\n * The active index of the sector.\n */\n activeIndex?: number\n /**\n * The data to use for the pie.\n */\n data?: Y[]\n /**\n * The label to use for the pie.\n */\n label?: ChartPieLabel\n /**\n * The label line to use for the pie.\n *\n * @default false\n */\n labelLine?: ChartPieLabelLine\n /**\n * If `true`, the label list is visible.\n *\n * @default false\n */\n labelList?: ChartPieLabelList\n /**\n * Props for the sector component.\n */\n sectorProps?:\n | ((\n props: PieSectorShapeProps,\n index: number | string | undefined,\n ) => ChartSectorProps)\n | ChartSectorProps\n}\n\nexport const ChartPie = withContext<\"svg\", ChartPieProps>((props) => {\n const { pieProps } = useComponentContext()\n const {\n activeIndex,\n children,\n label: labelProp,\n labelLine: labelLineProp = false,\n labelList = false,\n nameKey,\n sectorProps,\n ...rest\n } = mergeProps(pieProps, props)()\n const shape: UseChartPieProps[\"shape\"] = useCallback(\n (props, index) => {\n if (isNumber(activeIndex)) props.isActive = index === activeIndex\n\n return (\n <ChartSector\n {...mergeProps(props, runIfFn(sectorProps, props, index))()}\n />\n )\n },\n [activeIndex, sectorProps],\n )\n const label = useMemo<UseChartPieProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const Component = (props: any) => (\n <ChartPieLabel\n {...mergeProps(\n props,\n labelProp !== true ? runIfFn(labelProp, props) : {},\n )()}\n />\n )\n\n return Component\n }, [labelProp])\n const labelLine = useMemo<UseChartPieProps[\"labelLine\"]>(() => {\n if (!labelLineProp) return labelLineProp\n\n const Component = ({ key: _, ...rest }: any) => (\n <ChartPieLabelLine\n {...mergeProps(\n rest,\n labelLineProp !== true ? runIfFn(labelLineProp, rest) : {},\n )()}\n />\n )\n\n return Component\n }, [labelLineProp])\n const { getPieProps, getRootProps } = useChartPie({\n label,\n labelLine,\n nameKey,\n shape,\n ...rest,\n })\n\n return (\n <styled.svg asChild {...getRootProps()}>\n <Pie {...getPieProps()}>\n {children}\n\n {labelList ? (\n <ChartLabelList\n dataKey={nameKey}\n {...(isObject(labelList) ? labelList : {})}\n />\n ) : null}\n </Pie>\n </styled.svg>\n )\n}, \"pie\")() as GenericsComponent<{\n <Y extends Dict>(props: ChartPieProps<Y>): ReactElement\n}>\n\ninterface ChartSectorProps extends Merge<\n HTMLStyledProps<\"path\">,\n UseChartSectorProps\n> {}\n\nconst ChartSector = withContext<\"path\", ChartSectorProps>((props) => {\n const { sectorProps } = useComponentContext()\n const { getRootProps, getSectorProps } = useChartSector({\n ...sectorProps,\n ...props,\n })\n\n return (\n <styled.path asChild {...getRootProps()}>\n <Sector {...getSectorProps()} />\n </styled.path>\n )\n}, \"sector\")()\n\ninterface ChartPieLabelProps extends Merge<\n HTMLStyledProps<\"text\">,\n UseChartPieLabelProps\n> {}\n\nconst ChartPieLabel = withContext<\"text\", ChartPieLabelProps>((props) => {\n const { getRootProps, getTextProps } = useChartPieLabel(props)\n\n return (\n <styled.text asChild {...getRootProps()}>\n <Text {...getTextProps()} />\n </styled.text>\n )\n}, \"label\")()\n\ninterface ChartPieLabelLineProps extends Merge<\n HTMLStyledProps<\"path\">,\n UseChartPieLabelLineProps\n> {}\n\nconst ChartPieLabelLine = withContext<\"path\", ChartPieLabelLineProps>(\n (props) => {\n const { getCurveProps, getRootProps } = useChartPieLabelLine(props)\n\n return (\n <styled.path asChild {...getRootProps()}>\n <Curve {...getCurveProps()} />\n </styled.path>\n )\n },\n \"labelLine\",\n)()\n\nexport interface ChartDonutProps<\n Y extends Dict = Dict,\n> extends ChartPieProps<Y> {}\n\nexport const ChartDonut = component<\"svg\", ChartDonutProps>(ChartPie, \"donut\")(\n undefined,\n (props) => {\n const { pieProps } = useComponentContext()\n\n return mergeProps(pieProps, props)()\n },\n ({ label, ...rest }) => ({ innerRadius: !label ? \"70%\" : \"50%\", ...rest }),\n) as GenericsComponent<{\n <Y extends Dict>(props: ChartDonutProps<Y>): ReactElement\n}>\n\nexport interface ChartRadarProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"path\">,\n Omit<UseChartRadarProps, \"activeDot\" | \"dataKey\" | \"dot\" | \"label\" | \"stroke\">\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: keyof Y\n /**\n * The active dot to use for the line.\n *\n * @default true\n */\n activeDot?: ChartActiveDot\n /**\n * The dot to use for the line.\n *\n * @default false\n */\n dot?: ChartDot\n /**\n * The label to use for the line.\n *\n * @default false\n */\n label?: ChartLabelListType\n}\n\nexport const ChartRadar = withContext<\"path\", ChartRadarProps>((props) => {\n const { radarProps } = useComponentContext()\n const {\n activeDot: activeDotProp = true,\n children,\n dataKey,\n dot: dotProp = false,\n label: labelProp = false,\n stroke: strokeProp,\n ...rest\n } = mergeProps(radarProps, props)()\n const id = useId()\n const system = useSystem()\n const { theme } = useTheme()\n const color = strokeProp ?? rest.fill ?? rest.color\n const stroke = JSON.stringify(color)\n const dotProps = useSlotComponentProps({}, \"dot\")\n const activeDotProps = useSlotComponentProps({}, \"activeDot\")\n const labelProps = useSlotComponentProps({}, \"labelList\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const dot = useMemo<UseChartRadarProps[\"dot\"]>(() => {\n if (!dotProp) return dotProp\n\n const className = cx(\n dotProps.className,\n css(dotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(dotProp)) {\n return (props) =>\n dotProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(dotProp)) {\n return cloneElement<any>(dotProp, { className })\n } else if (isObject(dotProp)) {\n const [omittedProps, styleProps] = splitObject<DotProps, CSSObject>(\n dotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [dotProp, dotProps.className, dotProps.css, css, color])\n const activeDot = useMemo<UseChartRadarProps[\"activeDot\"]>(() => {\n if (!activeDotProp) return activeDotProp\n\n const className = cx(\n activeDotProps.className,\n css(activeDotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(activeDotProp)) {\n return (props) =>\n activeDotProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(activeDotProp)) {\n return cloneElement<any>(activeDotProp, { className })\n } else if (isObject(activeDotProp)) {\n const [omittedProps, styleProps] = splitObject<ActiveDotProps, CSSObject>(\n activeDotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [activeDotProp, activeDotProps.className, activeDotProps.css, css, color])\n const label = useMemo<UseChartRadarProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelListProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getRadarProps, getRootProps } = useChartRadar({\n activeDot,\n dataKey,\n dot,\n fill: color ? `url(#${id})` : \"\",\n label,\n stroke,\n ...rest,\n })\n\n return (\n <>\n <styled.path asChild {...getRootProps()}>\n <Radar {...getRadarProps()}>{children}</Radar>\n </styled.path>\n\n <linearGradient id={id} x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <styled.stop\n stopColor={color}\n stopOpacity={rest.fillOpacity ?? \"{radar-fill-opacity}\"}\n />\n </linearGradient>\n </>\n )\n}, \"radar\")() as GenericsComponent<{\n <Y extends Dict>(props: ChartRadarProps<Y>): ReactElement\n}>\n\nexport type ChartPolarAxisTick =\n | ((props: BaseTickContentProps) => ReactNode)\n | boolean\n | HTMLStyledProps<\"text\">\n | ReactElement\n\nexport type ChartAxisLine = boolean | HTMLStyledProps<\"line\">\n\nexport interface ChartAngleAxisProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"text\">,\n Omit<\n UseAngleAxisProps,\n \"axisLine\" | \"dataKey\" | \"label\" | \"tick\" | \"tickLine\"\n >\n> {\n /**\n * The tick line to use for the axis.\n *\n * @default false\n */\n axisLine?: ChartAxisLine\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey?: keyof Y\n /**\n * The label to use for the axis.\n *\n * @default false\n */\n label?: ChartLabel\n /**\n * The tick to use for the axis.\n *\n * @default true\n */\n tick?: ChartPolarAxisTick\n /**\n * The tick line to use for the axis.\n *\n * @default false\n */\n tickLine?: ChartTickLine\n}\n\nexport const ChartAngleAxis = withContext<\"text\", ChartAngleAxisProps>(\n (props) => {\n const { nameKey, angleAxisProps } = useComponentContext()\n const {\n axisLine: axisLineProp = false,\n children,\n label: labelProp = false,\n tick: tickProp = true,\n tickLine: tickLineProp = false,\n ...rest\n } = mergeProps(angleAxisProps, props)()\n const system = useSystem()\n const { theme } = useTheme()\n const tickProps = useSlotComponentProps({}, \"angleAxisTick\")\n const labelProps = useSlotComponentProps({}, \"angleAxisLabel\")\n const tickLineProps = useSlotComponentProps({}, \"angleAxisTickLine\")\n const axisLineProps = useSlotComponentProps({}, \"angleAxisLine\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const tick = useMemo<UseAngleAxisProps[\"tick\"]>(() => {\n if (!tickProp) return tickProp\n\n const className = cx(tickProps.className, css(tickProps.css))\n\n if (isFunction(tickProp)) {\n return (props) =>\n tickProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(tickProp)) {\n return cloneElement<any>(tickProp, { className })\n } else if (isObject(tickProp)) {\n const [omittedProps, styleProps] = splitObject<\n BaseTickContentProps,\n CSSObject\n >(tickProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [tickProp, tickProps.className, tickProps.css, css])\n const tickLine = useMemo<UseAngleAxisProps[\"tickLine\"]>(() => {\n if (!tickLineProp) return tickLineProp\n\n const className = cx(tickLineProps.className, css(tickLineProps.css))\n\n if (isObject(tickLineProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"line\">,\n CSSObject\n >(tickLineProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [tickLineProp, tickLineProps.className, tickLineProps.css, css])\n const axisLine = useMemo<UseAngleAxisProps[\"axisLine\"]>(() => {\n if (!axisLineProp) return axisLineProp\n\n const className = cx(axisLineProps.className, css(axisLineProps.css))\n\n if (isObject(axisLineProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"line\">,\n CSSObject\n >(axisLineProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [axisLineProp, axisLineProps.className, axisLineProps.css, css])\n const label = useMemo<UseAngleAxisProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className, children: labelProp }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getAngleAxisProps, getRootProps } = useAngleAxis({\n axisLine,\n dataKey: nameKey,\n label,\n tick,\n tickLine,\n ...rest,\n })\n\n return (\n <styled.text asChild {...getRootProps()}>\n <PolarAngleAxis {...getAngleAxisProps()}>{children}</PolarAngleAxis>\n </styled.text>\n )\n },\n \"angleAxis\",\n)() as GenericsComponent<{\n <Y extends Dict>(props: ChartAngleAxisProps<Y>): ReactElement\n}>\n\nexport interface ChartRadiusAxisProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"text\">,\n Omit<\n UseRadiusAxisProps,\n \"axisLine\" | \"dataKey\" | \"label\" | \"tick\" | \"tickLine\"\n >\n> {\n /**\n * The tick line to use for the axis.\n *\n * @default false\n */\n axisLine?: ChartAxisLine\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey?: keyof Y\n /**\n * The label to use for the axis.\n *\n * @default false\n */\n label?: ChartLabel\n /**\n * The tick to use for the axis.\n *\n * @default true\n */\n tick?: ChartPolarAxisTick\n /**\n * The tick line to use for the axis.\n *\n * @default false\n */\n tickLine?: ChartTickLine\n}\n\nexport const ChartRadiusAxis = withContext<\"text\", ChartRadiusAxisProps>(\n (props) => {\n const { radiusAxisProps } = useComponentContext()\n const {\n axisLine: axisLineProp = false,\n children,\n label: labelProp = false,\n tick: tickProp = true,\n tickLine: tickLineProp = false,\n ...rest\n } = mergeProps(radiusAxisProps, props)()\n const system = useSystem()\n const { theme } = useTheme()\n const tickProps = useSlotComponentProps({}, \"radiusAxisTick\")\n const labelProps = useSlotComponentProps({}, \"radiusAxisLabel\")\n const tickLineProps = useSlotComponentProps({}, \"radiusAxisTickLine\")\n const axisLineProps = useSlotComponentProps({}, \"radiusAxisLine\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const tick = useMemo<UseRadiusAxisProps[\"tick\"]>(() => {\n if (!tickProp) return tickProp\n\n const className = cx(tickProps.className, css(tickProps.css))\n\n if (isFunction(tickProp)) {\n return (props) =>\n tickProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(tickProp)) {\n return cloneElement<any>(tickProp, { className })\n } else if (isObject(tickProp)) {\n const [omittedProps, styleProps] = splitObject<\n BaseTickContentProps,\n CSSObject\n >(tickProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [tickProp, tickProps.className, tickProps.css, css])\n const tickLine = useMemo<UseRadiusAxisProps[\"tickLine\"]>(() => {\n if (!tickLineProp) return tickLineProp\n\n const className = cx(tickLineProps.className, css(tickLineProps.css))\n\n if (isObject(tickLineProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"line\">,\n CSSObject\n >(tickLineProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [tickLineProp, tickLineProps.className, tickLineProps.css, css])\n const axisLine = useMemo<UseRadiusAxisProps[\"axisLine\"]>(() => {\n if (!axisLineProp) return axisLineProp\n\n const className = cx(axisLineProps.className, css(axisLineProps.css))\n\n if (isObject(axisLineProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"line\">,\n CSSObject\n >(axisLineProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [axisLineProp, axisLineProps.className, axisLineProps.css, css])\n const label = useMemo<UseRadiusAxisProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className, children: labelProp }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getRadiusAxisProps, getRootProps } = useRadiusAxis({\n axisLine,\n label,\n tick,\n tickLine,\n ...rest,\n })\n\n return (\n <styled.text asChild {...getRootProps()}>\n <PolarRadiusAxis {...getRadiusAxisProps()}>{children}</PolarRadiusAxis>\n </styled.text>\n )\n },\n \"radiusAxis\",\n)() as GenericsComponent<{\n <Y extends Dict>(props: ChartRadiusAxisProps<Y>): ReactElement\n}>\n\nexport interface ChartPolarGridProps extends Merge<\n HTMLStyledProps<\"line\">,\n UsePolarGridProps\n> {}\n\nexport const ChartPolarGrid = withContext<\"line\", ChartPolarGridProps>(\n (props) => {\n const { gridProps } = useComponentContext()\n const { getPolarGridProps, getRootProps } = usePolarGrid({\n ...gridProps,\n ...props,\n })\n\n return (\n <styled.line asChild {...getRootProps()}>\n <PolarGrid {...getPolarGridProps()} />\n </styled.line>\n )\n },\n \"grid\",\n)()\n\nexport type ChartRadialBackground =\n | ((props: SectorProps) => ReactNode)\n | boolean\n | HTMLStyledProps<\"path\">\n | ReactElement\n\nexport interface ChartRadialProps<Y extends Dict = Dict> extends Merge<\n Omit<HTMLStyledProps<\"svg\">, \"background\">,\n Omit<UseChartRadialProps<Y>, \"background\" | \"dataKey\" | \"label\">\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: keyof Y\n /**\n * The background to use for the radial chart.\n */\n background?: ChartRadialBackground\n /**\n * The label to use for the radial.\n *\n * @default false\n */\n label?: ChartLabelListType\n /**\n * If `true`, the label list is visible.\n *\n * @default false\n */\n labelList?: ChartPieLabelList\n /**\n * Props for the sector component.\n */\n sectorProps?:\n | ((props: RadialBarSectorProps) => ChartSectorProps)\n | ChartSectorProps\n}\n\nexport const ChartRadial = withContext<\"svg\", ChartRadialProps>(\n <Y extends Dict>(props: ChartRadialProps<Y>) => {\n const { radialProps } = useComponentContext()\n const {\n background: backgroundProp = true,\n children,\n dataKey,\n label: labelProp = false,\n labelList = false,\n nameKey,\n sectorProps,\n ...rest\n } = mergeProps(radialProps, props)()\n const system = useSystem()\n const { theme } = useTheme()\n const { nameKeyRef } = useChartComponentContext()\n const labelProps = useSlotComponentProps({}, \"labelList\")\n const backgroundProps = useSlotComponentProps({}, \"radialBackground\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const shape: UseChartRadialProps<Y>[\"shape\"] = useCallback(\n (props) => {\n const color = rest.fill ?? rest.color\n\n return (\n <ChartSector\n color={color}\n {...mergeProps(props, runIfFn(sectorProps, props))()}\n />\n )\n },\n [rest.fill, rest.color, sectorProps],\n )\n const label = useMemo<UseChartRadialProps<Y>[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<\n LabelListProps,\n CSSObject\n >(labelProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const background = useMemo<UseChartRadialProps<Y>[\"background\"]>(() => {\n if (!backgroundProp) return backgroundProp\n\n const className = cx(backgroundProps.className, css(backgroundProps.css))\n\n if (isFunction(backgroundProp)) {\n return (props) =>\n backgroundProp({\n ...props,\n className: cx(className, props.className),\n })\n } else if (isValidElement(backgroundProp)) {\n return cloneElement<any>(backgroundProp, { className })\n } else if (isObject(backgroundProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"path\">,\n CSSObject\n >(backgroundProp, shouldForwardProp)\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [backgroundProp, backgroundProps.className, backgroundProps.css, css])\n const { getRadialProps, getRootProps } = useChartRadial({\n background,\n dataKey: dataKey as DataKey<any>,\n label,\n nameKey,\n shape,\n ...rest,\n })\n\n assignRef(nameKeyRef, nameKey)\n\n return (\n <styled.svg asChild {...getRootProps()}>\n <RadialBar {...getRadialProps()}>\n {children}\n\n {labelList ? (\n <ChartLabelList\n dataKey={nameKey as DataKey<any>}\n offset={4}\n position=\"insideStart\"\n {...(isObject(labelList) ? labelList : {})}\n />\n ) : null}\n </RadialBar>\n </styled.svg>\n )\n },\n \"radial\",\n)() as GenericsComponent<{\n <Y extends Dict>(props: ChartRadialProps<Y>): ReactElement\n}>\n"],"mappings":";;;;;;;;;;;;;;;;;AAoGA,MAAM,oBAAoB,wBAAwB;AAmOlD,MAAM,EACJ,WACA,kBACA,cAAc,wBACd,qBACA,iBAAiB,2BACjB,aACA,cACA,0BACE,oBACF,eACA,eACF;AAIA,MAAa,aAAa,c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AAW,GAAI,eAAe;aAA9B,CACG,UAEA,YACC,oBAAC,gBAAD;IACE,SAAS;IACT,QAAQ;IACR,UAAS;IACT,IAAA,GAAA,cAAA,SAAA,CAAc,SAAS,IAAI,YAAY,CAAC;GACzC,CAAA,IACC,IACK;;CACD,CAAA;AAEhB,GACA,QACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"polar-chart.js","names":[],"sources":["../../../../src/components/chart/polar-chart.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\n\nimport type {\n ActiveDotProps,\n BaseTickContentProps,\n DataKey,\n DotProps,\n LabelListProps,\n LabelProps,\n PieLabelRenderProps,\n PieSectorShapeProps,\n RadialBarSectorProps,\n SectorProps,\n} from \"recharts\"\nimport type { PolarChartProps as OriginalPolarChartProps } from \"recharts/types/util/types\"\nimport type {\n CSSObject,\n CSSProps,\n GenericsComponent,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Dict, Merge } from \"../../utils\"\nimport type {\n ChartActiveDot,\n ChartDot,\n ChartLabel,\n ChartLabelListProps,\n ChartLabelList as ChartLabelListType,\n ChartProps,\n ChartTickLine,\n} from \"./chart\"\nimport type { PolarChartStyle } from \"./polar-chart.style\"\nimport type {\n UseAngleAxisProps,\n UseChartPieLabelLineProps,\n UseChartPieLabelProps,\n UseChartPieProps,\n UseChartRadarProps,\n UseChartRadialProps,\n UseChartSectorProps,\n UsePolarChartProps,\n UsePolarGridProps,\n UseRadiusAxisProps,\n} from \"./use-polar-chart\"\nimport {\n cloneElement,\n isValidElement,\n useCallback,\n useId,\n useMemo,\n} from \"react\"\nimport {\n Curve,\n Pie,\n PolarAngleAxis,\n PolarGrid,\n PolarRadiusAxis,\n Radar,\n RadialBar,\n Sector,\n Text,\n} from \"recharts\"\nimport {\n createShouldForwardProp,\n createSlotComponent,\n getCSS,\n mergeProps,\n styled,\n useSystem,\n useTheme,\n varAttr,\n} from \"../../core\"\nimport {\n assignRef,\n cx,\n isFunction,\n isNumber,\n isObject,\n runIfFn,\n splitObject,\n} from \"../../utils\"\nimport { Chart, ChartLabelList, useChartComponentContext } from \"./chart\"\nimport { polarChartStyle } from \"./polar-chart.style\"\nimport {\n useAngleAxis,\n useChartPie,\n useChartPieLabel,\n useChartPieLabelLine,\n useChartRadar,\n useChartRadial,\n useChartSector,\n usePolarChart,\n usePolarGrid,\n useRadiusAxis,\n} from \"./use-polar-chart\"\n\nconst shouldForwardProp = createShouldForwardProp()\n\ninterface ComponentContext extends Pick<\n PolarChartProps,\n | \"angleAxisProps\"\n | \"gridProps\"\n | \"nameKey\"\n | \"pieProps\"\n | \"radarProps\"\n | \"radialProps\"\n | \"radiusAxisProps\"\n | \"sectorProps\"\n> {}\n\nexport interface PolarChartProps<Y extends Dict = Dict>\n extends\n Omit<ChartProps, \"cx\" | \"cy\">,\n UsePolarChartProps<Y>,\n ThemeProps<PolarChartStyle> {\n /**\n * The fill of the active dot.\n */\n activeDotFill?: CSSProps[\"fill\"]\n /**\n * The radius of the active dot.\n */\n activeDotRadius?: CSSProps[\"r\"]\n /**\n * The stroke of the active dot.\n */\n activeDotStroke?: CSSProps[\"stroke\"]\n /**\n * The width of the active dot stroke.\n */\n activeDotStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The stroke of the angle axis line.\n */\n angleAxisLineStroke?: CSSProps[\"stroke\"]\n /**\n * The width of the angle axis line stroke.\n */\n angleAxisLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The color of the angle axis text.\n */\n angleAxisTextColor?: CSSProps[\"color\"]\n /**\n * The fill of the angle axis text.\n */\n angleAxisTextFill?: CSSProps[\"fill\"]\n /**\n * The fill of the dot.\n */\n dotFill?: CSSProps[\"fill\"]\n /**\n * The radius of the dot.\n */\n dotRadius?: CSSProps[\"r\"]\n /**\n * The stroke of the dot.\n */\n dotStroke?: CSSProps[\"stroke\"]\n /**\n * The width of the dot stroke.\n */\n dotStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The stroke of the grid.\n */\n gridStroke?: CSSProps[\"stroke\"]\n /**\n * The opacity of the inactive label line.\n */\n inactiveLabelLineOpacity?: CSSProps[\"opacity\"]\n /**\n * The opacity of the inactive label.\n */\n inactiveLabelOpacity?: CSSProps[\"opacity\"]\n /**\n * The opacity of the inactive radar.\n */\n inactiveRadarOpacity?: CSSProps[\"opacity\"]\n /**\n * The opacity of the inactive sector.\n */\n inactiveSectorOpacity?: CSSProps[\"opacity\"]\n /**\n * The color of the label.\n */\n labelColor?: CSSProps[\"color\"]\n /**\n * The fill of the label.\n */\n labelFill?: CSSProps[\"fill\"]\n /**\n * The stroke of the label line.\n */\n labelLineStroke?: CSSProps[\"stroke\"]\n /**\n * The width of the label line stroke.\n */\n labelLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The key to use for the angle axis.\n */\n nameKey?: keyof Y\n /**\n * The color of the radar.\n */\n radarColor?: CSSProps[\"color\"]\n /**\n * The fill opacity of the radar.\n */\n radarFillOpacity?: CSSProps[\"fillOpacity\"]\n /**\n * The stroke of the radar.\n */\n radarStroke?: CSSProps[\"stroke\"]\n /**\n * The width of the radar stroke.\n */\n radarStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The color of the radial background.\n */\n radialBackgroundColor?: CSSProps[\"color\"]\n /**\n * The fill of the radial background.\n */\n radialBackgroundFill?: CSSProps[\"fill\"]\n /**\n * The stroke of the radial background.\n */\n radialBackgroundStroke?: CSSProps[\"stroke\"]\n /**\n * The width of the radial background stroke.\n */\n radialBackgroundStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The stroke of the radius axis line.\n */\n radiusAxisLineStroke?: CSSProps[\"stroke\"]\n /**\n * The width of the radius axis line stroke.\n */\n radiusAxisLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The color of the radius axis text.\n */\n radiusAxisTextColor?: CSSProps[\"color\"]\n /**\n * The fill of the radius axis text.\n */\n radiusAxisTextFill?: CSSProps[\"fill\"]\n /**\n * The color of the sector.\n */\n sectorColor?: CSSProps[\"color\"]\n /**\n * The fill of the sector.\n */\n sectorFill?: CSSProps[\"fill\"]\n /**\n * The stroke of the sector.\n */\n sectorStroke?: CSSProps[\"stroke\"]\n /**\n * The width of the sector stroke.\n */\n sectorStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * If `true`, angle axis is visible.\n *\n * @default true\n */\n withAngleAxis?: boolean\n /**\n * If `true`, grid is visible.\n *\n * @default true\n */\n withGrid?: boolean\n /**\n * If `true`, radius axis is visible.\n *\n * @default false\n */\n withRadiusAxis?: boolean\n /**\n * Props for the angle axis component.\n */\n angleAxisProps?: UseAngleAxisProps\n /**\n * Props for the polar chart component.\n */\n chartProps?: Omit<OriginalPolarChartProps, \"data\">\n /**\n * Props for the donut component.\n */\n donutProps?: Omit<ChartPieProps, \"data\" | \"dataKey\" | \"nameKey\">\n /**\n * Props for the grid component.\n */\n gridProps?: ChartPolarGridProps\n /**\n * Props for the pie component.\n */\n pieProps?: Omit<ChartPieProps, \"data\" | \"dataKey\" | \"nameKey\">\n /**\n * Props for the radar component.\n */\n radarProps?: Omit<ChartRadarProps, \"data\" | \"dataKey\">\n /**\n * Props for the radial component.\n */\n radialProps?: Omit<ChartRadialProps, \"dataKey\" | \"nameKey\">\n /**\n * Props for the radius axis component.\n */\n radiusAxisProps?: UseRadiusAxisProps\n /**\n * Props for the sector component.\n */\n sectorProps?: ChartSectorProps\n}\n\nconst {\n component,\n ComponentContext,\n PropsContext: PolarChartPropsContext,\n useComponentContext,\n usePropsContext: usePolarChartPropsContext,\n withContext,\n withProvider,\n useSlotComponentProps,\n} = createSlotComponent<PolarChartProps, PolarChartStyle, ComponentContext>(\n \"polar-chart\",\n polarChartStyle,\n)\n\nexport { PolarChartPropsContext, usePolarChartPropsContext }\n\nexport const PolarChart = withProvider(\n <Y extends Dict>({\n components: componentsProp,\n nameKey,\n render,\n withAngleAxis = false,\n withGrid = false,\n withRadiusAxis = false,\n angleAxisProps,\n chartProps,\n donutProps,\n gridProps,\n pieProps = donutProps,\n radarProps,\n radialProps,\n radiusAxisProps,\n sectorProps,\n ...rest\n }: PolarChartProps<Y>) => {\n const { getChartProps, getRootProps } = usePolarChart(rest)\n const components = useMemo(\n () => [\n {\n component: ChartPolarGrid,\n fallback: withGrid ? <ChartPolarGrid /> : null,\n },\n {\n component: ChartAngleAxis,\n fallback: withAngleAxis ? <ChartAngleAxis /> : null,\n },\n {\n component: ChartRadiusAxis,\n fallback: withRadiusAxis ? <ChartRadiusAxis /> : null,\n },\n ...componentsProp,\n ],\n [componentsProp, withGrid, withAngleAxis, withRadiusAxis],\n )\n const componentContext = useMemo(\n () => ({\n nameKey: nameKey as string | undefined,\n angleAxisProps,\n gridProps,\n pieProps,\n radarProps,\n radialProps,\n radiusAxisProps,\n sectorProps,\n }),\n [\n pieProps,\n radarProps,\n sectorProps,\n angleAxisProps,\n radiusAxisProps,\n gridProps,\n nameKey,\n radialProps,\n ],\n )\n\n return (\n <ComponentContext value={componentContext}>\n <Chart\n components={components}\n render={(props) => render(getChartProps({ ...props, ...chartProps }))}\n {...getRootProps()}\n />\n </ComponentContext>\n )\n },\n \"root\",\n)(\n undefined,\n ({\n activeDotFill,\n activeDotRadius,\n activeDotStroke,\n activeDotStrokeWidth,\n angleAxisLineStroke,\n angleAxisLineStrokeWidth,\n angleAxisTextColor,\n angleAxisTextFill,\n dotFill,\n dotRadius,\n dotStroke,\n dotStrokeWidth,\n gridStroke,\n inactiveLabelLineOpacity,\n inactiveLabelOpacity,\n inactiveRadarOpacity,\n inactiveSectorOpacity,\n labelColor,\n labelFill,\n labelLineStroke,\n labelLineStrokeWidth,\n radarColor,\n radarFillOpacity,\n radarStroke,\n radarStrokeWidth,\n radialBackgroundColor,\n radialBackgroundFill,\n radialBackgroundStroke,\n radialBackgroundStrokeWidth,\n radiusAxisLineStroke,\n radiusAxisLineStrokeWidth,\n radiusAxisTextColor,\n radiusAxisTextFill,\n sectorColor,\n sectorFill,\n sectorStroke,\n sectorStrokeWidth,\n ...rest\n }) => ({\n \"--active-dot-fill\": varAttr(activeDotFill, \"colors\"),\n \"--active-dot-r\": activeDotRadius,\n \"--active-dot-stroke\": varAttr(activeDotStroke, \"colors\"),\n \"--active-dot-stroke-width\": activeDotStrokeWidth,\n \"--angle-axis-line-stroke\": varAttr(angleAxisLineStroke, \"colors\"),\n \"--angle-axis-line-stroke-width\": angleAxisLineStrokeWidth,\n \"--angle-axis-text-color\": varAttr(angleAxisTextColor, \"colors\"),\n \"--angle-axis-text-fill\": varAttr(angleAxisTextFill, \"colors\"),\n \"--dot-fill\": varAttr(dotFill, \"colors\"),\n \"--dot-r\": dotRadius,\n \"--dot-stroke\": varAttr(dotStroke, \"colors\"),\n \"--dot-stroke-width\": dotStrokeWidth,\n \"--grid-stroke\": varAttr(gridStroke, \"colors\"),\n \"--inactive-label-line-opacity\": inactiveLabelLineOpacity,\n \"--inactive-label-opacity\": inactiveLabelOpacity,\n \"--inactive-radar-opacity\": inactiveRadarOpacity,\n \"--inactive-sector-opacity\": inactiveSectorOpacity,\n \"--label-color\": varAttr(labelColor, \"colors\"),\n \"--label-fill\": varAttr(labelFill, \"colors\"),\n \"--label-line-stroke\": varAttr(labelLineStroke, \"colors\"),\n \"--label-line-stroke-width\": labelLineStrokeWidth,\n \"--radar-color\": varAttr(radarColor, \"colors\"),\n \"--radar-fill-opacity\": radarFillOpacity,\n \"--radar-stroke\": varAttr(radarStroke, \"colors\"),\n \"--radar-stroke-width\": radarStrokeWidth,\n \"--radial-background-color\": varAttr(radialBackgroundColor, \"colors\"),\n \"--radial-background-fill\": varAttr(radialBackgroundFill, \"colors\"),\n \"--radial-background-stroke\": varAttr(radialBackgroundStroke, \"colors\"),\n \"--radial-background-stroke-width\": radialBackgroundStrokeWidth,\n \"--radius-axis-line-stroke\": varAttr(radiusAxisLineStroke, \"colors\"),\n \"--radius-axis-line-stroke-width\": radiusAxisLineStrokeWidth,\n \"--radius-axis-text-color\": varAttr(radiusAxisTextColor, \"colors\"),\n \"--radius-axis-text-fill\": varAttr(radiusAxisTextFill, \"colors\"),\n \"--sector-color\": varAttr(sectorColor, \"colors\"),\n \"--sector-fill\": varAttr(sectorFill, \"colors\"),\n \"--sector-stroke\": varAttr(sectorStroke, \"colors\"),\n \"--sector-stroke-width\": sectorStrokeWidth,\n ...rest,\n }),\n) as GenericsComponent<{\n <Y extends Dict>(props: PolarChartProps<Y>): ReactElement\n}>\n\nexport type ChartPieLabel =\n | ((props: PieLabelRenderProps) => Partial<ChartPieLabelProps>)\n | boolean\n | Partial<ChartPieLabelProps>\n\nexport type ChartPieLabelLine =\n | ((props: any) => ChartPieLabelLineProps)\n | boolean\n | ChartPieLabelLineProps\n\nexport type ChartPieLabelList = boolean | ChartLabelListProps\n\nexport interface ChartPieProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"svg\">,\n Omit<UseChartPieProps, \"data\" | \"dataKey\" | \"label\" | \"labelLine\" | \"nameKey\">\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: Exclude<keyof Y, \"fill\">\n /**\n * The key of the name of the data.\n */\n nameKey: Exclude<keyof Y, \"fill\">\n /**\n * The active index of the sector.\n */\n activeIndex?: number\n /**\n * The data to use for the pie.\n */\n data?: Y[]\n /**\n * The label to use for the pie.\n */\n label?: ChartPieLabel\n /**\n * The label line to use for the pie.\n *\n * @default false\n */\n labelLine?: ChartPieLabelLine\n /**\n * If `true`, the label list is visible.\n *\n * @default false\n */\n labelList?: ChartPieLabelList\n /**\n * Props for the sector component.\n */\n sectorProps?:\n | ((\n props: PieSectorShapeProps,\n index: number | string | undefined,\n ) => ChartSectorProps)\n | ChartSectorProps\n}\n\nexport const ChartPie = withContext<\"svg\", ChartPieProps>((props) => {\n const { pieProps } = useComponentContext()\n const {\n activeIndex,\n children,\n label: labelProp,\n labelLine: labelLineProp = false,\n labelList = false,\n nameKey,\n sectorProps,\n ...rest\n } = mergeProps(pieProps, props)()\n const shape: UseChartPieProps[\"shape\"] = useCallback(\n (props, index) => {\n if (isNumber(activeIndex)) props.isActive = index === activeIndex\n\n return (\n <ChartSector\n {...mergeProps(props, runIfFn(sectorProps, props, index))()}\n />\n )\n },\n [activeIndex, sectorProps],\n )\n const label = useMemo<UseChartPieProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const Component = (props: any) => (\n <ChartPieLabel\n {...mergeProps(\n props,\n labelProp !== true ? runIfFn(labelProp, props) : {},\n )()}\n />\n )\n\n return Component\n }, [labelProp])\n const labelLine = useMemo<UseChartPieProps[\"labelLine\"]>(() => {\n if (!labelLineProp) return labelLineProp\n\n const Component = ({ key: _, ...rest }: any) => (\n <ChartPieLabelLine\n {...mergeProps(\n rest,\n labelLineProp !== true ? runIfFn(labelLineProp, rest) : {},\n )()}\n />\n )\n\n return Component\n }, [labelLineProp])\n const { getPieProps, getRootProps } = useChartPie({\n label,\n labelLine,\n nameKey,\n shape,\n ...rest,\n })\n\n return (\n <styled.svg asChild {...getRootProps()}>\n <Pie {...getPieProps()}>\n {children}\n\n {labelList ? (\n <ChartLabelList\n dataKey={nameKey}\n {...(isObject(labelList) ? labelList : {})}\n />\n ) : null}\n </Pie>\n </styled.svg>\n )\n}, \"pie\")() as GenericsComponent<{\n <Y extends Dict>(props: ChartPieProps<Y>): ReactElement\n}>\n\ninterface ChartSectorProps extends Merge<\n HTMLStyledProps<\"path\">,\n UseChartSectorProps\n> {}\n\nconst ChartSector = withContext<\"path\", ChartSectorProps>((props) => {\n const { sectorProps } = useComponentContext()\n const { getRootProps, getSectorProps } = useChartSector({\n ...sectorProps,\n ...props,\n })\n\n return (\n <styled.path asChild {...getRootProps()}>\n <Sector {...getSectorProps()} />\n </styled.path>\n )\n}, \"sector\")()\n\ninterface ChartPieLabelProps extends Merge<\n HTMLStyledProps<\"text\">,\n UseChartPieLabelProps\n> {}\n\nconst ChartPieLabel = withContext<\"text\", ChartPieLabelProps>((props) => {\n const { getRootProps, getTextProps } = useChartPieLabel(props)\n\n return (\n <styled.text asChild {...getRootProps()}>\n <Text {...getTextProps()} />\n </styled.text>\n )\n}, \"label\")()\n\ninterface ChartPieLabelLineProps extends Merge<\n HTMLStyledProps<\"path\">,\n UseChartPieLabelLineProps\n> {}\n\nconst ChartPieLabelLine = withContext<\"path\", ChartPieLabelLineProps>(\n (props) => {\n const { getCurveProps, getRootProps } = useChartPieLabelLine(props)\n\n return (\n <styled.path asChild {...getRootProps()}>\n <Curve {...getCurveProps()} />\n </styled.path>\n )\n },\n \"labelLine\",\n)()\n\nexport interface ChartDonutProps<\n Y extends Dict = Dict,\n> extends ChartPieProps<Y> {}\n\nexport const ChartDonut = component<\"svg\", ChartDonutProps>(ChartPie, \"donut\")(\n undefined,\n (props) => {\n const { pieProps } = useComponentContext()\n\n return mergeProps(pieProps, props)()\n },\n ({ label, ...rest }) => ({ innerRadius: !label ? \"70%\" : \"50%\", ...rest }),\n) as GenericsComponent<{\n <Y extends Dict>(props: ChartDonutProps<Y>): ReactElement\n}>\n\nexport interface ChartRadarProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"path\">,\n Omit<UseChartRadarProps, \"activeDot\" | \"dataKey\" | \"dot\" | \"label\" | \"stroke\">\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: keyof Y\n /**\n * The active dot to use for the line.\n *\n * @default true\n */\n activeDot?: ChartActiveDot\n /**\n * The dot to use for the line.\n *\n * @default false\n */\n dot?: ChartDot\n /**\n * The label to use for the line.\n *\n * @default false\n */\n label?: ChartLabelListType\n}\n\nexport const ChartRadar = withContext<\"path\", ChartRadarProps>((props) => {\n const { radarProps } = useComponentContext()\n const {\n activeDot: activeDotProp = true,\n children,\n dataKey,\n dot: dotProp = false,\n label: labelProp = false,\n stroke: strokeProp,\n ...rest\n } = mergeProps(radarProps, props)()\n const id = useId()\n const system = useSystem()\n const { theme } = useTheme()\n const color = strokeProp ?? rest.fill ?? rest.color\n const stroke = JSON.stringify(color)\n const dotProps = useSlotComponentProps({}, \"dot\")\n const activeDotProps = useSlotComponentProps({}, \"activeDot\")\n const labelProps = useSlotComponentProps({}, \"labelList\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const dot = useMemo<UseChartRadarProps[\"dot\"]>(() => {\n if (!dotProp) return dotProp\n\n const className = cx(\n dotProps.className,\n css(dotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(dotProp)) {\n return (props) =>\n dotProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(dotProp)) {\n return cloneElement<any>(dotProp, { className })\n } else if (isObject(dotProp)) {\n const [omittedProps, styleProps] = splitObject<DotProps, CSSObject>(\n dotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [dotProp, dotProps.className, dotProps.css, css, color])\n const activeDot = useMemo<UseChartRadarProps[\"activeDot\"]>(() => {\n if (!activeDotProp) return activeDotProp\n\n const className = cx(\n activeDotProps.className,\n css(activeDotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(activeDotProp)) {\n return (props) =>\n activeDotProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(activeDotProp)) {\n return cloneElement<any>(activeDotProp, { className })\n } else if (isObject(activeDotProp)) {\n const [omittedProps, styleProps] = splitObject<ActiveDotProps, CSSObject>(\n activeDotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [activeDotProp, activeDotProps.className, activeDotProps.css, css, color])\n const label = useMemo<UseChartRadarProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelListProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getRadarProps, getRootProps } = useChartRadar({\n activeDot,\n dataKey,\n dot,\n fill: color ? `url(#${id})` : \"\",\n label,\n stroke,\n ...rest,\n })\n\n return (\n <>\n <styled.path asChild {...getRootProps()}>\n <Radar {...getRadarProps()}>{children}</Radar>\n </styled.path>\n\n <linearGradient id={id} x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <styled.stop\n stopColor={color}\n stopOpacity={rest.fillOpacity ?? \"{radar-fill-opacity}\"}\n />\n </linearGradient>\n </>\n )\n}, \"radar\")() as GenericsComponent<{\n <Y extends Dict>(props: ChartRadarProps<Y>): ReactElement\n}>\n\nexport type ChartPolarAxisTick =\n | ((props: BaseTickContentProps) => ReactNode)\n | boolean\n | HTMLStyledProps<\"text\">\n | ReactElement\n\nexport type ChartAxisLine = boolean | HTMLStyledProps<\"line\">\n\nexport interface ChartAngleAxisProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"text\">,\n Omit<\n UseAngleAxisProps,\n \"axisLine\" | \"dataKey\" | \"label\" | \"tick\" | \"tickLine\"\n >\n> {\n /**\n * The tick line to use for the axis.\n *\n * @default false\n */\n axisLine?: ChartAxisLine\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey?: keyof Y\n /**\n * The label to use for the axis.\n *\n * @default false\n */\n label?: ChartLabel\n /**\n * The tick to use for the axis.\n *\n * @default true\n */\n tick?: ChartPolarAxisTick\n /**\n * The tick line to use for the axis.\n *\n * @default false\n */\n tickLine?: ChartTickLine\n}\n\nexport const ChartAngleAxis = withContext<\"text\", ChartAngleAxisProps>(\n (props) => {\n const { nameKey, angleAxisProps } = useComponentContext()\n const {\n axisLine: axisLineProp = false,\n children,\n label: labelProp = false,\n tick: tickProp = true,\n tickLine: tickLineProp = false,\n ...rest\n } = mergeProps(angleAxisProps, props)()\n const system = useSystem()\n const { theme } = useTheme()\n const tickProps = useSlotComponentProps({}, \"angleAxisTick\")\n const labelProps = useSlotComponentProps({}, \"angleAxisLabel\")\n const tickLineProps = useSlotComponentProps({}, \"angleAxisTickLine\")\n const axisLineProps = useSlotComponentProps({}, \"angleAxisLine\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const tick = useMemo<UseAngleAxisProps[\"tick\"]>(() => {\n if (!tickProp) return tickProp\n\n const className = cx(tickProps.className, css(tickProps.css))\n\n if (isFunction(tickProp)) {\n return (props) =>\n tickProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(tickProp)) {\n return cloneElement<any>(tickProp, { className })\n } else if (isObject(tickProp)) {\n const [omittedProps, styleProps] = splitObject<\n BaseTickContentProps,\n CSSObject\n >(tickProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [tickProp, tickProps.className, tickProps.css, css])\n const tickLine = useMemo<UseAngleAxisProps[\"tickLine\"]>(() => {\n if (!tickLineProp) return tickLineProp\n\n const className = cx(tickLineProps.className, css(tickLineProps.css))\n\n if (isObject(tickLineProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"line\">,\n CSSObject\n >(tickLineProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [tickLineProp, tickLineProps.className, tickLineProps.css, css])\n const axisLine = useMemo<UseAngleAxisProps[\"axisLine\"]>(() => {\n if (!axisLineProp) return axisLineProp\n\n const className = cx(axisLineProps.className, css(axisLineProps.css))\n\n if (isObject(axisLineProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"line\">,\n CSSObject\n >(axisLineProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [axisLineProp, axisLineProps.className, axisLineProps.css, css])\n const label = useMemo<UseAngleAxisProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className, children: labelProp }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getAngleAxisProps, getRootProps } = useAngleAxis({\n axisLine,\n dataKey: nameKey,\n label,\n tick,\n tickLine,\n ...rest,\n })\n\n return (\n <styled.text asChild {...getRootProps()}>\n <PolarAngleAxis {...getAngleAxisProps()}>{children}</PolarAngleAxis>\n </styled.text>\n )\n },\n \"angleAxis\",\n)() as GenericsComponent<{\n <Y extends Dict>(props: ChartAngleAxisProps<Y>): ReactElement\n}>\n\nexport interface ChartRadiusAxisProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"text\">,\n Omit<\n UseRadiusAxisProps,\n \"axisLine\" | \"dataKey\" | \"label\" | \"tick\" | \"tickLine\"\n >\n> {\n /**\n * The tick line to use for the axis.\n *\n * @default false\n */\n axisLine?: ChartAxisLine\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey?: keyof Y\n /**\n * The label to use for the axis.\n *\n * @default false\n */\n label?: ChartLabel\n /**\n * The tick to use for the axis.\n *\n * @default true\n */\n tick?: ChartPolarAxisTick\n /**\n * The tick line to use for the axis.\n *\n * @default false\n */\n tickLine?: ChartTickLine\n}\n\nexport const ChartRadiusAxis = withContext<\"text\", ChartRadiusAxisProps>(\n (props) => {\n const { radiusAxisProps } = useComponentContext()\n const {\n axisLine: axisLineProp = false,\n children,\n label: labelProp = false,\n tick: tickProp = true,\n tickLine: tickLineProp = false,\n ...rest\n } = mergeProps(radiusAxisProps, props)()\n const system = useSystem()\n const { theme } = useTheme()\n const tickProps = useSlotComponentProps({}, \"radiusAxisTick\")\n const labelProps = useSlotComponentProps({}, \"radiusAxisLabel\")\n const tickLineProps = useSlotComponentProps({}, \"radiusAxisTickLine\")\n const axisLineProps = useSlotComponentProps({}, \"radiusAxisLine\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const tick = useMemo<UseRadiusAxisProps[\"tick\"]>(() => {\n if (!tickProp) return tickProp\n\n const className = cx(tickProps.className, css(tickProps.css))\n\n if (isFunction(tickProp)) {\n return (props) =>\n tickProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(tickProp)) {\n return cloneElement<any>(tickProp, { className })\n } else if (isObject(tickProp)) {\n const [omittedProps, styleProps] = splitObject<\n BaseTickContentProps,\n CSSObject\n >(tickProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [tickProp, tickProps.className, tickProps.css, css])\n const tickLine = useMemo<UseRadiusAxisProps[\"tickLine\"]>(() => {\n if (!tickLineProp) return tickLineProp\n\n const className = cx(tickLineProps.className, css(tickLineProps.css))\n\n if (isObject(tickLineProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"line\">,\n CSSObject\n >(tickLineProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [tickLineProp, tickLineProps.className, tickLineProps.css, css])\n const axisLine = useMemo<UseRadiusAxisProps[\"axisLine\"]>(() => {\n if (!axisLineProp) return axisLineProp\n\n const className = cx(axisLineProps.className, css(axisLineProps.css))\n\n if (isObject(axisLineProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"line\">,\n CSSObject\n >(axisLineProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [axisLineProp, axisLineProps.className, axisLineProps.css, css])\n const label = useMemo<UseRadiusAxisProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className, children: labelProp }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const { getRadiusAxisProps, getRootProps } = useRadiusAxis({\n axisLine,\n label,\n tick,\n tickLine,\n ...rest,\n })\n\n return (\n <styled.text asChild {...getRootProps()}>\n <PolarRadiusAxis {...getRadiusAxisProps()}>{children}</PolarRadiusAxis>\n </styled.text>\n )\n },\n \"radiusAxis\",\n)() as GenericsComponent<{\n <Y extends Dict>(props: ChartRadiusAxisProps<Y>): ReactElement\n}>\n\nexport interface ChartPolarGridProps extends Merge<\n HTMLStyledProps<\"line\">,\n UsePolarGridProps\n> {}\n\nexport const ChartPolarGrid = withContext<\"line\", ChartPolarGridProps>(\n (props) => {\n const { gridProps } = useComponentContext()\n const { getPolarGridProps, getRootProps } = usePolarGrid({\n ...gridProps,\n ...props,\n })\n\n return (\n <styled.line asChild {...getRootProps()}>\n <PolarGrid {...getPolarGridProps()} />\n </styled.line>\n )\n },\n \"grid\",\n)()\n\nexport type ChartRadialBackground =\n | ((props: SectorProps) => ReactNode)\n | boolean\n | HTMLStyledProps<\"path\">\n | ReactElement\n\nexport interface ChartRadialProps<Y extends Dict = Dict> extends Merge<\n Omit<HTMLStyledProps<\"svg\">, \"background\">,\n Omit<UseChartRadialProps<Y>, \"background\" | \"dataKey\" | \"label\">\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: keyof Y\n /**\n * The background to use for the radial chart.\n */\n background?: ChartRadialBackground\n /**\n * The label to use for the radial.\n *\n * @default false\n */\n label?: ChartLabelListType\n /**\n * If `true`, the label list is visible.\n *\n * @default false\n */\n labelList?: ChartPieLabelList\n /**\n * Props for the sector component.\n */\n sectorProps?:\n | ((props: RadialBarSectorProps) => ChartSectorProps)\n | ChartSectorProps\n}\n\nexport const ChartRadial = withContext<\"svg\", ChartRadialProps>(\n <Y extends Dict>(props: ChartRadialProps<Y>) => {\n const { radialProps } = useComponentContext()\n const {\n background: backgroundProp = true,\n children,\n dataKey,\n label: labelProp = false,\n labelList = false,\n nameKey,\n sectorProps,\n ...rest\n } = mergeProps(radialProps, props)()\n const system = useSystem()\n const { theme } = useTheme()\n const { nameKeyRef } = useChartComponentContext()\n const labelProps = useSlotComponentProps({}, \"labelList\")\n const backgroundProps = useSlotComponentProps({}, \"radialBackground\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const shape: UseChartRadialProps<Y>[\"shape\"] = useCallback(\n (props) => {\n const color = rest.fill ?? rest.color\n\n return (\n <ChartSector\n color={color}\n {...mergeProps(props, runIfFn(sectorProps, props))()}\n />\n )\n },\n [rest.fill, rest.color, sectorProps],\n )\n const label = useMemo<UseChartRadialProps<Y>[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<\n LabelListProps,\n CSSObject\n >(labelProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [labelProp, labelProps.className, labelProps.css, css])\n const background = useMemo<UseChartRadialProps<Y>[\"background\"]>(() => {\n if (!backgroundProp) return backgroundProp\n\n const className = cx(backgroundProps.className, css(backgroundProps.css))\n\n if (isFunction(backgroundProp)) {\n return (props) =>\n backgroundProp({\n ...props,\n className: cx(className, props.className),\n })\n } else if (isValidElement(backgroundProp)) {\n return cloneElement<any>(backgroundProp, { className })\n } else if (isObject(backgroundProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"path\">,\n CSSObject\n >(backgroundProp, shouldForwardProp)\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [backgroundProp, backgroundProps.className, backgroundProps.css, css])\n const { getRadialProps, getRootProps } = useChartRadial({\n background,\n dataKey: dataKey as DataKey<any>,\n label,\n nameKey,\n shape,\n ...rest,\n })\n\n assignRef(nameKeyRef, nameKey)\n\n return (\n <styled.svg asChild {...getRootProps()}>\n <RadialBar {...getRadialProps()}>\n {children}\n\n {labelList ? (\n <ChartLabelList\n dataKey={nameKey as DataKey<any>}\n offset={4}\n position=\"insideStart\"\n {...(isObject(labelList) ? labelList : {})}\n />\n ) : null}\n </RadialBar>\n </styled.svg>\n )\n },\n \"radial\",\n)() as GenericsComponent<{\n <Y extends Dict>(props: ChartRadialProps<Y>): ReactElement\n}>\n"],"mappings":";;;;;;;;;;;;;;;;;AAoGA,MAAM,oBAAoB,wBAAwB;AAmOlD,MAAM,EACJ,WACA,kBACA,cAAc,wBACd,qBACA,iBAAiB,2BACjB,aACA,cACA,0BACE,oBACF,eACA,eACF;AAIA,MAAa,aAAa,cACP,EACf,YAAY,gBACZ,SACA,QACA,gBAAgB,OAChB,WAAW,OACX,iBAAiB,OACjB,gBACA,YACA,YACA,WACA,WAAW,YACX,YACA,aACA,iBACA,aACA,GAAG,WACqB;CACxB,MAAM,EAAE,eAAe,iBAAiB,cAAc,IAAI;CAC1D,MAAM,aAAa,cACX;EACJ;GACE,WAAW;GACX,UAAU,WAAW,oBAAC,gBAAD,CAAiB,CAAA,IAAI;EAC5C;EACA;GACE,W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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-group.js","names":[],"sources":["../../../../src/components/checkbox/checkbox-group.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type {\n GenericsComponent,\n ThemeProps,\n WithoutThemeProps,\n} from \"../../core\"\nimport type { GroupProps } from \"../group\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { CheckboxProps } from \"./checkbox\"\nimport type { CheckboxStyle } from \"./checkbox.style\"\nimport type { UseCheckboxGroupProps } from \"./use-checkbox-group\"\nimport { useMemo } from \"react\"\nimport { Group } from \"../group\"\nimport {\n Checkbox,\n CheckboxPropsContext,\n component,\n useRootComponentProps,\n} from \"./checkbox\"\nimport { CheckboxGroupContext, useCheckboxGroup } from \"./use-checkbox-group\"\n\nexport interface CheckboxGroupItem<\n Y extends string = string,\n> extends CheckboxProps<Y> {\n label: ReactNode\n}\n\nexport interface CheckboxGroupRootProps<Y extends string = string>\n extends\n Omit<\n WithoutThemeProps<GroupProps, CheckboxStyle>,\n \"defaultValue\" | \"onChange\" | \"value\"\n >,\n ThemeProps<CheckboxStyle>,\n UseCheckboxGroupProps<Y>,\n UseInputBorderProps,\n Pick<CheckboxProps, \"checkedIcon\"> {\n /**\n * If provided, generate options based on items.\n *\n * @default []\n */\n items?: CheckboxGroupItem<Y>[]\n}\n\n/**\n * `CheckboxGroup` is a component that groups `Checkbox` components.\n *\n * @see https://yamada-ui.com/docs/components/checkbox\n */\nexport const CheckboxGroupRoot = component<\"div\", CheckboxGroupRootProps>(\n (props) => {\n const [\n ,\n {\n colorScheme,\n size,\n variant,\n checkedIcon,\n children,\n disabled,\n errorBorderColor,\n focusBorderColor,\n invalid,\n items = [],\n readOnly,\n shape,\n ...rest\n },\n ] = useRootComponentProps(props, \"group\", {\n transferProps: [\"variant\", \"colorScheme\", \"size\", \"shape\"],\n })\n const { max, value, getInputProps, getLabelProps, getRootProps, onChange } =\n useCheckboxGroup(rest)\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return items.map(({ label, value, ...rest }, index) => (\n <Checkbox key={value ?? index} value={value} {...rest}>\n {label}\n </Checkbox>\n ))\n }, [items, children])\n const context = useMemo(\n () => ({\n colorScheme,\n size,\n variant,\n checkedIcon,\n disabled,\n errorBorderColor,\n focusBorderColor,\n invalid,\n readOnly,\n shape,\n }),\n [\n variant,\n size,\n colorScheme,\n shape,\n disabled,\n invalid,\n readOnly,\n errorBorderColor,\n focusBorderColor,\n checkedIcon,\n ],\n )\n const groupContext = useMemo(\n () => ({ max, value, getInputProps, getLabelProps, onChange }),\n [max, value, getInputProps, getLabelProps, onChange],\n )\n\n return (\n <CheckboxPropsContext value={context}>\n <CheckboxGroupContext value={groupContext}>\n <Group orientation=\"vertical\" {...getRootProps()}>\n {computedChildren}\n </Group>\n </CheckboxGroupContext>\n </CheckboxPropsContext>\n )\n },\n \"group\",\n)() as GenericsComponent<{\n <Y extends string = string>(props: CheckboxGroupRootProps<Y>): ReactElement\n}>\n\nexport { Checkbox as CheckboxGroupItem }\n"],"mappings":";;;;;;;;;;;;AAoDA,MAAa,oBAAoB,WAC9B,UAAU;CACT,MAAM,GAEJ,EACE,aACA,MACA,SACA,aACA,UACA,UACA,kBACA,kBACA,SACA,QAAQ,CAAC,GACT,UACA,OACA,GAAG,UAEH,sBAAsB,OAAO,SAAS,EACxC,eAAe;EAAC;EAAW;EAAe;EAAQ;CAAO,EAC3D,CAAC;CACD,MAAM,EAAE,KAAK,OAAO,eAAe,eAAe,cAAc,aAC9D,iBAAiB,IAAI;CACvB,MAAM,mBAAmB,cAAc;EACrC,IAAI,UAAU,OAAO;EAErB,OAAO,MAAM,KAAK,EAAE,OAAO,OAAO,GAAG,QAAQ,UAC3C,oBAAC,UAAD;GAAsC;GAAO,GAAI;
|
|
1
|
+
{"version":3,"file":"checkbox-group.js","names":[],"sources":["../../../../src/components/checkbox/checkbox-group.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type {\n GenericsComponent,\n ThemeProps,\n WithoutThemeProps,\n} from \"../../core\"\nimport type { GroupProps } from \"../group\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { CheckboxProps } from \"./checkbox\"\nimport type { CheckboxStyle } from \"./checkbox.style\"\nimport type { UseCheckboxGroupProps } from \"./use-checkbox-group\"\nimport { useMemo } from \"react\"\nimport { Group } from \"../group\"\nimport {\n Checkbox,\n CheckboxPropsContext,\n component,\n useRootComponentProps,\n} from \"./checkbox\"\nimport { CheckboxGroupContext, useCheckboxGroup } from \"./use-checkbox-group\"\n\nexport interface CheckboxGroupItem<\n Y extends string = string,\n> extends CheckboxProps<Y> {\n label: ReactNode\n}\n\nexport interface CheckboxGroupRootProps<Y extends string = string>\n extends\n Omit<\n WithoutThemeProps<GroupProps, CheckboxStyle>,\n \"defaultValue\" | \"onChange\" | \"value\"\n >,\n ThemeProps<CheckboxStyle>,\n UseCheckboxGroupProps<Y>,\n UseInputBorderProps,\n Pick<CheckboxProps, \"checkedIcon\"> {\n /**\n * If provided, generate options based on items.\n *\n * @default []\n */\n items?: CheckboxGroupItem<Y>[]\n}\n\n/**\n * `CheckboxGroup` is a component that groups `Checkbox` components.\n *\n * @see https://yamada-ui.com/docs/components/checkbox\n */\nexport const CheckboxGroupRoot = component<\"div\", CheckboxGroupRootProps>(\n (props) => {\n const [\n ,\n {\n colorScheme,\n size,\n variant,\n checkedIcon,\n children,\n disabled,\n errorBorderColor,\n focusBorderColor,\n invalid,\n items = [],\n readOnly,\n shape,\n ...rest\n },\n ] = useRootComponentProps(props, \"group\", {\n transferProps: [\"variant\", \"colorScheme\", \"size\", \"shape\"],\n })\n const { max, value, getInputProps, getLabelProps, getRootProps, onChange } =\n useCheckboxGroup(rest)\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return items.map(({ label, value, ...rest }, index) => (\n <Checkbox key={value ?? index} value={value} {...rest}>\n {label}\n </Checkbox>\n ))\n }, [items, children])\n const context = useMemo(\n () => ({\n colorScheme,\n size,\n variant,\n checkedIcon,\n disabled,\n errorBorderColor,\n focusBorderColor,\n invalid,\n readOnly,\n shape,\n }),\n [\n variant,\n size,\n colorScheme,\n shape,\n disabled,\n invalid,\n readOnly,\n errorBorderColor,\n focusBorderColor,\n checkedIcon,\n ],\n )\n const groupContext = useMemo(\n () => ({ max, value, getInputProps, getLabelProps, onChange }),\n [max, value, getInputProps, getLabelProps, onChange],\n )\n\n return (\n <CheckboxPropsContext value={context}>\n <CheckboxGroupContext value={groupContext}>\n <Group orientation=\"vertical\" {...getRootProps()}>\n {computedChildren}\n </Group>\n </CheckboxGroupContext>\n </CheckboxPropsContext>\n )\n },\n \"group\",\n)() as GenericsComponent<{\n <Y extends string = string>(props: CheckboxGroupRootProps<Y>): ReactElement\n}>\n\nexport { Checkbox as CheckboxGroupItem }\n"],"mappings":";;;;;;;;;;;;AAoDA,MAAa,oBAAoB,WAC9B,UAAU;CACT,MAAM,GAEJ,EACE,aACA,MACA,SACA,aACA,UACA,UACA,kBACA,kBACA,SACA,QAAQ,CAAC,GACT,UACA,OACA,GAAG,UAEH,sBAAsB,OAAO,SAAS,EACxC,eAAe;EAAC;EAAW;EAAe;EAAQ;CAAO,EAC3D,CAAC;CACD,MAAM,EAAE,KAAK,OAAO,eAAe,eAAe,cAAc,aAC9D,iBAAiB,IAAI;CACvB,MAAM,mBAAmB,cAAc;EACrC,IAAI,UAAU,OAAO;EAErB,OAAO,MAAM,KAAK,EAAE,OAAO,OAAO,GAAG,QAAQ,UAC3C,oBAAC,UAAD;GAAsC;GAAO,GAAI;GAC9C,UAAA;EACO,GAFK,SAAS,KAEd,CACX;CACH,GAAG,CAAC,OAAO,QAAQ,CAAC;CAgCpB,OACE,oBAAC,sBAAD;EAAsB,OAhCR,eACP;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,IACA;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAQmC;EACjC,UAAA,oBAAC,sBAAD;GAAsB,OAPL,eACZ;IAAE;IAAK;IAAO;IAAe;IAAe;GAAS,IAC5D;IAAC;IAAK;IAAO;IAAe;IAAe;GAAQ,CAKT;GACtC,UAAA,oBAAC,OAAD;IAAO,aAAY;IAAW,GAAI,aAAa;IAC5C,UAAA;GACI,CAAA;EACa,CAAA;CACF,CAAA;AAE1B,GACA,OACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","names":[],"sources":["../../../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type { GenericsComponent, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { Merge } from \"../../utils\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { CheckboxStyle } from \"./checkbox.style\"\nimport type { UseCheckboxProps } from \"./use-checkbox\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { CheckIcon, MinusIcon } from \"../icon\"\nimport { useInputBorder } from \"../input\"\nimport { checkboxStyle } from \"./checkbox.style\"\nimport { useCheckbox } from \"./use-checkbox\"\n\nexport interface CheckboxProps<Y extends string = string>\n extends\n Merge<HTMLStyledProps<\"label\">, UseCheckboxProps<Y>>,\n ThemeProps<CheckboxStyle>,\n UseInputBorderProps {\n /**\n * The icon to display in the checkbox when it is checked.\n */\n checkedIcon?: ReactNode\n /**\n * The icon to display in the checkbox when it is indeterminate.\n */\n indeterminateIcon?: ReactNode\n /**\n * Props for the indicator component.\n */\n indicatorProps?: CheckboxIndicatorProps\n /**\n * Props for the input element.\n */\n inputProps?: HTMLStyledProps<\"input\">\n /**\n * Props for the label component.\n */\n labelProps?: CheckboxLabelProps\n /**\n * Props for the label element.\n */\n rootProps?: HTMLStyledProps<\"label\">\n}\n\nconst {\n component,\n PropsContext: CheckboxPropsContext,\n usePropsContext: useCheckboxPropsContext,\n withContext,\n withProvider,\n useRootComponentProps,\n} = createSlotComponent<CheckboxProps, CheckboxStyle>(\"checkbox\", checkboxStyle)\n\nexport {\n CheckboxPropsContext,\n component,\n useCheckboxPropsContext,\n useRootComponentProps,\n}\n\n/**\n * `Checkbox` is a component used for allowing users to select multiple values from multiple options.\n *\n * @see https://yamada-ui.com/docs/components/checkbox\n */\nexport const Checkbox = withProvider<\"label\", CheckboxProps>(\n ({\n checkedIcon,\n children,\n errorBorderColor,\n focusBorderColor,\n indeterminateIcon,\n indicatorProps,\n inputProps,\n labelProps,\n rootProps,\n ...rest\n }) => {\n const {\n checked,\n indeterminate,\n getIndicatorProps,\n getInputProps,\n getRootProps,\n } = useCheckbox(rest)\n const varProps = useInputBorder({ errorBorderColor, focusBorderColor })\n const icon = useMemo(() => {\n if (indeterminate) return indeterminateIcon || <MinusIcon />\n else if (checked) return checkedIcon || <CheckIcon />\n else return null\n }, [indeterminate, indeterminateIcon, checked, checkedIcon])\n const input = useMemo(() => {\n return <styled.input {...getInputProps(inputProps)} />\n }, [getInputProps, inputProps])\n const indicator = useMemo(() => {\n return (\n <CheckboxIndicator {...getIndicatorProps(indicatorProps)}>\n {icon}\n </CheckboxIndicator>\n )\n }, [getIndicatorProps, indicatorProps, icon])\n\n return (\n <styled.label {...getRootProps({ ...varProps, ...rootProps })}>\n {input}\n {indicator}\n {children ? (\n <CheckboxLabel {...labelProps}>{children}</CheckboxLabel>\n ) : null}\n </styled.label>\n )\n },\n \"root\",\n)() as GenericsComponent<{\n <Y extends string = string>(props: CheckboxProps<Y>): ReactElement\n}>\n\ninterface CheckboxIndicatorProps extends HTMLStyledProps {}\n\nconst CheckboxIndicator = withContext<\"div\", CheckboxIndicatorProps>(\n \"div\",\n \"indicator\",\n)({ \"data-indicator\": \"\" })\n\ninterface CheckboxLabelProps extends HTMLStyledProps<\"span\"> {}\n\nconst CheckboxLabel = withContext<\"span\", CheckboxLabelProps>(\"span\", \"label\")()\n"],"mappings":";;;;;;;;;;;AA8CA,MAAM,EACJ,WACA,cAAc,sBACd,iBAAiB,yBACjB,aACA,cACA,0BACE,oBAAkD,YAAY,aAAa;;;;;;AAc/E,MAAa,WAAW,cACrB,EACC,aACA,UACA,kBACA,kBACA,mBACA,gBACA,YACA,YACA,WACA,GAAG,WACC;CACJ,MAAM,EACJ,SACA,eACA,mBACA,eACA,iBACE,YAAY,IAAI;CACpB,MAAM,WAAW,eAAe;EAAE;EAAkB;CAAiB,CAAC;CACtE,MAAM,OAAO,cAAc;EACzB,IAAI,eAAe,OAAO,qBAAqB,oBAAC,WAAD,CAAY,CAAA;OACtD,IAAI,SAAS,OAAO,eAAe,oBAAC,WAAD,CAAY,CAAA;OAC/C,OAAO;CACd,GAAG;EAAC;EAAe;EAAmB;EAAS;CAAW,CAAC;CAC3D,MAAM,QAAQ,cAAc;EAC1B,OAAO,oBAAC,OAAO,OAAR,EAAc,GAAI,cAAc,UAAU,EAAI,CAAA;CACvD,GAAG,CAAC,eAAe,UAAU,CAAC;CAC9B,MAAM,YAAY,cAAc;EAC9B,OACE,oBAAC,mBAAD;GAAmB,GAAI,kBAAkB,cAAc;
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":[],"sources":["../../../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type { GenericsComponent, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { Merge } from \"../../utils\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { CheckboxStyle } from \"./checkbox.style\"\nimport type { UseCheckboxProps } from \"./use-checkbox\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { CheckIcon, MinusIcon } from \"../icon\"\nimport { useInputBorder } from \"../input\"\nimport { checkboxStyle } from \"./checkbox.style\"\nimport { useCheckbox } from \"./use-checkbox\"\n\nexport interface CheckboxProps<Y extends string = string>\n extends\n Merge<HTMLStyledProps<\"label\">, UseCheckboxProps<Y>>,\n ThemeProps<CheckboxStyle>,\n UseInputBorderProps {\n /**\n * The icon to display in the checkbox when it is checked.\n */\n checkedIcon?: ReactNode\n /**\n * The icon to display in the checkbox when it is indeterminate.\n */\n indeterminateIcon?: ReactNode\n /**\n * Props for the indicator component.\n */\n indicatorProps?: CheckboxIndicatorProps\n /**\n * Props for the input element.\n */\n inputProps?: HTMLStyledProps<\"input\">\n /**\n * Props for the label component.\n */\n labelProps?: CheckboxLabelProps\n /**\n * Props for the label element.\n */\n rootProps?: HTMLStyledProps<\"label\">\n}\n\nconst {\n component,\n PropsContext: CheckboxPropsContext,\n usePropsContext: useCheckboxPropsContext,\n withContext,\n withProvider,\n useRootComponentProps,\n} = createSlotComponent<CheckboxProps, CheckboxStyle>(\"checkbox\", checkboxStyle)\n\nexport {\n CheckboxPropsContext,\n component,\n useCheckboxPropsContext,\n useRootComponentProps,\n}\n\n/**\n * `Checkbox` is a component used for allowing users to select multiple values from multiple options.\n *\n * @see https://yamada-ui.com/docs/components/checkbox\n */\nexport const Checkbox = withProvider<\"label\", CheckboxProps>(\n ({\n checkedIcon,\n children,\n errorBorderColor,\n focusBorderColor,\n indeterminateIcon,\n indicatorProps,\n inputProps,\n labelProps,\n rootProps,\n ...rest\n }) => {\n const {\n checked,\n indeterminate,\n getIndicatorProps,\n getInputProps,\n getRootProps,\n } = useCheckbox(rest)\n const varProps = useInputBorder({ errorBorderColor, focusBorderColor })\n const icon = useMemo(() => {\n if (indeterminate) return indeterminateIcon || <MinusIcon />\n else if (checked) return checkedIcon || <CheckIcon />\n else return null\n }, [indeterminate, indeterminateIcon, checked, checkedIcon])\n const input = useMemo(() => {\n return <styled.input {...getInputProps(inputProps)} />\n }, [getInputProps, inputProps])\n const indicator = useMemo(() => {\n return (\n <CheckboxIndicator {...getIndicatorProps(indicatorProps)}>\n {icon}\n </CheckboxIndicator>\n )\n }, [getIndicatorProps, indicatorProps, icon])\n\n return (\n <styled.label {...getRootProps({ ...varProps, ...rootProps })}>\n {input}\n {indicator}\n {children ? (\n <CheckboxLabel {...labelProps}>{children}</CheckboxLabel>\n ) : null}\n </styled.label>\n )\n },\n \"root\",\n)() as GenericsComponent<{\n <Y extends string = string>(props: CheckboxProps<Y>): ReactElement\n}>\n\ninterface CheckboxIndicatorProps extends HTMLStyledProps {}\n\nconst CheckboxIndicator = withContext<\"div\", CheckboxIndicatorProps>(\n \"div\",\n \"indicator\",\n)({ \"data-indicator\": \"\" })\n\ninterface CheckboxLabelProps extends HTMLStyledProps<\"span\"> {}\n\nconst CheckboxLabel = withContext<\"span\", CheckboxLabelProps>(\"span\", \"label\")()\n"],"mappings":";;;;;;;;;;;AA8CA,MAAM,EACJ,WACA,cAAc,sBACd,iBAAiB,yBACjB,aACA,cACA,0BACE,oBAAkD,YAAY,aAAa;;;;;;AAc/E,MAAa,WAAW,cACrB,EACC,aACA,UACA,kBACA,kBACA,mBACA,gBACA,YACA,YACA,WACA,GAAG,WACC;CACJ,MAAM,EACJ,SACA,eACA,mBACA,eACA,iBACE,YAAY,IAAI;CACpB,MAAM,WAAW,eAAe;EAAE;EAAkB;CAAiB,CAAC;CACtE,MAAM,OAAO,cAAc;EACzB,IAAI,eAAe,OAAO,qBAAqB,oBAAC,WAAD,CAAY,CAAA;OACtD,IAAI,SAAS,OAAO,eAAe,oBAAC,WAAD,CAAY,CAAA;OAC/C,OAAO;CACd,GAAG;EAAC;EAAe;EAAmB;EAAS;CAAW,CAAC;CAC3D,MAAM,QAAQ,cAAc;EAC1B,OAAO,oBAAC,OAAO,OAAR,EAAc,GAAI,cAAc,UAAU,EAAI,CAAA;CACvD,GAAG,CAAC,eAAe,UAAU,CAAC;CAC9B,MAAM,YAAY,cAAc;EAC9B,OACE,oBAAC,mBAAD;GAAmB,GAAI,kBAAkB,cAAc;GACpD,UAAA;EACgB,CAAA;CAEvB,GAAG;EAAC;EAAmB;EAAgB;CAAI,CAAC;CAE5C,OACE,qBAAC,OAAO,OAAR;EAAc,GAAI,aAAa;GAAE,GAAG;GAAU,GAAG;EAAU,CAAC;EAA5D,UAAA;GACG;GACA;GACA,WACC,oBAAC,eAAD;IAAe,GAAI;IAAa;GAAwB,CAAA,IACtD;EACQ;;AAElB,GACA,MACF,CAAC,CAAC;AAMF,MAAM,oBAAoB,YACxB,OACA,WACF,CAAC,CAAC,EAAE,kBAAkB,GAAG,CAAC;AAI1B,MAAM,gBAAgB,YAAwC,QAAQ,OAAO,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-card-group.js","names":[],"sources":["../../../../src/components/checkbox-card/checkbox-card-group.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type {\n GenericsComponent,\n ThemeProps,\n WithoutThemeProps,\n} from \"../../core\"\nimport type { UseCheckboxGroupProps } from \"../checkbox\"\nimport type { GroupProps } from \"../group\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { CheckboxCardRootProps } from \"./checkbox-card\"\nimport type { CheckboxCardStyle } from \"./checkbox-card.style\"\nimport { useMemo } from \"react\"\nimport { CheckboxGroupContext, useCheckboxGroup } from \"../checkbox\"\nimport { Group } from \"../group\"\nimport {\n CheckboxCardPropsContext,\n CheckboxCardRoot,\n component,\n useRootComponentProps,\n} from \"./checkbox-card\"\n\nexport interface CheckboxCardGroupItem<\n Y extends string = string,\n> extends CheckboxCardRootProps<Y> {}\n\nexport interface CheckboxCardGroupRootProps<Y extends string = string>\n extends\n Omit<\n WithoutThemeProps<GroupProps, CheckboxCardStyle>,\n \"defaultValue\" | \"onChange\" | \"value\"\n >,\n ThemeProps<CheckboxCardStyle>,\n UseCheckboxGroupProps<Y>,\n UseInputBorderProps,\n Pick<CheckboxCardRootProps, \"checkedIcon\" | \"withIndicator\"> {\n /**\n * If provided, generate options based on items.\n *\n * @default []\n */\n items?: CheckboxCardGroupItem<Y>[]\n}\n\n/**\n * `CheckboxCardGroup` is a component that groups `CheckboxCard` components.\n *\n * @see https://yamada-ui.com/docs/components/checkbox-card\n */\nexport const CheckboxCardGroupRoot = component<\n \"div\",\n CheckboxCardGroupRootProps\n>((props) => {\n const [\n ,\n {\n colorScheme,\n size,\n variant,\n checkedIcon,\n children,\n disabled,\n errorBorderColor,\n focusBorderColor,\n invalid,\n items = [],\n justify,\n readOnly,\n shape,\n withIndicator,\n ...rest\n },\n ] = useRootComponentProps(props, \"group\", {\n transferProps: [\n \"variant\",\n \"colorScheme\",\n \"size\",\n \"shape\",\n \"justify\",\n \"withIndicator\",\n ],\n })\n const { max, value, getInputProps, getLabelProps, getRootProps, onChange } =\n useCheckboxGroup(rest)\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return items.map(({ value, ...rest }, index) => (\n <CheckboxCardRoot key={value ?? index} value={value} {...rest} />\n ))\n }, [items, children])\n const context = useMemo(\n () => ({\n colorScheme,\n size,\n variant,\n checkedIcon,\n disabled,\n errorBorderColor,\n focusBorderColor,\n invalid,\n justify,\n readOnly,\n shape,\n withIndicator,\n }),\n [\n colorScheme,\n size,\n checkedIcon,\n variant,\n disabled,\n justify,\n withIndicator,\n errorBorderColor,\n focusBorderColor,\n invalid,\n readOnly,\n shape,\n ],\n )\n const groupContext = useMemo(\n () => ({ max, value, getInputProps, getLabelProps, onChange }),\n [max, value, getInputProps, getLabelProps, onChange],\n )\n\n return (\n <CheckboxCardPropsContext value={context}>\n <CheckboxGroupContext value={groupContext}>\n <Group {...getRootProps()}>{computedChildren}</Group>\n </CheckboxGroupContext>\n </CheckboxCardPropsContext>\n )\n}, \"group\")() as GenericsComponent<{\n <Y extends string = string>(\n props: CheckboxCardGroupRootProps<Y>,\n ): ReactElement\n}>\n\nexport { CheckboxCardRoot as CheckboxCardGroupItem }\n"],"mappings":";;;;;;;;;;;;AAkDA,MAAa,wBAAwB,WAGlC,UAAU;CACX,MAAM,GAEJ,EACE,aACA,MACA,SACA,aACA,UACA,UACA,kBACA,kBACA,SACA,QAAQ,CAAC,GACT,SACA,UACA,OACA,eACA,GAAG,UAEH,sBAAsB,OAAO,SAAS,EACxC,eAAe;EACb;EACA;EACA;EACA;EACA;EACA;CACF,EACF,CAAC;CACD,MAAM,EAAE,KAAK,OAAO,eAAe,eAAe,cAAc,aAC9D,iBAAiB,IAAI;CACvB,MAAM,mBAAmB,cAAc;EACrC,IAAI,UAAU,OAAO;EAErB,OAAO,MAAM,KAAK,EAAE,OAAO,GAAG,QAAQ,UACpC,oBAAC,kBAAD;GAA8C;GAAO,GAAI;EAAO,GAAzC,SAAS,KAAgC,CACjE;CACH,GAAG,CAAC,OAAO,QAAQ,CAAC;CAoCpB,OACE,oBAAC,0BAAD;EAA0B,OApCZ,eACP;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,IACA;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAQuC;
|
|
1
|
+
{"version":3,"file":"checkbox-card-group.js","names":[],"sources":["../../../../src/components/checkbox-card/checkbox-card-group.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type {\n GenericsComponent,\n ThemeProps,\n WithoutThemeProps,\n} from \"../../core\"\nimport type { UseCheckboxGroupProps } from \"../checkbox\"\nimport type { GroupProps } from \"../group\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { CheckboxCardRootProps } from \"./checkbox-card\"\nimport type { CheckboxCardStyle } from \"./checkbox-card.style\"\nimport { useMemo } from \"react\"\nimport { CheckboxGroupContext, useCheckboxGroup } from \"../checkbox\"\nimport { Group } from \"../group\"\nimport {\n CheckboxCardPropsContext,\n CheckboxCardRoot,\n component,\n useRootComponentProps,\n} from \"./checkbox-card\"\n\nexport interface CheckboxCardGroupItem<\n Y extends string = string,\n> extends CheckboxCardRootProps<Y> {}\n\nexport interface CheckboxCardGroupRootProps<Y extends string = string>\n extends\n Omit<\n WithoutThemeProps<GroupProps, CheckboxCardStyle>,\n \"defaultValue\" | \"onChange\" | \"value\"\n >,\n ThemeProps<CheckboxCardStyle>,\n UseCheckboxGroupProps<Y>,\n UseInputBorderProps,\n Pick<CheckboxCardRootProps, \"checkedIcon\" | \"withIndicator\"> {\n /**\n * If provided, generate options based on items.\n *\n * @default []\n */\n items?: CheckboxCardGroupItem<Y>[]\n}\n\n/**\n * `CheckboxCardGroup` is a component that groups `CheckboxCard` components.\n *\n * @see https://yamada-ui.com/docs/components/checkbox-card\n */\nexport const CheckboxCardGroupRoot = component<\n \"div\",\n CheckboxCardGroupRootProps\n>((props) => {\n const [\n ,\n {\n colorScheme,\n size,\n variant,\n checkedIcon,\n children,\n disabled,\n errorBorderColor,\n focusBorderColor,\n invalid,\n items = [],\n justify,\n readOnly,\n shape,\n withIndicator,\n ...rest\n },\n ] = useRootComponentProps(props, \"group\", {\n transferProps: [\n \"variant\",\n \"colorScheme\",\n \"size\",\n \"shape\",\n \"justify\",\n \"withIndicator\",\n ],\n })\n const { max, value, getInputProps, getLabelProps, getRootProps, onChange } =\n useCheckboxGroup(rest)\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return items.map(({ value, ...rest }, index) => (\n <CheckboxCardRoot key={value ?? index} value={value} {...rest} />\n ))\n }, [items, children])\n const context = useMemo(\n () => ({\n colorScheme,\n size,\n variant,\n checkedIcon,\n disabled,\n errorBorderColor,\n focusBorderColor,\n invalid,\n justify,\n readOnly,\n shape,\n withIndicator,\n }),\n [\n colorScheme,\n size,\n checkedIcon,\n variant,\n disabled,\n justify,\n withIndicator,\n errorBorderColor,\n focusBorderColor,\n invalid,\n readOnly,\n shape,\n ],\n )\n const groupContext = useMemo(\n () => ({ max, value, getInputProps, getLabelProps, onChange }),\n [max, value, getInputProps, getLabelProps, onChange],\n )\n\n return (\n <CheckboxCardPropsContext value={context}>\n <CheckboxGroupContext value={groupContext}>\n <Group {...getRootProps()}>{computedChildren}</Group>\n </CheckboxGroupContext>\n </CheckboxCardPropsContext>\n )\n}, \"group\")() as GenericsComponent<{\n <Y extends string = string>(\n props: CheckboxCardGroupRootProps<Y>,\n ): ReactElement\n}>\n\nexport { CheckboxCardRoot as CheckboxCardGroupItem }\n"],"mappings":";;;;;;;;;;;;AAkDA,MAAa,wBAAwB,WAGlC,UAAU;CACX,MAAM,GAEJ,EACE,aACA,MACA,SACA,aACA,UACA,UACA,kBACA,kBACA,SACA,QAAQ,CAAC,GACT,SACA,UACA,OACA,eACA,GAAG,UAEH,sBAAsB,OAAO,SAAS,EACxC,eAAe;EACb;EACA;EACA;EACA;EACA;EACA;CACF,EACF,CAAC;CACD,MAAM,EAAE,KAAK,OAAO,eAAe,eAAe,cAAc,aAC9D,iBAAiB,IAAI;CACvB,MAAM,mBAAmB,cAAc;EACrC,IAAI,UAAU,OAAO;EAErB,OAAO,MAAM,KAAK,EAAE,OAAO,GAAG,QAAQ,UACpC,oBAAC,kBAAD;GAA8C;GAAO,GAAI;EAAO,GAAzC,SAAS,KAAgC,CACjE;CACH,GAAG,CAAC,OAAO,QAAQ,CAAC;CAoCpB,OACE,oBAAC,0BAAD;EAA0B,OApCZ,eACP;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,IACA;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAQuC;EACrC,UAAA,oBAAC,sBAAD;GAAsB,OAPL,eACZ;IAAE;IAAK;IAAO;IAAe;IAAe;GAAS,IAC5D;IAAC;IAAK;IAAO;IAAe;IAAe;GAAQ,CAKT;GACtC,UAAA,oBAAC,OAAD;IAAO,GAAI,aAAa;IAAI,UAAA;GAAwB,CAAA;EAChC,CAAA;CACE,CAAA;AAE9B,GAAG,OAAO,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-card.js","names":[],"sources":["../../../../src/components/checkbox-card/checkbox-card.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type { GenericsComponent, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { Merge } from \"../../utils\"\nimport type { UseCheckboxProps } from \"../checkbox\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { CheckboxCardStyle } from \"./checkbox-card.style\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { useCheckbox } from \"../checkbox\"\nimport { CheckIcon, MinusIcon } from \"../icon\"\nimport { useInputBorder } from \"../input\"\nimport { checkboxCardStyle } from \"./checkbox-card.style\"\n\nexport interface CheckboxCardRootProps<Y extends string = string>\n extends\n Merge<HTMLStyledProps<\"label\">, UseCheckboxProps<Y>>,\n ThemeProps<CheckboxCardStyle>,\n UseInputBorderProps {\n /**\n * The addon of the checkbox card.\n */\n addon?: ReactNode\n /**\n * The icon to display in the checkbox when it is checked.\n */\n checkedIcon?: ReactNode\n /**\n * The description of the checkbox card.\n */\n description?: ReactNode\n /**\n * The icon to display in the checkbox when it is indeterminate.\n */\n indeterminateIcon?: ReactNode\n /**\n * The label of the checkbox card.\n */\n label?: ReactNode\n /**\n * If `true`, the indicator will be displayed.\n *\n * @default true\n */\n withIndicator?: boolean\n /**\n * Props for the addon component.\n */\n addonProps?: CheckboxCardAddonProps\n /**\n * Props for the description component.\n */\n descriptionProps?: CheckboxCardDescriptionProps\n /**\n * Props for the indicator component.\n */\n indicatorProps?: CheckboxCardIndicatorProps\n /**\n * Props for the input element.\n */\n inputProps?: HTMLStyledProps<\"input\">\n /**\n * Props for the label component.\n */\n labelProps?: CheckboxCardLabelProps\n /**\n * Props for the label element.\n */\n rootProps?: HTMLStyledProps<\"label\">\n}\n\nconst {\n component,\n PropsContext: CheckboxCardPropsContext,\n usePropsContext: useCheckboxCardPropsContext,\n withContext,\n withProvider,\n useRootComponentProps,\n} = createSlotComponent<CheckboxCardRootProps, CheckboxCardStyle>(\n \"checkbox-card\",\n checkboxCardStyle,\n)\n\nexport {\n CheckboxCardPropsContext,\n component,\n useCheckboxCardPropsContext,\n useRootComponentProps,\n}\n\n/**\n * `CheckboxCard` is a component used for allowing users to select multiple values from multiple options.\n *\n * @see https://yamada-ui.com/docs/components/checkbox-card\n */\nexport const CheckboxCardRoot = withProvider<\"label\", CheckboxCardRootProps>(\n ({\n addon,\n checkedIcon,\n children,\n description,\n errorBorderColor,\n focusBorderColor,\n indeterminateIcon,\n label,\n withIndicator = true,\n addonProps,\n descriptionProps,\n indicatorProps,\n inputProps,\n labelProps,\n rootProps,\n ...rest\n }) => {\n const {\n checked,\n indeterminate,\n getIndicatorProps,\n getInputProps,\n getRootProps,\n } = useCheckbox(rest)\n const varProps = useInputBorder({ errorBorderColor, focusBorderColor })\n const icon = useMemo(() => {\n if (indeterminate) return indeterminateIcon || <MinusIcon />\n else if (checked) return checkedIcon || <CheckIcon />\n else return null\n }, [indeterminate, indeterminateIcon, checked, checkedIcon])\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (\n <>\n {label ? (\n <CheckboxCardLabel {...labelProps}>{label}</CheckboxCardLabel>\n ) : null}\n {description ? (\n <CheckboxCardDescription {...descriptionProps}>\n {description}\n </CheckboxCardDescription>\n ) : null}\n {addon ? (\n <CheckboxCardAddon {...addonProps}>{addon}</CheckboxCardAddon>\n ) : null}\n </>\n )\n }, [\n addon,\n addonProps,\n children,\n description,\n descriptionProps,\n label,\n labelProps,\n ])\n\n return (\n <styled.label {...getRootProps({ ...varProps, ...rootProps })}>\n <styled.input {...getInputProps(inputProps)} />\n {withIndicator ? (\n <CheckboxCardIndicator {...getIndicatorProps(indicatorProps)}>\n {icon}\n </CheckboxCardIndicator>\n ) : null}\n\n {computedChildren}\n </styled.label>\n )\n },\n \"root\",\n)() as GenericsComponent<{\n <Y extends string = string>(props: CheckboxCardRootProps<Y>): ReactElement\n}>\n\ninterface CheckboxCardIndicatorProps extends HTMLStyledProps {}\n\nconst CheckboxCardIndicator = withContext<\"div\", CheckboxCardIndicatorProps>(\n \"div\",\n \"indicator\",\n)({ \"data-indicator\": \"\" })\n\nexport interface CheckboxCardLabelProps extends HTMLStyledProps {}\n\nexport const CheckboxCardLabel = withContext<\"span\", CheckboxCardLabelProps>(\n \"span\",\n \"label\",\n)()\n\nexport interface CheckboxCardDescriptionProps extends HTMLStyledProps {}\n\nexport const CheckboxCardDescription = withContext<\n \"span\",\n CheckboxCardDescriptionProps\n>(\"span\", \"description\")()\n\nexport interface CheckboxCardAddonProps extends HTMLStyledProps {}\n\nexport const CheckboxCardAddon = withContext<\"span\", CheckboxCardAddonProps>(\n \"span\",\n \"addon\",\n)()\n"],"mappings":";;;;;;;;;;;AAwEA,MAAM,EACJ,WACA,cAAc,0BACd,iBAAiB,6BACjB,aACA,cACA,0BACE,oBACF,iBACA,iBACF;;;;;;AAcA,MAAa,mBAAmB,cAC7B,EACC,OACA,aACA,UACA,aACA,kBACA,kBACA,mBACA,OACA,gBAAgB,MAChB,YACA,kBACA,gBACA,YACA,YACA,WACA,GAAG,WACC;CACJ,MAAM,EACJ,SACA,eACA,mBACA,eACA,iBACE,YAAY,IAAI;CACpB,MAAM,WAAW,eAAe;EAAE;EAAkB;CAAiB,CAAC;CACtE,MAAM,OAAO,cAAc;EACzB,IAAI,eAAe,OAAO,qBAAqB,oBAAC,WAAD,CAAY,CAAA;OACtD,IAAI,SAAS,OAAO,eAAe,oBAAC,WAAD,CAAY,CAAA;OAC/C,OAAO;CACd,GAAG;EAAC;EAAe;EAAmB;EAAS;CAAW,CAAC;CAC3D,MAAM,mBAAmB,cAAc;EACrC,IAAI,UAAU,OAAO;EAErB,OACE,qBAAA,YAAA,EAAA,UAAA;GACG,QACC,oBAAC,mBAAD;IAAmB,GAAI;
|
|
1
|
+
{"version":3,"file":"checkbox-card.js","names":[],"sources":["../../../../src/components/checkbox-card/checkbox-card.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type { GenericsComponent, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { Merge } from \"../../utils\"\nimport type { UseCheckboxProps } from \"../checkbox\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { CheckboxCardStyle } from \"./checkbox-card.style\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { useCheckbox } from \"../checkbox\"\nimport { CheckIcon, MinusIcon } from \"../icon\"\nimport { useInputBorder } from \"../input\"\nimport { checkboxCardStyle } from \"./checkbox-card.style\"\n\nexport interface CheckboxCardRootProps<Y extends string = string>\n extends\n Merge<HTMLStyledProps<\"label\">, UseCheckboxProps<Y>>,\n ThemeProps<CheckboxCardStyle>,\n UseInputBorderProps {\n /**\n * The addon of the checkbox card.\n */\n addon?: ReactNode\n /**\n * The icon to display in the checkbox when it is checked.\n */\n checkedIcon?: ReactNode\n /**\n * The description of the checkbox card.\n */\n description?: ReactNode\n /**\n * The icon to display in the checkbox when it is indeterminate.\n */\n indeterminateIcon?: ReactNode\n /**\n * The label of the checkbox card.\n */\n label?: ReactNode\n /**\n * If `true`, the indicator will be displayed.\n *\n * @default true\n */\n withIndicator?: boolean\n /**\n * Props for the addon component.\n */\n addonProps?: CheckboxCardAddonProps\n /**\n * Props for the description component.\n */\n descriptionProps?: CheckboxCardDescriptionProps\n /**\n * Props for the indicator component.\n */\n indicatorProps?: CheckboxCardIndicatorProps\n /**\n * Props for the input element.\n */\n inputProps?: HTMLStyledProps<\"input\">\n /**\n * Props for the label component.\n */\n labelProps?: CheckboxCardLabelProps\n /**\n * Props for the label element.\n */\n rootProps?: HTMLStyledProps<\"label\">\n}\n\nconst {\n component,\n PropsContext: CheckboxCardPropsContext,\n usePropsContext: useCheckboxCardPropsContext,\n withContext,\n withProvider,\n useRootComponentProps,\n} = createSlotComponent<CheckboxCardRootProps, CheckboxCardStyle>(\n \"checkbox-card\",\n checkboxCardStyle,\n)\n\nexport {\n CheckboxCardPropsContext,\n component,\n useCheckboxCardPropsContext,\n useRootComponentProps,\n}\n\n/**\n * `CheckboxCard` is a component used for allowing users to select multiple values from multiple options.\n *\n * @see https://yamada-ui.com/docs/components/checkbox-card\n */\nexport const CheckboxCardRoot = withProvider<\"label\", CheckboxCardRootProps>(\n ({\n addon,\n checkedIcon,\n children,\n description,\n errorBorderColor,\n focusBorderColor,\n indeterminateIcon,\n label,\n withIndicator = true,\n addonProps,\n descriptionProps,\n indicatorProps,\n inputProps,\n labelProps,\n rootProps,\n ...rest\n }) => {\n const {\n checked,\n indeterminate,\n getIndicatorProps,\n getInputProps,\n getRootProps,\n } = useCheckbox(rest)\n const varProps = useInputBorder({ errorBorderColor, focusBorderColor })\n const icon = useMemo(() => {\n if (indeterminate) return indeterminateIcon || <MinusIcon />\n else if (checked) return checkedIcon || <CheckIcon />\n else return null\n }, [indeterminate, indeterminateIcon, checked, checkedIcon])\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (\n <>\n {label ? (\n <CheckboxCardLabel {...labelProps}>{label}</CheckboxCardLabel>\n ) : null}\n {description ? (\n <CheckboxCardDescription {...descriptionProps}>\n {description}\n </CheckboxCardDescription>\n ) : null}\n {addon ? (\n <CheckboxCardAddon {...addonProps}>{addon}</CheckboxCardAddon>\n ) : null}\n </>\n )\n }, [\n addon,\n addonProps,\n children,\n description,\n descriptionProps,\n label,\n labelProps,\n ])\n\n return (\n <styled.label {...getRootProps({ ...varProps, ...rootProps })}>\n <styled.input {...getInputProps(inputProps)} />\n {withIndicator ? (\n <CheckboxCardIndicator {...getIndicatorProps(indicatorProps)}>\n {icon}\n </CheckboxCardIndicator>\n ) : null}\n\n {computedChildren}\n </styled.label>\n )\n },\n \"root\",\n)() as GenericsComponent<{\n <Y extends string = string>(props: CheckboxCardRootProps<Y>): ReactElement\n}>\n\ninterface CheckboxCardIndicatorProps extends HTMLStyledProps {}\n\nconst CheckboxCardIndicator = withContext<\"div\", CheckboxCardIndicatorProps>(\n \"div\",\n \"indicator\",\n)({ \"data-indicator\": \"\" })\n\nexport interface CheckboxCardLabelProps extends HTMLStyledProps {}\n\nexport const CheckboxCardLabel = withContext<\"span\", CheckboxCardLabelProps>(\n \"span\",\n \"label\",\n)()\n\nexport interface CheckboxCardDescriptionProps extends HTMLStyledProps {}\n\nexport const CheckboxCardDescription = withContext<\n \"span\",\n CheckboxCardDescriptionProps\n>(\"span\", \"description\")()\n\nexport interface CheckboxCardAddonProps extends HTMLStyledProps {}\n\nexport const CheckboxCardAddon = withContext<\"span\", CheckboxCardAddonProps>(\n \"span\",\n \"addon\",\n)()\n"],"mappings":";;;;;;;;;;;AAwEA,MAAM,EACJ,WACA,cAAc,0BACd,iBAAiB,6BACjB,aACA,cACA,0BACE,oBACF,iBACA,iBACF;;;;;;AAcA,MAAa,mBAAmB,cAC7B,EACC,OACA,aACA,UACA,aACA,kBACA,kBACA,mBACA,OACA,gBAAgB,MAChB,YACA,kBACA,gBACA,YACA,YACA,WACA,GAAG,WACC;CACJ,MAAM,EACJ,SACA,eACA,mBACA,eACA,iBACE,YAAY,IAAI;CACpB,MAAM,WAAW,eAAe;EAAE;EAAkB;CAAiB,CAAC;CACtE,MAAM,OAAO,cAAc;EACzB,IAAI,eAAe,OAAO,qBAAqB,oBAAC,WAAD,CAAY,CAAA;OACtD,IAAI,SAAS,OAAO,eAAe,oBAAC,WAAD,CAAY,CAAA;OAC/C,OAAO;CACd,GAAG;EAAC;EAAe;EAAmB;EAAS;CAAW,CAAC;CAC3D,MAAM,mBAAmB,cAAc;EACrC,IAAI,UAAU,OAAO;EAErB,OACE,qBAAA,YAAA,EAAA,UAAA;GACG,QACC,oBAAC,mBAAD;IAAmB,GAAI;IAAa,UAAA;GAAyB,CAAA,IAC3D;GACH,cACC,oBAAC,yBAAD;IAAyB,GAAI;IAC1B,UAAA;GACsB,CAAA,IACvB;GACH,QACC,oBAAC,mBAAD;IAAmB,GAAI;IAAa,UAAA;GAAyB,CAAA,IAC3D;EACJ,EAAA,CAAA;CAEN,GAAG;EACD;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,OACE,qBAAC,OAAO,OAAR;EAAc,GAAI,aAAa;GAAE,GAAG;GAAU,GAAG;EAAU,CAAC;EAA5D,UAAA;GACE,oBAAC,OAAO,OAAR,EAAc,GAAI,cAAc,UAAU,EAAI,CAAA;GAC7C,gBACC,oBAAC,uBAAD;IAAuB,GAAI,kBAAkB,cAAc;IACxD,UAAA;GACoB,CAAA,IACrB;GAEH;EACW;;AAElB,GACA,MACF,CAAC,CAAC;AAMF,MAAM,wBAAwB,YAC5B,OACA,WACF,CAAC,CAAC,EAAE,kBAAkB,GAAG,CAAC;AAI1B,MAAa,oBAAoB,YAC/B,QACA,OACF,CAAC,CAAC;AAIF,MAAa,0BAA0B,YAGrC,QAAQ,aAAa,CAAC,CAAC;AAIzB,MAAa,oBAAoB,YAC/B,QACA,OACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circle-progress.js","names":[],"sources":["../../../../src/components/circle-progress/circle-progress.tsx"],"sourcesContent":["\"use client\"\n\nimport type { CSSProps, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { UseProgressProps } from \"../progress\"\nimport type { CircleProgressStyle } from \"./circle-progress.style\"\nimport { createSlotComponent, mergeCSS, styled, varAttr } from \"../../core\"\nimport { isNumber } from \"../../utils\"\nimport { useProgress } from \"../progress\"\nimport { circleProgressStyle } from \"./circle-progress.style\"\n\nexport interface CircleProgressRootProps\n extends HTMLStyledProps, UseProgressProps, ThemeProps<CircleProgressStyle> {\n /**\n * The animation duration in seconds.\n */\n duration?: number | string\n /**\n * The color of the progress range.\n */\n rangeColor?: CSSProps[\"color\"]\n /**\n * The thickness of the progress bar.\n */\n thickness?: CSSProps[\"width\"]\n /**\n * The color of the progress track.\n */\n trackColor?: CSSProps[\"color\"]\n /**\n * Props for the progress circle element.\n */\n circleProps?: CircleProgressCircleProps\n /**\n * Props for the progress range element.\n */\n rangeProps?: CircleProgressRangeProps\n /**\n * Props for the progress track element.\n */\n trackProps?: CircleProgressTrackProps\n}\n\nconst {\n PropsContext: CircleProgressPropsContext,\n usePropsContext: useCircleProgressPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<CircleProgressRootProps, CircleProgressStyle>(\n \"circle-progress\",\n circleProgressStyle,\n)\n\nexport { CircleProgressPropsContext, useCircleProgressPropsContext }\n\n/**\n * `CircleProgress` is a component that displays progress in a circular progress bar.\n *\n * @see https://yamada-ui.com/docs/components/circle-progress\n */\nexport const CircleProgressRoot = withProvider<\"div\", CircleProgressRootProps>(\n ({\n css,\n children,\n max,\n min,\n rangeColor,\n trackColor,\n value,\n circleProps,\n rangeProps,\n trackProps,\n ...rest\n }) => {\n const { percent, getRangeProps, getRootProps, getTrackProps } =\n useProgress<\"svg\">({ max, min, value })\n\n return (\n <styled.div css={mergeCSS(css, { \"--percent\": percent })} {...rest}>\n <CircleProgressCircle {...getRootProps(circleProps)}>\n <CircleProgressTrack\n stroke={trackColor}\n {...getTrackProps(trackProps)}\n />\n <CircleProgressRange\n stroke={rangeColor}\n {...getRangeProps(rangeProps)}\n />\n </CircleProgressCircle>\n\n {children}\n </styled.div>\n )\n },\n \"root\",\n)(({ boxSize, duration, thickness, ...rest }) => ({\n \"--duration\": isNumber(duration) ? `${duration}s` : duration,\n \"--size\": varAttr(boxSize, \"sizes\"),\n \"--thickness\": varAttr(thickness, \"sizes\"),\n ...rest,\n}))\n\ninterface CircleProgressCircleProps extends HTMLStyledProps<\"svg\"> {}\n\nconst CircleProgressCircle = withContext<\"svg\", CircleProgressCircleProps>(\n \"svg\",\n \"circle\",\n)()\n\ninterface CircleProgressTrackProps extends HTMLStyledProps<\"circle\"> {}\n\nconst CircleProgressTrack = withContext<\"circle\", CircleProgressTrackProps>(\n \"circle\",\n \"track\",\n)()\n\ninterface CircleProgressRangeProps extends HTMLStyledProps<\"circle\"> {}\n\nconst CircleProgressRange = withContext<\"circle\", CircleProgressRangeProps>(\n \"circle\",\n \"range\",\n)()\n\nexport interface CircleProgressLabelProps extends HTMLStyledProps<\"span\"> {}\n\nexport const CircleProgressLabel = withContext<\n \"span\",\n CircleProgressLabelProps\n>(\"span\", \"label\")()\n"],"mappings":";;;;;;;;;;AA0CA,MAAM,EACJ,cAAc,4BACd,iBAAiB,+BACjB,aACA,iBACE,oBACF,mBACA,mBACF;;;;;;AASA,MAAa,qBAAqB,cAC/B,EACC,KACA,UACA,KACA,KACA,YACA,YACA,OACA,aACA,YACA,YACA,GAAG,WACC;CACJ,MAAM,EAAE,SAAS,eAAe,cAAc,kBAC5C,YAAmB;EAAE;EAAK;EAAK;CAAM,CAAC;CAExC,OACE,qBAAC,OAAO,KAAR;EAAY,KAAK,SAAS,KAAK,EAAE,aAAa,QAAQ,CAAC;EAAG,GAAI;
|
|
1
|
+
{"version":3,"file":"circle-progress.js","names":[],"sources":["../../../../src/components/circle-progress/circle-progress.tsx"],"sourcesContent":["\"use client\"\n\nimport type { CSSProps, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { UseProgressProps } from \"../progress\"\nimport type { CircleProgressStyle } from \"./circle-progress.style\"\nimport { createSlotComponent, mergeCSS, styled, varAttr } from \"../../core\"\nimport { isNumber } from \"../../utils\"\nimport { useProgress } from \"../progress\"\nimport { circleProgressStyle } from \"./circle-progress.style\"\n\nexport interface CircleProgressRootProps\n extends HTMLStyledProps, UseProgressProps, ThemeProps<CircleProgressStyle> {\n /**\n * The animation duration in seconds.\n */\n duration?: number | string\n /**\n * The color of the progress range.\n */\n rangeColor?: CSSProps[\"color\"]\n /**\n * The thickness of the progress bar.\n */\n thickness?: CSSProps[\"width\"]\n /**\n * The color of the progress track.\n */\n trackColor?: CSSProps[\"color\"]\n /**\n * Props for the progress circle element.\n */\n circleProps?: CircleProgressCircleProps\n /**\n * Props for the progress range element.\n */\n rangeProps?: CircleProgressRangeProps\n /**\n * Props for the progress track element.\n */\n trackProps?: CircleProgressTrackProps\n}\n\nconst {\n PropsContext: CircleProgressPropsContext,\n usePropsContext: useCircleProgressPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<CircleProgressRootProps, CircleProgressStyle>(\n \"circle-progress\",\n circleProgressStyle,\n)\n\nexport { CircleProgressPropsContext, useCircleProgressPropsContext }\n\n/**\n * `CircleProgress` is a component that displays progress in a circular progress bar.\n *\n * @see https://yamada-ui.com/docs/components/circle-progress\n */\nexport const CircleProgressRoot = withProvider<\"div\", CircleProgressRootProps>(\n ({\n css,\n children,\n max,\n min,\n rangeColor,\n trackColor,\n value,\n circleProps,\n rangeProps,\n trackProps,\n ...rest\n }) => {\n const { percent, getRangeProps, getRootProps, getTrackProps } =\n useProgress<\"svg\">({ max, min, value })\n\n return (\n <styled.div css={mergeCSS(css, { \"--percent\": percent })} {...rest}>\n <CircleProgressCircle {...getRootProps(circleProps)}>\n <CircleProgressTrack\n stroke={trackColor}\n {...getTrackProps(trackProps)}\n />\n <CircleProgressRange\n stroke={rangeColor}\n {...getRangeProps(rangeProps)}\n />\n </CircleProgressCircle>\n\n {children}\n </styled.div>\n )\n },\n \"root\",\n)(({ boxSize, duration, thickness, ...rest }) => ({\n \"--duration\": isNumber(duration) ? `${duration}s` : duration,\n \"--size\": varAttr(boxSize, \"sizes\"),\n \"--thickness\": varAttr(thickness, \"sizes\"),\n ...rest,\n}))\n\ninterface CircleProgressCircleProps extends HTMLStyledProps<\"svg\"> {}\n\nconst CircleProgressCircle = withContext<\"svg\", CircleProgressCircleProps>(\n \"svg\",\n \"circle\",\n)()\n\ninterface CircleProgressTrackProps extends HTMLStyledProps<\"circle\"> {}\n\nconst CircleProgressTrack = withContext<\"circle\", CircleProgressTrackProps>(\n \"circle\",\n \"track\",\n)()\n\ninterface CircleProgressRangeProps extends HTMLStyledProps<\"circle\"> {}\n\nconst CircleProgressRange = withContext<\"circle\", CircleProgressRangeProps>(\n \"circle\",\n \"range\",\n)()\n\nexport interface CircleProgressLabelProps extends HTMLStyledProps<\"span\"> {}\n\nexport const CircleProgressLabel = withContext<\n \"span\",\n CircleProgressLabelProps\n>(\"span\", \"label\")()\n"],"mappings":";;;;;;;;;;AA0CA,MAAM,EACJ,cAAc,4BACd,iBAAiB,+BACjB,aACA,iBACE,oBACF,mBACA,mBACF;;;;;;AASA,MAAa,qBAAqB,cAC/B,EACC,KACA,UACA,KACA,KACA,YACA,YACA,OACA,aACA,YACA,YACA,GAAG,WACC;CACJ,MAAM,EAAE,SAAS,eAAe,cAAc,kBAC5C,YAAmB;EAAE;EAAK;EAAK;CAAM,CAAC;CAExC,OACE,qBAAC,OAAO,KAAR;EAAY,KAAK,SAAS,KAAK,EAAE,aAAa,QAAQ,CAAC;EAAG,GAAI;EAA9D,UAAA,CACE,qBAAC,sBAAD;GAAsB,GAAI,aAAa,WAAW;GAAlD,UAAA,CACE,oBAAC,qBAAD;IACE,QAAQ;IACR,GAAI,cAAc,UAAU;GAC7B,CAAA,GACD,oBAAC,qBAAD;IACE,QAAQ;IACR,GAAI,cAAc,UAAU;GAC7B,CAAA,CACmB;EAErB,CAAA,GAAA,QACS;;AAEhB,GACA,MACF,CAAC,EAAE,EAAE,SAAS,UAAU,WAAW,GAAG,YAAY;CAChD,eAAA,GAAA,cAAA,SAAA,CAAuB,QAAQ,IAAI,GAAG,SAAS,KAAK;CACpD,UAAU,QAAQ,SAAS,OAAO;CAClC,eAAe,QAAQ,WAAW,OAAO;CACzC,GAAG;AACL,EAAE;AAIF,MAAM,uBAAuB,YAC3B,OACA,QACF,CAAC,CAAC;AAIF,MAAM,sBAAsB,YAC1B,UACA,OACF,CAAC,CAAC;AAIF,MAAM,sBAAsB,YAC1B,UACA,OACF,CAAC,CAAC;AAIF,MAAa,sBAAsB,YAGjC,QAAQ,OAAO,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapse.js","names":["motion"],"sources":["../../../../src/components/collapse/collapse.tsx"],"sourcesContent":["\"use client\"\n\nimport type { Variants } from \"motion/react\"\nimport type { ThemeProps } from \"../../core\"\nimport type {\n HTMLMotionProps,\n MotionTransitionVariants,\n WithTransitionProps,\n} from \"../motion\"\nimport type { CollapseStyle } from \"./collapse.style\"\nimport { AnimatePresence } from \"motion/react\"\nimport { useEffect, useMemo, useState } from \"react\"\nimport { createComponent } from \"../../core\"\nimport { createdDom, isNumeric } from \"../../utils\"\nimport { createTransition, motion } from \"../motion\"\nimport { collapseStyle } from \"./collapse.style\"\n\nconst variants: Variants = {\n enter: ({\n animationOpacity,\n delay,\n duration,\n endingHeight: height,\n enter,\n transition,\n transitionEnd,\n } = {}) => ({\n ...(animationOpacity ? { opacity: 1 } : {}),\n height,\n transition: createTransition.enter(transition?.enter)(delay, duration),\n transitionEnd: transitionEnd?.enter,\n ...enter,\n }),\n exit: ({\n animationOpacity,\n delay,\n duration,\n exit,\n startingHeight: height,\n transition,\n transitionEnd,\n } = {}) => ({\n ...(animationOpacity ? { opacity: isNumeric(height) ? 1 : 0 } : {}),\n height,\n transition: createTransition.exit(transition?.exit)(delay, duration),\n transitionEnd: transitionEnd?.exit,\n ...exit,\n }),\n} satisfies MotionTransitionVariants\n\nexport interface CollapseProps\n extends WithTransitionProps<HTMLMotionProps>, ThemeProps<CollapseStyle> {\n /**\n * If `true`, the opacity of the content will be animated.\n *\n * @default true\n */\n animationOpacity?: boolean\n /**\n * The height you want the content in its expanded state.\n *\n * @default 'auto'\n */\n endingHeight?: number | string\n /**\n * The height you want the content in its collapsed state.\n *\n * @default 0\n */\n startingHeight?: number | string\n}\n\nconst {\n PropsContext: CollapsePropsContext,\n usePropsContext: useCollapsePropsContext,\n withContext,\n} = createComponent<CollapseProps, CollapseStyle>(\"collapse\", collapseStyle)\n\nexport { CollapsePropsContext, useCollapsePropsContext }\n\n/**\n * `Collapse` is a component that allows you to expand or collapse an element for display.\n *\n * @see https://yamada-ui.com/docs/components/collapse\n */\nexport const Collapse = withContext<\"div\", CollapseProps>(\n ({\n style,\n animationOpacity = true,\n delay,\n duration,\n endingHeight = \"auto\",\n open: openProp,\n startingHeight = 0,\n transition: transitionProp,\n transitionEnd,\n unmountOnExit,\n ...rest\n }) => {\n const [mounted, setMounted] = useState(false)\n const animate = openProp || unmountOnExit ? \"enter\" : \"exit\"\n const open = unmountOnExit ? openProp : true\n\n const transition = useMemo(() => {\n if (!mounted) return { enter: { duration: 0 } }\n else if (transitionProp) return transitionProp\n else\n return {\n enter: {\n height: {\n duration: duration ?? 0.3,\n ease: [0.25, 0.1, 0.25, 1],\n },\n opacity: {\n duration: duration ?? 0.4,\n ease: [0.25, 0.1, 0.25, 1],\n },\n },\n exit: {\n height: {\n duration: duration ?? 0.3,\n ease: [0.25, 0.1, 0.25, 1],\n },\n opacity: {\n duration: duration ?? 0.4,\n ease: [0.25, 0.1, 0.25, 1],\n },\n },\n }\n }, [mounted, duration, transitionProp])\n\n const custom = useMemo(\n () => ({\n animationOpacity,\n delay,\n duration,\n endingHeight,\n startingHeight,\n transition,\n transitionEnd,\n }),\n [\n animationOpacity,\n delay,\n duration,\n endingHeight,\n startingHeight,\n transition,\n transitionEnd,\n ],\n )\n\n useEffect(() => {\n if (createdDom()) setMounted(true)\n }, [])\n\n return (\n <AnimatePresence custom={custom} initial={false}>\n {open ? (\n <motion.div\n style={{ overflow: \"hidden\", ...style }}\n animate={animate}\n custom={custom}\n exit=\"exit\"\n initial={unmountOnExit ? \"exit\" : false}\n variants={variants}\n {...rest}\n />\n ) : null}\n </AnimatePresence>\n )\n },\n)()\n"],"mappings":";;;;;;;;;;AAiBA,MAAM,WAAqB;CACzB,QAAQ,EACN,kBACA,OACA,UACA,cAAc,QACd,OACA,YACA,kBACE,CAAC,OAAO;EACV,GAAI,mBAAmB,EAAE,SAAS,EAAE,IAAI,CAAC;EACzC;EACA,YAAY,iBAAiB,MAAM,YAAY,KAAK,CAAC,CAAC,OAAO,QAAQ;EACrE,eAAe,eAAe;EAC9B,GAAG;CACL;CACA,OAAO,EACL,kBACA,OACA,UACA,MACA,gBAAgB,QAChB,YACA,kBACE,CAAC,OAAO;EACV,GAAI,mBAAmB,EAAE,UAAA,GAAA,cAAA,UAAA,CAAmB,MAAM,IAAI,IAAI,EAAE,IAAI,CAAC;EACjE;EACA,YAAY,iBAAiB,KAAK,YAAY,IAAI,CAAC,CAAC,OAAO,QAAQ;EACnE,eAAe,eAAe;EAC9B,GAAG;CACL;AACF;AAwBA,MAAM,EACJ,cAAc,sBACd,iBAAiB,yBACjB,gBACE,gBAA8C,YAAY,aAAa;;;;;;AAS3E,MAAa,WAAW,aACrB,EACC,OACA,mBAAmB,MACnB,OACA,UACA,eAAe,QACf,MAAM,UACN,iBAAiB,GACjB,YAAY,gBACZ,eACA,eACA,GAAG,WACC;CACJ,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAC5C,MAAM,UAAU,YAAY,gBAAgB,UAAU;CACtD,MAAM,OAAO,gBAAgB,WAAW;CAExC,MAAM,aAAa,cAAc;EAC/B,IAAI,CAAC,SAAS,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE;OACzC,IAAI,gBAAgB,OAAO;OAE9B,OAAO;GACL,OAAO;IACL,QAAQ;KACN,UAAU,YAAY;KACtB,MAAM;MAAC;MAAM;MAAK;MAAM;KAAC;IAC3B;IACA,SAAS;KACP,UAAU,YAAY;KACtB,MAAM;MAAC;MAAM;MAAK;MAAM;KAAC;IAC3B;GACF;GACA,MAAM;IACJ,QAAQ;KACN,UAAU,YAAY;KACtB,MAAM;MAAC;MAAM;MAAK;MAAM;KAAC;IAC3B;IACA,SAAS;KACP,UAAU,YAAY;KACtB,MAAM;MAAC;MAAM;MAAK;MAAM;KAAC;IAC3B;GACF;EACF;CACJ,GAAG;EAAC;EAAS;EAAU;CAAc,CAAC;CAEtC,MAAM,SAAS,eACN;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,gBAAgB;EACd,KAAA,GAAA,cAAA,WAAA,CAAe,GAAG,WAAW,IAAI;CACnC,GAAG,CAAC,CAAC;CAEL,OACE,oBAAC,iBAAD;EAAyB;EAAQ,SAAS;
|
|
1
|
+
{"version":3,"file":"collapse.js","names":["motion"],"sources":["../../../../src/components/collapse/collapse.tsx"],"sourcesContent":["\"use client\"\n\nimport type { Variants } from \"motion/react\"\nimport type { ThemeProps } from \"../../core\"\nimport type {\n HTMLMotionProps,\n MotionTransitionVariants,\n WithTransitionProps,\n} from \"../motion\"\nimport type { CollapseStyle } from \"./collapse.style\"\nimport { AnimatePresence } from \"motion/react\"\nimport { useEffect, useMemo, useState } from \"react\"\nimport { createComponent } from \"../../core\"\nimport { createdDom, isNumeric } from \"../../utils\"\nimport { createTransition, motion } from \"../motion\"\nimport { collapseStyle } from \"./collapse.style\"\n\nconst variants: Variants = {\n enter: ({\n animationOpacity,\n delay,\n duration,\n endingHeight: height,\n enter,\n transition,\n transitionEnd,\n } = {}) => ({\n ...(animationOpacity ? { opacity: 1 } : {}),\n height,\n transition: createTransition.enter(transition?.enter)(delay, duration),\n transitionEnd: transitionEnd?.enter,\n ...enter,\n }),\n exit: ({\n animationOpacity,\n delay,\n duration,\n exit,\n startingHeight: height,\n transition,\n transitionEnd,\n } = {}) => ({\n ...(animationOpacity ? { opacity: isNumeric(height) ? 1 : 0 } : {}),\n height,\n transition: createTransition.exit(transition?.exit)(delay, duration),\n transitionEnd: transitionEnd?.exit,\n ...exit,\n }),\n} satisfies MotionTransitionVariants\n\nexport interface CollapseProps\n extends WithTransitionProps<HTMLMotionProps>, ThemeProps<CollapseStyle> {\n /**\n * If `true`, the opacity of the content will be animated.\n *\n * @default true\n */\n animationOpacity?: boolean\n /**\n * The height you want the content in its expanded state.\n *\n * @default 'auto'\n */\n endingHeight?: number | string\n /**\n * The height you want the content in its collapsed state.\n *\n * @default 0\n */\n startingHeight?: number | string\n}\n\nconst {\n PropsContext: CollapsePropsContext,\n usePropsContext: useCollapsePropsContext,\n withContext,\n} = createComponent<CollapseProps, CollapseStyle>(\"collapse\", collapseStyle)\n\nexport { CollapsePropsContext, useCollapsePropsContext }\n\n/**\n * `Collapse` is a component that allows you to expand or collapse an element for display.\n *\n * @see https://yamada-ui.com/docs/components/collapse\n */\nexport const Collapse = withContext<\"div\", CollapseProps>(\n ({\n style,\n animationOpacity = true,\n delay,\n duration,\n endingHeight = \"auto\",\n open: openProp,\n startingHeight = 0,\n transition: transitionProp,\n transitionEnd,\n unmountOnExit,\n ...rest\n }) => {\n const [mounted, setMounted] = useState(false)\n const animate = openProp || unmountOnExit ? \"enter\" : \"exit\"\n const open = unmountOnExit ? openProp : true\n\n const transition = useMemo(() => {\n if (!mounted) return { enter: { duration: 0 } }\n else if (transitionProp) return transitionProp\n else\n return {\n enter: {\n height: {\n duration: duration ?? 0.3,\n ease: [0.25, 0.1, 0.25, 1],\n },\n opacity: {\n duration: duration ?? 0.4,\n ease: [0.25, 0.1, 0.25, 1],\n },\n },\n exit: {\n height: {\n duration: duration ?? 0.3,\n ease: [0.25, 0.1, 0.25, 1],\n },\n opacity: {\n duration: duration ?? 0.4,\n ease: [0.25, 0.1, 0.25, 1],\n },\n },\n }\n }, [mounted, duration, transitionProp])\n\n const custom = useMemo(\n () => ({\n animationOpacity,\n delay,\n duration,\n endingHeight,\n startingHeight,\n transition,\n transitionEnd,\n }),\n [\n animationOpacity,\n delay,\n duration,\n endingHeight,\n startingHeight,\n transition,\n transitionEnd,\n ],\n )\n\n useEffect(() => {\n if (createdDom()) setMounted(true)\n }, [])\n\n return (\n <AnimatePresence custom={custom} initial={false}>\n {open ? (\n <motion.div\n style={{ overflow: \"hidden\", ...style }}\n animate={animate}\n custom={custom}\n exit=\"exit\"\n initial={unmountOnExit ? \"exit\" : false}\n variants={variants}\n {...rest}\n />\n ) : null}\n </AnimatePresence>\n )\n },\n)()\n"],"mappings":";;;;;;;;;;AAiBA,MAAM,WAAqB;CACzB,QAAQ,EACN,kBACA,OACA,UACA,cAAc,QACd,OACA,YACA,kBACE,CAAC,OAAO;EACV,GAAI,mBAAmB,EAAE,SAAS,EAAE,IAAI,CAAC;EACzC;EACA,YAAY,iBAAiB,MAAM,YAAY,KAAK,CAAC,CAAC,OAAO,QAAQ;EACrE,eAAe,eAAe;EAC9B,GAAG;CACL;CACA,OAAO,EACL,kBACA,OACA,UACA,MACA,gBAAgB,QAChB,YACA,kBACE,CAAC,OAAO;E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