@bearmenu/ui 0.1.1 → 0.5.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/{chunk-2CUFS5LF.js → chunk-2BMJRXQX.js} +1 -1
- package/dist/chunk-HLQ2IRE7.js +279 -0
- package/dist/chunk-IQASCH2V.js +25 -0
- package/dist/{chunk-UXAYXRFN.js → chunk-QJ54Z7TC.js} +15 -1
- package/dist/{chunk-X6GATUI2.js → chunk-UISA4CIG.js} +1 -0
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.d.ts +9 -7
- package/dist/components/calendar.js +153 -39
- package/dist/components/card.d.ts +2 -1
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.js +1 -1
- package/dist/components/checkbox.js +3 -25
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/empty-state.js +1 -1
- package/dist/components/haptic-button.js +1 -1
- package/dist/components/link-button.js +1 -1
- package/dist/components/multi-select-combobox.js +1 -1
- package/dist/components/multi-select-menu.d.ts +26 -0
- package/dist/components/multi-select-menu.js +71 -0
- package/dist/components/pagination.js +1 -1
- package/dist/components/phone-frame.d.ts +17 -0
- package/dist/components/phone-frame.js +41 -0
- package/dist/components/place-about-tab.d.ts +17 -0
- package/dist/components/place-about-tab.js +6 -0
- package/dist/components/place-card.d.ts +17 -0
- package/dist/components/place-card.js +145 -0
- package/dist/components/place-details-mobile.d.ts +18 -0
- package/dist/components/place-details-mobile.js +187 -0
- package/dist/components/place-types.d.ts +145 -0
- package/dist/components/place-types.js +1 -0
- package/dist/components/search-bar.js +1 -1
- package/dist/components/searchable-select.js +1 -1
- package/dist/components/skeleton-card.js +1 -1
- package/dist/components/skeleton.js +1 -1
- package/dist/components/sliding-panels.js +1 -1
- package/dist/components/sonner.js +11 -2
- package/dist/components/tabs.js +1 -1
- package/dist/components/toaster.js +1 -1
- package/package.json +28 -9
- package/src/components/accordion.stories.tsx +51 -0
- package/src/components/alert-dialog.stories.tsx +45 -0
- package/src/components/alert.stories.tsx +85 -0
- package/src/components/aspect-ratio.stories.tsx +47 -0
- package/src/components/avatar.stories.tsx +66 -0
- package/src/components/badge.stories.tsx +60 -0
- package/src/components/breadcrumb.stories.tsx +63 -0
- package/src/components/button.stories.tsx +115 -0
- package/src/components/button.tsx +1 -1
- package/src/components/calendar.stories.tsx +47 -0
- package/src/components/calendar.tsx +160 -40
- package/src/components/card.stories.tsx +72 -0
- package/src/components/card.tsx +13 -1
- package/src/components/carousel.stories.tsx +62 -0
- package/src/components/checkbox.stories.tsx +54 -0
- package/src/components/checkbox.tsx +1 -1
- package/src/components/collapsible.stories.tsx +34 -0
- package/src/components/command.stories.tsx +64 -0
- package/src/components/currency-input.stories.tsx +50 -0
- package/src/components/dialog.stories.tsx +75 -0
- package/src/components/drawer.stories.tsx +47 -0
- package/src/components/dropdown-menu.stories.tsx +64 -0
- package/src/components/dropdown-menu.tsx +1 -1
- package/src/components/empty-state.stories.tsx +67 -0
- package/src/components/form.stories.tsx +73 -0
- package/src/components/haptic-button.stories.tsx +41 -0
- package/src/components/input-otp.stories.tsx +42 -0
- package/src/components/input.stories.tsx +41 -0
- package/src/components/label.stories.tsx +35 -0
- package/src/components/markdown-renderer.stories.tsx +45 -0
- package/src/components/multi-select-combobox.stories.tsx +78 -0
- package/src/components/multi-select-menu.tsx +96 -0
- package/src/components/pagination.stories.tsx +48 -0
- package/src/components/phone-frame.stories.tsx +51 -0
- package/src/components/phone-frame.test.tsx +82 -0
- package/src/components/phone-frame.tsx +59 -0
- package/src/components/place-about-tab.stories.tsx +164 -0
- package/src/components/place-about-tab.test.tsx +325 -0
- package/src/components/place-about-tab.tsx +474 -0
- package/src/components/place-card.stories.tsx +120 -0
- package/src/components/place-card.test.tsx +187 -0
- package/src/components/place-card.tsx +187 -0
- package/src/components/place-details-mobile.tsx +251 -0
- package/src/components/place-types.ts +127 -0
- package/src/components/popover.stories.tsx +42 -0
- package/src/components/progress.stories.tsx +35 -0
- package/src/components/radio-group.stories.tsx +46 -0
- package/src/components/rating.stories.tsx +45 -0
- package/src/components/scroll-area.stories.tsx +48 -0
- package/src/components/search-bar.stories.tsx +92 -0
- package/src/components/searchable-select.stories.tsx +55 -0
- package/src/components/select.stories.tsx +92 -0
- package/src/components/separator.stories.tsx +33 -0
- package/src/components/sheet.stories.tsx +95 -0
- package/src/components/skeleton-card.stories.tsx +53 -0
- package/src/components/skeleton.stories.tsx +42 -0
- package/src/components/skeleton.tsx +1 -0
- package/src/components/slider.stories.tsx +27 -0
- package/src/components/sliding-panels.stories.tsx +68 -0
- package/src/components/sonner.tsx +17 -2
- package/src/components/sticky-container.stories.tsx +33 -0
- package/src/components/switch.stories.tsx +35 -0
- package/src/components/table.stories.tsx +60 -0
- package/src/components/tabs.stories.tsx +53 -0
- package/src/components/tabs.tsx +1 -1
- package/src/components/text.stories.tsx +82 -0
- package/src/components/textarea.stories.tsx +35 -0
- package/src/components/toast.stories.tsx +63 -0
- package/src/components/toggle-group.stories.tsx +60 -0
- package/src/components/toggle.stories.tsx +48 -0
- package/src/components/tooltip.stories.tsx +71 -0
- package/src/globals.css +14 -2
- package/src/test/setup.ts +9 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
Toast,
|
|
4
|
+
ToastAction,
|
|
5
|
+
ToastClose,
|
|
6
|
+
ToastDescription,
|
|
7
|
+
ToastProvider,
|
|
8
|
+
ToastTitle,
|
|
9
|
+
ToastViewport,
|
|
10
|
+
} from "./toast";
|
|
11
|
+
|
|
12
|
+
const meta = {
|
|
13
|
+
title: "Components/Toast",
|
|
14
|
+
component: Toast,
|
|
15
|
+
tags: ["autodocs"],
|
|
16
|
+
decorators: [
|
|
17
|
+
(Story) => (
|
|
18
|
+
<ToastProvider>
|
|
19
|
+
<Story />
|
|
20
|
+
<ToastViewport />
|
|
21
|
+
</ToastProvider>
|
|
22
|
+
),
|
|
23
|
+
],
|
|
24
|
+
} satisfies Meta<typeof Toast>;
|
|
25
|
+
|
|
26
|
+
export default meta;
|
|
27
|
+
type Story = StoryObj<typeof meta>;
|
|
28
|
+
|
|
29
|
+
export const Default: Story = {
|
|
30
|
+
render: () => (
|
|
31
|
+
<Toast open>
|
|
32
|
+
<div className="grid gap-1">
|
|
33
|
+
<ToastTitle>Notification</ToastTitle>
|
|
34
|
+
<ToastDescription>Your changes have been saved.</ToastDescription>
|
|
35
|
+
</div>
|
|
36
|
+
<ToastClose />
|
|
37
|
+
</Toast>
|
|
38
|
+
),
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const Destructive: Story = {
|
|
42
|
+
render: () => (
|
|
43
|
+
<Toast variant="destructive" open>
|
|
44
|
+
<div className="grid gap-1">
|
|
45
|
+
<ToastTitle>Error</ToastTitle>
|
|
46
|
+
<ToastDescription>Something went wrong.</ToastDescription>
|
|
47
|
+
</div>
|
|
48
|
+
<ToastClose />
|
|
49
|
+
</Toast>
|
|
50
|
+
),
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const WithAction: Story = {
|
|
54
|
+
render: () => (
|
|
55
|
+
<Toast open>
|
|
56
|
+
<div className="grid gap-1">
|
|
57
|
+
<ToastTitle>Event Created</ToastTitle>
|
|
58
|
+
<ToastDescription>Friday, March 14 at 2:00 PM</ToastDescription>
|
|
59
|
+
</div>
|
|
60
|
+
<ToastAction altText="Undo">Undo</ToastAction>
|
|
61
|
+
</Toast>
|
|
62
|
+
),
|
|
63
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { ToggleGroup, ToggleGroupItem } from "./toggle-group";
|
|
3
|
+
import { Bold, Italic, Underline, AlignLeft, AlignCenter, AlignRight } from "lucide-react";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Components/ToggleGroup",
|
|
7
|
+
component: ToggleGroup,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
} satisfies Meta<typeof ToggleGroup>;
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
|
|
14
|
+
export const Default: Story = {
|
|
15
|
+
render: () => (
|
|
16
|
+
<ToggleGroup type="multiple">
|
|
17
|
+
<ToggleGroupItem value="bold" aria-label="Toggle bold">
|
|
18
|
+
<Bold className="h-4 w-4" />
|
|
19
|
+
</ToggleGroupItem>
|
|
20
|
+
<ToggleGroupItem value="italic" aria-label="Toggle italic">
|
|
21
|
+
<Italic className="h-4 w-4" />
|
|
22
|
+
</ToggleGroupItem>
|
|
23
|
+
<ToggleGroupItem value="underline" aria-label="Toggle underline">
|
|
24
|
+
<Underline className="h-4 w-4" />
|
|
25
|
+
</ToggleGroupItem>
|
|
26
|
+
</ToggleGroup>
|
|
27
|
+
),
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Single: Story = {
|
|
31
|
+
render: () => (
|
|
32
|
+
<ToggleGroup type="single" defaultValue="center">
|
|
33
|
+
<ToggleGroupItem value="left" aria-label="Align left">
|
|
34
|
+
<AlignLeft className="h-4 w-4" />
|
|
35
|
+
</ToggleGroupItem>
|
|
36
|
+
<ToggleGroupItem value="center" aria-label="Align center">
|
|
37
|
+
<AlignCenter className="h-4 w-4" />
|
|
38
|
+
</ToggleGroupItem>
|
|
39
|
+
<ToggleGroupItem value="right" aria-label="Align right">
|
|
40
|
+
<AlignRight className="h-4 w-4" />
|
|
41
|
+
</ToggleGroupItem>
|
|
42
|
+
</ToggleGroup>
|
|
43
|
+
),
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const Outline: Story = {
|
|
47
|
+
render: () => (
|
|
48
|
+
<ToggleGroup type="multiple" variant="outline">
|
|
49
|
+
<ToggleGroupItem value="bold" aria-label="Toggle bold">
|
|
50
|
+
<Bold className="h-4 w-4" />
|
|
51
|
+
</ToggleGroupItem>
|
|
52
|
+
<ToggleGroupItem value="italic" aria-label="Toggle italic">
|
|
53
|
+
<Italic className="h-4 w-4" />
|
|
54
|
+
</ToggleGroupItem>
|
|
55
|
+
<ToggleGroupItem value="underline" aria-label="Toggle underline">
|
|
56
|
+
<Underline className="h-4 w-4" />
|
|
57
|
+
</ToggleGroupItem>
|
|
58
|
+
</ToggleGroup>
|
|
59
|
+
),
|
|
60
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Toggle } from "./toggle";
|
|
3
|
+
import { Bold, Italic, Underline } from "lucide-react";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Components/Toggle",
|
|
7
|
+
component: Toggle,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
variant: {
|
|
11
|
+
control: "select",
|
|
12
|
+
options: ["default", "outline"],
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
control: "select",
|
|
16
|
+
options: ["default", "sm", "lg"],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
} satisfies Meta<typeof Toggle>;
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryObj<typeof meta>;
|
|
23
|
+
|
|
24
|
+
export const Default: Story = {
|
|
25
|
+
args: { children: <Bold className="h-4 w-4" /> },
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const Outline: Story = {
|
|
29
|
+
args: { variant: "outline", children: <Italic className="h-4 w-4" /> },
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const WithText: Story = {
|
|
33
|
+
args: { children: <><Bold className="h-4 w-4" /> Bold</> },
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Disabled: Story = {
|
|
37
|
+
args: { disabled: true, children: <Bold className="h-4 w-4" /> },
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const TextFormatting: Story = {
|
|
41
|
+
render: () => (
|
|
42
|
+
<div className="flex items-center gap-1">
|
|
43
|
+
<Toggle variant="outline" size="sm"><Bold className="h-4 w-4" /></Toggle>
|
|
44
|
+
<Toggle variant="outline" size="sm"><Italic className="h-4 w-4" /></Toggle>
|
|
45
|
+
<Toggle variant="outline" size="sm"><Underline className="h-4 w-4" /></Toggle>
|
|
46
|
+
</div>
|
|
47
|
+
),
|
|
48
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip";
|
|
3
|
+
import { Button } from "./button";
|
|
4
|
+
import { Plus } from "lucide-react";
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Components/Tooltip",
|
|
8
|
+
component: Tooltip,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
decorators: [
|
|
11
|
+
(Story) => (
|
|
12
|
+
<TooltipProvider>
|
|
13
|
+
<Story />
|
|
14
|
+
</TooltipProvider>
|
|
15
|
+
),
|
|
16
|
+
],
|
|
17
|
+
} satisfies Meta<typeof Tooltip>;
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
20
|
+
type Story = StoryObj<typeof meta>;
|
|
21
|
+
|
|
22
|
+
export const Default: Story = {
|
|
23
|
+
render: () => (
|
|
24
|
+
<Tooltip>
|
|
25
|
+
<TooltipTrigger asChild>
|
|
26
|
+
<Button variant="outline">Hover me</Button>
|
|
27
|
+
</TooltipTrigger>
|
|
28
|
+
<TooltipContent>
|
|
29
|
+
<p>This is a tooltip</p>
|
|
30
|
+
</TooltipContent>
|
|
31
|
+
</Tooltip>
|
|
32
|
+
),
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const OnIcon: Story = {
|
|
36
|
+
render: () => (
|
|
37
|
+
<Tooltip>
|
|
38
|
+
<TooltipTrigger asChild>
|
|
39
|
+
<Button size="icon" variant="outline">
|
|
40
|
+
<Plus className="h-4 w-4" />
|
|
41
|
+
</Button>
|
|
42
|
+
</TooltipTrigger>
|
|
43
|
+
<TooltipContent>
|
|
44
|
+
<p>Add new item</p>
|
|
45
|
+
</TooltipContent>
|
|
46
|
+
</Tooltip>
|
|
47
|
+
),
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const Positions: Story = {
|
|
51
|
+
render: () => (
|
|
52
|
+
<div className="flex items-center gap-8">
|
|
53
|
+
<Tooltip>
|
|
54
|
+
<TooltipTrigger asChild><Button variant="outline" size="sm">Top</Button></TooltipTrigger>
|
|
55
|
+
<TooltipContent side="top"><p>Top tooltip</p></TooltipContent>
|
|
56
|
+
</Tooltip>
|
|
57
|
+
<Tooltip>
|
|
58
|
+
<TooltipTrigger asChild><Button variant="outline" size="sm">Bottom</Button></TooltipTrigger>
|
|
59
|
+
<TooltipContent side="bottom"><p>Bottom tooltip</p></TooltipContent>
|
|
60
|
+
</Tooltip>
|
|
61
|
+
<Tooltip>
|
|
62
|
+
<TooltipTrigger asChild><Button variant="outline" size="sm">Left</Button></TooltipTrigger>
|
|
63
|
+
<TooltipContent side="left"><p>Left tooltip</p></TooltipContent>
|
|
64
|
+
</Tooltip>
|
|
65
|
+
<Tooltip>
|
|
66
|
+
<TooltipTrigger asChild><Button variant="outline" size="sm">Right</Button></TooltipTrigger>
|
|
67
|
+
<TooltipContent side="right"><p>Right tooltip</p></TooltipContent>
|
|
68
|
+
</Tooltip>
|
|
69
|
+
</div>
|
|
70
|
+
),
|
|
71
|
+
};
|
package/src/globals.css
CHANGED
|
@@ -60,7 +60,7 @@ h6 {
|
|
|
60
60
|
--accent: oklch(0.94 0.04 50);
|
|
61
61
|
--accent-foreground: oklch(0.22 0.025 45);
|
|
62
62
|
--destructive: oklch(0.577 0.245 27.325);
|
|
63
|
-
--destructive-foreground: oklch(0.
|
|
63
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
64
64
|
--border: oklch(0.9 0.012 60);
|
|
65
65
|
--input: oklch(0.9 0.012 60);
|
|
66
66
|
--ring: oklch(0.25 0.05 35);
|
|
@@ -82,6 +82,10 @@ h6 {
|
|
|
82
82
|
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
83
83
|
--sidebar-border: oklch(0.922 0 0);
|
|
84
84
|
--sidebar-ring: oklch(0.708 0 0);
|
|
85
|
+
--success: oklch(0.48 0.17 150);
|
|
86
|
+
--success-foreground: oklch(0.985 0 0);
|
|
87
|
+
--warning: oklch(0.72 0.18 68);
|
|
88
|
+
--warning-foreground: oklch(0.18 0.04 45);
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
.dark {
|
|
@@ -100,7 +104,7 @@ h6 {
|
|
|
100
104
|
--accent: oklch(0.3 0.04 50);
|
|
101
105
|
--accent-foreground: oklch(0.97 0.008 60);
|
|
102
106
|
--destructive: oklch(0.396 0.141 25.723);
|
|
103
|
-
--destructive-foreground: oklch(0.
|
|
107
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
104
108
|
--border: oklch(0.3 0.015 45);
|
|
105
109
|
--input: oklch(0.3 0.015 45);
|
|
106
110
|
--ring: oklch(0.98 0 0);
|
|
@@ -121,6 +125,10 @@ h6 {
|
|
|
121
125
|
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
122
126
|
--sidebar-border: oklch(0.269 0 0);
|
|
123
127
|
--sidebar-ring: oklch(0.439 0 0);
|
|
128
|
+
--success: oklch(0.63 0.17 150);
|
|
129
|
+
--success-foreground: oklch(0.985 0 0);
|
|
130
|
+
--warning: oklch(0.76 0.15 68);
|
|
131
|
+
--warning-foreground: oklch(0.18 0.04 45);
|
|
124
132
|
}
|
|
125
133
|
|
|
126
134
|
@theme inline {
|
|
@@ -162,6 +170,10 @@ h6 {
|
|
|
162
170
|
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
163
171
|
--color-sidebar-border: var(--sidebar-border);
|
|
164
172
|
--color-sidebar-ring: var(--sidebar-ring);
|
|
173
|
+
--color-success: var(--success);
|
|
174
|
+
--color-success-foreground: var(--success-foreground);
|
|
175
|
+
--color-warning: var(--warning);
|
|
176
|
+
--color-warning-foreground: var(--warning-foreground);
|
|
165
177
|
--color-surface: var(--surface);
|
|
166
178
|
--color-surface-foreground: var(--surface-foreground);
|
|
167
179
|
--color-surface-2: var(--surface-2);
|