@acronis-platform/ui-react 2.0.0 → 3.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/avatar/avatar.js +33 -22
- package/dist/components/ui/avatar/avatar.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/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/table/table.js +27 -27
- package/dist/components/ui/table/table.js.map +1 -1
- package/dist/index.js +530 -520
- package/dist/index.js.map +1 -1
- package/dist/react.js +530 -520
- 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/avatar/avatar.d.ts +26 -7
- 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/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/grid/grid.d.ts +1 -1
- 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/index.d.ts +3 -0
- package/dist/ui-react.css +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { jsx as c, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { Collapsible as h } from "@base-ui/react/collapsible";
|
|
4
|
+
import { useRender as x } from "@base-ui/react/use-render";
|
|
5
|
+
import { mergeProps as N } from "@base-ui/react/merge-props";
|
|
6
|
+
import { ChevronRightIcon as O } from "@acronis-platform/icons-react/stroke-mono";
|
|
7
|
+
import { cn as T } from "../../../lib/utils.js";
|
|
8
|
+
const y = t.createContext({
|
|
9
|
+
collapsible: !1,
|
|
10
|
+
open: !1
|
|
11
|
+
}), j = () => t.useContext(y), k = t.forwardRef(
|
|
12
|
+
({
|
|
13
|
+
collapsible: n = !1,
|
|
14
|
+
open: o,
|
|
15
|
+
defaultOpen: r = !1,
|
|
16
|
+
onOpenChange: e,
|
|
17
|
+
disabled: a,
|
|
18
|
+
className: i,
|
|
19
|
+
style: s,
|
|
20
|
+
render: l,
|
|
21
|
+
children: u,
|
|
22
|
+
...f
|
|
23
|
+
}, m) => {
|
|
24
|
+
const [S, W] = t.useState(r), g = o !== void 0, d = g ? o : S, z = t.useCallback(
|
|
25
|
+
(p, F) => {
|
|
26
|
+
g || W(p), e == null || e(p, F);
|
|
27
|
+
},
|
|
28
|
+
[g, e]
|
|
29
|
+
), A = t.useMemo(
|
|
30
|
+
() => ({ open: d, disabled: a ?? !1 }),
|
|
31
|
+
[d, a]
|
|
32
|
+
), C = typeof u == "function" ? u({ open: d }) : u, v = typeof i == "function" ? i(A) : i, b = typeof s == "function" ? s(A) : s, R = t.useMemo(
|
|
33
|
+
() => ({ collapsible: n, open: d }),
|
|
34
|
+
[n, d]
|
|
35
|
+
), M = x({
|
|
36
|
+
render: l,
|
|
37
|
+
ref: m,
|
|
38
|
+
defaultTagName: "div",
|
|
39
|
+
props: N(
|
|
40
|
+
{ className: v, style: b },
|
|
41
|
+
f,
|
|
42
|
+
{
|
|
43
|
+
children: C
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
});
|
|
47
|
+
if (!n) {
|
|
48
|
+
const p = m != null || v != null || b != null || l != null || Object.keys(f).length > 0;
|
|
49
|
+
return /* @__PURE__ */ c(y.Provider, { value: R, children: p ? M : C });
|
|
50
|
+
}
|
|
51
|
+
return /* @__PURE__ */ c(y.Provider, { value: R, children: /* @__PURE__ */ c(
|
|
52
|
+
h.Root,
|
|
53
|
+
{
|
|
54
|
+
ref: m,
|
|
55
|
+
render: l,
|
|
56
|
+
className: v,
|
|
57
|
+
style: b,
|
|
58
|
+
open: d,
|
|
59
|
+
onOpenChange: z,
|
|
60
|
+
disabled: a,
|
|
61
|
+
...f,
|
|
62
|
+
children: C
|
|
63
|
+
}
|
|
64
|
+
) });
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
k.displayName = "AccordionContainer";
|
|
68
|
+
const w = t.forwardRef(({ className: n, children: o, "aria-label": r, ...e }, a) => {
|
|
69
|
+
const { collapsible: i } = j();
|
|
70
|
+
return i ? /* @__PURE__ */ c(
|
|
71
|
+
h.Trigger,
|
|
72
|
+
{
|
|
73
|
+
ref: a,
|
|
74
|
+
"aria-label": e["aria-labelledby"] || o != null ? r : r ?? "Toggle",
|
|
75
|
+
className: T(
|
|
76
|
+
"inline-flex size-8 shrink-0 cursor-pointer items-center justify-center border-0 bg-transparent p-0 text-[var(--ui-glyph-on-surface-neutral-dark)]",
|
|
77
|
+
"outline-none focus-visible:rounded-sm focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)]",
|
|
78
|
+
"[&[data-panel-open]>svg]:rotate-90 [&:not([data-panel-open])>svg]:rtl:rotate-180",
|
|
79
|
+
n
|
|
80
|
+
),
|
|
81
|
+
...e,
|
|
82
|
+
children: o ?? /* @__PURE__ */ c(
|
|
83
|
+
O,
|
|
84
|
+
{
|
|
85
|
+
size: 16,
|
|
86
|
+
className: "transition-transform duration-200"
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
) : null;
|
|
91
|
+
});
|
|
92
|
+
w.displayName = "AccordionContainerTrigger";
|
|
93
|
+
const P = t.forwardRef(
|
|
94
|
+
({
|
|
95
|
+
className: n,
|
|
96
|
+
style: o,
|
|
97
|
+
children: r,
|
|
98
|
+
render: e,
|
|
99
|
+
hiddenUntilFound: a,
|
|
100
|
+
keepMounted: i,
|
|
101
|
+
...s
|
|
102
|
+
}, l) => {
|
|
103
|
+
const { collapsible: u } = j(), f = x({
|
|
104
|
+
render: e,
|
|
105
|
+
ref: l,
|
|
106
|
+
defaultTagName: "div",
|
|
107
|
+
props: N(
|
|
108
|
+
{
|
|
109
|
+
className: n,
|
|
110
|
+
style: o
|
|
111
|
+
},
|
|
112
|
+
s,
|
|
113
|
+
{ children: r }
|
|
114
|
+
)
|
|
115
|
+
});
|
|
116
|
+
return u ? /* @__PURE__ */ c(
|
|
117
|
+
h.Panel,
|
|
118
|
+
{
|
|
119
|
+
ref: l,
|
|
120
|
+
style: o,
|
|
121
|
+
className: T(
|
|
122
|
+
"overflow-hidden transition-[height] duration-200 ease-out data-[ending-style]:h-0 data-[starting-style]:h-0",
|
|
123
|
+
n
|
|
124
|
+
),
|
|
125
|
+
hiddenUntilFound: a,
|
|
126
|
+
keepMounted: i,
|
|
127
|
+
...s,
|
|
128
|
+
children: r
|
|
129
|
+
}
|
|
130
|
+
) : l != null || n != null || o != null || e != null || Object.keys(s).length > 0 ? f : /* @__PURE__ */ c(I, { children: r });
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
P.displayName = "AccordionContainerContent";
|
|
134
|
+
const G = Object.assign(k, {
|
|
135
|
+
Trigger: w,
|
|
136
|
+
Content: P
|
|
137
|
+
});
|
|
138
|
+
export {
|
|
139
|
+
G as AccordionContainer,
|
|
140
|
+
P as AccordionContainerContent,
|
|
141
|
+
w as AccordionContainerTrigger,
|
|
142
|
+
j as useAccordionContainerContext
|
|
143
|
+
};
|
|
144
|
+
//# sourceMappingURL=accordion-container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion-container.js","sources":["../../../../src/components/ui/accordion-container/accordion-container.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Collapsible as CollapsiblePrimitive } from '@base-ui/react/collapsible';\nimport { useRender } from '@base-ui/react/use-render';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { ChevronRightIcon } from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\n\n// The shared disclosure primitive behind Card's and Section's `isCollapsable`\n// variant (Figma file lrU3ydIyvPYQNE6ixdsKtJ, node 10561:83806). Built directly\n// on Base UI's Collapsible — Root/Trigger/Panel own all open/close state, ARIA\n// wiring, and height animation; this component only adds the chevron rotation\n// and the `collapsible=false` bypass. It never imposes visual styling beyond\n// what the disclosure mechanic itself requires: no padding/background/border on\n// Root or Content, no position/hover opinion on Trigger beyond its chevron's\n// glyph color (--ui-glyph-on-surface-neutral-dark, the same neutral treatment\n// Accordion's chevron uses). Every other visual decision (header layout,\n// spacing, background, borders) stays owned by the consumer composing this\n// primitive into their own component (Card, Section, ...).\n\ninterface AccordionContainerState {\n open: boolean;\n}\n\ntype AccordionContainerChildren =\n | React.ReactNode\n | ((state: AccordionContainerState) => React.ReactNode);\n\ntype AccordionContainerBaseProps = Omit<\n React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Root>,\n 'children'\n>;\n\ninterface AccordionContainerProps extends AccordionContainerBaseProps {\n /**\n * Whether the disclosure exists at all. When `false`, `children` render\n * directly with no trigger and no panel wrapper — the Figma\n * `isCollapsable=false` state has no disclosure UI.\n * @default false\n */\n collapsible?: boolean;\n /**\n * Accepts a plain node, or a render-prop function receiving the current\n * `{ open }` state — for content outside `AccordionContainer.Content` (e.g.\n * a header) that still needs to know whether the panel is expanded, even\n * when this component owns the open state itself (uncontrolled).\n */\n children?: AccordionContainerChildren;\n}\n\ninterface AccordionContainerContextValue {\n collapsible: boolean;\n open: boolean;\n}\n\nconst AccordionContainerContext =\n React.createContext<AccordionContainerContextValue>({\n collapsible: false,\n open: false,\n });\n\n/**\n * Reads whether the nearest `AccordionContainer` ancestor is `collapsible`\n * and, if so, its current `open` state — for content outside\n * `AccordionContainer.Content` (e.g. a header) that needs to react to the\n * panel's state without a dedicated prop, such as `CardHeader` dropping its\n * bottom divider while collapsed.\n */\nconst useAccordionContainerContext = () =>\n React.useContext(AccordionContainerContext);\n\nconst AccordionContainer = React.forwardRef<\n HTMLDivElement,\n AccordionContainerProps\n>(\n (\n {\n collapsible = false,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n disabled,\n className,\n style,\n render,\n children,\n ...props\n },\n ref\n ) => {\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);\n const isControlled = openProp !== undefined;\n const open = isControlled ? openProp : uncontrolledOpen;\n\n const handleOpenChange = React.useCallback<\n NonNullable<AccordionContainerBaseProps['onOpenChange']>\n >(\n (nextOpen, eventDetails) => {\n if (!isControlled) {\n setUncontrolledOpen(nextOpen);\n }\n onOpenChange?.(nextOpen, eventDetails);\n },\n [isControlled, onOpenChange]\n );\n\n const collapsibleState = React.useMemo(\n () => ({ open, disabled: disabled ?? false }),\n [open, disabled]\n );\n\n const resolvedChildren =\n typeof children === 'function' ? children({ open }) : children;\n const resolvedClassName =\n typeof className === 'function' ? className(collapsibleState) : className;\n const resolvedStyle =\n typeof style === 'function' ? style(collapsibleState) : style;\n\n const contextValue = React.useMemo<AccordionContainerContextValue>(\n () => ({ collapsible, open }),\n [collapsible, open]\n );\n\n const bypassRendered = useRender({\n render,\n ref,\n defaultTagName: 'div',\n props: mergeProps<'div'>(\n { className: resolvedClassName, style: resolvedStyle },\n props,\n {\n children: resolvedChildren,\n }\n ),\n });\n\n if (!collapsible) {\n // No wrapper is imposed for the common case (no ref/className/style/render/\n // extra DOM props) so this bypass stays style-isolation-neutral; a consumer\n // that does pass any of those gets a `div` so they aren't silently dropped.\n const needsWrapper =\n ref != null ||\n resolvedClassName != null ||\n resolvedStyle != null ||\n render != null ||\n Object.keys(props).length > 0;\n\n return (\n <AccordionContainerContext.Provider value={contextValue}>\n {needsWrapper ? bypassRendered : resolvedChildren}\n </AccordionContainerContext.Provider>\n );\n }\n\n return (\n <AccordionContainerContext.Provider value={contextValue}>\n <CollapsiblePrimitive.Root\n ref={ref}\n render={render}\n className={resolvedClassName}\n style={resolvedStyle}\n open={open}\n onOpenChange={handleOpenChange}\n disabled={disabled}\n {...props}\n >\n {resolvedChildren}\n </CollapsiblePrimitive.Root>\n </AccordionContainerContext.Provider>\n );\n }\n);\nAccordionContainer.displayName = 'AccordionContainer';\n\ntype AccordionContainerTriggerProps = React.ComponentPropsWithoutRef<\n typeof CollapsiblePrimitive.Trigger\n>;\n\nconst AccordionContainerTrigger = React.forwardRef<\n HTMLButtonElement,\n AccordionContainerTriggerProps\n>(({ className, children, 'aria-label': ariaLabel, ...props }, ref) => {\n const { collapsible } = useAccordionContainerContext();\n\n if (!collapsible) {\n return null;\n }\n\n return (\n <CollapsiblePrimitive.Trigger\n ref={ref}\n aria-label={\n props['aria-labelledby'] || children != null\n ? ariaLabel\n : (ariaLabel ?? 'Toggle')\n }\n className={cn(\n 'inline-flex size-8 shrink-0 cursor-pointer items-center justify-center border-0 bg-transparent p-0 text-[var(--ui-glyph-on-surface-neutral-dark)]',\n 'outline-none focus-visible:rounded-sm focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)]',\n '[&[data-panel-open]>svg]:rotate-90 [&:not([data-panel-open])>svg]:rtl:rotate-180',\n className\n )}\n {...props}\n >\n {children ?? (\n <ChevronRightIcon\n size={16}\n className=\"transition-transform duration-200\"\n />\n )}\n </CollapsiblePrimitive.Trigger>\n );\n});\nAccordionContainerTrigger.displayName = 'AccordionContainerTrigger';\n\ntype AccordionContainerContentProps = React.ComponentPropsWithoutRef<\n typeof CollapsiblePrimitive.Panel\n>;\n\nconst AccordionContainerContent = React.forwardRef<\n React.ComponentRef<typeof CollapsiblePrimitive.Panel>,\n AccordionContainerContentProps\n>(\n (\n {\n className,\n style,\n children,\n render,\n hiddenUntilFound,\n keepMounted,\n ...props\n },\n ref\n ) => {\n const { collapsible } = useAccordionContainerContext();\n\n // Unlike Root, Content doesn't support the render-prop `(state) => value`\n // form for className/style, so the bypass div below only ever sees plain\n // values.\n const bypassRendered = useRender({\n render: render as\n | useRender.RenderProp<Record<string, unknown>>\n | undefined,\n ref,\n defaultTagName: 'div',\n props: mergeProps<'div'>(\n {\n className: className as string | undefined,\n style: style as React.CSSProperties | undefined,\n },\n props,\n { children }\n ),\n });\n\n if (!collapsible) {\n // Same style-isolation-neutral bypass as the Root: no wrapper unless the\n // consumer actually passed something that would otherwise be dropped.\n // hiddenUntilFound/keepMounted are Panel-only props, destructured above\n // so they never leak onto this plain div.\n const needsWrapper =\n ref != null ||\n className != null ||\n style != null ||\n render != null ||\n Object.keys(props).length > 0;\n\n return needsWrapper ? bypassRendered : <>{children}</>;\n }\n\n return (\n <CollapsiblePrimitive.Panel\n ref={ref}\n style={style}\n className={cn(\n 'overflow-hidden transition-[height] duration-200 ease-out data-[ending-style]:h-0 data-[starting-style]:h-0',\n className\n )}\n hiddenUntilFound={hiddenUntilFound}\n keepMounted={keepMounted}\n {...props}\n >\n {children}\n </CollapsiblePrimitive.Panel>\n );\n }\n);\nAccordionContainerContent.displayName = 'AccordionContainerContent';\n\nconst AccordionContainerRoot = Object.assign(AccordionContainer, {\n Trigger: AccordionContainerTrigger,\n Content: AccordionContainerContent,\n});\n\nexport {\n AccordionContainerRoot as AccordionContainer,\n AccordionContainerTrigger,\n AccordionContainerContent,\n useAccordionContainerContext,\n type AccordionContainerProps,\n type AccordionContainerTriggerProps,\n type AccordionContainerContentProps,\n type AccordionContainerState,\n type AccordionContainerContextValue,\n};\n"],"names":["AccordionContainerContext","React","useAccordionContainerContext","AccordionContainer","collapsible","openProp","defaultOpen","onOpenChange","disabled","className","style","render","children","props","ref","uncontrolledOpen","setUncontrolledOpen","isControlled","open","handleOpenChange","nextOpen","eventDetails","collapsibleState","resolvedChildren","resolvedClassName","resolvedStyle","contextValue","bypassRendered","useRender","mergeProps","needsWrapper","jsx","CollapsiblePrimitive","AccordionContainerTrigger","ariaLabel","cn","ChevronRightIcon","AccordionContainerContent","hiddenUntilFound","keepMounted","Fragment","AccordionContainerRoot"],"mappings":";;;;;;;AAyDA,MAAMA,IACJC,EAAM,cAA8C;AAAA,EAClD,aAAa;AAAA,EACb,MAAM;AACR,CAAC,GASGC,IAA+B,MACnCD,EAAM,WAAWD,CAAyB,GAEtCG,IAAqBF,EAAM;AAAA,EAI/B,CACE;AAAA,IACE,aAAAG,IAAc;AAAA,IACd,MAAMC;AAAA,IACN,aAAAC,IAAc;AAAA,IACd,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAM,CAACC,GAAkBC,CAAmB,IAAIf,EAAM,SAASK,CAAW,GACpEW,IAAeZ,MAAa,QAC5Ba,IAAOD,IAAeZ,IAAWU,GAEjCI,IAAmBlB,EAAM;AAAA,MAG7B,CAACmB,GAAUC,MAAiB;AAC1B,QAAKJ,KACHD,EAAoBI,CAAQ,GAE9Bb,KAAA,QAAAA,EAAea,GAAUC;AAAA,MAC3B;AAAA,MACA,CAACJ,GAAcV,CAAY;AAAA,IAAA,GAGvBe,IAAmBrB,EAAM;AAAA,MAC7B,OAAO,EAAE,MAAAiB,GAAM,UAAUV,KAAY,GAAA;AAAA,MACrC,CAACU,GAAMV,CAAQ;AAAA,IAAA,GAGXe,IACJ,OAAOX,KAAa,aAAaA,EAAS,EAAE,MAAAM,EAAA,CAAM,IAAIN,GAClDY,IACJ,OAAOf,KAAc,aAAaA,EAAUa,CAAgB,IAAIb,GAC5DgB,IACJ,OAAOf,KAAU,aAAaA,EAAMY,CAAgB,IAAIZ,GAEpDgB,IAAezB,EAAM;AAAA,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SAASI;AACX,CAAC;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as o from "react";
|
|
3
3
|
import { Avatar as v } from "@base-ui/react/avatar";
|
|
4
|
-
import { cva as
|
|
4
|
+
import { cva as d } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
5
5
|
import { cn as l } from "../../../lib/utils.js";
|
|
6
|
-
const
|
|
6
|
+
const g = d(
|
|
7
7
|
"relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden size-[var(--ui-avatar-global-avatar-size)] rounded-[var(--ui-avatar-global-avatar-border-border-radius)] [box-shadow:0_0_0_var(--ui-avatar-global-avatar-border-border-width)_var(--ui-avatar-global-avatar-border-color)] text-xs font-semibold leading-4",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
@@ -22,16 +22,7 @@ const s = c(
|
|
|
22
22
|
color: "teal"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
),
|
|
26
|
-
v.Root,
|
|
27
|
-
{
|
|
28
|
-
ref: i,
|
|
29
|
-
className: l(s({ color: r }), a),
|
|
30
|
-
...e
|
|
31
|
-
}
|
|
32
|
-
));
|
|
33
|
-
b.displayName = "Avatar";
|
|
34
|
-
const u = o.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ t(
|
|
25
|
+
), m = o.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ t(
|
|
35
26
|
v.Image,
|
|
36
27
|
{
|
|
37
28
|
ref: e,
|
|
@@ -39,8 +30,8 @@ const u = o.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ t(
|
|
|
39
30
|
...r
|
|
40
31
|
}
|
|
41
32
|
));
|
|
42
|
-
|
|
43
|
-
const
|
|
33
|
+
m.displayName = "AvatarImage";
|
|
34
|
+
const c = o.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ t(
|
|
44
35
|
v.Fallback,
|
|
45
36
|
{
|
|
46
37
|
ref: e,
|
|
@@ -48,8 +39,28 @@ const n = o.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ t(
|
|
|
48
39
|
...r
|
|
49
40
|
}
|
|
50
41
|
));
|
|
51
|
-
|
|
52
|
-
const
|
|
42
|
+
c.displayName = "AvatarFallback";
|
|
43
|
+
const f = o.forwardRef(
|
|
44
|
+
({
|
|
45
|
+
className: a,
|
|
46
|
+
color: r,
|
|
47
|
+
variant: e = "text",
|
|
48
|
+
label: s = "SB",
|
|
49
|
+
icon: b,
|
|
50
|
+
children: i,
|
|
51
|
+
...u
|
|
52
|
+
}, n) => /* @__PURE__ */ t(
|
|
53
|
+
v.Root,
|
|
54
|
+
{
|
|
55
|
+
ref: n,
|
|
56
|
+
className: l(g({ color: r }), a),
|
|
57
|
+
...u,
|
|
58
|
+
children: i !== void 0 ? i : e === "icon" ? b : /* @__PURE__ */ t(c, { children: s })
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
);
|
|
62
|
+
f.displayName = "Avatar";
|
|
63
|
+
const x = o.forwardRef(
|
|
53
64
|
({ className: a, ...r }, e) => /* @__PURE__ */ t(
|
|
54
65
|
"div",
|
|
55
66
|
{
|
|
@@ -62,12 +73,12 @@ const d = o.forwardRef(
|
|
|
62
73
|
}
|
|
63
74
|
)
|
|
64
75
|
);
|
|
65
|
-
|
|
76
|
+
x.displayName = "AvatarGroup";
|
|
66
77
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
78
|
+
f as Avatar,
|
|
79
|
+
c as AvatarFallback,
|
|
80
|
+
x as AvatarGroup,
|
|
81
|
+
m as AvatarImage,
|
|
82
|
+
g as avatarVariants
|
|
72
83
|
};
|
|
73
84
|
//# sourceMappingURL=avatar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.js","sources":["../../../../src/components/ui/avatar/avatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Avatar as AvatarPrimitive } from '@base-ui/react/avatar';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Wraps Base UI's Avatar primitive (Root / Image / Fallback), themed by the\n// dedicated next-gen `--ui-avatar-*` token tier from @acronis-platform/tokens-pd.\n// A 32px circle (`--ui-avatar-global-avatar-size` / `-border-border-radius`) with a 2px\n// ring (`-border-border-width` / `-border-color`) — the ring is what visually\n// separates avatars when they overlap in an `AvatarGroup`. When no image is set\n// (or it fails to load) the `AvatarFallback` shows initials.\n//\n// The ring is a `box-shadow`, not a CSS `border`: Figma draws the 2px stroke\n// with `strokeAlign: OUTSIDE`, so the 32px is the *colored circle* and the ring\n// sits outside it. A CSS border would be drawn inside the border-box, shrinking\n// the visible circle to 28px (PLTFRM-92393). A box-shadow ring paints outside\n// without inflating the 32px layout box, so the `AvatarGroup` overlap step\n// (32px − 6px gap) still matches the design.\n//\n// It is written as a raw `[box-shadow:…]` arbitrary property, not Tailwind's\n// `shadow-[…]` utility: the utility routes the value through `--tw-shadow-color`\n// (`0 0 0 var(--tw-shadow-color, <spread>) <color>`), which resolves\n// inconsistently for a spread-only ring across engine versions. The raw property\n// emits the literal declaration so every renderer draws the same 2px outset ring.\n//\n// `color` selects one of the eight Figma color schemes; it tints the fallback\n// background (`--ui-avatar-color-<scheme>`) and the initials\n// (`--ui-avatar-label-color-<scheme>`). Initials use the 12px/16px/600 caption\n// style baked into the design (`text-xs font-semibold leading-4`).\nconst avatarVariants = cva(\n 'relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden ' +\n 'size-[var(--ui-avatar-global-avatar-size)] rounded-[var(--ui-avatar-global-avatar-border-border-radius)] ' +\n '[box-shadow:0_0_0_var(--ui-avatar-global-avatar-border-border-width)_var(--ui-avatar-global-avatar-border-color)] ' +\n 'text-xs font-semibold leading-4',\n {\n variants: {\n color: {\n teal: 'bg-[var(--ui-avatar-color-teal)] text-[var(--ui-avatar-label-color-teal)]',\n violet:\n 'bg-[var(--ui-avatar-color-violet)] text-[var(--ui-avatar-label-color-violet)]',\n red: 'bg-[var(--ui-avatar-color-red)] text-[var(--ui-avatar-label-color-red)]',\n yellow:\n 'bg-[var(--ui-avatar-color-yellow)] text-[var(--ui-avatar-label-color-yellow)]',\n orange:\n 'bg-[var(--ui-avatar-color-orange)] text-[var(--ui-avatar-label-color-orange)]',\n blue: 'bg-[var(--ui-avatar-color-blue)] text-[var(--ui-avatar-label-color-blue)]',\n gray: 'bg-[var(--ui-avatar-color-gray)] text-[var(--ui-avatar-label-color-gray)]',\n green:\n 'bg-[var(--ui-avatar-color-green)] text-[var(--ui-avatar-label-color-green)]',\n },\n },\n defaultVariants: {\n color: 'teal',\n },\n }\n);\n\nexport
|
|
1
|
+
{"version":3,"file":"avatar.js","sources":["../../../../src/components/ui/avatar/avatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Avatar as AvatarPrimitive } from '@base-ui/react/avatar';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Wraps Base UI's Avatar primitive (Root / Image / Fallback), themed by the\n// dedicated next-gen `--ui-avatar-*` token tier from @acronis-platform/tokens-pd.\n// A 32px circle (`--ui-avatar-global-avatar-size` / `-border-border-radius`) with a 2px\n// ring (`-border-border-width` / `-border-color`) — the ring is what visually\n// separates avatars when they overlap in an `AvatarGroup`. When no image is set\n// (or it fails to load) the `AvatarFallback` shows initials.\n//\n// `variant`/`label`/`icon` are a convenience for the common no-photo case (the\n// Figma component has no \"image\" variant at all — just Text/Icon): with no\n// `children` composed, Avatar auto-renders either `label` (Text) or `icon`\n// (Icon). Composing `AvatarImage`/`AvatarFallback` as `children` — for the real\n// photo-with-fallback case — always takes precedence over both.\n//\n// \"No `children` composed\" means `children === undefined` specifically, not\n// merely falsy. An explicit `null` child is a deliberate \"render nothing\" and\n// has to stay empty: `timeline.tsx`'s marker passes\n// `icon ?? (initials ? <AvatarFallback/> : null)`, so a blank marker resolves to\n// `null`, and a `children ?? …` check would paint the default 'SB' label over\n// what should be an empty dot.\n//\n// The ring is a `box-shadow`, not a CSS `border`: Figma draws the 2px stroke\n// with `strokeAlign: OUTSIDE`, so the 32px is the *colored circle* and the ring\n// sits outside it. A CSS border would be drawn inside the border-box, shrinking\n// the visible circle to 28px (PLTFRM-92393). A box-shadow ring paints outside\n// without inflating the 32px layout box, so the `AvatarGroup` overlap step\n// (32px − 6px gap) still matches the design.\n//\n// It is written as a raw `[box-shadow:…]` arbitrary property, not Tailwind's\n// `shadow-[…]` utility: the utility routes the value through `--tw-shadow-color`\n// (`0 0 0 var(--tw-shadow-color, <spread>) <color>`), which resolves\n// inconsistently for a spread-only ring across engine versions. The raw property\n// emits the literal declaration so every renderer draws the same 2px outset ring.\n//\n// `color` selects one of the eight Figma color schemes; it tints the fallback\n// background (`--ui-avatar-color-<scheme>`) and the initials\n// (`--ui-avatar-label-color-<scheme>`). Initials use the 12px/16px/600 caption\n// style baked into the design (`text-xs font-semibold leading-4`).\nconst avatarVariants = cva(\n 'relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden ' +\n 'size-[var(--ui-avatar-global-avatar-size)] rounded-[var(--ui-avatar-global-avatar-border-border-radius)] ' +\n '[box-shadow:0_0_0_var(--ui-avatar-global-avatar-border-border-width)_var(--ui-avatar-global-avatar-border-color)] ' +\n 'text-xs font-semibold leading-4',\n {\n variants: {\n color: {\n teal: 'bg-[var(--ui-avatar-color-teal)] text-[var(--ui-avatar-label-color-teal)]',\n violet:\n 'bg-[var(--ui-avatar-color-violet)] text-[var(--ui-avatar-label-color-violet)]',\n red: 'bg-[var(--ui-avatar-color-red)] text-[var(--ui-avatar-label-color-red)]',\n yellow:\n 'bg-[var(--ui-avatar-color-yellow)] text-[var(--ui-avatar-label-color-yellow)]',\n orange:\n 'bg-[var(--ui-avatar-color-orange)] text-[var(--ui-avatar-label-color-orange)]',\n blue: 'bg-[var(--ui-avatar-color-blue)] text-[var(--ui-avatar-label-color-blue)]',\n gray: 'bg-[var(--ui-avatar-color-gray)] text-[var(--ui-avatar-label-color-gray)]',\n green:\n 'bg-[var(--ui-avatar-color-green)] text-[var(--ui-avatar-label-color-green)]',\n },\n },\n defaultVariants: {\n color: 'teal',\n },\n }\n);\n\nexport type AvatarImageProps = React.ComponentPropsWithoutRef<\n typeof AvatarPrimitive.Image\n>;\n\n/** The avatar image; hidden by Base UI until it loads, revealing the fallback. */\nconst AvatarImage = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Image>,\n AvatarImageProps\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image\n ref={ref}\n className={cn('size-full object-cover', className)}\n {...props}\n />\n));\nAvatarImage.displayName = 'AvatarImage';\n\nexport type AvatarFallbackProps = React.ComponentPropsWithoutRef<\n typeof AvatarPrimitive.Fallback\n>;\n\n/** Shown when there's no image (or it fails) — typically the user's initials. */\nconst AvatarFallback = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Fallback>,\n AvatarFallbackProps\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn('flex size-full items-center justify-center', className)}\n {...props}\n />\n));\nAvatarFallback.displayName = 'AvatarFallback';\n\nexport interface AvatarProps\n extends\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>,\n VariantProps<typeof avatarVariants> {\n /**\n * Selects the auto-rendered fallback content when no `children` are\n * composed: initials (`label`) or an `icon`. Ignored once `children` (e.g.\n * `AvatarImage`/`AvatarFallback`) are composed directly — including an\n * explicit `null`, which renders an empty circle.\n */\n variant?: 'text' | 'icon';\n /**\n * Initials shown for the `text` variant when no `children` are composed\n * (i.e. `children` is `undefined`).\n */\n label?: string;\n /**\n * Icon shown for the `icon` variant when no `children` are composed\n * (i.e. `children` is `undefined`).\n */\n icon?: React.ReactNode;\n}\n\n/**\n * A user/entity avatar: a colored circle showing an image, initials, or an\n * icon. Compose `AvatarImage`/`AvatarFallback` for the photo-with-fallback\n * case, or use `variant`/`label`/`icon` for a quick text or icon badge; stack\n * several in `AvatarGroup`.\n */\nconst Avatar = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Root>,\n AvatarProps\n>(\n (\n {\n className,\n color,\n variant = 'text',\n label = 'SB',\n icon,\n children,\n ...props\n },\n ref\n ) => (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(avatarVariants({ color }), className)}\n {...props}\n >\n {children !== undefined ? (\n children\n ) : variant === 'icon' ? (\n icon\n ) : (\n <AvatarFallback>{label}</AvatarFallback>\n )}\n </AvatarPrimitive.Root>\n )\n);\nAvatar.displayName = 'Avatar';\n\nexport type AvatarGroupProps = React.HTMLAttributes<HTMLDivElement>;\n\n/**\n * Overlapping stack of avatars. Each avatar after the first is pulled left by\n * `--ui-avatar-global-avatar-group-gap` (a negative offset), so their 2px\n * borders form the layered look; later avatars render above earlier ones.\n */\nconst AvatarGroup = React.forwardRef<HTMLDivElement, AvatarGroupProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex items-center [&>*:not(:first-child)]:ms-[var(--ui-avatar-global-avatar-group-gap)]',\n className\n )}\n {...props}\n />\n )\n);\nAvatarGroup.displayName = 'AvatarGroup';\n\nexport { Avatar, AvatarImage, AvatarFallback, AvatarGroup, avatarVariants };\n"],"names":["avatarVariants","cva","AvatarImage","React","className","props","ref","jsx","AvatarPrimitive","cn","AvatarFallback","Avatar","color","variant","label","icon","children","AvatarGroup"],"mappings":";;;;;AA2CA,MAAMA,IAAiBC;AAAA,EACrB;AAAA,EAIA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,MAAM;AAAA,QACN,QACE;AAAA,QACF,KAAK;AAAA,QACL,QACE;AAAA,QACF,QACE;AAAA,QACF,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,EACT;AAEJ,GAOMC,IAAcC,EAAM,WA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@ -1,92 +1,168 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as c, Fragment as D, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { mergeProps as s } from "@base-ui/react/merge-props";
|
|
4
|
+
import { useRender as d } from "@base-ui/react/use-render";
|
|
5
|
+
import { cva as E } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
6
|
+
import { HandleGripIcon as P, PencilIcon as B } from "@acronis-platform/icons-react/stroke-mono";
|
|
7
|
+
import { cn as n } from "../../../lib/utils.js";
|
|
8
|
+
import { useAccordionContainerContext as G, AccordionContainer as S } from "../accordion-container/accordion-container.js";
|
|
9
|
+
import { Switch as q } from "../switch/switch.js";
|
|
10
|
+
import { Avatar as J, AvatarFallback as K } from "../avatar/avatar.js";
|
|
11
|
+
import { ButtonIconInput as L } from "../button-icon-input/button-icon-input.js";
|
|
12
|
+
import { buttonIconVariants as M } from "../button-icon/button-icon.js";
|
|
13
|
+
const O = E(
|
|
14
|
+
"overflow-hidden rounded-lg border bg-[var(--ui-background-surface-primary)] text-[var(--ui-text-on-surface-primary)] shadow-xs",
|
|
15
|
+
{
|
|
16
|
+
variants: {
|
|
17
|
+
hasError: {
|
|
18
|
+
false: "border-[var(--ui-border-on-surface-border)]",
|
|
19
|
+
true: "border-[var(--ui-border-on-surface-border-error)]"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
hasError: !1
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
), Q = i.forwardRef(
|
|
27
|
+
({ className: a, hasError: e, render: o, ...t }, l) => d({
|
|
28
|
+
render: o,
|
|
29
|
+
ref: l,
|
|
9
30
|
defaultTagName: "div",
|
|
10
|
-
props:
|
|
11
|
-
{
|
|
12
|
-
|
|
13
|
-
"rounded-lg border border-border bg-background text-foreground shadow-xs",
|
|
14
|
-
e
|
|
15
|
-
)
|
|
16
|
-
},
|
|
17
|
-
r
|
|
31
|
+
props: s(
|
|
32
|
+
{ className: n(O({ hasError: e }), a) },
|
|
33
|
+
t
|
|
18
34
|
)
|
|
19
35
|
})
|
|
20
36
|
);
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
({
|
|
24
|
-
|
|
25
|
-
|
|
37
|
+
Q.displayName = "Card";
|
|
38
|
+
const U = i.forwardRef(
|
|
39
|
+
({
|
|
40
|
+
className: a,
|
|
41
|
+
title: e,
|
|
42
|
+
description: o,
|
|
43
|
+
hasDescription: t = !1,
|
|
44
|
+
isDraggable: l = !1,
|
|
45
|
+
dragHandleLabel: m = "Reorder",
|
|
46
|
+
isSwitchable: p = !1,
|
|
47
|
+
switchChecked: u,
|
|
48
|
+
defaultSwitchChecked: h,
|
|
49
|
+
onSwitchCheckedChange: v,
|
|
50
|
+
switchDisabled: x,
|
|
51
|
+
switchLabel: b = "Toggle card",
|
|
52
|
+
hasAvatar: g = !1,
|
|
53
|
+
avatarLabel: N = "",
|
|
54
|
+
avatar: C,
|
|
55
|
+
hasRename: w = !1,
|
|
56
|
+
onRename: k,
|
|
57
|
+
renameLabel: y = "Rename",
|
|
58
|
+
extras: R,
|
|
59
|
+
actions: A,
|
|
60
|
+
isCollapsible: f = !1,
|
|
61
|
+
collapseLabel: T = "Collapse card",
|
|
62
|
+
render: I,
|
|
63
|
+
children: F,
|
|
64
|
+
...j
|
|
65
|
+
}, H) => {
|
|
66
|
+
const { collapsible: V, open: z } = G();
|
|
67
|
+
return d({
|
|
68
|
+
render: I,
|
|
69
|
+
ref: H,
|
|
70
|
+
defaultTagName: "div",
|
|
71
|
+
props: s(
|
|
72
|
+
{
|
|
73
|
+
className: n(
|
|
74
|
+
"flex w-full shrink-0 items-center gap-2 overflow-hidden border-[var(--ui-border-on-surface-divider)] px-4 py-2",
|
|
75
|
+
!(f && V && !z) && "border-b",
|
|
76
|
+
a
|
|
77
|
+
),
|
|
78
|
+
children: /* @__PURE__ */ c(D, { children: [
|
|
79
|
+
l && /* @__PURE__ */ r(
|
|
80
|
+
P,
|
|
81
|
+
{
|
|
82
|
+
size: 16,
|
|
83
|
+
className: "shrink-0 cursor-grab text-[var(--ui-text-on-surface-secondary)]",
|
|
84
|
+
title: m
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
p && /* @__PURE__ */ r(
|
|
88
|
+
q,
|
|
89
|
+
{
|
|
90
|
+
checked: u,
|
|
91
|
+
defaultChecked: h,
|
|
92
|
+
onCheckedChange: v,
|
|
93
|
+
disabled: x,
|
|
94
|
+
"aria-label": b,
|
|
95
|
+
className: "shrink-0"
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
g && (C ?? /* @__PURE__ */ r(J, { color: "blue", className: "shrink-0", children: /* @__PURE__ */ r(K, { children: N }) })),
|
|
99
|
+
/* @__PURE__ */ c("div", { className: "flex min-w-0 flex-1 flex-col items-start justify-center gap-0.5", children: [
|
|
100
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
101
|
+
e && /* @__PURE__ */ r("p", { className: "truncate text-lg leading-6 font-normal text-[var(--ui-text-on-surface-primary)]", children: e }),
|
|
102
|
+
w && /* @__PURE__ */ r(
|
|
103
|
+
L,
|
|
104
|
+
{
|
|
105
|
+
variant: "normal",
|
|
106
|
+
onClick: k,
|
|
107
|
+
"aria-label": y,
|
|
108
|
+
children: /* @__PURE__ */ r(B, { size: 16 })
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
R
|
|
112
|
+
] }),
|
|
113
|
+
t && /* @__PURE__ */ r("p", { className: "w-full truncate text-xs leading-4 text-[var(--ui-text-on-surface-secondary)]", children: o })
|
|
114
|
+
] }),
|
|
115
|
+
F,
|
|
116
|
+
A,
|
|
117
|
+
f && /* @__PURE__ */ r(
|
|
118
|
+
S.Trigger,
|
|
119
|
+
{
|
|
120
|
+
"aria-label": T,
|
|
121
|
+
className: M({ variant: "ghost" })
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
] })
|
|
125
|
+
},
|
|
126
|
+
j
|
|
127
|
+
)
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
U.displayName = "CardHeader";
|
|
132
|
+
const W = i.forwardRef(
|
|
133
|
+
({ className: a, render: e, ...o }, t) => d({
|
|
134
|
+
render: e,
|
|
135
|
+
ref: t,
|
|
26
136
|
defaultTagName: "div",
|
|
27
|
-
props:
|
|
28
|
-
{ className:
|
|
29
|
-
|
|
137
|
+
props: s(
|
|
138
|
+
{ className: n("flex w-full flex-col px-4 pb-4", a) },
|
|
139
|
+
o
|
|
30
140
|
)
|
|
31
141
|
})
|
|
32
142
|
);
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
({ className:
|
|
36
|
-
render:
|
|
37
|
-
ref:
|
|
143
|
+
W.displayName = "CardContent";
|
|
144
|
+
const X = i.forwardRef(
|
|
145
|
+
({ className: a, render: e, ...o }, t) => d({
|
|
146
|
+
render: e,
|
|
147
|
+
ref: t,
|
|
38
148
|
defaultTagName: "div",
|
|
39
|
-
props:
|
|
149
|
+
props: s(
|
|
40
150
|
{
|
|
41
|
-
className:
|
|
42
|
-
"
|
|
43
|
-
|
|
151
|
+
className: n(
|
|
152
|
+
"flex w-full shrink-0 items-start gap-4 overflow-hidden border-t border-[var(--ui-border-on-surface-divider)] p-4",
|
|
153
|
+
a
|
|
44
154
|
)
|
|
45
155
|
},
|
|
46
|
-
|
|
47
|
-
)
|
|
48
|
-
})
|
|
49
|
-
);
|
|
50
|
-
l.displayName = "CardTitle";
|
|
51
|
-
const i = o.forwardRef(
|
|
52
|
-
({ className: e, render: a, ...r }, d) => s({
|
|
53
|
-
render: a,
|
|
54
|
-
ref: d,
|
|
55
|
-
defaultTagName: "div",
|
|
56
|
-
props: t(
|
|
57
|
-
{ className: p("text-sm text-muted-foreground", e) },
|
|
58
|
-
r
|
|
59
|
-
)
|
|
60
|
-
})
|
|
61
|
-
);
|
|
62
|
-
i.displayName = "CardDescription";
|
|
63
|
-
const n = o.forwardRef(
|
|
64
|
-
({ className: e, render: a, ...r }, d) => s({
|
|
65
|
-
render: a,
|
|
66
|
-
ref: d,
|
|
67
|
-
defaultTagName: "div",
|
|
68
|
-
props: t({ className: p("p-6 pt-0", e) }, r)
|
|
69
|
-
})
|
|
70
|
-
);
|
|
71
|
-
n.displayName = "CardContent";
|
|
72
|
-
const c = o.forwardRef(
|
|
73
|
-
({ className: e, render: a, ...r }, d) => s({
|
|
74
|
-
render: a,
|
|
75
|
-
ref: d,
|
|
76
|
-
defaultTagName: "div",
|
|
77
|
-
props: t(
|
|
78
|
-
{ className: p("flex items-center p-6 pt-0", e) },
|
|
79
|
-
r
|
|
156
|
+
o
|
|
80
157
|
)
|
|
81
158
|
})
|
|
82
159
|
);
|
|
83
|
-
|
|
160
|
+
X.displayName = "CardFooter";
|
|
84
161
|
export {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
l as CardTitle
|
|
162
|
+
Q as Card,
|
|
163
|
+
W as CardContent,
|
|
164
|
+
X as CardFooter,
|
|
165
|
+
U as CardHeader,
|
|
166
|
+
O as cardVariants
|
|
91
167
|
};
|
|
92
168
|
//# sourceMappingURL=card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","sources":["../../../../src/components/ui/card/card.tsx"],"sourcesContent":["import * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\n\nimport { cn } from '@/lib/utils';\n\n// Initial version ported from `@acronis-platform/shadcn-uikit`'s `card`\n// (packages/ui-legacy/src/components/ui/card.tsx). No \"ready for dev\" Figma node\n// exists yet, so this is a design-pending v1: there is no `--ui-card-*` token\n// tier, so the surface/text/border colors resolve to the shared **semantic**\n// tokens via the bridged Tailwind names in `src/styles/index.css`:\n// • bg-background → --ui-background-surface-primary (legacy `bg-card`)\n// • text-foreground → --ui-text-on-surface-primary (legacy `text-card-foreground`)\n// • border-border → --ui-border-on-surface-border (legacy bare `border`)\n// • text-muted-foreground → --ui-text-on-surface-secondary (description)\n// Geometry (radius, padding, gaps, shadow) is carried over verbatim from legacy.\n// Reconcile against the real design with `/figma-component Card <url> --update`\n// once a mockup lands — at which point an elevated-surface token may replace the\n// primary surface used for the card background.\n\ninterface CardPartProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Replace the rendered `<div>` with another element or component (Base UI\n * composition) — e.g. render `CardTitle` as a heading. The component's props\n * and class names are merged onto it.\n */\n render?: useRender.RenderProp;\n}\n\nconst Card = React.forwardRef<HTMLDivElement, CardPartProps>(\n ({ className, render, ...props }, ref) =>\n useRender({\n render,\n ref,\n defaultTagName: 'div',\n props: mergeProps<'div'>(\n {\n className: cn(\n 'rounded-lg border border-border bg-background text-foreground shadow-xs',\n className\n ),\n },\n props\n ),\n })\n);\nCard.displayName = 'Card';\n\nconst CardHeader = React.forwardRef<HTMLDivElement, CardPartProps>(\n ({ className, render, ...props }, ref) =>\n useRender({\n render,\n ref,\n defaultTagName: 'div',\n props: mergeProps<'div'>(\n { className: cn('flex flex-col space-y-1.5 p-6', className) },\n props\n ),\n })\n);\nCardHeader.displayName = 'CardHeader';\n\nconst CardTitle = React.forwardRef<HTMLDivElement, CardPartProps>(\n ({ className, render, ...props }, ref) =>\n useRender({\n render,\n ref,\n defaultTagName: 'div',\n props: mergeProps<'div'>(\n {\n className: cn(\n 'text-2xl font-semibold leading-none tracking-tight',\n className\n ),\n },\n props\n ),\n })\n);\nCardTitle.displayName = 'CardTitle';\n\nconst CardDescription = React.forwardRef<HTMLDivElement, CardPartProps>(\n ({ className, render, ...props }, ref) =>\n useRender({\n render,\n ref,\n defaultTagName: 'div',\n props: mergeProps<'div'>(\n { className: cn('text-sm text-muted-foreground', className) },\n props\n ),\n })\n);\nCardDescription.displayName = 'CardDescription';\n\nconst CardContent = React.forwardRef<HTMLDivElement, CardPartProps>(\n ({ className, render, ...props }, ref) =>\n useRender({\n render,\n ref,\n defaultTagName: 'div',\n props: mergeProps<'div'>({ className: cn('p-6 pt-0', className) }, props),\n })\n);\nCardContent.displayName = 'CardContent';\n\nconst CardFooter = React.forwardRef<HTMLDivElement, CardPartProps>(\n ({ className, render, ...props }, ref) =>\n useRender({\n render,\n ref,\n defaultTagName: 'div',\n props: mergeProps<'div'>(\n { className: cn('flex items-center p-6 pt-0', className) },\n props\n ),\n })\n);\nCardFooter.displayName = 'CardFooter';\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardDescription,\n CardContent,\n type CardPartProps,\n};\n"],"names":["Card","React","className","render","props","ref","useRender","mergeProps","cn","CardHeader","CardTitle","CardDescription","CardContent","CardFooter"],"mappings":";;;;AA6BA,MAAMA,IAAOC,EAAM;AAAA,EACjB,CAAC,EAAE,WAAAC,GAAW,QAAAC,GAAQ,GAAGC,EAAA,GAASC,MAChCC,EAAU;AAAA,IACR,QAAAH;AAAA,IACA,KAAAE;AAAA,IACA,gBAAgB;AAAA,IAChB,OAAOE;AAAA,MACL;AAAA,QACE,WAAWC;AAAA,UACT;AAAA,UACAN;AAAA,QAAA;AAAA,MACF;AAAA,MAEFE;AAAA,IAAA;AAAA,EACF,CACD;AACL;AACAJ,EAAK,cAAc;AAEnB,MAAMS,IAAaR,EAAM;AAAA,EACvB,CAAC,EAAE,WAAAC,GAAW,QAAAC,GAAQ,GAAGC,EAAA,GAASC,MAChCC,EAAU;AAAA,IACR,QAAAH;AAAA,IACA,KAAAE;AAAA,IACA,gBAAgB;AAAA,IAChB,OAAOE;AAAA,MACL,EAAE,WAAWC,EAAG,iCAAiCN,CAAS,EAAA;AAAA,MAC1DE;AAAA,IAAA;AAAA,EACF,CACD;AACL;AACAK,EAAW,cAAc;AAEzB,MAAMC,IAAYT,EAAM;AAAA,EACtB,CAAC,EA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"],"sourcesContent":["import * 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';\nimport { HandleGripIcon } from '@acronis-platform/icons-react/stroke-mono';\nimport { PencilIcon } from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\nimport { Avatar, AvatarFallback } from '@/components/ui/avatar';\nimport { ButtonIconInput } from '@/components/ui/button-icon-input';\nimport { Switch } from '@/components/ui/switch';\nimport { buttonIconVariants } from '@/components/ui/button-icon';\nimport {\n AccordionContainer,\n useAccordionContainerContext,\n} from '@/components/ui/accordion-container';\n\n// Figma node 10012:195993 (\"Card\"). The design's `isCollapsable` variant\n// (`false` / `true-expanded` / `true-collapsed`) is implemented by composing\n// `Card` with `AccordionContainer` (the shared disclosure primitive) rather\n// than a bespoke chevron/animation: wrap `CardContent`/`CardFooter` in\n// `AccordionContainer.Content` and set `CardHeader`'s `isCollapsible` to\n// render the trigger. The trigger is restyled with `buttonIconVariants({\n// variant: 'ghost' })` instead of `AccordionContainer.Trigger`'s own neutral\n// default — Figma's `ButtonCollapse` is a real ghost `ButtonIcon` instance\n// (confirmed via Code Connect metadata + its idle icon color resolving to\n// `--ui-button-icon-global-icon-color-idle`), not the accordion's plain\n// neutral chevron.\n// No dedicated `--ui-card-*` token tier exists for the root chrome (only the\n// unrelated `CardFilter` tier does) — the design references plain semantic\n// tokens for the surface/border/divider/text colors, so this stays on the\n// shared semantic tier rather than a component-local one.\n//\n// `hasHeader` / `hasBody` / `hasFooter` from Figma aren't reproduced as\n// booleans: this is a compound component (`Card` + `CardHeader` +\n// `CardContent` + `CardFooter`), so a part is simply omitted by the consumer\n// instead of hidden behind a flag — same pattern as the rest of this package\n// (see `breadcrumb.tsx`). `CardHeader`'s own feature toggles (`isDraggable`,\n// `isSwitchable`, `hasAvatar`, `hasRename`, `hasDescription`) stay as booleans\n// because each gates real interactive/content sub-parts with independent\n// payloads (a callback, a slot, a label), not a structural part swap.\n\nconst cardVariants = cva(\n 'overflow-hidden rounded-lg border bg-[var(--ui-background-surface-primary)] text-[var(--ui-text-on-surface-primary)] shadow-xs',\n {\n variants: {\n hasError: {\n false: 'border-[var(--ui-border-on-surface-border)]',\n true: 'border-[var(--ui-border-on-surface-border-error)]',\n },\n },\n defaultVariants: {\n hasError: false,\n },\n }\n);\n\nexport interface CardProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof cardVariants> {\n /**\n * Replace the rendered `<div>` with another element or component (Base UI\n * composition) — e.g. render `Card` as an `<article>`.\n */\n render?: useRender.RenderProp;\n}\n\nconst Card = React.forwardRef<HTMLDivElement, CardProps>(\n ({ className, hasError, render, ...props }, ref) =>\n useRender({\n render,\n ref,\n defaultTagName: 'div',\n props: mergeProps<'div'>(\n { className: cn(cardVariants({ hasError }), className) },\n props\n ),\n })\n);\nCard.displayName = 'Card';\n\nexport interface CardHeaderProps extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'title'\n> {\n /** The card's title. Renders nothing when omitted. */\n title?: string;\n /** Helper text shown under the title; only rendered when `hasDescription`. */\n description?: string;\n /** Shows `description` below the title. */\n hasDescription?: boolean;\n /** Shows a drag handle at the start of the header, for reorderable lists. */\n isDraggable?: boolean;\n /** Accessible label for the drag handle. */\n dragHandleLabel?: string;\n /** Shows a toggle switch at the start of the header. */\n isSwitchable?: boolean;\n /** Controlled checked state of the header switch. */\n switchChecked?: boolean;\n /** Uncontrolled initial checked state of the header switch. */\n defaultSwitchChecked?: boolean;\n /** Fires when the header switch is toggled. */\n onSwitchCheckedChange?: (checked: boolean) => void;\n /** Disables the header switch. */\n switchDisabled?: boolean;\n /** Accessible label for the header switch. */\n switchLabel?: string;\n /** Shows an avatar before the title. */\n hasAvatar?: boolean;\n /** Initials shown in the default avatar; ignored if `avatar` is provided. */\n avatarLabel?: string;\n /** Replaces the default initials avatar with custom content. */\n avatar?: React.ReactNode;\n /** Shows a rename button next to the title. */\n hasRename?: boolean;\n /** Fires when the rename button is activated. */\n onRename?: () => void;\n /** Accessible label for the rename button. */\n renameLabel?: string;\n /** Extra content rendered inline next to the title (e.g. a tag or badge). */\n extras?: React.ReactNode;\n /** Actions rendered at the end of the header (e.g. a menu button). */\n actions?: React.ReactNode;\n /**\n * Shows a disclosure trigger at the end of the header. Only has an effect\n * when this header renders inside a collapsible `AccordionContainer` —\n * see the collapsible composition example.\n */\n isCollapsible?: boolean;\n /** Accessible label for the collapse trigger. */\n collapseLabel?: string;\n /**\n * Replace the rendered `<div>` with another element or component (Base UI\n * composition).\n */\n render?: useRender.RenderProp;\n}\n\nconst CardHeader = React.forwardRef<HTMLDivElement, CardHeaderProps>(\n (\n {\n className,\n title,\n description,\n hasDescription = false,\n isDraggable = false,\n dragHandleLabel = 'Reorder',\n isSwitchable = false,\n switchChecked,\n defaultSwitchChecked,\n onSwitchCheckedChange,\n switchDisabled,\n switchLabel = 'Toggle card',\n hasAvatar = false,\n avatarLabel = '',\n avatar,\n hasRename = false,\n onRename,\n renameLabel = 'Rename',\n extras,\n actions,\n isCollapsible = false,\n collapseLabel = 'Collapse card',\n render,\n children,\n ...props\n },\n ref\n ) => {\n const { collapsible: inAccordion, open } = useAccordionContainerContext();\n // Drop the divider whenever this header sits in a collapsed accordion\n // panel — it otherwise doubles up against Card's own outer border once\n // there's nothing visible below to separate it from. This doesn't check\n // whether the panel actually has no visible content below (a sibling\n // outside AccordionContainer.Content, or a CardFooter with its own\n // border-t, can still mask a doubled divider in those cases).\n const hideDivider = isCollapsible && inAccordion && !open;\n\n return useRender({\n render,\n ref,\n defaultTagName: 'div',\n props: mergeProps<'div'>(\n {\n className: cn(\n 'flex w-full shrink-0 items-center gap-2 overflow-hidden border-[var(--ui-border-on-surface-divider)] px-4 py-2',\n !hideDivider && 'border-b',\n className\n ),\n children: (\n <>\n {isDraggable && (\n <HandleGripIcon\n size={16}\n className=\"shrink-0 cursor-grab text-[var(--ui-text-on-surface-secondary)]\"\n title={dragHandleLabel}\n />\n )}\n {isSwitchable && (\n <Switch\n checked={switchChecked}\n defaultChecked={defaultSwitchChecked}\n onCheckedChange={onSwitchCheckedChange}\n disabled={switchDisabled}\n aria-label={switchLabel}\n className=\"shrink-0\"\n />\n )}\n {hasAvatar &&\n (avatar ?? (\n <Avatar color=\"blue\" className=\"shrink-0\">\n <AvatarFallback>{avatarLabel}</AvatarFallback>\n </Avatar>\n ))}\n <div className=\"flex min-w-0 flex-1 flex-col items-start justify-center gap-0.5\">\n <div className=\"flex items-center gap-2\">\n {title && (\n <p className=\"truncate text-lg leading-6 font-normal text-[var(--ui-text-on-surface-primary)]\">\n {title}\n </p>\n )}\n {hasRename && (\n <ButtonIconInput\n variant=\"normal\"\n onClick={onRename}\n aria-label={renameLabel}\n >\n <PencilIcon size={16} />\n </ButtonIconInput>\n )}\n {extras}\n </div>\n {hasDescription && (\n <p className=\"w-full truncate text-xs leading-4 text-[var(--ui-text-on-surface-secondary)]\">\n {description}\n </p>\n )}\n </div>\n {children}\n {actions}\n {isCollapsible && (\n <AccordionContainer.Trigger\n aria-label={collapseLabel}\n className={buttonIconVariants({ variant: 'ghost' })}\n />\n )}\n </>\n ),\n },\n props\n ),\n });\n }\n);\nCardHeader.displayName = 'CardHeader';\n\nexport interface CardPartProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Replace the rendered `<div>` with another element or component (Base UI\n * composition).\n */\n render?: useRender.RenderProp;\n}\n\nconst CardContent = React.forwardRef<HTMLDivElement, CardPartProps>(\n ({ className, render, ...props }, ref) =>\n useRender({\n render,\n ref,\n defaultTagName: 'div',\n props: mergeProps<'div'>(\n { className: cn('flex w-full flex-col px-4 pb-4', className) },\n props\n ),\n })\n);\nCardContent.displayName = 'CardContent';\n\nconst CardFooter = React.forwardRef<HTMLDivElement, CardPartProps>(\n ({ className, render, ...props }, ref) =>\n useRender({\n render,\n ref,\n defaultTagName: 'div',\n props: mergeProps<'div'>(\n {\n className: cn(\n 'flex w-full shrink-0 items-start gap-4 overflow-hidden border-t border-[var(--ui-border-on-surface-divider)] p-4',\n className\n ),\n },\n props\n ),\n })\n);\nCardFooter.displayName = 'CardFooter';\n\nexport { Card, CardHeader, CardContent, CardFooter, cardVariants };\n"],"names":["cardVariants","cva","Card","React","className","hasError","render","props","ref","useRender","mergeProps","cn","CardHeader","title","description","hasDescription","isDraggable","dragHandleLabel","isSwitchable","switchChecked","defaultSwitchChecked","onSwitchCheckedChange","switchDisabled","switchLabel","hasAvatar","avatarLabel","avatar","hasRename","onRename","renameLabel","extras","actions","isCollapsible","collapseLabel","children","inAccordion","open","useAccordionContainerContext","jsxs","Fragment","jsx","HandleGripIcon","Switch","Avatar","AvatarFallback","ButtonIconInput","PencilIcon","AccordionContainer","buttonIconVariants","CardContent","CardFooter"],"mappings":";;;;;;;;;;;;AA0CA,MAAMA,IAAeC;AAAA,EACnB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,UAAU;AAAA,QACR,OAAO;AAAA,QACP,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF,iBAAiB;AAAA,MACf,UAAU;AAAA,IAAA;AAAA,EACZ;AAEJ,GAaMC,IAAOC,EAAM;AAAA,EACjB,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,QAAAC,GAAQ,GAAGC,EAAA,GAASC,MAC1CC,EAAU;AAAA,IACR,QAAAH;AAAA,IACA,KAAAE;AAAA,IACA,gBAAgB;AAAA,IAChB,OAAOE;AAAA,MACL,EAAE,WAAWC,EAAGX,EAAa,EAAE,UAAAK,EAAA,CAAU,GAAGD,CAAS,EAAA;AAAA,MACrDG;AAAA,IAAA;AAAA,EACF,CACD;AACL;AACAL,EAAK,cAAc;AA2DnB,MAAMU,IAAaT,EAAM;AAAA,EACvB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,OAAAS;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,aAAAC,IAAc;AAAA,IACd,iBAAAC,IAAkB;AAA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