@almanaclabs/blaze-ui 0.24.0 → 0.26.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/app-shell/app-shell.d.ts +1 -1
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/app-shell.js +5 -5
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +17 -16
- package/dist/components/chat-bar/chat-bar.d.ts +14 -2
- package/dist/components/chat-bar/chat-bar.d.ts.map +1 -1
- package/dist/components/chat-bar/chat-bar.js +64 -37
- package/dist/components/chat-list/chat-list.d.ts +17 -4
- package/dist/components/chat-list/chat-list.d.ts.map +1 -1
- package/dist/components/chat-list/chat-list.js +52 -30
- package/dist/components/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/components/post-card/post-card.d.ts +13 -1
- package/dist/components/post-card/post-card.d.ts.map +1 -1
- package/dist/components/post-card/post-card.js +151 -143
- package/dist/components/selectable-tile/index.d.ts +2 -0
- package/dist/components/selectable-tile/index.d.ts.map +1 -0
- package/dist/components/selectable-tile/selectable-tile.d.ts +40 -0
- package/dist/components/selectable-tile/selectable-tile.d.ts.map +1 -0
- package/dist/components/selectable-tile/selectable-tile.js +54 -0
- package/dist/components/sheet/sheet.d.ts +15 -2
- package/dist/components/sheet/sheet.d.ts.map +1 -1
- package/dist/components/sheet/sheet.js +25 -12
- package/dist/components/slide-deck/index.d.ts +2 -0
- package/dist/components/slide-deck/index.d.ts.map +1 -0
- package/dist/components/slide-deck/slide-deck.d.ts +50 -0
- package/dist/components/slide-deck/slide-deck.d.ts.map +1 -0
- package/dist/components/slide-deck/slide-deck.js +201 -0
- package/dist/components/toggle-group/toggle-group.d.ts.map +1 -1
- package/dist/components/toggle-group/toggle-group.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +81 -79
- package/package.json +1 -1
|
@@ -37,17 +37,23 @@ function u({ className: t, ...r }) {
|
|
|
37
37
|
...r
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
var d = {
|
|
41
|
+
sm: "data-[side=left]:sm:w-full data-[side=right]:sm:w-full data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",
|
|
42
|
+
md: "data-[side=left]:sm:w-full data-[side=right]:sm:w-full data-[side=left]:sm:max-w-[480px] data-[side=right]:sm:max-w-[480px]",
|
|
43
|
+
lg: "data-[side=left]:sm:w-full data-[side=right]:sm:w-full data-[side=left]:sm:max-w-[640px] data-[side=right]:sm:max-w-[640px]"
|
|
44
|
+
};
|
|
45
|
+
function f({ className: o, children: s, side: c = "right", size: f = "sm", showCloseButton: p = !0, ...m }) {
|
|
41
46
|
return /* @__PURE__ */ r(l, { children: [/* @__PURE__ */ n(u, {}), /* @__PURE__ */ r(a.Popup, {
|
|
42
47
|
"data-slot": "sheet-content",
|
|
43
48
|
"data-side": c,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
"data-size": f,
|
|
50
|
+
className: e("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem]", d[f], o),
|
|
51
|
+
...m,
|
|
52
|
+
children: [s, p && /* @__PURE__ */ r(a.Close, {
|
|
47
53
|
"data-slot": "sheet-close",
|
|
48
54
|
render: /* @__PURE__ */ n(t, {
|
|
49
55
|
variant: "tertiary",
|
|
50
|
-
className: "absolute top-3 right-3",
|
|
56
|
+
className: "absolute top-3 right-3 sm:top-5 sm:right-5",
|
|
51
57
|
size: "icon-sm"
|
|
52
58
|
}),
|
|
53
59
|
children: [/* @__PURE__ */ n(i, {}), /* @__PURE__ */ n("span", {
|
|
@@ -57,28 +63,35 @@ function d({ className: o, children: s, side: c = "right", showCloseButton: d =
|
|
|
57
63
|
})]
|
|
58
64
|
})] });
|
|
59
65
|
}
|
|
60
|
-
function
|
|
66
|
+
function p({ className: t, ...r }) {
|
|
61
67
|
return /* @__PURE__ */ n("div", {
|
|
62
68
|
"data-slot": "sheet-header",
|
|
63
|
-
className: e("flex flex-col gap-0.5 p-4", t),
|
|
69
|
+
className: e("flex flex-col gap-0.5 p-4 sm:p-6 sm:pb-4", t),
|
|
64
70
|
...r
|
|
65
71
|
});
|
|
66
72
|
}
|
|
67
|
-
function
|
|
73
|
+
function m({ className: t, ...r }) {
|
|
74
|
+
return /* @__PURE__ */ n("div", {
|
|
75
|
+
"data-slot": "sheet-body",
|
|
76
|
+
className: e("min-h-0 flex-1 overflow-y-auto px-4 sm:px-6", t),
|
|
77
|
+
...r
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function h({ className: t, ...r }) {
|
|
68
81
|
return /* @__PURE__ */ n("div", {
|
|
69
82
|
"data-slot": "sheet-footer",
|
|
70
|
-
className: e("mt-auto flex flex-col gap-2 p-4", t),
|
|
83
|
+
className: e("mt-auto flex flex-col gap-2 p-4 sm:p-6", t),
|
|
71
84
|
...r
|
|
72
85
|
});
|
|
73
86
|
}
|
|
74
|
-
function
|
|
87
|
+
function g({ className: t, ...r }) {
|
|
75
88
|
return /* @__PURE__ */ n(a.Title, {
|
|
76
89
|
"data-slot": "sheet-title",
|
|
77
90
|
className: e("font-heading text-base font-medium text-foreground", t),
|
|
78
91
|
...r
|
|
79
92
|
});
|
|
80
93
|
}
|
|
81
|
-
function
|
|
94
|
+
function _({ className: t, ...r }) {
|
|
82
95
|
return /* @__PURE__ */ n(a.Description, {
|
|
83
96
|
"data-slot": "sheet-description",
|
|
84
97
|
className: e("text-sm text-muted-foreground", t),
|
|
@@ -86,4 +99,4 @@ function h({ className: t, ...r }) {
|
|
|
86
99
|
});
|
|
87
100
|
}
|
|
88
101
|
//#endregion
|
|
89
|
-
export { o as Sheet, c as SheetClose,
|
|
102
|
+
export { o as Sheet, m as SheetBody, c as SheetClose, f as SheetContent, _ as SheetDescription, h as SheetFooter, p as SheetHeader, g as SheetTitle, s as SheetTrigger };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/slide-deck/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type Slide = {
|
|
3
|
+
id: string;
|
|
4
|
+
/** The slide's accessible name, such as "Slide 2: $550". */
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
type SlideAspect = '4:5' | '1:1';
|
|
8
|
+
type SlideRender = (slide: Slide, context: {
|
|
9
|
+
index: number;
|
|
10
|
+
size: 'stage' | 'thumb';
|
|
11
|
+
}) => React.ReactNode;
|
|
12
|
+
type SlideStripProps = Omit<React.ComponentProps<'div'>, 'onSelect'> & {
|
|
13
|
+
slides: Slide[];
|
|
14
|
+
/** The selected slide, 0-based. */
|
|
15
|
+
selected: number;
|
|
16
|
+
onSelect: (index: number) => void;
|
|
17
|
+
aspect?: SlideAspect;
|
|
18
|
+
/** Draws each slide; a thumb is the stage render scaled down. */
|
|
19
|
+
renderSlide: SlideRender;
|
|
20
|
+
/** Shows the + at the end of the strip. */
|
|
21
|
+
onAdd?: () => void;
|
|
22
|
+
/** Lets the owner drag a slide, or move the selected one with Alt+← and Alt+→. */
|
|
23
|
+
onReorder?: (from: number, to: number) => void;
|
|
24
|
+
/** The most slides there can be; the + hides once there are this many. */
|
|
25
|
+
max?: number;
|
|
26
|
+
/** The strip's accessible name. Defaults to "Slides". */
|
|
27
|
+
label?: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The slides as a row of thumbnails with + at the end. ← and → move the selection; with `onReorder`, a slide can be
|
|
31
|
+
* dragged, or moved with Alt+← and Alt+→.
|
|
32
|
+
*/
|
|
33
|
+
declare function SlideStrip({ slides, selected, onSelect, aspect, renderSlide, onAdd, onReorder, max, label, className, ...props }: SlideStripProps): React.JSX.Element;
|
|
34
|
+
type SlideDeckProps = Omit<React.ComponentProps<'div'>, 'onSelect'> & Pick<SlideStripProps, 'slides' | 'selected' | 'onSelect' | 'aspect' | 'renderSlide' | 'onAdd' | 'onReorder' | 'max'> & {
|
|
35
|
+
/** The + under a single slide, before it's a carousel. Defaults to "Add a slide". */
|
|
36
|
+
addLabel?: string;
|
|
37
|
+
/** Under the strip, such as a note. */
|
|
38
|
+
footer?: React.ReactNode;
|
|
39
|
+
/** The strip's accessible name. Defaults to "Slides". */
|
|
40
|
+
label?: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* A carousel's slides inside a post: the selected slide large, with the strip of thumbnails and + under it. A single
|
|
44
|
+
* slide shows no strip, only "+ Add a slide". Put it in `PostCard`'s `media`, and point the card's actions at the
|
|
45
|
+
* selected slide with `actionTarget`. The app draws each slide with `renderSlide`, including any text the owner edits
|
|
46
|
+
* in place on the stage.
|
|
47
|
+
*/
|
|
48
|
+
declare function SlideDeck({ slides, selected, onSelect, aspect, renderSlide, onAdd, onReorder, max, addLabel, footer, label, className, ...props }: SlideDeckProps): React.JSX.Element;
|
|
49
|
+
export { SlideDeck, SlideStrip, type Slide, type SlideAspect, type SlideDeckProps, type SlideRender, type SlideStripProps, };
|
|
50
|
+
//# sourceMappingURL=slide-deck.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slide-deck.d.ts","sourceRoot":"","sources":["../../../src/components/slide-deck/slide-deck.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,KAAK,KAAK,GAAG;IACX,EAAE,EAAE,MAAM,CAAA;IACV,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,KAAK,WAAW,GAAG,KAAK,GAAG,KAAK,CAAA;AAEhC,KAAK,WAAW,GAAG,CACjB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAA;CAAE,KAChD,KAAK,CAAC,SAAS,CAAA;AAWpB,KAAK,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACrE,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,iEAAiE;IACjE,WAAW,EAAE,WAAW,CAAA;IACxB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;IAClB,kFAAkF;IAClF,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9C,0EAA0E;IAC1E,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;GAGG;AACH,iBAAS,UAAU,CAAC,EAClB,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,MAAc,EACd,WAAW,EACX,KAAK,EACL,SAAS,EACT,GAAG,EACH,KAAgB,EAChB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,qBA+KjB;AAED,KAAK,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GACjE,IAAI,CACF,eAAe,EACb,QAAQ,GACR,UAAU,GACV,UAAU,GACV,QAAQ,GACR,aAAa,GACb,OAAO,GACP,WAAW,GACX,KAAK,CACR,GAAG;IACF,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,uCAAuC;IACvC,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AA+CH;;;;;GAKG;AACH,iBAAS,SAAS,CAAC,EACjB,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,MAAc,EACd,WAAW,EACX,KAAK,EACL,SAAS,EACT,GAAG,EACH,QAAwB,EACxB,MAAM,EACN,KAAgB,EAChB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,qBAiDhB;AAED,OAAO,EACL,SAAS,EACT,UAAU,EACV,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,CAAA"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { IconPlus as i } from "@tabler/icons-react";
|
|
5
|
+
//#region src/components/slide-deck/slide-deck.tsx
|
|
6
|
+
var a = {
|
|
7
|
+
"4:5": "aspect-[4/5]",
|
|
8
|
+
"1:1": "aspect-square"
|
|
9
|
+
}, o = 360, s = 56;
|
|
10
|
+
function c({ slides: c, selected: l, onSelect: u, aspect: d = "4:5", renderSlide: f, onAdd: p, onReorder: m, max: h, label: g = "Slides", className: _, ...v }) {
|
|
11
|
+
let y = t.useRef(/* @__PURE__ */ new Map()), b = t.useRef(null), [x, S] = t.useState(null), [C, w] = t.useState(""), T = t.useRef(null);
|
|
12
|
+
t.useEffect(() => {
|
|
13
|
+
let e = T.current;
|
|
14
|
+
e && c.findIndex((t) => t.id === e.id) === e.to && (y.current.get(e.id)?.focus(), T.current = null);
|
|
15
|
+
});
|
|
16
|
+
let E = (e, t) => {
|
|
17
|
+
let n = e.currentTarget.getBoundingClientRect();
|
|
18
|
+
return e.clientX > n.left + n.width / 2 ? t + 1 : t;
|
|
19
|
+
}, D = (e) => {
|
|
20
|
+
let t = c[e];
|
|
21
|
+
t && y.current.get(t.id)?.focus();
|
|
22
|
+
}, O = (e, t) => {
|
|
23
|
+
if (!m || t < 0 || t >= c.length || t === e) return;
|
|
24
|
+
let n = c[e];
|
|
25
|
+
n && (T.current = {
|
|
26
|
+
id: n.id,
|
|
27
|
+
to: t
|
|
28
|
+
}), m(e, t), w(`${c[e]?.label ?? `Slide ${e + 1}`} moved to ${t + 1} of ${c.length}`);
|
|
29
|
+
}, k = (e, t) => {
|
|
30
|
+
let n = e.key === "ArrowRight" ? 1 : e.key === "ArrowLeft" ? -1 : 0;
|
|
31
|
+
if (e.key === "Home" || e.key === "End") {
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
let t = e.key === "Home" ? 0 : c.length - 1;
|
|
34
|
+
u(t), D(t);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (!n) return;
|
|
38
|
+
e.preventDefault();
|
|
39
|
+
let r = t + n;
|
|
40
|
+
if (!(r < 0 || r >= c.length)) {
|
|
41
|
+
if (e.altKey) {
|
|
42
|
+
O(t, r);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
u(r), D(r);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return /* @__PURE__ */ r("div", {
|
|
49
|
+
"data-slot": "slide-strip",
|
|
50
|
+
role: "group",
|
|
51
|
+
"aria-label": g,
|
|
52
|
+
className: e("flex min-w-0 items-center gap-2", _),
|
|
53
|
+
...v,
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ n("ol", {
|
|
56
|
+
className: "m-0 flex min-w-0 list-none gap-2 overflow-x-auto p-0.5 [scrollbar-width:thin]",
|
|
57
|
+
children: c.map((t, r) => {
|
|
58
|
+
let i = r === l;
|
|
59
|
+
return /* @__PURE__ */ n("li", {
|
|
60
|
+
className: e("relative flex-none", x === r && "before:absolute before:inset-y-0 before:-left-1.5 before:w-0.5 before:rounded-full before:bg-primary", x === c.length && r === c.length - 1 && "after:absolute after:inset-y-0 after:-right-1.5 after:w-0.5 after:rounded-full after:bg-primary"),
|
|
61
|
+
onDragOver: (e) => {
|
|
62
|
+
b.current !== null && (e.preventDefault(), S(E(e, r)));
|
|
63
|
+
},
|
|
64
|
+
onDragLeave: () => S((e) => e === r || e === r + 1 ? null : e),
|
|
65
|
+
onDrop: (e) => {
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
let t = b.current, n = E(e, r);
|
|
68
|
+
b.current = null, S(null), t !== null && O(t, n > t ? n - 1 : n);
|
|
69
|
+
},
|
|
70
|
+
children: /* @__PURE__ */ n("button", {
|
|
71
|
+
ref: (e) => {
|
|
72
|
+
e ? y.current.set(t.id, e) : y.current.delete(t.id);
|
|
73
|
+
},
|
|
74
|
+
type: "button",
|
|
75
|
+
"data-slot": "slide-strip-thumb",
|
|
76
|
+
"aria-label": `${t.label}${m ? ", Alt+Arrow keys to move" : ""}`,
|
|
77
|
+
"aria-current": i ? "true" : void 0,
|
|
78
|
+
tabIndex: i ? 0 : -1,
|
|
79
|
+
draggable: !!m,
|
|
80
|
+
onDragStart: (e) => {
|
|
81
|
+
b.current = r, e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", t.id);
|
|
82
|
+
},
|
|
83
|
+
onDragEnd: () => {
|
|
84
|
+
b.current = null, S(null);
|
|
85
|
+
},
|
|
86
|
+
onClick: () => u(r),
|
|
87
|
+
onKeyDown: (e) => k(e, r),
|
|
88
|
+
style: { width: s },
|
|
89
|
+
className: e("relative block overflow-hidden rounded-md border border-border-subtle bg-card outline-none transition-shadow", a[d], "hover:border-border focus-visible:ring-3 focus-visible:ring-ring/50", i && "border-foreground ring-2 ring-foreground", m && "cursor-grab active:cursor-grabbing"),
|
|
90
|
+
children: /* @__PURE__ */ n("span", {
|
|
91
|
+
"aria-hidden": "true",
|
|
92
|
+
inert: !0,
|
|
93
|
+
className: "pointer-events-none absolute top-0 left-0 block origin-top-left",
|
|
94
|
+
style: {
|
|
95
|
+
width: o,
|
|
96
|
+
transform: `scale(${s / o})`
|
|
97
|
+
},
|
|
98
|
+
children: /* @__PURE__ */ n("span", {
|
|
99
|
+
className: e("block w-full", a[d]),
|
|
100
|
+
children: f(t, {
|
|
101
|
+
index: r,
|
|
102
|
+
size: "thumb"
|
|
103
|
+
})
|
|
104
|
+
})
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
}, t.id);
|
|
108
|
+
})
|
|
109
|
+
}),
|
|
110
|
+
p && (h === void 0 || c.length < h) ? /* @__PURE__ */ n("button", {
|
|
111
|
+
type: "button",
|
|
112
|
+
"data-slot": "slide-strip-add",
|
|
113
|
+
"aria-label": "Add a slide",
|
|
114
|
+
onClick: p,
|
|
115
|
+
style: { width: s },
|
|
116
|
+
className: e("flex flex-none items-center justify-center rounded-md border border-dashed border-border text-muted-foreground outline-none transition-colors hover:border-foreground/30 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50", a[d]),
|
|
117
|
+
children: /* @__PURE__ */ n(i, {
|
|
118
|
+
"aria-hidden": "true",
|
|
119
|
+
className: "size-4"
|
|
120
|
+
})
|
|
121
|
+
}) : null,
|
|
122
|
+
/* @__PURE__ */ n("span", {
|
|
123
|
+
role: "status",
|
|
124
|
+
"aria-live": "polite",
|
|
125
|
+
className: "sr-only",
|
|
126
|
+
children: C
|
|
127
|
+
})
|
|
128
|
+
]
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
function l({ slide: r, aspect: i, children: s }) {
|
|
132
|
+
let c = t.useRef(null), [l, u] = t.useState(1);
|
|
133
|
+
return t.useLayoutEffect(() => {
|
|
134
|
+
let e = c.current;
|
|
135
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
136
|
+
let t = () => u(Math.min(1, e.clientWidth / o || 1));
|
|
137
|
+
t();
|
|
138
|
+
let n = new ResizeObserver(t);
|
|
139
|
+
return n.observe(e), () => n.disconnect();
|
|
140
|
+
}, []), /* @__PURE__ */ n("figure", {
|
|
141
|
+
ref: c,
|
|
142
|
+
"data-slot": "slide-deck-stage",
|
|
143
|
+
"aria-label": r.label,
|
|
144
|
+
className: e("relative m-0 w-full overflow-hidden rounded-xl border border-border-subtle bg-card", a[i]),
|
|
145
|
+
style: { maxWidth: o },
|
|
146
|
+
children: /* @__PURE__ */ n("div", {
|
|
147
|
+
className: e("absolute top-0 left-0 origin-top-left", a[i]),
|
|
148
|
+
style: {
|
|
149
|
+
width: o,
|
|
150
|
+
transform: l === 1 ? void 0 : `scale(${l})`
|
|
151
|
+
},
|
|
152
|
+
children: s
|
|
153
|
+
})
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function u({ slides: t, selected: a, onSelect: o, aspect: s = "4:5", renderSlide: u, onAdd: d, onReorder: f, max: p, addLabel: m = "Add a slide", footer: h, label: g = "Slides", className: _, ...v }) {
|
|
157
|
+
let y = t[a], b = !!d && (p === void 0 || t.length < p);
|
|
158
|
+
return /* @__PURE__ */ r("div", {
|
|
159
|
+
"data-slot": "slide-deck",
|
|
160
|
+
"data-aspect": s,
|
|
161
|
+
className: e("flex min-w-0 flex-col gap-2", _),
|
|
162
|
+
...v,
|
|
163
|
+
children: [
|
|
164
|
+
y ? /* @__PURE__ */ n(l, {
|
|
165
|
+
slide: y,
|
|
166
|
+
aspect: s,
|
|
167
|
+
children: u(y, {
|
|
168
|
+
index: a,
|
|
169
|
+
size: "stage"
|
|
170
|
+
})
|
|
171
|
+
}, y.id) : null,
|
|
172
|
+
t.length > 1 ? /* @__PURE__ */ n(c, {
|
|
173
|
+
slides: t,
|
|
174
|
+
selected: a,
|
|
175
|
+
onSelect: o,
|
|
176
|
+
aspect: s,
|
|
177
|
+
renderSlide: u,
|
|
178
|
+
onAdd: d,
|
|
179
|
+
onReorder: f,
|
|
180
|
+
max: p,
|
|
181
|
+
label: g
|
|
182
|
+
}) : b ? /* @__PURE__ */ r("button", {
|
|
183
|
+
type: "button",
|
|
184
|
+
"data-slot": "slide-deck-add",
|
|
185
|
+
onClick: d,
|
|
186
|
+
className: "type-detail inline-flex w-fit items-center gap-1.5 rounded-md px-1.5 py-1 text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
187
|
+
children: [/* @__PURE__ */ n(i, {
|
|
188
|
+
"aria-hidden": "true",
|
|
189
|
+
className: "size-4"
|
|
190
|
+
}), m]
|
|
191
|
+
}) : null,
|
|
192
|
+
h ? /* @__PURE__ */ n("div", {
|
|
193
|
+
"data-slot": "slide-deck-footer",
|
|
194
|
+
className: "type-detail text-muted-foreground",
|
|
195
|
+
children: h
|
|
196
|
+
}) : null
|
|
197
|
+
]
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
//#endregion
|
|
201
|
+
export { u as SlideDeck, c as SlideStrip };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-group.d.ts","sourceRoot":"","sources":["../../../src/components/toggle-group/toggle-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AACjF,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAG5D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAcpD,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAW,EACX,WAA0B,EAC1B,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,KAAK,GAC3B,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;CACxC,
|
|
1
|
+
{"version":3,"file":"toggle-group.d.ts","sourceRoot":"","sources":["../../../src/components/toggle-group/toggle-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AACjF,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAG5D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAcpD,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAW,EACX,WAA0B,EAC1B,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,KAAK,GAC3B,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;CACxC,qBAwBF;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,QAAQ,EACR,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,qBAyB7D;AAED,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -20,7 +20,7 @@ function s({ className: t, variant: n, size: i, spacing: s = 2, orientation: c =
|
|
|
20
20
|
"data-spacing": s,
|
|
21
21
|
"data-orientation": c,
|
|
22
22
|
style: { "--gap": s },
|
|
23
|
-
className: e("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch", t),
|
|
23
|
+
className: e("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch", "data-[variant=outline]:gap-0.5 data-[variant=outline]:bg-muted data-[variant=outline]:p-[3px]", t),
|
|
24
24
|
...u,
|
|
25
25
|
children: /* @__PURE__ */ r(o.Provider, {
|
|
26
26
|
value: {
|
|
@@ -43,7 +43,7 @@ function c({ className: a, children: s, variant: c = "default", size: l = "defau
|
|
|
43
43
|
className: e("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t", t({
|
|
44
44
|
variant: d.variant || c,
|
|
45
45
|
size: d.size || l
|
|
46
|
-
}), a),
|
|
46
|
+
}), "group-data-[variant=outline]/toggle-group:rounded-md! group-data-[variant=outline]/toggle-group:border-0! group-data-[variant=outline]/toggle-group:bg-transparent! group-data-[variant=outline]/toggle-group:font-normal group-data-[variant=outline]/toggle-group:text-foreground-secondary! group-data-[variant=outline]/toggle-group:hover:text-foreground! group-data-[variant=outline]/toggle-group:aria-pressed:bg-card! group-data-[variant=outline]/toggle-group:aria-pressed:font-medium group-data-[variant=outline]/toggle-group:aria-pressed:text-foreground! group-data-[variant=outline]/toggle-group:aria-pressed:shadow-sm", a),
|
|
47
47
|
...u,
|
|
48
48
|
children: s
|
|
49
49
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -61,11 +61,13 @@ export * from './components/radio-group';
|
|
|
61
61
|
export * from './components/rating';
|
|
62
62
|
export * from './components/scroll-area';
|
|
63
63
|
export * from './components/section-header';
|
|
64
|
+
export * from './components/selectable-tile';
|
|
64
65
|
export * from './components/select';
|
|
65
66
|
export * from './components/sheet';
|
|
66
67
|
export * from './components/sidebar';
|
|
67
68
|
export * from './components/signal-strip';
|
|
68
69
|
export * from './components/skeleton';
|
|
70
|
+
export * from './components/slide-deck';
|
|
69
71
|
export * from './components/slider';
|
|
70
72
|
export * from './components/source-avatar';
|
|
71
73
|
export * from './components/sparkline';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,WAAW,EACX,cAAc,EACd,KAAK,WAAW,GACjB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,IAAI,EACJ,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,GACV,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,UAA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