@inspirare/design-system 0.0.22 → 0.0.24
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/README.md +82 -61
- package/dist/book-logo-filled.svg +55 -0
- package/dist/components/ui/accessibility-improvements.js +26 -23
- package/dist/components/ui/accordion.js +34 -24
- package/dist/components/ui/alert-dialog.js +91 -57
- package/dist/components/ui/alert.js +38 -26
- package/dist/components/ui/aspect-ratio.js +11 -3
- package/dist/components/ui/avatar.js +30 -8
- package/dist/components/ui/badge.js +20 -14
- package/dist/components/ui/breadcrumb.js +69 -56
- package/dist/components/ui/button-group.js +17 -13
- package/dist/components/ui/button.js +19 -15
- package/dist/components/ui/calendar.js +63 -59
- package/dist/components/ui/card.js +11 -9
- package/dist/components/ui/carousel.js +70 -75
- package/dist/components/ui/chart.js +75 -72
- package/dist/components/ui/checkbox.js +4 -5
- package/dist/components/ui/collapsible.js +12 -14
- package/dist/components/ui/color-picker.js +60 -80
- package/dist/components/ui/combobox.js +153 -33
- package/dist/components/ui/command.js +50 -48
- package/dist/components/ui/context-menu.js +129 -68
- package/dist/components/ui/dialog.js +65 -60
- package/dist/components/ui/drawer.js +81 -40
- package/dist/components/ui/dropdown-menu.js +100 -87
- package/dist/components/ui/empty.js +7 -6
- package/dist/components/ui/field.js +44 -47
- package/dist/components/ui/form.js +22 -23
- package/dist/components/ui/hover-card.js +14 -11
- package/dist/components/ui/input-group.js +16 -13
- package/dist/components/ui/input-otp.js +37 -32
- package/dist/components/ui/input.js +9 -7
- package/dist/components/ui/item.js +42 -36
- package/dist/components/ui/kbd.js +2 -1
- package/dist/components/ui/label.js +6 -7
- package/dist/components/ui/menubar.js +124 -93
- package/dist/components/ui/navigation-menu.js +79 -54
- package/dist/components/ui/pagination.js +78 -58
- package/dist/components/ui/popover.js +35 -16
- package/dist/components/ui/progress.js +37 -13
- package/dist/components/ui/radio-group.js +14 -14
- package/dist/components/ui/resizable.js +24 -15
- package/dist/components/ui/scroll-area.js +29 -11
- package/dist/components/ui/select.js +98 -56
- package/dist/components/ui/separator.js +5 -7
- package/dist/components/ui/sheet.js +47 -42
- package/dist/components/ui/sidebar.js +279 -248
- package/dist/components/ui/skeleton.js +4 -40
- package/dist/components/ui/slider.js +27 -29
- package/dist/components/ui/sonner.js +27 -10
- package/dist/components/ui/spinner.js +2 -0
- package/dist/components/ui/switch.js +3 -4
- package/dist/components/ui/table.js +6 -6
- package/dist/components/ui/tabs.js +45 -22
- package/dist/components/ui/textarea.js +3 -2
- package/dist/components/ui/theme-toggle.js +38 -41
- package/dist/components/ui/toggle-group.js +30 -21
- package/dist/components/ui/toggle.js +8 -9
- package/dist/components/ui/tooltip.js +28 -23
- package/dist/index.css +1 -1
- package/dist/index.d.ts +446 -468
- package/dist/index.js +58 -58
- package/package.json +42 -41
- package/src/App.tsx +28 -34
- package/src/components/branding/assets/book-logo-filled.svg +55 -0
- package/src/components/branding/logo/logo.tsx +56 -0
- package/src/components/ui/accessibility-improvements.stories.tsx +18 -0
- package/src/components/ui/accessibility-improvements.test.tsx +13 -0
- package/src/components/ui/accessibility-improvements.tsx +16 -6
- package/src/components/ui/accordion.stories.tsx +19 -0
- package/src/components/ui/accordion.test.tsx +14 -0
- package/src/components/ui/accordion.tsx +28 -20
- package/src/components/ui/alert-dialog.stories.tsx +19 -0
- package/src/components/ui/alert-dialog.test.tsx +14 -0
- package/src/components/ui/alert-dialog.tsx +159 -123
- package/src/components/ui/alert.stories.tsx +19 -0
- package/src/components/ui/alert.test.tsx +14 -0
- package/src/components/ui/alert.tsx +60 -41
- package/src/components/ui/aspect-ratio.stories.tsx +19 -0
- package/src/components/ui/aspect-ratio.test.tsx +14 -0
- package/src/components/ui/aspect-ratio.tsx +19 -2
- package/src/components/ui/attachment.stories.tsx +19 -0
- package/src/components/ui/attachment.test.tsx +14 -0
- package/src/components/ui/attachment.tsx +209 -0
- package/src/components/ui/avatar.stories.tsx +19 -0
- package/src/components/ui/avatar.test.tsx +14 -0
- package/src/components/ui/avatar.tsx +73 -17
- package/src/components/ui/badge.stories.tsx +19 -0
- package/src/components/ui/badge.test.tsx +14 -0
- package/src/components/ui/badge.tsx +33 -25
- package/src/components/ui/breadcrumb.stories.tsx +19 -0
- package/src/components/ui/breadcrumb.test.tsx +14 -0
- package/src/components/ui/breadcrumb.tsx +98 -86
- package/src/components/ui/bubble.stories.tsx +19 -0
- package/src/components/ui/bubble.test.tsx +14 -0
- package/src/components/ui/bubble.tsx +130 -0
- package/src/components/ui/button-group.stories.tsx +19 -0
- package/src/components/ui/button-group.test.tsx +14 -0
- package/src/components/ui/button-group.tsx +26 -20
- package/src/components/ui/button.stories.tsx +19 -0
- package/src/components/ui/button.test.tsx +14 -0
- package/src/components/ui/button.tsx +30 -31
- package/src/components/ui/calendar.stories.tsx +19 -0
- package/src/components/ui/calendar.test.tsx +14 -0
- package/src/components/ui/calendar.tsx +28 -26
- package/src/components/ui/card.stories.tsx +19 -0
- package/src/components/ui/card.test.tsx +14 -0
- package/src/components/ui/card.tsx +30 -17
- package/src/components/ui/carousel.stories.tsx +19 -0
- package/src/components/ui/carousel.test.tsx +14 -0
- package/src/components/ui/carousel.tsx +115 -135
- package/src/components/ui/chart.stories.tsx +18 -0
- package/src/components/ui/chart.test.tsx +13 -0
- package/src/components/ui/chart.tsx +220 -216
- package/src/components/ui/checkbox.stories.tsx +19 -0
- package/src/components/ui/checkbox.test.tsx +14 -0
- package/src/components/ui/checkbox.tsx +7 -10
- package/src/components/ui/collapsible.stories.tsx +19 -0
- package/src/components/ui/collapsible.test.tsx +14 -0
- package/src/components/ui/collapsible.tsx +11 -26
- package/src/components/ui/color-picker.stories.tsx +19 -0
- package/src/components/ui/color-picker.test.tsx +14 -0
- package/src/components/ui/color-picker.tsx +36 -26
- package/src/components/ui/combobox.stories.tsx +19 -0
- package/src/components/ui/combobox.test.tsx +14 -0
- package/src/components/ui/combobox.tsx +281 -96
- package/src/components/ui/command.stories.tsx +19 -0
- package/src/components/ui/command.test.tsx +14 -0
- package/src/components/ui/command.tsx +59 -47
- package/src/components/ui/context-menu.stories.tsx +19 -0
- package/src/components/ui/context-menu.test.tsx +14 -0
- package/src/components/ui/context-menu.tsx +231 -160
- package/src/components/ui/dialog.stories.tsx +19 -0
- package/src/components/ui/dialog.test.tsx +14 -0
- package/src/components/ui/dialog.tsx +81 -72
- package/src/components/ui/direction.stories.tsx +19 -0
- package/src/components/ui/direction.test.tsx +14 -0
- package/src/components/ui/direction.tsx +6 -0
- package/src/components/ui/drawer.stories.tsx +19 -0
- package/src/components/ui/drawer.test.tsx +14 -0
- package/src/components/ui/drawer.tsx +143 -64
- package/src/components/ui/dropdown-menu.stories.tsx +19 -0
- package/src/components/ui/dropdown-menu.test.tsx +14 -0
- package/src/components/ui/dropdown-menu.tsx +199 -153
- package/src/components/ui/empty.stories.tsx +18 -0
- package/src/components/ui/empty.test.tsx +13 -0
- package/src/components/ui/empty.tsx +11 -9
- package/src/components/ui/field.stories.tsx +18 -0
- package/src/components/ui/field.test.tsx +13 -0
- package/src/components/ui/field.tsx +26 -32
- package/src/components/ui/form.stories.tsx +22 -0
- package/src/components/ui/form.test.tsx +15 -0
- package/src/components/ui/form.tsx +1 -2
- package/src/components/ui/hover-card.stories.tsx +19 -0
- package/src/components/ui/hover-card.test.tsx +14 -0
- package/src/components/ui/hover-card.tsx +34 -32
- package/src/components/ui/input-group.stories.tsx +18 -0
- package/src/components/ui/input-group.test.tsx +13 -0
- package/src/components/ui/input-group.tsx +21 -28
- package/src/components/ui/input-otp.stories.tsx +19 -0
- package/src/components/ui/input-otp.test.tsx +14 -0
- package/src/components/ui/input-otp.tsx +58 -42
- package/src/components/ui/input.stories.tsx +19 -0
- package/src/components/ui/input.test.tsx +14 -0
- package/src/components/ui/input.tsx +9 -8
- package/src/components/ui/item.stories.tsx +18 -0
- package/src/components/ui/item.test.tsx +13 -0
- package/src/components/ui/item.tsx +38 -28
- package/src/components/ui/kbd.stories.tsx +18 -0
- package/src/components/ui/kbd.test.tsx +13 -0
- package/src/components/ui/kbd.tsx +3 -3
- package/src/components/ui/label.stories.tsx +18 -0
- package/src/components/ui/label.test.tsx +13 -0
- package/src/components/ui/label.tsx +7 -11
- package/src/components/ui/marker.stories.tsx +19 -0
- package/src/components/ui/marker.test.tsx +14 -0
- package/src/components/ui/marker.tsx +73 -0
- package/src/components/ui/menubar.stories.tsx +19 -0
- package/src/components/ui/menubar.test.tsx +14 -0
- package/src/components/ui/menubar.tsx +226 -202
- package/src/components/ui/message-scroller.stories.tsx +19 -0
- package/src/components/ui/message-scroller.test.tsx +14 -0
- package/src/components/ui/message-scroller.tsx +131 -0
- package/src/components/ui/message.stories.tsx +19 -0
- package/src/components/ui/message.test.tsx +14 -0
- package/src/components/ui/message.tsx +94 -0
- package/src/components/ui/native-select.stories.tsx +18 -0
- package/src/components/ui/native-select.test.tsx +13 -0
- package/src/components/ui/native-select.tsx +63 -0
- package/src/components/ui/navigation-menu.stories.tsx +19 -0
- package/src/components/ui/navigation-menu.test.tsx +14 -0
- package/src/components/ui/navigation-menu.tsx +145 -103
- package/src/components/ui/pagination.stories.tsx +19 -0
- package/src/components/ui/pagination.test.tsx +14 -0
- package/src/components/ui/pagination.tsx +114 -83
- package/src/components/ui/popover.stories.tsx +19 -0
- package/src/components/ui/popover.test.tsx +14 -0
- package/src/components/ui/popover.tsx +68 -33
- package/src/components/ui/progress.stories.tsx +19 -0
- package/src/components/ui/progress.test.tsx +14 -0
- package/src/components/ui/progress.tsx +67 -15
- package/src/components/ui/questionnaire.stories.tsx +19 -0
- package/src/components/ui/questionnaire.test.tsx +14 -0
- package/src/components/ui/questionnaire.tsx +324 -0
- package/src/components/ui/radio-group.stories.tsx +19 -0
- package/src/components/ui/radio-group.test.tsx +14 -0
- package/src/components/ui/radio-group.tsx +15 -20
- package/src/components/ui/resizable.stories.tsx +19 -0
- package/src/components/ui/resizable.test.tsx +14 -0
- package/src/components/ui/resizable.tsx +37 -30
- package/src/components/ui/scroll-area.stories.tsx +19 -0
- package/src/components/ui/scroll-area.test.tsx +14 -0
- package/src/components/ui/scroll-area.tsx +41 -19
- package/src/components/ui/select.stories.tsx +19 -0
- package/src/components/ui/select.test.tsx +14 -0
- package/src/components/ui/select.tsx +145 -78
- package/src/components/ui/separator.stories.tsx +19 -0
- package/src/components/ui/separator.test.tsx +14 -0
- package/src/components/ui/separator.tsx +8 -11
- package/src/components/ui/sheet.stories.tsx +19 -0
- package/src/components/ui/sheet.test.tsx +14 -0
- package/src/components/ui/sheet.tsx +56 -71
- package/src/components/ui/sidebar.stories.tsx +18 -0
- package/src/components/ui/sidebar.test.tsx +13 -0
- package/src/components/ui/sidebar.tsx +469 -513
- package/src/components/ui/skeleton.stories.tsx +19 -0
- package/src/components/ui/skeleton.test.tsx +14 -0
- package/src/components/ui/skeleton.tsx +8 -114
- package/src/components/ui/slider.stories.tsx +19 -0
- package/src/components/ui/slider.test.tsx +14 -0
- package/src/components/ui/slider.tsx +31 -40
- package/src/components/ui/sonner.stories.tsx +19 -0
- package/src/components/ui/sonner.test.tsx +14 -0
- package/src/components/ui/sonner.tsx +39 -7
- package/src/components/ui/spinner.stories.tsx +18 -0
- package/src/components/ui/spinner.test.tsx +13 -0
- package/src/components/ui/spinner.tsx +3 -7
- package/src/components/ui/switch.stories.tsx +19 -0
- package/src/components/ui/switch.test.tsx +14 -0
- package/src/components/ui/switch.tsx +4 -7
- package/src/components/ui/table.stories.tsx +19 -0
- package/src/components/ui/table.test.tsx +14 -0
- package/src/components/ui/table.tsx +17 -17
- package/src/components/ui/tabs.stories.tsx +19 -0
- package/src/components/ui/tabs.test.tsx +14 -0
- package/src/components/ui/tabs.tsx +71 -31
- package/src/components/ui/textarea.stories.tsx +19 -0
- package/src/components/ui/textarea.test.tsx +14 -0
- package/src/components/ui/textarea.tsx +7 -5
- package/src/components/ui/theme-toggle.stories.tsx +18 -0
- package/src/components/ui/theme-toggle.test.tsx +13 -0
- package/src/components/ui/theme-toggle.tsx +35 -37
- package/src/components/ui/toggle-group.stories.tsx +19 -0
- package/src/components/ui/toggle-group.test.tsx +14 -0
- package/src/components/ui/toggle-group.tsx +41 -25
- package/src/components/ui/toggle.stories.tsx +19 -0
- package/src/components/ui/toggle.test.tsx +14 -0
- package/src/components/ui/toggle.tsx +17 -19
- package/src/components/ui/tooltip.stories.tsx +19 -0
- package/src/components/ui/tooltip.test.tsx +14 -0
- package/src/components/ui/tooltip.tsx +53 -44
- package/src/demo/AIDemo.tsx +50 -0
- package/src/demo/ButtonsDemo.tsx +41 -18
- package/src/demo/CalendarDemo.tsx +1 -1
- package/src/demo/FeedbackDemo.tsx +4 -6
- package/src/demo/FormsDemo.tsx +34 -11
- package/src/demo/NavigationDemo.tsx +38 -13
- package/src/demo/OverlaysDemo.tsx +22 -36
- package/src/demo/update-demos.js +82 -0
- package/src/index.css +66 -46
- package/src/lib/utils.ts +3 -3
- package/src/stories/Button.stories.ts +54 -0
- package/src/stories/Button.tsx +36 -0
- package/src/stories/Configure.mdx +388 -0
- package/src/stories/Header.stories.ts +34 -0
- package/src/stories/Header.tsx +55 -0
- package/src/stories/Page.stories.ts +33 -0
- package/src/stories/Page.tsx +73 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/stories/page.css +68 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { axe } from 'jest-axe';
|
|
3
|
+
import { Toggle } from "./toggle";
|
|
4
|
+
|
|
5
|
+
describe('Toggle Accessibility', () => {
|
|
6
|
+
it('should have no accessibility violations in basic render', async () => {
|
|
7
|
+
const Wrapper = () => (
|
|
8
|
+
<Toggle aria-label="Toggle italic">I</Toggle>
|
|
9
|
+
);
|
|
10
|
+
const { container } = render(<Wrapper />);
|
|
11
|
+
const results = await axe(container);
|
|
12
|
+
expect(results).toHaveNoViolations();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client"
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle"
|
|
4
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
6
5
|
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
8
7
|
|
|
9
8
|
const toggleVariants = cva(
|
|
10
|
-
"inline-flex items-center justify-center gap-
|
|
9
|
+
"group/toggle inline-flex items-center justify-center cursor-pointer gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none cursor-pointer hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
11
10
|
{
|
|
12
11
|
variants: {
|
|
13
12
|
variant: {
|
|
14
13
|
default: "bg-transparent",
|
|
15
|
-
outline:
|
|
16
|
-
"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
|
|
14
|
+
outline: "border border-input bg-transparent hover:bg-muted",
|
|
17
15
|
},
|
|
18
16
|
size: {
|
|
19
|
-
default:
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
default:
|
|
18
|
+
"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
19
|
+
sm: "h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
20
|
+
lg: "h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
22
21
|
},
|
|
23
22
|
},
|
|
24
23
|
defaultVariants: {
|
|
@@ -26,22 +25,21 @@ const toggleVariants = cva(
|
|
|
26
25
|
size: "default",
|
|
27
26
|
},
|
|
28
27
|
}
|
|
29
|
-
)
|
|
28
|
+
)
|
|
30
29
|
|
|
31
30
|
function Toggle({
|
|
32
31
|
className,
|
|
33
|
-
variant,
|
|
34
|
-
size,
|
|
32
|
+
variant = "default",
|
|
33
|
+
size = "default",
|
|
35
34
|
...props
|
|
36
|
-
}:
|
|
37
|
-
VariantProps<typeof toggleVariants>) {
|
|
35
|
+
}: TogglePrimitive.Props & VariantProps<typeof toggleVariants>) {
|
|
38
36
|
return (
|
|
39
|
-
<TogglePrimitive
|
|
37
|
+
<TogglePrimitive
|
|
40
38
|
data-slot="toggle"
|
|
41
39
|
className={cn(toggleVariants({ variant, size, className }))}
|
|
42
40
|
{...props}
|
|
43
41
|
/>
|
|
44
|
-
)
|
|
42
|
+
)
|
|
45
43
|
}
|
|
46
44
|
|
|
47
|
-
export { Toggle, toggleVariants }
|
|
45
|
+
export { Toggle, toggleVariants }
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from "./tooltip";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Design System/Tooltip',
|
|
6
|
+
parameters: { layout: 'centered' },
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
} satisfies Meta;
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
|
|
13
|
+
export const Default: Story = {
|
|
14
|
+
render: () => (
|
|
15
|
+
<div className="p-4 w-full h-full flex items-center justify-center">
|
|
16
|
+
<TooltipProvider><Tooltip><TooltipTrigger className="px-4 py-2 border rounded">Hover</TooltipTrigger><TooltipContent><p>Add to library</p></TooltipContent></Tooltip></TooltipProvider>
|
|
17
|
+
</div>
|
|
18
|
+
)
|
|
19
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { axe } from 'jest-axe';
|
|
3
|
+
import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from "./tooltip";
|
|
4
|
+
|
|
5
|
+
describe('Tooltip Accessibility', () => {
|
|
6
|
+
it('should have no accessibility violations in basic render', async () => {
|
|
7
|
+
const Wrapper = () => (
|
|
8
|
+
<TooltipProvider><Tooltip><TooltipTrigger className="px-4 py-2 border rounded">Hover</TooltipTrigger><TooltipContent><p>Add to library</p></TooltipContent></Tooltip></TooltipProvider>
|
|
9
|
+
);
|
|
10
|
+
const { container } = render(<Wrapper />);
|
|
11
|
+
const results = await axe(container);
|
|
12
|
+
expect(results).toHaveNoViolations();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -1,68 +1,77 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client"
|
|
2
2
|
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
|
+
import * as React from "react"
|
|
5
4
|
|
|
6
|
-
import {
|
|
5
|
+
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip"
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
7
8
|
|
|
8
9
|
function TooltipProvider({
|
|
9
|
-
|
|
10
|
+
delay = 0,
|
|
10
11
|
...props
|
|
11
|
-
}:
|
|
12
|
+
}: TooltipPrimitive.Provider.Props) {
|
|
12
13
|
return (
|
|
13
14
|
<TooltipPrimitive.Provider
|
|
14
15
|
data-slot="tooltip-provider"
|
|
15
|
-
|
|
16
|
+
delay={delay}
|
|
16
17
|
{...props}
|
|
17
18
|
/>
|
|
18
|
-
)
|
|
19
|
+
)
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
function Tooltip({
|
|
22
|
-
...props
|
|
23
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Root>) {
|
|
24
|
-
return (
|
|
25
|
-
<TooltipProvider>
|
|
26
|
-
<TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
27
|
-
</TooltipProvider>
|
|
28
|
-
);
|
|
22
|
+
function Tooltip({ ...props }: TooltipPrimitive.Root.Props) {
|
|
23
|
+
return <TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
29
24
|
}
|
|
30
25
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
className={cn("cursor-pointer", className)}
|
|
39
|
-
{...props}
|
|
40
|
-
/>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
26
|
+
const TooltipTrigger = React.forwardRef<
|
|
27
|
+
React.ElementRef<"button">,
|
|
28
|
+
TooltipPrimitive.Trigger.Props
|
|
29
|
+
>(({ ...props }, ref) => {
|
|
30
|
+
return <TooltipPrimitive.Trigger ref={ref} data-slot="tooltip-trigger" {...props} />
|
|
31
|
+
})
|
|
32
|
+
TooltipTrigger.displayName = "TooltipTrigger"
|
|
43
33
|
|
|
44
|
-
|
|
34
|
+
const TooltipContent = React.forwardRef<
|
|
35
|
+
React.ElementRef<"div">,
|
|
36
|
+
TooltipPrimitive.Popup.Props &
|
|
37
|
+
Pick<
|
|
38
|
+
TooltipPrimitive.Positioner.Props,
|
|
39
|
+
"align" | "alignOffset" | "side" | "sideOffset"
|
|
40
|
+
>
|
|
41
|
+
>(({
|
|
45
42
|
className,
|
|
46
|
-
|
|
43
|
+
side = "top",
|
|
44
|
+
sideOffset = 4,
|
|
45
|
+
align = "center",
|
|
46
|
+
alignOffset = 0,
|
|
47
47
|
children,
|
|
48
48
|
...props
|
|
49
|
-
}
|
|
49
|
+
}, ref) => {
|
|
50
50
|
return (
|
|
51
51
|
<TooltipPrimitive.Portal>
|
|
52
|
-
<TooltipPrimitive.
|
|
53
|
-
|
|
52
|
+
<TooltipPrimitive.Positioner
|
|
53
|
+
align={align}
|
|
54
|
+
alignOffset={alignOffset}
|
|
55
|
+
side={side}
|
|
54
56
|
sideOffset={sideOffset}
|
|
55
|
-
className=
|
|
56
|
-
"bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
|
|
57
|
-
className
|
|
58
|
-
)}
|
|
59
|
-
{...props}
|
|
57
|
+
className="isolate z-50"
|
|
60
58
|
>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
<TooltipPrimitive.Popup
|
|
60
|
+
ref={ref}
|
|
61
|
+
data-slot="tooltip-content"
|
|
62
|
+
className={cn(
|
|
63
|
+
"z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
64
|
+
className
|
|
65
|
+
)}
|
|
66
|
+
{...props}
|
|
67
|
+
>
|
|
68
|
+
{children}
|
|
69
|
+
<TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" />
|
|
70
|
+
</TooltipPrimitive.Popup>
|
|
71
|
+
</TooltipPrimitive.Positioner>
|
|
64
72
|
</TooltipPrimitive.Portal>
|
|
65
|
-
)
|
|
66
|
-
}
|
|
73
|
+
)
|
|
74
|
+
})
|
|
75
|
+
TooltipContent.displayName = "TooltipContent"
|
|
67
76
|
|
|
68
|
-
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
|
77
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "../components/ui/card";
|
|
2
|
+
import { Message } from "../components/ui/message";
|
|
3
|
+
import { Bubble } from "../components/ui/bubble";
|
|
4
|
+
import { Button } from "../components/ui/button";
|
|
5
|
+
|
|
6
|
+
export function AIDemo() {
|
|
7
|
+
return (
|
|
8
|
+
<div className="flex flex-col gap-8">
|
|
9
|
+
<Card>
|
|
10
|
+
<CardHeader>
|
|
11
|
+
<CardTitle>Componentes de Chat (IA)</CardTitle>
|
|
12
|
+
<CardDescription>
|
|
13
|
+
Componentes construídos com React Aria para interfaces de conversação, chatbots e assistentes.
|
|
14
|
+
</CardDescription>
|
|
15
|
+
</CardHeader>
|
|
16
|
+
<CardContent>
|
|
17
|
+
<div className="flex flex-col gap-6 rounded-lg border bg-muted/20 p-6">
|
|
18
|
+
<Message role="user">
|
|
19
|
+
<Bubble>
|
|
20
|
+
<div className="text-sm">
|
|
21
|
+
Olá! Como você pode me ajudar a melhorar a escrita da minha história de fantasia?
|
|
22
|
+
</div>
|
|
23
|
+
</Bubble>
|
|
24
|
+
</Message>
|
|
25
|
+
|
|
26
|
+
<Message role="assistant">
|
|
27
|
+
<Bubble>
|
|
28
|
+
<div className="text-sm">
|
|
29
|
+
Olá, jovem autor! Sou a Escrivania. Eu posso ajudar revisando a jornada do seu herói, melhorando as descrições dos seus personagens ou sugerindo ideias de construção de mundo (worldbuilding) para o seu universo de fantasia. O que você gostaria de explorar primeiro?
|
|
30
|
+
</div>
|
|
31
|
+
</Bubble>
|
|
32
|
+
</Message>
|
|
33
|
+
|
|
34
|
+
<Message role="user">
|
|
35
|
+
<Bubble>
|
|
36
|
+
<div className="text-sm">
|
|
37
|
+
Preciso de ideias para o sistema de magia.
|
|
38
|
+
</div>
|
|
39
|
+
</Bubble>
|
|
40
|
+
</Message>
|
|
41
|
+
|
|
42
|
+
<div className="flex justify-end mt-4">
|
|
43
|
+
<Button variant="outline" size="sm">Regerar Resposta</Button>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</CardContent>
|
|
47
|
+
</Card>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
}
|
package/src/demo/ButtonsDemo.tsx
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Button } from "../components/ui/button";
|
|
2
2
|
import { Badge } from "../components/ui/badge";
|
|
3
|
-
import { Toggle } from "
|
|
4
|
-
import { ToggleGroup, ToggleGroupItem } from "
|
|
3
|
+
import { Toggle } from "@/components/ui/toggle";
|
|
4
|
+
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
|
5
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
|
|
5
6
|
import { Card, CardContent, CardHeader, CardTitle } from "../components/ui/card";
|
|
6
7
|
import { Bold, Italic, Underline } from "lucide-react";
|
|
7
8
|
|
|
8
9
|
export function ButtonsDemo() {
|
|
9
10
|
return (
|
|
10
|
-
<div className="
|
|
11
|
+
<div className="flex flex-col gap-8">
|
|
11
12
|
<Card>
|
|
12
13
|
<CardHeader>
|
|
13
14
|
<CardTitle>Variantes de Botões</CardTitle>
|
|
@@ -54,25 +55,47 @@ export function ButtonsDemo() {
|
|
|
54
55
|
<CardTitle>Toggles</CardTitle>
|
|
55
56
|
</CardHeader>
|
|
56
57
|
<CardContent className="flex flex-wrap gap-8 items-center">
|
|
57
|
-
<div className="
|
|
58
|
+
<div className="flex flex-col gap-2">
|
|
58
59
|
<p className="text-sm text-muted-foreground">Toggle Simples</p>
|
|
59
|
-
<
|
|
60
|
-
<
|
|
61
|
-
|
|
60
|
+
<Tooltip>
|
|
61
|
+
<TooltipTrigger render={
|
|
62
|
+
<Toggle aria-label="Ativar negrito">
|
|
63
|
+
<Bold className="h-4 w-4" />
|
|
64
|
+
</Toggle>
|
|
65
|
+
} />
|
|
66
|
+
<TooltipContent>Negrito</TooltipContent>
|
|
67
|
+
</Tooltip>
|
|
62
68
|
</div>
|
|
63
69
|
|
|
64
|
-
<div className="
|
|
70
|
+
<div className="flex flex-col gap-2">
|
|
65
71
|
<p className="text-sm text-muted-foreground">Toggle Group (Múltiplo)</p>
|
|
66
|
-
<ToggleGroup
|
|
67
|
-
<
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
<ToggleGroup>
|
|
73
|
+
<Tooltip>
|
|
74
|
+
<TooltipTrigger render={
|
|
75
|
+
<ToggleGroupItem value="bold" aria-label="Toggle bold">
|
|
76
|
+
<Bold className="h-4 w-4" />
|
|
77
|
+
</ToggleGroupItem>
|
|
78
|
+
} />
|
|
79
|
+
<TooltipContent>Negrito</TooltipContent>
|
|
80
|
+
</Tooltip>
|
|
81
|
+
|
|
82
|
+
<Tooltip>
|
|
83
|
+
<TooltipTrigger render={
|
|
84
|
+
<ToggleGroupItem value="italic" aria-label="Toggle italic">
|
|
85
|
+
<Italic className="h-4 w-4" />
|
|
86
|
+
</ToggleGroupItem>
|
|
87
|
+
} />
|
|
88
|
+
<TooltipContent>Itálico</TooltipContent>
|
|
89
|
+
</Tooltip>
|
|
90
|
+
|
|
91
|
+
<Tooltip>
|
|
92
|
+
<TooltipTrigger render={
|
|
93
|
+
<ToggleGroupItem value="underline" aria-label="Toggle underline">
|
|
94
|
+
<Underline className="h-4 w-4" />
|
|
95
|
+
</ToggleGroupItem>
|
|
96
|
+
} />
|
|
97
|
+
<TooltipContent>Sublinhado</TooltipContent>
|
|
98
|
+
</Tooltip>
|
|
76
99
|
</ToggleGroup>
|
|
77
100
|
</div>
|
|
78
101
|
</CardContent>
|
|
@@ -22,7 +22,7 @@ export function FeedbackDemo() {
|
|
|
22
22
|
}, []);
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
|
-
<div className="
|
|
25
|
+
<div className="flex flex-col gap-8">
|
|
26
26
|
<Card>
|
|
27
27
|
<CardHeader>
|
|
28
28
|
<CardTitle>Progresso (Progress)</CardTitle>
|
|
@@ -37,9 +37,9 @@ export function FeedbackDemo() {
|
|
|
37
37
|
<CardTitle>Esqueleto (Skeleton)</CardTitle>
|
|
38
38
|
</CardHeader>
|
|
39
39
|
<CardContent>
|
|
40
|
-
<div className="flex items-center
|
|
40
|
+
<div className="flex items-center gap-4">
|
|
41
41
|
<Skeleton className="h-12 w-12 rounded-full" />
|
|
42
|
-
<div className="
|
|
42
|
+
<div className="flex flex-col gap-2">
|
|
43
43
|
<Skeleton className="h-4 w-[250px]" />
|
|
44
44
|
<Skeleton className="h-4 w-[200px]" />
|
|
45
45
|
</div>
|
|
@@ -69,9 +69,7 @@ export function FeedbackDemo() {
|
|
|
69
69
|
<CardContent>
|
|
70
70
|
<TooltipProvider>
|
|
71
71
|
<Tooltip>
|
|
72
|
-
<TooltipTrigger
|
|
73
|
-
<Button variant="outline">Passe o mouse</Button>
|
|
74
|
-
</TooltipTrigger>
|
|
72
|
+
<TooltipTrigger render={<Button variant="outline" />}>Passe o mouse</TooltipTrigger>
|
|
75
73
|
<TooltipContent>
|
|
76
74
|
<p>Adicione à biblioteca</p>
|
|
77
75
|
</TooltipContent>
|
package/src/demo/FormsDemo.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Card, CardContent, CardHeader, CardTitle } from "../components/ui/card";
|
|
1
|
+
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "../components/ui/card";
|
|
2
|
+
import { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator } from "../components/ui/input-otp";
|
|
2
3
|
import { Input } from "../components/ui/input";
|
|
3
4
|
import { Label } from "../components/ui/label";
|
|
4
5
|
import { Textarea } from "../components/ui/textarea";
|
|
@@ -11,12 +12,12 @@ import { ColorPicker } from "../components/ui/color-picker";
|
|
|
11
12
|
|
|
12
13
|
export function FormsDemo() {
|
|
13
14
|
return (
|
|
14
|
-
<div className="
|
|
15
|
+
<div className="flex flex-col gap-8">
|
|
15
16
|
<Card>
|
|
16
17
|
<CardHeader>
|
|
17
18
|
<CardTitle>Campos de Texto e Selects</CardTitle>
|
|
18
19
|
</CardHeader>
|
|
19
|
-
<CardContent className="
|
|
20
|
+
<CardContent className="flex flex-col gap-6">
|
|
20
21
|
<div className="grid w-full max-w-sm items-center gap-1.5">
|
|
21
22
|
<Label htmlFor="email">E-mail</Label>
|
|
22
23
|
<Input type="email" id="email" placeholder="nome@exemplo.com" />
|
|
@@ -48,31 +49,31 @@ export function FormsDemo() {
|
|
|
48
49
|
<CardHeader>
|
|
49
50
|
<CardTitle>Checkboxes, Radios e Switches</CardTitle>
|
|
50
51
|
</CardHeader>
|
|
51
|
-
<CardContent className="
|
|
52
|
-
<div className="flex items-center
|
|
52
|
+
<CardContent className="flex flex-col gap-8">
|
|
53
|
+
<div className="flex items-center gap-2">
|
|
53
54
|
<Checkbox id="terms" />
|
|
54
55
|
<Label htmlFor="terms">Aceitar termos e condições</Label>
|
|
55
56
|
</div>
|
|
56
57
|
|
|
57
|
-
<div className="
|
|
58
|
+
<div className="flex flex-col gap-3">
|
|
58
59
|
<Label>Notificações</Label>
|
|
59
60
|
<RadioGroup defaultValue="all">
|
|
60
|
-
<div className="flex items-center
|
|
61
|
+
<div className="flex items-center gap-2">
|
|
61
62
|
<RadioGroupItem value="all" id="r1" />
|
|
62
63
|
<Label htmlFor="r1">Todas as notificações</Label>
|
|
63
64
|
</div>
|
|
64
|
-
<div className="flex items-center
|
|
65
|
+
<div className="flex items-center gap-2">
|
|
65
66
|
<RadioGroupItem value="mentions" id="r2" />
|
|
66
67
|
<Label htmlFor="r2">Apenas menções</Label>
|
|
67
68
|
</div>
|
|
68
|
-
<div className="flex items-center
|
|
69
|
+
<div className="flex items-center gap-2">
|
|
69
70
|
<RadioGroupItem value="none" id="r3" />
|
|
70
71
|
<Label htmlFor="r3">Nenhuma</Label>
|
|
71
72
|
</div>
|
|
72
73
|
</RadioGroup>
|
|
73
74
|
</div>
|
|
74
75
|
|
|
75
|
-
<div className="flex items-center
|
|
76
|
+
<div className="flex items-center gap-2">
|
|
76
77
|
<Switch id="airplane-mode" />
|
|
77
78
|
<Label htmlFor="airplane-mode">Modo Avião</Label>
|
|
78
79
|
</div>
|
|
@@ -83,7 +84,7 @@ export function FormsDemo() {
|
|
|
83
84
|
<CardHeader>
|
|
84
85
|
<CardTitle>Seletores Especiais</CardTitle>
|
|
85
86
|
</CardHeader>
|
|
86
|
-
<CardContent className="
|
|
87
|
+
<CardContent className="flex flex-col gap-8">
|
|
87
88
|
<div className="grid w-full max-w-sm items-center gap-3">
|
|
88
89
|
<Label>Slider (Deslizante)</Label>
|
|
89
90
|
<Slider defaultValue={[50]} max={100} step={1} />
|
|
@@ -95,6 +96,28 @@ export function FormsDemo() {
|
|
|
95
96
|
</div>
|
|
96
97
|
</CardContent>
|
|
97
98
|
</Card>
|
|
99
|
+
|
|
100
|
+
<Card>
|
|
101
|
+
<CardHeader>
|
|
102
|
+
<CardTitle>One-Time Password (OTP)</CardTitle>
|
|
103
|
+
<CardDescription>Para códigos de verificação.</CardDescription>
|
|
104
|
+
</CardHeader>
|
|
105
|
+
<CardContent>
|
|
106
|
+
<InputOTP maxLength={6}>
|
|
107
|
+
<InputOTPGroup>
|
|
108
|
+
<InputOTPSlot index={0} />
|
|
109
|
+
<InputOTPSlot index={1} />
|
|
110
|
+
<InputOTPSlot index={2} />
|
|
111
|
+
</InputOTPGroup>
|
|
112
|
+
<InputOTPSeparator />
|
|
113
|
+
<InputOTPGroup>
|
|
114
|
+
<InputOTPSlot index={3} />
|
|
115
|
+
<InputOTPSlot index={4} />
|
|
116
|
+
<InputOTPSlot index={5} />
|
|
117
|
+
</InputOTPGroup>
|
|
118
|
+
</InputOTP>
|
|
119
|
+
</CardContent>
|
|
120
|
+
</Card>
|
|
98
121
|
</div>
|
|
99
122
|
);
|
|
100
123
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Card, CardContent, CardHeader, CardTitle, CardDescription, CardFooter } from "../components/ui/card";
|
|
2
2
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../components/ui/tabs";
|
|
3
|
+
import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from "../components/ui/carousel";
|
|
3
4
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "../components/ui/accordion";
|
|
4
5
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../components/ui/collapsible";
|
|
5
6
|
import { ScrollArea } from "../components/ui/scroll-area";
|
|
@@ -12,14 +13,14 @@ export function NavigationDemo() {
|
|
|
12
13
|
const [isOpen, setIsOpen] = useState(false);
|
|
13
14
|
|
|
14
15
|
return (
|
|
15
|
-
<div className="
|
|
16
|
+
<div className="flex flex-col gap-8">
|
|
16
17
|
<Card>
|
|
17
18
|
<CardHeader>
|
|
18
19
|
<CardTitle>Abas (Tabs)</CardTitle>
|
|
19
20
|
</CardHeader>
|
|
20
21
|
<CardContent>
|
|
21
22
|
<Tabs defaultValue="account" className="w-[400px]">
|
|
22
|
-
<TabsList className="
|
|
23
|
+
<TabsList className="flex w-full">
|
|
23
24
|
<TabsTrigger value="account">Conta</TabsTrigger>
|
|
24
25
|
<TabsTrigger value="password">Senha</TabsTrigger>
|
|
25
26
|
</TabsList>
|
|
@@ -38,7 +39,7 @@ export function NavigationDemo() {
|
|
|
38
39
|
<CardTitle>Acordeão (Accordion)</CardTitle>
|
|
39
40
|
</CardHeader>
|
|
40
41
|
<CardContent>
|
|
41
|
-
<Accordion
|
|
42
|
+
<Accordion className="w-full">
|
|
42
43
|
<AccordionItem value="item-1">
|
|
43
44
|
<AccordionTrigger>É acessível?</AccordionTrigger>
|
|
44
45
|
<AccordionContent>
|
|
@@ -63,28 +64,26 @@ export function NavigationDemo() {
|
|
|
63
64
|
<Collapsible
|
|
64
65
|
open={isOpen}
|
|
65
66
|
onOpenChange={setIsOpen}
|
|
66
|
-
className="w-[350px]
|
|
67
|
+
className="w-[350px] flex flex-col gap-2"
|
|
67
68
|
>
|
|
68
|
-
<div className="flex items-center justify-between
|
|
69
|
+
<div className="flex items-center justify-between gap-4 px-4">
|
|
69
70
|
<h4 className="text-sm font-semibold">
|
|
70
71
|
@peduarte favoritou 3 repositórios
|
|
71
72
|
</h4>
|
|
72
|
-
<CollapsibleTrigger
|
|
73
|
-
<Button variant="ghost" size="sm" className="w-9 p-0">
|
|
73
|
+
<CollapsibleTrigger render={<Button variant="ghost" size="sm" className="w-9 p-0" />}>
|
|
74
74
|
<ChevronsUpDown className="h-4 w-4" />
|
|
75
75
|
<span className="sr-only">Alternar</span>
|
|
76
|
-
</
|
|
77
|
-
</CollapsibleTrigger>
|
|
76
|
+
</CollapsibleTrigger>
|
|
78
77
|
</div>
|
|
79
78
|
<div className="rounded-md border px-4 py-3 font-mono text-sm">
|
|
80
|
-
@
|
|
79
|
+
@base-ui/react
|
|
81
80
|
</div>
|
|
82
|
-
<CollapsibleContent className="
|
|
81
|
+
<CollapsibleContent className="flex flex-col gap-2">
|
|
83
82
|
<div className="rounded-md border px-4 py-3 font-mono text-sm">
|
|
84
|
-
|
|
83
|
+
tailwindcss/v4
|
|
85
84
|
</div>
|
|
86
85
|
<div className="rounded-md border px-4 py-3 font-mono text-sm">
|
|
87
|
-
|
|
86
|
+
framer-motion
|
|
88
87
|
</div>
|
|
89
88
|
</CollapsibleContent>
|
|
90
89
|
</Collapsible>
|
|
@@ -136,6 +135,32 @@ export function NavigationDemo() {
|
|
|
136
135
|
</CardContent>
|
|
137
136
|
</Card>
|
|
138
137
|
</div>
|
|
138
|
+
|
|
139
|
+
<Card>
|
|
140
|
+
<CardHeader>
|
|
141
|
+
<CardTitle>Carousel</CardTitle>
|
|
142
|
+
<CardDescription>Carrossel de conteúdo.</CardDescription>
|
|
143
|
+
</CardHeader>
|
|
144
|
+
<CardContent className="flex justify-center">
|
|
145
|
+
<Carousel className="w-full max-w-xs">
|
|
146
|
+
<CarouselContent>
|
|
147
|
+
{Array.from({ length: 5 }).map((_, index) => (
|
|
148
|
+
<CarouselItem key={index}>
|
|
149
|
+
<div className="p-1">
|
|
150
|
+
<Card>
|
|
151
|
+
<CardContent className="flex aspect-square items-center justify-center p-6">
|
|
152
|
+
<span className="text-4xl font-semibold">{index + 1}</span>
|
|
153
|
+
</CardContent>
|
|
154
|
+
</Card>
|
|
155
|
+
</div>
|
|
156
|
+
</CarouselItem>
|
|
157
|
+
))}
|
|
158
|
+
</CarouselContent>
|
|
159
|
+
<CarouselPrevious />
|
|
160
|
+
<CarouselNext />
|
|
161
|
+
</Carousel>
|
|
162
|
+
</CardContent>
|
|
163
|
+
</Card>
|
|
139
164
|
</div>
|
|
140
165
|
);
|
|
141
166
|
}
|