@acronis-platform/ui-react 2.0.0 → 4.0.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/dist/components/ui/accordion-container/accordion-container.js +144 -0
- package/dist/components/ui/accordion-container/accordion-container.js.map +1 -0
- package/dist/components/ui/app-shell-chat/app-shell-chat.js.map +1 -1
- package/dist/components/ui/area-chart/area-chart.js +141 -139
- package/dist/components/ui/area-chart/area-chart.js.map +1 -1
- package/dist/components/ui/avatar/avatar.js +33 -22
- package/dist/components/ui/avatar/avatar.js.map +1 -1
- package/dist/components/ui/bar-chart/bar-chart.js +295 -293
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/card/card.js +150 -74
- package/dist/components/ui/card/card.js.map +1 -1
- package/dist/components/ui/card-section/card-section.js +111 -0
- package/dist/components/ui/card-section/card-section.js.map +1 -0
- package/dist/components/ui/category-bar/category-bar.js +109 -93
- package/dist/components/ui/category-bar/category-bar.js.map +1 -1
- package/dist/components/ui/chart/chart-palette.js +113 -0
- package/dist/components/ui/chart/chart-palette.js.map +1 -0
- package/dist/components/ui/chart/chart.js +176 -129
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/chart-state/chart-state-illustrations.js +310 -0
- package/dist/components/ui/chart-state/chart-state-illustrations.js.map +1 -0
- package/dist/components/ui/chart-state/chart-state.js +48 -34
- package/dist/components/ui/chart-state/chart-state.js.map +1 -1
- package/dist/components/ui/chart-widget/chart-widget.js +87 -0
- package/dist/components/ui/chart-widget/chart-widget.js.map +1 -0
- package/dist/components/ui/composed-chart/composed-chart.js +117 -115
- package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
- package/dist/components/ui/confidence-cone/confidence-cone.js +166 -158
- package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
- package/dist/components/ui/data-table/data-table.js +4 -2
- package/dist/components/ui/data-table/data-table.js.map +1 -1
- package/dist/components/ui/empty-overlay/empty-overlay.js +49 -0
- package/dist/components/ui/empty-overlay/empty-overlay.js.map +1 -0
- package/dist/components/ui/funnel-chart/funnel-chart.js +162 -161
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
- package/dist/components/ui/histogram/histogram.js +94 -92
- package/dist/components/ui/histogram/histogram.js.map +1 -1
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/label/label.js +2 -9
- package/dist/components/ui/label/label.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.js +143 -141
- package/dist/components/ui/line-chart/line-chart.js.map +1 -1
- package/dist/components/ui/metric/metric.js +74 -185
- package/dist/components/ui/metric/metric.js.map +1 -1
- package/dist/components/ui/page-content/page-content.js.map +1 -1
- package/dist/components/ui/pie-chart/pie-chart.js +201 -195
- package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
- package/dist/components/ui/radar-chart/radar-chart.js +133 -131
- package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +297 -265
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
- package/dist/components/ui/sankey-chart/sankey-chart.js +123 -101
- package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -1
- package/dist/components/ui/scatter-chart/scatter-chart.js +76 -74
- package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
- package/dist/components/ui/section/section.js +157 -31
- package/dist/components/ui/section/section.js.map +1 -1
- package/dist/components/ui/stepper/stepper.js +24 -24
- package/dist/components/ui/stepper/stepper.js.map +1 -1
- package/dist/components/ui/stepper-item/stepper-item.js +43 -24
- package/dist/components/ui/stepper-item/stepper-item.js.map +1 -1
- package/dist/components/ui/table/table.js +27 -27
- package/dist/components/ui/table/table.js.map +1 -1
- package/dist/components/ui/treemap/treemap.js +133 -124
- package/dist/components/ui/treemap/treemap.js.map +1 -1
- package/dist/components/ui/trend-indicator/trend-indicator.js +34 -69
- package/dist/components/ui/trend-indicator/trend-indicator.js.map +1 -1
- package/dist/components/ui/wizard/wizard.js +59 -0
- package/dist/components/ui/wizard/wizard.js.map +1 -0
- package/dist/hooks/use-wizard.js +75 -0
- package/dist/hooks/use-wizard.js.map +1 -0
- package/dist/index.js +540 -525
- package/dist/index.js.map +1 -1
- package/dist/llms/accordion-container.md +181 -0
- package/dist/llms/accordion.md +124 -0
- package/dist/llms/alert.md +225 -0
- package/dist/llms/app-shell-chat.md +415 -0
- package/dist/llms/area-chart.md +355 -0
- package/dist/llms/avatar.md +208 -0
- package/dist/llms/bar-chart.md +406 -0
- package/dist/llms/breadcrumb.md +326 -0
- package/dist/llms/button-group.md +298 -0
- package/dist/llms/button-icon-input.md +142 -0
- package/dist/llms/button-icon-menu.md +209 -0
- package/dist/llms/button-icon.md +128 -0
- package/dist/llms/button-menu.md +172 -0
- package/dist/llms/button.md +185 -0
- package/dist/llms/calendar-panel.md +733 -0
- package/dist/llms/calendar.md +188 -0
- package/dist/llms/card-filter.md +214 -0
- package/dist/llms/card-section.md +293 -0
- package/dist/llms/card.md +447 -0
- package/dist/llms/carousel-dialog.md +156 -0
- package/dist/llms/category-bar.md +193 -0
- package/dist/llms/chart-state.md +190 -0
- package/dist/llms/chart-widget.md +209 -0
- package/dist/llms/chart.md +182 -0
- package/dist/llms/checkbox.md +257 -0
- package/dist/llms/chip.md +195 -0
- package/dist/llms/combobox.md +164 -0
- package/dist/llms/composed-chart.md +508 -0
- package/dist/llms/confidence-cone.md +277 -0
- package/dist/llms/data-table.md +474 -0
- package/dist/llms/date-range-picker.md +272 -0
- package/dist/llms/description-list.md +131 -0
- package/dist/llms/dialog-footer-carousel.md +147 -0
- package/dist/llms/dialog-footer-default.md +142 -0
- package/dist/llms/dialog-root.md +246 -0
- package/dist/llms/dialog-welcome.md +223 -0
- package/dist/llms/dialog.md +403 -0
- package/dist/llms/dropdown-menu.md +193 -0
- package/dist/llms/empty-overlay.md +146 -0
- package/dist/llms/empty.md +156 -0
- package/dist/llms/field.md +185 -0
- package/dist/llms/filter-cards.md +157 -0
- package/dist/llms/filter-chips.md +323 -0
- package/dist/llms/filter-search.md +512 -0
- package/dist/llms/form.md +154 -0
- package/dist/llms/funnel-chart.md +333 -0
- package/dist/llms/grid.md +80 -0
- package/dist/llms/histogram.md +190 -0
- package/dist/llms/input-date-picker.md +203 -0
- package/dist/llms/input-otp.md +173 -0
- package/dist/llms/input-password.md +197 -0
- package/dist/llms/input-search.md +170 -0
- package/dist/llms/input-select.md +278 -0
- package/dist/llms/input-text-area.md +271 -0
- package/dist/llms/input-text.md +192 -0
- package/dist/llms/line-chart.md +369 -0
- package/dist/llms/link.md +209 -0
- package/dist/llms/loading.md +130 -0
- package/dist/llms/meter.md +177 -0
- package/dist/llms/metric.md +204 -0
- package/dist/llms/number-field.md +122 -0
- package/dist/llms/page-content.md +69 -0
- package/dist/llms/page-header.md +182 -0
- package/dist/llms/pagination.md +133 -0
- package/dist/llms/pie-chart.md +307 -0
- package/dist/llms/popover.md +252 -0
- package/dist/llms/progress-circle.md +126 -0
- package/dist/llms/progress.md +111 -0
- package/dist/llms/radar-chart.md +316 -0
- package/dist/llms/radial-bar-chart.md +319 -0
- package/dist/llms/radio.md +255 -0
- package/dist/llms/resizable.md +195 -0
- package/dist/llms/sankey-chart.md +208 -0
- package/dist/llms/scatter-chart.md +239 -0
- package/dist/llms/scroll-area.md +183 -0
- package/dist/llms/section.md +401 -0
- package/dist/llms/select.md +210 -0
- package/dist/llms/separator.md +87 -0
- package/dist/llms/sheet.md +202 -0
- package/dist/llms/sidebar-primary.md +360 -0
- package/dist/llms/sidebar-secondary.md +417 -0
- package/dist/llms/skeleton.md +81 -0
- package/dist/llms/slider.md +97 -0
- package/dist/llms/spinner.md +100 -0
- package/dist/llms/stack.md +80 -0
- package/dist/llms/stepper-item.md +309 -0
- package/dist/llms/stepper.md +251 -0
- package/dist/llms/switch.md +140 -0
- package/dist/llms/table.md +436 -0
- package/dist/llms/tabs.md +197 -0
- package/dist/llms/tag.md +139 -0
- package/dist/llms/timeline.md +361 -0
- package/dist/llms/timer.md +259 -0
- package/dist/llms/toast.md +241 -0
- package/dist/llms/toggle-group.md +121 -0
- package/dist/llms/toolbar.md +453 -0
- package/dist/llms/tooltip.md +164 -0
- package/dist/llms/treemap.md +254 -0
- package/dist/llms/trend-indicator.md +132 -0
- package/dist/llms/widget-placeholder.md +169 -0
- package/dist/llms/wizard.md +412 -0
- package/dist/llms.txt +142 -0
- package/dist/react.js +540 -525
- package/dist/react.js.map +1 -1
- package/dist/src/components/ui/accordion-container/accordion-container.d.ts +44 -0
- package/dist/src/components/ui/accordion-container/index.d.ts +1 -0
- package/dist/src/components/ui/area-chart/area-chart.d.ts +9 -4
- package/dist/src/components/ui/avatar/avatar.d.ts +27 -8
- package/dist/src/components/ui/bar-chart/bar-chart.d.ts +9 -4
- package/dist/src/components/ui/button/button.d.ts +1 -1
- package/dist/src/components/ui/card/card.d.ts +69 -8
- package/dist/src/components/ui/card/index.d.ts +1 -1
- package/dist/src/components/ui/card-section/card-section.d.ts +50 -0
- package/dist/src/components/ui/card-section/index.d.ts +1 -0
- package/dist/src/components/ui/category-bar/category-bar.d.ts +10 -4
- package/dist/src/components/ui/chart/__stories__/palette-control.d.ts +48 -0
- package/dist/src/components/ui/chart/__tests__/chart-palette.test.d.ts +1 -0
- package/dist/src/components/ui/chart/chart-palette.d.ts +128 -0
- package/dist/src/components/ui/chart/chart.d.ts +66 -15
- package/dist/src/components/ui/chart/index.d.ts +4 -2
- package/dist/src/components/ui/chart-state/chart-state-illustrations.d.ts +6 -0
- package/dist/src/components/ui/chart-state/chart-state.d.ts +13 -2
- package/dist/src/components/ui/chart-state/index.d.ts +1 -0
- package/dist/src/components/ui/chart-widget/chart-widget.d.ts +64 -0
- package/dist/src/components/ui/chart-widget/index.d.ts +1 -0
- package/dist/src/components/ui/composed-chart/composed-chart.d.ts +12 -7
- package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +10 -5
- package/dist/src/components/ui/dialog/dialog.d.ts +1 -1
- package/dist/src/components/ui/empty-overlay/empty-overlay.d.ts +20 -0
- package/dist/src/components/ui/empty-overlay/index.d.ts +2 -0
- package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +11 -5
- package/dist/src/components/ui/grid/grid.d.ts +1 -1
- package/dist/src/components/ui/histogram/histogram.d.ts +10 -4
- package/dist/src/components/ui/label/index.d.ts +1 -1
- package/dist/src/components/ui/label/label.d.ts +1 -5
- package/dist/src/components/ui/line-chart/line-chart.d.ts +9 -4
- package/dist/src/components/ui/metric/metric.d.ts +13 -14
- package/dist/src/components/ui/pie-chart/pie-chart.d.ts +17 -8
- package/dist/src/components/ui/radar-chart/radar-chart.d.ts +10 -5
- package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +17 -6
- package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +10 -5
- package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +10 -5
- package/dist/src/components/ui/section/index.d.ts +1 -1
- package/dist/src/components/ui/section/section.d.ts +75 -6
- package/dist/src/components/ui/sheet/sheet.d.ts +1 -1
- package/dist/src/components/ui/stack/stack.d.ts +1 -1
- package/dist/src/components/ui/stepper-item/stepper-item.d.ts +6 -5
- package/dist/src/components/ui/tag/tag.d.ts +1 -1
- package/dist/src/components/ui/treemap/treemap.d.ts +11 -5
- package/dist/src/components/ui/trend-indicator/trend-indicator.d.ts +3 -7
- package/dist/src/components/ui/wizard/index.d.ts +1 -0
- package/dist/src/components/ui/wizard/wizard.d.ts +6 -0
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/use-wizard.d.ts +80 -0
- package/dist/src/index.d.ts +5 -3
- package/dist/ui-react.css +1 -1
- package/package.json +12 -6
- package/dist/components/ui/app-shell/app-shell.js +0 -75
- package/dist/components/ui/app-shell/app-shell.js.map +0 -1
- package/dist/components/ui/auth-layout/auth-layout.js +0 -56
- package/dist/components/ui/auth-layout/auth-layout.js.map +0 -1
- package/dist/components/ui/collapsible/collapsible.js +0 -22
- package/dist/components/ui/collapsible/collapsible.js.map +0 -1
- package/dist/src/components/ui/app-shell/app-shell.d.ts +0 -8
- package/dist/src/components/ui/app-shell/index.d.ts +0 -1
- package/dist/src/components/ui/auth-layout/auth-layout.d.ts +0 -6
- package/dist/src/components/ui/auth-layout/index.d.ts +0 -1
- package/dist/src/components/ui/collapsible/collapsible.d.ts +0 -5
- package/dist/src/components/ui/collapsible/index.d.ts +0 -1
- package/dist/src/components/ui/label/label.docs.d.ts +0 -10
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
import { jsxs as e, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import * as f from "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
const
|
|
3
|
+
import { cn as x } from "../../../lib/utils.js";
|
|
4
|
+
const v = f.forwardRef(
|
|
5
5
|
({
|
|
6
|
-
className:
|
|
7
|
-
children:
|
|
8
|
-
currentStep:
|
|
9
|
-
totalSteps:
|
|
6
|
+
className: r,
|
|
7
|
+
children: l,
|
|
8
|
+
currentStep: p,
|
|
9
|
+
totalSteps: s,
|
|
10
10
|
current: i,
|
|
11
11
|
next: t,
|
|
12
12
|
stepLabel: n = "Step",
|
|
13
|
-
ofLabel:
|
|
13
|
+
ofLabel: o = "of",
|
|
14
14
|
nextLabel: d = "Next:",
|
|
15
|
-
separatorLabel:
|
|
15
|
+
separatorLabel: c = ": ",
|
|
16
16
|
...m
|
|
17
|
-
},
|
|
17
|
+
}, u) => /* @__PURE__ */ e(
|
|
18
18
|
"div",
|
|
19
19
|
{
|
|
20
|
-
ref:
|
|
20
|
+
ref: u,
|
|
21
21
|
"data-slot": "stepper",
|
|
22
|
-
className:
|
|
22
|
+
className: x("w-full", r),
|
|
23
23
|
...m,
|
|
24
24
|
children: [
|
|
25
25
|
/* @__PURE__ */ e(
|
|
26
26
|
"div",
|
|
27
27
|
{
|
|
28
28
|
"data-slot": "stepper-summary",
|
|
29
|
-
className: "flex flex-col gap-[var(--ui-gap
|
|
29
|
+
className: "flex flex-col gap-[var(--ui-stepper-breakpoint-default-line-gap)] text-sm leading-6 lg:hidden",
|
|
30
30
|
children: [
|
|
31
31
|
/* @__PURE__ */ e("p", { "data-slot": "stepper-current-line", children: [
|
|
32
|
-
/* @__PURE__ */ e("span", { className: "text-[var(--ui-
|
|
32
|
+
/* @__PURE__ */ e("span", { className: "text-[var(--ui-stepper-breakpoint-default-label-color)]", children: [
|
|
33
33
|
n,
|
|
34
34
|
" ",
|
|
35
|
-
|
|
35
|
+
p,
|
|
36
36
|
" ",
|
|
37
|
-
|
|
37
|
+
o,
|
|
38
38
|
" ",
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
s,
|
|
40
|
+
c
|
|
41
41
|
] }),
|
|
42
|
-
/* @__PURE__ */ a("span", { className: "text-[var(--ui-
|
|
42
|
+
/* @__PURE__ */ a("span", { className: "text-[var(--ui-stepper-breakpoint-default-value-color)]", children: i })
|
|
43
43
|
] }),
|
|
44
44
|
t != null && /* @__PURE__ */ e("p", { "data-slot": "stepper-next-line", children: [
|
|
45
|
-
/* @__PURE__ */ e("span", { className: "text-[var(--ui-
|
|
45
|
+
/* @__PURE__ */ e("span", { className: "text-[var(--ui-stepper-breakpoint-default-label-color)]", children: [
|
|
46
46
|
d,
|
|
47
47
|
" "
|
|
48
48
|
] }),
|
|
49
|
-
/* @__PURE__ */ a("span", { className: "text-[var(--ui-
|
|
49
|
+
/* @__PURE__ */ a("span", { className: "text-[var(--ui-stepper-breakpoint-default-value-color)]", children: t })
|
|
50
50
|
] })
|
|
51
51
|
]
|
|
52
52
|
}
|
|
@@ -55,16 +55,16 @@ const h = f.forwardRef(
|
|
|
55
55
|
"div",
|
|
56
56
|
{
|
|
57
57
|
"data-slot": "stepper-items",
|
|
58
|
-
className: "hidden flex-wrap content-start items-start justify-start gap-[var(--ui-gap
|
|
59
|
-
children:
|
|
58
|
+
className: "hidden flex-wrap content-start items-start justify-start gap-[var(--ui-stepper-breakpoint-lg-container-gap)] lg:flex",
|
|
59
|
+
children: l
|
|
60
60
|
}
|
|
61
61
|
)
|
|
62
62
|
]
|
|
63
63
|
}
|
|
64
64
|
)
|
|
65
65
|
);
|
|
66
|
-
|
|
66
|
+
v.displayName = "Stepper";
|
|
67
67
|
export {
|
|
68
|
-
|
|
68
|
+
v as Stepper
|
|
69
69
|
};
|
|
70
70
|
//# sourceMappingURL=stepper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepper.js","sources":["../../../../src/components/ui/stepper/stepper.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\n// The stepper root. It renders the sequence two ways and lets CSS pick one:\n// a start-aligned, wrapping row of `StepperItem` children on wide viewports, and a\n// two-line text summary (\"Step 3 of 5: <current>\" / \"Next: <next>\") on narrow\n// ones. There is no `variant` prop and no `cva`: the only axis the design has\n// is the viewport width, which is not something JS decides here.\n//\n// ── Why a real media query, and why both trees always render ──\n// The Figma component models the two layouts as a `breakpoint` variant\n// (`0-1024` / `>1025`). In code that is a viewport media query, so it is\n// expressed with Tailwind's stock `lg:` variant (`hidden lg:flex` /\n// `flex lg:hidden`) rather than a `ResizeObserver`. `page-header.tsx`'s\n// `useRowOverflow` hook is deliberately *not* reused: that measures whether\n// content fits its own container (a content-fit problem), which is a different\n// question from \"how wide is the viewport\". A media query needs no measuring\n// pass, no hydration mismatch, and no layout thrash.\n//\n// Consequence, and it is intentional: **both subtrees are always in the DOM**,\n// and only their visibility differs. Nothing is `aria-hidden`, because which\n// tree is showing is not knowable from JS — the browser decides it in CSS.\n// That is correct rather than a compromise: `hidden` / `lg:hidden` resolve to\n// `display: none`, and a `display: none` subtree is not exposed to assistive\n// tech, so exactly one of the two is announced at any width. In jsdom, though,\n// no media query is evaluated, so unit tests see both at once.\n//\n// ── Breakpoint boundary: 1024, not 1025 ──\n// Figma's variant names say `0-1024` and `>1025`, which leaves 1024px itself\n// ambiguous and 1025 as the first \"desktop\" pixel. Tailwind's `lg:` is\n// `@media (min-width: 64rem)` = exactly 1024px (see the `@theme` block in\n// `src/styles/index.css` and `BREAKPOINT_LG` in `src/lib/breakpoints.ts`), so\n// 1024px renders the desktop row here. That 1px difference is accepted rather\n// than hand-rolling a one-off `1025px` query: the repo already pins the design\n// team's ranges to clean rem values and documents the rounding where it differs\n// (see the comments in `src/stories/breakpoints-demo.stories.tsx`), and\n// inventing a bespoke breakpoint for one component would put it out of step\n// with every other responsive surface in the kit.\n//\n// ──
|
|
1
|
+
{"version":3,"file":"stepper.js","sources":["../../../../src/components/ui/stepper/stepper.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\n// The stepper root. It renders the sequence two ways and lets CSS pick one:\n// a start-aligned, wrapping row of `StepperItem` children on wide viewports, and a\n// two-line text summary (\"Step 3 of 5: <current>\" / \"Next: <next>\") on narrow\n// ones. There is no `variant` prop and no `cva`: the only axis the design has\n// is the viewport width, which is not something JS decides here.\n//\n// ── Why a real media query, and why both trees always render ──\n// The Figma component models the two layouts as a `breakpoint` variant\n// (`0-1024` / `>1025`). In code that is a viewport media query, so it is\n// expressed with Tailwind's stock `lg:` variant (`hidden lg:flex` /\n// `flex lg:hidden`) rather than a `ResizeObserver`. `page-header.tsx`'s\n// `useRowOverflow` hook is deliberately *not* reused: that measures whether\n// content fits its own container (a content-fit problem), which is a different\n// question from \"how wide is the viewport\". A media query needs no measuring\n// pass, no hydration mismatch, and no layout thrash.\n//\n// Consequence, and it is intentional: **both subtrees are always in the DOM**,\n// and only their visibility differs. Nothing is `aria-hidden`, because which\n// tree is showing is not knowable from JS — the browser decides it in CSS.\n// That is correct rather than a compromise: `hidden` / `lg:hidden` resolve to\n// `display: none`, and a `display: none` subtree is not exposed to assistive\n// tech, so exactly one of the two is announced at any width. In jsdom, though,\n// no media query is evaluated, so unit tests see both at once.\n//\n// ── Breakpoint boundary: 1024, not 1025 ──\n// Figma's variant names say `0-1024` and `>1025`, which leaves 1024px itself\n// ambiguous and 1025 as the first \"desktop\" pixel. Tailwind's `lg:` is\n// `@media (min-width: 64rem)` = exactly 1024px (see the `@theme` block in\n// `src/styles/index.css` and `BREAKPOINT_LG` in `src/lib/breakpoints.ts`), so\n// 1024px renders the desktop row here. That 1px difference is accepted rather\n// than hand-rolling a one-off `1025px` query: the repo already pins the design\n// team's ranges to clean rem values and documents the rounding where it differs\n// (see the comments in `src/stories/breakpoints-demo.stories.tsx`), and\n// inventing a bespoke breakpoint for one component would put it out of step\n// with every other responsive surface in the kit.\n//\n// ── Tokens — dedicated `--ui-stepper-*` tier (2026-08-24) ──\n// Re-synced from Figma: @acronis-platform/tokens-pd now ships a `Stepper` tier\n// (see `packages/tokens-pd/css/Stepper/default.css`), which replaces the\n// semantic/generic placeholder tokens (`--ui-gap-4`, `--ui-text-on-surface-*`)\n// this component used before that tier existed:\n//\n// --ui-stepper-breakpoint-default-line-gap -> the summary's two-line gap\n// --ui-stepper-breakpoint-default-label-color -> the \"Step X of Y:\" / \"Next:\" prefix\n// --ui-stepper-breakpoint-default-value-color -> the current/next step name\n// --ui-stepper-breakpoint-lg-container-gap -> the wide item row's gap\n//\n// The tier defines one shared `value-color`/`label-color` pair for both the\n// current-step line and the next-step line, so a single token covers both.\n\nexport interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * The `StepperItem` elements making up the sequence. Rendered in the wide\n * (>= 1024px) layout only — the compact layout is a text summary and shows no\n * items at all.\n */\n children?: React.ReactNode;\n /** 1-based index of the step the user is on, e.g. `3`. Compact layout only. */\n currentStep: React.ReactNode;\n /** How many steps there are in total, e.g. `5`. Compact layout only. */\n totalSteps: React.ReactNode;\n /** The current step's name. Compact layout only. */\n current: React.ReactNode;\n /**\n * The next step's name. Omit it — on the last step, say — and the whole\n * \"Next: …\" line is left out rather than rendered empty. Compact layout only.\n */\n next?: React.ReactNode;\n /**\n * The word introducing the step counter. A prop, not an inlined literal, so\n * the string can be translated (see `context/conventions.md` §\"Localization —\n * no hardcoded labels\"): this component generates the text itself, unlike the\n * step names, which the caller supplies.\n */\n stepLabel?: string;\n /** The word joining the current step number to the total. Translatable — see `stepLabel`. */\n ofLabel?: string;\n /** The label introducing the next step's name. Translatable — see `stepLabel`. */\n nextLabel?: string;\n /**\n * The punctuation joining the step counter to the current step's name. A prop\n * for the same reason as `stepLabel`: the component generates it, and not every\n * locale writes it as `\": \"` (French, say, spaces before the colon; CJK uses a\n * full-width one).\n */\n separatorLabel?: string;\n}\n\nconst Stepper = React.forwardRef<HTMLDivElement, StepperProps>(\n (\n {\n className,\n children,\n currentStep,\n totalSteps,\n current,\n next,\n stepLabel = 'Step',\n ofLabel = 'of',\n nextLabel = 'Next:',\n separatorLabel = ': ',\n ...props\n },\n ref\n ) => (\n <div\n ref={ref}\n data-slot=\"stepper\"\n className={cn('w-full', className)}\n {...props}\n >\n {/* Compact summary — the only thing visible below the `lg` breakpoint. */}\n <div\n data-slot=\"stepper-summary\"\n className=\"flex flex-col gap-[var(--ui-stepper-breakpoint-default-line-gap)] text-sm leading-6 lg:hidden\"\n >\n <p data-slot=\"stepper-current-line\">\n <span className=\"text-[var(--ui-stepper-breakpoint-default-label-color)]\">\n {stepLabel} {currentStep} {ofLabel} {totalSteps}\n {separatorLabel}\n </span>\n <span className=\"text-[var(--ui-stepper-breakpoint-default-value-color)]\">\n {current}\n </span>\n </p>\n {next != null && (\n <p data-slot=\"stepper-next-line\">\n <span className=\"text-[var(--ui-stepper-breakpoint-default-label-color)]\">\n {nextLabel}{' '}\n </span>\n <span className=\"text-[var(--ui-stepper-breakpoint-default-value-color)]\">\n {next}\n </span>\n </p>\n )}\n </div>\n\n {/* The item row — hidden below `lg`, where the summary replaces it. */}\n <div\n data-slot=\"stepper-items\"\n className=\"hidden flex-wrap content-start items-start justify-start gap-[var(--ui-stepper-breakpoint-lg-container-gap)] lg:flex\"\n >\n {children}\n </div>\n </div>\n )\n);\nStepper.displayName = 'Stepper';\n\nexport { Stepper };\n"],"names":["Stepper","React","className","children","currentStep","totalSteps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QAAA;AAAA,QAKJ,gBAAAS;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,aAAU;AAAA,YACV,WAAU;AAAA,YAET,UAAAb;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAGN;AACAH,EAAQ,cAAc;"}
|
|
@@ -1,36 +1,55 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as l, Fragment as m, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
3
|
import { mergeProps as v } from "@base-ui/react/merge-props";
|
|
4
|
-
import { useRender as
|
|
4
|
+
import { useRender as b } from "@base-ui/react/use-render";
|
|
5
5
|
import { cva as g } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
6
|
-
import { cn as
|
|
7
|
-
const
|
|
8
|
-
"inline-flex items-center gap-[var(--ui-gap
|
|
6
|
+
import { cn as f } from "../../../lib/utils.js";
|
|
7
|
+
const x = g(
|
|
8
|
+
"ui-stepper-item-global-container-text-style inline-flex items-center gap-[var(--ui-stepper-item-global-container-gap)] rounded-[var(--ui-stepper-item-global-container-border-radius)] border-[length:var(--ui-stepper-item-current-container-border-width)] border-solid border-transparent ps-[var(--ui-stepper-item-global-container-padding-l)] pe-[var(--ui-stepper-item-global-container-padding-r)] py-[var(--ui-stepper-item-global-container-padding-y)] outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)]",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
current: "bg-[var(--ui-
|
|
13
|
-
completed: "text-[var(--ui-
|
|
14
|
-
future: "pointer-events-none
|
|
12
|
+
current: "border-[var(--ui-stepper-item-current-container-border-color)] bg-[var(--ui-stepper-item-current-container-color)] text-[var(--ui-stepper-item-current-label-color)]",
|
|
13
|
+
completed: "text-[var(--ui-stepper-item-completed-label-color)]",
|
|
14
|
+
future: "pointer-events-none bg-[var(--ui-stepper-item-future-container-color)] text-[var(--ui-stepper-item-future-label-color)]"
|
|
15
15
|
},
|
|
16
16
|
// Declared as an axis so the variant x state matrix below can key off it;
|
|
17
17
|
// on its own it paints nothing, because only `completed` reacts to it.
|
|
18
|
+
// Every state — `idle` included — gets its own token in that matrix, so a
|
|
19
|
+
// brand override on any one of them is honored (the convention in
|
|
20
|
+
// `context/conventions.md`: wire each state to its own token even when the
|
|
21
|
+
// default brand's value happens to match another's).
|
|
18
22
|
state: {
|
|
19
23
|
idle: "",
|
|
20
24
|
hover: "",
|
|
21
|
-
active: ""
|
|
25
|
+
active: "",
|
|
26
|
+
focus: ""
|
|
22
27
|
}
|
|
23
28
|
},
|
|
24
29
|
compoundVariants: [
|
|
30
|
+
{
|
|
31
|
+
variant: "completed",
|
|
32
|
+
state: "idle",
|
|
33
|
+
class: "bg-[var(--ui-stepper-item-completed-container-color-idle)]"
|
|
34
|
+
},
|
|
25
35
|
{
|
|
26
36
|
variant: "completed",
|
|
27
37
|
state: "hover",
|
|
28
|
-
class: "bg-[var(--ui-
|
|
38
|
+
class: "bg-[var(--ui-stepper-item-completed-container-color-hover)]"
|
|
29
39
|
},
|
|
30
40
|
{
|
|
31
41
|
variant: "completed",
|
|
32
42
|
state: "active",
|
|
33
|
-
class: "bg-[var(--ui-
|
|
43
|
+
class: "bg-[var(--ui-stepper-item-completed-container-color-active)]"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
// `-focus-ring` resolves to the exact same value as `--ui-focus-primary`
|
|
47
|
+
// (verified in tokens-pd) — it names a ring color, not a fill, so this
|
|
48
|
+
// renders the same 3px ring `focus-visible` already draws automatically
|
|
49
|
+
// on a composed control, rather than a solid background.
|
|
50
|
+
variant: "completed",
|
|
51
|
+
state: "focus",
|
|
52
|
+
class: "ring-[3px] ring-[var(--ui-stepper-item-completed-container-color-focus-ring)]"
|
|
34
53
|
}
|
|
35
54
|
],
|
|
36
55
|
defaultVariants: {
|
|
@@ -38,17 +57,17 @@ const b = g(
|
|
|
38
57
|
state: "idle"
|
|
39
58
|
}
|
|
40
59
|
}
|
|
41
|
-
), h =
|
|
60
|
+
), h = d.forwardRef(
|
|
42
61
|
({
|
|
43
62
|
className: i,
|
|
44
63
|
variant: e = "current",
|
|
45
64
|
state: r = "idle",
|
|
46
|
-
avatar:
|
|
65
|
+
avatar: o,
|
|
47
66
|
label: t,
|
|
48
67
|
render: a,
|
|
49
68
|
children: n,
|
|
50
|
-
...
|
|
51
|
-
},
|
|
69
|
+
...p
|
|
70
|
+
}, s) => {
|
|
52
71
|
const c = {
|
|
53
72
|
"data-slot": "stepper-item",
|
|
54
73
|
"data-variant": e,
|
|
@@ -70,21 +89,21 @@ const b = g(
|
|
|
70
89
|
...a ? {} : { role: "link" }
|
|
71
90
|
} : {}
|
|
72
91
|
};
|
|
73
|
-
return
|
|
92
|
+
return b({
|
|
74
93
|
render: a,
|
|
75
|
-
ref:
|
|
94
|
+
ref: s,
|
|
76
95
|
defaultTagName: "div",
|
|
77
96
|
props: v(
|
|
78
97
|
{
|
|
79
98
|
...c,
|
|
80
|
-
className: x(
|
|
81
|
-
children: /* @__PURE__ */
|
|
82
|
-
|
|
83
|
-
t != null && /* @__PURE__ */
|
|
99
|
+
className: f(x({ variant: e, state: r }), i),
|
|
100
|
+
children: /* @__PURE__ */ l(m, { children: [
|
|
101
|
+
o,
|
|
102
|
+
t != null && /* @__PURE__ */ u("span", { className: "min-w-0 truncate", children: t }),
|
|
84
103
|
n
|
|
85
104
|
] })
|
|
86
105
|
},
|
|
87
|
-
|
|
106
|
+
p
|
|
88
107
|
)
|
|
89
108
|
});
|
|
90
109
|
}
|
|
@@ -92,6 +111,6 @@ const b = g(
|
|
|
92
111
|
h.displayName = "StepperItem";
|
|
93
112
|
export {
|
|
94
113
|
h as StepperItem,
|
|
95
|
-
|
|
114
|
+
x as stepperItemVariants
|
|
96
115
|
};
|
|
97
116
|
//# sourceMappingURL=stepper-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepper-item.js","sources":["../../../../src/components/ui/stepper-item/stepper-item.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// One step in a stepper: an Avatar marker (the step's number, icon, or image)\n// followed by the step name. `variant` is the step's structural role in the\n// sequence — `current` (where the user is), `completed` (already passed, and so\n// realistically clickable to jump back), `future` (not reachable yet). `state`\n// is the interaction state, and it only produces a different look on a\n// `completed` step: `current` is always painted in its highlighted look and\n// `future` is always painted disabled, which is exactly what the Figma component\n// set models — only five state x variant combos exist there\n// (active+current, idle/hover/active+completed, disabled+future).\n//\n// The Avatar is fully consumer-supplied and consumer-styled: this component\n// renders the element it is given verbatim and never sizes, tints, or recolors\n// it. That is why the Figma variables that color the digit *inside* the circle\n// (`components/Stepper/Item/{current,future}/label/color/*`) are deliberately\n// not consumed here — they belong to whatever the caller puts in the `avatar`\n// slot.\n//\n// ── Token substitution (placeholder — re-point once design ships the tier) ──\n// The design references `components/Stepper/Item/*`, which is not \"ready for\n// dev\": there is no `--ui-stepper-item-*` tier in @acronis-platform/tokens-pd\n// (a grep for `Stepper` across tokens-pd and the design-tokens source returns\n// nothing). Rather than hand-author values, this consumes the semantic/generic\n// tokens whose *resolved* value in `packages/tokens-pd/css/default.css` matches\n// the Figma variable exactly — verified value-by-value:\n//\n// components/Stepper/Item/_global/container/gap (8px) -> --ui-gap-8\n// components/Stepper/Item/_global/container/paddingY (8px) -> --ui-gap-8\n// (padding-x came through Figma as the generic `gap/gap-16`) -> --ui-gap-16\n// components/Stepper/Item/_global/container/borderRadius (8px) -> `rounded-lg`\n// components/Stepper/Item/_global/container/color/active (#e2ebf5) -> --ui-background-surface-active\n// components/Stepper/Item/_global/container/color/hover (#eef2f7) -> --ui-background-surface-hover\n// semantics/colors/text/onSurface/primary (#18191b) -> --ui-text-on-surface-primary\n// semantics/colors/text/onSurface/disabled (#afb2b6) -> --ui-text-on-surface-disabled\n//\n// The radius is the one exception that stays a static Tailwind utility: tokens-pd\n// has no generic radius scale at all — every `*border-radius*` token is\n// component-owned (e.g. `--ui-card-filter-global-container-border-radius`) — so\n// there is nothing honest to point at, and inventing a token name would be worse\n// than an 8px utility. Figma also defines three separate\n// `completed/label/color/{idle,hover,active}` variables, but all three carry the\n// identical `#18191b`, so the single semantic token covers them faithfully.\n//\n// `focus-visible` lives on the base class rather than a variant: the default\n// `<div>` is never focusable, so the ring only ever appears on a step composed\n// as a real control via `render` — the same 3px `--ui-focus-primary` ring\n// `CardFilter` and `BreadcrumbLink` use.\nconst stepperItemVariants = cva(\n 'inline-flex items-center gap-[var(--ui-gap-8)] rounded-lg px-[var(--ui-gap-16)] py-[var(--ui-gap-8)] text-sm leading-6 outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)]',\n {\n variants: {\n variant: {\n current:\n 'bg-[var(--ui-background-surface-active)] text-[var(--ui-text-on-surface-primary)]',\n completed: 'text-[var(--ui-text-on-surface-primary)]',\n future:\n 'pointer-events-none text-[var(--ui-text-on-surface-disabled)]',\n },\n // Declared as an axis so the variant x state matrix below can key off it;\n // on its own it paints nothing, because only `completed` reacts to it.\n state: {\n idle: '',\n hover: '',\n active: '',\n },\n },\n compoundVariants: [\n {\n variant: 'completed',\n state: 'hover',\n class: 'bg-[var(--ui-background-surface-hover)]',\n },\n {\n variant: 'completed',\n state: 'active',\n class: 'bg-[var(--ui-background-surface-active)]',\n },\n ],\n defaultVariants: {\n variant: 'current',\n state: 'idle',\n },\n }\n);\n\n/** Kept in lockstep with the `cva` axes above. */\nexport type StepperItemVariant = NonNullable<\n VariantProps<typeof stepperItemVariants>['variant']\n>;\nexport type StepperItemState = NonNullable<\n VariantProps<typeof stepperItemVariants>['state']\n>;\n\nexport interface StepperItemProps\n extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * The step's structural role in the sequence. Drives the container background\n * and the label color. Defaults to `current` for prop ergonomics — in a real\n * sequence every step declares its own.\n */\n variant?: StepperItemVariant;\n /**\n * Interaction state. Only produces a different look when `variant` is\n * `completed` (`idle` has no background, `hover` and `active` paint one).\n * Ignored for `current`, which always renders in its highlighted look, and for\n * `future`, which always renders disabled and non-interactive.\n */\n state?: StepperItemState;\n /**\n * The step's marker — required, and entirely the caller's to compose. Pass any\n * `Avatar` composition (color scheme, initials / icon / image, size overrides);\n * this component renders it verbatim and never styles it.\n */\n avatar: React.ReactElement;\n /** The step name. */\n label?: React.ReactNode;\n /**\n * Replace the rendered `<div>` with another element or component (Base UI\n * composition) — e.g. a `<button>`, since a completed step is usually a way\n * back to an earlier step.\n */\n render?: useRender.RenderProp;\n}\n\nconst StepperItem = React.forwardRef<HTMLDivElement, StepperItemProps>(\n (\n {\n className,\n variant = 'current',\n state = 'idle',\n avatar,\n label,\n render,\n children,\n ...props\n },\n ref\n ) => {\n // Hoisted out of the `mergeProps` literal: `data-*` keys aren't part of the\n // Base UI element prop type, so they only pass the excess-property check\n // when spread in (same shape as CardFilter's `data-selected`).\n const attributes = {\n 'data-slot': 'stepper-item',\n 'data-variant': variant,\n 'data-state': state,\n ...(variant === 'future'\n ? {\n 'aria-disabled': true,\n // `pointer-events-none` only stops the mouse. Without this, a step\n // composed as a real control (`render={<button />}`) would still be\n // reachable by Tab and activatable by Enter/Space, which contradicts\n // what `aria-disabled` promises. A consumer prop still wins — `props`\n // is merged after these.\n tabIndex: -1,\n // ARIA 1.2: `aria-disabled` on an element with no widget role is not\n // announced, and the default rendering here is a plain `<div>`. Give\n // it an explicit role so \"unavailable\" actually reaches assistive\n // tech — the same fix `BreadcrumbPage` applies to the current-page\n // `<span>`. Skipped when the consumer composes a real element via\n // `render`, which brings its own (correct) role.\n ...(render ? {} : { role: 'link' }),\n }\n : {}),\n };\n\n return useRender({\n render,\n ref,\n defaultTagName: 'div',\n props: mergeProps<'div'>(\n {\n ...attributes,\n className: cn(stepperItemVariants({ variant, state }), className),\n children: (\n <>\n {avatar}\n {label != null && (\n <span className=\"min-w-0 truncate\">{label}</span>\n )}\n {children}\n </>\n ),\n },\n props\n ),\n });\n }\n);\nStepperItem.displayName = 'StepperItem';\n\nexport { StepperItem, stepperItemVariants };\n"],"names":["stepperItemVariants","cva","StepperItem","React","className","variant","state","avatar","label","render","children","props","ref","attributes","useRender","mergeProps","cn","jsxs","Fragment","jsx"],"mappings":";;;;;;AAuDA,MAAMA,IAAsBC;AAAA,EAC1B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,WAAW;AAAA,QACX,QACE;AAAA,MAAA;AAAA;AAAA;AAAA,MAIJ,OAAO;AAAA,QACL,MAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ;AAAA,MAAA;AAAA,IACV;AAAA,IAEF,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,OAAO;AAAA,QACP,OAAO;AAAA,MAAA;AAAA,MAET;AAAA,QACE,SAAS;AAAA,QACT,OAAO;AAAA,QACP,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,OAAO;AAAA,IAAA;AAAA,EACT;AAEJ,GAyCMC,IAAcC,EAAM;AAAA,EACxB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,OAAAC,IAAQ;AAAA,IACR,QAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AAIH,UAAMC,IAAa;AAAA,MACjB,aAAa;AAAA,MACb,gBAAgBR;AAAA,MAChB,cAAcC;AAAA,MACd,GAAID,MAAY,WACZ;AAAA,QACE,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAMjB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAOV,GAAII,IAAS,CAAA,IAAK,EAAE,MAAM,OAAA;AAAA,MAAO,IAEnC,CAAA;AAAA,IAAC;AAGP,WAAOK,EAAU;AAAA,MACf,QAAAL;AAAA,MACA,KAAAG;AAAA,MACA,gBAAgB;AAAA,MAChB,OAAOG;AAAA,QACL;AAAA,UACE,GAAGF;AAAA,UACH,WAAWG,EAAGhB,EAAoB,EAAE,SAAAK,GAAS,OAAAC,EAAA,CAAO,GAAGF,CAAS;AAAA,UAChE,UACE,gBAAAa,EAAAC,GAAA,EACG,UAAA;AAAA,YAAAX;AAAA,YACAC,KAAS,QACR,gBAAAW,EAAC,QAAA,EAAK,WAAU,oBAAoB,UAAAX,GAAM;AAAA,YAE3CE;AAAA,UAAA,EAAA,CACH;AAAA,QAAA;AAAA,QAGJC;AAAA,MAAA;AAAA,IACF,CACD;AAAA,EACH;AACF;AACAT,EAAY,cAAc;"}
|
|
1
|
+
{"version":3,"file":"stepper-item.js","sources":["../../../../src/components/ui/stepper-item/stepper-item.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// One step in a stepper: an Avatar marker (the step's number, icon, or image)\n// followed by the step name. `variant` is the step's structural role in the\n// sequence — `current` (where the user is, highlighted with a fill and border),\n// `completed` (already passed, and so realistically clickable to jump back —\n// its container reacts to `state`), `future` (not reachable yet, always\n// disabled). `state` is the interaction look and only paints anything on a\n// `completed` step: `current` is always rendered highlighted and `future` is\n// always rendered disabled, which is exactly what the Figma component set\n// models.\n//\n// The Avatar is fully consumer-supplied and consumer-styled: this component\n// renders the element it is given verbatim and never sizes, tints, or recolors\n// it. Figma's `current`/`future` avatars DO recolor the digit *inside* the\n// circle to `--ui-stepper-item-{current,future}-label-color` — the exact same\n// token this component uses for the step name — overriding Avatar's own\n// per-scheme label color (verified directly in the Figma reference markup: the\n// digit's `text-[color:…]` references `components/Stepper/Item/{current,\n// future}/label/color`, not `components/Avatar/label/color/*`). Because the\n// marker is a caller-owned slot, that override is the caller's job, not this\n// component's — compose it as\n// `<Avatar className=\"text-[var(--ui-stepper-item-current-label-color)]\" …>`\n// (see the stories/demo for the current and future variants). `completed`'s\n// checkmark is a fixed icon asset, not text, so it needs no such override.\n//\n// ── Tokens — dedicated `--ui-stepper-item-*` tier (2026-08-24) ──\n// Re-synced from Figma: @acronis-platform/tokens-pd now ships a `Stepper` tier\n// (see `packages/tokens-pd/css/Stepper/default.css`), which replaces the\n// semantic/generic placeholder tokens (`--ui-background-surface-*`,\n// `--ui-text-on-surface-*`) this component used before that tier existed. The\n// tier's `global-container-padding-{l,r}` are asymmetric (8px / 16px) — the\n// start side sits closer to the avatar, the end side gives the label room — so\n// padding is split rather than collapsed into the tier's single\n// `global-container-padding-x` token (8px, matching only the start side) or a\n// `px-*` utility. Mapped with logical `ps-`/`pe-` so the asymmetry mirrors\n// with the flex order under `dir=\"rtl\"` (Figma's `paddingLeft/Right` naming\n// describes its LTR frame, not a physical side).\n//\n// The label's typography comes from the same tier as a generated *class*\n// (`.ui-stepper-item-global-container-text-style` — family / 14px / 500 / 24px /\n// letter-spacing) rather than as `--ui-*` custom properties, so it is applied\n// verbatim by name, the way `Alert`, `InputOTP`, and the sidebars apply theirs.\n// Transcribing it into discrete utilities would silently drop the properties\n// that have no utility here (family, letter-spacing) and drift when the tier\n// changes.\n//\n// The border width is reserved on the *base* class with a transparent color, not\n// declared only on `current`: the container is an inline-flex box with auto\n// width/height, so a border that exists on one variant and not the others makes\n// the current step render ~2px larger than its siblings and knocks the row's\n// avatars and labels out of alignment. Every variant therefore reserves the same\n// box, and only `current` paints the border color (the same shape `tag.tsx`\n// uses). `current`'s width token is the shared one because it's the only width\n// the tier ships.\nconst stepperItemVariants = cva(\n 'ui-stepper-item-global-container-text-style inline-flex items-center gap-[var(--ui-stepper-item-global-container-gap)] rounded-[var(--ui-stepper-item-global-container-border-radius)] border-[length:var(--ui-stepper-item-current-container-border-width)] border-solid border-transparent ps-[var(--ui-stepper-item-global-container-padding-l)] pe-[var(--ui-stepper-item-global-container-padding-r)] py-[var(--ui-stepper-item-global-container-padding-y)] outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)]',\n {\n variants: {\n variant: {\n current:\n 'border-[var(--ui-stepper-item-current-container-border-color)] bg-[var(--ui-stepper-item-current-container-color)] text-[var(--ui-stepper-item-current-label-color)]',\n completed: 'text-[var(--ui-stepper-item-completed-label-color)]',\n future:\n 'pointer-events-none bg-[var(--ui-stepper-item-future-container-color)] text-[var(--ui-stepper-item-future-label-color)]',\n },\n // Declared as an axis so the variant x state matrix below can key off it;\n // on its own it paints nothing, because only `completed` reacts to it.\n // Every state — `idle` included — gets its own token in that matrix, so a\n // brand override on any one of them is honored (the convention in\n // `context/conventions.md`: wire each state to its own token even when the\n // default brand's value happens to match another's).\n state: {\n idle: '',\n hover: '',\n active: '',\n focus: '',\n },\n },\n compoundVariants: [\n {\n variant: 'completed',\n state: 'idle',\n class: 'bg-[var(--ui-stepper-item-completed-container-color-idle)]',\n },\n {\n variant: 'completed',\n state: 'hover',\n class: 'bg-[var(--ui-stepper-item-completed-container-color-hover)]',\n },\n {\n variant: 'completed',\n state: 'active',\n class: 'bg-[var(--ui-stepper-item-completed-container-color-active)]',\n },\n {\n // `-focus-ring` resolves to the exact same value as `--ui-focus-primary`\n // (verified in tokens-pd) — it names a ring color, not a fill, so this\n // renders the same 3px ring `focus-visible` already draws automatically\n // on a composed control, rather than a solid background.\n variant: 'completed',\n state: 'focus',\n class:\n 'ring-[3px] ring-[var(--ui-stepper-item-completed-container-color-focus-ring)]',\n },\n ],\n defaultVariants: {\n variant: 'current',\n state: 'idle',\n },\n }\n);\n\n/** Kept in lockstep with the `cva` axes above. */\nexport type StepperItemVariant = NonNullable<\n VariantProps<typeof stepperItemVariants>['variant']\n>;\nexport type StepperItemState = NonNullable<\n VariantProps<typeof stepperItemVariants>['state']\n>;\n\nexport interface StepperItemProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * The step's structural role in the sequence. Drives the container background\n * and the label color. Defaults to `current` for prop ergonomics — in a real\n * sequence every step declares its own.\n */\n variant?: StepperItemVariant;\n /**\n * Interaction state. Only produces a different look when `variant` is\n * `completed` — each of `idle`, `hover`, `active`, and `focus` is wired to its\n * own token, so a brand can style any of them independently. Ignored for\n * `current`, which always renders in its highlighted look, and for `future`,\n * which always renders disabled and non-interactive.\n */\n state?: StepperItemState;\n /**\n * The step's marker — required, and entirely the caller's to compose. Pass any\n * `Avatar` composition (color scheme, initials / icon / image, size overrides);\n * this component renders it verbatim and never styles it.\n */\n avatar: React.ReactElement;\n /** The step name. */\n label?: React.ReactNode;\n /**\n * Replace the rendered `<div>` with another element or component (Base UI\n * composition) — e.g. a `<button>`, since a completed step is usually a way\n * back to an earlier step.\n */\n render?: useRender.RenderProp;\n}\n\nconst StepperItem = React.forwardRef<HTMLDivElement, StepperItemProps>(\n (\n {\n className,\n variant = 'current',\n state = 'idle',\n avatar,\n label,\n render,\n children,\n ...props\n },\n ref\n ) => {\n // Hoisted out of the `mergeProps` literal: `data-*` keys aren't part of the\n // Base UI element prop type, so they only pass the excess-property check\n // when spread in (same shape as CardFilter's `data-selected`).\n const attributes = {\n 'data-slot': 'stepper-item',\n 'data-variant': variant,\n 'data-state': state,\n ...(variant === 'future'\n ? {\n 'aria-disabled': true,\n // `pointer-events-none` only stops the mouse. Without this, a step\n // composed as a real control (`render={<button />}`) would still be\n // reachable by Tab and activatable by Enter/Space, which contradicts\n // what `aria-disabled` promises. A consumer prop still wins — `props`\n // is merged after these.\n tabIndex: -1,\n // ARIA 1.2: `aria-disabled` on an element with no widget role is not\n // announced, and the default rendering here is a plain `<div>`. Give\n // it an explicit role so \"unavailable\" actually reaches assistive\n // tech — the same fix `BreadcrumbPage` applies to the current-page\n // `<span>`. Skipped when the consumer composes a real element via\n // `render`, which brings its own (correct) role.\n ...(render ? {} : { role: 'link' }),\n }\n : {}),\n };\n\n return useRender({\n render,\n ref,\n defaultTagName: 'div',\n props: mergeProps<'div'>(\n {\n ...attributes,\n className: cn(stepperItemVariants({ variant, state }), className),\n children: (\n <>\n {avatar}\n {label != null && (\n <span className=\"min-w-0 truncate\">{label}</span>\n )}\n {children}\n </>\n ),\n },\n props\n ),\n });\n }\n);\nStepperItem.displayName = 'StepperItem';\n\nexport { StepperItem, stepperItemVariants };\n"],"names":["stepperItemVariants","cva","StepperItem","React","className","variant","state","avatar","label","render","children","props","ref","attributes","useRender","mergeProps","cn","jsxs","Fragment","jsx"],"mappings":";;;;;;AA8DA,MAAMA,IAAsBC;AAAA,EAC1B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,WAAW;AAAA,QACX,QACE;AAAA,MAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQJ,OAAO;AAAA,QACL,MAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,IAEF,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,OAAO;AAAA,QACP,OAAO;AAAA,MAAA;AAAA,MAET;AAAA,QACE,SAAS;AAAA,QACT,OAAO;AAAA,QACP,OAAO;AAAA,MAAA;AAAA,MAET;AAAA,QACE,SAAS;AAAA,QACT,OAAO;AAAA,QACP,OAAO;AAAA,MAAA;AAAA,MAET;AAAA;AAAA;AAAA;AAAA;AAAA,QAKE,SAAS;AAAA,QACT,OAAO;AAAA,QACP,OACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,OAAO;AAAA,IAAA;AAAA,EACT;AAEJ,GAyCMC,IAAcC,EAAM;AAAA,EACxB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,OAAAC,IAAQ;AAAA,IACR,QAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AAIH,UAAMC,IAAa;AAAA,MACjB,aAAa;AAAA,MACb,gBAAgBR;AAAA,MAChB,cAAcC;AAAA,MACd,GAAID,MAAY,WACZ;AAAA,QACE,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAMjB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAOV,GAAII,IAAS,CAAA,IAAK,EAAE,MAAM,OAAA;AAAA,MAAO,IAEnC,CAAA;AAAA,IAAC;AAGP,WAAOK,EAAU;AAAA,MACf,QAAAL;AAAA,MACA,KAAAG;AAAA,MACA,gBAAgB;AAAA,MAChB,OAAOG;AAAA,QACL;AAAA,UACE,GAAGF;AAAA,UACH,WAAWG,EAAGhB,EAAoB,EAAE,SAAAK,GAAS,OAAAC,EAAA,CAAO,GAAGF,CAAS;AAAA,UAChE,UACE,gBAAAa,EAAAC,GAAA,EACG,UAAA;AAAA,YAAAX;AAAA,YACAC,KAAS,QACR,gBAAAW,EAAC,QAAA,EAAK,WAAU,oBAAoB,UAAAX,GAAM;AAAA,YAE3CE;AAAA,UAAA,EAAA,CACH;AAAA,QAAA;AAAA,QAGJC;AAAA,MAAA;AAAA,IACF,CACD;AAAA,EACH;AACF;AACAT,EAAY,cAAc;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "react";
|
|
3
3
|
import { ArrowUpIcon as u, ArrowDownIcon as v, ArrowsDownUpIcon as g } from "@acronis-platform/icons-react/stroke-mono";
|
|
4
|
-
import { cn as
|
|
5
|
-
const m = i.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */
|
|
4
|
+
import { cn as r } from "../../../lib/utils.js";
|
|
5
|
+
const m = i.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */ o("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ o(
|
|
6
6
|
"table",
|
|
7
7
|
{
|
|
8
8
|
ref: l,
|
|
9
|
-
className:
|
|
9
|
+
className: r(
|
|
10
10
|
"w-full caption-bottom border-collapse text-sm text-[var(--ui-table-data-value-color-idle)]",
|
|
11
11
|
a
|
|
12
12
|
),
|
|
@@ -14,22 +14,22 @@ const m = i.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */ r("div", {
|
|
|
14
14
|
}
|
|
15
15
|
) }));
|
|
16
16
|
m.displayName = "Table";
|
|
17
|
-
const h = i.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */
|
|
17
|
+
const h = i.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */ o("thead", { ref: l, className: r(a), ...e }));
|
|
18
18
|
h.displayName = "TableHeader";
|
|
19
|
-
const p = i.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */
|
|
19
|
+
const p = i.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */ o(
|
|
20
20
|
"tbody",
|
|
21
21
|
{
|
|
22
22
|
ref: l,
|
|
23
|
-
className:
|
|
23
|
+
className: r("[&_tr:last-child]:border-0", a),
|
|
24
24
|
...e
|
|
25
25
|
}
|
|
26
26
|
));
|
|
27
27
|
p.displayName = "TableBody";
|
|
28
|
-
const f = i.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */
|
|
28
|
+
const f = i.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */ o(
|
|
29
29
|
"tfoot",
|
|
30
30
|
{
|
|
31
31
|
ref: l,
|
|
32
|
-
className:
|
|
32
|
+
className: r(
|
|
33
33
|
"border-t-[length:var(--ui-table-global-row-border-width)] [border-top-style:var(--ui-table-global-row-border-style)] border-[color:var(--ui-table-global-row-border-color)] font-medium [&>tr]:last:border-b-0",
|
|
34
34
|
a
|
|
35
35
|
),
|
|
@@ -38,12 +38,12 @@ const f = i.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */ r(
|
|
|
38
38
|
));
|
|
39
39
|
f.displayName = "TableFooter";
|
|
40
40
|
const w = i.forwardRef(
|
|
41
|
-
({ className: a, selected: e, ...l }, t) => /* @__PURE__ */
|
|
41
|
+
({ className: a, selected: e, ...l }, t) => /* @__PURE__ */ o(
|
|
42
42
|
"tr",
|
|
43
43
|
{
|
|
44
44
|
ref: t,
|
|
45
45
|
"data-state": e ? "selected" : void 0,
|
|
46
|
-
className:
|
|
46
|
+
className: r(
|
|
47
47
|
"border-b-[length:var(--ui-table-global-row-border-width)] [border-bottom-style:var(--ui-table-global-row-border-style)] border-[color:var(--ui-table-global-row-border-color)] bg-[var(--ui-table-data-row-color-idle)] transition-colors hover:bg-[var(--ui-table-data-row-color-hover)] data-[state=selected]:bg-[var(--ui-table-data-row-color-active)]",
|
|
48
48
|
// The design documents a keyboard-nav focus state on the row itself
|
|
49
49
|
// (a ring spanning the full row). Rows aren't focusable by default, so
|
|
@@ -58,7 +58,7 @@ const w = i.forwardRef(
|
|
|
58
58
|
w.displayName = "TableRow";
|
|
59
59
|
function x({ direction: a }) {
|
|
60
60
|
const e = "size-[var(--ui-table-header-sort-icon-size)]";
|
|
61
|
-
return a === "asc" ? /* @__PURE__ */
|
|
61
|
+
return a === "asc" ? /* @__PURE__ */ o(u, { className: r(e, "text-[var(--ui-table-header-sort-icon-color-active)]") }) : a === "desc" ? /* @__PURE__ */ o(v, { className: r(e, "text-[var(--ui-table-header-sort-icon-color-active)]") }) : /* @__PURE__ */ o(g, { className: r(e, "text-[var(--ui-table-header-sort-icon-color-inactive)]") });
|
|
62
62
|
}
|
|
63
63
|
const y = i.forwardRef(
|
|
64
64
|
({
|
|
@@ -69,12 +69,12 @@ const y = i.forwardRef(
|
|
|
69
69
|
onSort: s,
|
|
70
70
|
wrap: c,
|
|
71
71
|
...d
|
|
72
|
-
}, b) => /* @__PURE__ */
|
|
72
|
+
}, b) => /* @__PURE__ */ o(
|
|
73
73
|
"th",
|
|
74
74
|
{
|
|
75
75
|
ref: b,
|
|
76
76
|
"aria-sort": t === "asc" ? "ascending" : t === "desc" ? "descending" : l ? "none" : void 0,
|
|
77
|
-
className:
|
|
77
|
+
className: r(
|
|
78
78
|
"px-[var(--ui-table-global-cell-padding-x)] py-[var(--ui-table-global-cell-padding-y)] text-start align-middle text-sm font-semibold leading-6 text-[var(--ui-table-header-label-color)] bg-[var(--ui-table-header-cell-color-idle)] [&:has([role=checkbox])]:pe-0",
|
|
79
79
|
c ? "whitespace-normal" : "h-[var(--ui-table-global-cell-min-height)]",
|
|
80
80
|
// Per the design, a sortable header tints the whole cell on hover/press
|
|
@@ -91,7 +91,7 @@ const y = i.forwardRef(
|
|
|
91
91
|
className: "flex w-full cursor-pointer items-center gap-[var(--ui-table-header-gap)] text-start outline-none",
|
|
92
92
|
children: [
|
|
93
93
|
e,
|
|
94
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ o(x, { direction: t })
|
|
95
95
|
]
|
|
96
96
|
}
|
|
97
97
|
) : e
|
|
@@ -100,12 +100,12 @@ const y = i.forwardRef(
|
|
|
100
100
|
);
|
|
101
101
|
y.displayName = "TableHead";
|
|
102
102
|
const N = i.forwardRef(
|
|
103
|
-
({ className: a, wrap: e, ...l }, t) => /* @__PURE__ */
|
|
103
|
+
({ className: a, wrap: e, ...l }, t) => /* @__PURE__ */ o(
|
|
104
104
|
"td",
|
|
105
105
|
{
|
|
106
106
|
ref: t,
|
|
107
|
-
className:
|
|
108
|
-
"px-[var(--ui-table-global-cell-padding-x)] py-[var(--ui-table-global-cell-padding-y)] align-middle text-sm leading-6 bg-[var(--ui-table-data-cell-color-idle)] [&:has([role=checkbox])]:pe-0",
|
|
107
|
+
className: r(
|
|
108
|
+
"px-[var(--ui-table-global-cell-padding-x)] py-[var(--ui-table-global-cell-padding-y)] align-middle text-sm leading-6 bg-[var(--ui-table-data-cell-color-idle)] transition-colors [&:has([role=checkbox])]:pe-0",
|
|
109
109
|
e ? "whitespace-normal" : "h-[var(--ui-table-global-cell-min-height)]",
|
|
110
110
|
a
|
|
111
111
|
),
|
|
@@ -114,12 +114,12 @@ const N = i.forwardRef(
|
|
|
114
114
|
)
|
|
115
115
|
);
|
|
116
116
|
N.displayName = "TableCell";
|
|
117
|
-
const T = i.forwardRef(({ className: a, header: e, ...l }, t) => /* @__PURE__ */
|
|
117
|
+
const T = i.forwardRef(({ className: a, header: e, ...l }, t) => /* @__PURE__ */ o(
|
|
118
118
|
e ? "th" : "td",
|
|
119
119
|
{
|
|
120
120
|
ref: t,
|
|
121
|
-
className:
|
|
122
|
-
"w-8 h-[var(--ui-table-global-cell-min-height)] ps-[var(--ui-table-global-cell-padding-x)] py-[var(--ui-table-global-cell-padding-y)] align-middle",
|
|
121
|
+
className: r(
|
|
122
|
+
"w-8 h-[var(--ui-table-global-cell-min-height)] ps-[var(--ui-table-global-cell-padding-x)] py-[var(--ui-table-global-cell-padding-y)] align-middle transition-colors",
|
|
123
123
|
e ? "bg-[var(--ui-table-header-cell-color-idle)]" : "bg-[var(--ui-table-data-cell-color-idle)]",
|
|
124
124
|
a
|
|
125
125
|
),
|
|
@@ -127,11 +127,11 @@ const T = i.forwardRef(({ className: a, header: e, ...l }, t) => /* @__PURE__ */
|
|
|
127
127
|
}
|
|
128
128
|
));
|
|
129
129
|
T.displayName = "TableSelectCell";
|
|
130
|
-
const R = i.forwardRef(({ className: a, bulkSelectionActive: e, children: l, ...t }, s) => /* @__PURE__ */
|
|
130
|
+
const R = i.forwardRef(({ className: a, bulkSelectionActive: e, children: l, ...t }, s) => /* @__PURE__ */ o(
|
|
131
131
|
"td",
|
|
132
132
|
{
|
|
133
133
|
ref: s,
|
|
134
|
-
className:
|
|
134
|
+
className: r(
|
|
135
135
|
"w-12 h-[var(--ui-table-global-cell-min-height)] px-[var(--ui-table-global-cell-padding-x)] text-end align-middle bg-[var(--ui-table-data-cell-color-idle)]",
|
|
136
136
|
!e && "rounded-sm transition-colors hover:bg-[var(--ui-table-data-cell-color-hover)] active:bg-[var(--ui-table-data-cell-color-active)] has-[:focus-visible]:ring-[3px] has-[:focus-visible]:ring-inset has-[:focus-visible]:ring-[var(--ui-focus-primary)]",
|
|
137
137
|
a
|
|
@@ -141,11 +141,11 @@ const R = i.forwardRef(({ className: a, bulkSelectionActive: e, children: l, ...
|
|
|
141
141
|
}
|
|
142
142
|
));
|
|
143
143
|
R.displayName = "TableActionsCell";
|
|
144
|
-
const C = i.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */
|
|
144
|
+
const C = i.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */ o(
|
|
145
145
|
"th",
|
|
146
146
|
{
|
|
147
147
|
ref: l,
|
|
148
|
-
className:
|
|
148
|
+
className: r(
|
|
149
149
|
"w-12 h-[var(--ui-table-global-cell-min-height)] px-[var(--ui-table-global-cell-padding-x)] text-end align-middle rounded-sm transition-colors bg-[var(--ui-table-header-cell-color-idle)] hover:bg-[var(--ui-table-header-cell-color-hover)] active:bg-[var(--ui-table-header-cell-color-active)] has-[:focus-visible]:ring-[3px] has-[:focus-visible]:ring-inset has-[:focus-visible]:ring-[var(--ui-focus-primary)]",
|
|
150
150
|
a
|
|
151
151
|
),
|
|
@@ -153,11 +153,11 @@ const C = i.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */ r(
|
|
|
153
153
|
}
|
|
154
154
|
));
|
|
155
155
|
C.displayName = "TableSettingsCell";
|
|
156
|
-
const A = i.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */
|
|
156
|
+
const A = i.forwardRef(({ className: a, ...e }, l) => /* @__PURE__ */ o(
|
|
157
157
|
"caption",
|
|
158
158
|
{
|
|
159
159
|
ref: l,
|
|
160
|
-
className:
|
|
160
|
+
className: r("mt-4 text-sm text-muted-foreground", a),
|
|
161
161
|
...e
|
|
162
162
|
}
|
|
163
163
|
));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","sources":["../../../../src/components/ui/table/table.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n ArrowDownIcon,\n ArrowUpIcon,\n ArrowsDownUpIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\n\n// Composable table primitives, reconciled against the Table design in the\n// ui-react Figma (canvas 2948-2416; assembled example 4567-6801, part state\n// matrices TableHeaderCell 3427-207 / TableDataCell 4536-97 / TableDataRow\n// 4536-699 / TableSettings 3698-497 / TableActions 4536-414 / TableCheckbox\n// 3698-746). A `--ui-table-*` token tier already exists, so these parts theme\n// directly from it (imported in styles/index.css):\n// • cell -> --ui-table-global-cell-{padding-x,padding-y,min-height}\n// • row -> --ui-table-global-row-{border-color,border-width,border-style},\n// --ui-table-data-row-color-{idle,hover,active} (active = selected)\n// • head -> --ui-table-header-{label-color,gap}, --ui-table-header-cell-color-{idle,hover,active}\n// • data -> --ui-table-data-cell-color-{idle,hover,active}, --ui-table-data-value-color-{idle,disabled}\n// • sort -> --ui-table-header-sort-icon-{color-active,color-inactive,size}\n// • focus -> --ui-focus-primary (the kit-wide 3px focus ring, radius/radius-4)\n// Per the design, the header/settings/actions cells tint on hover and press at\n// the *cell* level (not on an inner control), so the interaction tokens sit on\n// the `<th>`/`<td>` and the focus ring is drawn on the cell via `has-[…]`.\n//\n// The design's cell content (tags, status dots, links) stays consumer\n// composition — `--ui-table-global-cell-{tag,icon}-margin-y` and\n// --ui-table-data-gap describe that content's own insets, not a part contract,\n// so no wrapper part is invented for them here.\n\nconst Table = React.forwardRef<\n HTMLTableElement,\n React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n <div className=\"relative w-full overflow-auto\">\n <table\n ref={ref}\n className={cn(\n 'w-full caption-bottom border-collapse text-sm text-[var(--ui-table-data-value-color-idle)]',\n className\n )}\n {...props}\n />\n </div>\n));\nTable.displayName = 'Table';\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead ref={ref} className={cn(className)} {...props} />\n));\nTableHeader.displayName = 'TableHeader';\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={cn('[&_tr:last-child]:border-0', className)}\n {...props}\n />\n));\nTableBody.displayName = 'TableBody';\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n className={cn(\n 'border-t-[length:var(--ui-table-global-row-border-width)] [border-top-style:var(--ui-table-global-row-border-style)] border-[color:var(--ui-table-global-row-border-color)] font-medium [&>tr]:last:border-b-0',\n className\n )}\n {...props}\n />\n));\nTableFooter.displayName = 'TableFooter';\n\nexport interface TableRowProps\n extends React.HTMLAttributes<HTMLTableRowElement> {\n /** Mark the row as selected — applies the active row token + `data-state`. */\n selected?: boolean;\n}\n\nconst TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n ({ className, selected, ...props }, ref) => (\n <tr\n ref={ref}\n data-state={selected ? 'selected' : undefined}\n className={cn(\n 'border-b-[length:var(--ui-table-global-row-border-width)] [border-bottom-style:var(--ui-table-global-row-border-style)] border-[color:var(--ui-table-global-row-border-color)] bg-[var(--ui-table-data-row-color-idle)] transition-colors hover:bg-[var(--ui-table-data-row-color-hover)] data-[state=selected]:bg-[var(--ui-table-data-row-color-active)]',\n // The design documents a keyboard-nav focus state on the row itself\n // (a ring spanning the full row). Rows aren't focusable by default, so\n // this only paints once a consumer makes them focusable (`tabIndex`).\n 'focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-[var(--ui-focus-primary)]',\n className\n )}\n {...props}\n />\n )\n);\nTableRow.displayName = 'TableRow';\n\ntype SortDirection = 'asc' | 'desc' | false;\n\nexport interface TableHeadProps\n extends React.ThHTMLAttributes<HTMLTableCellElement> {\n /** Render the column as sortable — adds a sort affordance and `aria-sort`. */\n sortable?: boolean;\n /** Current sort direction for this column (`false` = sortable but unsorted). */\n sortDirection?: SortDirection;\n /** Invoked when the user activates a sortable header (click / Enter / Space). */\n onSort?: () => void;\n /**\n * Allow the header to wrap onto multiple lines (`whitespace-normal`) and drop\n * the fixed row height so the cell grows to fit its content.\n */\n wrap?: boolean;\n}\n\nfunction SortIcon({ direction }: { direction: SortDirection }) {\n const size = 'size-[var(--ui-table-header-sort-icon-size)]';\n if (direction === 'asc') {\n return <ArrowUpIcon className={cn(size, 'text-[var(--ui-table-header-sort-icon-color-active)]')} />;\n }\n if (direction === 'desc') {\n return <ArrowDownIcon className={cn(size, 'text-[var(--ui-table-header-sort-icon-color-active)]')} />;\n }\n return <ArrowsDownUpIcon className={cn(size, 'text-[var(--ui-table-header-sort-icon-color-inactive)]')} />;\n}\n\nconst TableHead = React.forwardRef<HTMLTableCellElement, TableHeadProps>(\n (\n {\n className,\n children,\n sortable,\n sortDirection = false,\n onSort,\n wrap,\n ...props\n },\n ref\n ) => (\n <th\n ref={ref}\n aria-sort={\n sortDirection === 'asc'\n ? 'ascending'\n : sortDirection === 'desc'\n ? 'descending'\n : sortable\n ? 'none'\n : undefined\n }\n className={cn(\n 'px-[var(--ui-table-global-cell-padding-x)] py-[var(--ui-table-global-cell-padding-y)] text-start align-middle text-sm font-semibold leading-6 text-[var(--ui-table-header-label-color)] bg-[var(--ui-table-header-cell-color-idle)] [&:has([role=checkbox])]:pe-0',\n wrap\n ? 'whitespace-normal'\n : 'h-[var(--ui-table-global-cell-min-height)]',\n // Per the design, a sortable header tints the whole cell on hover/press\n // and draws the focus ring on the cell, not on the inner control.\n sortable &&\n 'cursor-pointer rounded-sm transition-colors hover:bg-[var(--ui-table-header-cell-color-hover)] active:bg-[var(--ui-table-header-cell-color-active)] has-[:focus-visible]:ring-[3px] has-[:focus-visible]:ring-inset has-[:focus-visible]:ring-[var(--ui-focus-primary)]',\n className\n )}\n {...props}\n >\n {sortable ? (\n <button\n type=\"button\"\n onClick={onSort}\n className=\"flex w-full cursor-pointer items-center gap-[var(--ui-table-header-gap)] text-start outline-none\"\n >\n {children}\n <SortIcon direction={sortDirection} />\n </button>\n ) : (\n children\n )}\n </th>\n )\n);\nTableHead.displayName = 'TableHead';\n\nexport interface TableCellProps\n extends React.TdHTMLAttributes<HTMLTableCellElement> {\n /**\n * Allow the cell to wrap onto multiple lines (`whitespace-normal`) and drop\n * the fixed row height so the row grows to fit its content.\n */\n wrap?: boolean;\n}\n\nconst TableCell = React.forwardRef<HTMLTableCellElement, TableCellProps>(\n ({ className, wrap, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\n 'px-[var(--ui-table-global-cell-padding-x)] py-[var(--ui-table-global-cell-padding-y)] align-middle text-sm leading-6 bg-[var(--ui-table-data-cell-color-idle)] [&:has([role=checkbox])]:pe-0',\n wrap\n ? 'whitespace-normal'\n : 'h-[var(--ui-table-global-cell-min-height)]',\n className\n )}\n {...props}\n />\n )\n);\nTableCell.displayName = 'TableCell';\n\nexport interface TableSelectCellProps\n extends React.ThHTMLAttributes<HTMLTableCellElement> {\n /**\n * Render the select-all cell of the header row (`<th>`) instead of a row's\n * selection cell (`<td>`).\n */\n header?: boolean;\n}\n\n/**\n * The row-selection cell (design part `TableCheckbox`) — a fixed 32px column\n * holding a label-less `Checkbox`. Only the leading padding is applied, matching\n * the design (16px padding + a 16px box), so the checkbox sits flush against the\n * first data cell.\n */\nconst TableSelectCell = React.forwardRef<\n HTMLTableCellElement,\n TableSelectCellProps\n>(({ className, header, ...props }, ref) => {\n const Comp = header ? 'th' : 'td';\n return (\n <Comp\n ref={ref}\n className={cn(\n 'w-8 h-[var(--ui-table-global-cell-min-height)] ps-[var(--ui-table-global-cell-padding-x)] py-[var(--ui-table-global-cell-padding-y)] align-middle',\n header\n ? 'bg-[var(--ui-table-header-cell-color-idle)]'\n : 'bg-[var(--ui-table-data-cell-color-idle)]',\n className\n )}\n {...props}\n />\n );\n});\nTableSelectCell.displayName = 'TableSelectCell';\n\nexport interface TableActionsCellProps\n extends React.TdHTMLAttributes<HTMLTableCellElement> {\n /**\n * Suppress this row's actions because a selection is in play — the cell\n * still reserves its 48px column (so the grid doesn't reflow) but renders no\n * children and no hover/press tint. Per the design, that means any row is\n * selected, including exactly one. Pass `isBulkSelectionActive(table)` (from\n * the data-table part) rather than re-deriving the threshold.\n */\n bulkSelectionActive?: boolean;\n}\n\n/**\n * The trailing row-actions cell (design part `TableActions`) — a fixed 48px\n * column, end-aligned, holding the consumer's overflow trigger (e.g. a\n * `ButtonIcon` with `EllipsisIcon` opening a `DropdownMenu`). The cell itself\n * carries the hover/press tint and the focus ring, per the design.\n */\nconst TableActionsCell = React.forwardRef<\n HTMLTableCellElement,\n TableActionsCellProps\n>(({ className, bulkSelectionActive, children, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\n 'w-12 h-[var(--ui-table-global-cell-min-height)] px-[var(--ui-table-global-cell-padding-x)] text-end align-middle bg-[var(--ui-table-data-cell-color-idle)]',\n !bulkSelectionActive &&\n 'rounded-sm transition-colors hover:bg-[var(--ui-table-data-cell-color-hover)] active:bg-[var(--ui-table-data-cell-color-active)] has-[:focus-visible]:ring-[3px] has-[:focus-visible]:ring-inset has-[:focus-visible]:ring-[var(--ui-focus-primary)]',\n className\n )}\n {...props}\n >\n {bulkSelectionActive ? null : children}\n </td>\n));\nTableActionsCell.displayName = 'TableActionsCell';\n\n/**\n * The trailing header cell holding the column-settings trigger (design part\n * `TableSettings`) — a fixed 48px column, end-aligned, holding the consumer's\n * gear trigger (e.g. a `ButtonIcon` with `CogIcon`). Visual states only; what\n * the trigger opens (a column-visibility menu) is the consumer's choice —\n * `TableViewOptions` is the ready-made one.\n */\nconst TableSettingsCell = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <th\n ref={ref}\n className={cn(\n 'w-12 h-[var(--ui-table-global-cell-min-height)] px-[var(--ui-table-global-cell-padding-x)] text-end align-middle rounded-sm transition-colors bg-[var(--ui-table-header-cell-color-idle)] hover:bg-[var(--ui-table-header-cell-color-hover)] active:bg-[var(--ui-table-header-cell-color-active)] has-[:focus-visible]:ring-[3px] has-[:focus-visible]:ring-inset has-[:focus-visible]:ring-[var(--ui-focus-primary)]',\n className\n )}\n {...props}\n />\n));\nTableSettingsCell.displayName = 'TableSettingsCell';\n\nconst TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n <caption\n ref={ref}\n className={cn('mt-4 text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nTableCaption.displayName = 'TableCaption';\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableSelectCell,\n TableActionsCell,\n TableSettingsCell,\n TableCaption,\n};\n"],"names":["Table","React","className","props","ref","jsx","cn","TableHeader","TableBody","TableFooter","TableRow","selected","SortIcon","direction","size","ArrowUpIcon","ArrowDownIcon","ArrowsDownUpIcon","TableHead","children","sortable","sortDirection","onSort","wrap","jsxs","TableCell","TableSelectCell","header","TableActionsCell","bulkSelectionActive","TableSettingsCell","TableCaption"],"mappings":";;;;AA+BA,MAAMA,IAAQC,EAAM,WAGlB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC,EAAC,OAAA,EAAI,WAAU,iCACb,UAAA,gBAAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN,GACF,CACD;AACDH,EAAM,cAAc;AAEpB,MAAMO,IAAcN,EAAM,WAGxB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC,EAAC,SAAA,EAAM,KAAAD,GAAU,WAAWE,E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,EAAA;AAAA,CAGT;AACDuB,EAAgB,cAAc;AAoB9B,MAAME,IAAmB3B,EAAM,WAG7B,CAAC,EAAE,WAAAC,GAAW,qBAAA2B,GAAqB,UAAAV,GAAU,GAAGhB,KAASC,MACzD,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACA,CAACuB,KACC;AAAA,MACF3B;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,IAEH,cAAsB,OAAOgB;AAAA,EAAA;AAChC,CACD;AACDS,EAAiB,cAAc;AAS/B,MAAME,IAAoB7B,EAAM,WAG9B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN,CACD;AACD2B,EAAkB,cAAc;AAEhC,MAAMC,IAAe9B,EAAM,WAGzB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE,EAAG,sCAAsCJ,CAAS;AAAA,IAC5D,GAAGC;AAAA,EAAA;AACN,CACD;AACD4B,EAAa,cAAc;"}
|
|
1
|
+
{"version":3,"file":"table.js","sources":["../../../../src/components/ui/table/table.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n ArrowDownIcon,\n ArrowUpIcon,\n ArrowsDownUpIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\n\n// Composable table primitives, reconciled against the Table design in the\n// ui-react Figma (canvas 2948-2416; assembled example 4567-6801, part state\n// matrices TableHeaderCell 3427-207 / TableDataCell 4536-97 / TableDataRow\n// 4536-699 / TableSettings 3698-497 / TableActions 4536-414 / TableCheckbox\n// 3698-746). A `--ui-table-*` token tier already exists, so these parts theme\n// directly from it (imported in styles/index.css):\n// • cell -> --ui-table-global-cell-{padding-x,padding-y,min-height}\n// • row -> --ui-table-global-row-{border-color,border-width,border-style},\n// --ui-table-data-row-color-{idle,hover,active} (active = selected)\n// • head -> --ui-table-header-{label-color,gap}, --ui-table-header-cell-color-{idle,hover,active}\n// • data -> --ui-table-data-cell-color-{idle,hover,active}, --ui-table-data-value-color-{idle,disabled}\n// • sort -> --ui-table-header-sort-icon-{color-active,color-inactive,size}\n// • focus -> --ui-focus-primary (the kit-wide 3px focus ring, radius/radius-4)\n// Per the design, the header/settings/actions cells tint on hover and press at\n// the *cell* level (not on an inner control), so the interaction tokens sit on\n// the `<th>`/`<td>` and the focus ring is drawn on the cell via `has-[…]`.\n//\n// The design's cell content (tags, status dots, links) stays consumer\n// composition — `--ui-table-global-cell-{tag,icon}-margin-y` and\n// --ui-table-data-gap describe that content's own insets, not a part contract,\n// so no wrapper part is invented for them here.\n\nconst Table = React.forwardRef<\n HTMLTableElement,\n React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n <div className=\"relative w-full overflow-auto\">\n <table\n ref={ref}\n className={cn(\n 'w-full caption-bottom border-collapse text-sm text-[var(--ui-table-data-value-color-idle)]',\n className\n )}\n {...props}\n />\n </div>\n));\nTable.displayName = 'Table';\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead ref={ref} className={cn(className)} {...props} />\n));\nTableHeader.displayName = 'TableHeader';\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={cn('[&_tr:last-child]:border-0', className)}\n {...props}\n />\n));\nTableBody.displayName = 'TableBody';\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n className={cn(\n 'border-t-[length:var(--ui-table-global-row-border-width)] [border-top-style:var(--ui-table-global-row-border-style)] border-[color:var(--ui-table-global-row-border-color)] font-medium [&>tr]:last:border-b-0',\n className\n )}\n {...props}\n />\n));\nTableFooter.displayName = 'TableFooter';\n\nexport interface TableRowProps\n extends React.HTMLAttributes<HTMLTableRowElement> {\n /** Mark the row as selected — applies the active row token + `data-state`. */\n selected?: boolean;\n}\n\nconst TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n ({ className, selected, ...props }, ref) => (\n <tr\n ref={ref}\n data-state={selected ? 'selected' : undefined}\n className={cn(\n 'border-b-[length:var(--ui-table-global-row-border-width)] [border-bottom-style:var(--ui-table-global-row-border-style)] border-[color:var(--ui-table-global-row-border-color)] bg-[var(--ui-table-data-row-color-idle)] transition-colors hover:bg-[var(--ui-table-data-row-color-hover)] data-[state=selected]:bg-[var(--ui-table-data-row-color-active)]',\n // The design documents a keyboard-nav focus state on the row itself\n // (a ring spanning the full row). Rows aren't focusable by default, so\n // this only paints once a consumer makes them focusable (`tabIndex`).\n 'focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-[var(--ui-focus-primary)]',\n className\n )}\n {...props}\n />\n )\n);\nTableRow.displayName = 'TableRow';\n\ntype SortDirection = 'asc' | 'desc' | false;\n\nexport interface TableHeadProps\n extends React.ThHTMLAttributes<HTMLTableCellElement> {\n /** Render the column as sortable — adds a sort affordance and `aria-sort`. */\n sortable?: boolean;\n /** Current sort direction for this column (`false` = sortable but unsorted). */\n sortDirection?: SortDirection;\n /** Invoked when the user activates a sortable header (click / Enter / Space). */\n onSort?: () => void;\n /**\n * Allow the header to wrap onto multiple lines (`whitespace-normal`) and drop\n * the fixed row height so the cell grows to fit its content.\n */\n wrap?: boolean;\n}\n\nfunction SortIcon({ direction }: { direction: SortDirection }) {\n const size = 'size-[var(--ui-table-header-sort-icon-size)]';\n if (direction === 'asc') {\n return <ArrowUpIcon className={cn(size, 'text-[var(--ui-table-header-sort-icon-color-active)]')} />;\n }\n if (direction === 'desc') {\n return <ArrowDownIcon className={cn(size, 'text-[var(--ui-table-header-sort-icon-color-active)]')} />;\n }\n return <ArrowsDownUpIcon className={cn(size, 'text-[var(--ui-table-header-sort-icon-color-inactive)]')} />;\n}\n\nconst TableHead = React.forwardRef<HTMLTableCellElement, TableHeadProps>(\n (\n {\n className,\n children,\n sortable,\n sortDirection = false,\n onSort,\n wrap,\n ...props\n },\n ref\n ) => (\n <th\n ref={ref}\n aria-sort={\n sortDirection === 'asc'\n ? 'ascending'\n : sortDirection === 'desc'\n ? 'descending'\n : sortable\n ? 'none'\n : undefined\n }\n className={cn(\n 'px-[var(--ui-table-global-cell-padding-x)] py-[var(--ui-table-global-cell-padding-y)] text-start align-middle text-sm font-semibold leading-6 text-[var(--ui-table-header-label-color)] bg-[var(--ui-table-header-cell-color-idle)] [&:has([role=checkbox])]:pe-0',\n wrap\n ? 'whitespace-normal'\n : 'h-[var(--ui-table-global-cell-min-height)]',\n // Per the design, a sortable header tints the whole cell on hover/press\n // and draws the focus ring on the cell, not on the inner control.\n sortable &&\n 'cursor-pointer rounded-sm transition-colors hover:bg-[var(--ui-table-header-cell-color-hover)] active:bg-[var(--ui-table-header-cell-color-active)] has-[:focus-visible]:ring-[3px] has-[:focus-visible]:ring-inset has-[:focus-visible]:ring-[var(--ui-focus-primary)]',\n className\n )}\n {...props}\n >\n {sortable ? (\n <button\n type=\"button\"\n onClick={onSort}\n className=\"flex w-full cursor-pointer items-center gap-[var(--ui-table-header-gap)] text-start outline-none\"\n >\n {children}\n <SortIcon direction={sortDirection} />\n </button>\n ) : (\n children\n )}\n </th>\n )\n);\nTableHead.displayName = 'TableHead';\n\nexport interface TableCellProps\n extends React.TdHTMLAttributes<HTMLTableCellElement> {\n /**\n * Allow the cell to wrap onto multiple lines (`whitespace-normal`) and drop\n * the fixed row height so the row grows to fit its content.\n */\n wrap?: boolean;\n}\n\nconst TableCell = React.forwardRef<HTMLTableCellElement, TableCellProps>(\n ({ className, wrap, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\n 'px-[var(--ui-table-global-cell-padding-x)] py-[var(--ui-table-global-cell-padding-y)] align-middle text-sm leading-6 bg-[var(--ui-table-data-cell-color-idle)] transition-colors [&:has([role=checkbox])]:pe-0',\n wrap\n ? 'whitespace-normal'\n : 'h-[var(--ui-table-global-cell-min-height)]',\n className\n )}\n {...props}\n />\n )\n);\nTableCell.displayName = 'TableCell';\n\nexport interface TableSelectCellProps\n extends React.ThHTMLAttributes<HTMLTableCellElement> {\n /**\n * Render the select-all cell of the header row (`<th>`) instead of a row's\n * selection cell (`<td>`).\n */\n header?: boolean;\n}\n\n/**\n * The row-selection cell (design part `TableCheckbox`) — a fixed 32px column\n * holding a label-less `Checkbox`. Only the leading padding is applied, matching\n * the design (16px padding + a 16px box), so the checkbox sits flush against the\n * first data cell.\n */\nconst TableSelectCell = React.forwardRef<\n HTMLTableCellElement,\n TableSelectCellProps\n>(({ className, header, ...props }, ref) => {\n const Comp = header ? 'th' : 'td';\n return (\n <Comp\n ref={ref}\n className={cn(\n 'w-8 h-[var(--ui-table-global-cell-min-height)] ps-[var(--ui-table-global-cell-padding-x)] py-[var(--ui-table-global-cell-padding-y)] align-middle transition-colors',\n header\n ? 'bg-[var(--ui-table-header-cell-color-idle)]'\n : 'bg-[var(--ui-table-data-cell-color-idle)]',\n className\n )}\n {...props}\n />\n );\n});\nTableSelectCell.displayName = 'TableSelectCell';\n\nexport interface TableActionsCellProps\n extends React.TdHTMLAttributes<HTMLTableCellElement> {\n /**\n * Suppress this row's actions because a selection is in play — the cell\n * still reserves its 48px column (so the grid doesn't reflow) but renders no\n * children and no hover/press tint. Per the design, that means any row is\n * selected, including exactly one. Pass `isBulkSelectionActive(table)` (from\n * the data-table part) rather than re-deriving the threshold.\n */\n bulkSelectionActive?: boolean;\n}\n\n/**\n * The trailing row-actions cell (design part `TableActions`) — a fixed 48px\n * column, end-aligned, holding the consumer's overflow trigger (e.g. a\n * `ButtonIcon` with `EllipsisIcon` opening a `DropdownMenu`). The cell itself\n * carries the hover/press tint and the focus ring, per the design.\n */\nconst TableActionsCell = React.forwardRef<\n HTMLTableCellElement,\n TableActionsCellProps\n>(({ className, bulkSelectionActive, children, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\n 'w-12 h-[var(--ui-table-global-cell-min-height)] px-[var(--ui-table-global-cell-padding-x)] text-end align-middle bg-[var(--ui-table-data-cell-color-idle)]',\n !bulkSelectionActive &&\n 'rounded-sm transition-colors hover:bg-[var(--ui-table-data-cell-color-hover)] active:bg-[var(--ui-table-data-cell-color-active)] has-[:focus-visible]:ring-[3px] has-[:focus-visible]:ring-inset has-[:focus-visible]:ring-[var(--ui-focus-primary)]',\n className\n )}\n {...props}\n >\n {bulkSelectionActive ? null : children}\n </td>\n));\nTableActionsCell.displayName = 'TableActionsCell';\n\n/**\n * The trailing header cell holding the column-settings trigger (design part\n * `TableSettings`) — a fixed 48px column, end-aligned, holding the consumer's\n * gear trigger (e.g. a `ButtonIcon` with `CogIcon`). Visual states only; what\n * the trigger opens (a column-visibility menu) is the consumer's choice —\n * `TableViewOptions` is the ready-made one.\n */\nconst TableSettingsCell = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <th\n ref={ref}\n className={cn(\n 'w-12 h-[var(--ui-table-global-cell-min-height)] px-[var(--ui-table-global-cell-padding-x)] text-end align-middle rounded-sm transition-colors bg-[var(--ui-table-header-cell-color-idle)] hover:bg-[var(--ui-table-header-cell-color-hover)] active:bg-[var(--ui-table-header-cell-color-active)] has-[:focus-visible]:ring-[3px] has-[:focus-visible]:ring-inset has-[:focus-visible]:ring-[var(--ui-focus-primary)]',\n className\n )}\n {...props}\n />\n));\nTableSettingsCell.displayName = 'TableSettingsCell';\n\nconst TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n <caption\n ref={ref}\n className={cn('mt-4 text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nTableCaption.displayName = 'TableCaption';\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableSelectCell,\n TableActionsCell,\n TableSettingsCell,\n TableCaption,\n};\n"],"names":["Table","React","className","props","ref","jsx","cn","TableHeader","TableBody","TableFooter","TableRow","selected","SortIcon","direction","size","ArrowUpIcon","ArrowDownIcon","ArrowsDownUpIcon","TableHead","children","sortable","sortDirection","onSort","wrap","jsxs","TableCell","TableSelectCell","header","TableActionsCell","bulkSelectionActive","TableSettingsCell","TableCaption"],"mappings":";;;;AA+BA,MAAMA,IAAQC,EAAM,WAGlB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC,EAAC,OAAA,EAAI,WAAU,iCACb,UAAA,gBAAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN,GACF,CACD;AACDH,EAAM,cAAc;AAEpB,MAAMO,IAAcN,EAAM,WAGxB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC,EAAC,SAAA,EAAM,KAAAD,GAAU,WAAWE,EAAGJ,CAAS,GAAI,GAAGC,GAAO,CACvD;AACDI,EAAY,cAAc;AAE1B,MAAMC,IAAYP,EAAM,WAGtB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE,EAAG,8BAA8BJ,CAAS;AAAA,IACpD,GAAGC;AAAA,EAAA;AACN,CACD;AACDK,EAAU,cAAc;AAExB,MAAMC,IAAcR,EAAM,WAGxB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