@szum-tech/design-system 3.17.0 → 3.18.2
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/chunk-D5PAWOAZ.cjs +1 -0
- package/dist/chunk-JUNHRB4B.js +1 -0
- package/dist/chunk-P7BFOJLM.cjs +3 -0
- package/dist/chunk-ZYG2KYKK.js +3 -0
- package/dist/components/index.cjs +1 -924
- package/dist/components/index.d.cts +1650 -56
- package/dist/components/index.d.ts +1650 -56
- package/dist/components/index.js +1 -43
- package/dist/hooks/index.cjs +1 -35
- package/dist/hooks/index.js +1 -2
- package/dist/icons/index.cjs +2 -93
- package/dist/icons/index.js +2 -88
- package/dist/utils/index.cjs +1 -10
- package/dist/utils/index.js +1 -1
- package/package.json +30 -38
- package/dist/chunk-2WQJ36RD.cjs +0 -78
- package/dist/chunk-2Y2ZCPNV.cjs +0 -61
- package/dist/chunk-35H6T7OQ.cjs +0 -2912
- package/dist/chunk-375QAB65.cjs +0 -145
- package/dist/chunk-3DP3VMPN.js +0 -173
- package/dist/chunk-3GNVQFCK.cjs +0 -50
- package/dist/chunk-3RK5PCIC.js +0 -86
- package/dist/chunk-3WSQRFUY.cjs +0 -11
- package/dist/chunk-4LNGZHF2.cjs +0 -33
- package/dist/chunk-4TRADSTP.js +0 -34
- package/dist/chunk-5B37TQYT.cjs +0 -18
- package/dist/chunk-5F2Y65JH.js +0 -32
- package/dist/chunk-5MJPZUTO.js +0 -38
- package/dist/chunk-5MV54MWS.js +0 -46
- package/dist/chunk-6BSR3O2J.js +0 -53
- package/dist/chunk-6HX7ETL3.cjs +0 -183
- package/dist/chunk-7OD2NBSV.cjs +0 -50
- package/dist/chunk-A72LE53B.js +0 -21
- package/dist/chunk-A7SBXO2Y.cjs +0 -40
- package/dist/chunk-AAPMLWYK.js +0 -2831
- package/dist/chunk-B4M7Q5KX.cjs +0 -25
- package/dist/chunk-B7RHEMZH.js +0 -48
- package/dist/chunk-BTSHACKG.js +0 -123
- package/dist/chunk-BUJO4FB6.js +0 -252
- package/dist/chunk-CL2C6STG.cjs +0 -278
- package/dist/chunk-CXHDWIGF.cjs +0 -89
- package/dist/chunk-DGWBE2Y3.cjs +0 -205
- package/dist/chunk-DUAM4RTP.cjs +0 -23
- package/dist/chunk-EOTQVIA5.js +0 -993
- package/dist/chunk-EUH466AL.cjs +0 -179
- package/dist/chunk-F7NFSDOD.cjs +0 -91
- package/dist/chunk-G24PWQKG.js +0 -20
- package/dist/chunk-GEDBA3JU.cjs +0 -49
- package/dist/chunk-GYXQUTWZ.cjs +0 -59
- package/dist/chunk-H2BWO3SI.cjs +0 -11
- package/dist/chunk-H5NHGMSQ.js +0 -136
- package/dist/chunk-HCHVDUI6.cjs +0 -34
- package/dist/chunk-HNRVLRMN.js +0 -82
- package/dist/chunk-HPICKLBZ.cjs +0 -204
- package/dist/chunk-I3E75OQX.js +0 -16
- package/dist/chunk-I3RSTJP6.js +0 -20
- package/dist/chunk-IWF52DDE.js +0 -55
- package/dist/chunk-IZU3KULT.js +0 -41
- package/dist/chunk-K5AURCK5.js +0 -183
- package/dist/chunk-KTAIBRTH.cjs +0 -10
- package/dist/chunk-L2TRMQNN.js +0 -130
- package/dist/chunk-M7NIRB3U.js +0 -43
- package/dist/chunk-MNDQXDV4.cjs +0 -607
- package/dist/chunk-N4TYSZSU.cjs +0 -44
- package/dist/chunk-NU5UQPBX.cjs +0 -25
- package/dist/chunk-NXEZE7LG.js +0 -15
- package/dist/chunk-OCOCENE6.js +0 -42
- package/dist/chunk-OQCNPNPS.js +0 -23
- package/dist/chunk-OXZQGDTR.js +0 -208
- package/dist/chunk-OZSNSRLV.cjs +0 -1027
- package/dist/chunk-P4IL77YC.js +0 -66
- package/dist/chunk-P4JIMFSL.js +0 -51
- package/dist/chunk-P5IUC7HJ.js +0 -9
- package/dist/chunk-PBEZZMAB.js +0 -25
- package/dist/chunk-RKFU4DS3.cjs +0 -1064
- package/dist/chunk-S3ANEJJ7.cjs +0 -22
- package/dist/chunk-S3ZUFD6U.js +0 -23
- package/dist/chunk-SHPJGB2L.cjs +0 -19
- package/dist/chunk-TH44JYXB.cjs +0 -27
- package/dist/chunk-TMXVL5CV.cjs +0 -48
- package/dist/chunk-U3QKV7I4.js +0 -54
- package/dist/chunk-U7XZJQ4O.js +0 -36
- package/dist/chunk-UJX74PFK.cjs +0 -46
- package/dist/chunk-ULEEQ723.cjs +0 -108
- package/dist/chunk-UNOMGKAZ.cjs +0 -141
- package/dist/chunk-USIW3VT5.cjs +0 -73
- package/dist/chunk-VK2FJ65F.js +0 -575
- package/dist/chunk-VK5EX3OG.cjs +0 -132
- package/dist/chunk-WCQ5WKCQ.js +0 -1042
- package/dist/chunk-WMGJCB7O.js +0 -157
- package/dist/chunk-X3ZT3KGX.cjs +0 -53
- package/dist/chunk-X5O7GP4S.js +0 -48
- package/dist/chunk-X7WREEFD.js +0 -8
- package/dist/chunk-XENOUBSI.cjs +0 -37
- package/dist/chunk-XKCLVPUC.js +0 -176
- package/dist/chunk-XTKD76O5.js +0 -29
- package/dist/chunk-YBFG2IRJ.cjs +0 -225
- package/dist/chunk-YEFLGE3L.cjs +0 -47
- package/dist/chunk-YUMKV5TH.js +0 -56
- package/dist/chunk-ZD2QRAOX.js +0 -9
- package/dist/chunk-ZVF7J4EI.cjs +0 -58
- package/dist/color-picker.types-GI7dq2Ig.d.cts +0 -42
- package/dist/color-picker.types-GI7dq2Ig.d.ts +0 -42
- package/dist/components/accordion/index.cjs +0 -23
- package/dist/components/accordion/index.d.cts +0 -17
- package/dist/components/accordion/index.d.ts +0 -17
- package/dist/components/accordion/index.js +0 -2
- package/dist/components/alert/index.cjs +0 -19
- package/dist/components/alert/index.d.cts +0 -24
- package/dist/components/alert/index.d.ts +0 -24
- package/dist/components/alert/index.js +0 -2
- package/dist/components/alert-dialog/index.cjs +0 -43
- package/dist/components/alert-dialog/index.d.cts +0 -32
- package/dist/components/alert-dialog/index.d.ts +0 -32
- package/dist/components/alert-dialog/index.js +0 -2
- package/dist/components/avatar/index.cjs +0 -19
- package/dist/components/avatar/index.d.cts +0 -14
- package/dist/components/avatar/index.d.ts +0 -14
- package/dist/components/avatar/index.js +0 -2
- package/dist/components/badge/index.cjs +0 -19
- package/dist/components/badge/index.d.cts +0 -28
- package/dist/components/badge/index.d.ts +0 -28
- package/dist/components/badge/index.js +0 -2
- package/dist/components/badge-overflow/index.cjs +0 -183
- package/dist/components/badge-overflow/index.d.cts +0 -21
- package/dist/components/badge-overflow/index.d.ts +0 -21
- package/dist/components/badge-overflow/index.js +0 -161
- package/dist/components/breadcrump/index.cjs +0 -80
- package/dist/components/breadcrump/index.d.cts +0 -21
- package/dist/components/breadcrump/index.d.ts +0 -21
- package/dist/components/breadcrump/index.js +0 -72
- package/dist/components/button/index.cjs +0 -52
- package/dist/components/button/index.d.cts +0 -58
- package/dist/components/button/index.d.ts +0 -58
- package/dist/components/button/index.js +0 -43
- package/dist/components/card/index.cjs +0 -35
- package/dist/components/card/index.d.cts +0 -25
- package/dist/components/card/index.d.ts +0 -25
- package/dist/components/card/index.js +0 -2
- package/dist/components/carousel/index.cjs +0 -269
- package/dist/components/carousel/index.d.cts +0 -48
- package/dist/components/carousel/index.d.ts +0 -48
- package/dist/components/carousel/index.js +0 -238
- package/dist/components/checkbox/index.cjs +0 -11
- package/dist/components/checkbox/index.d.cts +0 -8
- package/dist/components/checkbox/index.d.ts +0 -8
- package/dist/components/checkbox/index.js +0 -2
- package/dist/components/collapsible/index.cjs +0 -18
- package/dist/components/collapsible/index.d.cts +0 -12
- package/dist/components/collapsible/index.d.ts +0 -12
- package/dist/components/collapsible/index.js +0 -1
- package/dist/components/color-picker/index.cjs +0 -92
- package/dist/components/color-picker/index.d.cts +0 -71
- package/dist/components/color-picker/index.d.ts +0 -71
- package/dist/components/color-picker/index.js +0 -43
- package/dist/components/color-swatch/index.cjs +0 -11
- package/dist/components/color-swatch/index.d.cts +0 -22
- package/dist/components/color-swatch/index.d.ts +0 -22
- package/dist/components/color-swatch/index.js +0 -2
- package/dist/components/counting-number/index.cjs +0 -11
- package/dist/components/counting-number/index.d.cts +0 -57
- package/dist/components/counting-number/index.d.ts +0 -57
- package/dist/components/counting-number/index.js +0 -2
- package/dist/components/dialog/index.cjs +0 -39
- package/dist/components/dialog/index.d.cts +0 -42
- package/dist/components/dialog/index.d.ts +0 -42
- package/dist/components/dialog/index.js +0 -2
- package/dist/components/dropdown-menu/index.cjs +0 -71
- package/dist/components/dropdown-menu/index.d.cts +0 -67
- package/dist/components/dropdown-menu/index.d.ts +0 -67
- package/dist/components/dropdown-menu/index.js +0 -2
- package/dist/components/empty/index.cjs +0 -31
- package/dist/components/empty/index.d.cts +0 -29
- package/dist/components/empty/index.d.ts +0 -29
- package/dist/components/empty/index.js +0 -2
- package/dist/components/field/index.cjs +0 -49
- package/dist/components/field/index.d.cts +0 -50
- package/dist/components/field/index.d.ts +0 -50
- package/dist/components/field/index.js +0 -4
- package/dist/components/file-upload/index.cjs +0 -60
- package/dist/components/file-upload/index.d.cts +0 -131
- package/dist/components/file-upload/index.d.ts +0 -131
- package/dist/components/file-upload/index.js +0 -3
- package/dist/components/header/index.cjs +0 -11
- package/dist/components/header/index.d.cts +0 -18
- package/dist/components/header/index.d.ts +0 -18
- package/dist/components/header/index.js +0 -2
- package/dist/components/input/index.cjs +0 -11
- package/dist/components/input/index.d.cts +0 -9
- package/dist/components/input/index.d.ts +0 -9
- package/dist/components/input/index.js +0 -2
- package/dist/components/item/index.cjs +0 -48
- package/dist/components/item/index.d.cts +0 -61
- package/dist/components/item/index.d.ts +0 -61
- package/dist/components/item/index.js +0 -3
- package/dist/components/label/index.cjs +0 -11
- package/dist/components/label/index.d.cts +0 -8
- package/dist/components/label/index.d.ts +0 -8
- package/dist/components/label/index.js +0 -2
- package/dist/components/marquee/index.cjs +0 -11
- package/dist/components/marquee/index.d.cts +0 -48
- package/dist/components/marquee/index.d.ts +0 -48
- package/dist/components/marquee/index.js +0 -2
- package/dist/components/masonry/index.cjs +0 -16
- package/dist/components/masonry/index.d.cts +0 -181
- package/dist/components/masonry/index.d.ts +0 -181
- package/dist/components/masonry/index.js +0 -3
- package/dist/components/popover/index.cjs +0 -35
- package/dist/components/popover/index.d.cts +0 -18
- package/dist/components/popover/index.d.ts +0 -18
- package/dist/components/popover/index.js +0 -2
- package/dist/components/progress/index.cjs +0 -11
- package/dist/components/progress/index.d.cts +0 -8
- package/dist/components/progress/index.d.ts +0 -8
- package/dist/components/progress/index.js +0 -2
- package/dist/components/radio-group/index.cjs +0 -15
- package/dist/components/radio-group/index.d.cts +0 -22
- package/dist/components/radio-group/index.d.ts +0 -22
- package/dist/components/radio-group/index.js +0 -2
- package/dist/components/scroll-area/index.cjs +0 -15
- package/dist/components/scroll-area/index.d.cts +0 -11
- package/dist/components/scroll-area/index.d.ts +0 -11
- package/dist/components/scroll-area/index.js +0 -2
- package/dist/components/select/index.cjs +0 -31
- package/dist/components/select/index.d.cts +0 -22
- package/dist/components/select/index.d.ts +0 -22
- package/dist/components/select/index.js +0 -2
- package/dist/components/separator/index.cjs +0 -11
- package/dist/components/separator/index.d.cts +0 -8
- package/dist/components/separator/index.d.ts +0 -8
- package/dist/components/separator/index.js +0 -2
- package/dist/components/sheet/index.cjs +0 -39
- package/dist/components/sheet/index.d.cts +0 -42
- package/dist/components/sheet/index.d.ts +0 -42
- package/dist/components/sheet/index.js +0 -2
- package/dist/components/sidebar/index.cjs +0 -148
- package/dist/components/sidebar/index.d.cts +0 -135
- package/dist/components/sidebar/index.d.ts +0 -135
- package/dist/components/sidebar/index.js +0 -43
- package/dist/components/skeleton/index.cjs +0 -11
- package/dist/components/skeleton/index.d.cts +0 -7
- package/dist/components/skeleton/index.d.ts +0 -7
- package/dist/components/skeleton/index.js +0 -2
- package/dist/components/sortable/index.cjs +0 -27
- package/dist/components/sortable/index.d.cts +0 -50
- package/dist/components/sortable/index.d.ts +0 -50
- package/dist/components/sortable/index.js +0 -2
- package/dist/components/spinner/index.cjs +0 -11
- package/dist/components/spinner/index.d.cts +0 -7
- package/dist/components/spinner/index.d.ts +0 -7
- package/dist/components/spinner/index.js +0 -2
- package/dist/components/status/index.cjs +0 -19
- package/dist/components/status/index.d.cts +0 -25
- package/dist/components/status/index.d.ts +0 -25
- package/dist/components/status/index.js +0 -2
- package/dist/components/stepper/index.cjs +0 -124
- package/dist/components/stepper/index.d.cts +0 -164
- package/dist/components/stepper/index.d.ts +0 -164
- package/dist/components/stepper/index.js +0 -43
- package/dist/components/switch/index.cjs +0 -11
- package/dist/components/switch/index.d.cts +0 -19
- package/dist/components/switch/index.d.ts +0 -19
- package/dist/components/switch/index.js +0 -2
- package/dist/components/tabs/index.cjs +0 -23
- package/dist/components/tabs/index.d.cts +0 -17
- package/dist/components/tabs/index.d.ts +0 -17
- package/dist/components/tabs/index.js +0 -2
- package/dist/components/textarea/index.cjs +0 -11
- package/dist/components/textarea/index.d.cts +0 -9
- package/dist/components/textarea/index.d.ts +0 -9
- package/dist/components/textarea/index.js +0 -2
- package/dist/components/timeline/index.cjs +0 -45
- package/dist/components/timeline/index.d.cts +0 -63
- package/dist/components/timeline/index.d.ts +0 -63
- package/dist/components/timeline/index.js +0 -4
- package/dist/components/toaster/index.cjs +0 -56
- package/dist/components/toaster/index.d.cts +0 -8
- package/dist/components/toaster/index.d.ts +0 -8
- package/dist/components/toaster/index.js +0 -43
- package/dist/components/tooltip/index.cjs +0 -19
- package/dist/components/tooltip/index.d.cts +0 -12
- package/dist/components/tooltip/index.d.ts +0 -12
- package/dist/components/tooltip/index.js +0 -2
- package/dist/components/typing-text/index.cjs +0 -11
- package/dist/components/typing-text/index.d.cts +0 -41
- package/dist/components/typing-text/index.d.ts +0 -41
- package/dist/components/typing-text/index.js +0 -2
- package/dist/components/word-rotate/index.cjs +0 -11
- package/dist/components/word-rotate/index.d.cts +0 -30
- package/dist/components/word-rotate/index.d.ts +0 -30
- package/dist/components/word-rotate/index.js +0 -2
- package/dist/direction-CUOPDLCj.d.cts +0 -7
- package/dist/direction-CUOPDLCj.d.ts +0 -7
- package/dist/popover-trigger-Cf4PPj0z.d.cts +0 -14
- package/dist/popover-trigger-Cf4PPj0z.d.ts +0 -14
- package/dist/select-Bf6XQtt-.d.cts +0 -12
- package/dist/select-Bf6XQtt-.d.ts +0 -12
- package/dist/tooltip-content-DqtogPBq.d.cts +0 -8
- package/dist/tooltip-content-DqtogPBq.d.ts +0 -8
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { AlertDialog as AlertDialog$1 } from 'radix-ui';
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
type AlertDialogProps = AlertDialog$1.AlertDialogProps;
|
|
6
|
-
declare const AlertDialog: React.FC<AlertDialog$1.AlertDialogProps>;
|
|
7
|
-
|
|
8
|
-
type AlertDialogTriggerProps = AlertDialog$1.AlertDialogTriggerProps;
|
|
9
|
-
declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialog$1.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
-
|
|
11
|
-
type AlertDialogContentProps = React.ComponentProps<typeof AlertDialog$1.Content>;
|
|
12
|
-
declare function AlertDialogContent({ className, ...props }: AlertDialogContentProps): react_jsx_runtime.JSX.Element;
|
|
13
|
-
|
|
14
|
-
type AlertDialogActionProps = AlertDialog$1.AlertDialogActionProps;
|
|
15
|
-
declare const AlertDialogAction: React.ForwardRefExoticComponent<AlertDialog$1.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
-
|
|
17
|
-
type AlertDialogFooterProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
18
|
-
declare function AlertDialogFooter({ className, ...props }: AlertDialogFooterProps): react_jsx_runtime.JSX.Element;
|
|
19
|
-
|
|
20
|
-
type AlertDialogTitleProps = React.ComponentProps<typeof AlertDialog$1.Title>;
|
|
21
|
-
declare function AlertDialogTitle({ className, ref, ...props }: AlertDialogTitleProps): react_jsx_runtime.JSX.Element;
|
|
22
|
-
|
|
23
|
-
type AlertDialogDescriptionProps = React.ComponentProps<typeof AlertDialog$1.Description>;
|
|
24
|
-
declare function AlertDialogDescription({ className, ...props }: AlertDialogDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
25
|
-
|
|
26
|
-
type AlertDialogCancelProps = AlertDialog$1.AlertDialogCancelProps;
|
|
27
|
-
declare const AlertDialogCancel: React.ForwardRefExoticComponent<AlertDialog$1.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>>;
|
|
28
|
-
|
|
29
|
-
type AlertDialogHeaderProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
30
|
-
declare function AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps): react_jsx_runtime.JSX.Element;
|
|
31
|
-
|
|
32
|
-
export { AlertDialog, AlertDialogAction, type AlertDialogActionProps, AlertDialogCancel, type AlertDialogCancelProps, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, type AlertDialogDescriptionProps, AlertDialogFooter, type AlertDialogFooterProps, AlertDialogHeader, type AlertDialogHeaderProps, type AlertDialogProps, AlertDialogTitle, type AlertDialogTitleProps, AlertDialogTrigger, type AlertDialogTriggerProps };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { AlertDialog as AlertDialog$1 } from 'radix-ui';
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
type AlertDialogProps = AlertDialog$1.AlertDialogProps;
|
|
6
|
-
declare const AlertDialog: React.FC<AlertDialog$1.AlertDialogProps>;
|
|
7
|
-
|
|
8
|
-
type AlertDialogTriggerProps = AlertDialog$1.AlertDialogTriggerProps;
|
|
9
|
-
declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialog$1.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
-
|
|
11
|
-
type AlertDialogContentProps = React.ComponentProps<typeof AlertDialog$1.Content>;
|
|
12
|
-
declare function AlertDialogContent({ className, ...props }: AlertDialogContentProps): react_jsx_runtime.JSX.Element;
|
|
13
|
-
|
|
14
|
-
type AlertDialogActionProps = AlertDialog$1.AlertDialogActionProps;
|
|
15
|
-
declare const AlertDialogAction: React.ForwardRefExoticComponent<AlertDialog$1.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
-
|
|
17
|
-
type AlertDialogFooterProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
18
|
-
declare function AlertDialogFooter({ className, ...props }: AlertDialogFooterProps): react_jsx_runtime.JSX.Element;
|
|
19
|
-
|
|
20
|
-
type AlertDialogTitleProps = React.ComponentProps<typeof AlertDialog$1.Title>;
|
|
21
|
-
declare function AlertDialogTitle({ className, ref, ...props }: AlertDialogTitleProps): react_jsx_runtime.JSX.Element;
|
|
22
|
-
|
|
23
|
-
type AlertDialogDescriptionProps = React.ComponentProps<typeof AlertDialog$1.Description>;
|
|
24
|
-
declare function AlertDialogDescription({ className, ...props }: AlertDialogDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
25
|
-
|
|
26
|
-
type AlertDialogCancelProps = AlertDialog$1.AlertDialogCancelProps;
|
|
27
|
-
declare const AlertDialogCancel: React.ForwardRefExoticComponent<AlertDialog$1.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>>;
|
|
28
|
-
|
|
29
|
-
type AlertDialogHeaderProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
30
|
-
declare function AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps): react_jsx_runtime.JSX.Element;
|
|
31
|
-
|
|
32
|
-
export { AlertDialog, AlertDialogAction, type AlertDialogActionProps, AlertDialogCancel, type AlertDialogCancelProps, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, type AlertDialogDescriptionProps, AlertDialogFooter, type AlertDialogFooterProps, AlertDialogHeader, type AlertDialogHeaderProps, type AlertDialogProps, AlertDialogTitle, type AlertDialogTitleProps, AlertDialogTrigger, type AlertDialogTriggerProps };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunk4LNGZHF2_cjs = require('../../chunk-4LNGZHF2.cjs');
|
|
4
|
-
require('../../chunk-H2BWO3SI.cjs');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "Avatar", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunk4LNGZHF2_cjs.Avatar; }
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "AvatarFallback", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () { return chunk4LNGZHF2_cjs.AvatarFallback; }
|
|
15
|
-
});
|
|
16
|
-
Object.defineProperty(exports, "AvatarImage", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () { return chunk4LNGZHF2_cjs.AvatarImage; }
|
|
19
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { Avatar as Avatar$1 } from 'radix-ui';
|
|
4
|
-
|
|
5
|
-
type AvatarProps = React.ComponentProps<typeof Avatar$1.Root>;
|
|
6
|
-
declare function Avatar({ className, ...props }: AvatarProps): react_jsx_runtime.JSX.Element;
|
|
7
|
-
|
|
8
|
-
type AvatarImageProps = React.ComponentProps<typeof Avatar$1.Image>;
|
|
9
|
-
declare function AvatarImage({ className, ...props }: AvatarImageProps): react_jsx_runtime.JSX.Element;
|
|
10
|
-
|
|
11
|
-
type AvatarFallbackProps = React.ComponentProps<typeof Avatar$1.Fallback>;
|
|
12
|
-
declare function AvatarFallback({ className, ...props }: AvatarFallbackProps): react_jsx_runtime.JSX.Element;
|
|
13
|
-
|
|
14
|
-
export { Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { Avatar as Avatar$1 } from 'radix-ui';
|
|
4
|
-
|
|
5
|
-
type AvatarProps = React.ComponentProps<typeof Avatar$1.Root>;
|
|
6
|
-
declare function Avatar({ className, ...props }: AvatarProps): react_jsx_runtime.JSX.Element;
|
|
7
|
-
|
|
8
|
-
type AvatarImageProps = React.ComponentProps<typeof Avatar$1.Image>;
|
|
9
|
-
declare function AvatarImage({ className, ...props }: AvatarImageProps): react_jsx_runtime.JSX.Element;
|
|
10
|
-
|
|
11
|
-
type AvatarFallbackProps = React.ComponentProps<typeof Avatar$1.Fallback>;
|
|
12
|
-
declare function AvatarFallback({ className, ...props }: AvatarFallbackProps): react_jsx_runtime.JSX.Element;
|
|
13
|
-
|
|
14
|
-
export { Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkZVF7J4EI_cjs = require('../../chunk-ZVF7J4EI.cjs');
|
|
4
|
-
require('../../chunk-H2BWO3SI.cjs');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "Badge", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunkZVF7J4EI_cjs.Badge; }
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "BadgeButton", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () { return chunkZVF7J4EI_cjs.BadgeButton; }
|
|
15
|
-
});
|
|
16
|
-
Object.defineProperty(exports, "BadgeDot", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () { return chunkZVF7J4EI_cjs.BadgeDot; }
|
|
19
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import React__default from 'react';
|
|
4
|
-
import { VariantProps } from 'class-variance-authority';
|
|
5
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
|
-
|
|
7
|
-
declare const badgeVariants: (props?: {
|
|
8
|
-
variant?: "primary" | "secondary" | "outline" | "success" | "warning" | "error";
|
|
9
|
-
} & class_variance_authority_types.ClassProp) => string;
|
|
10
|
-
|
|
11
|
-
type BadgeVariantsProps = VariantProps<typeof badgeVariants>;
|
|
12
|
-
type BadgeVariant = NonNullable<BadgeVariantsProps["variant"]>;
|
|
13
|
-
|
|
14
|
-
type BadgeProps = React.ComponentProps<"span"> & {
|
|
15
|
-
variant?: BadgeVariant;
|
|
16
|
-
asChild?: boolean;
|
|
17
|
-
};
|
|
18
|
-
declare function Badge({ className, variant, asChild, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
19
|
-
|
|
20
|
-
type BadgeButtonProps = React__default.ComponentProps<"button"> & {
|
|
21
|
-
asChild?: boolean;
|
|
22
|
-
};
|
|
23
|
-
declare function BadgeButton({ className, asChild, ...props }: BadgeButtonProps): react_jsx_runtime.JSX.Element;
|
|
24
|
-
|
|
25
|
-
type BadgeDotProps = React.ComponentProps<"span">;
|
|
26
|
-
declare function BadgeDot({ className, ...props }: React.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
|
|
27
|
-
|
|
28
|
-
export { Badge, BadgeButton, type BadgeButtonProps, BadgeDot, type BadgeDotProps, type BadgeProps, type BadgeVariant };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import React__default from 'react';
|
|
4
|
-
import { VariantProps } from 'class-variance-authority';
|
|
5
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
|
-
|
|
7
|
-
declare const badgeVariants: (props?: {
|
|
8
|
-
variant?: "primary" | "secondary" | "outline" | "success" | "warning" | "error";
|
|
9
|
-
} & class_variance_authority_types.ClassProp) => string;
|
|
10
|
-
|
|
11
|
-
type BadgeVariantsProps = VariantProps<typeof badgeVariants>;
|
|
12
|
-
type BadgeVariant = NonNullable<BadgeVariantsProps["variant"]>;
|
|
13
|
-
|
|
14
|
-
type BadgeProps = React.ComponentProps<"span"> & {
|
|
15
|
-
variant?: BadgeVariant;
|
|
16
|
-
asChild?: boolean;
|
|
17
|
-
};
|
|
18
|
-
declare function Badge({ className, variant, asChild, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
19
|
-
|
|
20
|
-
type BadgeButtonProps = React__default.ComponentProps<"button"> & {
|
|
21
|
-
asChild?: boolean;
|
|
22
|
-
};
|
|
23
|
-
declare function BadgeButton({ className, asChild, ...props }: BadgeButtonProps): react_jsx_runtime.JSX.Element;
|
|
24
|
-
|
|
25
|
-
type BadgeDotProps = React.ComponentProps<"span">;
|
|
26
|
-
declare function BadgeDot({ className, ...props }: React.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
|
|
27
|
-
|
|
28
|
-
export { Badge, BadgeButton, type BadgeButtonProps, BadgeDot, type BadgeDotProps, type BadgeProps, type BadgeVariant };
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkF7NFSDOD_cjs = require('../../chunk-F7NFSDOD.cjs');
|
|
4
|
-
require('../../chunk-N4TYSZSU.cjs');
|
|
5
|
-
var chunkH2BWO3SI_cjs = require('../../chunk-H2BWO3SI.cjs');
|
|
6
|
-
var React = require('react');
|
|
7
|
-
var radixUi = require('radix-ui');
|
|
8
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
-
|
|
10
|
-
function _interopNamespace(e) {
|
|
11
|
-
if (e && e.__esModule) return e;
|
|
12
|
-
var n = Object.create(null);
|
|
13
|
-
if (e) {
|
|
14
|
-
Object.keys(e).forEach(function (k) {
|
|
15
|
-
if (k !== 'default') {
|
|
16
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function () { return e[k]; }
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
n.default = e;
|
|
25
|
-
return Object.freeze(n);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
29
|
-
|
|
30
|
-
function BadgeOverflow(props) {
|
|
31
|
-
const {
|
|
32
|
-
items,
|
|
33
|
-
getBadgeLabel: getBadgeLabelProp,
|
|
34
|
-
lineCount = 1,
|
|
35
|
-
renderBadge,
|
|
36
|
-
renderOverflow,
|
|
37
|
-
asChild,
|
|
38
|
-
className,
|
|
39
|
-
style,
|
|
40
|
-
ref,
|
|
41
|
-
...rootProps
|
|
42
|
-
} = props;
|
|
43
|
-
const getBadgeLabel = React__namespace.useCallback(
|
|
44
|
-
(item) => {
|
|
45
|
-
if (typeof item === "object" && !getBadgeLabelProp) {
|
|
46
|
-
throw new Error("`getBadgeLabel` is required when using array of objects");
|
|
47
|
-
}
|
|
48
|
-
return getBadgeLabelProp ? getBadgeLabelProp(item) : item;
|
|
49
|
-
},
|
|
50
|
-
[getBadgeLabelProp]
|
|
51
|
-
);
|
|
52
|
-
const rootRef = React__namespace.useRef(null);
|
|
53
|
-
const composedRef = chunkF7NFSDOD_cjs.useComposedRefs(ref, rootRef);
|
|
54
|
-
const measureRef = React__namespace.useRef(null);
|
|
55
|
-
const [containerWidth, setContainerWidth] = React__namespace.useState(0);
|
|
56
|
-
const [badgeGap, setBadgeGap] = React__namespace.useState(4);
|
|
57
|
-
const [badgeHeight, setBadgeHeight] = React__namespace.useState(20);
|
|
58
|
-
const [overflowBadgeWidth, setOverflowBadgeWidth] = React__namespace.useState(40);
|
|
59
|
-
const [isMeasured, setIsMeasured] = React__namespace.useState(false);
|
|
60
|
-
const [badgeWidths, setBadgeWidths] = React__namespace.useState(/* @__PURE__ */ new Map());
|
|
61
|
-
React__namespace.useLayoutEffect(() => {
|
|
62
|
-
if (!rootRef.current || !measureRef.current) return;
|
|
63
|
-
function measureContainer() {
|
|
64
|
-
if (!rootRef.current || !measureRef.current) return;
|
|
65
|
-
const computedStyle = getComputedStyle(rootRef.current);
|
|
66
|
-
const gapValue = computedStyle.gap;
|
|
67
|
-
const gap = gapValue ? parseFloat(gapValue) : 4;
|
|
68
|
-
setBadgeGap(gap);
|
|
69
|
-
const paddingLeft = parseFloat(computedStyle.paddingLeft) || 0;
|
|
70
|
-
const paddingRight = parseFloat(computedStyle.paddingRight) || 0;
|
|
71
|
-
const totalPadding = paddingLeft + paddingRight;
|
|
72
|
-
const widthMap = /* @__PURE__ */ new Map();
|
|
73
|
-
const measureChildren = measureRef.current.children;
|
|
74
|
-
for (let i = 0; i < items.length; i++) {
|
|
75
|
-
const child = measureChildren[i];
|
|
76
|
-
if (child) {
|
|
77
|
-
const label = getBadgeLabel(items[i]);
|
|
78
|
-
widthMap.set(label, child.offsetWidth);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
setBadgeWidths(widthMap);
|
|
82
|
-
const firstBadge = measureChildren[0];
|
|
83
|
-
if (firstBadge) {
|
|
84
|
-
setBadgeHeight(firstBadge.offsetHeight || 20);
|
|
85
|
-
}
|
|
86
|
-
const overflowChild = measureChildren[items.length];
|
|
87
|
-
if (overflowChild) {
|
|
88
|
-
setOverflowBadgeWidth(overflowChild.offsetWidth || 40);
|
|
89
|
-
}
|
|
90
|
-
const width = rootRef.current.clientWidth - totalPadding;
|
|
91
|
-
setContainerWidth(width);
|
|
92
|
-
setIsMeasured(true);
|
|
93
|
-
}
|
|
94
|
-
measureContainer();
|
|
95
|
-
const resizeObserver = new ResizeObserver(measureContainer);
|
|
96
|
-
resizeObserver.observe(rootRef.current);
|
|
97
|
-
return () => {
|
|
98
|
-
resizeObserver.disconnect();
|
|
99
|
-
};
|
|
100
|
-
}, [items, getBadgeLabel]);
|
|
101
|
-
const placeholderHeight = React__namespace.useMemo(
|
|
102
|
-
() => badgeHeight * lineCount + badgeGap * (lineCount - 1),
|
|
103
|
-
[badgeHeight, badgeGap, lineCount]
|
|
104
|
-
);
|
|
105
|
-
const { visibleItems, hiddenCount } = React__namespace.useMemo(() => {
|
|
106
|
-
if (!containerWidth || items.length === 0 || badgeWidths.size === 0) {
|
|
107
|
-
return { visibleItems: items, hiddenCount: 0 };
|
|
108
|
-
}
|
|
109
|
-
let currentLineWidth = 0;
|
|
110
|
-
let currentLine = 1;
|
|
111
|
-
const visible = [];
|
|
112
|
-
for (let i = 0; i < items.length; i++) {
|
|
113
|
-
const item = items[i];
|
|
114
|
-
if (!item) continue;
|
|
115
|
-
const label = getBadgeLabel(item);
|
|
116
|
-
const badgeWidth = badgeWidths.get(label);
|
|
117
|
-
if (!badgeWidth) {
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
const widthWithGap = badgeWidth + badgeGap;
|
|
121
|
-
const isLastLine = currentLine === lineCount;
|
|
122
|
-
const hasMoreItems = i < items.length - 1;
|
|
123
|
-
const availableWidth = isLastLine && hasMoreItems ? containerWidth - overflowBadgeWidth - badgeGap : containerWidth;
|
|
124
|
-
if (currentLineWidth + widthWithGap <= availableWidth) {
|
|
125
|
-
currentLineWidth += widthWithGap;
|
|
126
|
-
visible.push(item);
|
|
127
|
-
} else if (currentLine < lineCount) {
|
|
128
|
-
currentLine++;
|
|
129
|
-
currentLineWidth = widthWithGap;
|
|
130
|
-
visible.push(item);
|
|
131
|
-
} else {
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return {
|
|
136
|
-
visibleItems: visible,
|
|
137
|
-
hiddenCount: Math.max(0, items.length - visible.length)
|
|
138
|
-
};
|
|
139
|
-
}, [items, getBadgeLabel, containerWidth, lineCount, badgeGap, overflowBadgeWidth, badgeWidths]);
|
|
140
|
-
const Component = asChild ? radixUi.Slot.Slot : "div";
|
|
141
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(React__namespace.Fragment, { children: [
|
|
142
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { ref: measureRef, className: "pointer-events-none invisible absolute flex flex-wrap", style: { gap: badgeGap }, children: [
|
|
143
|
-
items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(React__namespace.Fragment, { children: renderBadge(item, getBadgeLabel(item)) }, index)),
|
|
144
|
-
renderOverflow ? renderOverflow(99) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-flex h-5 shrink-0 items-center rounded-md border px-1.5 text-xs font-semibold", children: "+99" })
|
|
145
|
-
] }),
|
|
146
|
-
isMeasured ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
147
|
-
Component,
|
|
148
|
-
{
|
|
149
|
-
"data-slot": "badge-overflow",
|
|
150
|
-
...rootProps,
|
|
151
|
-
ref: composedRef,
|
|
152
|
-
className: chunkH2BWO3SI_cjs.cn("flex flex-wrap", className),
|
|
153
|
-
style: {
|
|
154
|
-
gap: badgeGap,
|
|
155
|
-
...style
|
|
156
|
-
},
|
|
157
|
-
children: [
|
|
158
|
-
visibleItems.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(React__namespace.Fragment, { children: renderBadge(item, getBadgeLabel(item)) }, index)),
|
|
159
|
-
hiddenCount > 0 && (renderOverflow ? renderOverflow(hiddenCount) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex h-5 shrink-0 items-center rounded-md border px-1.5 text-xs font-semibold", children: [
|
|
160
|
-
"+",
|
|
161
|
-
hiddenCount
|
|
162
|
-
] }))
|
|
163
|
-
]
|
|
164
|
-
}
|
|
165
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
166
|
-
Component,
|
|
167
|
-
{
|
|
168
|
-
"data-slot": "badge-overflow",
|
|
169
|
-
...rootProps,
|
|
170
|
-
ref: composedRef,
|
|
171
|
-
className: chunkH2BWO3SI_cjs.cn("flex flex-wrap", className),
|
|
172
|
-
style: {
|
|
173
|
-
gap: badgeGap,
|
|
174
|
-
minHeight: placeholderHeight,
|
|
175
|
-
...style
|
|
176
|
-
},
|
|
177
|
-
children: items.slice(0, Math.min(items.length, lineCount * 3 - (lineCount > 1 ? 1 : 0))).map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(React__namespace.Fragment, { children: renderBadge(item, getBadgeLabel(item)) }, index))
|
|
178
|
-
}
|
|
179
|
-
)
|
|
180
|
-
] });
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
exports.BadgeOverflow = BadgeOverflow;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
interface GetBadgeLabel<T> {
|
|
5
|
-
/**
|
|
6
|
-
* Callback that returns a label string for each badge item.
|
|
7
|
-
* Optional for primitive arrays (strings, numbers), required for object arrays.
|
|
8
|
-
* @example getBadgeLabel={(item) => item.name}
|
|
9
|
-
*/
|
|
10
|
-
getBadgeLabel: (item: T) => string;
|
|
11
|
-
}
|
|
12
|
-
type BadgeOverflowProps<T = string> = React.ComponentProps<"div"> & (T extends object ? GetBadgeLabel<T> : Partial<GetBadgeLabel<T>>) & {
|
|
13
|
-
items: T[];
|
|
14
|
-
lineCount?: number;
|
|
15
|
-
renderBadge: (item: T, label: string) => React.ReactNode;
|
|
16
|
-
renderOverflow?: (count: number) => React.ReactNode;
|
|
17
|
-
asChild?: boolean;
|
|
18
|
-
};
|
|
19
|
-
declare function BadgeOverflow<T = string>(props: BadgeOverflowProps<T>): react_jsx_runtime.JSX.Element;
|
|
20
|
-
|
|
21
|
-
export { BadgeOverflow, type BadgeOverflowProps };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
interface GetBadgeLabel<T> {
|
|
5
|
-
/**
|
|
6
|
-
* Callback that returns a label string for each badge item.
|
|
7
|
-
* Optional for primitive arrays (strings, numbers), required for object arrays.
|
|
8
|
-
* @example getBadgeLabel={(item) => item.name}
|
|
9
|
-
*/
|
|
10
|
-
getBadgeLabel: (item: T) => string;
|
|
11
|
-
}
|
|
12
|
-
type BadgeOverflowProps<T = string> = React.ComponentProps<"div"> & (T extends object ? GetBadgeLabel<T> : Partial<GetBadgeLabel<T>>) & {
|
|
13
|
-
items: T[];
|
|
14
|
-
lineCount?: number;
|
|
15
|
-
renderBadge: (item: T, label: string) => React.ReactNode;
|
|
16
|
-
renderOverflow?: (count: number) => React.ReactNode;
|
|
17
|
-
asChild?: boolean;
|
|
18
|
-
};
|
|
19
|
-
declare function BadgeOverflow<T = string>(props: BadgeOverflowProps<T>): react_jsx_runtime.JSX.Element;
|
|
20
|
-
|
|
21
|
-
export { BadgeOverflow, type BadgeOverflowProps };
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { useComposedRefs } from '../../chunk-P4IL77YC.js';
|
|
2
|
-
import '../../chunk-G24PWQKG.js';
|
|
3
|
-
import { cn } from '../../chunk-ZD2QRAOX.js';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { Slot } from 'radix-ui';
|
|
6
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
function BadgeOverflow(props) {
|
|
9
|
-
const {
|
|
10
|
-
items,
|
|
11
|
-
getBadgeLabel: getBadgeLabelProp,
|
|
12
|
-
lineCount = 1,
|
|
13
|
-
renderBadge,
|
|
14
|
-
renderOverflow,
|
|
15
|
-
asChild,
|
|
16
|
-
className,
|
|
17
|
-
style,
|
|
18
|
-
ref,
|
|
19
|
-
...rootProps
|
|
20
|
-
} = props;
|
|
21
|
-
const getBadgeLabel = React.useCallback(
|
|
22
|
-
(item) => {
|
|
23
|
-
if (typeof item === "object" && !getBadgeLabelProp) {
|
|
24
|
-
throw new Error("`getBadgeLabel` is required when using array of objects");
|
|
25
|
-
}
|
|
26
|
-
return getBadgeLabelProp ? getBadgeLabelProp(item) : item;
|
|
27
|
-
},
|
|
28
|
-
[getBadgeLabelProp]
|
|
29
|
-
);
|
|
30
|
-
const rootRef = React.useRef(null);
|
|
31
|
-
const composedRef = useComposedRefs(ref, rootRef);
|
|
32
|
-
const measureRef = React.useRef(null);
|
|
33
|
-
const [containerWidth, setContainerWidth] = React.useState(0);
|
|
34
|
-
const [badgeGap, setBadgeGap] = React.useState(4);
|
|
35
|
-
const [badgeHeight, setBadgeHeight] = React.useState(20);
|
|
36
|
-
const [overflowBadgeWidth, setOverflowBadgeWidth] = React.useState(40);
|
|
37
|
-
const [isMeasured, setIsMeasured] = React.useState(false);
|
|
38
|
-
const [badgeWidths, setBadgeWidths] = React.useState(/* @__PURE__ */ new Map());
|
|
39
|
-
React.useLayoutEffect(() => {
|
|
40
|
-
if (!rootRef.current || !measureRef.current) return;
|
|
41
|
-
function measureContainer() {
|
|
42
|
-
if (!rootRef.current || !measureRef.current) return;
|
|
43
|
-
const computedStyle = getComputedStyle(rootRef.current);
|
|
44
|
-
const gapValue = computedStyle.gap;
|
|
45
|
-
const gap = gapValue ? parseFloat(gapValue) : 4;
|
|
46
|
-
setBadgeGap(gap);
|
|
47
|
-
const paddingLeft = parseFloat(computedStyle.paddingLeft) || 0;
|
|
48
|
-
const paddingRight = parseFloat(computedStyle.paddingRight) || 0;
|
|
49
|
-
const totalPadding = paddingLeft + paddingRight;
|
|
50
|
-
const widthMap = /* @__PURE__ */ new Map();
|
|
51
|
-
const measureChildren = measureRef.current.children;
|
|
52
|
-
for (let i = 0; i < items.length; i++) {
|
|
53
|
-
const child = measureChildren[i];
|
|
54
|
-
if (child) {
|
|
55
|
-
const label = getBadgeLabel(items[i]);
|
|
56
|
-
widthMap.set(label, child.offsetWidth);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
setBadgeWidths(widthMap);
|
|
60
|
-
const firstBadge = measureChildren[0];
|
|
61
|
-
if (firstBadge) {
|
|
62
|
-
setBadgeHeight(firstBadge.offsetHeight || 20);
|
|
63
|
-
}
|
|
64
|
-
const overflowChild = measureChildren[items.length];
|
|
65
|
-
if (overflowChild) {
|
|
66
|
-
setOverflowBadgeWidth(overflowChild.offsetWidth || 40);
|
|
67
|
-
}
|
|
68
|
-
const width = rootRef.current.clientWidth - totalPadding;
|
|
69
|
-
setContainerWidth(width);
|
|
70
|
-
setIsMeasured(true);
|
|
71
|
-
}
|
|
72
|
-
measureContainer();
|
|
73
|
-
const resizeObserver = new ResizeObserver(measureContainer);
|
|
74
|
-
resizeObserver.observe(rootRef.current);
|
|
75
|
-
return () => {
|
|
76
|
-
resizeObserver.disconnect();
|
|
77
|
-
};
|
|
78
|
-
}, [items, getBadgeLabel]);
|
|
79
|
-
const placeholderHeight = React.useMemo(
|
|
80
|
-
() => badgeHeight * lineCount + badgeGap * (lineCount - 1),
|
|
81
|
-
[badgeHeight, badgeGap, lineCount]
|
|
82
|
-
);
|
|
83
|
-
const { visibleItems, hiddenCount } = React.useMemo(() => {
|
|
84
|
-
if (!containerWidth || items.length === 0 || badgeWidths.size === 0) {
|
|
85
|
-
return { visibleItems: items, hiddenCount: 0 };
|
|
86
|
-
}
|
|
87
|
-
let currentLineWidth = 0;
|
|
88
|
-
let currentLine = 1;
|
|
89
|
-
const visible = [];
|
|
90
|
-
for (let i = 0; i < items.length; i++) {
|
|
91
|
-
const item = items[i];
|
|
92
|
-
if (!item) continue;
|
|
93
|
-
const label = getBadgeLabel(item);
|
|
94
|
-
const badgeWidth = badgeWidths.get(label);
|
|
95
|
-
if (!badgeWidth) {
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
const widthWithGap = badgeWidth + badgeGap;
|
|
99
|
-
const isLastLine = currentLine === lineCount;
|
|
100
|
-
const hasMoreItems = i < items.length - 1;
|
|
101
|
-
const availableWidth = isLastLine && hasMoreItems ? containerWidth - overflowBadgeWidth - badgeGap : containerWidth;
|
|
102
|
-
if (currentLineWidth + widthWithGap <= availableWidth) {
|
|
103
|
-
currentLineWidth += widthWithGap;
|
|
104
|
-
visible.push(item);
|
|
105
|
-
} else if (currentLine < lineCount) {
|
|
106
|
-
currentLine++;
|
|
107
|
-
currentLineWidth = widthWithGap;
|
|
108
|
-
visible.push(item);
|
|
109
|
-
} else {
|
|
110
|
-
break;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return {
|
|
114
|
-
visibleItems: visible,
|
|
115
|
-
hiddenCount: Math.max(0, items.length - visible.length)
|
|
116
|
-
};
|
|
117
|
-
}, [items, getBadgeLabel, containerWidth, lineCount, badgeGap, overflowBadgeWidth, badgeWidths]);
|
|
118
|
-
const Component = asChild ? Slot.Slot : "div";
|
|
119
|
-
return /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
120
|
-
/* @__PURE__ */ jsxs("div", { ref: measureRef, className: "pointer-events-none invisible absolute flex flex-wrap", style: { gap: badgeGap }, children: [
|
|
121
|
-
items.map((item, index) => /* @__PURE__ */ jsx(React.Fragment, { children: renderBadge(item, getBadgeLabel(item)) }, index)),
|
|
122
|
-
renderOverflow ? renderOverflow(99) : /* @__PURE__ */ jsx("div", { className: "inline-flex h-5 shrink-0 items-center rounded-md border px-1.5 text-xs font-semibold", children: "+99" })
|
|
123
|
-
] }),
|
|
124
|
-
isMeasured ? /* @__PURE__ */ jsxs(
|
|
125
|
-
Component,
|
|
126
|
-
{
|
|
127
|
-
"data-slot": "badge-overflow",
|
|
128
|
-
...rootProps,
|
|
129
|
-
ref: composedRef,
|
|
130
|
-
className: cn("flex flex-wrap", className),
|
|
131
|
-
style: {
|
|
132
|
-
gap: badgeGap,
|
|
133
|
-
...style
|
|
134
|
-
},
|
|
135
|
-
children: [
|
|
136
|
-
visibleItems.map((item, index) => /* @__PURE__ */ jsx(React.Fragment, { children: renderBadge(item, getBadgeLabel(item)) }, index)),
|
|
137
|
-
hiddenCount > 0 && (renderOverflow ? renderOverflow(hiddenCount) : /* @__PURE__ */ jsxs("div", { className: "inline-flex h-5 shrink-0 items-center rounded-md border px-1.5 text-xs font-semibold", children: [
|
|
138
|
-
"+",
|
|
139
|
-
hiddenCount
|
|
140
|
-
] }))
|
|
141
|
-
]
|
|
142
|
-
}
|
|
143
|
-
) : /* @__PURE__ */ jsx(
|
|
144
|
-
Component,
|
|
145
|
-
{
|
|
146
|
-
"data-slot": "badge-overflow",
|
|
147
|
-
...rootProps,
|
|
148
|
-
ref: composedRef,
|
|
149
|
-
className: cn("flex flex-wrap", className),
|
|
150
|
-
style: {
|
|
151
|
-
gap: badgeGap,
|
|
152
|
-
minHeight: placeholderHeight,
|
|
153
|
-
...style
|
|
154
|
-
},
|
|
155
|
-
children: items.slice(0, Math.min(items.length, lineCount * 3 - (lineCount > 1 ? 1 : 0))).map((item, index) => /* @__PURE__ */ jsx(React.Fragment, { children: renderBadge(item, getBadgeLabel(item)) }, index))
|
|
156
|
-
}
|
|
157
|
-
)
|
|
158
|
-
] });
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export { BadgeOverflow };
|