tembro 3.1.12 → 3.1.14
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/CHANGELOG.md +10 -0
- package/dist/components/charts/charts.d.ts +1 -1
- package/dist/showcase/package-meta.d.ts +2 -2
- package/dist/src/components/charts/charts.cjs +1 -1
- package/dist/src/components/charts/charts.js +14 -10
- package/dist/src/components/display/kanban.cjs +1 -1
- package/dist/src/components/display/kanban.js +135 -59
- package/dist/src/components/feedback/alert.cjs +1 -1
- package/dist/src/components/feedback/alert.js +3 -3
- package/dist/src/components/ui/card/index.cjs +1 -1
- package/dist/src/components/ui/card/index.js +8 -8
- package/dist/src/components/wizard/stepper.cjs +1 -1
- package/dist/src/components/wizard/stepper.js +4 -4
- package/dist/src/showcase/package-meta.cjs +1 -1
- package/dist/src/showcase/package-meta.js +1 -1
- package/dist/src/showcase/site-data.cjs +1 -1
- package/dist/src/showcase/site-data.js +1 -1
- package/dist/src/showcase/tembro-registry.json.cjs +1 -1
- package/dist/src/showcase/tembro-registry.json.js +1 -1
- package/package.json +1 -1
- package/packages/cli/dist/index.cjs +1 -1
- package/packages/cli/vendor/src/components/charts/charts.tsx +2 -2
- package/packages/cli/vendor/src/components/display/kanban.tsx +175 -57
- package/packages/cli/vendor/src/components/feedback/alert.tsx +3 -3
- package/packages/cli/vendor/src/components/ui/card/index.tsx +4 -4
- package/packages/cli/vendor/src/components/wizard/stepper.tsx +6 -6
- package/packages/cli/vendor/src/showcase/package-meta.ts +1 -1
- package/packages/cli/vendor/src/showcase/tembro-registry.json +1 -1
- package/packages/cli/vendor/templates/showcase/src/showcase/layout/HeroSection.tsx +2 -2
- package/packages/cli/vendor/templates/showcase/src/showcase/layout/WorkbenchSidebar.tsx +1 -1
- package/registry.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## 3.1.14 - 2026-07-16
|
|
6
|
+
|
|
7
|
+
- Fixed Kanban drag-and-drop by adding a native drag/drop fallback while preserving the existing `@dnd-kit` integration.
|
|
8
|
+
- Kept Kanban controlled and uncontrolled column updates in sync for drag, drop, and card move callbacks.
|
|
9
|
+
- Refreshed registry/showcase package metadata for the 3.1.14 release.
|
|
10
|
+
|
|
11
|
+
## 3.1.13 - 2026-07-16
|
|
12
|
+
|
|
13
|
+
- Fixed `LineChart` responsive SVG height so wide dashboard cards no longer stretch line charts into oversized panels.
|
|
14
|
+
|
|
5
15
|
## 3.1.12 - 2026-07-16
|
|
6
16
|
|
|
7
17
|
- Fixed `BarChart` bars rendering with zero height inside dashboard cards.
|
|
@@ -47,7 +47,7 @@ export type LineChartProps = Omit<React.ComponentProps<"svg">, "values"> & {
|
|
|
47
47
|
state?: ChartState;
|
|
48
48
|
emptyLabel?: React.ReactNode;
|
|
49
49
|
};
|
|
50
|
-
declare function LineChart({ values, size, width, showArea, showGrid, labels, valueFormatter, stroke, state, emptyLabel, className, ...props }: LineChartProps): React.JSX.Element;
|
|
50
|
+
declare function LineChart({ values, size, width, showArea, showGrid, labels, valueFormatter, stroke, state, emptyLabel, className, style, ...props }: LineChartProps): React.JSX.Element;
|
|
51
51
|
declare function AreaChart(props: Omit<LineChartProps, "showArea">): React.JSX.Element;
|
|
52
52
|
export type SparklineProps = Omit<LineChartProps, "size" | "showArea"> & {
|
|
53
53
|
values: number[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const PACKAGE_LATEST_VERSION = "3.1.
|
|
1
|
+
export declare const PACKAGE_LATEST_VERSION = "3.1.14";
|
|
2
2
|
export declare const PACKAGE_LATEST_RELEASE_DATE = "July 15, 2026";
|
|
3
|
-
export declare const PACKAGE_DEPENDENCY_RANGE = "3.1.
|
|
3
|
+
export declare const PACKAGE_DEPENDENCY_RANGE = "3.1.14";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a={sm:120,md:180,lg:260};function o(e,t=1){return Math.max(...e,t)}function s(e,t){return!Number.isFinite(e)||t<=0?0:Math.max(0,Math.min(e/t,1))}function c(e,t){return t??`var(--color-chart-${e%5+1}, var(--primary))`}function l(e,t){return t?t(e):e.toLocaleString()}function u(e){return typeof e==`string`||typeof e==`number`?String(e):void 0}function d(e,t,n,r){let i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function f(e,t,n,r,i){let a=d(e,t,n,i),o=d(e,t,n,r),s=i-r<=180?`0`:`1`;return[`M`,a.x,a.y,`A`,n,n,0,s,0,o.x,o.y].join(` `)}function p(e,t,n,r=12){let i=o(e),a=Math.max(t-r*2,1),c=Math.max(n-r*2,1);return e.length===0?``:e.map((t,n)=>{let o=r+(e.length===1?a/2:n/(e.length-1)*a),l=r+(1-s(t,i))*c;return`${n===0?`M`:`L`} ${o} ${l}`}).join(` `)}function m(e,t,n,r=12){let i=p(e,t,n,r);if(!i)return``;let a=n-r;return`${i} L ${e.length===1?t/2:t-r} ${a} L ${e.length===1?t/2:r} ${a} Z`}function h({title:e,description:r,action:a,state:o=`ready`,emptyLabel:s=`No data available.`,className:c,children:l,...u}){return(0,i.jsxs)(n.Card,{"data-slot":`chart-frame`,className:t.cn(`border-border/75 bg-card/96 shadow-sm ring-1 ring-foreground/4`,c),...u,children:[(e||r||a)&&(0,i.jsxs)(n.CardHeader,{className:`flex flex-row items-start justify-between gap-3`,children:[(0,i.jsxs)(`div`,{className:`grid gap-1`,children:[e&&(0,i.jsx)(n.CardTitle,{children:e}),r&&(0,i.jsx)(n.CardDescription,{children:r})]}),a]}),(0,i.jsxs)(n.CardContent,{children:[o===`loading`?(0,i.jsxs)(`div`,{className:`grid gap-3`,children:[(0,i.jsx)(`div`,{className:`h-4 w-24 animate-pulse rounded bg-muted`}),(0,i.jsx)(`div`,{className:`h-36 animate-pulse rounded-[min(var(--radius-xl),16px)] bg-muted/70`})]}):null,o===`empty`?(0,i.jsx)(`div`,{className:`rounded-[min(var(--radius-xl),16px)] border border-dashed border-border/70 px-4 py-10 text-center text-sm text-muted-foreground`,children:s}):null,o===`ready`?l:null]})]})}function g({data:e,size:n=`md`,max:r,showLabels:d=!0,showValues:f=!0,valueFormatter:p,state:m=`ready`,emptyLabel:h=`No chart data.`,className:g,barClassName:_,...v}){let y=e.map(e=>e.value),b=r??o(y.map(e=>Math.abs(e))),x=a[n],S=Math.max(x-(f?28:0)-(d?24:0),32);return m===`loading`?(0,i.jsx)(`div`,{"data-slot":`bar-chart`,className:t.cn(`grid gap-3`,g),...v,children:(0,i.jsx)(`div`,{className:`h-40 animate-pulse rounded-[min(var(--radius-xl),16px)] bg-muted/70`})}):m===`empty`||e.length===0?(0,i.jsx)(`div`,{"data-slot":`bar-chart`,className:t.cn(`rounded-[min(var(--radius-xl),16px)] border border-dashed border-border/70 px-4 py-10 text-center text-sm text-muted-foreground`,g),...v,children:h}):(0,i.jsx)(`div`,{"data-slot":`bar-chart`,className:t.cn(`grid gap-3`,g),...v,children:(0,i.jsx)(`div`,{className:`flex items-end gap-2`,style:{minHeight:x},children:e.map((e,n)=>{let r=s(Math.abs(e.value),b),a=e.value<0,o=u(e.label),m=Math.max(Math.round(r*S),Math.abs(e.value)>0?3:0);return(0,i.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-center gap-2`,title:o?`${o}: ${e.value}`:void 0,children:[f&&(0,i.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:l(e.value,p)}),(0,i.jsx)(`div`,{className:`flex w-full items-end rounded-[min(var(--radius-xl),16px)] border border-border/60 bg-muted/38 p-1`,style:{height:S},children:(0,i.jsx)(`div`,{className:t.cn(`w-full rounded-[min(var(--radius-lg),12px)] bg-primary transition-all`,_),style:{height:m,background:c(n,e.color),opacity:a?.72:1}})}),d&&(0,i.jsx)(`div`,{className:`max-w-full truncate text-xs text-muted-foreground`,children:e.label})]},n)})})})}function _({values:e,size:n=`md`,width:r=560,showArea:c=!1,showGrid:d=!0,labels:f,valueFormatter:h,stroke:g=`var(--primary)`,state:_=`ready`,emptyLabel:v=`No line data.`,className:y,...
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a={sm:120,md:180,lg:260};function o(e,t=1){return Math.max(...e,t)}function s(e,t){return!Number.isFinite(e)||t<=0?0:Math.max(0,Math.min(e/t,1))}function c(e,t){return t??`var(--color-chart-${e%5+1}, var(--primary))`}function l(e,t){return t?t(e):e.toLocaleString()}function u(e){return typeof e==`string`||typeof e==`number`?String(e):void 0}function d(e,t,n,r){let i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function f(e,t,n,r,i){let a=d(e,t,n,i),o=d(e,t,n,r),s=i-r<=180?`0`:`1`;return[`M`,a.x,a.y,`A`,n,n,0,s,0,o.x,o.y].join(` `)}function p(e,t,n,r=12){let i=o(e),a=Math.max(t-r*2,1),c=Math.max(n-r*2,1);return e.length===0?``:e.map((t,n)=>{let o=r+(e.length===1?a/2:n/(e.length-1)*a),l=r+(1-s(t,i))*c;return`${n===0?`M`:`L`} ${o} ${l}`}).join(` `)}function m(e,t,n,r=12){let i=p(e,t,n,r);if(!i)return``;let a=n-r;return`${i} L ${e.length===1?t/2:t-r} ${a} L ${e.length===1?t/2:r} ${a} Z`}function h({title:e,description:r,action:a,state:o=`ready`,emptyLabel:s=`No data available.`,className:c,children:l,...u}){return(0,i.jsxs)(n.Card,{"data-slot":`chart-frame`,className:t.cn(`border-border/75 bg-card/96 shadow-sm ring-1 ring-foreground/4`,c),...u,children:[(e||r||a)&&(0,i.jsxs)(n.CardHeader,{className:`flex flex-row items-start justify-between gap-3`,children:[(0,i.jsxs)(`div`,{className:`grid gap-1`,children:[e&&(0,i.jsx)(n.CardTitle,{children:e}),r&&(0,i.jsx)(n.CardDescription,{children:r})]}),a]}),(0,i.jsxs)(n.CardContent,{children:[o===`loading`?(0,i.jsxs)(`div`,{className:`grid gap-3`,children:[(0,i.jsx)(`div`,{className:`h-4 w-24 animate-pulse rounded bg-muted`}),(0,i.jsx)(`div`,{className:`h-36 animate-pulse rounded-[min(var(--radius-xl),16px)] bg-muted/70`})]}):null,o===`empty`?(0,i.jsx)(`div`,{className:`rounded-[min(var(--radius-xl),16px)] border border-dashed border-border/70 px-4 py-10 text-center text-sm text-muted-foreground`,children:s}):null,o===`ready`?l:null]})]})}function g({data:e,size:n=`md`,max:r,showLabels:d=!0,showValues:f=!0,valueFormatter:p,state:m=`ready`,emptyLabel:h=`No chart data.`,className:g,barClassName:_,...v}){let y=e.map(e=>e.value),b=r??o(y.map(e=>Math.abs(e))),x=a[n],S=Math.max(x-(f?28:0)-(d?24:0),32);return m===`loading`?(0,i.jsx)(`div`,{"data-slot":`bar-chart`,className:t.cn(`grid gap-3`,g),...v,children:(0,i.jsx)(`div`,{className:`h-40 animate-pulse rounded-[min(var(--radius-xl),16px)] bg-muted/70`})}):m===`empty`||e.length===0?(0,i.jsx)(`div`,{"data-slot":`bar-chart`,className:t.cn(`rounded-[min(var(--radius-xl),16px)] border border-dashed border-border/70 px-4 py-10 text-center text-sm text-muted-foreground`,g),...v,children:h}):(0,i.jsx)(`div`,{"data-slot":`bar-chart`,className:t.cn(`grid gap-3`,g),...v,children:(0,i.jsx)(`div`,{className:`flex items-end gap-2`,style:{minHeight:x},children:e.map((e,n)=>{let r=s(Math.abs(e.value),b),a=e.value<0,o=u(e.label),m=Math.max(Math.round(r*S),Math.abs(e.value)>0?3:0);return(0,i.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-center gap-2`,title:o?`${o}: ${e.value}`:void 0,children:[f&&(0,i.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:l(e.value,p)}),(0,i.jsx)(`div`,{className:`flex w-full items-end rounded-[min(var(--radius-xl),16px)] border border-border/60 bg-muted/38 p-1`,style:{height:S},children:(0,i.jsx)(`div`,{className:t.cn(`w-full rounded-[min(var(--radius-lg),12px)] bg-primary transition-all`,_),style:{height:m,background:c(n,e.color),opacity:a?.72:1}})}),d&&(0,i.jsx)(`div`,{className:`max-w-full truncate text-xs text-muted-foreground`,children:e.label})]},n)})})})}function _({values:e,size:n=`md`,width:r=560,showArea:c=!1,showGrid:d=!0,labels:f,valueFormatter:h,stroke:g=`var(--primary)`,state:_=`ready`,emptyLabel:v=`No line data.`,className:y,style:b,...x}){let S=a[n],C=p(e,r,S),w=m(e,r,S),T=o(e);return _===`loading`?(0,i.jsx)(`div`,{className:t.cn(`h-36 animate-pulse rounded-[min(var(--radius-xl),16px)] bg-muted/70`,y)}):_===`empty`||e.length===0?(0,i.jsx)(`div`,{className:t.cn(`rounded-[min(var(--radius-xl),16px)] border border-dashed border-border/70 px-4 py-10 text-center text-sm text-muted-foreground`,y),children:v}):(0,i.jsxs)(`svg`,{"data-slot":`line-chart`,viewBox:`0 0 ${r} ${S}`,className:t.cn(`w-full overflow-visible`,y),style:{height:S,...b},role:`img`,...x,children:[d&&[.25,.5,.75].map(e=>(0,i.jsx)(`line`,{x1:`12`,x2:r-12,y1:12+e*(S-24),y2:12+e*(S-24),stroke:`var(--border)`,strokeDasharray:`4 6`,opacity:`0.7`},e)),c&&(0,i.jsx)(`path`,{d:w,fill:`var(--primary)`,opacity:`0.12`}),(0,i.jsx)(`path`,{d:C,fill:`none`,stroke:g,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`}),e.map((t,n)=>{let a=12+(e.length===1?(r-24)/2:n/(e.length-1)*(r-24)),o=12+(1-s(t,T))*(S-24),c=f?.[n],d=c==null?`${t}`:`${u(c)??`Value`}: ${t}`;return(0,i.jsx)(`circle`,{cx:a,cy:o,r:`3.5`,fill:g,children:(0,i.jsx)(`title`,{children:h?`${c??`Value`}: ${l(t,h)}`:d})},n)})]})}function v(e){return(0,i.jsx)(_,{showArea:!0,...e})}function y({values:e,positive:n=!0,stroke:r,className:a,...o}){return(0,i.jsx)(_,{values:e,width:180,size:`sm`,stroke:r??(n?`var(--primary)`:`var(--destructive)`),className:t.cn(`max-w-44`,a),"aria-label":`Sparkline`,...o})}function b({data:e,size:n=180,strokeWidth:r=18,centerLabel:a,centerValue:o,state:s=`ready`,emptyLabel:l=`No distribution data.`,className:d,...p}){let m=e.reduce((e,t)=>e+Math.max(t.value,0),0),h=n/2-r,g=e.map((t,n)=>{let r=Math.max(t.value,0),i=e.slice(0,n).reduce((e,t)=>e+Math.max(t.value,0),0);return{item:t,start:i,end:m>0?i+r/m*360:i}});return s===`loading`?(0,i.jsx)(`div`,{className:t.cn(`h-44 w-full max-w-48 animate-pulse rounded-full bg-muted/70`,d)}):s===`empty`||e.length===0||m<=0?(0,i.jsx)(`div`,{className:t.cn(`flex h-44 w-full max-w-48 items-center justify-center rounded-full border border-dashed border-border/70 px-4 text-center text-sm text-muted-foreground`,d),children:l}):(0,i.jsxs)(`svg`,{"data-slot":`donut-chart`,viewBox:`0 0 ${n} ${n}`,className:t.cn(`h-auto w-full max-w-48`,d),role:`img`,...p,children:[(0,i.jsx)(`circle`,{cx:n/2,cy:n/2,r:h,fill:`none`,stroke:`var(--muted)`,strokeWidth:r}),g.map(({item:e,start:t,end:a},o)=>(0,i.jsx)(`path`,{d:f(n/2,n/2,h,t,a),fill:`none`,stroke:c(o,e.color),strokeWidth:r,strokeLinecap:`round`,children:(0,i.jsx)(`title`,{children:`${u(e.label)??`Segment`}: ${e.value}`})},o)),(o||a)&&(0,i.jsxs)(`text`,{x:`50%`,y:`50%`,textAnchor:`middle`,dominantBaseline:`middle`,fill:`var(--foreground)`,children:[o&&(0,i.jsx)(`tspan`,{x:`50%`,dy:a?`-0.2em`:`0`,className:`text-lg font-semibold`,children:o}),a&&(0,i.jsx)(`tspan`,{x:`50%`,dy:`1.3em`,className:`text-xs fill-muted-foreground`,children:a})]})]})}function x({data:e,className:n,...r}){return(0,i.jsx)(`div`,{"data-slot":`chart-legend`,className:t.cn(`flex flex-wrap gap-3 text-xs text-muted-foreground`,n),...r,children:e.map((e,t)=>(0,i.jsxs)(`div`,{className:`inline-flex items-center gap-1.5`,children:[(0,i.jsx)(`span`,{className:`size-2 rounded-full bg-primary`,style:{background:c(t,e.color)}}),(0,i.jsx)(`span`,{children:e.label})]},t))})}function S({label:e,value:n,change:r,positive:a=!0,values:o,className:s,...c}){return(0,i.jsxs)(`div`,{"data-slot":`metric-trend`,className:t.cn(`grid gap-3 rounded-[var(--radius-2xl)] border border-border/75 bg-card/96 p-4 shadow-sm ring-1 ring-foreground/4`,s),...c,children:[(0,i.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,i.jsxs)(`div`,{className:`grid gap-1`,children:[(0,i.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:e}),(0,i.jsx)(`div`,{className:`text-2xl font-semibold tracking-tight`,children:n})]}),r&&(0,i.jsx)(`div`,{className:t.cn(`rounded-full px-2 py-1 text-xs font-medium`,a?`bg-primary/10 text-primary`:`bg-destructive/10 text-destructive`),children:r})]}),o&&(0,i.jsx)(y,{values:o,positive:a})]})}exports.AreaChart=v,exports.BarChart=g,exports.ChartFrame=h,exports.ChartLegend=x,exports.DonutChart=b,exports.LineChart=_,exports.MetricTrend=S,exports.Sparkline=y;
|
|
@@ -134,17 +134,21 @@ function y({ data: t, size: n = "md", max: r, showLabels: i = !0, showValues: a
|
|
|
134
134
|
})
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
|
-
function b({ values: t, size: n = "md", width: r = 560, showArea: i = !1, showGrid: a = !0, labels: d, valueFormatter: m, stroke: h = "var(--primary)", state: v = "ready", emptyLabel: y = "No line data.", className: b,
|
|
138
|
-
let
|
|
137
|
+
function b({ values: t, size: n = "md", width: r = 560, showArea: i = !1, showGrid: a = !0, labels: d, valueFormatter: m, stroke: h = "var(--primary)", state: v = "ready", emptyLabel: y = "No line data.", className: b, style: x, ...S }) {
|
|
138
|
+
let C = c[n], w = g(t, r, C), T = _(t, r, C), E = l(t);
|
|
139
139
|
return v === "loading" ? /* @__PURE__ */ o("div", { className: e("h-36 animate-pulse rounded-[min(var(--radius-xl),16px)] bg-muted/70", b) }) : v === "empty" || t.length === 0 ? /* @__PURE__ */ o("div", {
|
|
140
140
|
className: e("rounded-[min(var(--radius-xl),16px)] border border-dashed border-border/70 px-4 py-10 text-center text-sm text-muted-foreground", b),
|
|
141
141
|
children: y
|
|
142
142
|
}) : /* @__PURE__ */ s("svg", {
|
|
143
143
|
"data-slot": "line-chart",
|
|
144
|
-
viewBox: `0 0 ${r} ${
|
|
145
|
-
className: e("
|
|
144
|
+
viewBox: `0 0 ${r} ${C}`,
|
|
145
|
+
className: e("w-full overflow-visible", b),
|
|
146
|
+
style: {
|
|
147
|
+
height: C,
|
|
148
|
+
...x
|
|
149
|
+
},
|
|
146
150
|
role: "img",
|
|
147
|
-
...
|
|
151
|
+
...S,
|
|
148
152
|
children: [
|
|
149
153
|
a && [
|
|
150
154
|
.25,
|
|
@@ -153,19 +157,19 @@ function b({ values: t, size: n = "md", width: r = 560, showArea: i = !1, showGr
|
|
|
153
157
|
].map((e) => /* @__PURE__ */ o("line", {
|
|
154
158
|
x1: "12",
|
|
155
159
|
x2: r - 12,
|
|
156
|
-
y1: 12 + e * (
|
|
157
|
-
y2: 12 + e * (
|
|
160
|
+
y1: 12 + e * (C - 24),
|
|
161
|
+
y2: 12 + e * (C - 24),
|
|
158
162
|
stroke: "var(--border)",
|
|
159
163
|
strokeDasharray: "4 6",
|
|
160
164
|
opacity: "0.7"
|
|
161
165
|
}, e)),
|
|
162
166
|
i && /* @__PURE__ */ o("path", {
|
|
163
|
-
d:
|
|
167
|
+
d: T,
|
|
164
168
|
fill: "var(--primary)",
|
|
165
169
|
opacity: "0.12"
|
|
166
170
|
}),
|
|
167
171
|
/* @__PURE__ */ o("path", {
|
|
168
|
-
d:
|
|
172
|
+
d: w,
|
|
169
173
|
fill: "none",
|
|
170
174
|
stroke: h,
|
|
171
175
|
strokeWidth: "3",
|
|
@@ -173,7 +177,7 @@ function b({ values: t, size: n = "md", width: r = 560, showArea: i = !1, showGr
|
|
|
173
177
|
strokeLinejoin: "round"
|
|
174
178
|
}),
|
|
175
179
|
t.map((e, n) => {
|
|
176
|
-
let i = 12 + (t.length === 1 ? (r - 24) / 2 : n / (t.length - 1) * (r - 24)), a = 12 + (1 - u(e,
|
|
180
|
+
let i = 12 + (t.length === 1 ? (r - 24) / 2 : n / (t.length - 1) * (r - 24)), a = 12 + (1 - u(e, E)) * (C - 24), s = d?.[n], c = s == null ? `${e}` : `${p(s) ?? "Value"}: ${e}`;
|
|
177
181
|
return /* @__PURE__ */ o("circle", {
|
|
178
182
|
cx: i,
|
|
179
183
|
cy: a,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs"),r=require("../../../node_modules/@dnd-kit/helpers/dist/index.cjs"),i=require("../../../node_modules/@dnd-kit/react/index.cjs"),a=require("../../../node_modules/@dnd-kit/dom/sortable.cjs"),o=require("../../../node_modules/@dnd-kit/react/sortable.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("lucide-react"),l=require("react/jsx-runtime");var u=`tembro-kanban-card:`,d=`tembro-kanban-column:`;function f(e){return`${u}${e}`}function p(e){return`${d}${e}`}function m(e){return e.startsWith(u)?e.slice(19):e}function h(e){let t=e===void 0?``:String(e);return t.startsWith(d)?t.slice(21):t}function g(e){return new Map(e.flatMap(e=>e.cards.map(e=>[f(e.key),e])))}function _(e,t){let n=g(e),i=r.move(Object.fromEntries(e.map(e=>[p(e.key),e.cards.map(e=>f(e.key))])),t);return e.map(e=>({...e,cards:(i[p(e.key)]??[]).map(e=>n.get(String(e))).filter(e=>!!e)}))}
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs"),r=require("../../../node_modules/@dnd-kit/helpers/dist/index.cjs"),i=require("../../../node_modules/@dnd-kit/react/index.cjs"),a=require("../../../node_modules/@dnd-kit/dom/sortable.cjs"),o=require("../../../node_modules/@dnd-kit/react/sortable.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("lucide-react"),l=require("react/jsx-runtime");var u=`tembro-kanban-card:`,d=`tembro-kanban-column:`;function f(e){return`${u}${e}`}function p(e){return`${d}${e}`}function m(e){return e.startsWith(u)?e.slice(19):e}function h(e){let t=e===void 0?``:String(e);return t.startsWith(d)?t.slice(21):t}function g(e){return new Map(e.flatMap(e=>e.cards.map(e=>[f(e.key),e])))}function _(e,t){let n=g(e),i=r.move(Object.fromEntries(e.map(e=>[p(e.key),e.cards.map(e=>f(e.key))])),t);return e.map(e=>({...e,cards:(i[p(e.key)]??[]).map(e=>n.get(String(e))).filter(e=>!!e)}))}function v(e,t,n){let r=e.find(e=>e.key===t.columnKey),i=e.find(e=>e.key===n.columnKey);if(!r||!i)return null;let a=r.cards.find(e=>e.key===t.cardKey);if(!a)return null;let o=r.cards.findIndex(e=>e.key===t.cardKey);if(o<0)return null;let s=i.cards,c=n.index??s.length;if(r.key===i.key&&c>o&&--c,c=Math.max(0,Math.min(c,s.length)),r.key===i.key&&o===c)return null;let l=e.map(e=>e.key===r.key?{...e,cards:e.cards.filter(e=>e.key!==t.cardKey)}:e).map(e=>{if(e.key!==i.key)return e;let t=[...e.cards];return t.splice(c,0,a),{...e,cards:t}});return{columns:l,change:{card:a,fromColumn:r,toColumn:l.find(e=>e.key===i.key)??i,fromIndex:o,toIndex:c}}}var y=s.forwardRef(function({label:e,disabled:t},n){return(0,l.jsx)(`button`,{ref:n,type:`button`,className:`inline-flex size-8 shrink-0 touch-none items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-45`,"aria-label":e,disabled:t,onClick:e=>e.stopPropagation(),children:(0,l.jsx)(c.GripVerticalIcon,{className:`size-4`,"aria-hidden":`true`})})});function b({card:e,handle:t}){return(0,l.jsxs)(n.Card,{className:`transition-colors hover:bg-muted/40`,children:[(0,l.jsx)(n.CardHeader,{className:`p-3 pb-1`,children:(0,l.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,l.jsx)(n.CardTitle,{className:`text-sm`,children:e.title}),(0,l.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.extra,t]})]})}),e.description||e.meta?(0,l.jsxs)(n.CardContent,{className:`grid gap-2 p-3 pt-0 text-xs text-muted-foreground`,children:[e.description,e.meta?(0,l.jsx)(`div`,{children:e.meta}):null]}):null]})}function x({card:e,column:n,index:r,boardDisabled:i,renderCard:a,onCardClick:s,dragHandleLabel:c,cardClassName:u,onNativeDragStart:d,onNativeDragEnd:m,onNativeDrop:h}){let g=i||n.disabled===!0||e.disabled===!0,{ref:_,handleRef:v,isDragging:x,isDropTarget:S}=o.useSortable({id:f(e.key),index:r,group:p(n.key),type:`tembro-kanban-card`,accept:`tembro-kanban-card`,disabled:g,data:{cardKey:e.key,columnKey:n.key},transition:{duration:180,easing:`cubic-bezier(0.2, 0, 0, 1)`,idle:!0}}),C=(0,l.jsx)(y,{ref:v,label:c?.(e,n)??`Move ${String(e.title)}`,disabled:g}),w={index:r,isDragging:x,isDropTarget:S,handle:C};return(0,l.jsx)(`article`,{ref:_,"data-slot":`kanban-card`,"data-dragging":x||void 0,"data-drop-target":S||void 0,"data-disabled":g||void 0,role:s&&!g?`button`:void 0,tabIndex:s&&!g?0:void 0,"aria-label":typeof e.title==`string`?e.title:void 0,draggable:!g,className:t.cn(`rounded-lg outline-none transition-[opacity,box-shadow]`,s&&!g&&`cursor-pointer focus-visible:ring-2 focus-visible:ring-ring`,S&&`ring-2 ring-primary/30`,x&&`opacity-30`,g&&`opacity-55`,u),onClick:()=>{g||s?.(e,n)},onDragStart:t=>{if(g)return;let i={cardKey:e.key,columnKey:n.key,index:r};t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,JSON.stringify(i)),d?.(i)},onDragEnd:m,onDragOver:e=>{g||e.preventDefault()},onDrop:e=>{g||(e.preventDefault(),e.stopPropagation(),h?.({columnKey:n.key,index:r}))},onKeyDown:t=>{t.target!==t.currentTarget||g||!s||(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),s(e,n))},children:a?.(e,n,w)??(0,l.jsx)(b,{card:e,handle:C})})}function S({column:e,boardDisabled:n,renderCard:r,onCardClick:a,dragHandleLabel:o,emptyColumn:s,columnClassName:c,cardClassName:u,onNativeDragStart:d,onNativeDragEnd:f,onNativeDrop:m}){let{ref:h,isDropTarget:g}=i.useDroppable({id:p(e.key),type:`tembro-kanban-column`,accept:`tembro-kanban-card`,disabled:n||e.disabled===!0,collisionPriority:1,data:{columnKey:e.key}});return(0,l.jsxs)(`section`,{ref:h,"data-slot":`kanban-column`,"data-drop-target":g||void 0,"data-disabled":e.disabled||void 0,"aria-label":typeof e.title==`string`?e.title:void 0,className:t.cn(`grid min-h-40 content-start gap-3 rounded-lg border bg-muted/35 p-3 transition-[border-color,background-color,box-shadow]`,g&&`border-primary/60 bg-primary/5 ring-2 ring-primary/15`,e.disabled&&`opacity-60`,c),onDragOver:t=>{n||e.disabled===!0||t.preventDefault()},onDrop:t=>{n||e.disabled===!0||(t.preventDefault(),m?.({columnKey:e.key,index:e.cards.length}))},children:[(0,l.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,l.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,l.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:e.title}),e.description?(0,l.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description}):null]}),(0,l.jsx)(`div`,{className:`rounded-full bg-background px-2 py-0.5 text-xs text-muted-foreground`,children:e.count??e.cards.length})]}),(0,l.jsx)(`div`,{className:`grid min-h-16 content-start gap-2`,children:e.cards.length===0?(0,l.jsxs)(`div`,{className:`grid min-h-20 place-items-center rounded-lg border border-dashed p-3 text-center text-xs text-muted-foreground`,children:[(0,l.jsx)(`span`,{children:s}),(0,l.jsx)(`span`,{className:`sr-only`,children:`No cards yet.`})]}):e.cards.map((t,i)=>(0,l.jsx)(x,{card:t,column:e,index:i,boardDisabled:n,renderCard:r,onCardClick:a,dragHandleLabel:o,cardClassName:u,onNativeDragStart:d,onNativeDragEnd:f,onNativeDrop:m},t.key))})]})}function C({columns:e,defaultColumns:n=[],onColumnsChange:r,onCardMove:o,renderCard:c,onCardClick:u,disabled:d=!1,emptyColumn:p=`Drop cards here.`,dragHandleLabel:g,columnClassName:y,cardClassName:x,overlayClassName:C,className:w,"aria-label":T=`Kanban board`,...E}){let[D,O]=s.useState(()=>n),[k,A]=s.useState(null),[j,M]=s.useState(null),N=s.useRef(null),P=s.useRef(null),F=e??D,I=k??F,L=e!==void 0;function R(e){let t=e.operation.source;if(!t)return;let n=String(t.id);N.current=F,A(F),M(n)}function z(e){let t=e.operation.source;if(!t||!a.isSortable(t))return;let n=_(N.current??F,e);N.current=n,A(n)}function B(e){let t=e.operation.source;if(M(null),e.canceled||!t||!a.isSortable(t)){N.current=null,A(null);return}let n=N.current??_(F,e),i=m(String(t.id)),s=h(t.initialGroup),c=h(t.group),l=F.find(e=>e.key===s),u=n.find(e=>e.key===c),d=l?.cards.find(e=>e.key===i);if(N.current=null,A(null),!d||!l||!u)return;let f={card:d,fromColumn:l,toColumn:u,fromIndex:t.initialIndex,toIndex:t.index};L||O(n),r?.(n,f),o?.(f)}function V(e){let t=P.current;if(P.current=null,!t)return;let n=v(F,t,e);n&&(L||O(n.columns),r?.(n.columns,n.change),o?.(n.change))}let H=j?I.flatMap(e=>e.cards.map(t=>({card:t,column:e}))).find(({card:e})=>f(e.key)===j):void 0;return(0,l.jsxs)(i.DragDropProvider,{onDragStart:R,onDragOver:z,onDragEnd:B,children:[(0,l.jsx)(`div`,{...E,role:`group`,"aria-label":T,"data-slot":`kanban-board`,className:t.cn(`grid gap-4 sm:auto-cols-[minmax(280px,1fr)] sm:grid-flow-col sm:overflow-x-auto sm:pb-2`,w),children:I.map(e=>(0,l.jsx)(S,{column:e,boardDisabled:d,renderCard:c,onCardClick:u,dragHandleLabel:g,emptyColumn:p,columnClassName:y,cardClassName:x,onNativeDragStart:e=>{P.current=e},onNativeDragEnd:()=>{P.current=null},onNativeDrop:V},e.key))}),(0,l.jsx)(i.DragOverlay,{children:H?(0,l.jsx)(`div`,{className:t.cn(`min-w-64 rotate-1 opacity-95 shadow-2xl`,C),children:c?.(H.card,H.column,{index:H.column.cards.findIndex(e=>e.key===H.card.key),isDragging:!0,isDropTarget:!1,handle:null})??(0,l.jsx)(b,{card:H.card,handle:null})}):null})]})}exports.KanbanBoard=C;
|
|
@@ -33,7 +33,38 @@ function S(e, t) {
|
|
|
33
33
|
cards: (r[v(e.key)] ?? []).map((e) => n.get(String(e))).filter((e) => !!e)
|
|
34
34
|
}));
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
function C(e, t, n) {
|
|
37
|
+
let r = e.find((e) => e.key === t.columnKey), i = e.find((e) => e.key === n.columnKey);
|
|
38
|
+
if (!r || !i) return null;
|
|
39
|
+
let a = r.cards.find((e) => e.key === t.cardKey);
|
|
40
|
+
if (!a) return null;
|
|
41
|
+
let o = r.cards.findIndex((e) => e.key === t.cardKey);
|
|
42
|
+
if (o < 0) return null;
|
|
43
|
+
let s = i.cards, c = n.index ?? s.length;
|
|
44
|
+
if (r.key === i.key && c > o && --c, c = Math.max(0, Math.min(c, s.length)), r.key === i.key && o === c) return null;
|
|
45
|
+
let l = e.map((e) => e.key === r.key ? {
|
|
46
|
+
...e,
|
|
47
|
+
cards: e.cards.filter((e) => e.key !== t.cardKey)
|
|
48
|
+
} : e).map((e) => {
|
|
49
|
+
if (e.key !== i.key) return e;
|
|
50
|
+
let t = [...e.cards];
|
|
51
|
+
return t.splice(c, 0, a), {
|
|
52
|
+
...e,
|
|
53
|
+
cards: t
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
return {
|
|
57
|
+
columns: l,
|
|
58
|
+
change: {
|
|
59
|
+
card: a,
|
|
60
|
+
fromColumn: r,
|
|
61
|
+
toColumn: l.find((e) => e.key === i.key) ?? i,
|
|
62
|
+
fromIndex: o,
|
|
63
|
+
toIndex: c
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
var w = d.forwardRef(function({ label: e, disabled: t }, n) {
|
|
37
68
|
return /* @__PURE__ */ p("button", {
|
|
38
69
|
ref: n,
|
|
39
70
|
type: "button",
|
|
@@ -47,7 +78,7 @@ var C = d.forwardRef(function({ label: e, disabled: t }, n) {
|
|
|
47
78
|
})
|
|
48
79
|
});
|
|
49
80
|
});
|
|
50
|
-
function
|
|
81
|
+
function T({ card: e, handle: a }) {
|
|
51
82
|
return /* @__PURE__ */ m(t, {
|
|
52
83
|
className: "transition-colors hover:bg-muted/40",
|
|
53
84
|
children: [/* @__PURE__ */ p(r, {
|
|
@@ -68,14 +99,14 @@ function w({ card: e, handle: a }) {
|
|
|
68
99
|
}) : null]
|
|
69
100
|
});
|
|
70
101
|
}
|
|
71
|
-
function
|
|
72
|
-
let
|
|
102
|
+
function E({ card: t, column: n, index: r, boardDisabled: i, renderCard: a, onCardClick: o, dragHandleLabel: s, cardClassName: c, onNativeDragStart: l, onNativeDragEnd: d, onNativeDrop: f }) {
|
|
103
|
+
let m = i || n.disabled === !0 || t.disabled === !0, { ref: h, handleRef: g, isDragging: y, isDropTarget: b } = u({
|
|
73
104
|
id: _(t.key),
|
|
74
105
|
index: r,
|
|
75
106
|
group: v(n.key),
|
|
76
107
|
type: "tembro-kanban-card",
|
|
77
108
|
accept: "tembro-kanban-card",
|
|
78
|
-
disabled:
|
|
109
|
+
disabled: m,
|
|
79
110
|
data: {
|
|
80
111
|
cardKey: t.key,
|
|
81
112
|
columnKey: n.key
|
|
@@ -85,40 +116,60 @@ function T({ card: t, column: n, index: r, boardDisabled: i, renderCard: a, onCa
|
|
|
85
116
|
easing: "cubic-bezier(0.2, 0, 0, 1)",
|
|
86
117
|
idle: !0
|
|
87
118
|
}
|
|
88
|
-
}),
|
|
89
|
-
ref:
|
|
119
|
+
}), x = /* @__PURE__ */ p(w, {
|
|
120
|
+
ref: g,
|
|
90
121
|
label: s?.(t, n) ?? `Move ${String(t.title)}`,
|
|
91
|
-
disabled:
|
|
92
|
-
}),
|
|
122
|
+
disabled: m
|
|
123
|
+
}), S = {
|
|
93
124
|
index: r,
|
|
94
|
-
isDragging:
|
|
95
|
-
isDropTarget:
|
|
96
|
-
handle:
|
|
125
|
+
isDragging: y,
|
|
126
|
+
isDropTarget: b,
|
|
127
|
+
handle: x
|
|
97
128
|
};
|
|
98
129
|
return /* @__PURE__ */ p("article", {
|
|
99
|
-
ref:
|
|
130
|
+
ref: h,
|
|
100
131
|
"data-slot": "kanban-card",
|
|
101
|
-
"data-dragging":
|
|
102
|
-
"data-drop-target":
|
|
103
|
-
"data-disabled":
|
|
104
|
-
role: o && !
|
|
105
|
-
tabIndex: o && !
|
|
132
|
+
"data-dragging": y || void 0,
|
|
133
|
+
"data-drop-target": b || void 0,
|
|
134
|
+
"data-disabled": m || void 0,
|
|
135
|
+
role: o && !m ? "button" : void 0,
|
|
136
|
+
tabIndex: o && !m ? 0 : void 0,
|
|
106
137
|
"aria-label": typeof t.title == "string" ? t.title : void 0,
|
|
107
|
-
|
|
138
|
+
draggable: !m,
|
|
139
|
+
className: e("rounded-lg outline-none transition-[opacity,box-shadow]", o && !m && "cursor-pointer focus-visible:ring-2 focus-visible:ring-ring", b && "ring-2 ring-primary/30", y && "opacity-30", m && "opacity-55", c),
|
|
108
140
|
onClick: () => {
|
|
109
|
-
|
|
141
|
+
m || o?.(t, n);
|
|
142
|
+
},
|
|
143
|
+
onDragStart: (e) => {
|
|
144
|
+
if (m) return;
|
|
145
|
+
let i = {
|
|
146
|
+
cardKey: t.key,
|
|
147
|
+
columnKey: n.key,
|
|
148
|
+
index: r
|
|
149
|
+
};
|
|
150
|
+
e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", JSON.stringify(i)), l?.(i);
|
|
151
|
+
},
|
|
152
|
+
onDragEnd: d,
|
|
153
|
+
onDragOver: (e) => {
|
|
154
|
+
m || e.preventDefault();
|
|
155
|
+
},
|
|
156
|
+
onDrop: (e) => {
|
|
157
|
+
m || (e.preventDefault(), e.stopPropagation(), f?.({
|
|
158
|
+
columnKey: n.key,
|
|
159
|
+
index: r
|
|
160
|
+
}));
|
|
110
161
|
},
|
|
111
162
|
onKeyDown: (e) => {
|
|
112
|
-
e.target !== e.currentTarget ||
|
|
163
|
+
e.target !== e.currentTarget || m || !o || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), o(t, n));
|
|
113
164
|
},
|
|
114
|
-
children: a?.(t, n,
|
|
165
|
+
children: a?.(t, n, S) ?? /* @__PURE__ */ p(T, {
|
|
115
166
|
card: t,
|
|
116
|
-
handle:
|
|
167
|
+
handle: x
|
|
117
168
|
})
|
|
118
169
|
});
|
|
119
170
|
}
|
|
120
|
-
function
|
|
121
|
-
let { ref:
|
|
171
|
+
function D({ column: t, boardDisabled: n, renderCard: r, onCardClick: i, dragHandleLabel: a, emptyColumn: o, columnClassName: s, cardClassName: l, onNativeDragStart: u, onNativeDragEnd: d, onNativeDrop: f }) {
|
|
172
|
+
let { ref: h, isDropTarget: g } = c({
|
|
122
173
|
id: v(t.key),
|
|
123
174
|
type: "tembro-kanban-column",
|
|
124
175
|
accept: "tembro-kanban-card",
|
|
@@ -127,12 +178,21 @@ function E({ column: t, boardDisabled: n, renderCard: r, onCardClick: i, dragHan
|
|
|
127
178
|
data: { columnKey: t.key }
|
|
128
179
|
});
|
|
129
180
|
return /* @__PURE__ */ m("section", {
|
|
130
|
-
ref:
|
|
181
|
+
ref: h,
|
|
131
182
|
"data-slot": "kanban-column",
|
|
132
|
-
"data-drop-target":
|
|
183
|
+
"data-drop-target": g || void 0,
|
|
133
184
|
"data-disabled": t.disabled || void 0,
|
|
134
185
|
"aria-label": typeof t.title == "string" ? t.title : void 0,
|
|
135
|
-
className: e("grid min-h-40 content-start gap-3 rounded-lg border bg-muted/35 p-3 transition-[border-color,background-color,box-shadow]",
|
|
186
|
+
className: e("grid min-h-40 content-start gap-3 rounded-lg border bg-muted/35 p-3 transition-[border-color,background-color,box-shadow]", g && "border-primary/60 bg-primary/5 ring-2 ring-primary/15", t.disabled && "opacity-60", s),
|
|
187
|
+
onDragOver: (e) => {
|
|
188
|
+
n || t.disabled === !0 || e.preventDefault();
|
|
189
|
+
},
|
|
190
|
+
onDrop: (e) => {
|
|
191
|
+
n || t.disabled === !0 || (e.preventDefault(), f?.({
|
|
192
|
+
columnKey: t.key,
|
|
193
|
+
index: t.cards.length
|
|
194
|
+
}));
|
|
195
|
+
},
|
|
136
196
|
children: [/* @__PURE__ */ m("div", {
|
|
137
197
|
className: "flex items-start justify-between gap-3",
|
|
138
198
|
children: [/* @__PURE__ */ m("div", {
|
|
@@ -156,7 +216,7 @@ function E({ column: t, boardDisabled: n, renderCard: r, onCardClick: i, dragHan
|
|
|
156
216
|
className: "sr-only",
|
|
157
217
|
children: "No cards yet."
|
|
158
218
|
})]
|
|
159
|
-
}) : t.cards.map((e, o) => /* @__PURE__ */ p(
|
|
219
|
+
}) : t.cards.map((e, o) => /* @__PURE__ */ p(E, {
|
|
160
220
|
card: e,
|
|
161
221
|
column: t,
|
|
162
222
|
index: o,
|
|
@@ -164,33 +224,36 @@ function E({ column: t, boardDisabled: n, renderCard: r, onCardClick: i, dragHan
|
|
|
164
224
|
renderCard: r,
|
|
165
225
|
onCardClick: i,
|
|
166
226
|
dragHandleLabel: a,
|
|
167
|
-
cardClassName: l
|
|
227
|
+
cardClassName: l,
|
|
228
|
+
onNativeDragStart: u,
|
|
229
|
+
onNativeDragEnd: d,
|
|
230
|
+
onNativeDrop: f
|
|
168
231
|
}, e.key))
|
|
169
232
|
})]
|
|
170
233
|
});
|
|
171
234
|
}
|
|
172
|
-
function
|
|
173
|
-
let [
|
|
174
|
-
function
|
|
235
|
+
function O({ columns: t, defaultColumns: n = [], onColumnsChange: r, onCardMove: i, renderCard: a, onCardClick: c, disabled: u = !1, emptyColumn: f = "Drop cards here.", dragHandleLabel: h, columnClassName: g, cardClassName: v, overlayClassName: x, className: w, "aria-label": E = "Kanban board", ...O }) {
|
|
236
|
+
let [k, A] = d.useState(() => n), [j, M] = d.useState(null), [N, P] = d.useState(null), F = d.useRef(null), I = d.useRef(null), L = t ?? k, R = j ?? L, z = t !== void 0;
|
|
237
|
+
function B(e) {
|
|
175
238
|
let t = e.operation.source;
|
|
176
239
|
if (!t) return;
|
|
177
240
|
let n = String(t.id);
|
|
178
|
-
|
|
241
|
+
F.current = L, M(L), P(n);
|
|
179
242
|
}
|
|
180
|
-
function
|
|
243
|
+
function V(e) {
|
|
181
244
|
let t = e.operation.source;
|
|
182
245
|
if (!t || !l(t)) return;
|
|
183
|
-
let n = S(
|
|
184
|
-
|
|
246
|
+
let n = S(F.current ?? L, e);
|
|
247
|
+
F.current = n, M(n);
|
|
185
248
|
}
|
|
186
|
-
function
|
|
249
|
+
function H(e) {
|
|
187
250
|
let t = e.operation.source;
|
|
188
|
-
if (
|
|
189
|
-
|
|
251
|
+
if (P(null), e.canceled || !t || !l(t)) {
|
|
252
|
+
F.current = null, M(null);
|
|
190
253
|
return;
|
|
191
254
|
}
|
|
192
|
-
let n =
|
|
193
|
-
if (
|
|
255
|
+
let n = F.current ?? S(L, e), a = y(String(t.id)), o = b(t.initialGroup), s = b(t.group), c = L.find((e) => e.key === o), u = n.find((e) => e.key === s), d = c?.cards.find((e) => e.key === a);
|
|
256
|
+
if (F.current = null, M(null), !d || !c || !u) return;
|
|
194
257
|
let f = {
|
|
195
258
|
card: d,
|
|
196
259
|
fromColumn: c,
|
|
@@ -198,23 +261,29 @@ function D({ columns: t, defaultColumns: n = [], onColumnsChange: r, onCardMove:
|
|
|
198
261
|
fromIndex: t.initialIndex,
|
|
199
262
|
toIndex: t.index
|
|
200
263
|
};
|
|
201
|
-
|
|
264
|
+
z || A(n), r?.(n, f), i?.(f);
|
|
265
|
+
}
|
|
266
|
+
function U(e) {
|
|
267
|
+
let t = I.current;
|
|
268
|
+
if (I.current = null, !t) return;
|
|
269
|
+
let n = C(L, t, e);
|
|
270
|
+
n && (z || A(n.columns), r?.(n.columns, n.change), i?.(n.change));
|
|
202
271
|
}
|
|
203
|
-
let
|
|
272
|
+
let W = N ? R.flatMap((e) => e.cards.map((t) => ({
|
|
204
273
|
card: t,
|
|
205
274
|
column: e
|
|
206
|
-
}))).find(({ card: e }) => _(e.key) ===
|
|
275
|
+
}))).find(({ card: e }) => _(e.key) === N) : void 0;
|
|
207
276
|
return /* @__PURE__ */ m(o, {
|
|
208
|
-
onDragStart:
|
|
209
|
-
onDragOver:
|
|
210
|
-
onDragEnd:
|
|
277
|
+
onDragStart: B,
|
|
278
|
+
onDragOver: V,
|
|
279
|
+
onDragEnd: H,
|
|
211
280
|
children: [/* @__PURE__ */ p("div", {
|
|
212
|
-
...
|
|
281
|
+
...O,
|
|
213
282
|
role: "group",
|
|
214
|
-
"aria-label":
|
|
283
|
+
"aria-label": E,
|
|
215
284
|
"data-slot": "kanban-board",
|
|
216
|
-
className: e("grid gap-4 sm:auto-cols-[minmax(280px,1fr)] sm:grid-flow-col sm:overflow-x-auto sm:pb-2",
|
|
217
|
-
children:
|
|
285
|
+
className: e("grid gap-4 sm:auto-cols-[minmax(280px,1fr)] sm:grid-flow-col sm:overflow-x-auto sm:pb-2", w),
|
|
286
|
+
children: R.map((e) => /* @__PURE__ */ p(D, {
|
|
218
287
|
column: e,
|
|
219
288
|
boardDisabled: u,
|
|
220
289
|
renderCard: a,
|
|
@@ -222,21 +291,28 @@ function D({ columns: t, defaultColumns: n = [], onColumnsChange: r, onCardMove:
|
|
|
222
291
|
dragHandleLabel: h,
|
|
223
292
|
emptyColumn: f,
|
|
224
293
|
columnClassName: g,
|
|
225
|
-
cardClassName: v
|
|
294
|
+
cardClassName: v,
|
|
295
|
+
onNativeDragStart: (e) => {
|
|
296
|
+
I.current = e;
|
|
297
|
+
},
|
|
298
|
+
onNativeDragEnd: () => {
|
|
299
|
+
I.current = null;
|
|
300
|
+
},
|
|
301
|
+
onNativeDrop: U
|
|
226
302
|
}, e.key))
|
|
227
|
-
}), /* @__PURE__ */ p(s, { children:
|
|
303
|
+
}), /* @__PURE__ */ p(s, { children: W ? /* @__PURE__ */ p("div", {
|
|
228
304
|
className: e("min-w-64 rotate-1 opacity-95 shadow-2xl", x),
|
|
229
|
-
children: a?.(
|
|
230
|
-
index:
|
|
305
|
+
children: a?.(W.card, W.column, {
|
|
306
|
+
index: W.column.cards.findIndex((e) => e.key === W.card.key),
|
|
231
307
|
isDragging: !0,
|
|
232
308
|
isDropTarget: !1,
|
|
233
309
|
handle: null
|
|
234
|
-
}) ?? /* @__PURE__ */ p(
|
|
235
|
-
card:
|
|
310
|
+
}) ?? /* @__PURE__ */ p(T, {
|
|
311
|
+
card: W.card,
|
|
236
312
|
handle: null
|
|
237
313
|
})
|
|
238
314
|
}) : null })]
|
|
239
315
|
});
|
|
240
316
|
}
|
|
241
317
|
//#endregion
|
|
242
|
-
export {
|
|
318
|
+
export { O as KanbanBoard };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("lucide-react"),i=require("react/jsx-runtime");var a={info:{soft:`border-primary/25 bg-primary/5 text-foreground`,outline:`border-primary/35 bg-background text-foreground`,solid:`border-primary bg-primary text-primary-foreground`},success:{soft:`border-emerald-500/25 bg-emerald-500/10 text-foreground`,outline:`border-emerald-500/35 bg-background text-foreground`,solid:`border-emerald-600 bg-emerald-600 text-white`},warning:{soft:`border-amber-500/30 bg-amber-500/10 text-foreground`,outline:`border-amber-500/35 bg-background text-foreground`,solid:`border-amber-500 bg-amber-500 text-amber-950`},destructive:{soft:`border-destructive/30 bg-destructive/10 text-foreground`,outline:`border-destructive/35 bg-background text-foreground`,solid:`border-destructive bg-destructive text-destructive-foreground`},muted:{soft:`border-border bg-muted/50 text-foreground`,outline:`border-border bg-background text-foreground`,solid:`border-border bg-foreground text-background`}},o={info:`text-primary`,success:`text-emerald-600 dark:text-emerald-400`,warning:`text-amber-600 dark:text-amber-400`,destructive:`text-destructive`,muted:`text-muted-foreground`};function s(e){switch(e){case`success`:return(0,i.jsx)(r.CheckCircle2Icon,{className:`size-4`});case`warning`:return(0,i.jsx)(r.TriangleAlertIcon,{className:`size-4`});case`destructive`:return(0,i.jsx)(r.AlertCircleIcon,{className:`size-4`});default:return(0,i.jsx)(r.InfoIcon,{className:`size-4`})}}function c({tone:e=`info`,variant:n=`soft`,size:r=`md`,title:c,description:l,icon:u,action:d,dismissible:f=!1,dismissLabel:p=`Dismiss alert`,onDismiss:m,actionsAlign:h=`end`,className:g,children:_,...v}){return(0,i.jsxs)(`div`,{"data-slot":`alert`,"data-size":r,role:e===`destructive`||e===`warning`?`alert`:`status`,className:t.cn(`flex gap-3 rounded-[var(--aui-card-radius,var(--radius-xl))] border p-4 text-sm shadow-[var(--aui-card-shadow,var(--aui-control-shadow,0_1px_0_rgba(255,255,255,0.05)))] data-[size=sm]:p-3`,a[e][n],g),...v,children:[(0,i.jsx)(`div`,{"data-slot":`alert-icon`,className:t.cn(`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-full border border-current/10 bg-background/55`,n===`solid`&&`bg-white/12 text-current`,o[e]),children:u??s(e)}),(0,i.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[c&&(0,i.jsx)(`div`,{"data-slot":`alert-title`,className:`font-medium leading-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("lucide-react"),i=require("react/jsx-runtime");var a={info:{soft:`border-primary/25 bg-primary/5 text-foreground`,outline:`border-primary/35 bg-background text-foreground`,solid:`border-primary bg-primary text-primary-foreground`},success:{soft:`border-emerald-500/25 bg-emerald-500/10 text-foreground`,outline:`border-emerald-500/35 bg-background text-foreground`,solid:`border-emerald-600 bg-emerald-600 text-white`},warning:{soft:`border-amber-500/30 bg-amber-500/10 text-foreground`,outline:`border-amber-500/35 bg-background text-foreground`,solid:`border-amber-500 bg-amber-500 text-amber-950`},destructive:{soft:`border-destructive/30 bg-destructive/10 text-foreground`,outline:`border-destructive/35 bg-background text-foreground`,solid:`border-destructive bg-destructive text-destructive-foreground`},muted:{soft:`border-border bg-muted/50 text-foreground`,outline:`border-border bg-background text-foreground`,solid:`border-border bg-foreground text-background`}},o={info:`text-primary`,success:`text-emerald-600 dark:text-emerald-400`,warning:`text-amber-600 dark:text-amber-400`,destructive:`text-destructive`,muted:`text-muted-foreground`};function s(e){switch(e){case`success`:return(0,i.jsx)(r.CheckCircle2Icon,{className:`size-4`});case`warning`:return(0,i.jsx)(r.TriangleAlertIcon,{className:`size-4`});case`destructive`:return(0,i.jsx)(r.AlertCircleIcon,{className:`size-4`});default:return(0,i.jsx)(r.InfoIcon,{className:`size-4`})}}function c({tone:e=`info`,variant:n=`soft`,size:r=`md`,title:c,description:l,icon:u,action:d,dismissible:f=!1,dismissLabel:p=`Dismiss alert`,onDismiss:m,actionsAlign:h=`end`,className:g,children:_,...v}){return(0,i.jsxs)(`div`,{"data-slot":`alert`,"data-size":r,role:e===`destructive`||e===`warning`?`alert`:`status`,className:t.cn(`flex min-w-0 gap-3 rounded-[var(--aui-card-radius,var(--radius-xl))] border p-4 text-sm shadow-[var(--aui-card-shadow,var(--aui-control-shadow,0_1px_0_rgba(255,255,255,0.05)))] data-[size=sm]:p-3`,a[e][n],g),...v,children:[(0,i.jsx)(`div`,{"data-slot":`alert-icon`,className:t.cn(`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-full border border-current/10 bg-background/55`,n===`solid`&&`bg-white/12 text-current`,o[e]),children:u??s(e)}),(0,i.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[c&&(0,i.jsx)(`div`,{"data-slot":`alert-title`,className:`max-w-full break-words font-medium leading-snug`,children:c}),(l||_)&&(0,i.jsx)(`div`,{"data-slot":`alert-description`,className:t.cn(`max-w-full break-words leading-snug text-muted-foreground`,n===`solid`&&`text-current/88`),children:l??_})]}),d||f?(0,i.jsxs)(`div`,{"data-slot":`alert-action`,className:t.cn(`flex shrink-0 items-start gap-2`,h===`start`&&`order-[-1] mr-2`),children:[d,f?(0,i.jsx)(`button`,{type:`button`,"aria-label":p,className:t.cn(`inline-flex size-8 items-center justify-center rounded-full border border-current/10 bg-background/45 text-current transition-opacity hover:opacity-90`,n===`solid`&&`bg-white/12`),onClick:m,children:(0,i.jsx)(`span`,{"aria-hidden":`true`,children:`×`})}):null]}):null]})}exports.Alert=c;
|
|
@@ -49,7 +49,7 @@ function u({ tone: t = "info", variant: n = "soft", size: r = "md", title: i, de
|
|
|
49
49
|
"data-slot": "alert",
|
|
50
50
|
"data-size": r,
|
|
51
51
|
role: t === "destructive" || t === "warning" ? "alert" : "status",
|
|
52
|
-
className: e("flex gap-3 rounded-[var(--aui-card-radius,var(--radius-xl))] border p-4 text-sm shadow-[var(--aui-card-shadow,var(--aui-control-shadow,0_1px_0_rgba(255,255,255,0.05)))] data-[size=sm]:p-3", s[t][n], _),
|
|
52
|
+
className: e("flex min-w-0 gap-3 rounded-[var(--aui-card-radius,var(--radius-xl))] border p-4 text-sm shadow-[var(--aui-card-shadow,var(--aui-control-shadow,0_1px_0_rgba(255,255,255,0.05)))] data-[size=sm]:p-3", s[t][n], _),
|
|
53
53
|
...y,
|
|
54
54
|
children: [
|
|
55
55
|
/* @__PURE__ */ a("div", {
|
|
@@ -61,11 +61,11 @@ function u({ tone: t = "info", variant: n = "soft", size: r = "md", title: i, de
|
|
|
61
61
|
className: "min-w-0 flex-1 space-y-1",
|
|
62
62
|
children: [i && /* @__PURE__ */ a("div", {
|
|
63
63
|
"data-slot": "alert-title",
|
|
64
|
-
className: "font-medium leading-
|
|
64
|
+
className: "max-w-full break-words font-medium leading-snug",
|
|
65
65
|
children: i
|
|
66
66
|
}), (u || v) && /* @__PURE__ */ a("div", {
|
|
67
67
|
"data-slot": "alert-description",
|
|
68
|
-
className: e("text-muted-foreground", n === "solid" && "text-current/88"),
|
|
68
|
+
className: e("max-w-full break-words leading-snug text-muted-foreground", n === "solid" && "text-current/88"),
|
|
69
69
|
children: u ?? v
|
|
70
70
|
})]
|
|
71
71
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("class-variance-authority"),i=require("react/jsx-runtime");var a=(0,r.cva)(`group/card flex flex-col gap-(--card-spacing) overflow-hidden py-(--card-spacing) [--card-spacing:--spacing(5)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0`,{variants:{variant:{default:``,elevated:``,outline:``,soft:``,ghost:``},size:{sm:``,default:``,lg:``},density:{compact:``,default:``,comfortable:``},tone:{neutral:``,info:``,success:``,warning:``,danger:``},interactive:{true:`cursor-pointer focus-visible:outline-none focus-visible:ring-0`,false:``},selected:{true:``,false:``},disabled:{true:`pointer-events-none`,false:``}},defaultVariants:{variant:`default`,size:`default`,density:`default`,tone:`neutral`,interactive:!1,selected:!1,disabled:!1}});function o(e){return e.eyebrow!=null||e.title!=null||e.description!=null||e.badge!=null||e.action!=null||e.media!=null||e.content!=null||e.footer!=null}function s({className:e,variant:n,size:r,density:s,tone:m,interactive:h,selected:g,disabled:_,orientation:v=`vertical`,mediaPosition:y=`start`,mediaAspect:b=`auto`,padding:x=`default`,tabIndex:S,eyebrow:C,title:w,description:T,badge:E,action:D,media:O,content:k,footer:A,mediaClassName:j,bodyClassName:M,headerClassName:N,eyebrowClassName:P,titleClassName:F,descriptionClassName:I,contentClassName:L,footerClassName:R,children:z,...B}){let V=o({eyebrow:C,title:w,description:T,badge:E,action:D,media:O,content:k,footer:A}),H=k??z,U=C!=null||w!=null||T!=null||E!=null||D!=null,W=A!=null,G=O?(0,i.jsx)(`div`,{"data-slot":`card-media`,"data-media-position":y,"data-media-aspect":b,className:t.cn(`overflow-hidden`,v===`horizontal`?`shrink-0 self-stretch`:``,b===`square`&&(v===`horizontal`?`w-40`:`aspect-square`),b===`video`&&(v===`horizontal`?`w-56`:`aspect-video`),b===`poster`&&(v===`horizontal`?`w-36`:`aspect-[3/4]`),b===`wide`&&(v===`horizontal`?`w-72`:`aspect-[16/7]`),j),children:O}):null,K={none:``,sm:`px-4`,default:`px-(--card-spacing)`,lg:`px-6`},q={none:``,sm:`pb-4`,default:``,lg:`pb-6`};return(0,i.jsx)(`div`,{"data-slot":`card`,"data-surface":V||void 0,"data-size":r??`default`,"data-variant":n??`default`,"data-tone":m??`neutral`,"data-density":s??`default`,"data-interactive":h||void 0,"data-selected":g||void 0,"data-disabled":_||void 0,"data-has-footer":W||void 0,"data-orientation":v,"data-padding":x,"aria-disabled":_||void 0,tabIndex:h&&!_?S??0:S,className:t.cn(a({variant:n,size:r,density:s,tone:m,interactive:h,selected:g,disabled:_}),v===`horizontal`&&`flex-row py-0`,e),...B,children:V?(0,i.jsxs)(i.Fragment,{children:[y===`start`?G:null,(0,i.jsxs)(`div`,{"data-slot":`card-body`,className:t.cn(`flex min-w-0 flex-1 flex-col`,v===`horizontal`?`py-(--card-spacing)`:``,q[x],M),children:[U?(0,i.jsxs)(c,{className:t.cn(K[x],N),children:[(0,i.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[C==null?null:(0,i.jsx)(`div`,{"data-slot":`card-eyebrow`,className:P,children:C}),w==null?null:(0,i.jsx)(l,{className:F,children:w}),T==null?null:(0,i.jsx)(u,{className:I,children:T})]}),E!=null||D!=null?(0,i.jsxs)(d,{className:`flex items-center gap-2`,children:[E,D]}):null]}):null,H==null?null:(0,i.jsx)(f,{className:t.cn(K[x],L),children:H}),W?(0,i.jsx)(p,{className:t.cn(K[x],R),children:A}):null]}),y===`end`?G:null]}):z})}function c({className:e,...n}){return(0,i.jsx)(`div`,{"data-slot":`card-header`,className:t.cn(`group/card-header @container/card-header grid auto-rows-min items-start gap-1.5 px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("class-variance-authority"),i=require("react/jsx-runtime");var a=(0,r.cva)(`group/card flex min-w-0 flex-col gap-(--card-spacing) overflow-hidden py-(--card-spacing) [--card-spacing:--spacing(5)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0`,{variants:{variant:{default:``,elevated:``,outline:``,soft:``,ghost:``},size:{sm:``,default:``,lg:``},density:{compact:``,default:``,comfortable:``},tone:{neutral:``,info:``,success:``,warning:``,danger:``},interactive:{true:`cursor-pointer focus-visible:outline-none focus-visible:ring-0`,false:``},selected:{true:``,false:``},disabled:{true:`pointer-events-none`,false:``}},defaultVariants:{variant:`default`,size:`default`,density:`default`,tone:`neutral`,interactive:!1,selected:!1,disabled:!1}});function o(e){return e.eyebrow!=null||e.title!=null||e.description!=null||e.badge!=null||e.action!=null||e.media!=null||e.content!=null||e.footer!=null}function s({className:e,variant:n,size:r,density:s,tone:m,interactive:h,selected:g,disabled:_,orientation:v=`vertical`,mediaPosition:y=`start`,mediaAspect:b=`auto`,padding:x=`default`,tabIndex:S,eyebrow:C,title:w,description:T,badge:E,action:D,media:O,content:k,footer:A,mediaClassName:j,bodyClassName:M,headerClassName:N,eyebrowClassName:P,titleClassName:F,descriptionClassName:I,contentClassName:L,footerClassName:R,children:z,...B}){let V=o({eyebrow:C,title:w,description:T,badge:E,action:D,media:O,content:k,footer:A}),H=k??z,U=C!=null||w!=null||T!=null||E!=null||D!=null,W=A!=null,G=O?(0,i.jsx)(`div`,{"data-slot":`card-media`,"data-media-position":y,"data-media-aspect":b,className:t.cn(`overflow-hidden`,v===`horizontal`?`shrink-0 self-stretch`:``,b===`square`&&(v===`horizontal`?`w-40`:`aspect-square`),b===`video`&&(v===`horizontal`?`w-56`:`aspect-video`),b===`poster`&&(v===`horizontal`?`w-36`:`aspect-[3/4]`),b===`wide`&&(v===`horizontal`?`w-72`:`aspect-[16/7]`),j),children:O}):null,K={none:``,sm:`px-4`,default:`px-(--card-spacing)`,lg:`px-6`},q={none:``,sm:`pb-4`,default:``,lg:`pb-6`};return(0,i.jsx)(`div`,{"data-slot":`card`,"data-surface":V||void 0,"data-size":r??`default`,"data-variant":n??`default`,"data-tone":m??`neutral`,"data-density":s??`default`,"data-interactive":h||void 0,"data-selected":g||void 0,"data-disabled":_||void 0,"data-has-footer":W||void 0,"data-orientation":v,"data-padding":x,"aria-disabled":_||void 0,tabIndex:h&&!_?S??0:S,className:t.cn(a({variant:n,size:r,density:s,tone:m,interactive:h,selected:g,disabled:_}),v===`horizontal`&&`flex-row py-0`,e),...B,children:V?(0,i.jsxs)(i.Fragment,{children:[y===`start`?G:null,(0,i.jsxs)(`div`,{"data-slot":`card-body`,className:t.cn(`flex min-w-0 flex-1 flex-col`,v===`horizontal`?`py-(--card-spacing)`:``,q[x],M),children:[U?(0,i.jsxs)(c,{className:t.cn(K[x],N),children:[(0,i.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[C==null?null:(0,i.jsx)(`div`,{"data-slot":`card-eyebrow`,className:P,children:C}),w==null?null:(0,i.jsx)(l,{className:F,children:w}),T==null?null:(0,i.jsx)(u,{className:I,children:T})]}),E!=null||D!=null?(0,i.jsxs)(d,{className:`flex items-center gap-2`,children:[E,D]}):null]}):null,H==null?null:(0,i.jsx)(f,{className:t.cn(K[x],L),children:H}),W?(0,i.jsx)(p,{className:t.cn(K[x],R),children:A}):null]}),y===`end`?G:null]}):z})}function c({className:e,...n}){return(0,i.jsx)(`div`,{"data-slot":`card-header`,className:t.cn(`group/card-header @container/card-header grid min-w-0 auto-rows-min items-start gap-1.5 px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...n})}function l({className:e,...n}){return(0,i.jsx)(`div`,{"data-slot":`card-title`,className:t.cn(`min-w-0 max-w-full break-words leading-snug`,e),...n})}function u({className:e,...n}){return(0,i.jsx)(`div`,{"data-slot":`card-description`,className:t.cn(`min-w-0 max-w-full break-words leading-snug text-muted-foreground`,e),...n})}function d({className:e,...n}){return(0,i.jsx)(`div`,{"data-slot":`card-action`,className:t.cn(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,e),...n})}function f({className:e,...n}){return(0,i.jsx)(`div`,{"data-slot":`card-content`,className:t.cn(`px-(--card-spacing)`,e),...n})}function p({className:e,...n}){return(0,i.jsx)(`div`,{"data-slot":`card-footer`,className:t.cn(`flex items-center p-(--card-spacing)`,e),...n})}exports.Card=s,exports.CardAction=d,exports.CardContent=f,exports.CardDescription=u,exports.CardFooter=p,exports.CardHeader=c,exports.CardTitle=l,exports.cardVariants=a;
|
|
@@ -3,7 +3,7 @@ import "react";
|
|
|
3
3
|
import { cva as t } from "class-variance-authority";
|
|
4
4
|
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/ui/card/index.tsx
|
|
6
|
-
var a = t("group/card flex flex-col gap-(--card-spacing) overflow-hidden py-(--card-spacing) [--card-spacing:--spacing(5)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0", {
|
|
6
|
+
var a = t("group/card flex min-w-0 flex-col gap-(--card-spacing) overflow-hidden py-(--card-spacing) [--card-spacing:--spacing(5)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0", {
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
9
9
|
default: "",
|
|
@@ -154,22 +154,22 @@ function s({ className: t, variant: s, size: m, density: h, tone: g, interactive
|
|
|
154
154
|
function c({ className: t, ...n }) {
|
|
155
155
|
return /* @__PURE__ */ r("div", {
|
|
156
156
|
"data-slot": "card-header",
|
|
157
|
-
className: e("group/card-header @container/card-header grid auto-rows-min items-start gap-1.5 px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[
|
|
157
|
+
className: e("group/card-header @container/card-header grid min-w-0 auto-rows-min items-start gap-1.5 px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)", t),
|
|
158
158
|
...n
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
|
-
function l({ className:
|
|
161
|
+
function l({ className: t, ...n }) {
|
|
162
162
|
return /* @__PURE__ */ r("div", {
|
|
163
163
|
"data-slot": "card-title",
|
|
164
|
-
className: e,
|
|
165
|
-
...
|
|
164
|
+
className: e("min-w-0 max-w-full break-words leading-snug", t),
|
|
165
|
+
...n
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
function u({ className:
|
|
168
|
+
function u({ className: t, ...n }) {
|
|
169
169
|
return /* @__PURE__ */ r("div", {
|
|
170
170
|
"data-slot": "card-description",
|
|
171
|
-
className: e,
|
|
172
|
-
...
|
|
171
|
+
className: e("min-w-0 max-w-full break-words leading-snug text-muted-foreground", t),
|
|
172
|
+
...n
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
175
|
function d({ className: t, ...n }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("lucide-react"),i=require("react/jsx-runtime");function a({className:e,steps:n,currentStep:a,onStepChange:o,orientation:s=`horizontal`,...c}){let l=Math.max(n.findIndex(e=>e.id===a),0);return(0,i.jsx)(`div`,{"data-slot":`stepper`,"data-orientation":s,className:t.cn(s===`vertical`?`grid gap-3`:`flex flex-wrap items-start gap-3`,e),...c,children:n.map((e,n)=>{let c=e.id===a,u=e.completed??n<l;return(0,i.jsxs)(`button`,{type:`button`,disabled:!(o&&!e.disabled),className:t.cn(`flex min-w-0 items-start gap-2 text-left disabled:cursor-default`,s===`horizontal`&&`flex-1`),onClick:()=>o?.(e.id),children:[(0,i.jsx)(`span`,{className:t.cn(`flex size-7 shrink-0 items-center justify-center rounded-full border text-xs font-medium`,c&&`border-primary bg-primary text-primary-foreground`,u&&!c&&`border-primary bg-primary/10 text-primary`),children:u&&!c?(0,i.jsx)(r.CheckIcon,{className:`size-4`}):n+1}),(0,i.jsxs)(`span`,{className:`min-w-0
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("lucide-react"),i=require("react/jsx-runtime");function a({className:e,steps:n,currentStep:a,onStepChange:o,orientation:s=`horizontal`,...c}){let l=Math.max(n.findIndex(e=>e.id===a),0);return(0,i.jsx)(`div`,{"data-slot":`stepper`,"data-orientation":s,className:t.cn(s===`vertical`?`grid gap-3`:`flex flex-wrap items-start gap-3`,e),...c,children:n.map((e,n)=>{let c=e.id===a,u=e.completed??n<l;return(0,i.jsxs)(`button`,{type:`button`,disabled:!(o&&!e.disabled),className:t.cn(`flex min-w-0 items-start gap-2 text-left disabled:cursor-default`,s===`horizontal`&&`min-w-36 flex-1`),onClick:()=>o?.(e.id),children:[(0,i.jsx)(`span`,{className:t.cn(`flex size-7 shrink-0 items-center justify-center rounded-full border text-xs font-medium`,c&&`border-primary bg-primary text-primary-foreground`,u&&!c&&`border-primary bg-primary/10 text-primary`),children:u&&!c?(0,i.jsx)(r.CheckIcon,{className:`size-4`}):n+1}),(0,i.jsxs)(`span`,{className:`grid min-w-0 max-w-full gap-0.5`,children:[(0,i.jsx)(`span`,{className:t.cn(`max-w-full break-words text-sm font-medium leading-snug`,c?`text-foreground`:`text-muted-foreground`),children:e.title}),e.description&&(0,i.jsx)(`span`,{className:`max-w-full break-words text-xs leading-snug text-muted-foreground`,children:e.description})]})]},e.id)})})}exports.Stepper=a;
|