@lglab/compose-ui 0.28.0 → 0.29.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/dist/accordion.d.ts +49 -40
- package/dist/accordion.d.ts.map +1 -0
- package/dist/accordion.js +47 -45
- package/dist/accordion.js.map +1 -0
- package/dist/alert-dialog.d.ts +93 -87
- package/dist/alert-dialog.d.ts.map +1 -0
- package/dist/alert-dialog.js +94 -111
- package/dist/alert-dialog.js.map +1 -0
- package/dist/autocomplete.d.ts +99 -96
- package/dist/autocomplete.d.ts.map +1 -0
- package/dist/autocomplete.js +92 -116
- package/dist/autocomplete.js.map +1 -0
- package/dist/avatar.d.ts +56 -47
- package/dist/avatar.d.ts.map +1 -0
- package/dist/avatar.js +66 -79
- package/dist/avatar.js.map +1 -0
- package/dist/badge.d.ts +48 -42
- package/dist/badge.d.ts.map +1 -0
- package/dist/badge.js +195 -202
- package/dist/badge.js.map +1 -0
- package/dist/button.d.ts +26 -21
- package/dist/button.d.ts.map +1 -0
- package/dist/button.js +24 -24
- package/dist/button.js.map +1 -0
- package/dist/card.d.ts +105 -99
- package/dist/card.d.ts.map +1 -0
- package/dist/card.js +105 -66
- package/dist/card.js.map +1 -0
- package/dist/checkbox-group.d.ts +16 -12
- package/dist/checkbox-group.d.ts.map +1 -0
- package/dist/checkbox-group.js +18 -14
- package/dist/checkbox-group.js.map +1 -0
- package/dist/checkbox.d.ts +25 -19
- package/dist/checkbox.d.ts.map +1 -0
- package/dist/checkbox.js +26 -32
- package/dist/checkbox.js.map +1 -0
- package/dist/collapsible.d.ts +32 -26
- package/dist/collapsible.d.ts.map +1 -0
- package/dist/collapsible.js +32 -32
- package/dist/collapsible.js.map +1 -0
- package/dist/combobox.d.ts +191 -182
- package/dist/combobox.d.ts.map +1 -0
- package/dist/combobox.js +176 -250
- package/dist/combobox.js.map +1 -0
- package/dist/context-menu.d.ts +151 -138
- package/dist/context-menu.d.ts.map +1 -0
- package/dist/context-menu.js +151 -173
- package/dist/context-menu.js.map +1 -0
- package/dist/dialog.d.ts +101 -92
- package/dist/dialog.d.ts.map +1 -0
- package/dist/dialog.js +101 -105
- package/dist/dialog.js.map +1 -0
- package/dist/drawer.d.ts +109 -99
- package/dist/drawer.d.ts.map +1 -0
- package/dist/drawer.js +120 -111
- package/dist/drawer.js.map +1 -0
- package/dist/field.d.ts +61 -54
- package/dist/field.d.ts.map +1 -0
- package/dist/field.js +58 -27
- package/dist/field.js.map +1 -0
- package/dist/fieldset.d.ts +24 -19
- package/dist/fieldset.d.ts.map +1 -0
- package/dist/fieldset.js +26 -18
- package/dist/fieldset.js.map +1 -0
- package/dist/form.d.ts +16 -12
- package/dist/form.d.ts.map +1 -0
- package/dist/form.js +18 -8
- package/dist/form.js.map +1 -0
- package/dist/index.d.ts +44 -2115
- package/dist/index.js +44 -318
- package/dist/input.d.ts +16 -12
- package/dist/input.d.ts.map +1 -0
- package/dist/input.js +19 -9
- package/dist/input.js.map +1 -0
- package/dist/lib/arrow-svg.js +28 -0
- package/dist/lib/arrow-svg.js.map +1 -0
- package/dist/lib/button-variants.d.ts +6 -0
- package/dist/lib/button-variants.d.ts.map +1 -0
- package/dist/lib/button-variants.js +31 -0
- package/dist/lib/button-variants.js.map +1 -0
- package/dist/lib/control-variants.d.ts +6 -0
- package/dist/lib/control-variants.d.ts.map +1 -0
- package/dist/lib/control-variants.js +37 -0
- package/dist/lib/control-variants.js.map +1 -0
- package/dist/lib/form-variants.js +11 -0
- package/dist/lib/form-variants.js.map +1 -0
- package/dist/lib/tooltip-variants.d.ts +5 -0
- package/dist/lib/tooltip-variants.d.ts.map +1 -0
- package/dist/lib/tooltip-variants.js +36 -0
- package/dist/lib/tooltip-variants.js.map +1 -0
- package/dist/lib/utils.js +11 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/menu.d.ts +151 -138
- package/dist/menu.d.ts.map +1 -0
- package/dist/menu.js +151 -146
- package/dist/menu.js.map +1 -0
- package/dist/menubar.d.ts +168 -155
- package/dist/menubar.d.ts.map +1 -0
- package/dist/menubar.js +163 -169
- package/dist/menubar.js.map +1 -0
- package/dist/meter.d.ts +53 -43
- package/dist/meter.d.ts.map +1 -0
- package/dist/meter.js +59 -64
- package/dist/meter.js.map +1 -0
- package/dist/navigation-menu.d.ts +111 -96
- package/dist/navigation-menu.d.ts.map +1 -0
- package/dist/navigation-menu.js +117 -175
- package/dist/navigation-menu.js.map +1 -0
- package/dist/number-field.d.ts +64 -54
- package/dist/number-field.d.ts.map +1 -0
- package/dist/number-field.js +61 -69
- package/dist/number-field.js.map +1 -0
- package/dist/popover.d.ts +90 -82
- package/dist/popover.d.ts.map +1 -0
- package/dist/popover.js +85 -94
- package/dist/popover.js.map +1 -0
- package/dist/preview-card.d.ts +58 -54
- package/dist/preview-card.d.ts.map +1 -0
- package/dist/preview-card.js +57 -81
- package/dist/preview-card.js.map +1 -0
- package/dist/progress.d.ts +48 -40
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +46 -50
- package/dist/progress.js.map +1 -0
- package/dist/radio-group.d.ts +16 -12
- package/dist/radio-group.d.ts.map +1 -0
- package/dist/radio-group.js +18 -14
- package/dist/radio-group.js.map +1 -0
- package/dist/radio.d.ts +24 -19
- package/dist/radio.d.ts.map +1 -0
- package/dist/radio.js +25 -34
- package/dist/radio.js.map +1 -0
- package/dist/scroll-area.d.ts +57 -47
- package/dist/scroll-area.d.ts.map +1 -0
- package/dist/scroll-area.js +54 -56
- package/dist/scroll-area.js.map +1 -0
- package/dist/select.d.ts +146 -133
- package/dist/select.d.ts.map +1 -0
- package/dist/select.js +133 -167
- package/dist/select.js.map +1 -0
- package/dist/separator.d.ts +17 -12
- package/dist/separator.d.ts.map +1 -0
- package/dist/separator.js +19 -23
- package/dist/separator.js.map +1 -0
- package/dist/skeleton.d.ts +20 -0
- package/dist/skeleton.d.ts.map +1 -0
- package/dist/skeleton.js +27 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/slider.d.ts +56 -47
- package/dist/slider.d.ts.map +1 -0
- package/dist/slider.js +53 -62
- package/dist/slider.js.map +1 -0
- package/dist/styles/default.css +14 -0
- package/dist/switch.d.ts +24 -19
- package/dist/switch.d.ts.map +1 -0
- package/dist/switch.js +23 -39
- package/dist/switch.js.map +1 -0
- package/dist/tabs.d.ts +60 -49
- package/dist/tabs.d.ts.map +1 -0
- package/dist/tabs.js +76 -84
- package/dist/tabs.js.map +1 -0
- package/dist/textarea.d.ts +15 -11
- package/dist/textarea.d.ts.map +1 -0
- package/dist/textarea.js +18 -14
- package/dist/textarea.js.map +1 -0
- package/dist/toast.d.ts +87 -81
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +79 -150
- package/dist/toast.js.map +1 -0
- package/dist/toggle-group.d.ts +34 -29
- package/dist/toggle-group.d.ts.map +1 -0
- package/dist/toggle-group.js +31 -34
- package/dist/toggle-group.js.map +1 -0
- package/dist/toggle.d.ts +24 -21
- package/dist/toggle.d.ts.map +1 -0
- package/dist/toggle.js +22 -15
- package/dist/toggle.js.map +1 -0
- package/dist/toolbar.d.ts +64 -56
- package/dist/toolbar.d.ts.map +1 -0
- package/dist/toolbar.js +57 -68
- package/dist/toolbar.js.map +1 -0
- package/dist/tooltip.d.ts +67 -62
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/tooltip.js +65 -90
- package/dist/tooltip.js.map +1 -0
- package/package.json +8 -8
- package/dist/arrow-svg-C6zQTvgS.js +0 -40
- package/dist/button-variants-CbFMPwc8.js +0 -33
- package/dist/control-variants-Bwep4n0y.js +0 -37
- package/dist/form-variants-LJ8gIbk0.js +0 -9
- package/dist/utils-B6yFEsav.js +0 -8
package/dist/textarea.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
m as Textarea
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn } from "./lib/utils.js";
|
|
4
|
+
import { inputBaseStyles } from "./lib/form-variants.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/textarea.tsx
|
|
9
|
+
const Textarea = ({ className, ...props }) => {
|
|
10
|
+
return /* @__PURE__ */ jsx("textarea", {
|
|
11
|
+
className: cn(inputBaseStyles, "h-auto min-h-20 py-2", className),
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
15
14
|
};
|
|
15
|
+
Textarea.displayName = "Textarea";
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Textarea };
|
|
19
|
+
//# sourceMappingURL=textarea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.js","names":[],"sources":["../src/components/textarea.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\n\nimport { inputBaseStyles } from '../lib/form-variants'\nimport { cn } from '../lib/utils'\n\ntype TextareaProps = React.ComponentProps<'textarea'>\n\nconst Textarea = ({ className, ...props }: TextareaProps) => {\n return (\n <textarea\n className={cn(inputBaseStyles, 'h-auto min-h-20 py-2', className)}\n {...props}\n />\n )\n}\n\nTextarea.displayName = 'Textarea'\n\nexport { Textarea }\n\nexport type { TextareaProps }\n"],"mappings":";;;;;;;;AASA,MAAM,YAAY,EAAE,WAAW,GAAG,YAA2B;AAC3D,QACE,oBAAC;EACC,WAAW,GAAG,iBAAiB,wBAAwB,UAAU;EACjE,GAAI;GACJ;;AAIN,SAAS,cAAc"}
|
package/dist/toast.d.ts
CHANGED
|
@@ -1,81 +1,87 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
1
|
+
import { ButtonSize, ButtonVariant } from "./lib/button-variants.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as react_jsx_runtime171 from "react/jsx-runtime";
|
|
4
|
+
import { Toast, Toast as Toast$1 } from "@base-ui/react/toast";
|
|
5
|
+
|
|
6
|
+
//#region src/components/toast.d.ts
|
|
7
|
+
type ToastProviderProps = React.ComponentProps<typeof Toast$1.Provider>;
|
|
8
|
+
declare const ToastProvider: {
|
|
9
|
+
(props: ToastProviderProps): react_jsx_runtime171.JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
13
|
+
type ToastViewportProps = React.ComponentProps<typeof Toast$1.Viewport> & {
|
|
14
|
+
position?: ToastPosition;
|
|
15
|
+
};
|
|
16
|
+
declare const ToastViewport: {
|
|
17
|
+
({
|
|
18
|
+
className,
|
|
19
|
+
position,
|
|
20
|
+
...props
|
|
21
|
+
}: ToastViewportProps): react_jsx_runtime171.JSX.Element;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
24
|
+
type ToastRootProps = React.ComponentProps<typeof Toast$1.Root>;
|
|
25
|
+
declare const ToastRoot: {
|
|
26
|
+
({
|
|
27
|
+
className,
|
|
28
|
+
...props
|
|
29
|
+
}: ToastRootProps): react_jsx_runtime171.JSX.Element;
|
|
30
|
+
displayName: string;
|
|
31
|
+
};
|
|
32
|
+
type ToastContentProps = React.ComponentProps<typeof Toast$1.Content>;
|
|
33
|
+
declare const ToastContent: {
|
|
34
|
+
({
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}: ToastContentProps): react_jsx_runtime171.JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
};
|
|
40
|
+
type ToastTitleProps = React.ComponentProps<typeof Toast$1.Title>;
|
|
41
|
+
declare const ToastTitle: {
|
|
42
|
+
({
|
|
43
|
+
className,
|
|
44
|
+
...props
|
|
45
|
+
}: ToastTitleProps): react_jsx_runtime171.JSX.Element;
|
|
46
|
+
displayName: string;
|
|
47
|
+
};
|
|
48
|
+
type ToastDescriptionProps = React.ComponentProps<typeof Toast$1.Description>;
|
|
49
|
+
declare const ToastDescription: {
|
|
50
|
+
({
|
|
51
|
+
className,
|
|
52
|
+
...props
|
|
53
|
+
}: ToastDescriptionProps): react_jsx_runtime171.JSX.Element;
|
|
54
|
+
displayName: string;
|
|
55
|
+
};
|
|
56
|
+
type ToastActionProps = React.ComponentProps<typeof Toast$1.Action> & {
|
|
57
|
+
variant?: ButtonVariant;
|
|
58
|
+
size?: ButtonSize;
|
|
59
|
+
};
|
|
60
|
+
declare const ToastAction: {
|
|
61
|
+
({
|
|
62
|
+
className,
|
|
63
|
+
variant,
|
|
64
|
+
size,
|
|
65
|
+
...props
|
|
66
|
+
}: ToastActionProps): react_jsx_runtime171.JSX.Element;
|
|
67
|
+
displayName: string;
|
|
68
|
+
};
|
|
69
|
+
type ToastCloseProps = React.ComponentProps<typeof Toast$1.Close>;
|
|
70
|
+
declare const ToastClose: {
|
|
71
|
+
({
|
|
72
|
+
className,
|
|
73
|
+
...props
|
|
74
|
+
}: ToastCloseProps): react_jsx_runtime171.JSX.Element;
|
|
75
|
+
displayName: string;
|
|
76
|
+
};
|
|
77
|
+
type ToastPositionerProps = React.ComponentProps<typeof Toast$1.Positioner>;
|
|
78
|
+
declare const ToastPositioner: {
|
|
79
|
+
({
|
|
80
|
+
className,
|
|
81
|
+
...props
|
|
82
|
+
}: ToastPositionerProps): react_jsx_runtime171.JSX.Element;
|
|
83
|
+
displayName: string;
|
|
84
|
+
};
|
|
85
|
+
//#endregion
|
|
86
|
+
export { Toast, ToastAction, type ToastActionProps, ToastClose, type ToastCloseProps, ToastContent, type ToastContentProps, ToastDescription, type ToastDescriptionProps, type ToastPosition, ToastPositioner, type ToastPositionerProps, ToastProvider, type ToastProviderProps, ToastRoot, type ToastRootProps, ToastTitle, type ToastTitleProps, ToastViewport, type ToastViewportProps };
|
|
87
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.ts","names":[],"sources":["../src/components/toast.tsx"],"sourcesContent":[],"mappings":";;;;;;KAgBK,kBAAA,GAAqB,KAAA,CAAM,sBAAsB,OAAA,CAAU;cAE1D;UAAwB,qBAAkB,oBAAA,CAAA,GAAA,CAAA;EAF3C,WAAA,EAAA,MAAA;CAAkB;KAYlB,aAAA,GAZ2D,UAAA,GAAA,YAAA,GAAA,WAAA,GAAA,aAAA,GAAA,eAAA,GAAA,cAAA;KAoB3D,kBAAA,GAAqB,KAAA,CAAM,cApBA,CAAA,OAoBsB,OAAA,CAAU,QApBhC,CAAA,GAAA;EAAc,QAAA,CAAA,EAqBjC,aArBiC;AAAA,CAAA;cAwBxC,aApBL,EAAA;;IAF6B,SAAA;IAAA,QAAA;IAAA,GAAA;EAAA,CAAA,EA0B3B,kBA1B2B,CAAA,EA0BT,oBAAA,CAAA,GAAA,CAAA,OA1BS;aAAkB,EAAA,MAAA;CAAA;AAAA,KAoD3C,cAAA,GAAiB,KAAA,CAAM,cA1CV,CAAA,OA0CgC,OAAA,CAAU,IA1C1C,CAAA;AAAA,cA4CZ,SApCD,EAAkB;EAAA,CAAA;IAAA,SAAA;IAAA,GAAA;EAAA,CAAA,EAoCqB,cApCrB,CAAA,EAoCmC,oBAAA,CAAA,GAAA,CAAA,OApCnC;aAAyC,EAAA,MAAA;;KAuG3D,iBAAA,GAAoB,KAAA,CAAM,cAtGlB,CAAA,OAsGwC,OAAA,CAAU,OAtGlD,CAAA;cAwGP,YAxGoB,EAAA;EAGpB,CAAA;IAAA,SAAA;IAAA,GAsBL;EAAA,CAAA,EA+E8C,iBA/E9C,CAAA,EA+E+D,oBAAA,CAAA,GAAA,CAAA,OA/E/D;EAAA,WAAA,EAAA,MAAA;;KAoGI,eAAA,GAAkB,KAAA,CAAM,sBAAsB,OAAA,CAAU;cAEvD,UAxHH,EAAA;;IAAkB,SAAA;IAAA,GAAA;EAAA,CAAA,EAwHwB,eAxHxB,CAAA,EAwHuC,oBAAA,CAAA,GAAA,CAAA,OAxHvC;EAAA,WAAA,EAAA,MAAA;AAAA,CAAA;KAkIhB,qBAAA,GAAwB,KAAA,CAAM,cAxGhB,CAAA,OAwGsC,OAAA,CAAU,WAxGhD,CAAA;cA0Gb,gBA1GsD,EAAA;;IAAtC,SAAM;IAAA,GAAA;EAAA,CAAA,EA0GuB,qBA1GvB,CAAA,EA0G4C,oBAAA,CAAA,GAAA,CAAA,OA1G5C;EAAc,WAAA,EAAA,MAAA;AAAA,CAAA;KAoHrC,gBAAA,GAAmB,KAAA,CAAM,cAvD7B,CAAA,OAuDmD,OAAA,CAAU,MAvD7D,CAAA,GAAA;YAwDW;MAnHgC,CAAA,EAoHnC,UApHmC;;cAuHtC,WAvHoD,EAAA;EAmErD,CAAA;IAAA,SAAA;IAAA,OAAiB;IAAA,IAAA;IAAA,GAAA;EAAA,CAAA,EAoD8C,gBApD9C,CAAA,EAoD8D,oBAAA,CAAA,GAAA,CAAA,OApD9D;EAAA,WAAA,EAAA,MAAA;;KAmEjB,eAAA,GAAkB,KAAA,CAAM,cAnEE,CAAA,OAmEoB,OAAA,CAAU,KAnE9B,CAAA;cAqEzB,UArEuC,EAAA;EAEvC,CAAA;IAAA,SAAA;IAAA,GAaL;EAAA,CAAA,EAsD4C,eAtD5C,CAAA,EAsD2D,oBAAA,CAAA,GAAA,CAAA,OAtD3D;EAAA,WAAA,EAAA,MAAA;;KAyEI,oBAAA,GAAuB,KAAA,CAAM,cAtFa,CAAA,OAsFS,OAAA,CAAU,UAtFnB,CAAA;cAwFzC,eAxF0D,EAAA;EAAA,CAAA;IAAA,SAAA;IAAA,GAAA;EAAA,CAAA,EAwFd,oBAxFc,CAAA,EAwFM,oBAAA,CAAA,GAAA,CAAA,OAxFN;EAqB3D,WAAA,EAAA,MAAe;CAAA"}
|
package/dist/toast.js
CHANGED
|
@@ -1,151 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
...s
|
|
13
|
-
}) => /* @__PURE__ */ o(
|
|
14
|
-
e.Viewport,
|
|
15
|
-
{
|
|
16
|
-
"data-position": a,
|
|
17
|
-
className: i(
|
|
18
|
-
"fixed z-50 w-[356px] outline-none",
|
|
19
|
-
// Vertical position
|
|
20
|
-
"data-[position^=bottom]:bottom-4",
|
|
21
|
-
"data-[position^=top]:top-4",
|
|
22
|
-
// Horizontal position
|
|
23
|
-
"data-[position$=right]:right-4",
|
|
24
|
-
"data-[position$=left]:left-4",
|
|
25
|
-
"data-[position$=center]:left-1/2 data-[position$=center]:-translate-x-1/2",
|
|
26
|
-
t
|
|
27
|
-
),
|
|
28
|
-
...s
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
p.displayName = "ToastViewport";
|
|
32
|
-
const l = ({ className: t, ...a }) => /* @__PURE__ */ o(
|
|
33
|
-
e.Root,
|
|
34
|
-
{
|
|
35
|
-
className: i(
|
|
36
|
-
// Base styles
|
|
37
|
-
"group flex w-full flex-col gap-1 rounded-lg border border-border bg-background p-4 shadow-lg",
|
|
38
|
-
"transition-[transform,opacity,height] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
39
|
-
"absolute z-[calc(1000-var(--toast-index))]",
|
|
40
|
-
"h-(--height) select-none",
|
|
41
|
-
// CSS custom properties for stacking
|
|
42
|
-
"[--gap:0.75rem] [--peek:0.75rem]",
|
|
43
|
-
"[--scale:calc(max(0,1-(var(--toast-index)*0.1)))]",
|
|
44
|
-
"[--shrink:calc(1-var(--scale))]",
|
|
45
|
-
"[--height:var(--toast-frontmost-height,var(--toast-height))]",
|
|
46
|
-
// Expanded state height
|
|
47
|
-
"data-expanded:h-(--toast-height)",
|
|
48
|
-
// Ending styles (shared)
|
|
49
|
-
"data-ending-style:opacity-0",
|
|
50
|
-
"data-limited:opacity-0",
|
|
51
|
-
// Gap element for hover interaction
|
|
52
|
-
'after:absolute after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-[""]',
|
|
53
|
-
// ===== BOTTOM POSITIONS =====
|
|
54
|
-
"in-data-[position^=bottom]:bottom-0",
|
|
55
|
-
"in-data-[position^=bottom]:origin-bottom",
|
|
56
|
-
"in-data-[position^=bottom]:[--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))]",
|
|
57
|
-
"in-data-[position^=bottom]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))]",
|
|
58
|
-
"in-data-[position^=bottom]:data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]",
|
|
59
|
-
"in-data-[position^=bottom]:data-starting-style:transform-[translateY(150%)]",
|
|
60
|
-
"in-data-[position^=bottom]:data-ending-style:transform-[translateY(150%)]",
|
|
61
|
-
"in-data-[position^=bottom]:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))]",
|
|
62
|
-
"in-data-[position^=bottom]:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))]",
|
|
63
|
-
"in-data-[position^=bottom]:after:top-full",
|
|
64
|
-
// ===== TOP POSITIONS =====
|
|
65
|
-
"in-data-[position^=top]:top-0",
|
|
66
|
-
"in-data-[position^=top]:origin-top",
|
|
67
|
-
"in-data-[position^=top]:[--offset-y:calc(var(--toast-offset-y)+calc(var(--toast-index)*var(--gap))+var(--toast-swipe-movement-y))]",
|
|
68
|
-
"in-data-[position^=top]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+(var(--toast-index)*var(--peek))+(var(--shrink)*var(--height))))_scale(var(--scale))]",
|
|
69
|
-
"in-data-[position^=top]:data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]",
|
|
70
|
-
"in-data-[position^=top]:data-starting-style:transform-[translateY(-150%)]",
|
|
71
|
-
"in-data-[position^=top]:data-ending-style:transform-[translateY(-150%)]",
|
|
72
|
-
"in-data-[position^=top]:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))]",
|
|
73
|
-
"in-data-[position^=top]:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))]",
|
|
74
|
-
"in-data-[position^=top]:after:bottom-full",
|
|
75
|
-
// ===== HORIZONTAL POSITIONS =====
|
|
76
|
-
"in-data-[position$=right]:right-0",
|
|
77
|
-
"in-data-[position$=left]:left-0",
|
|
78
|
-
"in-data-[position$=center]:left-0 in-data-[position$=center]:right-0",
|
|
79
|
-
// Left/right swipe exit animations
|
|
80
|
-
"data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]",
|
|
81
|
-
"data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]",
|
|
82
|
-
t
|
|
83
|
-
),
|
|
84
|
-
...a
|
|
85
|
-
}
|
|
86
|
-
);
|
|
87
|
-
l.displayName = "ToastRoot";
|
|
88
|
-
const m = ({ className: t, ...a }) => /* @__PURE__ */ o(
|
|
89
|
-
e.Content,
|
|
90
|
-
{
|
|
91
|
-
className: i(
|
|
92
|
-
"flex flex-col gap-1 overflow-hidden",
|
|
93
|
-
"transition-opacity duration-250",
|
|
94
|
-
"data-behind:pointer-events-none data-behind:opacity-0",
|
|
95
|
-
"data-expanded:pointer-events-auto data-expanded:opacity-100",
|
|
96
|
-
t
|
|
97
|
-
),
|
|
98
|
-
...a
|
|
99
|
-
}
|
|
100
|
-
);
|
|
101
|
-
m.displayName = "ToastContent";
|
|
102
|
-
const c = ({ className: t, ...a }) => /* @__PURE__ */ o(e.Title, { className: i("font-semibold", t), ...a });
|
|
103
|
-
c.displayName = "ToastTitle";
|
|
104
|
-
const f = ({ className: t, ...a }) => /* @__PURE__ */ o(e.Description, { className: i("text-sm", t), ...a });
|
|
105
|
-
f.displayName = "ToastDescription";
|
|
106
|
-
const v = ({ className: t, variant: a, size: s = "sm", ...r }) => /* @__PURE__ */ o(
|
|
107
|
-
e.Action,
|
|
108
|
-
{
|
|
109
|
-
className: i("w-fit mt-2", n({ variant: a, size: s }), t),
|
|
110
|
-
...r
|
|
111
|
-
}
|
|
112
|
-
);
|
|
113
|
-
v.displayName = "ToastAction";
|
|
114
|
-
const g = ({ className: t, ...a }) => /* @__PURE__ */ o(
|
|
115
|
-
e.Close,
|
|
116
|
-
{
|
|
117
|
-
className: i(
|
|
118
|
-
n({ variant: "ghost", size: "icon" }),
|
|
119
|
-
"absolute right-2 top-2 size-6",
|
|
120
|
-
t
|
|
121
|
-
),
|
|
122
|
-
...a
|
|
123
|
-
}
|
|
124
|
-
);
|
|
125
|
-
g.displayName = "ToastClose";
|
|
126
|
-
const y = ({ className: t, ...a }) => /* @__PURE__ */ o(
|
|
127
|
-
e.Positioner,
|
|
128
|
-
{
|
|
129
|
-
className: i(
|
|
130
|
-
"z-50",
|
|
131
|
-
"transition-[top,left,right,bottom,transform]",
|
|
132
|
-
"duration-[0.35s]",
|
|
133
|
-
"ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
134
|
-
t
|
|
135
|
-
),
|
|
136
|
-
...a
|
|
137
|
-
}
|
|
138
|
-
);
|
|
139
|
-
y.displayName = "ToastPositioner";
|
|
140
|
-
export {
|
|
141
|
-
N as Toast,
|
|
142
|
-
v as ToastAction,
|
|
143
|
-
g as ToastClose,
|
|
144
|
-
m as ToastContent,
|
|
145
|
-
f as ToastDescription,
|
|
146
|
-
y as ToastPositioner,
|
|
147
|
-
d as ToastProvider,
|
|
148
|
-
l as ToastRoot,
|
|
149
|
-
c as ToastTitle,
|
|
150
|
-
p as ToastViewport
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { buttonVariants } from "./lib/button-variants.js";
|
|
4
|
+
import { cn } from "./lib/utils.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { Toast, Toast as Toast$1 } from "@base-ui/react/toast";
|
|
8
|
+
|
|
9
|
+
//#region src/components/toast.tsx
|
|
10
|
+
const ToastProvider = (props) => {
|
|
11
|
+
return /* @__PURE__ */ jsx(Toast$1.Provider, { ...props });
|
|
151
12
|
};
|
|
13
|
+
ToastProvider.displayName = "ToastProvider";
|
|
14
|
+
const ToastViewport = ({ className, position = "bottom-right", ...props }) => {
|
|
15
|
+
return /* @__PURE__ */ jsx(Toast$1.Viewport, {
|
|
16
|
+
"data-position": position,
|
|
17
|
+
className: cn("fixed z-50 w-[356px] outline-none", "data-[position^=bottom]:bottom-4", "data-[position^=top]:top-4", "data-[position$=right]:right-4", "data-[position$=left]:left-4", "data-[position$=center]:left-1/2 data-[position$=center]:-translate-x-1/2", className),
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
ToastViewport.displayName = "ToastViewport";
|
|
22
|
+
const ToastRoot = ({ className, ...props }) => {
|
|
23
|
+
return /* @__PURE__ */ jsx(Toast$1.Root, {
|
|
24
|
+
className: cn("group flex w-full flex-col gap-1 rounded-lg border border-border bg-background p-4 shadow-lg", "transition-[transform,opacity,height] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)]", "absolute z-[calc(1000-var(--toast-index))]", "h-(--height) select-none", "[--gap:0.75rem] [--peek:0.75rem]", "[--scale:calc(max(0,1-(var(--toast-index)*0.1)))]", "[--shrink:calc(1-var(--scale))]", "[--height:var(--toast-frontmost-height,var(--toast-height))]", "data-expanded:h-(--toast-height)", "data-ending-style:opacity-0", "data-limited:opacity-0", "after:absolute after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-[\"\"]", "in-data-[position^=bottom]:bottom-0", "in-data-[position^=bottom]:origin-bottom", "in-data-[position^=bottom]:[--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))]", "in-data-[position^=bottom]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))]", "in-data-[position^=bottom]:data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]", "in-data-[position^=bottom]:data-starting-style:transform-[translateY(150%)]", "in-data-[position^=bottom]:data-ending-style:transform-[translateY(150%)]", "in-data-[position^=bottom]:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))]", "in-data-[position^=bottom]:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))]", "in-data-[position^=bottom]:after:top-full", "in-data-[position^=top]:top-0", "in-data-[position^=top]:origin-top", "in-data-[position^=top]:[--offset-y:calc(var(--toast-offset-y)+calc(var(--toast-index)*var(--gap))+var(--toast-swipe-movement-y))]", "in-data-[position^=top]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+(var(--toast-index)*var(--peek))+(var(--shrink)*var(--height))))_scale(var(--scale))]", "in-data-[position^=top]:data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]", "in-data-[position^=top]:data-starting-style:transform-[translateY(-150%)]", "in-data-[position^=top]:data-ending-style:transform-[translateY(-150%)]", "in-data-[position^=top]:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))]", "in-data-[position^=top]:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))]", "in-data-[position^=top]:after:bottom-full", "in-data-[position$=right]:right-0", "in-data-[position$=left]:left-0", "in-data-[position$=center]:left-0 in-data-[position$=center]:right-0", "data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]", "data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]", className),
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
ToastRoot.displayName = "ToastRoot";
|
|
29
|
+
const ToastContent = ({ className, ...props }) => {
|
|
30
|
+
return /* @__PURE__ */ jsx(Toast$1.Content, {
|
|
31
|
+
className: cn("flex flex-col gap-1 overflow-hidden", "transition-opacity duration-250", "data-behind:pointer-events-none data-behind:opacity-0", "data-expanded:pointer-events-auto data-expanded:opacity-100", className),
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
ToastContent.displayName = "ToastContent";
|
|
36
|
+
const ToastTitle = ({ className, ...props }) => {
|
|
37
|
+
return /* @__PURE__ */ jsx(Toast$1.Title, {
|
|
38
|
+
className: cn("font-semibold", className),
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
ToastTitle.displayName = "ToastTitle";
|
|
43
|
+
const ToastDescription = ({ className, ...props }) => {
|
|
44
|
+
return /* @__PURE__ */ jsx(Toast$1.Description, {
|
|
45
|
+
className: cn("text-sm", className),
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
ToastDescription.displayName = "ToastDescription";
|
|
50
|
+
const ToastAction = ({ className, variant, size = "sm", ...props }) => {
|
|
51
|
+
return /* @__PURE__ */ jsx(Toast$1.Action, {
|
|
52
|
+
className: cn("w-fit mt-2", buttonVariants({
|
|
53
|
+
variant,
|
|
54
|
+
size
|
|
55
|
+
}), className),
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
ToastAction.displayName = "ToastAction";
|
|
60
|
+
const ToastClose = ({ className, ...props }) => {
|
|
61
|
+
return /* @__PURE__ */ jsx(Toast$1.Close, {
|
|
62
|
+
className: cn(buttonVariants({
|
|
63
|
+
variant: "ghost",
|
|
64
|
+
size: "icon"
|
|
65
|
+
}), "absolute right-2 top-2 size-6", className),
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
ToastClose.displayName = "ToastClose";
|
|
70
|
+
const ToastPositioner = ({ className, ...props }) => {
|
|
71
|
+
return /* @__PURE__ */ jsx(Toast$1.Positioner, {
|
|
72
|
+
className: cn("z-50", "transition-[top,left,right,bottom,transform]", "duration-[0.35s]", "ease-[cubic-bezier(0.22,1,0.36,1)]", className),
|
|
73
|
+
...props
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
ToastPositioner.displayName = "ToastPositioner";
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
export { Toast, ToastAction, ToastClose, ToastContent, ToastDescription, ToastPositioner, ToastProvider, ToastRoot, ToastTitle, ToastViewport };
|
|
80
|
+
//# sourceMappingURL=toast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.js","names":["BaseToast"],"sources":["../src/components/toast.tsx"],"sourcesContent":["'use client'\n\nimport { Toast as BaseToast } from '@base-ui/react/toast'\nimport * as React from 'react'\n\nimport {\n type ButtonSize,\n type ButtonVariant,\n buttonVariants,\n} from '../lib/button-variants'\nimport { cn } from '../lib/utils'\n\n// ============================================================================\n// ToastProvider\n// ============================================================================\n\ntype ToastProviderProps = React.ComponentProps<typeof BaseToast.Provider>\n\nconst ToastProvider = (props: ToastProviderProps) => {\n return <BaseToast.Provider {...props} />\n}\n\nToastProvider.displayName = 'ToastProvider'\n\n// ============================================================================\n// ToastViewport\n// ============================================================================\n\ntype ToastPosition =\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right'\n\ntype ToastViewportProps = React.ComponentProps<typeof BaseToast.Viewport> & {\n position?: ToastPosition\n}\n\nconst ToastViewport = ({\n className,\n position = 'bottom-right',\n ...props\n}: ToastViewportProps) => {\n return (\n <BaseToast.Viewport\n data-position={position}\n className={cn(\n 'fixed z-50 w-[356px] outline-none',\n // Vertical position\n 'data-[position^=bottom]:bottom-4',\n 'data-[position^=top]:top-4',\n // Horizontal position\n 'data-[position$=right]:right-4',\n 'data-[position$=left]:left-4',\n 'data-[position$=center]:left-1/2 data-[position$=center]:-translate-x-1/2',\n className,\n )}\n {...props}\n />\n )\n}\n\nToastViewport.displayName = 'ToastViewport'\n\n// ============================================================================\n// ToastRoot\n// ============================================================================\n\ntype ToastRootProps = React.ComponentProps<typeof BaseToast.Root>\n\nconst ToastRoot = ({ className, ...props }: ToastRootProps) => {\n return (\n <BaseToast.Root\n className={cn(\n // Base styles\n 'group flex w-full flex-col gap-1 rounded-lg border border-border bg-background p-4 shadow-lg',\n 'transition-[transform,opacity,height] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)]',\n 'absolute z-[calc(1000-var(--toast-index))]',\n 'h-(--height) select-none',\n // CSS custom properties for stacking\n '[--gap:0.75rem] [--peek:0.75rem]',\n '[--scale:calc(max(0,1-(var(--toast-index)*0.1)))]',\n '[--shrink:calc(1-var(--scale))]',\n '[--height:var(--toast-frontmost-height,var(--toast-height))]',\n // Expanded state height\n 'data-expanded:h-(--toast-height)',\n // Ending styles (shared)\n 'data-ending-style:opacity-0',\n 'data-limited:opacity-0',\n // Gap element for hover interaction\n 'after:absolute after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-[\"\"]',\n\n // ===== BOTTOM POSITIONS =====\n 'in-data-[position^=bottom]:bottom-0',\n 'in-data-[position^=bottom]:origin-bottom',\n 'in-data-[position^=bottom]:[--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))]',\n 'in-data-[position^=bottom]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))]',\n 'in-data-[position^=bottom]:data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]',\n 'in-data-[position^=bottom]:data-starting-style:transform-[translateY(150%)]',\n 'in-data-[position^=bottom]:data-ending-style:transform-[translateY(150%)]',\n 'in-data-[position^=bottom]:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))]',\n 'in-data-[position^=bottom]:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))]',\n 'in-data-[position^=bottom]:after:top-full',\n\n // ===== TOP POSITIONS =====\n 'in-data-[position^=top]:top-0',\n 'in-data-[position^=top]:origin-top',\n 'in-data-[position^=top]:[--offset-y:calc(var(--toast-offset-y)+calc(var(--toast-index)*var(--gap))+var(--toast-swipe-movement-y))]',\n 'in-data-[position^=top]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+(var(--toast-index)*var(--peek))+(var(--shrink)*var(--height))))_scale(var(--scale))]',\n 'in-data-[position^=top]:data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]',\n 'in-data-[position^=top]:data-starting-style:transform-[translateY(-150%)]',\n 'in-data-[position^=top]:data-ending-style:transform-[translateY(-150%)]',\n 'in-data-[position^=top]:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))]',\n 'in-data-[position^=top]:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))]',\n 'in-data-[position^=top]:after:bottom-full',\n\n // ===== HORIZONTAL POSITIONS =====\n 'in-data-[position$=right]:right-0',\n 'in-data-[position$=left]:left-0',\n 'in-data-[position$=center]:left-0 in-data-[position$=center]:right-0',\n // Left/right swipe exit animations\n 'data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]',\n 'data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]',\n\n className,\n )}\n {...props}\n />\n )\n}\n\nToastRoot.displayName = 'ToastRoot'\n\n// ============================================================================\n// ToastContent\n// ============================================================================\n\ntype ToastContentProps = React.ComponentProps<typeof BaseToast.Content>\n\nconst ToastContent = ({ className, ...props }: ToastContentProps) => {\n return (\n <BaseToast.Content\n className={cn(\n 'flex flex-col gap-1 overflow-hidden',\n 'transition-opacity duration-250',\n 'data-behind:pointer-events-none data-behind:opacity-0',\n 'data-expanded:pointer-events-auto data-expanded:opacity-100',\n className,\n )}\n {...props}\n />\n )\n}\n\nToastContent.displayName = 'ToastContent'\n\n// ============================================================================\n// ToastTitle\n// ============================================================================\n\ntype ToastTitleProps = React.ComponentProps<typeof BaseToast.Title>\n\nconst ToastTitle = ({ className, ...props }: ToastTitleProps) => {\n return <BaseToast.Title className={cn('font-semibold', className)} {...props} />\n}\n\nToastTitle.displayName = 'ToastTitle'\n\n// ============================================================================\n// ToastDescription\n// ============================================================================\n\ntype ToastDescriptionProps = React.ComponentProps<typeof BaseToast.Description>\n\nconst ToastDescription = ({ className, ...props }: ToastDescriptionProps) => {\n return <BaseToast.Description className={cn('text-sm', className)} {...props} />\n}\n\nToastDescription.displayName = 'ToastDescription'\n\n// ============================================================================\n// ToastAction\n// ============================================================================\n\ntype ToastActionProps = React.ComponentProps<typeof BaseToast.Action> & {\n variant?: ButtonVariant\n size?: ButtonSize\n}\n\nconst ToastAction = ({ className, variant, size = 'sm', ...props }: ToastActionProps) => {\n return (\n <BaseToast.Action\n className={cn('w-fit mt-2', buttonVariants({ variant, size }), className)}\n {...props}\n />\n )\n}\n\nToastAction.displayName = 'ToastAction'\n\n// ============================================================================\n// ToastClose\n// ============================================================================\n\ntype ToastCloseProps = React.ComponentProps<typeof BaseToast.Close>\n\nconst ToastClose = ({ className, ...props }: ToastCloseProps) => {\n return (\n <BaseToast.Close\n className={cn(\n buttonVariants({ variant: 'ghost', size: 'icon' }),\n 'absolute right-2 top-2 size-6',\n className,\n )}\n {...props}\n />\n )\n}\n\nToastClose.displayName = 'ToastClose'\n\n// ============================================================================\n// ToastPositioner\n// ============================================================================\n\ntype ToastPositionerProps = React.ComponentProps<typeof BaseToast.Positioner>\n\nconst ToastPositioner = ({ className, ...props }: ToastPositionerProps) => {\n return (\n <BaseToast.Positioner\n className={cn(\n 'z-50',\n 'transition-[top,left,right,bottom,transform]',\n 'duration-[0.35s]',\n 'ease-[cubic-bezier(0.22,1,0.36,1)]',\n className,\n )}\n {...props}\n />\n )\n}\n\nToastPositioner.displayName = 'ToastPositioner'\n\n// ============================================================================\n// Exports\n// ============================================================================\n\n// Re-export Toast from Base UI for useToastManager, createToastManager, and other utilities\nexport { Toast } from '@base-ui/react/toast'\n\nexport {\n ToastProvider,\n ToastViewport,\n ToastRoot,\n ToastContent,\n ToastTitle,\n ToastDescription,\n ToastAction,\n ToastClose,\n ToastPositioner,\n}\n\nexport type {\n ToastPosition,\n ToastProviderProps,\n ToastViewportProps,\n ToastRootProps,\n ToastContentProps,\n ToastTitleProps,\n ToastDescriptionProps,\n ToastActionProps,\n ToastCloseProps,\n ToastPositionerProps,\n}\n"],"mappings":";;;;;;;;;AAkBA,MAAM,iBAAiB,UAA8B;AACnD,QAAO,oBAACA,QAAU,YAAS,GAAI,QAAS;;AAG1C,cAAc,cAAc;AAkB5B,MAAM,iBAAiB,EACrB,WACA,WAAW,gBACX,GAAG,YACqB;AACxB,QACE,oBAACA,QAAU;EACT,iBAAe;EACf,WAAW,GACT,qCAEA,oCACA,8BAEA,kCACA,gCACA,6EACA,UACD;EACD,GAAI;GACJ;;AAIN,cAAc,cAAc;AAQ5B,MAAM,aAAa,EAAE,WAAW,GAAG,YAA4B;AAC7D,QACE,oBAACA,QAAU;EACT,WAAW,GAET,gGACA,yFACA,8CACA,4BAEA,oCACA,qDACA,mCACA,gEAEA,oCAEA,+BACA,0BAEA,gGAGA,uCACA,4CACA,+IACA,uNACA,8HACA,+EACA,6EACA,6IACA,2IACA,6CAGA,iCACA,sCACA,sIACA,oNACA,2HACA,6EACA,2EACA,0IACA,wIACA,6CAGA,qCACA,mCACA,wEAEA,8IACA,+IAEA,UACD;EACD,GAAI;GACJ;;AAIN,UAAU,cAAc;AAQxB,MAAM,gBAAgB,EAAE,WAAW,GAAG,YAA+B;AACnE,QACE,oBAACA,QAAU;EACT,WAAW,GACT,uCACA,mCACA,yDACA,+DACA,UACD;EACD,GAAI;GACJ;;AAIN,aAAa,cAAc;AAQ3B,MAAM,cAAc,EAAE,WAAW,GAAG,YAA6B;AAC/D,QAAO,oBAACA,QAAU;EAAM,WAAW,GAAG,iBAAiB,UAAU;EAAE,GAAI;GAAS;;AAGlF,WAAW,cAAc;AAQzB,MAAM,oBAAoB,EAAE,WAAW,GAAG,YAAmC;AAC3E,QAAO,oBAACA,QAAU;EAAY,WAAW,GAAG,WAAW,UAAU;EAAE,GAAI;GAAS;;AAGlF,iBAAiB,cAAc;AAW/B,MAAM,eAAe,EAAE,WAAW,SAAS,OAAO,MAAM,GAAG,YAA8B;AACvF,QACE,oBAACA,QAAU;EACT,WAAW,GAAG,cAAc,eAAe;GAAE;GAAS;GAAM,CAAC,EAAE,UAAU;EACzE,GAAI;GACJ;;AAIN,YAAY,cAAc;AAQ1B,MAAM,cAAc,EAAE,WAAW,GAAG,YAA6B;AAC/D,QACE,oBAACA,QAAU;EACT,WAAW,GACT,eAAe;GAAE,SAAS;GAAS,MAAM;GAAQ,CAAC,EAClD,iCACA,UACD;EACD,GAAI;GACJ;;AAIN,WAAW,cAAc;AAQzB,MAAM,mBAAmB,EAAE,WAAW,GAAG,YAAkC;AACzE,QACE,oBAACA,QAAU;EACT,WAAW,GACT,QACA,gDACA,oBACA,sCACA,UACD;EACD,GAAI;GACJ;;AAIN,gBAAgB,cAAc"}
|
package/dist/toggle-group.d.ts
CHANGED
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
import { ControlSize, ControlVariant } from "./lib/control-variants.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as react_jsx_runtime205 from "react/jsx-runtime";
|
|
4
|
+
import { Toggle } from "@base-ui/react/toggle";
|
|
5
|
+
import { ToggleGroup } from "@base-ui/react/toggle-group";
|
|
6
|
+
|
|
7
|
+
//#region src/components/toggle-group.d.ts
|
|
8
|
+
type ToggleGroupRootProps = React.ComponentProps<typeof ToggleGroup>;
|
|
9
|
+
declare const ToggleGroupRoot: {
|
|
10
|
+
({
|
|
11
|
+
className,
|
|
12
|
+
orientation,
|
|
13
|
+
...props
|
|
14
|
+
}: ToggleGroupRootProps): react_jsx_runtime205.JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
type ToggleGroupItemProps = React.ComponentProps<typeof Toggle> & {
|
|
18
|
+
/** Visual style of the toggle item */
|
|
19
|
+
variant?: ControlVariant;
|
|
20
|
+
/** Size of the toggle item */
|
|
21
|
+
size?: ControlSize;
|
|
22
|
+
};
|
|
23
|
+
declare const ToggleGroupItem: {
|
|
24
|
+
({
|
|
25
|
+
className,
|
|
26
|
+
variant,
|
|
27
|
+
size,
|
|
28
|
+
...props
|
|
29
|
+
}: ToggleGroupItemProps): react_jsx_runtime205.JSX.Element;
|
|
30
|
+
displayName: string;
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { ToggleGroupItem, type ToggleGroupItemProps, ToggleGroupRoot, type ToggleGroupRootProps };
|
|
34
|
+
//# sourceMappingURL=toggle-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group.d.ts","names":[],"sources":["../src/components/toggle-group.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAiBK,oBAAA,GAAuB,KAAA,CAAM,sBAAsB;cAElD;;;;;KAAyD,uBAAoB,oBAAA,CAAA,GAAA,CAAA;EAF9E,WAAA,EAAA,MAAA;CAAoB;KA4BpB,oBAAA,GAAuB,KAAA,CAAM,cA5BsB,CAAA,OA4BA,MA5BA,CAAA,GAAA;;EAAR,OAAA,CAAA,EA8BpC,cA9BoC;EAE1C;EAkBL,IAAA,CAAA,EAYQ,WAZR;;cAeK;;IAjCyD,SAAA;IAAA,OAAA;IAAA,IAAA;IAAA,GAAA;EAAA,CAAA,EAsC5D,oBAtC4D,CAAA,EAsCxC,oBAAA,CAAA,GAAA,CAAA,OAtCwC;aAAoB,EAAA,MAAA;CAAA"}
|
package/dist/toggle-group.js
CHANGED
|
@@ -1,35 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// Vertical orientation adjustments
|
|
18
|
-
o === "vertical" && "[&>button:not(:first-of-type)]:ml-0 [&>button:not(:first-of-type)]:-mt-px [&>button:first-of-type]:rounded-bl-none [&>button:last-of-type]:rounded-r-none [&>button:first-of-type]:rounded-t-md [&>button:last-of-type]:rounded-b-md",
|
|
19
|
-
t
|
|
20
|
-
),
|
|
21
|
-
...e
|
|
22
|
-
}
|
|
23
|
-
);
|
|
24
|
-
f.displayName = "ToggleGroupRoot";
|
|
25
|
-
const s = ({
|
|
26
|
-
className: t,
|
|
27
|
-
variant: o,
|
|
28
|
-
size: e,
|
|
29
|
-
...l
|
|
30
|
-
}) => /* @__PURE__ */ r(u, { className: n(m({ variant: o, size: e }), t), ...l });
|
|
31
|
-
s.displayName = "ToggleGroupItem";
|
|
32
|
-
export {
|
|
33
|
-
s as ToggleGroupItem,
|
|
34
|
-
f as ToggleGroupRoot
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn } from "./lib/utils.js";
|
|
4
|
+
import { controlVariants } from "./lib/control-variants.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { Toggle } from "@base-ui/react/toggle";
|
|
8
|
+
import { ToggleGroup } from "@base-ui/react/toggle-group";
|
|
9
|
+
|
|
10
|
+
//#region src/components/toggle-group.tsx
|
|
11
|
+
const ToggleGroupRoot = ({ className, orientation, ...props }) => {
|
|
12
|
+
return /* @__PURE__ */ jsx(ToggleGroup, {
|
|
13
|
+
orientation,
|
|
14
|
+
className: cn("inline-flex", orientation === "vertical" && "flex-col", "[&>button]:rounded-none [&>button:not(:first-of-type)]:-ml-px", "[&>button:first-of-type]:rounded-l-md [&>button:last-of-type]:rounded-r-md", orientation === "vertical" && "[&>button:not(:first-of-type)]:ml-0 [&>button:not(:first-of-type)]:-mt-px [&>button:first-of-type]:rounded-bl-none [&>button:last-of-type]:rounded-r-none [&>button:first-of-type]:rounded-t-md [&>button:last-of-type]:rounded-b-md", className),
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
35
17
|
};
|
|
18
|
+
ToggleGroupRoot.displayName = "ToggleGroupRoot";
|
|
19
|
+
const ToggleGroupItem = ({ className, variant, size, ...props }) => {
|
|
20
|
+
return /* @__PURE__ */ jsx(Toggle, {
|
|
21
|
+
className: cn(controlVariants({
|
|
22
|
+
variant,
|
|
23
|
+
size
|
|
24
|
+
}), className),
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
ToggleGroupItem.displayName = "ToggleGroupItem";
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { ToggleGroupItem, ToggleGroupRoot };
|
|
32
|
+
//# sourceMappingURL=toggle-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group.js","names":["BaseToggleGroup"],"sources":["../src/components/toggle-group.tsx"],"sourcesContent":["'use client'\n\nimport { Toggle } from '@base-ui/react/toggle'\nimport { ToggleGroup as BaseToggleGroup } from '@base-ui/react/toggle-group'\nimport * as React from 'react'\n\nimport {\n type ControlSize,\n type ControlVariant,\n controlVariants,\n} from '../lib/control-variants'\nimport { cn } from '../lib/utils'\n\n// ============================================================================\n// ToggleGroupRoot\n// ============================================================================\n\ntype ToggleGroupRootProps = React.ComponentProps<typeof BaseToggleGroup>\n\nconst ToggleGroupRoot = ({ className, orientation, ...props }: ToggleGroupRootProps) => {\n return (\n <BaseToggleGroup\n orientation={orientation}\n className={cn(\n 'inline-flex',\n orientation === 'vertical' && 'flex-col',\n // Connected items: collapse borders, round only outer corners\n '[&>button]:rounded-none [&>button:not(:first-of-type)]:-ml-px',\n '[&>button:first-of-type]:rounded-l-md [&>button:last-of-type]:rounded-r-md',\n // Vertical orientation adjustments\n orientation === 'vertical' &&\n '[&>button:not(:first-of-type)]:ml-0 [&>button:not(:first-of-type)]:-mt-px [&>button:first-of-type]:rounded-bl-none [&>button:last-of-type]:rounded-r-none [&>button:first-of-type]:rounded-t-md [&>button:last-of-type]:rounded-b-md',\n className,\n )}\n {...props}\n />\n )\n}\n\nToggleGroupRoot.displayName = 'ToggleGroupRoot'\n\n// ============================================================================\n// ToggleGroupItem\n// ============================================================================\n\ntype ToggleGroupItemProps = React.ComponentProps<typeof Toggle> & {\n /** Visual style of the toggle item */\n variant?: ControlVariant\n /** Size of the toggle item */\n size?: ControlSize\n}\n\nconst ToggleGroupItem = ({\n className,\n variant,\n size,\n ...props\n}: ToggleGroupItemProps) => {\n return (\n <Toggle className={cn(controlVariants({ variant, size }), className)} {...props} />\n )\n}\n\nToggleGroupItem.displayName = 'ToggleGroupItem'\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nexport { ToggleGroupRoot, ToggleGroupItem }\n\nexport type { ToggleGroupRootProps, ToggleGroupItemProps }\n"],"mappings":";;;;;;;;;;AAmBA,MAAM,mBAAmB,EAAE,WAAW,aAAa,GAAG,YAAkC;AACtF,QACE,oBAACA;EACc;EACb,WAAW,GACT,eACA,gBAAgB,cAAc,YAE9B,iEACA,8EAEA,gBAAgB,cACd,wOACF,UACD;EACD,GAAI;GACJ;;AAIN,gBAAgB,cAAc;AAa9B,MAAM,mBAAmB,EACvB,WACA,SACA,MACA,GAAG,YACuB;AAC1B,QACE,oBAAC;EAAO,WAAW,GAAG,gBAAgB;GAAE;GAAS;GAAM,CAAC,EAAE,UAAU;EAAE,GAAI;GAAS;;AAIvF,gBAAgB,cAAc"}
|