@yamada-ui/react 2.3.5-dev-20261126022425 → 2.3.5-dev-20261126060138
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/carousel/use-carousel.cjs +1 -1
- package/dist/cjs/components/carousel/use-carousel.cjs.map +1 -1
- package/dist/cjs/components/chart/chart.cjs +29 -9
- package/dist/cjs/components/chart/chart.cjs.map +1 -1
- package/dist/cjs/components/chart/polar-chart.cjs +3 -3
- package/dist/cjs/components/chart/polar-chart.cjs.map +1 -1
- package/dist/cjs/components/dropzone/use-dropzone.cjs +1 -1
- package/dist/cjs/components/dropzone/use-dropzone.cjs.map +1 -1
- package/dist/cjs/components/file-input/use-file-input.cjs +1 -2
- package/dist/cjs/components/file-input/use-file-input.cjs.map +1 -1
- package/dist/cjs/components/infinite-scroll-area/use-infinite-scroll.cjs +4 -2
- package/dist/cjs/components/infinite-scroll-area/use-infinite-scroll.cjs.map +1 -1
- package/dist/cjs/components/loading/loading-provider.cjs +13 -23
- package/dist/cjs/components/loading/loading-provider.cjs.map +1 -1
- package/dist/cjs/components/marquee/use-marquee.cjs +1 -1
- package/dist/cjs/components/marquee/use-marquee.cjs.map +1 -1
- package/dist/cjs/components/menu/use-menu.cjs +7 -1
- package/dist/cjs/components/menu/use-menu.cjs.map +1 -1
- package/dist/cjs/components/native-popover/use-native-popover.cjs +1 -1
- package/dist/cjs/components/native-popover/use-native-popover.cjs.map +1 -1
- package/dist/cjs/components/notice/notice-provider.cjs +23 -23
- package/dist/cjs/components/notice/notice-provider.cjs.map +1 -1
- package/dist/cjs/components/notice/notice.cjs +4 -3
- package/dist/cjs/components/notice/notice.cjs.map +1 -1
- package/dist/cjs/components/popover/use-popover.cjs +1 -1
- package/dist/cjs/components/popover/use-popover.cjs.map +1 -1
- package/dist/cjs/components/sidebar/use-sidebar.cjs +2 -2
- package/dist/cjs/components/sidebar/use-sidebar.cjs.map +1 -1
- package/dist/cjs/components/textarea/use-textarea.cjs +1 -2
- package/dist/cjs/components/textarea/use-textarea.cjs.map +1 -1
- package/dist/cjs/components/tree/use-tree.cjs +24 -35
- package/dist/cjs/components/tree/use-tree.cjs.map +1 -1
- package/dist/esm/components/carousel/use-carousel.js +3 -3
- package/dist/esm/components/carousel/use-carousel.js.map +1 -1
- package/dist/esm/components/chart/chart.js +30 -10
- package/dist/esm/components/chart/chart.js.map +1 -1
- package/dist/esm/components/chart/polar-chart.js +3 -3
- package/dist/esm/components/chart/polar-chart.js.map +1 -1
- package/dist/esm/components/dropzone/use-dropzone.js +3 -3
- package/dist/esm/components/dropzone/use-dropzone.js.map +1 -1
- package/dist/esm/components/file-input/use-file-input.js +2 -3
- package/dist/esm/components/file-input/use-file-input.js.map +1 -1
- package/dist/esm/components/infinite-scroll-area/use-infinite-scroll.js +6 -4
- package/dist/esm/components/infinite-scroll-area/use-infinite-scroll.js.map +1 -1
- package/dist/esm/components/loading/loading-provider.js +14 -24
- package/dist/esm/components/loading/loading-provider.js.map +1 -1
- package/dist/esm/components/marquee/use-marquee.js +3 -3
- package/dist/esm/components/marquee/use-marquee.js.map +1 -1
- package/dist/esm/components/menu/use-menu.js +9 -3
- package/dist/esm/components/menu/use-menu.js.map +1 -1
- package/dist/esm/components/native-popover/use-native-popover.js +3 -3
- package/dist/esm/components/native-popover/use-native-popover.js.map +1 -1
- package/dist/esm/components/notice/notice-provider.js +24 -24
- package/dist/esm/components/notice/notice-provider.js.map +1 -1
- package/dist/esm/components/notice/notice.js +5 -4
- package/dist/esm/components/notice/notice.js.map +1 -1
- package/dist/esm/components/popover/use-popover.js +3 -3
- package/dist/esm/components/popover/use-popover.js.map +1 -1
- package/dist/esm/components/sidebar/use-sidebar.js +4 -4
- package/dist/esm/components/sidebar/use-sidebar.js.map +1 -1
- package/dist/esm/components/textarea/use-textarea.js +2 -3
- package/dist/esm/components/textarea/use-textarea.js.map +1 -1
- package/dist/esm/components/tree/use-tree.js +25 -36
- package/dist/esm/components/tree/use-tree.js.map +1 -1
- package/dist/types/components/accordion/accordion.style.d.ts +1 -1
- package/dist/types/components/autocomplete/autocomplete.style.d.ts +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/breadcrumb/breadcrumb.style.d.ts +1 -1
- package/dist/types/components/bubble/bubble.style.d.ts +1 -1
- package/dist/types/components/calendar/calendar.style.d.ts +2 -2
- package/dist/types/components/carousel/carousel.style.d.ts +2 -2
- package/dist/types/components/chart/cartesian-chart.style.d.ts +1 -1
- package/dist/types/components/chart/chart.d.ts +3 -2
- package/dist/types/components/chart/polar-chart.style.d.ts +1 -1
- package/dist/types/components/color-picker/color-picker.style.d.ts +1 -1
- package/dist/types/components/color-selector/color-selector.style.d.ts +2 -2
- package/dist/types/components/data-list/data-list.style.d.ts +1 -1
- package/dist/types/components/editable/editable.d.ts +1 -1
- package/dist/types/components/editable/editable.style.d.ts +1 -1
- package/dist/types/components/flip/flip.d.ts +1 -1
- package/dist/types/components/flip/flip.style.d.ts +1 -1
- package/dist/types/components/list/list.style.d.ts +2 -2
- package/dist/types/components/marquee/marquee.style.d.ts +1 -1
- package/dist/types/components/menu/menu.style.d.ts +2 -2
- package/dist/types/components/native-accordion/native-accordion.style.d.ts +2 -2
- package/dist/types/components/notice/notice.style.d.ts +1 -1
- package/dist/types/components/number-input/number-input.style.d.ts +1 -1
- package/dist/types/components/pagination/pagination.style.d.ts +1 -1
- package/dist/types/components/rating/rating.style.d.ts +2 -2
- package/dist/types/components/reorder/reorder.style.d.ts +1 -1
- package/dist/types/components/resizable/resizable.style.d.ts +2 -2
- package/dist/types/components/segmented-control/segmented-control.style.d.ts +2 -2
- package/dist/types/components/select/select.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/components/tree/tree.style.d.ts +1 -1
- package/dist/types/providers/i18n-provider/i18n-provider.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polar-chart.js","names":["replaceObject","isNumber","runIfFn","isObject","cx","isFunction","splitObject"],"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, FunctionOf, 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 transforms,\n useSystem,\n useTheme,\n varAttr,\n} from \"../../core\"\nimport {\n assignRef,\n cx,\n isFunction,\n isNumber,\n isObject,\n replaceObject,\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\": replaceObject(activeDotRadius, transforms.px),\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\": replaceObject(dotRadius, transforms.px),\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 = useCallback<FunctionOf<UseChartPieProps[\"shape\"]>>(\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 = useCallback<FunctionOf<UseChartRadialProps<Y>[\"shape\"]>>(\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":";;;;;;;;;;;;;;;;;;AAsGA,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,WAAW;GACX,UAAU,gBAAgB,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,eAAe;EACtD;EACS;EACT;EACA;EACA;EACA,GAAG;CACL,CAAC;CAED,UAAU,YAAY,OAAO;CAE7B,OACE,oBAAC,OAAO,KAAR;EAAY,SAAA;EAAQ,GAAI,aAAa;EACnC,UAAA,qBAAC,WAAD;GAAW,GAAI,eAAe;GAA9B,UAAA,CACG,UAEA,YACC,oBAAC,gBAAD;IACE,SAAS;IACT,QAAQ;IACR,UAAS;IACT,IAAA,GAAKD,cAAAA,SAAAA,CAAS,SAAS,IAAI,YAAY,CAAC;GACzC,CAAA,IACC,IACK;;CACD,CAAA;AAEhB,GACA,QACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"polar-chart.js","names":["replaceObject","isNumber","runIfFn","isObject","cx","isFunction","splitObject"],"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, FunctionOf, 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 transforms,\n useSystem,\n useTheme,\n varAttr,\n} from \"../../core\"\nimport {\n cx,\n isFunction,\n isNumber,\n isObject,\n replaceObject,\n runIfFn,\n splitObject,\n useSafeLayoutEffect,\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\": replaceObject(activeDotRadius, transforms.px),\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\": replaceObject(dotRadius, transforms.px),\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 = useCallback<FunctionOf<UseChartPieProps[\"shape\"]>>(\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 { registerNameKey } = useChartComponentContext()\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\n useSafeLayoutEffect(\n () => registerNameKey(nameKey),\n [nameKey, registerNameKey],\n )\n const system = useSystem()\n const { theme } = useTheme()\n const labelProps = useSlotComponentProps({}, \"labelList\")\n const backgroundProps = useSlotComponentProps({}, \"radialBackground\")\n const css = useMemo(() => getCSS(system, theme), [system, theme])\n const shape = useCallback<FunctionOf<UseChartRadialProps<Y>[\"shape\"]>>(\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 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":";;;;;;;;;;;;;;;;;;AAsGA,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,WAAW;GACX,UAAU,gBAAgB,oBAAC,gBAAD,CAAiB,CAAA,IAAI;EACjD;EACA;GACE,WAAW;GACX,UAAU,iBAAiB,oBAAC,iBAAD,CAAkB,CAAA,IAAI;EACnD;EACA,GAAG;CACL,GACA;EAAC;EAAgB;EAAU;EAAe;CAAc,CAC1D;CACA,MAAM,mBAAmB,eAChB;EACI;EACT;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,OACE,oBAAC,kBAAD;EAAkB,OAAO;EACvB,UAAA,oBAAC,OAAD;GACc;GACZ,SAAS,UAAU,OAAO,cAAc;IAAE,GAAG;IAAO,GAAG;GAAW,CAAC,CAAC;GACpE,GAAI,aAAa;EAClB,CAAA;CACe,CAAA;AAEtB,GACA,MACF,CAAC,CACC,KAAA,IACC,EACC,eACA,iBACA,iBACA,sBACA,qBACA,0BACA,oBACA,mBACA,SACA,WACA,WACA,gBACA,YACA,0BACA,sBACA,sBACA,uBACA,YACA,WACA,iBACA,sBACA,YACA,kBACA,aACA,kBACA,uBACA,sBACA,wBACA,6BACA,sBACA,2BACA,qBACA,oBACA,aACA,YACA,cACA,mBACA,GAAG,YACE;CACL,qBAAqB,QAAQ,eAAe,QAAQ;CACpD,mBAAA,GAAkBA,cAAAA,cAAAA,CAAc,iBAAiB,WAAW,EAAE;CAC9D,uBAAuB,QAAQ,iBAAiB,QAAQ;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AAI,eAAe,cAAc,GACtC,OAAO,aAAkB,gBAAgB,EAAE,UAAU,CAAC;OACjD,KAAA,GAAID,cAAAA,SAAAA,CAAS,cAAc,GAAG;GACnC,MAAM,CAAC,cAAc,eAAA,GAAcG,cAAAA,YAAAA,CAGjC,gBAAgB,iBAAiB;GACnC,OAAO;IACL,GAAG;IACH,YAAA,GAAWF,cAAAA,GAAAA,CAAG,WAAW,aAAa,WAAW,IAAI,UAAU,CAAC;GAClE;EACF,OACE,OAAO,EAAE,UAAU;CAEvB,GAAG;EAAC;EAAgB,gBAAgB;EAAW,gBAAgB;EAAK;CAAG,CAAC;CACxE,MAAM,EAAE,gBAAgB,iBAAiB,eAAe;EACtD;EACS;EACT;EACA;EACA;EACA,GAAG;CACL,CAAC;CAED,OACE,oBAAC,OAAO,KAAR;EAAY,SAAA;EAAQ,GAAI,aAAa;EACnC,UAAA,qBAAC,WAAD;GAAW,GAAI,eAAe;GAA9B,UAAA,CACG,UAEA,YACC,oBAAC,gBAAD;IACE,SAAS;IACT,QAAQ;IACR,UAAS;IACT,IAAA,GAAKD,cAAAA,SAAAA,CAAS,SAAS,IAAI,YAAY,CAAC;GACzC,CAAA,IACC,IACK;;CACD,CAAA;AAEhB,GACA,QACF,CAAC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { mergeRefs } from "../../utils/ref.js";
|
|
3
3
|
import { mergeProps } from "../../core/components/props.js";
|
|
4
4
|
import { utils_exports } from "../../utils/index.js";
|
|
5
5
|
import { useFieldProps } from "../field/use-field-props.js";
|
|
6
|
-
import { useCallback, useId } from "react";
|
|
6
|
+
import { useCallback, useId, useImperativeHandle } from "react";
|
|
7
7
|
import { fromEvent } from "file-selector";
|
|
8
8
|
import { useDropzone } from "react-dropzone";
|
|
9
9
|
// src/components/dropzone/use-dropzone.ts
|
|
@@ -41,7 +41,7 @@ const useDropzone$1 = (props = {}) => {
|
|
|
41
41
|
onFileDialogOpen
|
|
42
42
|
});
|
|
43
43
|
const dragIdle = !dragAccept && !dragReject;
|
|
44
|
-
|
|
44
|
+
useImperativeHandle(openRef, () => open, [open]);
|
|
45
45
|
const getRootProps = useCallback(({ ref, ...props } = {}) => {
|
|
46
46
|
const { ref: rootRef, ...rootProps } = getOriginalRootProps(mergeProps(dataProps, eventProps, {
|
|
47
47
|
id: labelledbyId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-dropzone.js","names":["useDropzone","useOriginalDropzone","isArray","ariaAttr","dataAttr"],"sources":["../../../../src/components/dropzone/use-dropzone.ts"],"sourcesContent":["\"use client\"\n\nimport type { RefObject } from \"react\"\nimport type { Accept, DropzoneOptions } from \"react-dropzone\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport type { FieldProps } from \"../field\"\nimport { fromEvent } from \"file-selector\"\nimport { useCallback, useId } from \"react\"\nimport { useDropzone as useOriginalDropzone } from \"react-dropzone\"\nimport { mergeProps } from \"../../core\"\nimport { ariaAttr,
|
|
1
|
+
{"version":3,"file":"use-dropzone.js","names":["useDropzone","useOriginalDropzone","isArray","ariaAttr","dataAttr"],"sources":["../../../../src/components/dropzone/use-dropzone.ts"],"sourcesContent":["\"use client\"\n\nimport type { RefObject } from \"react\"\nimport type { Accept, DropzoneOptions } from \"react-dropzone\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport type { FieldProps } from \"../field\"\nimport { fromEvent } from \"file-selector\"\nimport { useCallback, useId, useImperativeHandle } from \"react\"\nimport { useDropzone as useOriginalDropzone } from \"react-dropzone\"\nimport { mergeProps } from \"../../core\"\nimport { ariaAttr, dataAttr, isArray, mergeRefs } from \"../../utils\"\nimport { useFieldProps } from \"../field\"\n\nexport interface UseDropzoneProps\n extends Omit<HTMLProps, \"onDrop\" | \"onError\">, FieldProps {\n /**\n * Set accepted file types.\n */\n accept?: Accept | string[]\n /**\n * Set to true to focus the root element on render.\n *\n * @default false\n */\n autoFocus?: boolean\n /**\n * Use this to provide a custom file aggregator.\n */\n getFilesFromEvent?: DropzoneOptions[\"getFilesFromEvent\"]\n /**\n * If `true`, display the dropzone loading icon.\n *\n * @default false\n */\n loading?: boolean\n /**\n * Maximum accepted number of files.\n * The default value is 0 which means there is no limitation to how many files are accepted.\n *\n * @default 0\n */\n maxFiles?: number\n /**\n * Maximum file size (in bytes).\n *\n * @default Infinity\n */\n maxSize?: number\n /**\n * Minimum file size (in bytes).\n *\n * @default 0\n */\n minSize?: number\n /**\n * Allow drag and drop (or selection from the file dialog) of multiple files.\n *\n * @default false\n */\n multiple?: boolean\n /**\n * The HTML `name` attribute used for forms.\n */\n name?: string\n /**\n * If true, disables click to open the native file selection dialog.\n *\n * @default false\n */\n noClick?: boolean\n /**\n * If true, disables drag and drop.\n *\n * @default false\n */\n noDrag?: boolean\n /**\n * If true, stops drag event propagation to parents.\n *\n * @default false\n */\n noDragEventsBubbling?: boolean\n /**\n * If true, disables `space` and `enter` to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n *\n * @default false\n */\n noKeyboard?: boolean\n /**\n * Ref to a open function.\n */\n openRef?: RefObject<() => void>\n /**\n * If false, allow dropped items to take over the current browser window.\n *\n * @default true\n */\n preventDropOnDocument?: boolean\n /**\n * If true, use the [File System API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API) to read files.\n *\n * @default false\n */\n useFsAccessApi?: boolean\n /**\n * Custom validation function.\n * It must return null if there's no errors.\n */\n validator?: DropzoneOptions[\"validator\"]\n /**\n * Callback for when the dragenter event occurs.\n */\n onDragEnter?: DropzoneOptions[\"onDragEnter\"]\n /**\n * Callback for when the dragleave event occurs.\n */\n onDragLeave?: DropzoneOptions[\"onDragLeave\"]\n /**\n * Callback for when the dragover event occurs.\n */\n onDragOver?: DropzoneOptions[\"onDragOver\"]\n /**\n * Callback for when the drop event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n */\n onDrop?: DropzoneOptions[\"onDrop\"]\n /**\n * Callback for when the drop event occurs.\n * Note that if no files are accepted, this callback is not invoked.\n */\n onDropAccepted?: DropzoneOptions[\"onDropAccepted\"]\n /**\n * Callback for when the drop event occurs.\n * Note that if no files are rejected, this callback is not invoked.\n */\n onDropRejected?: DropzoneOptions[\"onDropRejected\"]\n /**\n * Callback for when there's some error from any of the promises.\n */\n onError?: DropzoneOptions[\"onError\"]\n /**\n * Callback for when closing the file dialog with no selection.\n */\n onFileDialogCancel?: DropzoneOptions[\"onFileDialogCancel\"]\n /**\n * Callback for when opening the file dialog.\n */\n onFileDialogOpen?: DropzoneOptions[\"onFileDialogOpen\"]\n}\n\nexport const useDropzone = (props: UseDropzoneProps = {}) => {\n const {\n props: {\n id,\n ref: refProp,\n name,\n accept,\n autoFocus = false,\n disabled,\n getFilesFromEvent = fromEvent,\n loading,\n maxFiles = 0,\n maxSize = Infinity,\n minSize = 0,\n multiple = false,\n noClick = false,\n noDrag = false,\n noDragEventsBubbling = false,\n noKeyboard = false,\n openRef,\n preventDropOnDocument = true,\n readOnly,\n useFsAccessApi = false,\n validator,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onDrop,\n onDropAccepted,\n onDropRejected,\n onError,\n onFileDialogCancel,\n onFileDialogOpen,\n ...rest\n },\n ariaProps,\n dataProps,\n eventProps,\n } = useFieldProps(props)\n const labelledbyId = useId()\n const interactive = !(loading || readOnly || disabled)\n const {\n acceptedFiles,\n fileRejections,\n isDragAccept: dragAccept,\n isDragActive: dragActive,\n isDragReject: dragReject,\n isFocused: focused,\n open,\n getInputProps: getOriginalInputProps,\n getRootProps: getOriginalRootProps,\n } = useOriginalDropzone({\n accept: isArray(accept)\n ? accept.reduce((prev, current) => ({ ...prev, [current]: [] }), {})\n : accept,\n autoFocus,\n disabled: !interactive,\n getFilesFromEvent,\n maxFiles,\n maxSize,\n minSize,\n multiple,\n noClick,\n noDrag,\n noDragEventsBubbling,\n noKeyboard,\n preventDropOnDocument,\n useFsAccessApi,\n validator,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onDrop,\n onDropAccepted,\n onDropRejected,\n onError,\n onFileDialogCancel,\n onFileDialogOpen,\n })\n const dragIdle = !dragAccept && !dragReject\n\n useImperativeHandle(openRef, () => open, [open])\n\n const getRootProps: PropGetter = useCallback(\n ({ ref, ...props } = {}) => {\n const { ref: rootRef, ...rootProps } = getOriginalRootProps(\n mergeProps(\n dataProps,\n eventProps,\n {\n id: labelledbyId,\n \"aria-disabled\": ariaAttr(!interactive),\n \"data-accept\": dataAttr(dragAccept),\n \"data-idle\": dataAttr(dragIdle),\n \"data-loading\": dataAttr(loading),\n \"data-reject\": dataAttr(dragReject),\n },\n rest,\n props,\n )(),\n ) as HTMLProps\n\n return { ...rootProps, ref: mergeRefs(refProp, ref, rootRef) }\n },\n [\n getOriginalRootProps,\n labelledbyId,\n dataProps,\n eventProps,\n interactive,\n dragAccept,\n dragIdle,\n loading,\n dragReject,\n refProp,\n rest,\n ],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}) =>\n getOriginalInputProps(\n mergeProps(\n ariaProps,\n dataProps,\n {\n id,\n name,\n \"aria-labelledby\": labelledbyId,\n disabled,\n readOnly,\n },\n props,\n )(),\n ),\n [\n getOriginalInputProps,\n id,\n name,\n disabled,\n readOnly,\n ariaProps,\n dataProps,\n labelledbyId,\n ],\n )\n\n return {\n acceptedFiles,\n dragAccept,\n dragActive,\n dragIdle,\n dragReject,\n fileRejections,\n focused,\n loading,\n open,\n getInputProps,\n getRootProps,\n }\n}\n\nexport type UseDropzoneReturn = ReturnType<typeof useDropzone>\n"],"mappings":";;;;;;;;;AAuJA,MAAaA,iBAAe,QAA0B,CAAC,MAAM;CAC3D,MAAM,EACJ,OAAO,EACL,IACA,KAAK,SACL,MACA,QACA,YAAY,OACZ,UACA,oBAAoB,WACpB,SACA,WAAW,GACX,UAAU,UACV,UAAU,GACV,WAAW,OACX,UAAU,OACV,SAAS,OACT,uBAAuB,OACvB,aAAa,OACb,SACA,wBAAwB,MACxB,UAC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A;EACA;EACA;EACA;EACA;EACA,eAtCyC,aACxC,QAAQ,CAAC,MACR,sBACE,WACE,WACA,WACA;GACE;GACA;GACA,mBAAmB;GACnB;GACA;EACF,GACA,KACF,CAAC,CAAC,CACJ,GACF;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAaY;EACZ;CACF;AACF"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { visuallyHiddenAttributes } from "../../utils/dom.js";
|
|
3
|
-
import { assignRef } from "../../utils/ref.js";
|
|
4
3
|
import { mergeProps } from "../../core/components/props.js";
|
|
5
4
|
import { useClickable } from "../../hooks/use-clickable/index.js";
|
|
6
5
|
import { useControllableState } from "../../hooks/use-controllable-state/index.js";
|
|
7
6
|
import { utils_exports } from "../../utils/index.js";
|
|
8
7
|
import { useFieldProps } from "../field/use-field-props.js";
|
|
9
|
-
import { useCallback, useRef } from "react";
|
|
8
|
+
import { useCallback, useImperativeHandle, useRef } from "react";
|
|
10
9
|
// src/components/file-input/use-file-input.ts
|
|
11
10
|
const useFileInput = (props) => {
|
|
12
11
|
const { context: { labelId } = {}, props: { id, ref, form, name, accept, defaultValue, disabled, multiple, placeholder, readOnly, required, resetRef, value, onChange: onChangeProp, ...rest }, ariaProps, dataProps, eventProps } = useFieldProps({
|
|
@@ -39,7 +38,7 @@ const useFileInput = (props) => {
|
|
|
39
38
|
focusOnClick: interactive,
|
|
40
39
|
onClick
|
|
41
40
|
})());
|
|
42
|
-
|
|
41
|
+
useImperativeHandle(resetRef, () => onReset, [onReset]);
|
|
43
42
|
const getInputProps = useCallback((props = {}) => mergeProps(visuallyHiddenAttributes, ariaProps, dataProps, {
|
|
44
43
|
id,
|
|
45
44
|
ref: inputRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-file-input.js","names":["isNull","has","dataAttr"],"sources":["../../../../src/components/file-input/use-file-input.ts"],"sourcesContent":["\"use client\"\n\nimport type { ChangeEvent, RefObject } from \"react\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport type { Dict } from \"../../utils\"\nimport type { FieldProps } from \"../field\"\nimport { useCallback, useRef } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useClickable } from \"../../hooks/use-clickable\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport {
|
|
1
|
+
{"version":3,"file":"use-file-input.js","names":["isNull","has","dataAttr"],"sources":["../../../../src/components/file-input/use-file-input.ts"],"sourcesContent":["\"use client\"\n\nimport type { ChangeEvent, RefObject } from \"react\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport type { Dict } from \"../../utils\"\nimport type { FieldProps } from \"../field\"\nimport { useCallback, useImperativeHandle, useRef } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useClickable } from \"../../hooks/use-clickable\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport { dataAttr, has, isNull, visuallyHiddenAttributes } from \"../../utils\"\nimport { useFieldProps } from \"../field\"\n\nexport type UseFileInputProps<Y extends \"button\" | \"input\" = \"input\"> =\n FieldProps &\n Omit<HTMLProps<Y>, \"defaultValue\" | \"onChange\" | \"ref\" | \"value\"> &\n Pick<HTMLProps<\"input\">, \"accept\" | \"multiple\" | \"placeholder\" | \"ref\"> & {\n /**\n * The initial value of the file input.\n */\n defaultValue?: File[]\n /**\n * Ref to a reset function.\n */\n resetRef?: RefObject<(() => void) | null>\n /**\n * The value of the file input.\n */\n value?: File[]\n /**\n * Function to be called when a file change event occurs.\n */\n onChange?: (files: File[] | undefined) => void\n }\n\nexport const useFileInput = <Y extends \"button\" | \"input\" = \"input\">(\n props: UseFileInputProps<Y>,\n) => {\n const {\n context: { labelId } = {},\n props: {\n id,\n ref,\n form,\n name,\n accept,\n defaultValue,\n disabled,\n multiple,\n placeholder,\n readOnly,\n required,\n resetRef,\n value,\n onChange: onChangeProp,\n ...rest\n },\n ariaProps,\n dataProps,\n eventProps,\n } = useFieldProps<HTMLElement, UseFileInputProps<Y>>({\n ...props,\n notSupportReadOnly: true,\n })\n const interactive = !(readOnly || disabled)\n const inputRef = useRef<HTMLInputElement>(null)\n const [values, setValues] = useControllableState<File[] | undefined>({\n defaultValue,\n value,\n onChange: onChangeProp,\n })\n const count = values?.length ?? 0\n\n const onClick = useCallback(() => {\n if (!interactive) return\n\n inputRef.current?.click()\n }, [interactive])\n\n const onReset = useCallback(() => {\n if (inputRef.current) inputRef.current.value = \"\"\n\n setValues(undefined)\n }, [setValues])\n\n const onChange = useCallback(\n (ev: ChangeEvent<HTMLInputElement>) => {\n const files = !isNull(ev.currentTarget.files)\n ? Array.from(ev.currentTarget.files)\n : undefined\n\n setValues(files?.length ? files : undefined)\n },\n [setValues],\n )\n\n const clickableProps = useClickable<HTMLElement, Dict>(\n mergeProps(ariaProps, dataProps, eventProps, rest, {\n disabled: !interactive,\n focusable: readOnly && !disabled,\n focusOnClick: interactive,\n onClick,\n })(),\n )\n\n useImperativeHandle(resetRef, () => onReset, [onReset])\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}) =>\n mergeProps(\n visuallyHiddenAttributes,\n ariaProps,\n dataProps,\n {\n id,\n ref: inputRef,\n form,\n type: \"file\",\n name,\n accept,\n disabled,\n multiple,\n readOnly,\n required,\n },\n props,\n { ref, onChange },\n )(),\n [\n required,\n ariaProps,\n dataProps,\n id,\n form,\n name,\n accept,\n disabled,\n multiple,\n readOnly,\n ref,\n onChange,\n ],\n )\n\n const getFieldProps: PropGetter = useCallback(\n (props = {}) => {\n const hasLabel =\n has(props, [\"aria-label\", \"aria-labelledby\"], { truthy: true }) ||\n has(clickableProps, [\"aria-label\", \"aria-labelledby\"], { truthy: true })\n const hasPlaceholder = !!placeholder?.trim()\n const hasValues = !!count\n\n return mergeProps(\n {\n \"data-placeholder\": dataAttr(!count),\n ...clickableProps,\n \"aria-labelledby\":\n clickableProps[\"aria-labelledby\"] ??\n (!hasLabel && !hasPlaceholder && !hasValues ? labelId : undefined),\n tabIndex: interactive ? 0 : clickableProps.tabIndex,\n },\n props,\n )()\n },\n [clickableProps, count, interactive, labelId, placeholder],\n )\n\n return {\n disabled,\n interactive,\n readOnly,\n required,\n values,\n clickableProps,\n getFieldProps,\n getInputProps,\n }\n}\n\nexport type UseFileInputReturn = ReturnType<typeof useFileInput>\n"],"mappings":";;;;;;;;;AAmCA,MAAa,gBACX,UACG;CACH,MAAM,EACJ,SAAS,EAAE,YAAY,CAAC,GACxB,OAAO,EACL,IACA,KACA,MACA,MACA,QACA,cACA,UACA,UACA,aACA,UACA,UACA,UACA,OACA,UAAU,cACV,GAAG,QAEL,WACA,WACA,eACE,cAAiD;EACnD,GAAG;EACH,oBAAoB;CACtB,CAAC;CACD,MAAM,cAAc,EAAE,YAAY;CAClC,MAAM,WAAW,OAAyB,IAAI;CAC9C,MAAM,CAAC,QAAQ,aAAa,qBAAyC;EACnE;EACA;EACA,UAAU;CACZ,CAAC;CACD,MAAM,QAAQ,QAAQ,UAAU;CAEhC,MAAM,UAAU,kBAAkB;EAChC,IAAI,CAAC,aAAa;EAElB,SAAS,SAAS,MAAM;CAC1B,GAAG,CAAC,WAAW,CAAC;CAEhB,MAAM,UAAU,kBAAkB;EAChC,IAAI,SAAS,SAAS,SAAS,QAAQ,QAAQ;EAE/C,UAAU,KAAA,CAAS;CACrB,GAAG,CAAC,SAAS,CAAC;CAEd,MAAM,WAAW,aACd,OAAsC;EACrC,MAAM,QAAQ,EAAA,GAACA,cAAAA,OAAAA,CAAO,GAAG,cAAc,KAAK,IACxC,MAAM,KAAK,GAAG,cAAc,KAAK,IACjC,KAAA;EAEJ,UAAU,OAAO,SAAS,QAAQ,KAAA,CAAS;CAC7C,GACA,CAAC,SAAS,CACZ;CAEA,MAAM,iBAAiB,aACrB,WAAW,WAAW,WAAW,YAAY,MAAM;EACjD,UAAU,CAAC;EACX,WAAW,YAAY,CAAC;EACxB,cAAc;EACd;CACF,CAAC,CAAC,CAAC,CACL;CAEA,oBAAoB,gBAAgB,SAAS,CAAC,OAAO,CAAC;CAEtD,MAAM,gBAAqC,aACxC,QAAQ,CAAC,MACR,WACE,0BACA,WACA,WACA;EACE;EACA,KAAK;EACL;EACA,MAAM;EACN;EACA;EACA;EACA;EACA;EACA;CACF,GACA,OACA;EAAE;EAAK;CAAS,CAClB,CAAC,CAAC,GACJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAyBA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA,eA9BgC,aAC/B,QAAQ,CAAC,MAAM;GACd,MAAM,YAAA,GACJC,cAAAA,IAAAA,CAAI,OAAO,CAAC,cAAc,iBAAiB,GAAG,EAAE,QAAQ,KAAK,CAAC,MAAA,GAC9DA,cAAAA,IAAAA,CAAI,gBAAgB,CAAC,cAAc,iBAAiB,GAAG,EAAE,QAAQ,KAAK,CAAC;GACzE,MAAM,iBAAiB,CAAC,CAAC,aAAa,KAAK;GAC3C,MAAM,YAAY,CAAC,CAAC;GAEpB,OAAO,WACL;IACE,qBAAA,GAAoBC,cAAAA,SAAAA,CAAS,CAAC,KAAK;IACnC,GAAG;IACH,mBACE,eAAe,uBACd,CAAC,YAAY,CAAC,kBAAkB,CAAC,YAAY,UAAU,KAAA;IAC1D,UAAU,cAAc,IAAI,eAAe;GAC7C,GACA,KACF,CAAC,CAAC;EACJ,GACA;GAAC;GAAgB;GAAO;GAAa;GAAS;EAAW,CAU7C;EACZ;CACF;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useEnvironment } from "../../core/system/environment-provider.js";
|
|
3
|
-
import {
|
|
4
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useCallbackRef } from "../../utils/ref.js";
|
|
4
|
+
import { useCallback, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
5
5
|
// src/components/infinite-scroll-area/use-infinite-scroll.ts
|
|
6
6
|
const isScrollable = (el, vertical) => {
|
|
7
7
|
const style = getComputedStyle(el);
|
|
@@ -171,8 +171,10 @@ const useInfiniteScroll = ({ behavior, disabled = false, indexRef: indexRefProp,
|
|
|
171
171
|
getWindow,
|
|
172
172
|
direction
|
|
173
173
|
]);
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
useImperativeHandle(resetRef, () => onReset, [onReset]);
|
|
175
|
+
useImperativeHandle(indexRefProp, () => (index) => {
|
|
176
|
+
indexRef.current = index;
|
|
177
|
+
}, []);
|
|
176
178
|
return {
|
|
177
179
|
ref,
|
|
178
180
|
finish
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-infinite-scroll.js","names":[],"sources":["../../../../src/components/infinite-scroll-area/use-infinite-scroll.ts"],"sourcesContent":["\"use client\"\n\nimport type { RefObject } from \"react\"\nimport type { Orientation } from \"../../core\"\nimport { useCallback, useEffect, useRef, useState } from \"react\"\nimport { useEnvironment } from \"../../core\"\nimport { assignRef, useCallbackRef } from \"../../utils\"\n\nconst isScrollable = (el: HTMLElement, vertical: boolean) => {\n const style = getComputedStyle(el)\n\n if ([\"auto\", \"overlay\", \"scroll\"].includes(style.overflow)) return true\n\n if (vertical) return [\"auto\", \"overlay\", \"scroll\"].includes(style.overflowY)\n else return [\"auto\", \"overlay\", \"scroll\"].includes(style.overflowX)\n}\n\nexport interface UseInfiniteScrollProps extends Omit<\n IntersectionObserverInit,\n \"root\"\n> {\n /**\n * Determines whether scrolling is instant or animates smoothly.\n */\n behavior?: ScrollBehavior\n /**\n * If `true`, the infinite scroll is disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * Ref to a reset index function.\n */\n indexRef?: RefObject<(index: number) => void>\n /**\n * If `true`, invoke `onLoad` function for the first time.\n *\n * @default false\n */\n initialLoad?: boolean\n /**\n * The orientation of the infinite scroll.\n *\n * @default 'vertical'\n */\n orientation?: Orientation\n /**\n * Ref to a reset function.\n */\n resetRef?: RefObject<(index?: number, runScroll?: boolean) => void>\n /**\n * If `true`, reverse direction.\n *\n * @default false\n */\n reverse?: boolean\n /**\n * Margin around the root. Can have values similar to the CSS margin property,\n * e.g. \"10px 20px 30px 40px\" (top, right, bottom, left).\n */\n rootMargin?: string\n /**\n * The element that is used as the viewport for checking visibility of the target.\n * Defaults to the browser viewport if not specified or if `null`.\n */\n rootRef?: null | RefObject<HTMLElement | null>\n /**\n * If set the `onLoad` function will start from the given index.\n * If `initialLoad` is `true`, index starts from `0`.\n *\n * @default 1\n */\n startIndex?: number\n /**\n * Either a single number or an array of numbers which indicate at what percentage of the target's visibility the observer's callback should be executed.\n */\n threshold?: number | number[]\n /**\n * The callback invoked when trigger is intersect.\n */\n onLoad?: ({\n entry,\n finish,\n index,\n }: {\n index: number\n finish: () => void\n entry?: IntersectionObserverEntry\n }) => Promise<void> | void\n}\n\n/**\n * `useInfiniteScroll` is a custom hook for providing infinite scroll functionality.\n *\n * @see https://yamada-ui.com/docs/hooks/use-infinite-scroll\n */\nexport const useInfiniteScroll = <Y extends HTMLElement = HTMLDivElement>({\n behavior,\n disabled = false,\n indexRef: indexRefProp,\n initialLoad = false,\n orientation = \"vertical\",\n resetRef,\n reverse = false,\n rootMargin,\n rootRef,\n startIndex = initialLoad ? 0 : 1,\n threshold,\n onLoad: onLoadProp,\n}: UseInfiniteScrollProps = {}) => {\n const ref = useRef<Y>(null)\n const { getDocument, getWindow } = useEnvironment()\n const indexRef = useRef<number>(startIndex)\n const processingRef = useRef<boolean>(false)\n const observerRef = useRef<IntersectionObserver | undefined>(undefined)\n const [finish, setFinish] = useState<boolean>(false)\n const onLoad = useCallbackRef(onLoadProp)\n const vertical = orientation === \"vertical\"\n const direction = vertical ? \"top\" : \"left\"\n\n const onReset = useCallback(\n (index = 1, runScroll = true) => {\n indexRef.current = index\n\n setFinish(false)\n\n if (runScroll) {\n const root = rootRef?.current\n const body = getDocument()?.body\n const el = root && isScrollable(root, vertical) ? root : body\n\n if (el) {\n const target = el === body ? getWindow() : el\n const position = reverse\n ? vertical\n ? el.scrollHeight\n : el.scrollWidth\n : 0\n\n target?.scrollTo({ behavior, [direction]: position })\n }\n }\n\n if (disabled) return\n\n setTimeout(() => {\n const observer = observerRef.current\n const el = ref.current\n\n if (el) observer?.observe(el)\n })\n },\n [\n disabled,\n rootRef,\n getDocument,\n vertical,\n getWindow,\n reverse,\n behavior,\n direction,\n ],\n )\n\n const onFinish = useCallback(() => {\n const observer = observerRef.current\n const el = ref.current\n\n if (el) observer?.unobserve(el)\n\n setFinish(true)\n }, [])\n\n const createObserver = useCallback(() => {\n const root = rootRef?.current ?? null\n\n const observer = new IntersectionObserver(\n async ([entry]) => {\n const root = rootRef?.current\n const body = getDocument()?.body\n const el = root && isScrollable(root, vertical) ? root : body\n\n if (!entry?.isIntersecting || processingRef.current || !el) return\n\n const props = { entry, finish: onFinish, index: indexRef.current }\n\n processingRef.current = true\n\n if (root) root.ariaBusy = \"true\"\n\n let prevScrollPosition = 0\n\n if (reverse)\n prevScrollPosition = vertical ? el.scrollHeight : el.scrollWidth\n\n await onLoad(props)\n\n if (reverse)\n setTimeout(() => {\n const target = el === body ? getWindow() : el\n const position =\n (vertical ? el.scrollHeight : el.scrollWidth) - prevScrollPosition\n\n target?.scrollTo({ [direction]: position })\n })\n\n indexRef.current += 1\n processingRef.current = false\n\n if (root) root.ariaBusy = \"false\"\n },\n { root, rootMargin, threshold },\n )\n\n return observer\n }, [\n rootRef,\n rootMargin,\n threshold,\n getDocument,\n vertical,\n onFinish,\n reverse,\n onLoad,\n getWindow,\n direction,\n ])\n\n useEffect(() => {\n const setTabIndexAttribute = () => {\n const root = rootRef?.current\n if (\n root &&\n isScrollable(root, vertical) &&\n !root.hasAttribute(\"tabindex\")\n )\n root.setAttribute(\"tabindex\", \"0\")\n }\n\n const setupObserver = async () => {\n const el = ref.current\n const index = indexRef.current\n const root = rootRef?.current\n\n if (initialLoad) {\n processingRef.current = true\n\n if (root) root.ariaBusy = \"true\"\n\n await onLoad({ finish: onFinish, index })\n\n indexRef.current += 1\n processingRef.current = false\n\n if (root) root.ariaBusy = \"false\"\n }\n\n if (disabled) return\n\n observerRef.current = createObserver()\n\n const observer = observerRef.current\n\n if (reverse) {\n const root = rootRef?.current\n const body = getDocument()?.body\n const el = root && isScrollable(root, vertical) ? root : body\n\n if (el) {\n const target = el === body ? getWindow() : el\n const position = vertical ? el.scrollHeight : el.scrollWidth\n\n target?.scrollTo({ [direction]: position })\n }\n }\n\n setTimeout(() => {\n if (el) observer.observe(el)\n })\n\n return () => {\n if (el) observer.unobserve(el)\n }\n }\n\n setTabIndexAttribute()\n setupObserver()\n }, [\n createObserver,\n initialLoad,\n disabled,\n reverse,\n vertical,\n onFinish,\n onLoad,\n rootRef,\n getDocument,\n getWindow,\n direction,\n ])\n\n assignRef(resetRef, onReset)\n assignRef(indexRefProp, (index) => (indexRef.current = index))\n\n return { ref, finish }\n}\n"],"mappings":";;;;;AAQA,MAAM,gBAAgB,IAAiB,aAAsB;CAC3D,MAAM,QAAQ,iBAAiB,EAAE;CAEjC,IAAI;EAAC;EAAQ;EAAW;CAAQ,CAAC,CAAC,SAAS,MAAM,QAAQ,GAAG,OAAO;CAEnE,IAAI,UAAU,OAAO;EAAC;EAAQ;EAAW;CAAQ,CAAC,CAAC,SAAS,MAAM,SAAS;MACtE,OAAO;EAAC;EAAQ;EAAW;CAAQ,CAAC,CAAC,SAAS,MAAM,SAAS;AACpE;;;;;;AAkFA,MAAa,qBAA6D,EACxE,UACA,WAAW,OACX,UAAU,cACV,cAAc,OACd,cAAc,YACd,UACA,UAAU,OACV,YACA,SACA,aAAa,cAAc,IAAI,GAC/B,WACA,QAAQ,eACkB,CAAC,MAAM;CACjC,MAAM,MAAM,OAAU,IAAI;CAC1B,MAAM,EAAE,aAAa,cAAc,eAAe;CAClD,MAAM,WAAW,OAAe,UAAU;CAC1C,MAAM,gBAAgB,OAAgB,KAAK;CAC3C,MAAM,cAAc,OAAyC,KAAA,CAAS;CACtE,MAAM,CAAC,QAAQ,aAAa,SAAkB,KAAK;CACnD,MAAM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;GACF;GAEA,iBAAiB;IACf,IAAI,IAAI,SAAS,QAAQ,EAAE;GAC7B,CAAC;GAED,aAAa;IACX,IAAI,IAAI,SAAS,UAAU,EAAE;GAC/B;EACF;EAEA,qBAAqB;EACrB,cAAc;CAChB,GAAG;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,UAAU,UAAU,OAAO;CAC3B,UAAU,eAAe,UAAW,SAAS,UAAU,KAAM;CAE7D,OAAO;EAAE;EAAK;CAAO;AACvB"}
|
|
1
|
+
{"version":3,"file":"use-infinite-scroll.js","names":[],"sources":["../../../../src/components/infinite-scroll-area/use-infinite-scroll.ts"],"sourcesContent":["\"use client\"\n\nimport type { RefObject } from \"react\"\nimport type { Orientation } from \"../../core\"\nimport {\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from \"react\"\nimport { useEnvironment } from \"../../core\"\nimport { useCallbackRef } from \"../../utils\"\n\nconst isScrollable = (el: HTMLElement, vertical: boolean) => {\n const style = getComputedStyle(el)\n\n if ([\"auto\", \"overlay\", \"scroll\"].includes(style.overflow)) return true\n\n if (vertical) return [\"auto\", \"overlay\", \"scroll\"].includes(style.overflowY)\n else return [\"auto\", \"overlay\", \"scroll\"].includes(style.overflowX)\n}\n\nexport interface UseInfiniteScrollProps extends Omit<\n IntersectionObserverInit,\n \"root\"\n> {\n /**\n * Determines whether scrolling is instant or animates smoothly.\n */\n behavior?: ScrollBehavior\n /**\n * If `true`, the infinite scroll is disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * Ref to a reset index function.\n */\n indexRef?: RefObject<(index: number) => void>\n /**\n * If `true`, invoke `onLoad` function for the first time.\n *\n * @default false\n */\n initialLoad?: boolean\n /**\n * The orientation of the infinite scroll.\n *\n * @default 'vertical'\n */\n orientation?: Orientation\n /**\n * Ref to a reset function.\n */\n resetRef?: RefObject<(index?: number, runScroll?: boolean) => void>\n /**\n * If `true`, reverse direction.\n *\n * @default false\n */\n reverse?: boolean\n /**\n * Margin around the root. Can have values similar to the CSS margin property,\n * e.g. \"10px 20px 30px 40px\" (top, right, bottom, left).\n */\n rootMargin?: string\n /**\n * The element that is used as the viewport for checking visibility of the target.\n * Defaults to the browser viewport if not specified or if `null`.\n */\n rootRef?: null | RefObject<HTMLElement | null>\n /**\n * If set the `onLoad` function will start from the given index.\n * If `initialLoad` is `true`, index starts from `0`.\n *\n * @default 1\n */\n startIndex?: number\n /**\n * Either a single number or an array of numbers which indicate at what percentage of the target's visibility the observer's callback should be executed.\n */\n threshold?: number | number[]\n /**\n * The callback invoked when trigger is intersect.\n */\n onLoad?: ({\n entry,\n finish,\n index,\n }: {\n index: number\n finish: () => void\n entry?: IntersectionObserverEntry\n }) => Promise<void> | void\n}\n\n/**\n * `useInfiniteScroll` is a custom hook for providing infinite scroll functionality.\n *\n * @see https://yamada-ui.com/docs/hooks/use-infinite-scroll\n */\nexport const useInfiniteScroll = <Y extends HTMLElement = HTMLDivElement>({\n behavior,\n disabled = false,\n indexRef: indexRefProp,\n initialLoad = false,\n orientation = \"vertical\",\n resetRef,\n reverse = false,\n rootMargin,\n rootRef,\n startIndex = initialLoad ? 0 : 1,\n threshold,\n onLoad: onLoadProp,\n}: UseInfiniteScrollProps = {}) => {\n const ref = useRef<Y>(null)\n const { getDocument, getWindow } = useEnvironment()\n const indexRef = useRef<number>(startIndex)\n const processingRef = useRef<boolean>(false)\n const observerRef = useRef<IntersectionObserver | undefined>(undefined)\n const [finish, setFinish] = useState<boolean>(false)\n const onLoad = useCallbackRef(onLoadProp)\n const vertical = orientation === \"vertical\"\n const direction = vertical ? \"top\" : \"left\"\n\n const onReset = useCallback(\n (index = 1, runScroll = true) => {\n indexRef.current = index\n\n setFinish(false)\n\n if (runScroll) {\n const root = rootRef?.current\n const body = getDocument()?.body\n const el = root && isScrollable(root, vertical) ? root : body\n\n if (el) {\n const target = el === body ? getWindow() : el\n const position = reverse\n ? vertical\n ? el.scrollHeight\n : el.scrollWidth\n : 0\n\n target?.scrollTo({ behavior, [direction]: position })\n }\n }\n\n if (disabled) return\n\n setTimeout(() => {\n const observer = observerRef.current\n const el = ref.current\n\n if (el) observer?.observe(el)\n })\n },\n [\n disabled,\n rootRef,\n getDocument,\n vertical,\n getWindow,\n reverse,\n behavior,\n direction,\n ],\n )\n\n const onFinish = useCallback(() => {\n const observer = observerRef.current\n const el = ref.current\n\n if (el) observer?.unobserve(el)\n\n setFinish(true)\n }, [])\n\n const createObserver = useCallback(() => {\n const root = rootRef?.current ?? null\n\n const observer = new IntersectionObserver(\n async ([entry]) => {\n const root = rootRef?.current\n const body = getDocument()?.body\n const el = root && isScrollable(root, vertical) ? root : body\n\n if (!entry?.isIntersecting || processingRef.current || !el) return\n\n const props = { entry, finish: onFinish, index: indexRef.current }\n\n processingRef.current = true\n\n if (root) root.ariaBusy = \"true\"\n\n let prevScrollPosition = 0\n\n if (reverse)\n prevScrollPosition = vertical ? el.scrollHeight : el.scrollWidth\n\n await onLoad(props)\n\n if (reverse)\n setTimeout(() => {\n const target = el === body ? getWindow() : el\n const position =\n (vertical ? el.scrollHeight : el.scrollWidth) - prevScrollPosition\n\n target?.scrollTo({ [direction]: position })\n })\n\n indexRef.current += 1\n processingRef.current = false\n\n if (root) root.ariaBusy = \"false\"\n },\n { root, rootMargin, threshold },\n )\n\n return observer\n }, [\n rootRef,\n rootMargin,\n threshold,\n getDocument,\n vertical,\n onFinish,\n reverse,\n onLoad,\n getWindow,\n direction,\n ])\n\n useEffect(() => {\n const setTabIndexAttribute = () => {\n const root = rootRef?.current\n if (\n root &&\n isScrollable(root, vertical) &&\n !root.hasAttribute(\"tabindex\")\n )\n root.setAttribute(\"tabindex\", \"0\")\n }\n\n const setupObserver = async () => {\n const el = ref.current\n const index = indexRef.current\n const root = rootRef?.current\n\n if (initialLoad) {\n processingRef.current = true\n\n if (root) root.ariaBusy = \"true\"\n\n await onLoad({ finish: onFinish, index })\n\n indexRef.current += 1\n processingRef.current = false\n\n if (root) root.ariaBusy = \"false\"\n }\n\n if (disabled) return\n\n observerRef.current = createObserver()\n\n const observer = observerRef.current\n\n if (reverse) {\n const root = rootRef?.current\n const body = getDocument()?.body\n const el = root && isScrollable(root, vertical) ? root : body\n\n if (el) {\n const target = el === body ? getWindow() : el\n const position = vertical ? el.scrollHeight : el.scrollWidth\n\n target?.scrollTo({ [direction]: position })\n }\n }\n\n setTimeout(() => {\n if (el) observer.observe(el)\n })\n\n return () => {\n if (el) observer.unobserve(el)\n }\n }\n\n setTabIndexAttribute()\n setupObserver()\n }, [\n createObserver,\n initialLoad,\n disabled,\n reverse,\n vertical,\n onFinish,\n onLoad,\n rootRef,\n getDocument,\n getWindow,\n direction,\n ])\n\n useImperativeHandle(resetRef, () => onReset, [onReset])\n useImperativeHandle(\n indexRefProp,\n () => (index: number) => {\n indexRef.current = index\n },\n [],\n )\n\n return { ref, finish }\n}\n"],"mappings":";;;;;AAcA,MAAM,gBAAgB,IAAiB,aAAsB;CAC3D,MAAM,QAAQ,iBAAiB,EAAE;CAEjC,IAAI;EAAC;EAAQ;EAAW;CAAQ,CAAC,CAAC,SAAS,MAAM,QAAQ,GAAG,OAAO;CAEnE,IAAI,UAAU,OAAO;EAAC;EAAQ;EAAW;CAAQ,CAAC,CAAC,SAAS,MAAM,SAAS;MACtE,OAAO;EAAC;EAAQ;EAAW;CAAQ,CAAC,CAAC,SAAS,MAAM,SAAS;AACpE;;;;;;AAkFA,MAAa,qBAA6D,EACxE,UACA,WAAW,OACX,UAAU,cACV,cAAc,OACd,cAAc,YACd,UACA,UAAU,OACV,YACA,SACA,aAAa,cAAc,IAAI,GAC/B,WACA,QAAQ,eACkB,CAAC,MAAM;CACjC,MAAM,MAAM,OAAU,IAAI;CAC1B,MAAM,EAAE,aAAa,cAAc,eAAe;CAClD,MAAM,WAAW,OAAe,UAAU;CAC1C,MAAM,gBAAgB,OAAgB,KAAK;CAC3C,MAAM,cAAc,OAAyC,KAAA,CAAS;CACtE,MAAM,CAAC,QAA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AS,GAAG,YAAY,SAAS,CAAC;IAC5C;GACF;GAEA,iBAAiB;IACf,IAAI,IAAI,SAAS,QAAQ,EAAE;GAC7B,CAAC;GAED,aAAa;IACX,IAAI,IAAI,SAAS,UAAU,EAAE;GAC/B;EACF;EAEA,qBAAqB;EACrB,cAAc;CAChB,GAAG;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,oBAAoB,gBAAgB,SAAS,CAAC,OAAO,CAAC;CACtD,oBACE,qBACO,UAAkB;EACvB,SAAS,UAAU;CACrB,GACA,CAAC,CACH;CAEA,OAAO;EAAE;EAAK;CAAO;AACvB"}
|
|
@@ -1,35 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useUpdateEffect } from "../../utils/effect.js";
|
|
3
|
-
import { assignRef } from "../../utils/ref.js";
|
|
4
3
|
import { utils_exports } from "../../utils/index.js";
|
|
5
4
|
import { Portal } from "../portal/portal.js";
|
|
6
5
|
import { Background } from "./background.js";
|
|
7
6
|
import { Page } from "./page.js";
|
|
8
7
|
import { Screen } from "./screen.js";
|
|
9
|
-
import { createContext,
|
|
8
|
+
import { createContext, use, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
10
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
10
|
import { AnimatePresence } from "motion/react";
|
|
12
11
|
import { RemoveScroll } from "react-remove-scroll";
|
|
13
12
|
// src/components/loading/loading-provider.tsx
|
|
14
13
|
const LoadingContext = createContext({});
|
|
15
|
-
const
|
|
16
|
-
finish:
|
|
17
|
-
force:
|
|
18
|
-
start:
|
|
19
|
-
update:
|
|
20
|
-
});
|
|
21
|
-
const createMethods = (refs) => ({
|
|
22
|
-
finish: () => refs.current.finish.current?.(),
|
|
23
|
-
force: (state) => refs.current.force.current?.(state),
|
|
24
|
-
start: (props) => refs.current.start.current?.(props),
|
|
25
|
-
update: (props) => refs.current.update.current?.(props)
|
|
14
|
+
const createMethods = (ref) => ({
|
|
15
|
+
finish: () => ref.current?.finish(),
|
|
16
|
+
force: (state) => ref.current?.force(state),
|
|
17
|
+
start: (props) => ref.current?.start(props),
|
|
18
|
+
update: (props) => ref.current?.update(props)
|
|
26
19
|
});
|
|
27
20
|
const incrementCount = (prev) => prev + 1;
|
|
28
21
|
const decrementCount = (prev) => prev === 0 ? prev : prev - 1;
|
|
29
22
|
const LoadingProvider = ({ background: backgroundConfig, children, page: pageConfig, screen: screenConfig }) => {
|
|
30
|
-
const screen = useRef(
|
|
31
|
-
const page = useRef(
|
|
32
|
-
const background = useRef(
|
|
23
|
+
const screen = useRef(null);
|
|
24
|
+
const page = useRef(null);
|
|
25
|
+
const background = useRef(null);
|
|
33
26
|
const value = useMemo(() => ({
|
|
34
27
|
background: createMethods(background),
|
|
35
28
|
page: createMethods(page),
|
|
@@ -38,7 +31,6 @@ const LoadingProvider = ({ background: backgroundConfig, children, page: pageCon
|
|
|
38
31
|
return /* @__PURE__ */ jsxs(LoadingContext, {
|
|
39
32
|
value,
|
|
40
33
|
children: [
|
|
41
|
-
children,
|
|
42
34
|
/* @__PURE__ */ jsx(Controller, {
|
|
43
35
|
ref: screen,
|
|
44
36
|
...screenConfig,
|
|
@@ -54,7 +46,8 @@ const LoadingProvider = ({ background: backgroundConfig, children, page: pageCon
|
|
|
54
46
|
...backgroundConfig,
|
|
55
47
|
blockScrollOnMount: backgroundConfig?.blockScrollOnMount ?? false,
|
|
56
48
|
component: Background
|
|
57
|
-
})
|
|
49
|
+
}),
|
|
50
|
+
children
|
|
58
51
|
]
|
|
59
52
|
});
|
|
60
53
|
};
|
|
@@ -66,7 +59,7 @@ const Controller = ({ ref, allowPinchZoom = false, blockScrollOnMount = true, co
|
|
|
66
59
|
loadingScheme: loadingSchemeProp,
|
|
67
60
|
message: void 0
|
|
68
61
|
});
|
|
69
|
-
const
|
|
62
|
+
const methods = useMemo(() => ({
|
|
70
63
|
finish: () => {
|
|
71
64
|
loading.current = false;
|
|
72
65
|
setState(({ loadingCount }) => ({
|
|
@@ -99,16 +92,13 @@ const Controller = ({ ref, allowPinchZoom = false, blockScrollOnMount = true, co
|
|
|
99
92
|
...next
|
|
100
93
|
}))
|
|
101
94
|
}), [durationProp, loadingSchemeProp]);
|
|
102
|
-
|
|
103
|
-
assignRef(ref.current.finish, finish);
|
|
104
|
-
assignRef(ref.current.update, update);
|
|
105
|
-
assignRef(ref.current.force, force);
|
|
95
|
+
useImperativeHandle(ref, () => methods, [methods]);
|
|
106
96
|
const props = {
|
|
107
97
|
duration,
|
|
108
98
|
initial: loadingCountProp > 0 ? false : "initial",
|
|
109
99
|
loadingScheme,
|
|
110
100
|
message,
|
|
111
|
-
onFinish: finish
|
|
101
|
+
onFinish: methods.finish
|
|
112
102
|
};
|
|
113
103
|
useUpdateEffect(() => {
|
|
114
104
|
if (loadingCountProp > 0 || (0, utils_exports.isNumber)(durationProp)) setState({
|