@cl-light-ds/ui 0.1.0 → 0.3.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/package.json +1 -1
- package/src/components/accordion/CHANGELOG.md +41 -41
- package/src/components/accordion/index.ts +4 -4
- package/src/components/alert/CHANGELOG.md +5 -5
- package/src/components/alert/index.ts +4 -4
- package/src/components/avatar/CHANGELOG.md +44 -44
- package/src/components/avatar/index.ts +6 -6
- package/src/components/badge/CHANGELOG.md +49 -49
- package/src/components/badge/index.ts +2 -2
- package/src/components/breadcrumb/CHANGELOG.md +24 -24
- package/src/components/breadcrumb/index.ts +5 -5
- package/src/components/button/CHANGELOG.md +41 -41
- package/src/components/button/index.ts +2 -2
- package/src/components/button-group/CHANGELOG.md +34 -34
- package/src/components/button-group/index.ts +3 -3
- package/src/components/card/CHANGELOG.md +162 -119
- package/src/components/card/Card.astro +23 -8
- package/src/components/card/CardContent.astro +1 -1
- package/src/components/card/CardDescription.astro +1 -1
- package/src/components/card/CardMedia.astro +1 -1
- package/src/components/card/CardMediaActions.astro +21 -0
- package/src/components/card/CardMediaSelect.astro +21 -0
- package/src/components/card/index.ts +12 -10
- package/src/components/carousel/CHANGELOG.md +5 -5
- package/src/components/carousel/index.ts +3 -3
- package/src/components/checkbox/CHANGELOG.md +58 -58
- package/src/components/checkbox/Checkbox.astro +2 -2
- package/src/components/checkbox/index.ts +1 -1
- package/src/components/collapsible/CHANGELOG.md +5 -5
- package/src/components/collapsible/index.ts +4 -4
- package/src/components/combobox/CHANGELOG.md +27 -27
- package/src/components/combobox/index.ts +11 -11
- package/src/components/date/CHANGELOG.md +18 -18
- package/src/components/date/index.ts +2 -2
- package/src/components/dialog/CHANGELOG.md +39 -39
- package/src/components/dialog/index.ts +9 -9
- package/src/components/dropdown-menu/CHANGELOG.md +194 -194
- package/src/components/dropdown-menu/DropdownMenuItemContent.astro +79 -79
- package/src/components/dropdown-menu/DropdownMenuPortal.astro +13 -13
- package/src/components/dropdown-menu/DropdownMenuRadioGroup.astro +13 -13
- package/src/components/dropdown-menu/dropdown-menu-item-variants.ts +24 -24
- package/src/components/dropdown-menu/index.ts +12 -12
- package/src/components/field/CHANGELOG.md +33 -33
- package/src/components/field/index.ts +10 -10
- package/src/components/hover-card/CHANGELOG.md +20 -20
- package/src/components/hover-card/index.ts +3 -3
- package/src/components/input/CHANGELOG.md +29 -29
- package/src/components/input/index.ts +2 -2
- package/src/components/input-group/CHANGELOG.md +49 -49
- package/src/components/input-group/controlClasses.ts +2 -2
- package/src/components/input-group/index.ts +6 -6
- package/src/components/item/CHANGELOG.md +27 -27
- package/src/components/item/index.ts +10 -10
- package/src/components/kbd/CHANGELOG.md +5 -5
- package/src/components/kbd/index.ts +2 -2
- package/src/components/label/CHANGELOG.md +28 -28
- package/src/components/label/index.ts +2 -2
- package/src/components/link-group/CHANGELOG.md +75 -75
- package/src/components/link-group/index.ts +5 -5
- package/src/components/link-group/link-group-list-variants.ts +15 -15
- package/src/components/marquee/CHANGELOG.md +5 -5
- package/src/components/marquee/index.ts +2 -2
- package/src/components/native-select/CHANGELOG.md +5 -5
- package/src/components/native-select/NativeSelectOption.astro +9 -9
- package/src/components/native-select/index.ts +3 -3
- package/src/components/navigation-menu/CHANGELOG.md +63 -63
- package/src/components/navigation-menu/index.ts +10 -10
- package/src/components/organisms/lightning-sidebar-nav/CHANGELOG.md +50 -0
- package/src/components/organisms/lightning-sidebar-nav/LightningSidebarNav.astro +176 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNav.astro +50 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavGroup.astro +74 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavItem.astro +94 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavProBadge.astro +26 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavSection.astro +71 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavSkeleton.astro +67 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavSubItem.astro +69 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavUsage.astro +78 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavWorkspaceAvatar.astro +46 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavWorkspaceSwitcher.astro +130 -0
- package/src/components/organisms/lightning-sidebar-nav/icons.ts +46 -0
- package/src/components/organisms/lightning-sidebar-nav/index.ts +18 -0
- package/src/components/organisms/lightning-sidebar-nav/types.ts +77 -0
- package/src/components/popover/CHANGELOG.md +20 -5
- package/src/components/popover/Popover.astro +1 -0
- package/src/components/popover/PopoverContent.astro +6 -5
- package/src/components/popover/PopoverHeader.astro +1 -1
- package/src/components/popover/PopoverTrigger.astro +7 -1
- package/src/components/popover/index.ts +7 -7
- package/src/components/radio-group/CHANGELOG.md +31 -9
- package/src/components/radio-group/RadioGroup.astro +1 -1
- package/src/components/radio-group/RadioGroupItem.astro +12 -3
- package/src/components/radio-group/index.ts +3 -3
- package/src/components/select/CHANGELOG.md +39 -39
- package/src/components/select/index.ts +8 -8
- package/src/components/separator/CHANGELOG.md +5 -5
- package/src/components/separator/index.ts +2 -2
- package/src/components/skeleton/CHANGELOG.md +5 -5
- package/src/components/skeleton/index.ts +1 -1
- package/src/components/slider/CHANGELOG.md +5 -5
- package/src/components/slider/index.ts +1 -1
- package/src/components/spinner/CHANGELOG.md +18 -5
- package/src/components/spinner/Spinner.astro +3 -2
- package/src/components/spinner/index.ts +1 -1
- package/src/components/sticky-surface/CHANGELOG.md +5 -5
- package/src/components/sticky-surface/index.ts +2 -2
- package/src/components/switch/CHANGELOG.md +29 -9
- package/src/components/switch/Switch.astro +4 -4
- package/src/components/switch/index.ts +1 -1
- package/src/components/table/CHANGELOG.md +24 -5
- package/src/components/table/Table.astro +120 -12
- package/src/components/table/TableBody.astro +1 -2
- package/src/components/table/TableBulkToolbar.astro +37 -0
- package/src/components/table/TableCell.astro +25 -1
- package/src/components/table/TableCellText.astro +17 -0
- package/src/components/table/TableColumnMenu.astro +50 -0
- package/src/components/table/TableEditableCell.astro +287 -0
- package/src/components/table/TableEmpty.astro +17 -0
- package/src/components/table/TableFolderCell.astro +38 -0
- package/src/components/table/TableFooter.astro +1 -1
- package/src/components/table/TableHead.astro +71 -2
- package/src/components/table/TableHeader.astro +1 -1
- package/src/components/table/TablePagination.astro +57 -0
- package/src/components/table/TableRow.astro +32 -1
- package/src/components/table/TableSelectAllBanner.astro +34 -0
- package/src/components/table/TableSelectCell.astro +50 -0
- package/src/components/table/TableSkeletonRow.astro +21 -0
- package/src/components/table/index.ts +19 -9
- package/src/components/table/table-cell-variants.ts +29 -0
- package/src/components/tabs/CHANGELOG.md +5 -5
- package/src/components/tabs/index.ts +6 -6
- package/src/components/textarea/CHANGELOG.md +22 -5
- package/src/components/textarea/Textarea.astro +25 -3
- package/src/components/textarea/index.ts +2 -2
- package/src/components/toggle/CHANGELOG.md +23 -5
- package/src/components/toggle/Toggle.astro +13 -1
- package/src/components/toggle/index.ts +1 -1
- package/src/components/toggle-group/CHANGELOG.md +18 -5
- package/src/components/toggle-group/ToggleGroup.astro +14 -2
- package/src/components/toggle-group/index.ts +2 -2
- package/src/components/tooltip/CHANGELOG.md +22 -5
- package/src/components/tooltip/Tooltip.astro +26 -0
- package/src/components/tooltip/TooltipContent.astro +34 -9
- package/src/components/tooltip/index.ts +3 -3
- package/src/lib/table-controller.ts +1090 -0
- package/src/lib/toggle-group-controller.ts +113 -113
- package/src/lib/toggle-shared.ts +27 -26
- package/src/lib/utils.ts +6 -6
- package/src/styles/globals.css +197 -177
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { cn } from "@cl-light-ds/ui/lib/utils";
|
|
3
|
+
import type { HTMLAttributes } from "astro/types";
|
|
4
|
+
import { Checkbox } from "../checkbox";
|
|
5
|
+
import { cellBase } from "./table-cell-variants";
|
|
6
|
+
|
|
7
|
+
interface Props extends HTMLAttributes<"td"> {
|
|
8
|
+
class?: string;
|
|
9
|
+
/** Renders the header "select all on this page" checkbox in a `<th>`. */
|
|
10
|
+
header?: boolean;
|
|
11
|
+
checked?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Accessible label. Defaults to "Select all rows" / "Select row". */
|
|
14
|
+
label?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
class: className = "",
|
|
19
|
+
header = false,
|
|
20
|
+
checked = false,
|
|
21
|
+
disabled = false,
|
|
22
|
+
label = header ? "Select all rows" : "Select row",
|
|
23
|
+
...rest
|
|
24
|
+
} = Astro.props as Props;
|
|
25
|
+
|
|
26
|
+
const Tag = header ? "th" : "td";
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
<Tag
|
|
30
|
+
data-slot={header ? "table-head" : "table-cell"}
|
|
31
|
+
data-select-cell
|
|
32
|
+
scope={header ? "col" : undefined}
|
|
33
|
+
class={cn(
|
|
34
|
+
cellBase,
|
|
35
|
+
"w-15 text-center",
|
|
36
|
+
header
|
|
37
|
+
? "h-11 bg-muted group-data-[sticky-header]/table:sticky group-data-[sticky-header]/table:top-0 group-data-[sticky-header]/table:z-10 data-[pinned]:z-20 data-[pinned]:bg-muted"
|
|
38
|
+
: "h-12 py-2",
|
|
39
|
+
className,
|
|
40
|
+
)}
|
|
41
|
+
{...rest}
|
|
42
|
+
>
|
|
43
|
+
<Checkbox
|
|
44
|
+
data-table-select={header ? "all" : "row"}
|
|
45
|
+
aria-label={label}
|
|
46
|
+
checked={checked}
|
|
47
|
+
disabled={disabled}
|
|
48
|
+
class="align-middle"
|
|
49
|
+
/>
|
|
50
|
+
</Tag>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { cn } from "@cl-light-ds/ui/lib/utils";
|
|
3
|
+
import { Skeleton } from "../skeleton";
|
|
4
|
+
import { cellBase } from "./table-cell-variants";
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
/** Number of cells to render. */
|
|
8
|
+
columns: number;
|
|
9
|
+
class?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const { columns, class: className = "" } = Astro.props as Props;
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<tr data-slot="table-skeleton-row" aria-hidden="true" class={cn("bg-background", className)}>
|
|
16
|
+
{Array.from({ length: columns }, (_, i) => (
|
|
17
|
+
<td class={cn(cellBase, "h-12 py-2")}>
|
|
18
|
+
<Skeleton class={i === 0 ? "mx-auto size-4 rounded-sm" : "h-4 w-full max-w-32"} />
|
|
19
|
+
</td>
|
|
20
|
+
))}
|
|
21
|
+
</tr>
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
export { default as Table } from "./Table.astro";
|
|
2
|
-
export { default as TableHeader } from "./TableHeader.astro";
|
|
3
|
-
export { default as TableBody } from "./TableBody.astro";
|
|
4
|
-
export { default as TableFooter } from "./TableFooter.astro";
|
|
5
|
-
export { default as TableHead } from "./TableHead.astro";
|
|
6
|
-
export { default as TableRow } from "./TableRow.astro";
|
|
7
|
-
export { default as TableCell } from "./TableCell.astro";
|
|
8
|
-
export { default as TableCaption } from "./TableCaption.astro";
|
|
9
|
-
|
|
1
|
+
export { default as Table } from "./Table.astro";
|
|
2
|
+
export { default as TableHeader } from "./TableHeader.astro";
|
|
3
|
+
export { default as TableBody } from "./TableBody.astro";
|
|
4
|
+
export { default as TableFooter } from "./TableFooter.astro";
|
|
5
|
+
export { default as TableHead } from "./TableHead.astro";
|
|
6
|
+
export { default as TableRow } from "./TableRow.astro";
|
|
7
|
+
export { default as TableCell } from "./TableCell.astro";
|
|
8
|
+
export { default as TableCaption } from "./TableCaption.astro";
|
|
9
|
+
export { default as TableCellText } from "./TableCellText.astro";
|
|
10
|
+
export { default as TableEditableCell } from "./TableEditableCell.astro";
|
|
11
|
+
export { default as TableFolderCell } from "./TableFolderCell.astro";
|
|
12
|
+
export { default as TableSelectCell } from "./TableSelectCell.astro";
|
|
13
|
+
export { default as TableBulkToolbar } from "./TableBulkToolbar.astro";
|
|
14
|
+
export { default as TableSelectAllBanner } from "./TableSelectAllBanner.astro";
|
|
15
|
+
export { default as TablePagination } from "./TablePagination.astro";
|
|
16
|
+
export { default as TableColumnMenu } from "./TableColumnMenu.astro";
|
|
17
|
+
export { default as TableSkeletonRow } from "./TableSkeletonRow.astro";
|
|
18
|
+
export { default as TableEmpty } from "./TableEmpty.astro";
|
|
19
|
+
export type { TableCellOption } from "./TableEditableCell.astro";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
/** Shared padding, borders and pinning for header and data cells. */
|
|
4
|
+
export const cellBase = [
|
|
5
|
+
"relative border-b border-border px-4 align-middle whitespace-nowrap first:pl-6 last:pr-6",
|
|
6
|
+
"outline-none focus-visible:z-[2] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
|
|
7
|
+
"data-[pinned]:sticky data-[pinned]:z-[1] data-[pinned]:bg-inherit data-[pinned-last]:shadow-[inset_-1px_0_0_var(--border)]",
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
export const cellAlign = cva("", {
|
|
11
|
+
variants: {
|
|
12
|
+
align: {
|
|
13
|
+
left: "text-left",
|
|
14
|
+
center: "text-center",
|
|
15
|
+
right: "text-right",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
align: "left",
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export type CellAlign = "left" | "center" | "right";
|
|
24
|
+
|
|
25
|
+
/** Indent for nested rows: 20px per level, matching the Figma folder tree. */
|
|
26
|
+
export function levelIndentStyle(level: number | undefined): string | undefined {
|
|
27
|
+
if (!level || level <= 1) return undefined;
|
|
28
|
+
return `padding-inline-start: calc(1rem + ${(level - 1) * 1.25}rem)`;
|
|
29
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to the `Tabs` component will be documented in this file.
|
|
4
|
-
|
|
5
|
-
## Unreleased
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the `Tabs` component will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default as Tabs } from "./Tabs.astro";
|
|
2
|
-
export { default as TabsList } from "./TabsList.astro";
|
|
3
|
-
export { default as TabsTrigger } from "./TabsTrigger.astro";
|
|
4
|
-
export { default as TabsContent } from "./TabsContent.astro";
|
|
5
|
-
export { tabsListVariants } from "./TabsList.astro";
|
|
6
|
-
export { tabsContentVariants } from "./TabsContent.astro";
|
|
1
|
+
export { default as Tabs } from "./Tabs.astro";
|
|
2
|
+
export { default as TabsList } from "./TabsList.astro";
|
|
3
|
+
export { default as TabsTrigger } from "./TabsTrigger.astro";
|
|
4
|
+
export { default as TabsContent } from "./TabsContent.astro";
|
|
5
|
+
export { tabsListVariants } from "./TabsList.astro";
|
|
6
|
+
export { tabsContentVariants } from "./TabsContent.astro";
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to the `Textarea` component will be documented in this file.
|
|
4
|
-
|
|
5
|
-
##
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the `Textarea` component will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## 2026-09-18 — Figma alignment (ClickLearn Lightning Design Library, node `144-2`)
|
|
6
|
+
|
|
7
|
+
Figma documents Textarea across four pages: Contents (Clean, Label, "Actionable with resize mode", All details), States (Default, Hover, Pressed/Focus, Disabled), and Sizes (Simple, Actionable).
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Updated `@figmaUrl` from the old Bejamas file to the ClickLearn Lightning Design Library link.
|
|
12
|
+
- Background: `bg-transparent dark:bg-input/30` → `bg-card` — same recurring fix as `Input`/`InputGroup`/`DialogContent` (no light-mode background was set at all).
|
|
13
|
+
- Font weight: removed `font-semibold` — Figma specifies Regular (400), not Semi Bold; there was no reason for a plain textarea's typed text to be bold.
|
|
14
|
+
- Removed a dead duplicate `px-2.5` (a later `px-3` in the same class string always won anyway).
|
|
15
|
+
- `py-2` (8px) → `py-2.5` (10px), matching Figma's `padding/p-2.5` token (consistent across every Textarea instance checked).
|
|
16
|
+
- Disabled: `disabled:opacity-50` → `disabled:bg-muted disabled:text-muted-foreground` (kept `disabled:cursor-not-allowed`) — a real flat-color swap, matching Figma's Disabled screenshot and the same category of fix already made to `Checkbox`/`Input`.
|
|
17
|
+
|
|
18
|
+
### Notes (answering the "toolbar prop" question)
|
|
19
|
+
|
|
20
|
+
- Checked bejamas' own upstream `Textarea.astro` (via `gh api`) — it's a bare `<textarea>` with no toolbar concept whatsoever, so this isn't something to port from there.
|
|
21
|
+
- Figma's "Actionable" size is a **composition**, not a `Textarea`-level concern: it's the exact same `InputGroup` + `InputGroupTextarea` + `InputGroupAddon(align="block-start")` pattern already built and verified for `InputGroup`'s own toolbar example (same shared border, block-start divider). No `toolbar` prop was added to `Textarea` — added a storybook example demonstrating the composition instead, plus a note pointing at `InputGroup` for the full API.
|
|
22
|
+
- Focus ring (`border-ring`/`ring-3 ring-ring/50`), border color (`border-input`), and radius (`rounded-lg`) already matched Figma's tokens exactly — no changes needed.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @component Textarea
|
|
4
4
|
* @title Textarea
|
|
5
5
|
* @description A multi-line input field for longer user content.
|
|
6
|
-
* @figmaUrl https://www.figma.com/design/
|
|
6
|
+
* @figmaUrl https://www.figma.com/design/qXkzdqZ3QPQqgckU3AwIAH/ClickLearn-Lightning-Design-Library?node-id=144-2
|
|
7
7
|
* @status stable
|
|
8
8
|
* @since 0.1.0
|
|
9
9
|
*
|
|
@@ -20,17 +20,39 @@
|
|
|
20
20
|
*
|
|
21
21
|
* <Textarea placeholder="Type your message here..." />
|
|
22
22
|
* ```
|
|
23
|
+
*
|
|
24
|
+
* @examples
|
|
25
|
+
*
|
|
26
|
+
* ### Actionable (with toolbar)
|
|
27
|
+
*
|
|
28
|
+
* Figma's "Actionable" size is a composition, not a `Textarea` prop — build it with
|
|
29
|
+
* `InputGroup` + `InputGroupTextarea` + a `block-start` `InputGroupAddon`, the same
|
|
30
|
+
* pattern already used for InputGroup's own toolbar example.
|
|
31
|
+
*
|
|
32
|
+
* <InputGroup>
|
|
33
|
+
* <InputGroupTextarea placeholder="Type your message here..." />
|
|
34
|
+
* <InputGroupAddon align="block-start">
|
|
35
|
+
* <InputGroupButton size="icon-xs"><BoldIcon /></InputGroupButton>
|
|
36
|
+
* <InputGroupButton size="icon-xs"><ItalicIcon /></InputGroupButton>
|
|
37
|
+
* <InputGroupButton size="icon-xs"><UnderlineIcon /></InputGroupButton>
|
|
38
|
+
* <Separator orientation="vertical" class="!h-4" />
|
|
39
|
+
* <InputGroupButton size="icon-xs"><ListIcon /></InputGroupButton>
|
|
40
|
+
* <InputGroupButton size="icon-xs"><ImageIcon /></InputGroupButton>
|
|
41
|
+
* <Separator orientation="vertical" class="!h-4" />
|
|
42
|
+
* <InputGroupButton size="icon-xs"><EllipsisIcon /></InputGroupButton>
|
|
43
|
+
* </InputGroupAddon>
|
|
44
|
+
* </InputGroup>
|
|
23
45
|
*/
|
|
24
46
|
|
|
25
47
|
const { class: className = "", ...props } = Astro.props;
|
|
26
48
|
|
|
27
49
|
const baseClass =
|
|
28
|
-
"flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed
|
|
50
|
+
"flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed";
|
|
29
51
|
|
|
30
52
|
import { cn } from "@cl-light-ds/ui/lib/utils";
|
|
31
53
|
---
|
|
32
54
|
|
|
33
55
|
<textarea
|
|
34
56
|
data-slot={props["data-slot"] ?? "textarea"}
|
|
35
|
-
class={cn("border-input
|
|
57
|
+
class={cn("border-input bg-card focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-muted disabled:text-muted-foreground rounded-lg border px-3 py-2.5 text-base shadow-xs transition-[color,box-shadow] focus-visible:ring-3 aria-invalid:ring-3 md:text-sm", baseClass, className)}
|
|
36
58
|
{...props}></textarea>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Textarea } from "./Textarea.astro";
|
|
2
|
-
|
|
1
|
+
export { default as Textarea } from "./Textarea.astro";
|
|
2
|
+
|
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to the `Toggle` component will be documented in this file.
|
|
4
|
-
|
|
5
|
-
##
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the `Toggle` component will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## 2026-09-18 — Figma alignment (ClickLearn Lightning Design Library, node `5455-19034`)
|
|
6
|
+
|
|
7
|
+
Figma documents Toggle across four pages: Contents (Default, Clean, Tail Icon, Complex), States (Default, Hover, Pressed, Focus Default, Focus Pressed, Disabled), and Sizes (Small 28px, Medium 32px, Large 36px). Sizing/variant fixes live in the shared `toggleVariants` (`packages/ui/src/lib/toggle-shared.ts`), used by both `Toggle` and `ToggleGroup`.
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Added the missing `@figmaUrl`.
|
|
12
|
+
- **Default variant**: Figma's "Default" (unpressed) state renders as a bordered button — matching what the code calls `outline`, not the code's own bare/borderless `default` variant. Every existing usage example already passed `variant="outline"` explicitly, so changed the component's own default to `"outline"` — visually a no-op for existing usages, just removes the need to repeat the prop.
|
|
13
|
+
- **Sizes**: Figma's three sizes (28/32/36px) turned out to be the existing `sm`(32px, was mislabeled relative to Figma's "Medium")/`default`(36px, Figma's "Large") tiers shifted down one notch, with Figma's smallest size (28px) missing entirely. Added a new `size="xs"` (28px, `h-7`) to `toggle-shared.ts`. The code's own `lg` (40px) has no Figma equivalent — flagging per the recurring size-naming pattern (Accordion/Checkbox/Input/RadioGroup/Switch), not renaming.
|
|
14
|
+
- Disabled: `disabled:opacity-50` → `disabled:bg-muted disabled:text-muted-foreground` (kept `disabled:pointer-events-none`) — a real flat-color swap, matching Figma's Disabled screenshot and the same category of fix already made repeatedly (Checkbox/Input/Textarea).
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- A "Tail icon" storybook/JSDoc example, matching Figma's "Tail Icon"/"Complex" content variants — already achievable today via the existing slot (just place a trailing icon after the text), no new prop needed.
|
|
19
|
+
|
|
20
|
+
### Notes
|
|
21
|
+
|
|
22
|
+
- Pressed (`aria-pressed:bg-background-hover`) and Focus (`border-ring`/`ring-[3px]`) treatments already matched Figma's tokens exactly — no changes needed.
|
|
23
|
+
- Hover isn't implemented, per the standing project direction to skip hover states.
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @component Toggle
|
|
4
4
|
* @title Toggle
|
|
5
5
|
* @description A two-state button that can be either on or off.
|
|
6
|
+
* @figmaUrl https://www.figma.com/design/qXkzdqZ3QPQqgckU3AwIAH/ClickLearn-Lightning-Design-Library?node-id=5455-19034
|
|
6
7
|
*
|
|
7
8
|
* @preview
|
|
8
9
|
*
|
|
@@ -71,6 +72,9 @@
|
|
|
71
72
|
* ### Sizes
|
|
72
73
|
*
|
|
73
74
|
* <div class="flex items-center gap-2">
|
|
75
|
+
* <Toggle size="xs" variant="outline" aria-label="Toggle extra small">
|
|
76
|
+
* XS
|
|
77
|
+
* </Toggle>
|
|
74
78
|
* <Toggle size="sm" variant="outline" aria-label="Toggle small">
|
|
75
79
|
* Small
|
|
76
80
|
* </Toggle>
|
|
@@ -82,6 +86,14 @@
|
|
|
82
86
|
* </Toggle>
|
|
83
87
|
* </div>
|
|
84
88
|
*
|
|
89
|
+
* ### Tail icon
|
|
90
|
+
*
|
|
91
|
+
* <Toggle variant="outline" aria-label="Toggle bookmark">
|
|
92
|
+
* <BookmarkIcon class="group-aria-pressed/toggle:fill-foreground" />
|
|
93
|
+
* Bookmark
|
|
94
|
+
* <XIcon class="size-3.5" />
|
|
95
|
+
* </Toggle>
|
|
96
|
+
*
|
|
85
97
|
* ### Disabled
|
|
86
98
|
*
|
|
87
99
|
* <div class="flex items-center gap-2">
|
|
@@ -109,7 +121,7 @@ interface Props extends ToggleVariantProps, Omit<HTMLAttributes<"button">, "clas
|
|
|
109
121
|
}
|
|
110
122
|
|
|
111
123
|
const {
|
|
112
|
-
variant = "
|
|
124
|
+
variant = "outline",
|
|
113
125
|
size = "default",
|
|
114
126
|
defaultPressed,
|
|
115
127
|
disabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Toggle } from "./Toggle.astro";
|
|
1
|
+
export { default as Toggle } from "./Toggle.astro";
|
|
@@ -1,5 +1,18 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to the `ToggleGroup` component will be documented in this file.
|
|
4
|
-
|
|
5
|
-
##
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the `ToggleGroup` component will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## 2026-09-18 — Figma alignment (ClickLearn Lightning Design Library, node `5455-20808`)
|
|
6
|
+
|
|
7
|
+
Figma documents ToggleGroup across four pages: States (Default, Hover, Pressed, Focus Default, Focus Pressed, Disabled), Sizes (Small 28px, Medium 32px, Large 36px — matching `Toggle`'s own scale), Items (Lead/Middle/Tail item positions × sizes × states), and the top-level Variants page (Small/Medium/Large).
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Added the missing `@figmaUrl`.
|
|
12
|
+
- **Default variant**: changed the component's own default from `"default"` to `"outline"`, matching Figma's bordered default look — same fix and same reasoning as `Toggle` (every existing usage example already passed `variant="outline"` explicitly, so this is a no-op for current demos).
|
|
13
|
+
- **Sizes**: added `size="xs"` (28px) to the shared `toggleVariants` (see `Toggle`'s changelog for the full sizing analysis — `ToggleGroup` uses the identical scale). `ToggleGroupItem`'s own `size` override picks this up automatically since it shares the same `ToggleVariantProps` type.
|
|
14
|
+
|
|
15
|
+
### Notes
|
|
16
|
+
|
|
17
|
+
- Segmented "connected" styling (`spacing=0` → shared borders, first/last rounding) and the vertical-orientation border swap weren't shown differently in Figma's reference (which only documents individual items, not the connected-segment composition) — left unchanged since there's no contradicting evidence.
|
|
18
|
+
- Disabled/Focus/Pressed treatments are inherited from the same shared `toggleVariants` fixed in `Toggle` — no separate `ToggleGroup`-specific styling needed.
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @component ToggleGroup
|
|
4
4
|
* @title Toggle Group
|
|
5
5
|
* @description A set of two-state buttons that can be toggled on or off. Supports single or multiple selection.
|
|
6
|
+
* @figmaUrl https://www.figma.com/design/qXkzdqZ3QPQqgckU3AwIAH/ClickLearn-Lightning-Design-Library?node-id=5455-20808
|
|
6
7
|
*
|
|
7
8
|
* @preview
|
|
8
9
|
*
|
|
@@ -100,6 +101,17 @@
|
|
|
100
101
|
* ### Sizes
|
|
101
102
|
*
|
|
102
103
|
* <div class="flex flex-col gap-4">
|
|
104
|
+
* <ToggleGroup size="xs" variant="outline" defaultValue="center">
|
|
105
|
+
* <ToggleGroupItem value="left" aria-label="Align left">
|
|
106
|
+
* <AlignLeftIcon />
|
|
107
|
+
* </ToggleGroupItem>
|
|
108
|
+
* <ToggleGroupItem value="center" aria-label="Align center">
|
|
109
|
+
* <AlignCenterIcon />
|
|
110
|
+
* </ToggleGroupItem>
|
|
111
|
+
* <ToggleGroupItem value="right" aria-label="Align right">
|
|
112
|
+
* <AlignRightIcon />
|
|
113
|
+
* </ToggleGroupItem>
|
|
114
|
+
* </ToggleGroup>
|
|
103
115
|
* <ToggleGroup size="sm" variant="outline" defaultValue="center">
|
|
104
116
|
* <ToggleGroupItem value="left" aria-label="Align left">
|
|
105
117
|
* <AlignLeftIcon />
|
|
@@ -170,7 +182,7 @@ import { cn } from "@cl-light-ds/ui/lib/utils";
|
|
|
170
182
|
|
|
171
183
|
interface Props extends Omit<HTMLAttributes<"div">, "class"> {
|
|
172
184
|
variant?: "default" | "outline";
|
|
173
|
-
size?: "default" | "sm" | "lg";
|
|
185
|
+
size?: "xs" | "default" | "sm" | "lg";
|
|
174
186
|
spacing?: number;
|
|
175
187
|
defaultValue?: string | string[];
|
|
176
188
|
multiple?: boolean;
|
|
@@ -181,7 +193,7 @@ interface Props extends Omit<HTMLAttributes<"div">, "class"> {
|
|
|
181
193
|
}
|
|
182
194
|
|
|
183
195
|
const {
|
|
184
|
-
variant = "
|
|
196
|
+
variant = "outline",
|
|
185
197
|
size = "default",
|
|
186
198
|
spacing = 0,
|
|
187
199
|
defaultValue,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as ToggleGroup } from "./ToggleGroup.astro";
|
|
2
|
-
export { default as ToggleGroupItem } from "./ToggleGroupItem.astro";
|
|
1
|
+
export { default as ToggleGroup } from "./ToggleGroup.astro";
|
|
2
|
+
export { default as ToggleGroupItem } from "./ToggleGroupItem.astro";
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to the `Tooltip` component
|
|
4
|
-
|
|
5
|
-
##
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the `Tooltip` component family (`Tooltip`, `TooltipTrigger`, `TooltipContent`) are documented in this file.
|
|
4
|
+
|
|
5
|
+
## 2026-09-18 — Figma alignment (ClickLearn Lightning Design Library, node `5275-137`)
|
|
6
|
+
|
|
7
|
+
Figma documents Tooltip across four pages: Contents (6 side/align positions — already fully covered by the existing `side`/`align` props), Variants (Default, Outline), Sizes (Small, Large), and the top-level Component page.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **`variant` prop on `TooltipContent`** (`"default" | "outline"`, default `"default"`): Figma documents a second, previously entirely unimplemented "Outline" variant — a light `bg-card` tooltip with a `border-border` border and dark text, versus the existing inverted-dark style. Colors confirmed via Figma tokens (`card` = `#ffffff`, `border` = `#e4e4e7`, text = `foreground`). The arrow now matches whichever variant is active.
|
|
12
|
+
- **`size` prop on `TooltipContent`** (`"default" | "lg"`, default `"default"`): Figma's "Large" size uses more generous padding (`px-3 py-2` vs. the existing `px-2 py-1`) to comfortably fit a two-line title + supportive-text composition. The two-line content itself is left to the consumer to compose (a `flex flex-col` wrapper with a bold title and a muted caption) rather than hardcoded into `TooltipContent`, consistent with how other compound content (e.g. Popover's header) is handled.
|
|
13
|
+
- Storybook/JSDoc examples for both the Outline variant and the Large size.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Removed a dead, redundant duplicate of the arrow's `data-[side=*]` position classes (repeated verbatim right after the main class string) — same class of cleanup already done on Dialog/HoverCard/Popover.
|
|
18
|
+
|
|
19
|
+
### Notes
|
|
20
|
+
|
|
21
|
+
- The existing 6 content positions (None/Left/Right/Bottom Left/Bottom Middle/Bottom Right) all map directly onto the already-supported `side`/`align` props — no changes needed there.
|
|
22
|
+
- The default (dark, inverted) variant's colors already matched Figma exactly (`bg-foreground`/`text-background`) — no change needed.
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @component Tooltip
|
|
4
4
|
* @title Tooltip
|
|
5
5
|
* @description A small popup that appears when hovering over or focusing on an element. Positioning is computed in JavaScript.
|
|
6
|
+
* @figmaUrl https://www.figma.com/design/qXkzdqZ3QPQqgckU3AwIAH/ClickLearn-Lightning-Design-Library?node-id=5275-137
|
|
6
7
|
*
|
|
7
8
|
* @preview
|
|
8
9
|
*
|
|
@@ -35,6 +36,31 @@
|
|
|
35
36
|
*
|
|
36
37
|
* @examples
|
|
37
38
|
*
|
|
39
|
+
* ### Outline variant
|
|
40
|
+
*
|
|
41
|
+
* <Tooltip>
|
|
42
|
+
* <TooltipTrigger asChild>
|
|
43
|
+
* <Button variant="outline">Hover</Button>
|
|
44
|
+
* </TooltipTrigger>
|
|
45
|
+
* <TooltipContent variant="outline">
|
|
46
|
+
* <p>Tooltip label</p>
|
|
47
|
+
* </TooltipContent>
|
|
48
|
+
* </Tooltip>
|
|
49
|
+
*
|
|
50
|
+
* ### Large size (with supportive text)
|
|
51
|
+
*
|
|
52
|
+
* <Tooltip>
|
|
53
|
+
* <TooltipTrigger asChild>
|
|
54
|
+
* <Button variant="outline">Hover</Button>
|
|
55
|
+
* </TooltipTrigger>
|
|
56
|
+
* <TooltipContent variant="outline" size="lg">
|
|
57
|
+
* <div class="flex flex-col gap-1">
|
|
58
|
+
* <p class="font-medium">Tooltip label</p>
|
|
59
|
+
* <p class="opacity-70">Supportive text</p>
|
|
60
|
+
* </div>
|
|
61
|
+
* </TooltipContent>
|
|
62
|
+
* </Tooltip>
|
|
63
|
+
*
|
|
38
64
|
* ### With delay
|
|
39
65
|
*
|
|
40
66
|
* <Tooltip delay={1000}>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { cn } from "@cl-light-ds/ui/lib/utils";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
3
4
|
import type { HTMLAttributes } from "astro/types";
|
|
4
5
|
|
|
5
6
|
type TooltipSide =
|
|
@@ -16,6 +17,8 @@ interface Props extends HTMLAttributes<"div"> {
|
|
|
16
17
|
side?: TooltipSide;
|
|
17
18
|
align?: "start" | "center" | "end";
|
|
18
19
|
alignOffset?: number;
|
|
20
|
+
variant?: "default" | "outline";
|
|
21
|
+
size?: "default" | "lg";
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
const {
|
|
@@ -24,8 +27,36 @@ const {
|
|
|
24
27
|
side = "top",
|
|
25
28
|
align = "center",
|
|
26
29
|
alignOffset,
|
|
30
|
+
variant = "default",
|
|
31
|
+
size = "default",
|
|
27
32
|
...rest
|
|
28
33
|
} = Astro.props as Props;
|
|
34
|
+
|
|
35
|
+
const contentVariants = cva(
|
|
36
|
+
[
|
|
37
|
+
// visibility / animation
|
|
38
|
+
"relative pointer-events-none data-open:pointer-events-auto data-closed:pointer-events-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
39
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2",
|
|
40
|
+
// layout
|
|
41
|
+
"inline-flex items-center gap-1 has-data-[slot=kbd]:pr-1.5 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm rounded-lg shadow-md z-50 w-fit max-w-xs origin-(--transform-origin)",
|
|
42
|
+
],
|
|
43
|
+
{
|
|
44
|
+
variants: {
|
|
45
|
+
variant: {
|
|
46
|
+
default: "bg-foreground text-background",
|
|
47
|
+
outline: "bg-card text-foreground border border-border",
|
|
48
|
+
},
|
|
49
|
+
size: {
|
|
50
|
+
default: "px-2 py-1 text-xs",
|
|
51
|
+
lg: "px-3 py-2 text-sm",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
defaultVariants: {
|
|
55
|
+
variant: "default",
|
|
56
|
+
size: "default",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
);
|
|
29
60
|
---
|
|
30
61
|
|
|
31
62
|
<div data-slot="tooltip-portal">
|
|
@@ -38,20 +69,14 @@ const {
|
|
|
38
69
|
data-side-offset={sideOffset}
|
|
39
70
|
data-align={align}
|
|
40
71
|
data-align-offset={alignOffset}
|
|
41
|
-
class={cn(
|
|
42
|
-
"relative pointer-events-none data-open:pointer-events-auto data-closed:pointer-events-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-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 inline-flex items-center gap-1 px-2 py-1 text-xs has-data-[slot=kbd]:pr-1.5 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm rounded-lg shadow-md data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 w-fit max-w-xs origin-(--transform-origin) bg-foreground text-background",
|
|
43
|
-
className,
|
|
44
|
-
)}
|
|
72
|
+
class={cn(contentVariants({ variant, size }), className)}
|
|
45
73
|
>
|
|
46
74
|
<slot />
|
|
47
75
|
<div
|
|
48
76
|
data-slot="tooltip-arrow"
|
|
49
77
|
class={cn(
|
|
50
|
-
|
|
51
|
-
"data-[side=top]:-bottom-1",
|
|
52
|
-
"data-[side=bottom]:-top-1",
|
|
53
|
-
"data-[side=left]:-right-1",
|
|
54
|
-
"data-[side=right]:-left-1",
|
|
78
|
+
variant === "outline" ? "bg-card border border-border" : "bg-foreground fill-foreground",
|
|
79
|
+
"absolute size-2.5 rotate-45 rounded-[2px] data-[side=top]:-bottom-1 data-[side=bottom]:-top-1 data-[side=left]:-right-1 data-[side=left]:translate-x-[-1.5px] data-[side=right]:-left-1 data-[side=right]:translate-x-[1.5px] data-[side=inline-start]:-right-1 data-[side=inline-start]:translate-x-[-1.5px] data-[side=inline-end]:-left-1 data-[side=inline-end]:translate-x-[1.5px] z-50",
|
|
55
80
|
)}
|
|
56
81
|
>
|
|
57
82
|
</div>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as Tooltip } from "./Tooltip.astro";
|
|
2
|
-
export { default as TooltipTrigger } from "./TooltipTrigger.astro";
|
|
3
|
-
export { default as TooltipContent } from "./TooltipContent.astro";
|
|
1
|
+
export { default as Tooltip } from "./Tooltip.astro";
|
|
2
|
+
export { default as TooltipTrigger } from "./TooltipTrigger.astro";
|
|
3
|
+
export { default as TooltipContent } from "./TooltipContent.astro";
|