@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
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to the `Select` component will be documented in this file.
|
|
4
|
-
|
|
5
|
-
## Date 14th Sep 2026
|
|
6
|
-
## Figma alignment (node 2329-7946) + props audit
|
|
7
|
-
|
|
8
|
-
### Fixed
|
|
9
|
-
|
|
10
|
-
- `SelectTrigger`: vertical padding was `py-2` (8px); Figma specifies `py-1` (4px) on all sizes.
|
|
11
|
-
- `SelectTrigger`: `size="lg"` had no explicit height at all (`h-9`/`h-8` were defined, `h-10` for `lg` was missing) — the Large variant silently fell back to whatever height its padding produced instead of Figma's 40px. Added `data-[size=lg]:h-10`.
|
|
12
|
-
- `SelectTrigger`: focus-visible style used the plain-form-field pattern (`ring-ring/50`, opacity-blended). Figma's focus state is a solid `border-ring` + 2px `chart-1` shadow — the same "interactive control" pattern already used by `Button`, `Card`, and `DropdownMenuItem`. Switched to `focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-chart-1`.
|
|
13
|
-
- `SelectTrigger`: disabled state relied only on `opacity-50`. Figma shows an explicit muted background/text. Added `disabled:bg-muted disabled:text-muted-foreground`, matching `Input`'s existing disabled convention.
|
|
14
|
-
- `SelectTrigger`: removed a stray `-mr-0.75` negative margin on the chevron icon (not present in Figma) and dropped a few classes that `cn()`/tailwind-merge were already silently overriding (`rounded-md`, `pr-2`, `pl-2.5`).
|
|
15
|
-
- `SelectItem`: `rounded-sm` → `rounded-lg` and `text-xs` → `text-sm`, matching Figma's 8px item radius and 14px item text — `ComboboxItem` already used the correct values, `SelectItem` had drifted from it.
|
|
16
|
-
- `SelectContent`: the viewport had no padding at all unless items were wrapped in a `SelectGroup` (which carries its own `p-1`). A plain, ungrouped item list — the common case — sat flush against the popover's rounded corners. Added `p-1 gap-1` to the viewport so grouped and ungrouped content both get consistent spacing.
|
|
17
|
-
|
|
18
|
-
### Changed
|
|
19
|
-
|
|
20
|
-
- **`size` now actually propagates.** `Select`, `SelectTrigger`, and `SelectContent` each declared an independent `size` prop, but nothing ever synced them — `data-size` on the `Select` wrapper was purely decorative (confirmed by tracing `@data-slot/select`'s compiled runtime, which syncs `disabled` and `defaultValue` from the wrapper but never touched `size`). Setting `size="lg"` only on `<Select>` — the one place a consumer would naturally expect to control it — had zero visual effect. `Select`'s mount script now mirrors its `data-size` onto its `SelectTrigger` descendant at runtime, so `size` set on `<Select>` is authoritative; `SelectTrigger`'s own `size` prop is still available for standalone use outside a `Select` wrapper.
|
|
21
|
-
- Removed the unused `size` prop from `SelectContent` — nothing in its class list ever branched on it, and Figma doesn't vary dropdown-item sizing by Select size either. A prop with no effect is worse than no prop for a team that needs to know which controls actually do something.
|
|
22
|
-
|
|
23
|
-
### Added
|
|
24
|
-
|
|
25
|
-
- `Select`'s JSDoc now documents every sub-component's props in an `@api` table (mirroring `Field`'s format), and calls out which state is auto-synced from `<Select>` (`disabled`, `defaultValue`, and now `size`) versus what must be set per sub-component.
|
|
26
|
-
- Added a "With Label" example to `Select`'s JSDoc and to its Storybook page. `Select` has no label prop by design — label pairing stays composition-only via `Label`/`FieldLabel`, the same convention `Input` already uses (also already documented as the recommended pairing in `Field`'s own docs).
|
|
27
|
-
|
|
28
|
-
### Not changed (checked, no gap found)
|
|
29
|
-
|
|
30
|
-
- `border-input` resolves to the same `zinc-200` as `--border` — already matches Figma.
|
|
31
|
-
- The trigger's Hover state is visually identical to Default in light mode in Figma — matches the component's existing dark-mode-only hover classes.
|
|
32
|
-
- Figma renders item hover text as `accent-foreground`; the code uses `foreground`. Left as-is since `ComboboxItem` makes the same choice — a consistent system-wide simplification, not a `Select`-specific bug.
|
|
33
|
-
- `disabled` on `<Select>` already correctly disables `SelectTrigger` at runtime (unlike `size`) — no fix needed, just now documented explicitly.
|
|
34
|
-
|
|
35
|
-
## Unreleased
|
|
36
|
-
|
|
37
|
-
### Fixed
|
|
38
|
-
|
|
39
|
-
- Restored interactivity: the component's `<script>` was importing its runtime behavior from `@repo/lib/select`, a module that never existed in this repo — it was aliased to a no-op stub so builds wouldn't crash, leaving Select fully static. Fixed the import to point at `@data-slot/select` (the real published package the component's API already matched) and added it as a dependency. Select now opens/closes, supports keyboard navigation, and fires `select:change` / `select:open-change` as designed.
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the `Select` component will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## Date 14th Sep 2026
|
|
6
|
+
## Figma alignment (node 2329-7946) + props audit
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
|
|
10
|
+
- `SelectTrigger`: vertical padding was `py-2` (8px); Figma specifies `py-1` (4px) on all sizes.
|
|
11
|
+
- `SelectTrigger`: `size="lg"` had no explicit height at all (`h-9`/`h-8` were defined, `h-10` for `lg` was missing) — the Large variant silently fell back to whatever height its padding produced instead of Figma's 40px. Added `data-[size=lg]:h-10`.
|
|
12
|
+
- `SelectTrigger`: focus-visible style used the plain-form-field pattern (`ring-ring/50`, opacity-blended). Figma's focus state is a solid `border-ring` + 2px `chart-1` shadow — the same "interactive control" pattern already used by `Button`, `Card`, and `DropdownMenuItem`. Switched to `focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-chart-1`.
|
|
13
|
+
- `SelectTrigger`: disabled state relied only on `opacity-50`. Figma shows an explicit muted background/text. Added `disabled:bg-muted disabled:text-muted-foreground`, matching `Input`'s existing disabled convention.
|
|
14
|
+
- `SelectTrigger`: removed a stray `-mr-0.75` negative margin on the chevron icon (not present in Figma) and dropped a few classes that `cn()`/tailwind-merge were already silently overriding (`rounded-md`, `pr-2`, `pl-2.5`).
|
|
15
|
+
- `SelectItem`: `rounded-sm` → `rounded-lg` and `text-xs` → `text-sm`, matching Figma's 8px item radius and 14px item text — `ComboboxItem` already used the correct values, `SelectItem` had drifted from it.
|
|
16
|
+
- `SelectContent`: the viewport had no padding at all unless items were wrapped in a `SelectGroup` (which carries its own `p-1`). A plain, ungrouped item list — the common case — sat flush against the popover's rounded corners. Added `p-1 gap-1` to the viewport so grouped and ungrouped content both get consistent spacing.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- **`size` now actually propagates.** `Select`, `SelectTrigger`, and `SelectContent` each declared an independent `size` prop, but nothing ever synced them — `data-size` on the `Select` wrapper was purely decorative (confirmed by tracing `@data-slot/select`'s compiled runtime, which syncs `disabled` and `defaultValue` from the wrapper but never touched `size`). Setting `size="lg"` only on `<Select>` — the one place a consumer would naturally expect to control it — had zero visual effect. `Select`'s mount script now mirrors its `data-size` onto its `SelectTrigger` descendant at runtime, so `size` set on `<Select>` is authoritative; `SelectTrigger`'s own `size` prop is still available for standalone use outside a `Select` wrapper.
|
|
21
|
+
- Removed the unused `size` prop from `SelectContent` — nothing in its class list ever branched on it, and Figma doesn't vary dropdown-item sizing by Select size either. A prop with no effect is worse than no prop for a team that needs to know which controls actually do something.
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- `Select`'s JSDoc now documents every sub-component's props in an `@api` table (mirroring `Field`'s format), and calls out which state is auto-synced from `<Select>` (`disabled`, `defaultValue`, and now `size`) versus what must be set per sub-component.
|
|
26
|
+
- Added a "With Label" example to `Select`'s JSDoc and to its Storybook page. `Select` has no label prop by design — label pairing stays composition-only via `Label`/`FieldLabel`, the same convention `Input` already uses (also already documented as the recommended pairing in `Field`'s own docs).
|
|
27
|
+
|
|
28
|
+
### Not changed (checked, no gap found)
|
|
29
|
+
|
|
30
|
+
- `border-input` resolves to the same `zinc-200` as `--border` — already matches Figma.
|
|
31
|
+
- The trigger's Hover state is visually identical to Default in light mode in Figma — matches the component's existing dark-mode-only hover classes.
|
|
32
|
+
- Figma renders item hover text as `accent-foreground`; the code uses `foreground`. Left as-is since `ComboboxItem` makes the same choice — a consistent system-wide simplification, not a `Select`-specific bug.
|
|
33
|
+
- `disabled` on `<Select>` already correctly disables `SelectTrigger` at runtime (unlike `size`) — no fix needed, just now documented explicitly.
|
|
34
|
+
|
|
35
|
+
## Unreleased
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- Restored interactivity: the component's `<script>` was importing its runtime behavior from `@repo/lib/select`, a module that never existed in this repo — it was aliased to a no-op stub so builds wouldn't crash, leaving Select fully static. Fixed the import to point at `@data-slot/select` (the real published package the component's API already matched) and added it as a dependency. Select now opens/closes, supports keyboard navigation, and fires `select:change` / `select:open-change` as designed.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { default as Select } from "./Select.astro";
|
|
2
|
-
export { default as SelectTrigger } from "./SelectTrigger.astro";
|
|
3
|
-
export { default as SelectValue } from "./SelectValue.astro";
|
|
4
|
-
export { default as SelectContent } from "./SelectContent.astro";
|
|
5
|
-
export { default as SelectItem } from "./SelectItem.astro";
|
|
6
|
-
export { default as SelectGroup } from "./SelectGroup.astro";
|
|
7
|
-
export { default as SelectLabel } from "./SelectLabel.astro";
|
|
8
|
-
export { default as SelectSeparator } from "./SelectSeparator.astro";
|
|
1
|
+
export { default as Select } from "./Select.astro";
|
|
2
|
+
export { default as SelectTrigger } from "./SelectTrigger.astro";
|
|
3
|
+
export { default as SelectValue } from "./SelectValue.astro";
|
|
4
|
+
export { default as SelectContent } from "./SelectContent.astro";
|
|
5
|
+
export { default as SelectItem } from "./SelectItem.astro";
|
|
6
|
+
export { default as SelectGroup } from "./SelectGroup.astro";
|
|
7
|
+
export { default as SelectLabel } from "./SelectLabel.astro";
|
|
8
|
+
export { default as SelectSeparator } from "./SelectSeparator.astro";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to the `Separator` component will be documented in this file.
|
|
4
|
-
|
|
5
|
-
## Unreleased
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the `Separator` component will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Separator } from "./Separator.astro";
|
|
2
|
-
|
|
1
|
+
export { default as Separator } from "./Separator.astro";
|
|
2
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to the `Skeleton` component will be documented in this file.
|
|
4
|
-
|
|
5
|
-
## Unreleased
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the `Skeleton` component will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Skeleton } from "./Skeleton.astro";
|
|
1
|
+
export { default as Skeleton } from "./Skeleton.astro";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to the `Slider` component will be documented in this file.
|
|
4
|
-
|
|
5
|
-
## Unreleased
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the `Slider` component will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Slider } from "./Slider.astro";
|
|
1
|
+
export { default as Slider } from "./Slider.astro";
|
|
@@ -1,5 +1,18 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to the `Spinner` component will be documented in this file.
|
|
4
|
-
|
|
5
|
-
##
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the `Spinner` component will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## 2026-09-18 — Figma alignment (ClickLearn Lightning Design Library, node `5455-18523`)
|
|
6
|
+
|
|
7
|
+
Figma documents Spinner as four discrete sizes: Extra Small (12px), Small (16px), Medium (24px), Large (32px) — all rendered in a consistent primary-blue color.
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Added the missing `@figmaUrl`.
|
|
12
|
+
- Default color: added `text-primary` so the spinner's `stroke="currentColor"` resolves to primary blue (`#3785e0`, confirmed against Figma) by default, matching every size shown in Figma — previously it had no default color at all and just inherited whatever ambient text color happened to be in scope.
|
|
13
|
+
- Fixed a real regression that default color change caused: the storybook's own "Badge" example nests a bare `<Spinner data-icon />` inside the default (solid primary-blue) `Badge` variant — with the new default, the spinner became invisible (blue icon on blue background). Fixed by explicitly overriding it to `class="text-primary-foreground"` in that one case (both in the storybook page and the identical demo duplicated in `Spinner.astro`'s own JSDoc), matching the badge's own foreground token. All other compositions (outline/secondary badges, disabled buttons — which force `bg-muted` regardless of variant, so never collide with primary blue) were unaffected.
|
|
14
|
+
|
|
15
|
+
### Notes
|
|
16
|
+
|
|
17
|
+
- No new `size` prop added — the existing "use a `size-*` utility class" pattern already produces Figma's exact four sizes (`size-3`/`size-4`/`size-6`/`size-8` = 12/16/24/32px), confirmed already documented in the component's own JSDoc and storybook page. Relabeled the storybook "Size" demo with Figma's own names (Extra Small/Small/Medium/Large) for clarity.
|
|
18
|
+
- Stroke width and animation were already correct — no Figma evidence suggested otherwise.
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @component Spinner
|
|
4
4
|
* @title Spinner
|
|
5
5
|
* @description A loading indicator component that displays an animated spinning icon.
|
|
6
|
+
* @figmaUrl https://www.figma.com/design/qXkzdqZ3QPQqgckU3AwIAH/ClickLearn-Lightning-Design-Library?node-id=5455-18523
|
|
6
7
|
*
|
|
7
8
|
* @preview
|
|
8
9
|
*
|
|
@@ -84,7 +85,7 @@
|
|
|
84
85
|
*
|
|
85
86
|
* <div class="flex items-center gap-4 [--radius:1.2rem]">
|
|
86
87
|
* <Badge>
|
|
87
|
-
* <Spinner data-icon />
|
|
88
|
+
* <Spinner data-icon class="text-primary-foreground" />
|
|
88
89
|
* Syncing
|
|
89
90
|
* </Badge>
|
|
90
91
|
* <Badge variant="secondary">
|
|
@@ -130,5 +131,5 @@ const { class: className = "", ...props } = Astro.props;
|
|
|
130
131
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" data-slot="spinner"
|
|
131
132
|
role="status"
|
|
132
133
|
aria-label="Loading"
|
|
133
|
-
class={cn("", "size-4 animate-spin", className)}
|
|
134
|
+
class={cn("text-primary", "size-4 animate-spin", className)}
|
|
134
135
|
{...props}><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 1 1-6.219-8.56"/></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Spinner } from "./Spinner.astro";
|
|
1
|
+
export { default as Spinner } from "./Spinner.astro";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to the `StickySurface` component will be documented in this file.
|
|
4
|
-
|
|
5
|
-
## Unreleased
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the `StickySurface` component will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as StickySurface } from "./StickySurface.astro";
|
|
2
|
-
|
|
1
|
+
export { default as StickySurface } from "./StickySurface.astro";
|
|
2
|
+
|
|
@@ -1,9 +1,29 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to the `Switch` component will be documented in this file.
|
|
4
|
-
|
|
5
|
-
## Unreleased
|
|
6
|
-
|
|
7
|
-
### Fixed
|
|
8
|
-
|
|
9
|
-
- Restored interactivity: `@data-slot/switch` (already the correct import in `Switch.astro`) was never added as a dependency and was aliased to a no-op stub so builds wouldn't crash, leaving Switch fully static. Added the real package as a dependency and removed the stub alias.
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the `Switch` component will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Restored interactivity: `@data-slot/switch` (already the correct import in `Switch.astro`) was never added as a dependency and was aliased to a no-op stub so builds wouldn't crash, leaving Switch fully static. Added the real package as a dependency and removed the stub alias.
|
|
10
|
+
|
|
11
|
+
## 2026-09-18 — Figma alignment (ClickLearn Lightning Design Library, node `50-5797`)
|
|
12
|
+
|
|
13
|
+
Figma documents Switch across four pages: Contents (Simple, Label, Label and Caption), States (Default, Hover, Focus, Disabled), Sizes (Small 32×20, Large 36×24), and Variants (implicit in the main component: Default/Checked).
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Updated `@figmaUrl` from the old Bejamas file to the ClickLearn Lightning Design Library link.
|
|
18
|
+
- `default` size track height: `h-[18.4px]` (an odd, clearly unintentional fractional value) → `h-5` (20px), matching Figma's "Small" track exactly. Width (`w-8`/32px) was already correct. Also swapped the now-equivalent `w-[32px]` for the canonical `w-8` utility.
|
|
19
|
+
- Added `size="lg"` (36×24px, matching Figma's "Large") — previously only `sm`/`default` existed, with no tier matching Figma's larger documented size. The new thumb size (18px) and translate distance were derived to preserve the exact same proportions already used by `sm`/`default` (thumb = exactly half the track width in both existing tiers), confirmed against a pixel-level measurement of Figma's own Large checked-state export.
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- A "Label and caption" storybook example (`Field`/`FieldLabel`/`FieldDescription`), matching Figma's third documented content variant — not previously demonstrated.
|
|
24
|
+
|
|
25
|
+
### Notes
|
|
26
|
+
|
|
27
|
+
- Track colors (`bg-primary` checked / `bg-muted` unchecked), Focus ring (`border-ring`/`ring-3 ring-ring/50`), and the Disabled treatment (`opacity-50`) all already matched Figma's tokens/visual exactly — confirmed Figma's own Disabled state screenshot shows the same washed-out/low-contrast look an opacity fade produces, unlike Checkbox/Input/RadioGroup where a flat muted-color swap was clearly evident instead.
|
|
28
|
+
- `size="sm"` (24×14px) has no corresponding size in Figma (which only documents Small/Large, mapping to this component's `default`/`lg`) — flagging the naming mismatch per the recurring pattern (Accordion/Checkbox/Input/RadioGroup), not renaming here since `sm` isn't Figma-validated at all and isn't used anywhere outside its own demo.
|
|
29
|
+
- Simple and Label content variants were already fully supported (a bare `Switch`, or paired with a sibling `Label`) — no changes needed.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @component Switch
|
|
4
4
|
* @title Switch
|
|
5
5
|
* @description A toggle control for switching between checked and unchecked states.
|
|
6
|
-
* @figmaUrl https://www.figma.com/design/
|
|
6
|
+
* @figmaUrl https://www.figma.com/design/qXkzdqZ3QPQqgckU3AwIAH/ClickLearn-Lightning-Design-Library?node-id=50-5797
|
|
7
7
|
*
|
|
8
8
|
* @status stable
|
|
9
9
|
* @since 0.1.0
|
|
@@ -36,7 +36,7 @@ import { cn } from "@cl-light-ds/ui/lib/utils";
|
|
|
36
36
|
interface Props extends HTMLAttributes<"span"> {
|
|
37
37
|
class?: string;
|
|
38
38
|
id?: string;
|
|
39
|
-
size?: "sm" | "default";
|
|
39
|
+
size?: "sm" | "default" | "lg";
|
|
40
40
|
checked?: boolean;
|
|
41
41
|
defaultChecked?: boolean;
|
|
42
42
|
name?: string;
|
|
@@ -83,7 +83,7 @@ const initialChecked = checked ?? defaultChecked ?? false;
|
|
|
83
83
|
data-unchecked={initialChecked ? undefined : "true"}
|
|
84
84
|
aria-invalid={ariaInvalid}
|
|
85
85
|
class={cn(
|
|
86
|
-
"data-checked:bg-primary data-unchecked:bg-muted 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 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent shadow-xs focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-
|
|
86
|
+
"data-checked:bg-primary data-unchecked:bg-muted 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 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent shadow-xs focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-5 data-[size=default]:w-8 data-[size=sm]:h-[14px] data-[size=sm]:w-6 data-[size=lg]:h-6 data-[size=lg]:w-9 peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
87
87
|
className,
|
|
88
88
|
)}
|
|
89
89
|
>
|
|
@@ -94,7 +94,7 @@ const initialChecked = checked ?? defaultChecked ?? false;
|
|
|
94
94
|
data-disabled={disabled ? "true" : undefined}
|
|
95
95
|
data-readonly={readOnly ? "true" : undefined}
|
|
96
96
|
data-required={required ? "true" : undefined}
|
|
97
|
-
class="bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"
|
|
97
|
+
class="bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=lg]/switch:size-[18px] group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=lg]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 group-data-[size=lg]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"
|
|
98
98
|
aria-hidden="true"
|
|
99
99
|
></span>
|
|
100
100
|
</span>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Switch } from "./Switch.astro";
|
|
1
|
+
export { default as Switch } from "./Switch.astro";
|
|
@@ -1,5 +1,24 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to the `Table` component
|
|
4
|
-
|
|
5
|
-
##
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the `Table` component family (`Table`, `TableHeader`, `TableBody`, `TableFooter`, `TableRow`, `TableHead`, `TableCell`, `TableCaption`) are documented in this file.
|
|
4
|
+
|
|
5
|
+
## 2026-09-18 — Figma alignment (ClickLearn Lightning Design Library, node `5548-9089`)
|
|
6
|
+
|
|
7
|
+
Note: Figma's own canvas for this component is named "Table (⚠️)" — the designer's own marker that this page isn't fully finalized. Aligned against what's clearly evidenced (the overall container treatment) and left ambiguous details (see Notes) rather than guess.
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Added the missing `@figmaUrl`.
|
|
12
|
+
- **Removed the outer bordered/rounded card container** (`border border-border bg-background rounded-lg` on `table-container`) — Figma's table has no surrounding box at all: just plain rows with thin dividers sitting directly on the page background, confirmed from the screenshot (no visible outline around the whole table, unlike e.g. `Card`). Kept `relative w-full overflow-x-auto` for horizontal-scroll behavior on narrow screens.
|
|
13
|
+
- Removed two dead, literal duplicate class strings (`Table.astro`'s `"w-full caption-bottom text-sm"` passed twice to the same `cn()` call, and `TableBody.astro`'s `"[&_tr:last-child]:border-0"` likewise) — harmless no-ops, but the same class of cleanup already done repeatedly elsewhere (Dialog/HoverCard/Popover/Item).
|
|
14
|
+
|
|
15
|
+
### Notes
|
|
16
|
+
|
|
17
|
+
- Row/header dividers (`border-b`), footer shading (`bg-muted/50` + `border-t`), and caption styling (`text-muted-foreground text-sm`) already matched Figma's screenshot exactly — no changes needed.
|
|
18
|
+
- Figma's per-cell padding looked like it might use a flex-with-gap layout internally (fixed 120px-wide column "chips" with a 10px gap between them) rather than standard table-cell padding, which doesn't map cleanly onto a real `<table>`'s cell model — and given the page is explicitly marked unfinished, left the existing `px-2`/`p-2` cell padding as-is rather than chase a specific number off of a mockup that may not reflect the final intended markup.
|
|
19
|
+
- The "Items" page's three row types (Title/Basic/Footer) are just `TableHeader`/`TableBody`/`TableFooter` row anatomy, already fully supported — no new props or components needed.
|
|
20
|
+
- Row hover highlighting (`hover:bg-muted/50` on `TableRow`) was left as-is — this is a pre-existing, standard table interaction convention, not a "Hover" variant Figma separately documents (which is the category of hover state the project has been skipping elsewhere).
|
|
21
|
+
|
|
22
|
+
### Fixed (follow-up)
|
|
23
|
+
|
|
24
|
+
- The "Actions" example's icon-only `DropdownMenuTrigger` (an ellipsis button) was rendering two icons — `DropdownMenuTrigger` defaults `tailIcon` to `true` and auto-appends a `ChevronDown`, meant for text-label triggers, not icon-only ones. Added `tailIcon={false}` to all 5 occurrences (3 in `Table.astro`'s own JSDoc, 2 in the storybook docs page). Confirmed live: exactly one icon (`lucide-ellipsis`) now renders.
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @component Table
|
|
4
4
|
* @title Table
|
|
5
|
-
* @description A responsive table
|
|
5
|
+
* @description A responsive table with compound parts. Set `interactive` to enable sorting, row selection, inline editing, tree rows, keyboard grid navigation, column resize/hide and pinned columns. Data stays server-driven: the table emits `table:*` events and the app re-renders rows.
|
|
6
|
+
* @figmaUrl https://www.figma.com/design/qXkzdqZ3QPQqgckU3AwIAH/ClickLearn-Lightning-Design-Library?node-id=5548-9089
|
|
6
7
|
*
|
|
7
8
|
* @preview
|
|
8
9
|
*
|
|
@@ -185,7 +186,7 @@
|
|
|
185
186
|
* <TableCell>$29.99</TableCell>
|
|
186
187
|
* <TableCell class="text-right">
|
|
187
188
|
* <DropdownMenu>
|
|
188
|
-
* <DropdownMenuTrigger variant="ghost" size="icon" class="size-8"><EllipsisIcon /><span class="sr-only">Open menu</span></DropdownMenuTrigger>
|
|
189
|
+
* <DropdownMenuTrigger variant="ghost" size="icon" class="size-8" tailIcon={false}><EllipsisIcon /><span class="sr-only">Open menu</span></DropdownMenuTrigger>
|
|
189
190
|
* <DropdownMenuContent align="end">
|
|
190
191
|
* <DropdownMenuItem>Edit</DropdownMenuItem>
|
|
191
192
|
* <DropdownMenuItem>Duplicate</DropdownMenuItem>
|
|
@@ -200,7 +201,7 @@
|
|
|
200
201
|
* <TableCell>$129.99</TableCell>
|
|
201
202
|
* <TableCell class="text-right">
|
|
202
203
|
* <DropdownMenu>
|
|
203
|
-
* <DropdownMenuTrigger variant="ghost" size="icon" class="size-8"><EllipsisIcon /><span class="sr-only">Open menu</span></DropdownMenuTrigger>
|
|
204
|
+
* <DropdownMenuTrigger variant="ghost" size="icon" class="size-8" tailIcon={false}><EllipsisIcon /><span class="sr-only">Open menu</span></DropdownMenuTrigger>
|
|
204
205
|
* <DropdownMenuContent align="end">
|
|
205
206
|
* <DropdownMenuItem>Edit</DropdownMenuItem>
|
|
206
207
|
* <DropdownMenuItem>Duplicate</DropdownMenuItem>
|
|
@@ -215,7 +216,7 @@
|
|
|
215
216
|
* <TableCell>$49.99</TableCell>
|
|
216
217
|
* <TableCell class="text-right">
|
|
217
218
|
* <DropdownMenu>
|
|
218
|
-
* <DropdownMenuTrigger variant="ghost" size="icon" class="size-8"><EllipsisIcon /><span class="sr-only">Open menu</span></DropdownMenuTrigger>
|
|
219
|
+
* <DropdownMenuTrigger variant="ghost" size="icon" class="size-8" tailIcon={false}><EllipsisIcon /><span class="sr-only">Open menu</span></DropdownMenuTrigger>
|
|
219
220
|
* <DropdownMenuContent align="end">
|
|
220
221
|
* <DropdownMenuItem>Edit</DropdownMenuItem>
|
|
221
222
|
* <DropdownMenuItem>Duplicate</DropdownMenuItem>
|
|
@@ -227,6 +228,40 @@
|
|
|
227
228
|
* </TableRow>
|
|
228
229
|
* </TableBody>
|
|
229
230
|
* </Table>
|
|
231
|
+
*
|
|
232
|
+
* ### Interactive (sorting, selection, inline editing)
|
|
233
|
+
*
|
|
234
|
+
* The table never sorts, pages or saves data itself. It emits events on the root and the app responds:
|
|
235
|
+
*
|
|
236
|
+
* ```astro nocollapse
|
|
237
|
+
* <Table interactive stickyHeader pinnedColumns={2} maxHeight="480px" aria-label="Invoices">
|
|
238
|
+
* <TableBulkToolbar slot="bulk">
|
|
239
|
+
* <Button variant="outline" size="sm">Export .csv</Button>
|
|
240
|
+
* </TableBulkToolbar>
|
|
241
|
+
* <TableHeader>
|
|
242
|
+
* <TableRow>
|
|
243
|
+
* <TableSelectCell header />
|
|
244
|
+
* <TableHead column="name" sortable resizable>Name</TableHead>
|
|
245
|
+
* <TableHead column="status">Status</TableHead>
|
|
246
|
+
* <TableHead column="amount" align="right" sortable>Amount</TableHead>
|
|
247
|
+
* </TableRow>
|
|
248
|
+
* </TableHeader>
|
|
249
|
+
* <TableBody>
|
|
250
|
+
* <TableRow rowId="inv-1">
|
|
251
|
+
* <TableSelectCell />
|
|
252
|
+
* <TableEditableCell column="name" value="INV-00104" required />
|
|
253
|
+
* <TableEditableCell column="status" editor="select" value="paid" options={statusOptions} />
|
|
254
|
+
* <TableCell column="amount" align="right" numeric>$0.00</TableCell>
|
|
255
|
+
* </TableRow>
|
|
256
|
+
* </TableBody>
|
|
257
|
+
* </Table>
|
|
258
|
+
*
|
|
259
|
+
* <script>
|
|
260
|
+
* const table = document.querySelector('[data-slot="table-root"]');
|
|
261
|
+
* table.addEventListener("table:sort", (e) => refetch({ sort: e.detail }));
|
|
262
|
+
* table.addEventListener("table:edit", (e) => e.detail.respond(api.patch(e.detail)));
|
|
263
|
+
* </script>
|
|
264
|
+
* ```
|
|
230
265
|
*/
|
|
231
266
|
|
|
232
267
|
import { cn } from "@cl-light-ds/ui/lib/utils";
|
|
@@ -234,17 +269,90 @@ import type { HTMLAttributes } from "astro/types";
|
|
|
234
269
|
|
|
235
270
|
interface Props extends HTMLAttributes<"table"> {
|
|
236
271
|
class?: string;
|
|
272
|
+
/** Enables the table controller: sorting, selection, editing, tree rows, keyboard grid, resize/hide. */
|
|
273
|
+
interactive?: boolean;
|
|
274
|
+
/** Keeps the header row visible while the table body scrolls. Pair with `maxHeight`. */
|
|
275
|
+
stickyHeader?: boolean;
|
|
276
|
+
/** Number of leading columns pinned while scrolling horizontally. */
|
|
277
|
+
pinnedColumns?: number;
|
|
278
|
+
/** Max height of the scroll container, e.g. "480px". Needed for a sticky header inside the table. */
|
|
279
|
+
maxHeight?: string;
|
|
280
|
+
/** Marks the table busy (aria-busy) and dims the body while the server responds. */
|
|
281
|
+
loading?: boolean;
|
|
282
|
+
/** Total result count across all pages, used by the "Select all N results" banner. */
|
|
283
|
+
totalCount?: number;
|
|
284
|
+
/** Class for the outer wrapper that holds toolbar, table and pagination. */
|
|
285
|
+
rootClass?: string;
|
|
237
286
|
}
|
|
238
287
|
|
|
239
|
-
const {
|
|
288
|
+
const {
|
|
289
|
+
class: className = "",
|
|
290
|
+
interactive = false,
|
|
291
|
+
stickyHeader = false,
|
|
292
|
+
pinnedColumns = 0,
|
|
293
|
+
maxHeight,
|
|
294
|
+
loading = false,
|
|
295
|
+
totalCount,
|
|
296
|
+
rootClass = "",
|
|
297
|
+
...rest
|
|
298
|
+
} = Astro.props as Props;
|
|
299
|
+
|
|
300
|
+
const hasToolbar = Astro.slots.has("toolbar");
|
|
301
|
+
const hasBulk = Astro.slots.has("bulk");
|
|
302
|
+
const hasBanner = Astro.slots.has("banner");
|
|
303
|
+
const hasPagination = Astro.slots.has("pagination");
|
|
240
304
|
---
|
|
241
305
|
|
|
242
|
-
<div
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
306
|
+
<div
|
|
307
|
+
data-slot="table-root"
|
|
308
|
+
data-interactive={interactive ? "" : undefined}
|
|
309
|
+
data-sticky-header={stickyHeader ? "" : undefined}
|
|
310
|
+
data-pinned-columns={pinnedColumns || undefined}
|
|
311
|
+
data-loading={loading ? "" : undefined}
|
|
312
|
+
data-total-count={totalCount}
|
|
313
|
+
class={cn("group/table relative flex w-full flex-col", rootClass)}
|
|
314
|
+
>
|
|
315
|
+
{
|
|
316
|
+
(hasToolbar || hasBulk) && (
|
|
317
|
+
<div data-slot="table-toolbar-region" class="flex min-h-14 flex-col justify-center">
|
|
318
|
+
{hasToolbar && (
|
|
319
|
+
<div data-slot="table-toolbar" class="group-data-[has-selection]/table:hidden">
|
|
320
|
+
<slot name="toolbar" />
|
|
321
|
+
</div>
|
|
322
|
+
)}
|
|
323
|
+
{hasBulk && (
|
|
324
|
+
<div data-slot="table-bulk-region" class="hidden group-data-[has-selection]/table:block">
|
|
325
|
+
<slot name="bulk" />
|
|
326
|
+
</div>
|
|
327
|
+
)}
|
|
328
|
+
</div>
|
|
329
|
+
)
|
|
330
|
+
}
|
|
331
|
+
{hasBanner && <slot name="banner" />}
|
|
332
|
+
<div
|
|
333
|
+
data-slot="table-container"
|
|
334
|
+
class="relative w-full overflow-auto"
|
|
335
|
+
style={maxHeight ? `max-height: ${maxHeight}` : undefined}
|
|
247
336
|
>
|
|
248
|
-
<
|
|
249
|
-
|
|
337
|
+
<table
|
|
338
|
+
data-slot="table"
|
|
339
|
+
aria-busy={loading ? "true" : undefined}
|
|
340
|
+
class={cn(
|
|
341
|
+
"w-full caption-bottom border-separate border-spacing-0 text-sm",
|
|
342
|
+
"[&_tbody]:transition-opacity group-data-[loading]/table:[&_tbody]:opacity-50",
|
|
343
|
+
className,
|
|
344
|
+
)}
|
|
345
|
+
{...rest}
|
|
346
|
+
>
|
|
347
|
+
<slot />
|
|
348
|
+
</table>
|
|
349
|
+
</div>
|
|
350
|
+
{hasPagination && <slot name="pagination" />}
|
|
351
|
+
{interactive && <div data-slot="table-live" class="sr-only" aria-live="polite" aria-atomic="true" />}
|
|
250
352
|
</div>
|
|
353
|
+
|
|
354
|
+
<script>
|
|
355
|
+
import { initTables } from "@cl-light-ds/ui/lib/table-controller";
|
|
356
|
+
|
|
357
|
+
initTables();
|
|
358
|
+
</script>
|
|
@@ -12,7 +12,6 @@ const {
|
|
|
12
12
|
} = Astro.props as Props;
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
<tbody data-slot="table-body" class={cn("
|
|
15
|
+
<tbody data-slot="table-body" class={cn("", className)} {...rest}>
|
|
16
16
|
<slot />
|
|
17
17
|
</tbody>
|
|
18
|
-
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { X } from "@lucide/astro";
|
|
3
|
+
import { cn } from "@cl-light-ds/ui/lib/utils";
|
|
4
|
+
import type { HTMLAttributes } from "astro/types";
|
|
5
|
+
import { Badge } from "../badge";
|
|
6
|
+
|
|
7
|
+
interface Props extends HTMLAttributes<"div"> {
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const { class: className = "", ...rest } = Astro.props as Props;
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<div
|
|
15
|
+
data-slot="table-bulk-toolbar"
|
|
16
|
+
role="toolbar"
|
|
17
|
+
aria-label="Bulk actions"
|
|
18
|
+
class={cn(
|
|
19
|
+
"flex min-h-14 items-center justify-between gap-3 rounded-lg border border-primary/15 bg-table-row-selected px-4 py-2",
|
|
20
|
+
className,
|
|
21
|
+
)}
|
|
22
|
+
{...rest}
|
|
23
|
+
>
|
|
24
|
+
<Badge
|
|
25
|
+
as="button"
|
|
26
|
+
type="button"
|
|
27
|
+
data-table-action="clear-selection"
|
|
28
|
+
aria-label="Clear selection"
|
|
29
|
+
class="cursor-pointer"
|
|
30
|
+
>
|
|
31
|
+
<span><span data-slot="table-selection-count">0</span> selected</span>
|
|
32
|
+
<X slot="tail-icon" aria-hidden="true" />
|
|
33
|
+
</Badge>
|
|
34
|
+
<div class="flex items-center gap-3">
|
|
35
|
+
<slot />
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
@@ -1,20 +1,44 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { cn } from "@cl-light-ds/ui/lib/utils";
|
|
3
3
|
import type { HTMLAttributes } from "astro/types";
|
|
4
|
+
import { cellAlign, cellBase, levelIndentStyle, type CellAlign } from "./table-cell-variants";
|
|
4
5
|
|
|
5
6
|
interface Props extends HTMLAttributes<"td"> {
|
|
6
7
|
class?: string;
|
|
8
|
+
/** Column key, matched against `TableHead` `column` for hide/pin/resize. */
|
|
9
|
+
column?: string;
|
|
10
|
+
align?: CellAlign;
|
|
11
|
+
/** Number content: right-aligned, semibold, tabular figures. */
|
|
12
|
+
numeric?: boolean;
|
|
13
|
+
/** Nesting level (1–3). Indents the cell content 20px per level. */
|
|
14
|
+
level?: 1 | 2 | 3;
|
|
7
15
|
}
|
|
8
16
|
|
|
9
17
|
const {
|
|
10
18
|
class: className = "",
|
|
19
|
+
column,
|
|
20
|
+
numeric = false,
|
|
21
|
+
align = numeric ? "right" : "left",
|
|
22
|
+
level,
|
|
23
|
+
style,
|
|
11
24
|
...rest
|
|
12
25
|
} = Astro.props as Props;
|
|
26
|
+
|
|
27
|
+
const indent = levelIndentStyle(level);
|
|
13
28
|
---
|
|
14
29
|
|
|
15
30
|
<td
|
|
16
31
|
data-slot="table-cell"
|
|
17
|
-
|
|
32
|
+
data-column={column}
|
|
33
|
+
style={indent ? [indent, typeof style === "string" ? style : ""].filter(Boolean).join("; ") : style}
|
|
34
|
+
class={cn(
|
|
35
|
+
cellBase,
|
|
36
|
+
cellAlign({ align }),
|
|
37
|
+
"h-12 py-2 font-medium",
|
|
38
|
+
numeric && "font-semibold tabular-nums",
|
|
39
|
+
"[&:has([type=checkbox])]:w-15 [&:has([type=checkbox])]:text-center",
|
|
40
|
+
className,
|
|
41
|
+
)}
|
|
18
42
|
{...rest}
|
|
19
43
|
>
|
|
20
44
|
<slot />
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { cn } from "@cl-light-ds/ui/lib/utils";
|
|
3
|
+
import type { HTMLAttributes } from "astro/types";
|
|
4
|
+
|
|
5
|
+
interface Props extends HTMLAttributes<"div"> {
|
|
6
|
+
class?: string;
|
|
7
|
+
/** Secondary line under the label (Figma "2-Line Text"). */
|
|
8
|
+
subtitle?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const { class: className = "", subtitle, ...rest } = Astro.props as Props;
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<div data-slot="table-cell-text" class={cn("flex min-w-0 flex-col gap-0.5", className)} {...rest}>
|
|
15
|
+
<span class="truncate text-sm leading-5 font-medium text-foreground"><slot /></span>
|
|
16
|
+
{subtitle && <span class="truncate text-xs leading-4 font-normal text-muted-foreground">{subtitle}</span>}
|
|
17
|
+
</div>
|