@arolariu/components 1.0.0 → 1.1.0
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/CHANGELOG.md +57 -0
- package/EXAMPLES.md +2510 -0
- package/dist/components/ui/alert-dialog.d.ts +4 -16
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +18 -14
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/avatar.d.ts +3 -12
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar.js +18 -15
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button-group.d.ts.map +1 -1
- package/dist/components/ui/calendar.d.ts +1 -4
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +7 -7
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js.map +1 -1
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +125 -59
- package/dist/components/ui/chart.js.map +1 -1
- package/dist/components/ui/checkbox-group.d.ts +2 -6
- package/dist/components/ui/checkbox-group.d.ts.map +1 -1
- package/dist/components/ui/checkbox-group.js +8 -7
- package/dist/components/ui/checkbox-group.js.map +1 -1
- package/dist/components/ui/checkbox.d.ts +3 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +4 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js.map +1 -1
- package/dist/components/ui/combobox.d.ts +335 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox.js +206 -0
- package/dist/components/ui/combobox.js.map +1 -0
- package/dist/components/ui/combobox.module.js +23 -0
- package/dist/components/ui/combobox.module.js.map +1 -0
- package/dist/components/ui/combobox_module.css +142 -0
- package/dist/components/ui/combobox_module.css.map +1 -0
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +25 -16
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdrawer.d.ts +10 -16
- package/dist/components/ui/dropdrawer.d.ts.map +1 -1
- package/dist/components/ui/dropdrawer.js +28 -20
- package/dist/components/ui/dropdrawer.js.map +1 -1
- package/dist/components/ui/item.d.ts +1 -1
- package/dist/components/ui/item.d.ts.map +1 -1
- package/dist/components/ui/menubar.d.ts +11 -13
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/meter.d.ts +8 -24
- package/dist/components/ui/meter.d.ts.map +1 -1
- package/dist/components/ui/meter.js +23 -19
- package/dist/components/ui/meter.js.map +1 -1
- package/dist/components/ui/navigation-menu.d.ts +3 -12
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +14 -11
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/number-field.d.ts +6 -12
- package/dist/components/ui/number-field.d.ts.map +1 -1
- package/dist/components/ui/number-field.js.map +1 -1
- package/dist/components/ui/progress.d.ts +1 -4
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +10 -9
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.d.ts +2 -4
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/resizable.d.ts +3 -3
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/scratcher.d.ts +1 -1
- package/dist/components/ui/scratcher.d.ts.map +1 -1
- package/dist/components/ui/scratcher.js +5 -4
- package/dist/components/ui/scratcher.js.map +1 -1
- package/dist/components/ui/scroll-area.d.ts +2 -4
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/separator.d.ts +1 -4
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/separator.js +9 -8
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/sonner.d.ts +5 -4
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/sonner.js +7 -6
- package/dist/components/ui/sonner.js.map +1 -1
- package/dist/components/ui/toggle-group.d.ts +2 -8
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +12 -10
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toolbar.d.ts +10 -30
- package/dist/components/ui/toolbar.d.ts.map +1 -1
- package/dist/components/ui/toolbar.js +28 -23
- package/dist/components/ui/toolbar.js.map +1 -1
- package/dist/hooks/useClipboard.d.ts +77 -0
- package/dist/hooks/useClipboard.d.ts.map +1 -0
- package/dist/hooks/useClipboard.js +42 -0
- package/dist/hooks/useClipboard.js.map +1 -0
- package/dist/hooks/useControllableState.d.ts +54 -0
- package/dist/hooks/useControllableState.d.ts.map +1 -0
- package/dist/hooks/useControllableState.js +29 -0
- package/dist/hooks/useControllableState.js.map +1 -0
- package/dist/hooks/useDebounce.d.ts +33 -0
- package/dist/hooks/useDebounce.d.ts.map +1 -0
- package/dist/hooks/useDebounce.js +20 -0
- package/dist/hooks/useDebounce.js.map +1 -0
- package/dist/hooks/useEventCallback.d.ts +34 -0
- package/dist/hooks/useEventCallback.d.ts.map +1 -0
- package/dist/hooks/useEventCallback.js +12 -0
- package/dist/hooks/useEventCallback.js.map +1 -0
- package/dist/hooks/useId.d.ts +30 -0
- package/dist/hooks/useId.d.ts.map +1 -0
- package/dist/hooks/useId.js +9 -0
- package/dist/hooks/useId.js.map +1 -0
- package/dist/hooks/useIntersectionObserver.d.ts +51 -0
- package/dist/hooks/useIntersectionObserver.d.ts.map +1 -0
- package/dist/hooks/useIntersectionObserver.js +25 -0
- package/dist/hooks/useIntersectionObserver.js.map +1 -0
- package/dist/hooks/useInterval.d.ts +55 -0
- package/dist/hooks/useInterval.d.ts.map +1 -0
- package/dist/hooks/useInterval.js +24 -0
- package/dist/hooks/useInterval.js.map +1 -0
- package/dist/hooks/useLocalStorage.d.ts +43 -0
- package/dist/hooks/useLocalStorage.d.ts.map +1 -0
- package/dist/hooks/useLocalStorage.js +53 -0
- package/dist/hooks/useLocalStorage.js.map +1 -0
- package/dist/hooks/useMergedRefs.d.ts +27 -0
- package/dist/hooks/useMergedRefs.d.ts.map +1 -0
- package/dist/hooks/useMergedRefs.js +11 -0
- package/dist/hooks/useMergedRefs.js.map +1 -0
- package/dist/hooks/useOnClickOutside.d.ts +32 -0
- package/dist/hooks/useOnClickOutside.d.ts.map +1 -0
- package/dist/hooks/useOnClickOutside.js +23 -0
- package/dist/hooks/useOnClickOutside.js.map +1 -0
- package/dist/hooks/usePrevious.d.ts +33 -0
- package/dist/hooks/usePrevious.d.ts.map +1 -0
- package/dist/hooks/usePrevious.js +14 -0
- package/dist/hooks/usePrevious.js.map +1 -0
- package/dist/hooks/useThrottle.d.ts +37 -0
- package/dist/hooks/useThrottle.d.ts.map +1 -0
- package/dist/hooks/useThrottle.js +34 -0
- package/dist/hooks/useThrottle.js.map +1 -0
- package/dist/hooks/useTimeout.d.ts +28 -0
- package/dist/hooks/useTimeout.d.ts.map +1 -0
- package/dist/hooks/useTimeout.js +24 -0
- package/dist/hooks/useTimeout.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/lib/utilities.d.ts +2 -3
- package/dist/lib/utilities.d.ts.map +1 -1
- package/dist/lib/utilities.js.map +1 -1
- package/dist/motion/tokens.js +5 -5
- package/dist/motion/tokens.js.map +1 -1
- package/dist/rslib-runtime.js +39 -0
- package/dist/rslib-runtime.js.map +1 -0
- package/package.json +82 -3
- package/src/components/ui/alert-dialog.tsx +15 -8
- package/src/components/ui/avatar.tsx +9 -6
- package/src/components/ui/calendar.tsx +7 -13
- package/src/components/ui/carousel.tsx +2 -0
- package/src/components/ui/chart.tsx +63 -60
- package/src/components/ui/checkbox-group.tsx +4 -5
- package/src/components/ui/checkbox.tsx +10 -2
- package/src/components/ui/collapsible.tsx +1 -0
- package/src/components/ui/combobox.module.css +158 -0
- package/src/components/ui/combobox.tsx +569 -0
- package/src/components/ui/command.tsx +31 -15
- package/src/components/ui/context-menu.tsx +3 -0
- package/src/components/ui/drawer.tsx +2 -0
- package/src/components/ui/dropdown-menu.tsx +3 -0
- package/src/components/ui/dropdrawer.tsx +80 -62
- package/src/components/ui/menubar.tsx +9 -10
- package/src/components/ui/meter.tsx +16 -17
- package/src/components/ui/navigation-menu.tsx +41 -33
- package/src/components/ui/number-field.tsx +6 -13
- package/src/components/ui/progress.tsx +3 -2
- package/src/components/ui/radio-group.tsx +2 -5
- package/src/components/ui/resizable.tsx +2 -2
- package/src/components/ui/scratcher.tsx +6 -10
- package/src/components/ui/scroll-area.tsx +2 -5
- package/src/components/ui/separator.tsx +4 -3
- package/src/components/ui/sheet.tsx +3 -0
- package/src/components/ui/sidebar.tsx +1 -0
- package/src/components/ui/sonner.tsx +20 -12
- package/src/components/ui/toggle-group.tsx +6 -4
- package/src/components/ui/toolbar.tsx +20 -21
- package/src/hooks/useClipboard.tsx +137 -0
- package/src/hooks/useControllableState.tsx +81 -0
- package/src/hooks/useDebounce.tsx +50 -0
- package/src/hooks/useEventCallback.tsx +47 -0
- package/src/hooks/useId.tsx +36 -0
- package/src/hooks/useIntersectionObserver.tsx +81 -0
- package/src/hooks/useInterval.tsx +80 -0
- package/src/hooks/useLocalStorage.tsx +111 -0
- package/src/hooks/useMergedRefs.tsx +48 -0
- package/src/hooks/useOnClickOutside.tsx +55 -0
- package/src/hooks/usePrevious.tsx +44 -0
- package/src/hooks/useThrottle.tsx +78 -0
- package/src/hooks/useTimeout.tsx +51 -0
- package/src/index.ts +23 -0
- package/src/lib/utilities.ts +4 -4
- package/src/motion/tokens.ts +4 -4
- package/src/stories/DesignPrinciples.mdx +48 -0
- package/src/stories/GettingStarted.mdx +92 -0
- package/src/stories/Welcome.mdx +44 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
/* eslint-disable complexity, react/no-object-type-as-default-prop, react/no-danger, react-dom/no-dangerously-set-innerhtml, unicorn/no-negated-condition */
|
|
3
|
+
/* eslint-disable complexity, sonarjs/cognitive-complexity, react/no-object-type-as-default-prop, react/no-danger, react-dom/no-dangerously-set-innerhtml, unicorn/no-negated-condition */
|
|
4
4
|
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import type {DefaultTooltipContentProps, LegendPayload, ResponsiveContainerProps, TooltipValueType} from "recharts";
|
|
@@ -448,6 +448,7 @@ function ChartLegendContent({
|
|
|
448
448
|
);
|
|
449
449
|
}
|
|
450
450
|
|
|
451
|
+
// eslint-disable-next-line sonarjs/function-return-type
|
|
451
452
|
function formatChartValue(value: TooltipValueType, itemConfig: ChartConfig[string] | undefined): React.ReactNode {
|
|
452
453
|
if (typeof value === "number") {
|
|
453
454
|
return itemConfig?.formatter ? itemConfig.formatter(value) : value.toLocaleString();
|
|
@@ -456,6 +457,7 @@ function formatChartValue(value: TooltipValueType, itemConfig: ChartConfig[strin
|
|
|
456
457
|
return String(value);
|
|
457
458
|
}
|
|
458
459
|
|
|
460
|
+
// eslint-disable-next-line sonarjs/function-return-type
|
|
459
461
|
function formatLegendDataKey(dataKey: LegendPayload["dataKey"]): string | null {
|
|
460
462
|
return typeof dataKey === "number" || typeof dataKey === "string" ? String(dataKey) : null;
|
|
461
463
|
}
|
|
@@ -499,85 +501,85 @@ export {ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartToolti
|
|
|
499
501
|
|
|
500
502
|
// -- Chart containers -------------------------------------------------------
|
|
501
503
|
/** @see {@link https://recharts.github.io/en-US/api/AreaChart | AreaChart API} */
|
|
502
|
-
export const AreaChart = RechartsPrimitive
|
|
504
|
+
export const {AreaChart} = RechartsPrimitive;
|
|
503
505
|
/** @see {@link https://recharts.github.io/en-US/api/BarChart | BarChart API} */
|
|
504
|
-
export const BarChart = RechartsPrimitive
|
|
506
|
+
export const {BarChart} = RechartsPrimitive;
|
|
505
507
|
/** @see {@link https://recharts.github.io/en-US/api/ComposedChart | ComposedChart API} */
|
|
506
|
-
export const ComposedChart = RechartsPrimitive
|
|
508
|
+
export const {ComposedChart} = RechartsPrimitive;
|
|
507
509
|
/** @see {@link https://recharts.github.io/en-US/api/FunnelChart | FunnelChart API} */
|
|
508
|
-
export const FunnelChart = RechartsPrimitive
|
|
510
|
+
export const {FunnelChart} = RechartsPrimitive;
|
|
509
511
|
/** @see {@link https://recharts.github.io/en-US/api/LineChart | LineChart API} */
|
|
510
|
-
export const LineChart = RechartsPrimitive
|
|
512
|
+
export const {LineChart} = RechartsPrimitive;
|
|
511
513
|
/** @see {@link https://recharts.github.io/en-US/api/PieChart | PieChart API} */
|
|
512
|
-
export const PieChart = RechartsPrimitive
|
|
514
|
+
export const {PieChart} = RechartsPrimitive;
|
|
513
515
|
/** @see {@link https://recharts.github.io/en-US/api/RadarChart | RadarChart API} */
|
|
514
|
-
export const RadarChart = RechartsPrimitive
|
|
516
|
+
export const {RadarChart} = RechartsPrimitive;
|
|
515
517
|
/** @see {@link https://recharts.github.io/en-US/api/RadialBarChart | RadialBarChart API} */
|
|
516
|
-
export const RadialBarChart = RechartsPrimitive
|
|
518
|
+
export const {RadialBarChart} = RechartsPrimitive;
|
|
517
519
|
/** @see {@link https://recharts.github.io/en-US/api/ScatterChart | ScatterChart API} */
|
|
518
|
-
export const ScatterChart = RechartsPrimitive
|
|
520
|
+
export const {ScatterChart} = RechartsPrimitive;
|
|
519
521
|
/** @see {@link https://recharts.github.io/en-US/api/Sankey | Sankey API} */
|
|
520
|
-
export const Sankey = RechartsPrimitive
|
|
522
|
+
export const {Sankey} = RechartsPrimitive;
|
|
521
523
|
/** @see {@link https://recharts.github.io/en-US/api/SunburstChart | SunburstChart API} */
|
|
522
|
-
export const SunburstChart = RechartsPrimitive
|
|
524
|
+
export const {SunburstChart} = RechartsPrimitive;
|
|
523
525
|
/** @see {@link https://recharts.github.io/en-US/api/Treemap | Treemap API} */
|
|
524
|
-
export const Treemap = RechartsPrimitive
|
|
526
|
+
export const {Treemap} = RechartsPrimitive;
|
|
525
527
|
|
|
526
528
|
// -- Series elements --------------------------------------------------------
|
|
527
529
|
/** @see {@link https://recharts.github.io/en-US/api/Area | Area API} */
|
|
528
|
-
export const Area = RechartsPrimitive
|
|
530
|
+
export const {Area} = RechartsPrimitive;
|
|
529
531
|
/** @see {@link https://recharts.github.io/en-US/api/Bar | Bar API} */
|
|
530
|
-
export const Bar = RechartsPrimitive
|
|
532
|
+
export const {Bar} = RechartsPrimitive;
|
|
531
533
|
/**
|
|
532
534
|
* Groups stacked bars and configures shared stack properties such as radius.
|
|
533
535
|
* @since recharts 3.6
|
|
534
536
|
* @see {@link https://recharts.github.io/en-US/guide/roundedBars | BarStack Guide}
|
|
535
537
|
*/
|
|
536
|
-
export const BarStack = RechartsPrimitive
|
|
538
|
+
export const {BarStack} = RechartsPrimitive;
|
|
537
539
|
/** @see {@link https://recharts.github.io/en-US/api/Funnel | Funnel API} */
|
|
538
|
-
export const Funnel = RechartsPrimitive
|
|
540
|
+
export const {Funnel} = RechartsPrimitive;
|
|
539
541
|
/** @see {@link https://recharts.github.io/en-US/api/Line | Line API} */
|
|
540
|
-
export const Line = RechartsPrimitive
|
|
542
|
+
export const {Line} = RechartsPrimitive;
|
|
541
543
|
/** @see {@link https://recharts.github.io/en-US/api/Pie | Pie API} */
|
|
542
|
-
export const Pie = RechartsPrimitive
|
|
544
|
+
export const {Pie} = RechartsPrimitive;
|
|
543
545
|
/** @see {@link https://recharts.github.io/en-US/api/Radar | Radar API} */
|
|
544
|
-
export const Radar = RechartsPrimitive
|
|
546
|
+
export const {Radar} = RechartsPrimitive;
|
|
545
547
|
/** @see {@link https://recharts.github.io/en-US/api/RadialBar | RadialBar API} */
|
|
546
|
-
export const RadialBar = RechartsPrimitive
|
|
548
|
+
export const {RadialBar} = RechartsPrimitive;
|
|
547
549
|
/** @see {@link https://recharts.github.io/en-US/api/Scatter | Scatter API} */
|
|
548
|
-
export const Scatter = RechartsPrimitive
|
|
550
|
+
export const {Scatter} = RechartsPrimitive;
|
|
549
551
|
|
|
550
552
|
// -- Axis & grid ------------------------------------------------------------
|
|
551
553
|
/** @see {@link https://recharts.github.io/en-US/api/CartesianGrid | CartesianGrid API} */
|
|
552
|
-
export const CartesianGrid = RechartsPrimitive
|
|
554
|
+
export const {CartesianGrid} = RechartsPrimitive;
|
|
553
555
|
/** @see {@link https://recharts.github.io/en-US/api/PolarAngleAxis | PolarAngleAxis API} */
|
|
554
|
-
export const PolarAngleAxis = RechartsPrimitive
|
|
556
|
+
export const {PolarAngleAxis} = RechartsPrimitive;
|
|
555
557
|
/** @see {@link https://recharts.github.io/en-US/api/PolarGrid | PolarGrid API} */
|
|
556
|
-
export const PolarGrid = RechartsPrimitive
|
|
558
|
+
export const {PolarGrid} = RechartsPrimitive;
|
|
557
559
|
/** @see {@link https://recharts.github.io/en-US/api/PolarRadiusAxis | PolarRadiusAxis API} */
|
|
558
|
-
export const PolarRadiusAxis = RechartsPrimitive
|
|
560
|
+
export const {PolarRadiusAxis} = RechartsPrimitive;
|
|
559
561
|
/** @see {@link https://recharts.github.io/en-US/api/XAxis | XAxis API} – supports `type: "auto"` since v3.7. */
|
|
560
|
-
export const XAxis = RechartsPrimitive
|
|
562
|
+
export const {XAxis} = RechartsPrimitive;
|
|
561
563
|
/** @see {@link https://recharts.github.io/en-US/api/YAxis | YAxis API} – supports `type: "auto"` since v3.7. */
|
|
562
|
-
export const YAxis = RechartsPrimitive
|
|
564
|
+
export const {YAxis} = RechartsPrimitive;
|
|
563
565
|
/** @see {@link https://recharts.github.io/en-US/api/ZAxis | ZAxis API} */
|
|
564
|
-
export const ZAxis = RechartsPrimitive
|
|
566
|
+
export const {ZAxis} = RechartsPrimitive;
|
|
565
567
|
|
|
566
568
|
// -- Annotations & overlays ------------------------------------------------
|
|
567
569
|
/** @see {@link https://recharts.github.io/en-US/api/Brush | Brush API} */
|
|
568
|
-
export const Brush = RechartsPrimitive
|
|
570
|
+
export const {Brush} = RechartsPrimitive;
|
|
569
571
|
/** @see {@link https://recharts.github.io/en-US/api/ErrorBar | ErrorBar API} */
|
|
570
|
-
export const ErrorBar = RechartsPrimitive
|
|
572
|
+
export const {ErrorBar} = RechartsPrimitive;
|
|
571
573
|
/** @see {@link https://recharts.github.io/en-US/api/Label | Label API} */
|
|
572
|
-
export const RechartsLabel = RechartsPrimitive
|
|
574
|
+
export const {Label: RechartsLabel} = RechartsPrimitive;
|
|
573
575
|
/** @see {@link https://recharts.github.io/en-US/api/LabelList | LabelList API} */
|
|
574
|
-
export const LabelList = RechartsPrimitive
|
|
576
|
+
export const {LabelList} = RechartsPrimitive;
|
|
575
577
|
/** @see {@link https://recharts.github.io/en-US/api/ReferenceArea | ReferenceArea API} */
|
|
576
|
-
export const ReferenceArea = RechartsPrimitive
|
|
578
|
+
export const {ReferenceArea} = RechartsPrimitive;
|
|
577
579
|
/** @see {@link https://recharts.github.io/en-US/api/ReferenceDot | ReferenceDot API} */
|
|
578
|
-
export const ReferenceDot = RechartsPrimitive
|
|
580
|
+
export const {ReferenceDot} = RechartsPrimitive;
|
|
579
581
|
/** @see {@link https://recharts.github.io/en-US/api/ReferenceLine | ReferenceLine API} */
|
|
580
|
-
export const ReferenceLine = RechartsPrimitive
|
|
582
|
+
export const {ReferenceLine} = RechartsPrimitive;
|
|
581
583
|
|
|
582
584
|
// -- Layout -----------------------------------------------------------------
|
|
583
585
|
/**
|
|
@@ -585,54 +587,55 @@ export const ReferenceLine = RechartsPrimitive.ReferenceLine;
|
|
|
585
587
|
* alternatively use the `responsive` prop directly on chart containers.
|
|
586
588
|
* @see {@link https://recharts.github.io/en-US/api/ResponsiveContainer | ResponsiveContainer API}
|
|
587
589
|
*/
|
|
588
|
-
export const ResponsiveContainer = RechartsPrimitive
|
|
590
|
+
export const {ResponsiveContainer} = RechartsPrimitive;
|
|
589
591
|
/** @see {@link https://recharts.github.io/en-US/api/Customized | Customized API} */
|
|
590
|
-
export const Customized = RechartsPrimitive
|
|
592
|
+
export const {Customized} = RechartsPrimitive;
|
|
591
593
|
|
|
592
594
|
// -- Shapes -----------------------------------------------------------------
|
|
593
595
|
/**
|
|
594
596
|
* @deprecated Since recharts 3.7. Use the `shape` prop on chart series elements instead.
|
|
595
597
|
* @see {@link https://recharts.github.io/en-US/api/Cell | Cell API}
|
|
596
598
|
*/
|
|
597
|
-
|
|
598
|
-
export const
|
|
599
|
-
export const
|
|
600
|
-
export const
|
|
601
|
-
export const
|
|
602
|
-
export const
|
|
603
|
-
export const
|
|
604
|
-
export const
|
|
605
|
-
export const
|
|
599
|
+
// eslint-disable-next-line sonarjs/deprecation
|
|
600
|
+
export const {Cell} = RechartsPrimitive;
|
|
601
|
+
export const {Cross} = RechartsPrimitive;
|
|
602
|
+
export const {Curve} = RechartsPrimitive;
|
|
603
|
+
export const {Dot} = RechartsPrimitive;
|
|
604
|
+
export const {Polygon} = RechartsPrimitive;
|
|
605
|
+
export const {Rectangle} = RechartsPrimitive;
|
|
606
|
+
export const {Sector} = RechartsPrimitive;
|
|
607
|
+
export const {Symbols} = RechartsPrimitive;
|
|
608
|
+
export const {Trapezoid} = RechartsPrimitive;
|
|
606
609
|
|
|
607
610
|
// -- Z-index (v3.4+) -------------------------------------------------------
|
|
608
611
|
/** @since recharts 3.4 @see {@link https://recharts.github.io/en-US/guide/zIndex | Z-Index Guide} */
|
|
609
|
-
export const ZIndexLayer = RechartsPrimitive
|
|
612
|
+
export const {ZIndexLayer} = RechartsPrimitive;
|
|
610
613
|
/** Default z-index ordering constants. @since recharts 3.4 */
|
|
611
|
-
export const DefaultZIndexes = RechartsPrimitive
|
|
614
|
+
export const {DefaultZIndexes} = RechartsPrimitive;
|
|
612
615
|
|
|
613
616
|
// -- Hooks (v3+) ------------------------------------------------------------
|
|
614
617
|
/** Returns the current chart width in pixels. */
|
|
615
|
-
export const useChartWidth = RechartsPrimitive
|
|
618
|
+
export const {useChartWidth} = RechartsPrimitive;
|
|
616
619
|
/** Returns the current chart height in pixels. */
|
|
617
|
-
export const useChartHeight = RechartsPrimitive
|
|
620
|
+
export const {useChartHeight} = RechartsPrimitive;
|
|
618
621
|
/** Returns the chart offset (margins, axes). */
|
|
619
|
-
export const useOffset = RechartsPrimitive
|
|
622
|
+
export const {useOffset} = RechartsPrimitive;
|
|
620
623
|
/** Returns the plot area dimensions. */
|
|
621
|
-
export const usePlotArea = RechartsPrimitive
|
|
624
|
+
export const {usePlotArea} = RechartsPrimitive;
|
|
622
625
|
/** Returns the chart margin. */
|
|
623
|
-
export const useMargin = RechartsPrimitive
|
|
626
|
+
export const {useMargin} = RechartsPrimitive;
|
|
624
627
|
/** Returns whether the tooltip is currently active. @since recharts 3.7 */
|
|
625
|
-
export const useIsTooltipActive = RechartsPrimitive
|
|
628
|
+
export const {useIsTooltipActive} = RechartsPrimitive;
|
|
626
629
|
/** Returns the active tooltip coordinate. @since recharts 3.7 */
|
|
627
|
-
export const useActiveTooltipCoordinate = RechartsPrimitive
|
|
630
|
+
export const {useActiveTooltipCoordinate} = RechartsPrimitive;
|
|
628
631
|
/** Returns the active tooltip data points. */
|
|
629
|
-
export const useActiveTooltipDataPoints = RechartsPrimitive
|
|
632
|
+
export const {useActiveTooltipDataPoints} = RechartsPrimitive;
|
|
630
633
|
/** Returns the active tooltip label. */
|
|
631
|
-
export const useActiveTooltipLabel = RechartsPrimitive
|
|
634
|
+
export const {useActiveTooltipLabel} = RechartsPrimitive;
|
|
632
635
|
/** Returns the current X-axis domain. */
|
|
633
|
-
export const useXAxisDomain = RechartsPrimitive
|
|
636
|
+
export const {useXAxisDomain} = RechartsPrimitive;
|
|
634
637
|
/** Returns the current Y-axis domain. */
|
|
635
|
-
export const useYAxisDomain = RechartsPrimitive
|
|
638
|
+
export const {useYAxisDomain} = RechartsPrimitive;
|
|
636
639
|
|
|
637
640
|
// -- Type re-exports --------------------------------------------------------
|
|
638
641
|
export type {DefaultLegendContentProps, DefaultTooltipContentProps, TooltipValueType} from "recharts";
|
|
@@ -8,8 +8,6 @@ import * as React from "react";
|
|
|
8
8
|
import {cn} from "@/lib/utilities";
|
|
9
9
|
import styles from "./checkbox-group.module.css";
|
|
10
10
|
|
|
11
|
-
type CheckboxGroupProps = React.ComponentPropsWithRef<typeof BaseCheckboxGroup>;
|
|
12
|
-
|
|
13
11
|
/**
|
|
14
12
|
* Groups related checkboxes into a single accessible fieldset-like control.
|
|
15
13
|
*
|
|
@@ -28,12 +26,13 @@ type CheckboxGroupProps = React.ComponentPropsWithRef<typeof BaseCheckboxGroup>;
|
|
|
28
26
|
*
|
|
29
27
|
* @see {@link https://base-ui.com/react/components/checkbox-group | Base UI Checkbox Group Docs}
|
|
30
28
|
*/
|
|
31
|
-
|
|
29
|
+
const CheckboxGroup = React.forwardRef<HTMLDivElement, CheckboxGroup.Props>(function CheckboxGroup(props, forwardedRef) {
|
|
32
30
|
const {className, render, ...otherProps} = props;
|
|
33
31
|
|
|
34
32
|
return (
|
|
35
33
|
<BaseCheckboxGroup
|
|
36
34
|
{...otherProps}
|
|
35
|
+
ref={forwardedRef}
|
|
37
36
|
render={useRender({
|
|
38
37
|
defaultTagName: "div",
|
|
39
38
|
render: render as never,
|
|
@@ -41,11 +40,11 @@ function CheckboxGroup(props: Readonly<CheckboxGroup.Props>): React.ReactElement
|
|
|
41
40
|
})}
|
|
42
41
|
/>
|
|
43
42
|
);
|
|
44
|
-
}
|
|
43
|
+
});
|
|
45
44
|
|
|
46
45
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
47
46
|
namespace CheckboxGroup {
|
|
48
|
-
export type Props =
|
|
47
|
+
export type Props = React.ComponentPropsWithRef<typeof BaseCheckboxGroup>;
|
|
49
48
|
export type State = BaseCheckboxGroup.State;
|
|
50
49
|
}
|
|
51
50
|
|
|
@@ -8,6 +8,9 @@ import * as React from "react";
|
|
|
8
8
|
import {cn} from "@/lib/utilities";
|
|
9
9
|
import styles from "./checkbox.module.css";
|
|
10
10
|
|
|
11
|
+
type BaseCheckboxCheckedChange = NonNullable<React.ComponentPropsWithRef<typeof BaseCheckbox.Root>["onCheckedChange"]>;
|
|
12
|
+
type CheckboxChangeEventDetails = Parameters<BaseCheckboxCheckedChange>[1];
|
|
13
|
+
|
|
11
14
|
/**
|
|
12
15
|
* Props for the shared checkbox wrapper.
|
|
13
16
|
*/
|
|
@@ -17,7 +20,7 @@ interface CheckboxProps extends Omit<React.ComponentPropsWithRef<typeof BaseChec
|
|
|
17
20
|
/** The current checked state, including support for the legacy `"indeterminate"` value. @default undefined */
|
|
18
21
|
checked?: boolean | "indeterminate";
|
|
19
22
|
/** Called whenever the checked state changes. @default undefined */
|
|
20
|
-
onCheckedChange?: (checked: boolean | "indeterminate") => void;
|
|
23
|
+
onCheckedChange?: (checked: boolean | "indeterminate", eventDetails: CheckboxChangeEventDetails) => void;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
/**
|
|
@@ -41,13 +44,18 @@ const Checkbox = React.forwardRef<React.ComponentRef<typeof BaseCheckbox.Root>,
|
|
|
41
44
|
const {checked, className, onCheckedChange, render, ...otherProps} = props;
|
|
42
45
|
const baseChecked = checked === "indeterminate" ? true : checked;
|
|
43
46
|
const indeterminate = checked === "indeterminate";
|
|
47
|
+
const handleCheckedChange: BaseCheckboxCheckedChange | undefined = onCheckedChange
|
|
48
|
+
? (nextChecked, eventDetails) => {
|
|
49
|
+
onCheckedChange(nextChecked, eventDetails);
|
|
50
|
+
}
|
|
51
|
+
: undefined;
|
|
44
52
|
|
|
45
53
|
return (
|
|
46
54
|
<BaseCheckbox.Root
|
|
47
55
|
ref={ref}
|
|
48
56
|
checked={baseChecked}
|
|
49
57
|
indeterminate={indeterminate}
|
|
50
|
-
onCheckedChange={
|
|
58
|
+
onCheckedChange={handleCheckedChange}
|
|
51
59
|
{...otherProps}
|
|
52
60
|
render={useRender({
|
|
53
61
|
defaultTagName: "button",
|
|
@@ -68,6 +68,7 @@ function Collapsible(props: Readonly<Collapsible.Props>): React.ReactElement {
|
|
|
68
68
|
*/
|
|
69
69
|
const CollapsibleTrigger = React.forwardRef<React.ComponentRef<typeof BaseCollapsible.Trigger>, CollapsibleTrigger.Props>(
|
|
70
70
|
(props: Readonly<CollapsibleTrigger.Props>, ref): React.ReactElement => {
|
|
71
|
+
// eslint-disable-next-line sonarjs/deprecation -- backward-compatible asChild API
|
|
71
72
|
const {asChild = false, children, className, render, ...otherProps} = props;
|
|
72
73
|
const renderProp = asChild && React.isValidElement(children) ? children : render;
|
|
73
74
|
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Combobox component styles
|
|
3
|
+
* Compound component combining Command, Popover, and Button
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* Root container */
|
|
7
|
+
.combobox {
|
|
8
|
+
display: contents;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* Trigger button */
|
|
12
|
+
.trigger {
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
width: 100%;
|
|
15
|
+
min-width: 200px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.triggerValue {
|
|
19
|
+
flex: 1;
|
|
20
|
+
text-align: left;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
text-overflow: ellipsis;
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.triggerPlaceholder {
|
|
27
|
+
color: var(--ac-neutral-500);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.triggerIcon {
|
|
31
|
+
margin-left: var(--ac-spacing-2);
|
|
32
|
+
height: 1rem;
|
|
33
|
+
width: 1rem;
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
opacity: 0.5;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Popover content */
|
|
39
|
+
.content {
|
|
40
|
+
width: var(--anchor-width);
|
|
41
|
+
min-width: 200px;
|
|
42
|
+
padding: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Command container */
|
|
46
|
+
.command {
|
|
47
|
+
border: none;
|
|
48
|
+
box-shadow: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.commandInput {
|
|
52
|
+
border-bottom: 1px solid var(--ac-neutral-200);
|
|
53
|
+
border-radius: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.commandList {
|
|
57
|
+
max-height: 300px;
|
|
58
|
+
overflow-y: auto;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Items */
|
|
62
|
+
.item {
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
gap: var(--ac-spacing-2);
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
padding: var(--ac-spacing-2) var(--ac-spacing-3);
|
|
68
|
+
border-radius: var(--ac-radius-sm);
|
|
69
|
+
transition: background-color 0.2s;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.item:hover {
|
|
73
|
+
background-color: var(--ac-neutral-100);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.item[data-disabled] {
|
|
77
|
+
opacity: 0.5;
|
|
78
|
+
pointer-events: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.itemSelected {
|
|
82
|
+
background-color: var(--ac-neutral-100);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.itemCheck {
|
|
86
|
+
height: 1rem;
|
|
87
|
+
width: 1rem;
|
|
88
|
+
flex-shrink: 0;
|
|
89
|
+
opacity: 0;
|
|
90
|
+
transition: opacity 0.2s;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.itemCheckVisible {
|
|
94
|
+
opacity: 1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.itemLabel {
|
|
98
|
+
flex: 1;
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
text-overflow: ellipsis;
|
|
101
|
+
white-space: nowrap;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* Empty state */
|
|
105
|
+
.empty {
|
|
106
|
+
padding: var(--ac-spacing-6) var(--ac-spacing-4);
|
|
107
|
+
text-align: center;
|
|
108
|
+
color: var(--ac-neutral-500);
|
|
109
|
+
font-size: var(--ac-font-size-sm);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Group */
|
|
113
|
+
.group {
|
|
114
|
+
padding: var(--ac-spacing-1) 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Separator */
|
|
118
|
+
.separator {
|
|
119
|
+
margin: var(--ac-spacing-1) 0;
|
|
120
|
+
height: 1px;
|
|
121
|
+
background-color: var(--ac-neutral-200);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* Dark mode */
|
|
125
|
+
:global(.dark) .triggerPlaceholder {
|
|
126
|
+
color: var(--ac-neutral-400);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:global(.dark) .commandInput {
|
|
130
|
+
border-bottom-color: var(--ac-neutral-700);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:global(.dark) .item:hover {
|
|
134
|
+
background-color: var(--ac-neutral-800);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
:global(.dark) .itemSelected {
|
|
138
|
+
background-color: var(--ac-neutral-800);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
:global(.dark) .empty {
|
|
142
|
+
color: var(--ac-neutral-400);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
:global(.dark) .separator {
|
|
146
|
+
background-color: var(--ac-neutral-700);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* Responsive adjustments */
|
|
150
|
+
@media (max-width: 640px) {
|
|
151
|
+
.trigger {
|
|
152
|
+
min-width: 150px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.content {
|
|
156
|
+
min-width: 150px;
|
|
157
|
+
}
|
|
158
|
+
}
|