@bearmenu/ui 0.5.2 → 0.6.1
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-ERMIA7NP.js → chunk-7PPCH42H.js} +3 -3
- package/dist/{chunk-HLQ2IRE7.js → chunk-BAZFVSSG.js} +3 -3
- package/dist/chunk-D5QHEHXJ.js +26 -0
- package/dist/{chunk-UISA4CIG.js → chunk-N2KNBPAQ.js} +2 -2
- package/dist/{chunk-7H54PTVH.js → chunk-PSR7N36A.js} +38 -10
- package/dist/chunk-RIDXFY6M.js +38 -0
- package/dist/chunk-UUJVXN2O.js +82 -0
- package/dist/chunk-WKMLZDUT.js +122 -0
- package/dist/chunk-XK2ZDQVE.js +122 -0
- package/dist/{chunk-4KOMHDZD.js → chunk-Y5D5LP4A.js} +18 -3
- package/dist/chunk-YJ6OBKZJ.js +32 -0
- package/dist/{chunk-ESO2EM3L.js → chunk-ZBBUKXM5.js} +2 -2
- package/dist/chunk-ZFNOCP6W.js +106 -0
- package/dist/components/accordion.js +11 -5
- package/dist/components/alert-dialog.js +5 -3
- package/dist/components/alert.d.ts +4 -1
- package/dist/components/alert.js +25 -9
- package/dist/components/avatar.d.ts +17 -2
- package/dist/components/avatar.js +91 -12
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/breadcrumb.js +5 -2
- package/dist/components/button-group.d.ts +14 -0
- package/dist/components/button-group.js +39 -0
- package/dist/components/button.d.ts +3 -1
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.js +3 -3
- package/dist/components/card.d.ts +13 -5
- package/dist/components/card.js +2 -2
- package/dist/components/carousel.d.ts +20 -3
- package/dist/components/carousel.js +72 -12
- package/dist/components/checkbox.js +1 -1
- package/dist/components/circular-progress.d.ts +16 -0
- package/dist/components/circular-progress.js +105 -0
- package/dist/components/combobox.d.ts +27 -0
- package/dist/components/combobox.js +102 -0
- package/dist/components/command.d.ts +16 -3
- package/dist/components/command.js +2 -2
- package/dist/components/currency-input.d.ts +1 -0
- package/dist/components/currency-input.js +73 -52
- package/dist/components/date-input.d.ts +10 -0
- package/dist/components/date-input.js +40 -0
- package/dist/components/description-list.d.ts +15 -0
- package/dist/components/description-list.js +67 -0
- package/dist/components/dialog.d.ts +13 -2
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.d.ts +5 -2
- package/dist/components/drawer.js +47 -9
- package/dist/components/dropdown-menu.d.ts +7 -2
- package/dist/components/dropdown-menu.js +22 -6
- package/dist/components/empty-state.js +2 -2
- package/dist/components/field.d.ts +22 -0
- package/dist/components/field.js +130 -0
- package/dist/components/form.d.ts +2 -1
- package/dist/components/form.js +11 -1
- package/dist/components/haptic-button.js +3 -3
- package/dist/components/input-group.d.ts +18 -0
- package/dist/components/input-group.js +92 -0
- package/dist/components/input.d.ts +8 -2
- package/dist/components/input.js +1 -1
- package/dist/components/item.d.ts +23 -0
- package/dist/components/item.js +120 -0
- package/dist/components/kbd.d.ts +13 -0
- package/dist/components/kbd.js +49 -0
- package/dist/components/lazy-markdown.d.ts +3 -1
- package/dist/components/lazy-markdown.js +7 -7
- package/dist/components/link-button.js +1 -1
- package/dist/components/multi-select-combobox.js +92 -83
- package/dist/components/multi-select-menu.d.ts +0 -4
- package/dist/components/multi-select-menu.js +28 -17
- package/dist/components/native-select.d.ts +12 -0
- package/dist/components/native-select.js +49 -0
- package/dist/components/pagination.d.ts +5 -2
- package/dist/components/pagination.js +66 -7
- package/dist/components/place-about-tab.js +4 -4
- package/dist/components/place-card.js +1 -1
- package/dist/components/place-details-mobile.js +4 -4
- package/dist/components/popover.d.ts +7 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/progress.d.ts +5 -1
- package/dist/components/progress.js +17 -3
- package/dist/components/radio-group.js +12 -3
- package/dist/components/rating.d.ts +2 -0
- package/dist/components/rating.js +88 -70
- package/dist/components/scroll-fade.d.ts +15 -0
- package/dist/components/scroll-fade.js +116 -0
- package/dist/components/search-bar.d.ts +1 -2
- package/dist/components/search-bar.js +37 -60
- package/dist/components/searchable-select.js +76 -72
- package/dist/components/select.d.ts +5 -1
- package/dist/components/select.js +30 -14
- package/dist/components/selection-bar.d.ts +11 -0
- package/dist/components/selection-bar.js +65 -0
- package/dist/components/separator.js +3 -2
- package/dist/components/sheet.d.ts +1 -1
- package/dist/components/sheet.js +1 -1
- package/dist/components/skeleton-card.js +1 -1
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.js +21 -4
- package/dist/components/sliding-panels.js +9 -6
- package/dist/components/spinner.d.ts +17 -0
- package/dist/components/spinner.js +50 -0
- package/dist/components/stepper.d.ts +18 -0
- package/dist/components/stepper.js +199 -0
- package/dist/components/switch.js +4 -3
- package/dist/components/table.d.ts +23 -5
- package/dist/components/table.js +121 -35
- package/dist/components/tabs.d.ts +3 -1
- package/dist/components/tabs.js +37 -9
- package/dist/components/tag-group.d.ts +9 -0
- package/dist/components/tag-group.js +26 -0
- package/dist/components/tag.d.ts +17 -0
- package/dist/components/tag.js +61 -0
- package/dist/components/text.d.ts +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/textarea.js +2 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toaster.js +1 -1
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle.js +1 -1
- package/dist/components/tooltip.d.ts +3 -2
- package/dist/components/tooltip.js +16 -2
- package/package.json +45 -26
- package/src/components/accordion.tsx +11 -6
- package/src/components/alert-dialog.tsx +4 -2
- package/src/components/alert.tsx +20 -8
- package/src/components/avatar.tsx +106 -13
- package/src/components/badge.tsx +12 -11
- package/src/components/breadcrumb.tsx +5 -2
- package/src/components/button-group.stories.tsx +52 -0
- package/src/components/button-group.tsx +40 -0
- package/src/components/button.test.tsx +174 -0
- package/src/components/button.tsx +42 -19
- package/src/components/calendar.tsx +2 -2
- package/src/components/card.tsx +55 -13
- package/src/components/carousel.tsx +85 -13
- package/src/components/checkbox.test.tsx +58 -0
- package/src/components/checkbox.tsx +8 -3
- package/src/components/circular-progress.stories.tsx +39 -0
- package/src/components/circular-progress.tsx +102 -0
- package/src/components/collapsible.stories.tsx +7 -3
- package/src/components/combobox.stories.tsx +82 -0
- package/src/components/combobox.test.tsx +118 -0
- package/src/components/combobox.tsx +136 -0
- package/src/components/command.test.tsx +91 -0
- package/src/components/command.tsx +38 -15
- package/src/components/currency-input.test.tsx +63 -0
- package/src/components/currency-input.tsx +84 -66
- package/src/components/date-input.stories.tsx +31 -0
- package/src/components/date-input.tsx +43 -0
- package/src/components/description-list.stories.tsx +62 -0
- package/src/components/description-list.tsx +68 -0
- package/src/components/dialog.test.tsx +84 -0
- package/src/components/dialog.tsx +64 -24
- package/src/components/drawer.tsx +72 -23
- package/src/components/dropdown-menu.test.tsx +180 -0
- package/src/components/dropdown-menu.tsx +31 -6
- package/src/components/field.stories.tsx +36 -0
- package/src/components/field.test.tsx +157 -0
- package/src/components/field.tsx +146 -0
- package/src/components/form.stories.tsx +3 -2
- package/src/components/form.test.tsx +95 -0
- package/src/components/form.tsx +9 -0
- package/src/components/haptic-button.tsx +1 -1
- package/src/components/input-group.stories.tsx +61 -0
- package/src/components/input-group.tsx +99 -0
- package/src/components/input.test.tsx +103 -0
- package/src/components/input.tsx +24 -7
- package/src/components/item.stories.tsx +52 -0
- package/src/components/item.tsx +115 -0
- package/src/components/kbd.stories.tsx +33 -0
- package/src/components/kbd.tsx +46 -0
- package/src/components/lazy-markdown.tsx +10 -7
- package/src/components/multi-select-combobox.test.tsx +101 -0
- package/src/components/multi-select-combobox.tsx +85 -82
- package/src/components/multi-select-menu.tsx +49 -41
- package/src/components/native-select.stories.tsx +52 -0
- package/src/components/native-select.tsx +45 -0
- package/src/components/pagination.tsx +64 -5
- package/src/components/popover.tsx +66 -3
- package/src/components/progress.tsx +27 -4
- package/src/components/radio-group.test.tsx +64 -0
- package/src/components/radio-group.tsx +11 -3
- package/src/components/rating.test.tsx +112 -0
- package/src/components/rating.tsx +97 -82
- package/src/components/scroll-fade.stories.tsx +98 -0
- package/src/components/scroll-fade.tsx +127 -0
- package/src/components/search-bar.stories.tsx +1 -32
- package/src/components/search-bar.tsx +22 -59
- package/src/components/searchable-select.tsx +69 -73
- package/src/components/select.tsx +34 -19
- package/src/components/selection-bar.stories.tsx +37 -0
- package/src/components/selection-bar.tsx +65 -0
- package/src/components/separator.tsx +5 -2
- package/src/components/sheet.tsx +1 -1
- package/src/components/skeleton.tsx +2 -2
- package/src/components/slider.test.tsx +45 -0
- package/src/components/slider.tsx +31 -12
- package/src/components/sliding-panels.tsx +8 -5
- package/src/components/spinner.stories.tsx +35 -0
- package/src/components/spinner.tsx +50 -0
- package/src/components/stepper.stories.tsx +71 -0
- package/src/components/stepper.tsx +220 -0
- package/src/components/switch.test.tsx +52 -0
- package/src/components/switch.tsx +4 -3
- package/src/components/table.tsx +140 -35
- package/src/components/tabs.test.tsx +107 -0
- package/src/components/tabs.tsx +70 -23
- package/src/components/tag-group.stories.tsx +39 -0
- package/src/components/tag-group.tsx +28 -0
- package/src/components/tag.stories.tsx +50 -0
- package/src/components/tag.tsx +63 -0
- package/src/components/text.test.tsx +1 -1
- package/src/components/text.tsx +19 -3
- package/src/components/textarea.test.tsx +48 -0
- package/src/components/textarea.tsx +2 -1
- package/src/components/toast.tsx +4 -3
- package/src/components/toggle.tsx +2 -2
- package/src/components/tooltip.tsx +12 -2
- package/src/globals.css +126 -90
- package/dist/chunk-2BMJRXQX.js +0 -80
- package/dist/chunk-4AVS6CV4.js +0 -89
- package/dist/chunk-4UO73SKC.js +0 -26
- package/dist/chunk-CW24PLDW.js +0 -24
- package/dist/chunk-IQASCH2V.js +0 -25
- package/dist/chunk-NKHH23YK.js +0 -31
- package/dist/chunk-QJ54Z7TC.js +0 -83
|
@@ -2,9 +2,11 @@ import * as React from 'react';
|
|
|
2
2
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
3
3
|
|
|
4
4
|
type TabsVariant = "pill" | "underline";
|
|
5
|
-
declare const Tabs: React.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const Tabs: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
declare const TabsList: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
7
7
|
variant?: TabsVariant;
|
|
8
|
+
/** Make horizontal lists scrollable when overflowing. Default true for underline, false for pill. */
|
|
9
|
+
scrollable?: boolean;
|
|
8
10
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
9
11
|
declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
10
12
|
declare const TabsContent: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
package/dist/components/tabs.js
CHANGED
|
@@ -1,19 +1,42 @@
|
|
|
1
1
|
import { cn } from '../chunk-FEK5XGZW.js';
|
|
2
|
-
import { __objRest,
|
|
2
|
+
import { __objRest, __spreadValues, __spreadProps } from '../chunk-3GWWZKX7.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
|
|
7
|
+
var TabsContext = React.createContext({
|
|
8
|
+
variant: "pill",
|
|
9
|
+
orientation: "horizontal"
|
|
10
|
+
});
|
|
11
|
+
var Tabs = React.forwardRef((_a, ref) => {
|
|
12
|
+
var _b = _a, { className, orientation = "horizontal" } = _b, props = __objRest(_b, ["className", "orientation"]);
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
TabsPrimitive.Root,
|
|
15
|
+
__spreadValues({
|
|
16
|
+
ref,
|
|
17
|
+
"data-slot": "tabs",
|
|
18
|
+
orientation,
|
|
19
|
+
className: cn(
|
|
20
|
+
"flex",
|
|
21
|
+
orientation === "vertical" ? "flex-row gap-4" : "flex-col gap-2",
|
|
22
|
+
className
|
|
23
|
+
)
|
|
24
|
+
}, props)
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
Tabs.displayName = TabsPrimitive.Root.displayName;
|
|
9
28
|
var TabsList = React.forwardRef((_a, ref) => {
|
|
10
|
-
var _b = _a, { className, variant = "pill", children } = _b, props = __objRest(_b, ["className", "variant", "children"]);
|
|
11
|
-
|
|
29
|
+
var _b = _a, { className, variant = "pill", scrollable, children } = _b, props = __objRest(_b, ["className", "variant", "scrollable", "children"]);
|
|
30
|
+
const orientation = props["aria-orientation"] === "vertical" ? "vertical" : "horizontal";
|
|
31
|
+
const allowScroll = scrollable != null ? scrollable : orientation === "horizontal";
|
|
32
|
+
return /* @__PURE__ */ jsx(TabsContext.Provider, { value: { variant, orientation }, children: /* @__PURE__ */ jsx(
|
|
12
33
|
TabsPrimitive.List,
|
|
13
34
|
__spreadProps(__spreadValues({
|
|
14
35
|
ref,
|
|
36
|
+
"data-slot": "tabs-list",
|
|
15
37
|
className: cn(
|
|
16
|
-
variant === "pill" ? "inline-flex h-
|
|
38
|
+
variant === "pill" ? orientation === "vertical" ? "inline-flex flex-col items-stretch gap-1 rounded-2xl bg-muted p-1 text-muted-foreground" : "inline-flex h-11 max-w-full items-center justify-start gap-1 rounded-2xl bg-muted p-1 text-muted-foreground" : orientation === "vertical" ? "inline-flex flex-col items-stretch gap-0 border-r border-border bg-transparent text-muted-foreground" : "inline-flex h-auto max-w-full items-center gap-0 border-b border-border bg-transparent text-muted-foreground",
|
|
39
|
+
allowScroll && "overflow-x-auto overscroll-x-contain [scrollbar-width:none] [&::-webkit-scrollbar]:hidden [&>*]:shrink-0",
|
|
17
40
|
className
|
|
18
41
|
)
|
|
19
42
|
}, props), {
|
|
@@ -24,13 +47,17 @@ var TabsList = React.forwardRef((_a, ref) => {
|
|
|
24
47
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
25
48
|
var TabsTrigger = React.forwardRef((_a, ref) => {
|
|
26
49
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
27
|
-
const variant = React.useContext(
|
|
50
|
+
const { variant, orientation } = React.useContext(TabsContext);
|
|
28
51
|
return /* @__PURE__ */ jsx(
|
|
29
52
|
TabsPrimitive.Trigger,
|
|
30
53
|
__spreadValues({
|
|
31
54
|
ref,
|
|
55
|
+
"data-slot": "tabs-trigger",
|
|
32
56
|
className: cn(
|
|
33
|
-
|
|
57
|
+
"inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
58
|
+
variant === "pill" && "rounded-xl px-4 py-1.5 text-muted-foreground hover:text-foreground data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
|
|
59
|
+
variant === "underline" && orientation === "horizontal" && "relative h-11 rounded-none border-b-2 border-transparent px-4 text-muted-foreground hover:text-foreground data-[state=active]:border-primary data-[state=active]:text-foreground",
|
|
60
|
+
variant === "underline" && orientation === "vertical" && "relative rounded-none border-r-2 border-transparent px-4 py-2 -mr-px text-muted-foreground hover:text-foreground data-[state=active]:border-primary data-[state=active]:text-foreground justify-start",
|
|
34
61
|
className
|
|
35
62
|
)
|
|
36
63
|
}, props)
|
|
@@ -43,8 +70,9 @@ var TabsContent = React.forwardRef((_a, ref) => {
|
|
|
43
70
|
TabsPrimitive.Content,
|
|
44
71
|
__spreadValues({
|
|
45
72
|
ref,
|
|
73
|
+
"data-slot": "tabs-content",
|
|
46
74
|
className: cn(
|
|
47
|
-
"
|
|
75
|
+
"flex-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-md",
|
|
48
76
|
className
|
|
49
77
|
)
|
|
50
78
|
}, props)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
declare const TagGroup: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
label?: string;
|
|
5
|
+
/** Visually hide the label, keep accessible. */
|
|
6
|
+
srLabel?: boolean;
|
|
7
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
|
|
9
|
+
export { TagGroup };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cn } from '../chunk-FEK5XGZW.js';
|
|
2
|
+
import { __objRest, __spreadProps, __spreadValues } from '../chunk-3GWWZKX7.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var TagGroup = React.forwardRef((_a, ref) => {
|
|
7
|
+
var _b = _a, { className, label, srLabel = true, children } = _b, props = __objRest(_b, ["className", "label", "srLabel", "children"]);
|
|
8
|
+
return /* @__PURE__ */ jsxs(
|
|
9
|
+
"div",
|
|
10
|
+
__spreadProps(__spreadValues({
|
|
11
|
+
ref,
|
|
12
|
+
role: "group",
|
|
13
|
+
"aria-label": label,
|
|
14
|
+
"data-slot": "tag-group",
|
|
15
|
+
className: cn("flex flex-wrap items-center gap-1.5", className)
|
|
16
|
+
}, props), {
|
|
17
|
+
children: [
|
|
18
|
+
label && !srLabel && /* @__PURE__ */ jsx("span", { className: "mr-1 text-xs font-medium text-muted-foreground", children: label }),
|
|
19
|
+
children
|
|
20
|
+
]
|
|
21
|
+
})
|
|
22
|
+
);
|
|
23
|
+
});
|
|
24
|
+
TagGroup.displayName = "TagGroup";
|
|
25
|
+
|
|
26
|
+
export { TagGroup };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
declare const tagVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "destructive" | "outline" | "success" | "warning" | "primary" | null | undefined;
|
|
7
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
declare const Tag: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & VariantProps<(props?: ({
|
|
10
|
+
variant?: "default" | "destructive" | "outline" | "success" | "warning" | "primary" | null | undefined;
|
|
11
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
12
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & {
|
|
13
|
+
onRemove?: () => void;
|
|
14
|
+
removeLabel?: string;
|
|
15
|
+
} & React.RefAttributes<HTMLSpanElement>>;
|
|
16
|
+
|
|
17
|
+
export { Tag, tagVariants };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { cn } from '../chunk-FEK5XGZW.js';
|
|
2
|
+
import { __objRest, __spreadProps, __spreadValues } from '../chunk-3GWWZKX7.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { X } from 'lucide-react';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var tagVariants = cva(
|
|
9
|
+
"inline-flex items-center gap-1 rounded-full border text-xs font-medium transition-colors",
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
default: "border-border bg-muted text-foreground",
|
|
14
|
+
primary: "border-primary/30 bg-primary/10 text-primary",
|
|
15
|
+
success: "border-success/30 bg-success/10 text-success",
|
|
16
|
+
warning: "border-warning/30 bg-warning/10 text-warning",
|
|
17
|
+
destructive: "border-destructive/30 bg-destructive/10 text-destructive",
|
|
18
|
+
outline: "border-border bg-transparent text-foreground"
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
sm: "h-5 px-2 text-[10px]",
|
|
22
|
+
default: "h-6 px-2.5",
|
|
23
|
+
lg: "h-7 px-3 text-sm"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "default",
|
|
28
|
+
size: "default"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
var Tag = React.forwardRef(
|
|
33
|
+
(_a, ref) => {
|
|
34
|
+
var _b = _a, { className, variant, size, onRemove, removeLabel = "Remove", children } = _b, props = __objRest(_b, ["className", "variant", "size", "onRemove", "removeLabel", "children"]);
|
|
35
|
+
return /* @__PURE__ */ jsxs(
|
|
36
|
+
"span",
|
|
37
|
+
__spreadProps(__spreadValues({
|
|
38
|
+
ref,
|
|
39
|
+
"data-slot": "tag",
|
|
40
|
+
className: cn(tagVariants({ variant, size }), className)
|
|
41
|
+
}, props), {
|
|
42
|
+
children: [
|
|
43
|
+
children,
|
|
44
|
+
onRemove && /* @__PURE__ */ jsx(
|
|
45
|
+
"button",
|
|
46
|
+
{
|
|
47
|
+
type: "button",
|
|
48
|
+
"aria-label": removeLabel,
|
|
49
|
+
onClick: onRemove,
|
|
50
|
+
className: "-mr-0.5 inline-flex size-3.5 items-center justify-center rounded-full transition-colors hover:bg-foreground/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
51
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-3" })
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
]
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
Tag.displayName = "Tag";
|
|
60
|
+
|
|
61
|
+
export { Tag, tagVariants };
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const textVariants: (props?: ({
|
|
7
|
-
variant?: "h2" | "h3" | "label" | "body" | "caption" | "h1" | "h4" | "display" | "body-lg" | "body-sm" | "overline" | null | undefined;
|
|
7
|
+
variant?: "h2" | "h3" | "label" | "body" | "caption" | "h1" | "h4" | "small" | "display" | "body-lg" | "body-sm" | "overline" | null | undefined;
|
|
8
8
|
color?: "inherit" | "default" | "destructive" | "muted" | "primary" | "primary-foreground" | null | undefined;
|
|
9
9
|
weight?: "bold" | "medium" | "normal" | "semibold" | null | undefined;
|
|
10
10
|
leading?: "none" | "normal" | "tight" | "snug" | "relaxed" | "loose" | null | undefined;
|
package/dist/components/text.js
CHANGED
|
@@ -9,8 +9,9 @@ var Textarea = React.forwardRef(
|
|
|
9
9
|
return /* @__PURE__ */ jsx(
|
|
10
10
|
"textarea",
|
|
11
11
|
__spreadValues({
|
|
12
|
+
"data-slot": "textarea",
|
|
12
13
|
className: cn(
|
|
13
|
-
"flex min-h-
|
|
14
|
+
"flex min-h-20 w-full rounded-xl border border-border bg-input/50 px-4 py-3 text-base transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:bg-input disabled:cursor-not-allowed disabled:opacity-50 resize-y aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive/40",
|
|
14
15
|
className
|
|
15
16
|
),
|
|
16
17
|
ref
|
package/dist/components/toast.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport } from '../chunk-
|
|
1
|
+
export { Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport } from '../chunk-7PPCH42H.js';
|
|
2
2
|
import '../chunk-FEK5XGZW.js';
|
|
3
3
|
import '../chunk-3GWWZKX7.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ToastProvider, Toast, ToastTitle, ToastDescription, ToastClose, ToastViewport } from '../chunk-
|
|
1
|
+
import { ToastProvider, Toast, ToastTitle, ToastDescription, ToastClose, ToastViewport } from '../chunk-7PPCH42H.js';
|
|
2
2
|
import { useToast } from '../chunk-EBAMCZDW.js';
|
|
3
3
|
import '../chunk-FEK5XGZW.js';
|
|
4
4
|
import { __objRest, __spreadProps, __spreadValues } from '../chunk-3GWWZKX7.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toggleVariants } from '../chunk-
|
|
1
|
+
import { toggleVariants } from '../chunk-ZBBUKXM5.js';
|
|
2
2
|
import { cn } from '../chunk-FEK5XGZW.js';
|
|
3
3
|
import { __objRest, __spreadProps, __spreadValues } from '../chunk-3GWWZKX7.js';
|
|
4
4
|
import * as React from 'react';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
4
|
|
|
4
|
-
declare const TooltipProvider: React.
|
|
5
|
-
declare const Tooltip: React.
|
|
5
|
+
declare const TooltipProvider: ({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>) => react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare const Tooltip: ({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) => react_jsx_runtime.JSX.Element;
|
|
6
7
|
declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
8
|
declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
9
|
|
|
@@ -4,8 +4,22 @@ import * as React from 'react';
|
|
|
4
4
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
|
-
var TooltipProvider =
|
|
8
|
-
var
|
|
7
|
+
var TooltipProvider = (_a) => {
|
|
8
|
+
var _b = _a, {
|
|
9
|
+
delayDuration = 200
|
|
10
|
+
} = _b, props = __objRest(_b, [
|
|
11
|
+
"delayDuration"
|
|
12
|
+
]);
|
|
13
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, __spreadValues({ delayDuration }, props));
|
|
14
|
+
};
|
|
15
|
+
var Tooltip = (_a) => {
|
|
16
|
+
var _b = _a, {
|
|
17
|
+
delayDuration = 200
|
|
18
|
+
} = _b, props = __objRest(_b, [
|
|
19
|
+
"delayDuration"
|
|
20
|
+
]);
|
|
21
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Root, __spreadValues({ delayDuration }, props));
|
|
22
|
+
};
|
|
9
23
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
10
24
|
var TooltipContent = React.forwardRef((_a, ref) => {
|
|
11
25
|
var _b = _a, { className, sideOffset = 4 } = _b, props = __objRest(_b, ["className", "sideOffset"]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bearmenu/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "BearMenu design system — shared UI tokens, primitives, and components",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -24,28 +24,38 @@
|
|
|
24
24
|
"./components/avatar": "./src/components/avatar.tsx",
|
|
25
25
|
"./components/badge": "./src/components/badge.tsx",
|
|
26
26
|
"./components/breadcrumb": "./src/components/breadcrumb.tsx",
|
|
27
|
+
"./components/button-group": "./src/components/button-group.tsx",
|
|
27
28
|
"./components/button": "./src/components/button.tsx",
|
|
28
29
|
"./components/calendar": "./src/components/calendar.tsx",
|
|
29
30
|
"./components/card": "./src/components/card.tsx",
|
|
30
31
|
"./components/carousel": "./src/components/carousel.tsx",
|
|
31
32
|
"./components/checkbox": "./src/components/checkbox.tsx",
|
|
33
|
+
"./components/circular-progress": "./src/components/circular-progress.tsx",
|
|
32
34
|
"./components/collapsible": "./src/components/collapsible.tsx",
|
|
35
|
+
"./components/combobox": "./src/components/combobox.tsx",
|
|
33
36
|
"./components/command": "./src/components/command.tsx",
|
|
34
37
|
"./components/currency-input": "./src/components/currency-input.tsx",
|
|
38
|
+
"./components/date-input": "./src/components/date-input.tsx",
|
|
39
|
+
"./components/description-list": "./src/components/description-list.tsx",
|
|
35
40
|
"./components/dialog": "./src/components/dialog.tsx",
|
|
36
41
|
"./components/drawer": "./src/components/drawer.tsx",
|
|
37
42
|
"./components/dropdown-menu": "./src/components/dropdown-menu.tsx",
|
|
38
43
|
"./components/empty-state": "./src/components/empty-state.tsx",
|
|
44
|
+
"./components/field": "./src/components/field.tsx",
|
|
39
45
|
"./components/form": "./src/components/form.tsx",
|
|
40
46
|
"./components/haptic-button": "./src/components/haptic-button.tsx",
|
|
47
|
+
"./components/input-group": "./src/components/input-group.tsx",
|
|
41
48
|
"./components/input-otp": "./src/components/input-otp.tsx",
|
|
42
49
|
"./components/input": "./src/components/input.tsx",
|
|
50
|
+
"./components/item": "./src/components/item.tsx",
|
|
51
|
+
"./components/kbd": "./src/components/kbd.tsx",
|
|
43
52
|
"./components/label": "./src/components/label.tsx",
|
|
44
53
|
"./components/lazy-markdown": "./src/components/lazy-markdown.tsx",
|
|
45
54
|
"./components/link-button": "./src/components/link-button.tsx",
|
|
46
55
|
"./components/markdown-renderer": "./src/components/markdown-renderer.tsx",
|
|
47
56
|
"./components/multi-select-combobox": "./src/components/multi-select-combobox.tsx",
|
|
48
57
|
"./components/multi-select-menu": "./src/components/multi-select-menu.tsx",
|
|
58
|
+
"./components/native-select": "./src/components/native-select.tsx",
|
|
49
59
|
"./components/pagination": "./src/components/pagination.tsx",
|
|
50
60
|
"./components/phone-frame": "./src/components/phone-frame.tsx",
|
|
51
61
|
"./components/place-about-tab": "./src/components/place-about-tab.tsx",
|
|
@@ -57,9 +67,11 @@
|
|
|
57
67
|
"./components/radio-group": "./src/components/radio-group.tsx",
|
|
58
68
|
"./components/rating": "./src/components/rating.tsx",
|
|
59
69
|
"./components/scroll-area": "./src/components/scroll-area.tsx",
|
|
70
|
+
"./components/scroll-fade": "./src/components/scroll-fade.tsx",
|
|
60
71
|
"./components/search-bar": "./src/components/search-bar.tsx",
|
|
61
72
|
"./components/searchable-select": "./src/components/searchable-select.tsx",
|
|
62
73
|
"./components/select": "./src/components/select.tsx",
|
|
74
|
+
"./components/selection-bar": "./src/components/selection-bar.tsx",
|
|
63
75
|
"./components/separator": "./src/components/separator.tsx",
|
|
64
76
|
"./components/sheet": "./src/components/sheet.tsx",
|
|
65
77
|
"./components/skeleton-card": "./src/components/skeleton-card.tsx",
|
|
@@ -67,10 +79,14 @@
|
|
|
67
79
|
"./components/slider": "./src/components/slider.tsx",
|
|
68
80
|
"./components/sliding-panels": "./src/components/sliding-panels.tsx",
|
|
69
81
|
"./components/sonner": "./src/components/sonner.tsx",
|
|
82
|
+
"./components/spinner": "./src/components/spinner.tsx",
|
|
83
|
+
"./components/stepper": "./src/components/stepper.tsx",
|
|
70
84
|
"./components/sticky-container": "./src/components/sticky-container.tsx",
|
|
71
85
|
"./components/switch": "./src/components/switch.tsx",
|
|
72
86
|
"./components/table": "./src/components/table.tsx",
|
|
73
87
|
"./components/tabs": "./src/components/tabs.tsx",
|
|
88
|
+
"./components/tag-group": "./src/components/tag-group.tsx",
|
|
89
|
+
"./components/tag": "./src/components/tag.tsx",
|
|
74
90
|
"./components/text": "./src/components/text.tsx",
|
|
75
91
|
"./components/textarea": "./src/components/textarea.tsx",
|
|
76
92
|
"./components/toast": "./src/components/toast.tsx",
|
|
@@ -109,6 +125,8 @@
|
|
|
109
125
|
"build": "tsup",
|
|
110
126
|
"dev": "tsup --watch",
|
|
111
127
|
"typecheck": "tsc --noEmit",
|
|
128
|
+
"test": "vitest run",
|
|
129
|
+
"test:watch": "vitest",
|
|
112
130
|
"clean": "rm -rf dist",
|
|
113
131
|
"prepublishOnly": "pnpm run build"
|
|
114
132
|
},
|
|
@@ -159,29 +177,29 @@
|
|
|
159
177
|
},
|
|
160
178
|
"devDependencies": {
|
|
161
179
|
"@hookform/resolvers": "^3.10.0",
|
|
162
|
-
"@radix-ui/react-accordion": "
|
|
163
|
-
"@radix-ui/react-alert-dialog": "
|
|
164
|
-
"@radix-ui/react-aspect-ratio": "
|
|
165
|
-
"@radix-ui/react-avatar": "
|
|
166
|
-
"@radix-ui/react-checkbox": "
|
|
167
|
-
"@radix-ui/react-collapsible": "
|
|
168
|
-
"@radix-ui/react-dialog": "
|
|
169
|
-
"@radix-ui/react-dropdown-menu": "
|
|
170
|
-
"@radix-ui/react-label": "
|
|
171
|
-
"@radix-ui/react-popover": "
|
|
172
|
-
"@radix-ui/react-progress": "
|
|
173
|
-
"@radix-ui/react-radio-group": "
|
|
174
|
-
"@radix-ui/react-scroll-area": "
|
|
175
|
-
"@radix-ui/react-select": "
|
|
176
|
-
"@radix-ui/react-separator": "
|
|
177
|
-
"@radix-ui/react-slider": "
|
|
178
|
-
"@radix-ui/react-slot": "
|
|
179
|
-
"@radix-ui/react-switch": "
|
|
180
|
-
"@radix-ui/react-tabs": "
|
|
181
|
-
"@radix-ui/react-toast": "
|
|
182
|
-
"@radix-ui/react-toggle": "
|
|
183
|
-
"@radix-ui/react-toggle-group": "
|
|
184
|
-
"@radix-ui/react-tooltip": "
|
|
180
|
+
"@radix-ui/react-accordion": "^1.2.12",
|
|
181
|
+
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
182
|
+
"@radix-ui/react-aspect-ratio": "^1.1.8",
|
|
183
|
+
"@radix-ui/react-avatar": "^1.1.11",
|
|
184
|
+
"@radix-ui/react-checkbox": "^1.3.3",
|
|
185
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
186
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
187
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
188
|
+
"@radix-ui/react-label": "^2.1.8",
|
|
189
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
190
|
+
"@radix-ui/react-progress": "^1.1.8",
|
|
191
|
+
"@radix-ui/react-radio-group": "^1.3.8",
|
|
192
|
+
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
193
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
194
|
+
"@radix-ui/react-separator": "^1.1.8",
|
|
195
|
+
"@radix-ui/react-slider": "^1.3.6",
|
|
196
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
197
|
+
"@radix-ui/react-switch": "^1.2.6",
|
|
198
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
199
|
+
"@radix-ui/react-toast": "^1.2.15",
|
|
200
|
+
"@radix-ui/react-toggle": "^1.1.10",
|
|
201
|
+
"@radix-ui/react-toggle-group": "^1.1.11",
|
|
202
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
185
203
|
"@storybook/addon-a11y": "^10.3.5",
|
|
186
204
|
"@storybook/addon-docs": "^10.3.5",
|
|
187
205
|
"@storybook/react-vite": "^10.3.5",
|
|
@@ -189,12 +207,13 @@
|
|
|
189
207
|
"@tailwindcss/vite": "^4.2.4",
|
|
190
208
|
"@testing-library/jest-dom": "^6.9.1",
|
|
191
209
|
"@testing-library/react": "^16.3.2",
|
|
210
|
+
"@testing-library/user-event": "^14.6.1",
|
|
192
211
|
"@types/react": "^19",
|
|
193
212
|
"@types/react-dom": "^19",
|
|
194
213
|
"@vitejs/plugin-react": "^6.0.1",
|
|
195
214
|
"class-variance-authority": "^0.7.1",
|
|
196
215
|
"clsx": "^2.1.1",
|
|
197
|
-
"cmdk": "
|
|
216
|
+
"cmdk": "^1.1.1",
|
|
198
217
|
"embla-carousel-react": "^8.6.0",
|
|
199
218
|
"framer-motion": "^12.23.22",
|
|
200
219
|
"input-otp": "^1.4.2",
|
|
@@ -203,7 +222,7 @@
|
|
|
203
222
|
"next": "^16.1.7",
|
|
204
223
|
"next-themes": "^0.4.6",
|
|
205
224
|
"react": "19.2.4",
|
|
206
|
-
"react-day-picker": "
|
|
225
|
+
"react-day-picker": "^9.14.0",
|
|
207
226
|
"react-dom": "19.2.4",
|
|
208
227
|
"react-hook-form": "7.72.0",
|
|
209
228
|
"react-markdown": "^10.1.0",
|
|
@@ -13,7 +13,8 @@ const AccordionItem = React.forwardRef<
|
|
|
13
13
|
>(({ className, ...props }, ref) => (
|
|
14
14
|
<AccordionPrimitive.Item
|
|
15
15
|
ref={ref}
|
|
16
|
-
|
|
16
|
+
data-slot="accordion-item"
|
|
17
|
+
className={cn("border-b border-border last:border-b-0", className)}
|
|
17
18
|
{...props}
|
|
18
19
|
/>
|
|
19
20
|
));
|
|
@@ -26,14 +27,18 @@ const AccordionTrigger = React.forwardRef<
|
|
|
26
27
|
<AccordionPrimitive.Header className="flex">
|
|
27
28
|
<AccordionPrimitive.Trigger
|
|
28
29
|
ref={ref}
|
|
30
|
+
data-slot="accordion-trigger"
|
|
29
31
|
className={cn(
|
|
30
|
-
"flex flex-1 items-center justify-between py-4 font-medium
|
|
32
|
+
"flex flex-1 cursor-pointer items-center justify-between py-4 text-sm font-medium text-foreground transition-colors hover:text-foreground/80",
|
|
33
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm",
|
|
34
|
+
"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
35
|
+
"[&[data-state=open]>svg]:rotate-180",
|
|
31
36
|
className
|
|
32
37
|
)}
|
|
33
38
|
{...props}
|
|
34
39
|
>
|
|
35
40
|
{children}
|
|
36
|
-
<ChevronDown className="
|
|
41
|
+
<ChevronDown className="size-4 shrink-0 text-muted-foreground transition-transform duration-200" />
|
|
37
42
|
</AccordionPrimitive.Trigger>
|
|
38
43
|
</AccordionPrimitive.Header>
|
|
39
44
|
));
|
|
@@ -45,13 +50,13 @@ const AccordionContent = React.forwardRef<
|
|
|
45
50
|
>(({ className, children, ...props }, ref) => (
|
|
46
51
|
<AccordionPrimitive.Content
|
|
47
52
|
ref={ref}
|
|
48
|
-
|
|
53
|
+
data-slot="accordion-content"
|
|
54
|
+
className="overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
49
55
|
{...props}
|
|
50
56
|
>
|
|
51
|
-
<div className={cn("pb-4 pt-0
|
|
57
|
+
<div className={cn("pb-4 pt-0", className)}>{children}</div>
|
|
52
58
|
</AccordionPrimitive.Content>
|
|
53
59
|
));
|
|
54
|
-
|
|
55
60
|
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
56
61
|
|
|
57
62
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -16,8 +16,9 @@ const AlertDialogOverlay = React.forwardRef<
|
|
|
16
16
|
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
|
|
17
17
|
>(({ className, ...props }, ref) => (
|
|
18
18
|
<AlertDialogPrimitive.Overlay
|
|
19
|
+
data-slot="alert-dialog-overlay"
|
|
19
20
|
className={cn(
|
|
20
|
-
"fixed inset-0 z-
|
|
21
|
+
"fixed inset-0 z-[1000] bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
21
22
|
className
|
|
22
23
|
)}
|
|
23
24
|
{...props}
|
|
@@ -34,8 +35,9 @@ const AlertDialogContent = React.forwardRef<
|
|
|
34
35
|
<AlertDialogOverlay />
|
|
35
36
|
<AlertDialogPrimitive.Content
|
|
36
37
|
ref={ref}
|
|
38
|
+
data-slot="alert-dialog-content"
|
|
37
39
|
className={cn(
|
|
38
|
-
"fixed left-[50%] top-[50%] z-
|
|
40
|
+
"fixed left-[50%] top-[50%] z-[1000] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-2xl border border-border bg-card p-6 shadow-2xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
39
41
|
className
|
|
40
42
|
)}
|
|
41
43
|
{...props}
|
package/src/components/alert.tsx
CHANGED
|
@@ -4,17 +4,17 @@ import { cn } from "../lib/utils";
|
|
|
4
4
|
import { textVariants } from "./text";
|
|
5
5
|
|
|
6
6
|
const alertVariants = cva(
|
|
7
|
-
"relative w-full rounded-xl border
|
|
7
|
+
"relative w-full rounded-xl border px-4 py-3 text-sm transition-colors [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg~*]:pl-7",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
|
-
default: "bg-
|
|
11
|
+
default: "bg-card text-card-foreground border-border [&>svg]:text-foreground",
|
|
12
12
|
destructive:
|
|
13
|
-
"border-destructive/
|
|
13
|
+
"border-destructive/40 bg-destructive/10 text-destructive [&>svg]:text-destructive",
|
|
14
14
|
warning:
|
|
15
|
-
"border-
|
|
15
|
+
"border-warning/40 bg-warning/10 text-warning [&>svg]:text-warning",
|
|
16
16
|
success:
|
|
17
|
-
"border-
|
|
17
|
+
"border-success/40 bg-success/10 text-success [&>svg]:text-success",
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
defaultVariants: {
|
|
@@ -27,7 +27,13 @@ const Alert = React.forwardRef<
|
|
|
27
27
|
HTMLDivElement,
|
|
28
28
|
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
|
|
29
29
|
>(({ className, variant, ...props }, ref) => (
|
|
30
|
-
<div
|
|
30
|
+
<div
|
|
31
|
+
ref={ref}
|
|
32
|
+
role="alert"
|
|
33
|
+
data-slot="alert"
|
|
34
|
+
className={cn(alertVariants({ variant }), className)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
31
37
|
));
|
|
32
38
|
Alert.displayName = "Alert";
|
|
33
39
|
|
|
@@ -35,6 +41,7 @@ const AlertTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<H
|
|
|
35
41
|
({ className, ...props }, ref) => (
|
|
36
42
|
<h5
|
|
37
43
|
ref={ref}
|
|
44
|
+
data-slot="alert-title"
|
|
38
45
|
className={cn(
|
|
39
46
|
"mb-1",
|
|
40
47
|
textVariants({ weight: "medium", leading: "none", tracking: "tight" }),
|
|
@@ -50,8 +57,13 @@ const AlertDescription = React.forwardRef<
|
|
|
50
57
|
HTMLParagraphElement,
|
|
51
58
|
React.HTMLAttributes<HTMLParagraphElement>
|
|
52
59
|
>(({ className, ...props }, ref) => (
|
|
53
|
-
<div
|
|
60
|
+
<div
|
|
61
|
+
ref={ref}
|
|
62
|
+
data-slot="alert-description"
|
|
63
|
+
className={cn("text-sm [&_p]:leading-relaxed", className)}
|
|
64
|
+
{...props}
|
|
65
|
+
/>
|
|
54
66
|
));
|
|
55
67
|
AlertDescription.displayName = "AlertDescription";
|
|
56
68
|
|
|
57
|
-
export { Alert, AlertTitle, AlertDescription };
|
|
69
|
+
export { Alert, AlertTitle, AlertDescription, alertVariants };
|