@cl-light-ds/ui 0.1.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/README.md +45 -0
- package/package.json +59 -0
- package/src/components/accordion/Accordion.astro +248 -0
- package/src/components/accordion/AccordionContent.astro +26 -0
- package/src/components/accordion/AccordionItem.astro +36 -0
- package/src/components/accordion/AccordionTrigger.astro +118 -0
- package/src/components/accordion/CHANGELOG.md +41 -0
- package/src/components/accordion/index.ts +4 -0
- package/src/components/alert/Alert.astro +167 -0
- package/src/components/alert/AlertDescription.astro +24 -0
- package/src/components/alert/AlertTitle.astro +24 -0
- package/src/components/alert/CHANGELOG.md +5 -0
- package/src/components/alert/index.ts +4 -0
- package/src/components/avatar/Avatar.astro +197 -0
- package/src/components/avatar/AvatarBadge.astro +44 -0
- package/src/components/avatar/AvatarFallback.astro +26 -0
- package/src/components/avatar/AvatarGroup.astro +26 -0
- package/src/components/avatar/AvatarGroupCount.astro +30 -0
- package/src/components/avatar/AvatarImage.astro +46 -0
- package/src/components/avatar/CHANGELOG.md +44 -0
- package/src/components/avatar/index.ts +6 -0
- package/src/components/badge/Badge.astro +167 -0
- package/src/components/badge/CHANGELOG.md +49 -0
- package/src/components/badge/index.ts +2 -0
- package/src/components/breadcrumb/Breadcrumb.astro +76 -0
- package/src/components/breadcrumb/BreadcrumbItem.astro +32 -0
- package/src/components/breadcrumb/BreadcrumbList.astro +26 -0
- package/src/components/breadcrumb/BreadcrumbSeparator.astro +26 -0
- package/src/components/breadcrumb/CHANGELOG.md +24 -0
- package/src/components/breadcrumb/index.ts +5 -0
- package/src/components/button/Button.astro +233 -0
- package/src/components/button/CHANGELOG.md +41 -0
- package/src/components/button/index.ts +2 -0
- package/src/components/button-group/ButtonGroup.astro +130 -0
- package/src/components/button-group/ButtonGroupSeparator.astro +30 -0
- package/src/components/button-group/ButtonGroupText.astro +21 -0
- package/src/components/button-group/CHANGELOG.md +34 -0
- package/src/components/button-group/index.ts +3 -0
- package/src/components/card/CHANGELOG.md +119 -0
- package/src/components/card/Card.astro +182 -0
- package/src/components/card/CardAction.astro +26 -0
- package/src/components/card/CardContent.astro +28 -0
- package/src/components/card/CardDescription.astro +28 -0
- package/src/components/card/CardFooter.astro +24 -0
- package/src/components/card/CardHeader.astro +30 -0
- package/src/components/card/CardMedia.astro +27 -0
- package/src/components/card/CardOverlay.astro +32 -0
- package/src/components/card/CardTitle.astro +21 -0
- package/src/components/card/index.ts +10 -0
- package/src/components/carousel/CHANGELOG.md +5 -0
- package/src/components/carousel/Carousel.astro +106 -0
- package/src/components/carousel/CarouselSlide.astro +22 -0
- package/src/components/carousel/index.ts +3 -0
- package/src/components/checkbox/CHANGELOG.md +58 -0
- package/src/components/checkbox/Checkbox.astro +159 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/collapsible/CHANGELOG.md +5 -0
- package/src/components/collapsible/Collapsible.astro +202 -0
- package/src/components/collapsible/CollapsibleContent.astro +36 -0
- package/src/components/collapsible/CollapsibleTrigger.astro +34 -0
- package/src/components/collapsible/index.ts +4 -0
- package/src/components/combobox/CHANGELOG.md +27 -0
- package/src/components/combobox/Combobox.astro +365 -0
- package/src/components/combobox/ComboboxContent.astro +37 -0
- package/src/components/combobox/ComboboxEmpty.astro +18 -0
- package/src/components/combobox/ComboboxGroup.astro +19 -0
- package/src/components/combobox/ComboboxInput.astro +74 -0
- package/src/components/combobox/ComboboxItem.astro +39 -0
- package/src/components/combobox/ComboboxLabel.astro +18 -0
- package/src/components/combobox/ComboboxList.astro +21 -0
- package/src/components/combobox/ComboboxSeparator.astro +17 -0
- package/src/components/combobox/ComboboxTrigger.astro +30 -0
- package/src/components/combobox/ComboboxValue.astro +22 -0
- package/src/components/combobox/index.ts +11 -0
- package/src/components/date/CHANGELOG.md +18 -0
- package/src/components/date/Date.astro +137 -0
- package/src/components/date/index.ts +2 -0
- package/src/components/dialog/CHANGELOG.md +39 -0
- package/src/components/dialog/Dialog.astro +196 -0
- package/src/components/dialog/DialogClose.astro +23 -0
- package/src/components/dialog/DialogContent.astro +42 -0
- package/src/components/dialog/DialogDescription.astro +18 -0
- package/src/components/dialog/DialogFooter.astro +18 -0
- package/src/components/dialog/DialogHeader.astro +18 -0
- package/src/components/dialog/DialogOverlay.astro +19 -0
- package/src/components/dialog/DialogTitle.astro +18 -0
- package/src/components/dialog/DialogTrigger.astro +37 -0
- package/src/components/dialog/index.ts +9 -0
- package/src/components/dropdown-menu/CHANGELOG.md +194 -0
- package/src/components/dropdown-menu/DropdownMenu.astro +226 -0
- package/src/components/dropdown-menu/DropdownMenuCheckboxItem.astro +114 -0
- package/src/components/dropdown-menu/DropdownMenuContent.astro +42 -0
- package/src/components/dropdown-menu/DropdownMenuGroup.astro +19 -0
- package/src/components/dropdown-menu/DropdownMenuItem.astro +220 -0
- package/src/components/dropdown-menu/DropdownMenuItemContent.astro +79 -0
- package/src/components/dropdown-menu/DropdownMenuLabel.astro +20 -0
- package/src/components/dropdown-menu/DropdownMenuPortal.astro +13 -0
- package/src/components/dropdown-menu/DropdownMenuRadioGroup.astro +13 -0
- package/src/components/dropdown-menu/DropdownMenuRadioItem.astro +101 -0
- package/src/components/dropdown-menu/DropdownMenuSeparator.astro +18 -0
- package/src/components/dropdown-menu/DropdownMenuShortcut.astro +18 -0
- package/src/components/dropdown-menu/DropdownMenuTrigger.astro +49 -0
- package/src/components/dropdown-menu/dropdown-menu-item-variants.ts +24 -0
- package/src/components/dropdown-menu/index.ts +12 -0
- package/src/components/field/CHANGELOG.md +33 -0
- package/src/components/field/Field.astro +664 -0
- package/src/components/field/FieldContent.astro +20 -0
- package/src/components/field/FieldDescription.astro +22 -0
- package/src/components/field/FieldError.astro +51 -0
- package/src/components/field/FieldGroup.astro +20 -0
- package/src/components/field/FieldLabel.astro +22 -0
- package/src/components/field/FieldLegend.astro +23 -0
- package/src/components/field/FieldSeparator.astro +30 -0
- package/src/components/field/FieldSet.astro +20 -0
- package/src/components/field/FieldTitle.astro +20 -0
- package/src/components/field/index.ts +10 -0
- package/src/components/hover-card/CHANGELOG.md +20 -0
- package/src/components/hover-card/HoverCard.astro +235 -0
- package/src/components/hover-card/HoverCardContent.astro +54 -0
- package/src/components/hover-card/HoverCardTrigger.astro +38 -0
- package/src/components/hover-card/index.ts +3 -0
- package/src/components/input/CHANGELOG.md +29 -0
- package/src/components/input/Input.astro +130 -0
- package/src/components/input/index.ts +2 -0
- package/src/components/input-group/CHANGELOG.md +49 -0
- package/src/components/input-group/InputGroup.astro +135 -0
- package/src/components/input-group/InputGroupAddon.astro +49 -0
- package/src/components/input-group/InputGroupButton.astro +58 -0
- package/src/components/input-group/InputGroupInput.astro +18 -0
- package/src/components/input-group/InputGroupText.astro +21 -0
- package/src/components/input-group/InputGroupTextarea.astro +17 -0
- package/src/components/input-group/controlClasses.ts +2 -0
- package/src/components/input-group/index.ts +6 -0
- package/src/components/item/CHANGELOG.md +27 -0
- package/src/components/item/Item.astro +122 -0
- package/src/components/item/ItemActions.astro +21 -0
- package/src/components/item/ItemContent.astro +25 -0
- package/src/components/item/ItemDescription.astro +25 -0
- package/src/components/item/ItemFooter.astro +24 -0
- package/src/components/item/ItemGroup.astro +24 -0
- package/src/components/item/ItemHeader.astro +24 -0
- package/src/components/item/ItemMedia.astro +47 -0
- package/src/components/item/ItemSeparator.astro +21 -0
- package/src/components/item/ItemTitle.astro +25 -0
- package/src/components/item/index.ts +10 -0
- package/src/components/kbd/CHANGELOG.md +5 -0
- package/src/components/kbd/Kbd.astro +145 -0
- package/src/components/kbd/KbdGroup.astro +55 -0
- package/src/components/kbd/index.ts +2 -0
- package/src/components/label/CHANGELOG.md +28 -0
- package/src/components/label/Label.astro +97 -0
- package/src/components/label/index.ts +2 -0
- package/src/components/link-group/CHANGELOG.md +75 -0
- package/src/components/link-group/LinkGroup.astro +67 -0
- package/src/components/link-group/LinkGroupItem.astro +32 -0
- package/src/components/link-group/LinkGroupList.astro +25 -0
- package/src/components/link-group/LinkGroupTitle.astro +22 -0
- package/src/components/link-group/index.ts +5 -0
- package/src/components/link-group/link-group-list-variants.ts +15 -0
- package/src/components/marquee/CHANGELOG.md +5 -0
- package/src/components/marquee/Marquee.astro +119 -0
- package/src/components/marquee/index.ts +2 -0
- package/src/components/native-select/CHANGELOG.md +5 -0
- package/src/components/native-select/NativeSelect.astro +125 -0
- package/src/components/native-select/NativeSelectOptGroup.astro +14 -0
- package/src/components/native-select/NativeSelectOption.astro +9 -0
- package/src/components/native-select/index.ts +3 -0
- package/src/components/navigation-menu/CHANGELOG.md +63 -0
- package/src/components/navigation-menu/NavigationMenu.astro +414 -0
- package/src/components/navigation-menu/NavigationMenuContent.astro +37 -0
- package/src/components/navigation-menu/NavigationMenuIndicator.astro +24 -0
- package/src/components/navigation-menu/NavigationMenuItem.astro +22 -0
- package/src/components/navigation-menu/NavigationMenuLink.astro +18 -0
- package/src/components/navigation-menu/NavigationMenuList.astro +21 -0
- package/src/components/navigation-menu/NavigationMenuPositioner.astro +44 -0
- package/src/components/navigation-menu/NavigationMenuTrigger.astro +30 -0
- package/src/components/navigation-menu/NavigationMenuViewport.astro +19 -0
- package/src/components/navigation-menu/index.ts +10 -0
- package/src/components/popover/CHANGELOG.md +5 -0
- package/src/components/popover/Popover.astro +210 -0
- package/src/components/popover/PopoverClose.astro +18 -0
- package/src/components/popover/PopoverContent.astro +49 -0
- package/src/components/popover/PopoverDescription.astro +18 -0
- package/src/components/popover/PopoverHeader.astro +18 -0
- package/src/components/popover/PopoverTitle.astro +18 -0
- package/src/components/popover/PopoverTrigger.astro +29 -0
- package/src/components/popover/index.ts +7 -0
- package/src/components/radio-group/CHANGELOG.md +9 -0
- package/src/components/radio-group/RadioGroup.astro +81 -0
- package/src/components/radio-group/RadioGroupItem.astro +42 -0
- package/src/components/radio-group/index.ts +3 -0
- package/src/components/select/CHANGELOG.md +39 -0
- package/src/components/select/Select.astro +373 -0
- package/src/components/select/SelectContent.astro +91 -0
- package/src/components/select/SelectGroup.astro +19 -0
- package/src/components/select/SelectItem.astro +48 -0
- package/src/components/select/SelectLabel.astro +18 -0
- package/src/components/select/SelectSeparator.astro +17 -0
- package/src/components/select/SelectTrigger.astro +34 -0
- package/src/components/select/SelectValue.astro +22 -0
- package/src/components/select/index.ts +8 -0
- package/src/components/separator/CHANGELOG.md +5 -0
- package/src/components/separator/Separator.astro +60 -0
- package/src/components/separator/index.ts +2 -0
- package/src/components/skeleton/CHANGELOG.md +5 -0
- package/src/components/skeleton/Skeleton.astro +121 -0
- package/src/components/skeleton/index.ts +1 -0
- package/src/components/slider/CHANGELOG.md +5 -0
- package/src/components/slider/Slider.astro +198 -0
- package/src/components/slider/index.ts +1 -0
- package/src/components/spinner/CHANGELOG.md +5 -0
- package/src/components/spinner/Spinner.astro +134 -0
- package/src/components/spinner/index.ts +1 -0
- package/src/components/sticky-surface/CHANGELOG.md +5 -0
- package/src/components/sticky-surface/StickySurface.astro +152 -0
- package/src/components/sticky-surface/index.ts +2 -0
- package/src/components/switch/CHANGELOG.md +9 -0
- package/src/components/switch/Switch.astro +106 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/table/CHANGELOG.md +5 -0
- package/src/components/table/Table.astro +250 -0
- package/src/components/table/TableBody.astro +18 -0
- package/src/components/table/TableCaption.astro +17 -0
- package/src/components/table/TableCell.astro +21 -0
- package/src/components/table/TableFooter.astro +21 -0
- package/src/components/table/TableHead.astro +21 -0
- package/src/components/table/TableHeader.astro +17 -0
- package/src/components/table/TableRow.astro +21 -0
- package/src/components/table/index.ts +9 -0
- package/src/components/tabs/CHANGELOG.md +5 -0
- package/src/components/tabs/Tabs.astro +306 -0
- package/src/components/tabs/TabsContent.astro +47 -0
- package/src/components/tabs/TabsList.astro +69 -0
- package/src/components/tabs/TabsTrigger.astro +40 -0
- package/src/components/tabs/index.ts +6 -0
- package/src/components/textarea/CHANGELOG.md +5 -0
- package/src/components/textarea/Textarea.astro +36 -0
- package/src/components/textarea/index.ts +2 -0
- package/src/components/toggle/CHANGELOG.md +5 -0
- package/src/components/toggle/Toggle.astro +138 -0
- package/src/components/toggle/index.ts +1 -0
- package/src/components/toggle-group/CHANGELOG.md +5 -0
- package/src/components/toggle-group/ToggleGroup.astro +224 -0
- package/src/components/toggle-group/ToggleGroupItem.astro +48 -0
- package/src/components/toggle-group/index.ts +2 -0
- package/src/components/tooltip/CHANGELOG.md +5 -0
- package/src/components/tooltip/Tooltip.astro +331 -0
- package/src/components/tooltip/TooltipContent.astro +60 -0
- package/src/components/tooltip/TooltipTrigger.astro +34 -0
- package/src/components/tooltip/index.ts +3 -0
- package/src/lib/toggle-group-controller.ts +113 -0
- package/src/lib/toggle-shared.ts +26 -0
- package/src/lib/utils.ts +6 -0
- package/src/styles/globals.css +177 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { cn } from "@cl-light-ds/ui/lib/utils";
|
|
3
|
+
import type { HTMLAttributes } from "astro/types";
|
|
4
|
+
|
|
5
|
+
interface Props extends HTMLAttributes<"button"> {
|
|
6
|
+
class?: string;
|
|
7
|
+
/** Radix-like: render wrapper so the child can be the interactive element */
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
class: className = "",
|
|
13
|
+
asChild = false,
|
|
14
|
+
type = "button",
|
|
15
|
+
...rest
|
|
16
|
+
} = Astro.props as Props;
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
{
|
|
20
|
+
asChild ? (
|
|
21
|
+
<div data-slot="tooltip-trigger" data-as-child class={cn("", className)}>
|
|
22
|
+
<slot />
|
|
23
|
+
</div>
|
|
24
|
+
) : (
|
|
25
|
+
<button
|
|
26
|
+
{...rest}
|
|
27
|
+
type={type}
|
|
28
|
+
data-slot="tooltip-trigger"
|
|
29
|
+
class={cn("", className)}
|
|
30
|
+
>
|
|
31
|
+
<slot />
|
|
32
|
+
</button>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createToggleGroup as createBaseToggleGroup,
|
|
3
|
+
type ToggleGroupController,
|
|
4
|
+
type ToggleGroupOptions,
|
|
5
|
+
} from "@data-slot/toggle-group";
|
|
6
|
+
import {
|
|
7
|
+
TOGGLE_SIZES,
|
|
8
|
+
TOGGLE_VARIANTS,
|
|
9
|
+
toggleVariants,
|
|
10
|
+
type ToggleSize,
|
|
11
|
+
type ToggleVariant,
|
|
12
|
+
} from "./toggle-shared";
|
|
13
|
+
|
|
14
|
+
type ToggleOrientation = "horizontal" | "vertical";
|
|
15
|
+
|
|
16
|
+
interface ToggleGroupControllerOptions extends ToggleGroupOptions {
|
|
17
|
+
size?: ToggleSize;
|
|
18
|
+
spacing?: number;
|
|
19
|
+
variant?: ToggleVariant;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function parseOrientation(value: string | undefined): ToggleOrientation {
|
|
23
|
+
return value === "vertical" ? "vertical" : "horizontal";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function parseVariant(value: string | undefined): ToggleVariant | null {
|
|
27
|
+
return TOGGLE_VARIANTS.includes(value as ToggleVariant)
|
|
28
|
+
? (value as ToggleVariant)
|
|
29
|
+
: null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function parseSize(value: string | undefined): ToggleSize | null {
|
|
33
|
+
return TOGGLE_SIZES.includes(value as ToggleSize)
|
|
34
|
+
? (value as ToggleSize)
|
|
35
|
+
: null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function parseSpacing(value: string | undefined): number {
|
|
39
|
+
const nextValue = Number(value);
|
|
40
|
+
return Number.isFinite(nextValue) ? nextValue : 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function setPresenceAttribute(
|
|
44
|
+
element: HTMLElement,
|
|
45
|
+
attribute: string,
|
|
46
|
+
active: boolean,
|
|
47
|
+
) {
|
|
48
|
+
if (active) {
|
|
49
|
+
element.setAttribute(attribute, "");
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
element.removeAttribute(attribute);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function syncRootAttributes(
|
|
57
|
+
root: HTMLElement,
|
|
58
|
+
orientation: ToggleOrientation,
|
|
59
|
+
spacing: number,
|
|
60
|
+
) {
|
|
61
|
+
root.dataset.orientation = orientation;
|
|
62
|
+
root.dataset.spacing = String(spacing);
|
|
63
|
+
root.style.setProperty("--gap", String(spacing));
|
|
64
|
+
setPresenceAttribute(root, "data-horizontal", orientation === "horizontal");
|
|
65
|
+
setPresenceAttribute(root, "data-vertical", orientation === "vertical");
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function syncItemAttributes(
|
|
69
|
+
item: HTMLElement,
|
|
70
|
+
variant: ToggleVariant,
|
|
71
|
+
size: ToggleSize,
|
|
72
|
+
spacing: number,
|
|
73
|
+
) {
|
|
74
|
+
const itemVariant = parseVariant(item.dataset.variant) ?? variant;
|
|
75
|
+
const itemSize = parseSize(item.dataset.size) ?? size;
|
|
76
|
+
|
|
77
|
+
item.dataset.variant = itemVariant;
|
|
78
|
+
item.dataset.size = itemSize;
|
|
79
|
+
item.dataset.spacing = String(spacing);
|
|
80
|
+
|
|
81
|
+
for (const className of toggleVariants({
|
|
82
|
+
variant: itemVariant,
|
|
83
|
+
size: itemSize,
|
|
84
|
+
}).split(/\s+/)) {
|
|
85
|
+
if (className) {
|
|
86
|
+
item.classList.add(className);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function createToggleGroup(
|
|
92
|
+
root: HTMLElement,
|
|
93
|
+
options?: ToggleGroupControllerOptions,
|
|
94
|
+
): ToggleGroupController {
|
|
95
|
+
const orientation = parseOrientation(
|
|
96
|
+
options?.orientation ?? root.dataset.orientation,
|
|
97
|
+
);
|
|
98
|
+
const variant = parseVariant(options?.variant ?? root.dataset.variant) ?? "default";
|
|
99
|
+
const size = parseSize(options?.size ?? root.dataset.size) ?? "default";
|
|
100
|
+
const spacing =
|
|
101
|
+
options?.spacing ?? parseSpacing(root.dataset.spacing ?? root.style.getPropertyValue("--gap"));
|
|
102
|
+
|
|
103
|
+
syncRootAttributes(root, orientation, spacing);
|
|
104
|
+
|
|
105
|
+
root
|
|
106
|
+
.querySelectorAll<HTMLElement>('[data-slot="toggle-group-item"]')
|
|
107
|
+
.forEach((item) => syncItemAttributes(item, variant, size, spacing));
|
|
108
|
+
|
|
109
|
+
return createBaseToggleGroup(root, {
|
|
110
|
+
...options,
|
|
111
|
+
orientation,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
export const TOGGLE_VARIANTS = ["default", "outline"] as const;
|
|
4
|
+
export const TOGGLE_SIZES = ["default", "sm", "lg"] as const;
|
|
5
|
+
|
|
6
|
+
export type ToggleVariant = (typeof TOGGLE_VARIANTS)[number];
|
|
7
|
+
export type ToggleSize = (typeof TOGGLE_SIZES)[number];
|
|
8
|
+
|
|
9
|
+
export const toggleVariants = cva(
|
|
10
|
+
"hover:text-foreground aria-pressed:bg-background-hover focus-visible:border-ring focus-visible:ring-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive gap-1 rounded-md text-sm font-medium transition-[color,box-shadow] [&_svg:not([class*='size-'])]:size-4 group/toggle inline-flex items-center justify-center whitespace-nowrap outline-none hover:bg-background-hover focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
default: "bg-transparent",
|
|
15
|
+
outline: "border-input hover:bg-background-hover border bg-transparent shadow-xs",
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
default: "h-9 min-w-9 px-2",
|
|
19
|
+
sm: "h-8 min-w-8 px-1.5",
|
|
20
|
+
lg: "h-10 min-w-10 px-2.5",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export type ToggleVariantProps = VariantProps<typeof toggleVariants>;
|
package/src/lib/utils.ts
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
@import "tw-animate-css";
|
|
3
|
+
@import "bejamas/tailwind.css";
|
|
4
|
+
|
|
5
|
+
@source "../../../apps/**/*.{ts,tsx,astro}";
|
|
6
|
+
@source "../../../components/**/*.{ts,tsx,astro}";
|
|
7
|
+
@source "../**/*.{ts,tsx,astro}";
|
|
8
|
+
|
|
9
|
+
@custom-variant dark (&:is(.dark *));
|
|
10
|
+
|
|
11
|
+
@theme inline {
|
|
12
|
+
--font-sans: var(--font-sans);
|
|
13
|
+
--font-heading: var(--font-heading);
|
|
14
|
+
--radius-xs: var(--radius-xs);
|
|
15
|
+
--radius-sm: var(--radius-sm);
|
|
16
|
+
--radius-md: var(--radius-md);
|
|
17
|
+
--radius-lg: var(--radius-lg);
|
|
18
|
+
--radius-xl: var(--radius-xl);
|
|
19
|
+
--radius-card: var(--radius-card);
|
|
20
|
+
--color-background: var(--background);
|
|
21
|
+
--color-foreground: var(--foreground);
|
|
22
|
+
--color-card: var(--card);
|
|
23
|
+
--color-card-foreground: var(--card-foreground);
|
|
24
|
+
--color-popover: var(--popover);
|
|
25
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
26
|
+
--color-primary: var(--primary);
|
|
27
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
28
|
+
--color-secondary: var(--secondary);
|
|
29
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
30
|
+
--color-muted: var(--muted);
|
|
31
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
32
|
+
--color-accent: var(--accent);
|
|
33
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
34
|
+
--color-destructive: var(--destructive);
|
|
35
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
36
|
+
--color-success: var(--success);
|
|
37
|
+
--color-success-foreground: var(--success-foreground);
|
|
38
|
+
--color-badge-success: var(--badge-success);
|
|
39
|
+
--color-badge-success-foreground: var(--badge-success-foreground);
|
|
40
|
+
--color-badge-warning: var(--badge-warning);
|
|
41
|
+
--color-badge-warning-foreground: var(--badge-warning-foreground);
|
|
42
|
+
--color-badge-accent: var(--badge-accent);
|
|
43
|
+
--color-badge-accent-foreground: var(--badge-accent-foreground);
|
|
44
|
+
--color-badge-accent-hover: var(--badge-accent-hover);
|
|
45
|
+
--color-background-button-hover: var(--background-button-hover);
|
|
46
|
+
--color-destructive-hover: var(--destructive-hover);
|
|
47
|
+
--color-background-hover: var(--background-hover);
|
|
48
|
+
--color-background-light: var(--background-light);
|
|
49
|
+
--color-border: var(--border);
|
|
50
|
+
--color-input: var(--input);
|
|
51
|
+
--color-ring: var(--ring);
|
|
52
|
+
--color-chart-1: var(--chart-1);
|
|
53
|
+
--color-chart-2: var(--chart-2);
|
|
54
|
+
--color-chart-3: var(--chart-3);
|
|
55
|
+
--color-chart-4: var(--chart-4);
|
|
56
|
+
--color-chart-5: var(--chart-5);
|
|
57
|
+
--color-slider-background-disabled: var(--slider-background-disabled);
|
|
58
|
+
--color-slider-dot-background-disabled: var(--slider-dot-background-disabled);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:root {
|
|
62
|
+
--font-heading: var(--font-sans);
|
|
63
|
+
--primary-50: #ebf3fc;
|
|
64
|
+
--primary-100: #d7e7f9;
|
|
65
|
+
--primary-200: #afcef3;
|
|
66
|
+
--primary-300: #87b6ec;
|
|
67
|
+
--primary-400: #5f9de6;
|
|
68
|
+
--primary-500: #3785e0;
|
|
69
|
+
--primary-600: #2873cc;
|
|
70
|
+
--primary-700: #1f5faa;
|
|
71
|
+
--primary-800: #0e417e;
|
|
72
|
+
--primary-900: #103158;
|
|
73
|
+
--primary-950: #112843;
|
|
74
|
+
--background: var(--color-white);
|
|
75
|
+
--foreground: var(--color-zinc-950);
|
|
76
|
+
--card: var(--color-white);
|
|
77
|
+
--card-foreground: var(--color-zinc-950);
|
|
78
|
+
--popover: var(--color-white);
|
|
79
|
+
--popover-foreground: var(--color-zinc-950);
|
|
80
|
+
--primary: var(--primary-500);
|
|
81
|
+
--primary-foreground: var(--color-white);
|
|
82
|
+
--secondary: var(--color-zinc-100);
|
|
83
|
+
--secondary-foreground: var(--color-zinc-900);
|
|
84
|
+
--muted: var(--color-zinc-100);
|
|
85
|
+
--muted-foreground: var(--color-zinc-500);
|
|
86
|
+
--accent: oklch(0.97 0 0);
|
|
87
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
88
|
+
--destructive: var(--color-red-600);
|
|
89
|
+
--destructive-foreground: var(--color-white);
|
|
90
|
+
--success: var(--color-green-600);
|
|
91
|
+
--success-foreground: var(--color-white);
|
|
92
|
+
--badge-success: var(--color-green-700);
|
|
93
|
+
--badge-success-foreground: var(--color-white);
|
|
94
|
+
--badge-warning: var(--color-yellow-500);
|
|
95
|
+
--badge-warning-foreground: var(--color-white);
|
|
96
|
+
--badge-accent: var(--primary-50);
|
|
97
|
+
--badge-accent-foreground: var(--primary-950);
|
|
98
|
+
--badge-accent-hover: var(--primary-100);
|
|
99
|
+
--background-button-hover: var(--color-zinc-200);
|
|
100
|
+
--destructive-hover: var(--color-red-500);
|
|
101
|
+
--background-hover: var(--color-zinc-100);
|
|
102
|
+
--background-light: var(--primary-100);
|
|
103
|
+
--border: var(--color-zinc-200);
|
|
104
|
+
--input: var(--color-zinc-200);
|
|
105
|
+
--ring: var(--primary-400);
|
|
106
|
+
--chart-1: var(--primary-200);
|
|
107
|
+
--chart-2: var(--primary-400);
|
|
108
|
+
--chart-3: var(--primary-500);
|
|
109
|
+
--chart-4: var(--primary-700);
|
|
110
|
+
--chart-5: var(--primary-900);
|
|
111
|
+
--slider-background-disabled: color-mix(in oklab, var(--primary) 40%, transparent);
|
|
112
|
+
--slider-dot-background-disabled: color-mix(in oklab, var(--background) 40%, transparent);
|
|
113
|
+
--radius: 0.625rem;
|
|
114
|
+
--radius-xs: 0.125rem;
|
|
115
|
+
--radius-sm: 0.25rem;
|
|
116
|
+
--radius-md: 0.375rem;
|
|
117
|
+
--radius-lg: 0.5rem;
|
|
118
|
+
--radius-xl: 0.875rem;
|
|
119
|
+
--radius-card: 1.5rem;
|
|
120
|
+
--sidebar: oklch(0.985 0 0);
|
|
121
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
122
|
+
--sidebar-primary: oklch(0.4634 0.2647 264.76);
|
|
123
|
+
--sidebar-primary-foreground: oklch(0.97 0.014 264.76);
|
|
124
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
125
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
126
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
127
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.dark {
|
|
131
|
+
--background: oklch(0.145 0 0);
|
|
132
|
+
--foreground: oklch(0.985 0 0);
|
|
133
|
+
--card: oklch(0.205 0 0);
|
|
134
|
+
--card-foreground: oklch(0.985 0 0);
|
|
135
|
+
--popover: oklch(0.205 0 0);
|
|
136
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
137
|
+
--primary: var(--primary);
|
|
138
|
+
--primary-foreground: oklch(0.97 0.014 264.76);
|
|
139
|
+
--secondary: oklch(0.274 0.006 286.033);
|
|
140
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
141
|
+
--muted: oklch(0.269 0 0);
|
|
142
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
143
|
+
--accent: oklch(0.371 0 0);
|
|
144
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
145
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
146
|
+
--border: oklch(1 0 0 / 10%);
|
|
147
|
+
--input: oklch(1 0 0 / 15%);
|
|
148
|
+
--ring: oklch(0.556 0 0);
|
|
149
|
+
--chart-1: oklch(0.729 0.132 267.96);
|
|
150
|
+
--chart-2: oklch(0.579 0.237 266.56);
|
|
151
|
+
--chart-3: oklch(0.493 0.277 263.66);
|
|
152
|
+
--chart-4: oklch(0.463 0.265 264.76);
|
|
153
|
+
--chart-5: oklch(0.373 0.213 261.56);
|
|
154
|
+
--sidebar: oklch(0.205 0 0);
|
|
155
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
156
|
+
--sidebar-primary: oklch(0.4634 0.2647 264.76);
|
|
157
|
+
--sidebar-primary-foreground: oklch(0.97 0.014 264.76);
|
|
158
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
159
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
160
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
161
|
+
--sidebar-ring: oklch(0.556 0 0);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@layer base {
|
|
165
|
+
* {
|
|
166
|
+
@apply border-border outline-ring/50;
|
|
167
|
+
}
|
|
168
|
+
body {
|
|
169
|
+
@apply bg-background text-foreground;
|
|
170
|
+
}
|
|
171
|
+
.cn-font-heading {
|
|
172
|
+
@apply font-heading;
|
|
173
|
+
}
|
|
174
|
+
html {
|
|
175
|
+
@apply font-sans;
|
|
176
|
+
}
|
|
177
|
+
}
|