gladvn 0.2.16 → 0.2.18
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/bin/cli.js +9 -6
- package/dist/components/macro/accordion-preset.d.ts.map +1 -1
- package/dist/components/macro/alert-dialog-preset.d.ts.map +1 -1
- package/dist/components/macro/alert-preset.d.ts.map +1 -1
- package/dist/components/macro/avatar-preset.d.ts.map +1 -1
- package/dist/components/macro/breadcrumb-preset.d.ts.map +1 -1
- package/dist/components/macro/card-preset.d.ts.map +1 -1
- package/dist/components/macro/carousel-preset.d.ts.map +1 -1
- package/dist/components/macro/checkbox-preset.d.ts.map +1 -1
- package/dist/components/macro/combobox-preset.d.ts.map +1 -1
- package/dist/components/macro/command-preset.d.ts +1 -1
- package/dist/components/macro/command-preset.d.ts.map +1 -1
- package/dist/components/macro/date-picker.d.ts.map +1 -1
- package/dist/components/macro/dialog-preset.d.ts.map +1 -1
- package/dist/components/macro/empty-preset.d.ts.map +1 -1
- package/dist/components/macro/field-preset.d.ts.map +1 -1
- package/dist/components/macro/input-otp-preset.d.ts +6 -0
- package/dist/components/macro/input-otp-preset.d.ts.map +1 -1
- package/dist/components/macro/input-preset.d.ts +1 -1
- package/dist/components/macro/input-preset.d.ts.map +1 -1
- package/dist/components/macro/pagination-preset.d.ts.map +1 -1
- package/dist/components/macro/progress-preset.d.ts.map +1 -1
- package/dist/components/macro/radio-group-preset.d.ts.map +1 -1
- package/dist/components/macro/select-preset.d.ts.map +1 -1
- package/dist/components/macro/slider-preset.d.ts.map +1 -1
- package/dist/components/macro/switch-preset.d.ts.map +1 -1
- package/dist/components/macro/tabs-preset.d.ts +1 -1
- package/dist/components/macro/tabs-preset.d.ts.map +1 -1
- package/dist/components/macro/textarea-preset.d.ts +1 -1
- package/dist/components/macro/textarea-preset.d.ts.map +1 -1
- package/dist/components/micro/accordion.d.ts +7 -0
- package/dist/components/micro/accordion.d.ts.map +1 -1
- package/dist/components/micro/alert-dialog.d.ts.map +1 -1
- package/dist/components/micro/alert.d.ts +7 -0
- package/dist/components/micro/alert.d.ts.map +1 -1
- package/dist/components/micro/aspect-ratio.d.ts +7 -0
- package/dist/components/micro/aspect-ratio.d.ts.map +1 -1
- package/dist/components/micro/avatar.d.ts.map +1 -1
- package/dist/components/micro/badge.d.ts +8 -1
- package/dist/components/micro/badge.d.ts.map +1 -1
- package/dist/components/micro/breadcrumb.d.ts +7 -0
- package/dist/components/micro/breadcrumb.d.ts.map +1 -1
- package/dist/components/micro/button.d.ts +8 -1
- package/dist/components/micro/button.d.ts.map +1 -1
- package/dist/components/micro/calendar.d.ts +2 -2
- package/dist/components/micro/calendar.d.ts.map +1 -1
- package/dist/components/micro/carousel.d.ts.map +1 -1
- package/dist/components/micro/chart.d.ts.map +1 -1
- package/dist/components/micro/checkbox.d.ts.map +1 -1
- package/dist/components/micro/collapsible.d.ts.map +1 -1
- package/dist/components/micro/combobox.d.ts.map +1 -1
- package/dist/components/micro/command.d.ts.map +1 -1
- package/dist/components/micro/context-menu.d.ts.map +1 -1
- package/dist/components/micro/dialog.d.ts.map +1 -1
- package/dist/components/micro/drawer.d.ts.map +1 -1
- package/dist/components/micro/dropdown-menu.d.ts.map +1 -1
- package/dist/components/micro/empty.d.ts +7 -0
- package/dist/components/micro/empty.d.ts.map +1 -1
- package/dist/components/micro/field.d.ts.map +1 -1
- package/dist/components/micro/hover-card.d.ts +1 -1
- package/dist/components/micro/hover-card.d.ts.map +1 -1
- package/dist/components/micro/input-group.d.ts.map +1 -1
- package/dist/components/micro/input-otp.d.ts.map +1 -1
- package/dist/components/micro/input.d.ts +7 -0
- package/dist/components/micro/input.d.ts.map +1 -1
- package/dist/components/micro/item.d.ts.map +1 -1
- package/dist/components/micro/label.d.ts.map +1 -1
- package/dist/components/micro/menubar.d.ts.map +1 -1
- package/dist/components/micro/navigation-menu.d.ts +8 -1
- package/dist/components/micro/navigation-menu.d.ts.map +1 -1
- package/dist/components/micro/pagination.d.ts.map +1 -1
- package/dist/components/micro/popover.d.ts.map +1 -1
- package/dist/components/micro/progress.d.ts.map +1 -1
- package/dist/components/micro/radio-group.d.ts.map +1 -1
- package/dist/components/micro/select.d.ts +1 -1
- package/dist/components/micro/select.d.ts.map +1 -1
- package/dist/components/micro/sheet.d.ts.map +1 -1
- package/dist/components/micro/sidebar.d.ts.map +1 -1
- package/dist/components/micro/skeleton.d.ts +7 -0
- package/dist/components/micro/skeleton.d.ts.map +1 -1
- package/dist/components/micro/slider.d.ts +7 -0
- package/dist/components/micro/slider.d.ts.map +1 -1
- package/dist/components/micro/sonner.d.ts.map +1 -1
- package/dist/components/micro/spinner.d.ts.map +1 -1
- package/dist/components/micro/switch.d.ts.map +1 -1
- package/dist/components/micro/table.d.ts.map +1 -1
- package/dist/components/micro/tabs.d.ts +1 -1
- package/dist/components/micro/tabs.d.ts.map +1 -1
- package/dist/components/micro/textarea.d.ts +7 -0
- package/dist/components/micro/textarea.d.ts.map +1 -1
- package/dist/components/micro/toggle-group.d.ts.map +1 -1
- package/dist/components/micro/toggle.d.ts.map +1 -1
- package/dist/components/micro/tooltip.d.ts +1 -1
- package/dist/components/micro/tooltip.d.ts.map +1 -1
- package/dist/dev/App.d.ts.map +1 -1
- package/dist/dev/components/code-highlighter.d.ts.map +1 -1
- package/dist/dev/components/dev-context.d.ts.map +1 -1
- package/dist/dev/components/showcase.d.ts +1 -1
- package/dist/dev/components/showcase.d.ts.map +1 -1
- package/dist/dev/data.d.ts.map +1 -1
- package/dist/dev/main.d.ts.map +1 -1
- package/dist/dev/sections/buttons.d.ts.map +1 -1
- package/dist/dev/sections/feedback.d.ts.map +1 -1
- package/dist/dev/sections/overview.d.ts.map +1 -1
- package/dist/dev/showcase/accordion.d.ts.map +1 -1
- package/dist/dev/showcase/alert-dialog.d.ts.map +1 -1
- package/dist/dev/showcase/alert.d.ts.map +1 -1
- package/dist/dev/showcase/aspect-ratio.d.ts.map +1 -1
- package/dist/dev/showcase/avatar.d.ts.map +1 -1
- package/dist/dev/showcase/breadcrumb.d.ts.map +1 -1
- package/dist/dev/showcase/button.d.ts.map +1 -1
- package/dist/dev/showcase/calendar.d.ts.map +1 -1
- package/dist/dev/showcase/card.d.ts.map +1 -1
- package/dist/dev/showcase/carousel.d.ts.map +1 -1
- package/dist/dev/showcase/chart.d.ts.map +1 -1
- package/dist/dev/showcase/checkbox.d.ts.map +1 -1
- package/dist/dev/showcase/collapsible.d.ts.map +1 -1
- package/dist/dev/showcase/combobox.d.ts.map +1 -1
- package/dist/dev/showcase/command.d.ts.map +1 -1
- package/dist/dev/showcase/context-menu.d.ts.map +1 -1
- package/dist/dev/showcase/dialog.d.ts.map +1 -1
- package/dist/dev/showcase/drawer.d.ts.map +1 -1
- package/dist/dev/showcase/dropdown-menu.d.ts.map +1 -1
- package/dist/dev/showcase/empty.d.ts.map +1 -1
- package/dist/dev/showcase/hover-card.d.ts.map +1 -1
- package/dist/dev/showcase/input-group.d.ts.map +1 -1
- package/dist/dev/showcase/input-otp.d.ts.map +1 -1
- package/dist/dev/showcase/input.d.ts.map +1 -1
- package/dist/dev/showcase/item.d.ts.map +1 -1
- package/dist/dev/showcase/kbd.d.ts.map +1 -1
- package/dist/dev/showcase/label.d.ts.map +1 -1
- package/dist/dev/showcase/menubar.d.ts.map +1 -1
- package/dist/dev/showcase/navigation-menu.d.ts.map +1 -1
- package/dist/dev/showcase/overview.d.ts.map +1 -1
- package/dist/dev/showcase/pagination.d.ts.map +1 -1
- package/dist/dev/showcase/popover.d.ts.map +1 -1
- package/dist/dev/showcase/progress.d.ts.map +1 -1
- package/dist/dev/showcase/radio-group.d.ts.map +1 -1
- package/dist/dev/showcase/resizable.d.ts.map +1 -1
- package/dist/dev/showcase/scroll-area.d.ts.map +1 -1
- package/dist/dev/showcase/select.d.ts.map +1 -1
- package/dist/dev/showcase/separator.d.ts.map +1 -1
- package/dist/dev/showcase/sheet.d.ts.map +1 -1
- package/dist/dev/showcase/sidebar.d.ts.map +1 -1
- package/dist/dev/showcase/skeleton.d.ts.map +1 -1
- package/dist/dev/showcase/slider.d.ts.map +1 -1
- package/dist/dev/showcase/sonner.d.ts.map +1 -1
- package/dist/dev/showcase/spinner.d.ts.map +1 -1
- package/dist/dev/showcase/switch.d.ts.map +1 -1
- package/dist/dev/showcase/table.d.ts.map +1 -1
- package/dist/dev/showcase/tabs.d.ts.map +1 -1
- package/dist/dev/showcase/textarea.d.ts.map +1 -1
- package/dist/dev/showcase/theme-provider.d.ts.map +1 -1
- package/dist/dev/showcase/toast.d.ts.map +1 -1
- package/dist/dev/showcase/toggle-group.d.ts.map +1 -1
- package/dist/dev/showcase/toggle.d.ts.map +1 -1
- package/dist/dev/showcase/tooltip.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/package.json +3 -1
- package/scripts/format-codestrings.ts +87 -0
- package/scripts/organize-imports.ts +21 -0
- package/scripts/regex-format.cjs +67 -0
- package/scripts/tmp.tsx +25 -0
- package/src/components/macro/accordion-preset.test.tsx +1 -0
- package/src/components/macro/accordion-preset.tsx +2 -1
- package/src/components/macro/alert-dialog-preset.tsx +44 -43
- package/src/components/macro/alert-preset.tsx +7 -3
- package/src/components/macro/avatar-preset.tsx +2 -1
- package/src/components/macro/breadcrumb-preset.tsx +2 -1
- package/src/components/macro/card-preset.tsx +2 -1
- package/src/components/macro/carousel-preset.tsx +5 -2
- package/src/components/macro/checkbox-preset.test.tsx +1 -0
- package/src/components/macro/checkbox-preset.tsx +6 -2
- package/src/components/macro/combobox-preset.tsx +6 -3
- package/src/components/macro/command-preset.tsx +7 -3
- package/src/components/macro/date-picker.tsx +77 -59
- package/src/components/macro/dialog-preset.tsx +42 -38
- package/src/components/macro/empty-preset.tsx +2 -1
- package/src/components/macro/field-preset.test.tsx +1 -0
- package/src/components/macro/field-preset.tsx +2 -1
- package/src/components/macro/input-otp-preset.tsx +6 -2
- package/src/components/macro/input-preset.test.tsx +1 -0
- package/src/components/macro/input-preset.tsx +4 -2
- package/src/components/macro/pagination-preset.tsx +3 -1
- package/src/components/macro/progress-preset.test.tsx +1 -0
- package/src/components/macro/progress-preset.tsx +2 -1
- package/src/components/macro/radio-group-preset.tsx +4 -1
- package/src/components/macro/select-preset.tsx +35 -30
- package/src/components/macro/slider-preset.test.tsx +1 -0
- package/src/components/macro/slider-preset.tsx +4 -1
- package/src/components/macro/switch-preset.test.tsx +1 -0
- package/src/components/macro/switch-preset.tsx +4 -1
- package/src/components/macro/tabs-preset.test.tsx +1 -0
- package/src/components/macro/tabs-preset.tsx +4 -2
- package/src/components/macro/textarea-preset.test.tsx +1 -0
- package/src/components/macro/textarea-preset.tsx +4 -1
- package/src/components/micro/accordion.tsx +3 -2
- package/src/components/micro/alert-dialog.tsx +2 -1
- package/src/components/micro/alert.tsx +3 -2
- package/src/components/micro/aspect-ratio.tsx +2 -1
- package/src/components/micro/avatar.tsx +2 -1
- package/src/components/micro/badge.tsx +3 -3
- package/src/components/micro/breadcrumb.tsx +3 -2
- package/src/components/micro/button.test.tsx +1 -0
- package/src/components/micro/button.tsx +3 -3
- package/src/components/micro/calendar.tsx +10 -9
- package/src/components/micro/carousel.tsx +3 -2
- package/src/components/micro/chart.tsx +1 -0
- package/src/components/micro/checkbox.tsx +2 -2
- package/src/components/micro/collapsible.tsx +4 -2
- package/src/components/micro/combobox.tsx +47 -29
- package/src/components/micro/command.tsx +23 -16
- package/src/components/micro/context-menu.tsx +3 -2
- package/src/components/micro/dialog.tsx +2 -1
- package/src/components/micro/drawer.tsx +2 -1
- package/src/components/micro/dropdown-menu.tsx +3 -2
- package/src/components/micro/empty.tsx +2 -1
- package/src/components/micro/field.tsx +4 -3
- package/src/components/micro/hover-card.tsx +20 -19
- package/src/components/micro/input-group.tsx +5 -4
- package/src/components/micro/input-otp.tsx +3 -2
- package/src/components/micro/input.tsx +3 -2
- package/src/components/micro/item.tsx +1 -0
- package/src/components/micro/label.tsx +2 -1
- package/src/components/micro/menubar.tsx +2 -1
- package/src/components/micro/navigation-menu.tsx +18 -17
- package/src/components/micro/pagination.tsx +2 -1
- package/src/components/micro/popover.tsx +2 -1
- package/src/components/micro/progress.tsx +2 -1
- package/src/components/micro/radio-group.tsx +3 -3
- package/src/components/micro/select.tsx +5 -4
- package/src/components/micro/sheet.tsx +2 -1
- package/src/components/micro/sidebar.tsx +4 -1
- package/src/components/micro/skeleton.tsx +2 -1
- package/src/components/micro/slider.tsx +4 -1
- package/src/components/micro/sonner.tsx +2 -1
- package/src/components/micro/spinner.tsx +1 -2
- package/src/components/micro/switch.tsx +2 -2
- package/src/components/micro/table.tsx +2 -1
- package/src/components/micro/tabs.tsx +4 -3
- package/src/components/micro/textarea.tsx +2 -1
- package/src/components/micro/toggle-group.tsx +1 -0
- package/src/components/micro/toggle.tsx +1 -3
- package/src/components/micro/tooltip.tsx +9 -3
- package/src/dev/App.tsx +66 -41
- package/src/dev/components/code-highlighter.tsx +2 -1
- package/src/dev/components/dev-context.tsx +1 -0
- package/src/dev/components/showcase.tsx +13 -14
- package/src/dev/data.ts +206 -52
- package/src/dev/main.tsx +4 -4
- package/src/dev/sections/buttons.tsx +14 -12
- package/src/dev/sections/feedback.tsx +7 -2
- package/src/dev/sections/forms.tsx +11 -11
- package/src/dev/sections/overview.tsx +2 -1
- package/src/dev/showcase/accordion.tsx +399 -314
- package/src/dev/showcase/alert-dialog.tsx +387 -384
- package/src/dev/showcase/alert.tsx +271 -258
- package/src/dev/showcase/aspect-ratio.tsx +102 -105
- package/src/dev/showcase/avatar.tsx +216 -145
- package/src/dev/showcase/badge.tsx +78 -50
- package/src/dev/showcase/breadcrumb.tsx +88 -85
- package/src/dev/showcase/button.tsx +72 -96
- package/src/dev/showcase/calendar.tsx +41 -39
- package/src/dev/showcase/card.tsx +170 -148
- package/src/dev/showcase/carousel.tsx +239 -77
- package/src/dev/showcase/chart.tsx +5 -4
- package/src/dev/showcase/checkbox.tsx +206 -140
- package/src/dev/showcase/collapsible.tsx +108 -84
- package/src/dev/showcase/combobox.tsx +272 -199
- package/src/dev/showcase/command.tsx +31 -28
- package/src/dev/showcase/context-menu.tsx +94 -77
- package/src/dev/showcase/dialog.tsx +445 -424
- package/src/dev/showcase/drawer.tsx +142 -135
- package/src/dev/showcase/dropdown-menu.tsx +165 -161
- package/src/dev/showcase/empty.tsx +173 -158
- package/src/dev/showcase/hover-card.tsx +92 -52
- package/src/dev/showcase/input-group.tsx +193 -160
- package/src/dev/showcase/input-otp.tsx +109 -99
- package/src/dev/showcase/input.tsx +78 -42
- package/src/dev/showcase/item.tsx +101 -98
- package/src/dev/showcase/kbd.tsx +78 -62
- package/src/dev/showcase/label.tsx +16 -23
- package/src/dev/showcase/menubar.tsx +274 -251
- package/src/dev/showcase/navigation-menu.tsx +175 -170
- package/src/dev/showcase/overview.tsx +164 -148
- package/src/dev/showcase/pagination.tsx +101 -69
- package/src/dev/showcase/popover.tsx +113 -86
- package/src/dev/showcase/progress.tsx +99 -69
- package/src/dev/showcase/radio-group.tsx +217 -134
- package/src/dev/showcase/resizable.tsx +65 -55
- package/src/dev/showcase/scroll-area.tsx +32 -22
- package/src/dev/showcase/select.tsx +192 -136
- package/src/dev/showcase/separator.tsx +28 -24
- package/src/dev/showcase/sheet.tsx +182 -134
- package/src/dev/showcase/sidebar.tsx +9 -5
- package/src/dev/showcase/skeleton.tsx +54 -59
- package/src/dev/showcase/slider.tsx +158 -129
- package/src/dev/showcase/sonner.tsx +3 -5
- package/src/dev/showcase/spinner.tsx +22 -18
- package/src/dev/showcase/switch.tsx +207 -110
- package/src/dev/showcase/table.tsx +44 -32
- package/src/dev/showcase/tabs.tsx +272 -267
- package/src/dev/showcase/textarea.tsx +162 -116
- package/src/dev/showcase/theme-provider.tsx +596 -534
- package/src/dev/showcase/toast.tsx +37 -38
- package/src/dev/showcase/toggle-group.tsx +87 -39
- package/src/dev/showcase/toggle.tsx +36 -27
- package/src/dev/showcase/tooltip.tsx +154 -119
- package/src/lib/utils.test.ts +1 -0
- package/src/lib/utils.ts +1 -1
- package/src/styles/gladvn.css +1 -1
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
* - Form Control Parity
|
|
6
6
|
* - CSS Delegated Logic
|
|
7
7
|
*/
|
|
8
|
-
import { NavigationMenu as NavigationMenuPrimitive } from "@base-ui/react/navigation-menu";
|
|
9
8
|
import * as React from "react";
|
|
10
9
|
|
|
11
|
-
import {
|
|
10
|
+
import { NavigationMenu as NavigationMenuPrimitive } from "@base-ui/react/navigation-menu";
|
|
12
11
|
import { ChevronDownIcon } from "lucide-react";
|
|
13
12
|
|
|
13
|
+
import { cn } from "../../lib/utils";
|
|
14
|
+
|
|
14
15
|
/**
|
|
15
16
|
* @description A collection of links for navigating websites.
|
|
16
17
|
* @requires NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent
|
|
@@ -131,20 +132,20 @@ const NavigationMenuPositioner = React.forwardRef<
|
|
|
131
132
|
) => {
|
|
132
133
|
return (
|
|
133
134
|
<NavigationMenuPrimitive.Positioner
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
135
|
+
ref={ref}
|
|
136
|
+
side={side}
|
|
137
|
+
sideOffset={sideOffset}
|
|
138
|
+
align={align}
|
|
139
|
+
alignOffset={alignOffset}
|
|
140
|
+
className={cn(
|
|
141
|
+
"isolate z-50 h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] data-instant:transition-none data-[side=bottom]:before:top-[-10px] data-[side=bottom]:before:right-0 data-[side=bottom]:before:left-0",
|
|
142
|
+
className,
|
|
143
|
+
)}
|
|
144
|
+
{...props}
|
|
145
|
+
>
|
|
146
|
+
<NavigationMenuPrimitive.Popup className="data-ending-style:easing-[ease] xs:w-(--popup-width) relative h-(--popup-height) w-(--popup-width) origin-(--transform-origin) rounded-lg bg-popover text-popover-foreground shadow ring-1 ring-foreground/10 transition-[opacity,transform,width,height,scale,translate] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] outline-none data-ending-style:scale-90 data-ending-style:opacity-0 data-ending-style:duration-150 data-starting-style:scale-90 data-starting-style:opacity-0">
|
|
147
|
+
<NavigationMenuViewport />
|
|
148
|
+
</NavigationMenuPrimitive.Popup>
|
|
148
149
|
</NavigationMenuPrimitive.Positioner>
|
|
149
150
|
);
|
|
150
151
|
},
|
|
@@ -192,6 +193,6 @@ export {
|
|
|
192
193
|
NavigationMenuPortal,
|
|
193
194
|
NavigationMenuPositioner,
|
|
194
195
|
NavigationMenuTrigger,
|
|
195
|
-
NavigationMenuViewport,
|
|
196
196
|
navigationMenuTriggerStyle,
|
|
197
|
+
NavigationMenuViewport,
|
|
197
198
|
};
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* - CSS Delegated Logic
|
|
7
7
|
*/
|
|
8
8
|
import * as React from "react";
|
|
9
|
+
|
|
9
10
|
import {
|
|
10
11
|
ChevronLeftIcon,
|
|
11
12
|
ChevronRightIcon,
|
|
@@ -13,8 +14,8 @@ import {
|
|
|
13
14
|
} from "lucide-react";
|
|
14
15
|
|
|
15
16
|
import { Button } from "../../components/micro/button";
|
|
16
|
-
import { cn } from "../../lib/utils";
|
|
17
17
|
import type { Size } from "../../lib/types";
|
|
18
|
+
import { cn } from "../../lib/utils";
|
|
18
19
|
|
|
19
20
|
const ellipsisSizeMap: Record<Size, { container: string; icon: string }> = {
|
|
20
21
|
sm: { container: "size-7", icon: "[&>svg:not([class*='size-'])]:size-3" },
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
"use client";
|
|
10
10
|
|
|
11
|
-
import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
|
|
12
11
|
import * as React from "react";
|
|
13
12
|
|
|
13
|
+
import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
|
|
14
|
+
|
|
14
15
|
import { cn } from "../../lib/utils";
|
|
15
16
|
|
|
16
17
|
function Popover(props: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
|
|
10
|
-
import { Progress as ProgressPrimitive } from "@base-ui/react/progress";
|
|
11
10
|
import * as React from "react";
|
|
12
11
|
|
|
12
|
+
import { Progress as ProgressPrimitive } from "@base-ui/react/progress";
|
|
13
|
+
|
|
13
14
|
import { type Color, type Size } from "../../lib/types";
|
|
14
15
|
import { cn } from "../../lib/utils";
|
|
15
16
|
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
|
|
10
|
-
import { Radio as RadioPrimitive } from "@base-ui/react/radio";
|
|
11
|
-
import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";
|
|
12
10
|
import * as React from "react";
|
|
13
11
|
|
|
14
|
-
import {
|
|
12
|
+
import { Radio as RadioPrimitive } from "@base-ui/react/radio";
|
|
13
|
+
import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";
|
|
14
|
+
import { type VariantProps, cva } from "class-variance-authority";
|
|
15
15
|
|
|
16
16
|
import { type Size } from "../../lib/types";
|
|
17
17
|
import { cn } from "../../lib/utils";
|
|
@@ -7,13 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
|
|
10
|
-
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
11
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
12
10
|
import * as React from "react";
|
|
13
11
|
|
|
14
|
-
import {
|
|
12
|
+
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
13
|
+
import { type VariantProps, cva } from "class-variance-authority";
|
|
15
14
|
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
16
15
|
|
|
16
|
+
import { cn } from "../../lib/utils";
|
|
17
|
+
|
|
17
18
|
const Select = SelectPrimitive.Root;
|
|
18
19
|
|
|
19
20
|
const SelectGroup = React.forwardRef<
|
|
@@ -229,6 +230,6 @@ export {
|
|
|
229
230
|
SelectScrollUpButton,
|
|
230
231
|
SelectSeparator,
|
|
231
232
|
SelectTrigger,
|
|
232
|
-
selectTriggerVariants,
|
|
233
233
|
SelectValue,
|
|
234
|
+
selectTriggerVariants,
|
|
234
235
|
};
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
|
|
10
|
-
import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
|
|
11
10
|
import * as React from "react";
|
|
11
|
+
|
|
12
|
+
import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
|
|
12
13
|
import { XIcon } from "lucide-react";
|
|
13
14
|
|
|
14
15
|
import { Button } from "../../components/micro/button";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
|
+
|
|
4
7
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
5
8
|
// 1. Sidebar (Wrapper)
|
|
6
9
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* - Form Control Parity
|
|
6
6
|
* - CSS Delegated Logic
|
|
7
7
|
*/
|
|
8
|
-
import { cn } from "../../lib/utils";
|
|
9
8
|
import * as React from "react";
|
|
10
9
|
|
|
10
|
+
import { cn } from "../../lib/utils";
|
|
11
|
+
|
|
11
12
|
/**
|
|
12
13
|
* @description Use to show a placeholder while content is loading.
|
|
13
14
|
* @example
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* ✅ AUDITED & REFACTORED
|
|
3
5
|
* - Design System Compliant (22 Commandments)
|
|
@@ -5,9 +7,10 @@
|
|
|
5
7
|
* - Form Control Parity
|
|
6
8
|
* - CSS Delegated Logic
|
|
7
9
|
*/
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
|
|
8
12
|
import { Slider as SliderPrimitive } from "@base-ui/react/slider";
|
|
9
13
|
import { cva } from "class-variance-authority";
|
|
10
|
-
import * as React from "react";
|
|
11
14
|
|
|
12
15
|
import { type Size } from "../../lib/types";
|
|
13
16
|
import { cn } from "../../lib/utils";
|
|
@@ -7,14 +7,15 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
|
|
10
|
-
import { Toaster as Sonner, type ToasterProps } from "sonner";
|
|
11
10
|
import * as React from "react";
|
|
11
|
+
|
|
12
12
|
import {
|
|
13
13
|
CircleCheckIcon,
|
|
14
14
|
InfoIcon,
|
|
15
15
|
OctagonXIcon,
|
|
16
16
|
TriangleAlertIcon,
|
|
17
17
|
} from "lucide-react";
|
|
18
|
+
import { Toaster as Sonner, type ToasterProps } from "sonner";
|
|
18
19
|
|
|
19
20
|
import { Spinner } from "../../components/micro/spinner";
|
|
20
21
|
import { useTheme } from "../../components/micro/theme-provider";
|
|
@@ -6,11 +6,10 @@
|
|
|
6
6
|
* - CSS Delegated Logic
|
|
7
7
|
*/
|
|
8
8
|
import * as React from "react";
|
|
9
|
+
|
|
9
10
|
import { type VariantProps, cva } from "class-variance-authority";
|
|
10
11
|
import { Loader2Icon } from "lucide-react";
|
|
11
12
|
|
|
12
|
-
import { cn } from "../../lib/utils";
|
|
13
|
-
|
|
14
13
|
const spinnerVariants = cva("animate-spin motion-reduce:animate-none", {
|
|
15
14
|
variants: {
|
|
16
15
|
size: {
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
|
|
10
|
-
import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
|
|
11
10
|
import * as React from "react";
|
|
12
11
|
|
|
13
|
-
import {
|
|
12
|
+
import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
|
|
13
|
+
import { type VariantProps, cva } from "class-variance-authority";
|
|
14
14
|
|
|
15
15
|
import { cn } from "../../lib/utils";
|
|
16
16
|
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
|
|
10
|
-
import { ChevronDown, ChevronUp } from "lucide-react";
|
|
11
10
|
import * as React from "react";
|
|
12
11
|
|
|
12
|
+
import { ChevronDown, ChevronUp } from "lucide-react";
|
|
13
|
+
|
|
13
14
|
import { cn } from "../../lib/utils";
|
|
14
15
|
|
|
15
16
|
const Table = React.forwardRef<HTMLDivElement, React.ComponentProps<"div">>(
|
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
|
|
10
|
-
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
11
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
12
10
|
import * as React from "react";
|
|
13
11
|
|
|
12
|
+
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
13
|
+
import { type VariantProps, cva } from "class-variance-authority";
|
|
14
|
+
|
|
14
15
|
import { cn } from "../../lib/utils";
|
|
15
16
|
|
|
16
17
|
const Tabs = React.forwardRef<
|
|
@@ -97,4 +98,4 @@ const TabsContent = React.forwardRef<
|
|
|
97
98
|
});
|
|
98
99
|
TabsContent.displayName = "TabsContent";
|
|
99
100
|
|
|
100
|
-
export { Tabs, TabsContent, TabsList,
|
|
101
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger, tabsListVariants };
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* - Form Control Parity
|
|
6
6
|
* - CSS Delegated Logic
|
|
7
7
|
*/
|
|
8
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
9
8
|
import * as React from "react";
|
|
10
9
|
|
|
10
|
+
import { type VariantProps, cva } from "class-variance-authority";
|
|
11
|
+
|
|
11
12
|
import { type Size } from "../../lib/types";
|
|
12
13
|
import { cn } from "../../lib/utils";
|
|
13
14
|
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
|
|
10
10
|
import * as React from "react";
|
|
11
|
+
|
|
11
12
|
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
|
|
12
13
|
import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group";
|
|
13
14
|
import { type VariantProps } from "class-variance-authority";
|
|
@@ -8,9 +8,7 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
|
|
10
10
|
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
import { cn } from "../../lib/utils";
|
|
11
|
+
import { type VariantProps, cva } from "class-variance-authority";
|
|
14
12
|
|
|
15
13
|
const toggleVariants = cva(
|
|
16
14
|
"group/toggle inline-flex items-center justify-center rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-3 aria-invalid:focus-visible:ring-destructive/50 dark:aria-invalid:focus-visible:ring-destructive/50 aria-pressed:bg-muted aria-pressed:text-foreground data-[state=on]:bg-muted data-[state=on]:text-foreground [&>svg]:pointer-events-none [&>svg]:shrink-0 [&>svg:not([class*='size-'])]:size-4 bg-transparent",
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
|
|
10
|
-
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
11
10
|
import * as React from "react";
|
|
12
11
|
|
|
12
|
+
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
13
|
+
|
|
13
14
|
import { cn } from "../../lib/utils";
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -94,7 +95,6 @@ const TooltipContent = React.forwardRef<
|
|
|
94
95
|
{...props}
|
|
95
96
|
>
|
|
96
97
|
{children}
|
|
97
|
-
|
|
98
98
|
</TooltipPrimitive.Popup>
|
|
99
99
|
</TooltipPrimitive.Positioner>
|
|
100
100
|
);
|
|
@@ -102,4 +102,10 @@ const TooltipContent = React.forwardRef<
|
|
|
102
102
|
);
|
|
103
103
|
TooltipContent.displayName = "TooltipContent";
|
|
104
104
|
|
|
105
|
-
export {
|
|
105
|
+
export {
|
|
106
|
+
Tooltip,
|
|
107
|
+
TooltipContent,
|
|
108
|
+
TooltipPortal,
|
|
109
|
+
TooltipProvider,
|
|
110
|
+
TooltipTrigger,
|
|
111
|
+
};
|
package/src/dev/App.tsx
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import React, { Suspense, lazy, useCallback, useEffect, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
LayersIcon,
|
|
5
|
+
MenuIcon,
|
|
6
|
+
MoonIcon,
|
|
7
|
+
SearchIcon,
|
|
8
|
+
SunIcon,
|
|
9
|
+
XIcon,
|
|
10
|
+
} from "lucide-react";
|
|
11
|
+
|
|
5
12
|
import {
|
|
6
13
|
Command,
|
|
7
14
|
CommandDialog,
|
|
@@ -10,34 +17,30 @@ import {
|
|
|
10
17
|
CommandInput,
|
|
11
18
|
CommandItem,
|
|
12
19
|
CommandList,
|
|
13
|
-
CommandSeparator,
|
|
14
20
|
} from "../components/macro/command-preset";
|
|
21
|
+
import { Button } from "../components/micro/button";
|
|
22
|
+
import { Separator } from "../components/micro/separator";
|
|
23
|
+
import { useTheme } from "../components/micro/theme-provider";
|
|
24
|
+
import { GladvnLogo } from "../dev/components/GladvnLogo";
|
|
15
25
|
import { useDevContext } from "../dev/components/dev-context";
|
|
16
26
|
import { SizeToggle } from "../dev/components/showcase";
|
|
17
|
-
import { GladvnLogo } from "../dev/components/GladvnLogo";
|
|
18
27
|
import { COMPONENTS } from "../dev/data";
|
|
19
28
|
import OverviewSection from "../dev/showcase/overview";
|
|
20
|
-
import {
|
|
21
|
-
LayersIcon,
|
|
22
|
-
MenuIcon,
|
|
23
|
-
XIcon,
|
|
24
|
-
SunIcon,
|
|
25
|
-
MoonIcon,
|
|
26
|
-
SearchIcon,
|
|
27
|
-
} from "lucide-react";
|
|
28
|
-
import React, { Suspense, lazy, useCallback, useEffect, useState } from "react";
|
|
29
29
|
|
|
30
30
|
const components: Record<string, React.LazyExoticComponent<any>> = {};
|
|
31
31
|
COMPONENTS.forEach((comp) => {
|
|
32
32
|
components[comp.id] = lazy(() => import(`./showcase/${comp.id}.tsx`));
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
const groupedComponents = COMPONENTS.reduce(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
const groupedComponents = COMPONENTS.reduce(
|
|
36
|
+
(acc, comp) => {
|
|
37
|
+
const cat = (comp as any).category || "Other";
|
|
38
|
+
if (!acc[cat]) acc[cat] = [];
|
|
39
|
+
acc[cat].push(comp);
|
|
40
|
+
return acc;
|
|
41
|
+
},
|
|
42
|
+
{} as Record<string, (typeof COMPONENTS)[number][]>,
|
|
43
|
+
);
|
|
41
44
|
|
|
42
45
|
const categoryOrder = [
|
|
43
46
|
"Layout & Structure",
|
|
@@ -45,7 +48,7 @@ const categoryOrder = [
|
|
|
45
48
|
"Feedback & Overlays",
|
|
46
49
|
"Navigation",
|
|
47
50
|
"Data Display",
|
|
48
|
-
"Other"
|
|
51
|
+
"Other",
|
|
49
52
|
];
|
|
50
53
|
|
|
51
54
|
function ComponentViewer({ id }: { id: string }) {
|
|
@@ -163,7 +166,10 @@ export default function App() {
|
|
|
163
166
|
<MenuIcon className="size-5" />
|
|
164
167
|
)}
|
|
165
168
|
</button>
|
|
166
|
-
<a
|
|
169
|
+
<a
|
|
170
|
+
href="/"
|
|
171
|
+
className="inline-flex items-center hover:opacity-80 transition-opacity"
|
|
172
|
+
>
|
|
167
173
|
<GladvnLogo variant="wordmark" />
|
|
168
174
|
</a>
|
|
169
175
|
</div>
|
|
@@ -176,7 +182,9 @@ export default function App() {
|
|
|
176
182
|
aria-label="Tìm component (⌘K)"
|
|
177
183
|
>
|
|
178
184
|
<SearchIcon className="size-3.5 shrink-0" />
|
|
179
|
-
<span className="flex-1 text-left text-[13px]">
|
|
185
|
+
<span className="flex-1 text-left text-[13px]">
|
|
186
|
+
Tìm component...
|
|
187
|
+
</span>
|
|
180
188
|
<kbd className="text-[10px] bg-background border border-border/80 rounded px-1.5 py-0.5 font-sans leading-none">
|
|
181
189
|
⌘K
|
|
182
190
|
</kbd>
|
|
@@ -187,23 +195,39 @@ export default function App() {
|
|
|
187
195
|
<Button
|
|
188
196
|
variant="ghost"
|
|
189
197
|
iconOnly
|
|
190
|
-
render={
|
|
198
|
+
render={
|
|
199
|
+
<a
|
|
200
|
+
href="https://github.com/duongacy/gladvn"
|
|
201
|
+
target="_blank"
|
|
202
|
+
rel="noreferrer"
|
|
203
|
+
/>
|
|
204
|
+
}
|
|
191
205
|
nativeButton={false}
|
|
192
206
|
className="text-muted-foreground hover:text-foreground hidden sm:inline-flex"
|
|
193
207
|
>
|
|
194
208
|
{/* GitHub SVG mark */}
|
|
195
|
-
<svg
|
|
209
|
+
<svg
|
|
210
|
+
viewBox="0 0 24 24"
|
|
211
|
+
className="size-4"
|
|
212
|
+
fill="currentColor"
|
|
213
|
+
aria-hidden="true"
|
|
214
|
+
>
|
|
196
215
|
<path d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844a9.59 9.59 0 0 1 2.504.337c1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.02 10.02 0 0 0 22 12.017C22 6.484 17.522 2 12 2z" />
|
|
197
216
|
</svg>
|
|
198
217
|
<span className="sr-only">GitHub</span>
|
|
199
218
|
</Button>
|
|
200
219
|
|
|
201
|
-
<Separator
|
|
220
|
+
<Separator
|
|
221
|
+
orientation="vertical"
|
|
222
|
+
className="h-4 mx-1 hidden sm:block"
|
|
223
|
+
/>
|
|
202
224
|
|
|
203
225
|
<Button
|
|
204
226
|
variant="ghost"
|
|
205
227
|
iconOnly
|
|
206
|
-
onClick={() =>
|
|
228
|
+
onClick={() =>
|
|
229
|
+
theme?.setMode(theme.mode === "light" ? "dark" : "light")
|
|
230
|
+
}
|
|
207
231
|
className="text-muted-foreground hover:text-foreground relative"
|
|
208
232
|
>
|
|
209
233
|
<SunIcon className="size-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
|
|
@@ -226,16 +250,18 @@ export default function App() {
|
|
|
226
250
|
|
|
227
251
|
{/* Sidebar */}
|
|
228
252
|
<aside
|
|
229
|
-
className={`fixed inset-y-0 left-0 z-50 w-64 transform border-r bg-background border-border pt-4 px-3 transition-transform duration-200 ease-in-out md:sticky md:top-16 md:block md:h-[calc(100vh-4rem)] md:w-56 md:translate-x-0 md:pt-6 md:z-0 overflow-y-auto custom-scrollbar ${
|
|
230
|
-
|
|
253
|
+
className={`fixed inset-y-0 left-0 z-50 w-64 transform border-r bg-background border-border pt-4 px-3 transition-transform duration-200 ease-in-out md:sticky md:top-16 md:block md:h-[calc(100vh-4rem)] md:w-56 md:translate-x-0 md:pt-6 md:z-0 overflow-y-auto custom-scrollbar ${
|
|
254
|
+
isMobileMenuOpen ? "translate-x-0 shadow-2xl" : "-translate-x-full"
|
|
255
|
+
}`}
|
|
231
256
|
>
|
|
232
257
|
<nav className="space-y-0.5">
|
|
233
258
|
<button
|
|
234
259
|
onClick={() => setActive("overview")}
|
|
235
|
-
className={`w-full flex items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[13px] transition-colors text-left mb-2 ${
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
260
|
+
className={`w-full flex items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[13px] transition-colors text-left mb-2 ${
|
|
261
|
+
active === "overview"
|
|
262
|
+
? "bg-accent text-accent-foreground font-medium"
|
|
263
|
+
: "text-muted-foreground hover:bg-muted/60 hover:text-foreground"
|
|
264
|
+
}`}
|
|
239
265
|
>
|
|
240
266
|
<LayersIcon className="size-3.5" />
|
|
241
267
|
Overview
|
|
@@ -243,7 +269,7 @@ export default function App() {
|
|
|
243
269
|
</nav>
|
|
244
270
|
|
|
245
271
|
<div className="mt-6">
|
|
246
|
-
{categoryOrder.map(cat => {
|
|
272
|
+
{categoryOrder.map((cat) => {
|
|
247
273
|
const comps = groupedComponents[cat];
|
|
248
274
|
if (!comps || comps.length === 0) return null;
|
|
249
275
|
return (
|
|
@@ -256,10 +282,11 @@ export default function App() {
|
|
|
256
282
|
<button
|
|
257
283
|
key={id}
|
|
258
284
|
onClick={() => setActive(id)}
|
|
259
|
-
className={`w-full flex items-center justify-between gap-2.5 rounded-md px-2.5 py-1.5 text-[13px] transition-colors text-left ${
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
285
|
+
className={`w-full flex items-center justify-between gap-2.5 rounded-md px-2.5 py-1.5 text-[13px] transition-colors text-left ${
|
|
286
|
+
active === id
|
|
287
|
+
? "bg-accent text-accent-foreground font-medium"
|
|
288
|
+
: "text-muted-foreground hover:bg-muted/60 hover:text-foreground"
|
|
289
|
+
}`}
|
|
263
290
|
>
|
|
264
291
|
<span>{label}</span>
|
|
265
292
|
</button>
|
|
@@ -269,8 +296,6 @@ export default function App() {
|
|
|
269
296
|
);
|
|
270
297
|
})}
|
|
271
298
|
</div>
|
|
272
|
-
|
|
273
|
-
|
|
274
299
|
</aside>
|
|
275
300
|
|
|
276
301
|
{/* Main */}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from "react";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { type Highlighter, createHighlighter } from "shiki";
|
|
3
4
|
|
|
4
5
|
// Singleton highlighter — loaded once, reused across all CodeHighlighter instances
|
|
5
6
|
let highlighterPromise: Promise<Highlighter> | null = null;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
|
|
3
|
+
import { BookOpenIcon, CheckIcon, CopyIcon } from "lucide-react";
|
|
4
|
+
|
|
1
5
|
import { Button } from "../../components/micro/button";
|
|
2
6
|
import {
|
|
3
7
|
Tabs,
|
|
@@ -9,9 +13,6 @@ import { CodeHighlighter } from "../../dev/components/code-highlighter";
|
|
|
9
13
|
import { COLORS, COLOR_INFO } from "../../dev/data";
|
|
10
14
|
import { type Size } from "../../lib/types";
|
|
11
15
|
import { cn } from "../../lib/utils";
|
|
12
|
-
import { BookOpenIcon, CheckIcon, CopyIcon } from "lucide-react";
|
|
13
|
-
import React, { useState } from "react";
|
|
14
|
-
|
|
15
16
|
|
|
16
17
|
/* ─────────────────────────────────────────────────────────────────
|
|
17
18
|
SectionHeader – page‐level title bar
|
|
@@ -176,9 +177,7 @@ export function ExampleSection({
|
|
|
176
177
|
)}
|
|
177
178
|
>
|
|
178
179
|
<div className="absolute inset-0 -z-10 opacity-[0.03] dark:opacity-[0.05] [background-size:24px_24px] [background-image:radial-gradient(circle_at_center,var(--color-foreground)_1.5px,transparent_1.5px)]" />
|
|
179
|
-
<div className="relative z-10 w-full">
|
|
180
|
-
{children}
|
|
181
|
-
</div>
|
|
180
|
+
<div className="relative z-10 w-full">{children}</div>
|
|
182
181
|
</div>
|
|
183
182
|
</TabsContent>
|
|
184
183
|
|
|
@@ -358,14 +357,14 @@ export function Showcase({
|
|
|
358
357
|
)}
|
|
359
358
|
{hasTabs
|
|
360
359
|
? tabs.map((tab) => (
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
360
|
+
<TabsContent
|
|
361
|
+
key={tab.label}
|
|
362
|
+
value={tab.label}
|
|
363
|
+
className="mt-0 focus-visible:outline-none"
|
|
364
|
+
>
|
|
365
|
+
{tab.content}
|
|
366
|
+
</TabsContent>
|
|
367
|
+
))
|
|
369
368
|
: tabs[0]?.content}
|
|
370
369
|
</div>
|
|
371
370
|
</>
|