asta-ui 0.5.1 → 0.6.1

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.
Files changed (46) hide show
  1. package/dist/base/candlestick.js +1 -1
  2. package/dist/base/file-card.d.ts +1 -0
  3. package/dist/base/file-card.js +7 -0
  4. package/dist/base/price-chart.js +1 -1
  5. package/dist/base/properties-panel.d.ts +1 -0
  6. package/dist/base/properties-panel.js +15 -0
  7. package/dist/base/tool-dock.d.ts +1 -0
  8. package/dist/base/tool-dock.js +7 -0
  9. package/dist/base/trade-ticket.js +1 -1
  10. package/dist/base/workspace-switcher.d.ts +1 -0
  11. package/dist/base/workspace-switcher.js +7 -0
  12. package/dist/base.js +27 -3
  13. package/dist/candlestick.js +1 -1
  14. package/dist/chunk-4ZJEAWNG.js +165 -0
  15. package/dist/{chunk-Z6IAITZJ.js → chunk-5VQV2I7C.js} +2 -2
  16. package/dist/{chunk-JIVLBHHE.js → chunk-OFPZUTBI.js} +1 -1
  17. package/dist/chunk-OXLBH4QM.js +167 -0
  18. package/dist/chunk-PZJYDIJI.js +88 -0
  19. package/dist/{chunk-7MGB7FVD.js → chunk-RTAHGY6P.js} +2 -2
  20. package/dist/chunk-VUDTGRS3.js +138 -0
  21. package/dist/file-card.d.ts +1 -0
  22. package/dist/file-card.js +7 -0
  23. package/dist/index.js +27 -3
  24. package/dist/price-chart.js +1 -1
  25. package/dist/properties-panel.d.ts +1 -0
  26. package/dist/properties-panel.js +15 -0
  27. package/dist/tool-dock.d.ts +1 -0
  28. package/dist/tool-dock.js +7 -0
  29. package/dist/trade-ticket.js +1 -1
  30. package/dist/types/components/kit/file-card.d.ts +28 -0
  31. package/dist/types/components/kit/properties-panel.d.ts +56 -0
  32. package/dist/types/components/kit/tool-dock.d.ts +27 -0
  33. package/dist/types/components/kit/workspace-switcher.d.ts +33 -0
  34. package/dist/types/packages/asta-ui/src/base/file-card.d.ts +1 -0
  35. package/dist/types/packages/asta-ui/src/base/properties-panel.d.ts +1 -0
  36. package/dist/types/packages/asta-ui/src/base/tool-dock.d.ts +1 -0
  37. package/dist/types/packages/asta-ui/src/base/workspace-switcher.d.ts +1 -0
  38. package/dist/types/packages/asta-ui/src/base.d.ts +8 -0
  39. package/dist/types/packages/asta-ui/src/file-card.d.ts +1 -0
  40. package/dist/types/packages/asta-ui/src/index.d.ts +8 -0
  41. package/dist/types/packages/asta-ui/src/properties-panel.d.ts +1 -0
  42. package/dist/types/packages/asta-ui/src/tool-dock.d.ts +1 -0
  43. package/dist/types/packages/asta-ui/src/workspace-switcher.d.ts +1 -0
  44. package/dist/workspace-switcher.d.ts +1 -0
  45. package/dist/workspace-switcher.js +7 -0
  46. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Candlestick
4
- } from "../chunk-7MGB7FVD.js";
4
+ } from "../chunk-RTAHGY6P.js";
5
5
  export {
6
6
  Candlestick as default
7
7
  };
@@ -0,0 +1 @@
1
+ export * from "../types/packages/asta-ui/src/base/file-card";
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import {
3
+ FileCard
4
+ } from "../chunk-PZJYDIJI.js";
5
+ export {
6
+ FileCard
7
+ };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  PriceChart
4
- } from "../chunk-JIVLBHHE.js";
4
+ } from "../chunk-OFPZUTBI.js";
5
5
  export {
6
6
  PriceChart as default
7
7
  };
@@ -0,0 +1 @@
1
+ export * from "../types/packages/asta-ui/src/base/properties-panel";
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import {
3
+ ColorField,
4
+ PropRow,
5
+ PropSection,
6
+ PropertiesPanel,
7
+ ScrubInput
8
+ } from "../chunk-4ZJEAWNG.js";
9
+ export {
10
+ ColorField,
11
+ PropRow,
12
+ PropSection,
13
+ PropertiesPanel,
14
+ ScrubInput
15
+ };
@@ -0,0 +1 @@
1
+ export * from "../types/packages/asta-ui/src/base/tool-dock";
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import {
3
+ ToolDock
4
+ } from "../chunk-VUDTGRS3.js";
5
+ export {
6
+ ToolDock
7
+ };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  TradeTicket
4
- } from "../chunk-Z6IAITZJ.js";
4
+ } from "../chunk-5VQV2I7C.js";
5
5
  export {
6
6
  TradeTicket as default
7
7
  };
@@ -0,0 +1 @@
1
+ export * from "../types/packages/asta-ui/src/base/workspace-switcher";
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import {
3
+ WorkspaceSwitcher
4
+ } from "../chunk-OXLBH4QM.js";
5
+ export {
6
+ WorkspaceSwitcher
7
+ };
package/dist/base.js CHANGED
@@ -139,7 +139,7 @@ import {
139
139
  } from "./chunk-CNY76NHF.js";
140
140
  import {
141
141
  TradeTicket
142
- } from "./chunk-Z6IAITZJ.js";
142
+ } from "./chunk-5VQV2I7C.js";
143
143
  import {
144
144
  CardCheckout
145
145
  } from "./chunk-UEOEWP7L.js";
@@ -154,10 +154,10 @@ import {
154
154
  } from "./chunk-F5I6EK7F.js";
155
155
  import {
156
156
  PriceChart
157
- } from "./chunk-JIVLBHHE.js";
157
+ } from "./chunk-OFPZUTBI.js";
158
158
  import {
159
159
  Candlestick
160
- } from "./chunk-7MGB7FVD.js";
160
+ } from "./chunk-RTAHGY6P.js";
161
161
  import {
162
162
  SplitFlap
163
163
  } from "./chunk-2Z5Z4YYZ.js";
@@ -479,6 +479,19 @@ import {
479
479
  import {
480
480
  ColorPicker
481
481
  } from "./chunk-FKHNK5VC.js";
482
+ import {
483
+ WorkspaceSwitcher
484
+ } from "./chunk-OXLBH4QM.js";
485
+ import {
486
+ ToolDock
487
+ } from "./chunk-VUDTGRS3.js";
488
+ import {
489
+ ColorField,
490
+ PropRow,
491
+ PropSection,
492
+ PropertiesPanel,
493
+ ScrubInput
494
+ } from "./chunk-4ZJEAWNG.js";
482
495
  import {
483
496
  Timeline
484
497
  } from "./chunk-4FR6KJOJ.js";
@@ -488,6 +501,9 @@ import {
488
501
  import {
489
502
  StatCard
490
503
  } from "./chunk-3KS5EN3Q.js";
504
+ import {
505
+ FileCard
506
+ } from "./chunk-PZJYDIJI.js";
491
507
  import {
492
508
  Pagination,
493
509
  pageRange
@@ -634,6 +650,7 @@ export {
634
650
  ChecklistPassword,
635
651
  Checkout,
636
652
  ClipboardButton,
653
+ ColorField,
637
654
  ColorPicker,
638
655
  ComboLock,
639
656
  Combobox,
@@ -663,6 +680,7 @@ export {
663
680
  EmptyState,
664
681
  EventCalendar,
665
682
  Field,
683
+ FileCard,
666
684
  FileUpload,
667
685
  FillButton,
668
686
  FloatingInput,
@@ -744,6 +762,9 @@ export {
744
762
  ProgressBar,
745
763
  ProgressRing,
746
764
  PromptBox,
765
+ PropRow,
766
+ PropSection,
767
+ PropertiesPanel,
747
768
  RadioGroup,
748
769
  radio_group_aui_055_default as RadioGroupAui055,
749
770
  radio_group_aui_056_default as RadioGroupAui056,
@@ -757,6 +778,7 @@ export {
757
778
  RollingNumber,
758
779
  SNIPPET_LANGUAGES,
759
780
  ScrambleText,
781
+ ScrubInput,
760
782
  SearchField,
761
783
  SeatPicker,
762
784
  SegmentRadio,
@@ -832,6 +854,7 @@ export {
832
854
  Toaster,
833
855
  ToggleGroup,
834
856
  TokenSwap,
857
+ ToolDock,
835
858
  Tooltip,
836
859
  TradeTicket,
837
860
  TreeCheckbox,
@@ -843,6 +866,7 @@ export {
843
866
  VerifyOtp,
844
867
  VolumeSlider,
845
868
  Wishlist,
869
+ WorkspaceSwitcher,
846
870
  avatarFill,
847
871
  buttonClass,
848
872
  checkWorkEmail,
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Candlestick
4
- } from "./chunk-7MGB7FVD.js";
4
+ } from "./chunk-RTAHGY6P.js";
5
5
  export {
6
6
  Candlestick as default
7
7
  };
@@ -0,0 +1,165 @@
1
+ "use client";
2
+
3
+ // components/kit/properties-panel.tsx
4
+ import { useId, useRef, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var cx = (...c) => c.filter(Boolean).join(" ");
7
+ var KEYFRAMES = `@keyframes asta-prop-in { from { opacity: 0; transform: translateY(-3px) } }
8
+ @media (prefers-reduced-motion: reduce) { .asta-prop-body { animation: none !important } }`;
9
+ var FIELD = "h-7 rounded-[6px] bg-[color-mix(in_srgb,var(--ink)_5%,transparent)] text-[12px] text-ink transition-[background-color,box-shadow] duration-150 hover:bg-[color-mix(in_srgb,var(--ink)_8%,transparent)] focus-within:bg-paper focus-within:shadow-[inset_0_0_0_1.5px_var(--brand)]";
10
+ function PropertiesPanel({ title, kind, actions, children, className }) {
11
+ return /* @__PURE__ */ jsxs("div", { className: cx("w-full overflow-hidden rounded-[12px] bg-paper shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_12px_32px_-16px_rgb(0_0_0/0.22)]", className), children: [
12
+ /* @__PURE__ */ jsx("style", { href: "asta-properties-panel", precedence: "asta", children: KEYFRAMES }),
13
+ (title || kind || actions) && /* @__PURE__ */ jsxs("div", { className: "flex h-11 items-center gap-2 px-3.5", children: [
14
+ kind && /* @__PURE__ */ jsx("span", { className: "rounded-[5px] bg-[color-mix(in_srgb,var(--ink)_7%,transparent)] px-1.5 py-0.5 text-[11px] text-ink-2", children: kind }),
15
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-[13px] font-medium text-ink", children: title }),
16
+ actions
17
+ ] }),
18
+ /* @__PURE__ */ jsx("div", { className: "pb-1.5", children })
19
+ ] });
20
+ }
21
+ function PropSection({ title, action, defaultOpen = true, children }) {
22
+ const [open, setOpen] = useState(defaultOpen);
23
+ const id = useId();
24
+ return /* @__PURE__ */ jsxs("section", { className: "px-3.5 pt-2.5", children: [
25
+ /* @__PURE__ */ jsxs("div", { className: "flex h-7 items-center justify-between", children: [
26
+ /* @__PURE__ */ jsxs("button", { type: "button", "aria-expanded": open, "aria-controls": id, onClick: () => setOpen(!open), className: "group/sec flex cursor-pointer items-center gap-1 rounded-[4px] text-[11.5px] font-medium text-ink outline-none focus-visible:shadow-[0_0_0_2px_var(--brand)]", children: [
27
+ /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: cx("h-3 w-3 text-mute transition-transform duration-200 ease-[cubic-bezier(.16,1,.3,1)]", open && "rotate-90"), fill: "none", stroke: "currentColor", strokeWidth: 2.4, strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "m9 6 6 6-6 6" }) }),
28
+ title
29
+ ] }),
30
+ action
31
+ ] }),
32
+ open && /* @__PURE__ */ jsx("div", { id, className: "asta-prop-body animate-[asta-prop-in_.22s_cubic-bezier(.16,1,.3,1)_both] space-y-1.5 pb-2 pt-1", children })
33
+ ] });
34
+ }
35
+ var COLS = { 1: "grid-cols-1", 2: "grid-cols-2", 3: "grid-cols-3", 4: "grid-cols-4" };
36
+ function PropRow({ label, cols = 2, children }) {
37
+ return /* @__PURE__ */ jsxs("div", { className: cx("grid items-center gap-2", label ? "grid-cols-[64px_1fr]" : "grid-cols-1"), children: [
38
+ label && /* @__PURE__ */ jsx("span", { className: "truncate text-[11.5px] text-mute", children: label }),
39
+ /* @__PURE__ */ jsx("div", { className: cx("grid gap-1.5", COLS[cols]), children })
40
+ ] });
41
+ }
42
+ var clampTo = (v, min = -Infinity, max = Infinity, precision = 0) => {
43
+ const f = 10 ** precision;
44
+ return Math.min(max, Math.max(min, Math.round(v * f) / f));
45
+ };
46
+ function ScrubInput({ label, name, value, onChange, step = 1, min, max, precision = 0, unit, disabled }) {
47
+ const [draft, setDraft] = useState(null);
48
+ const [scrubbing, setScrubbing] = useState(false);
49
+ const drag = useRef({ x: 0, v: 0, moved: false });
50
+ const input = useRef(null);
51
+ const set = (v) => onChange(clampTo(v, min, max, precision));
52
+ const factor = (e) => e.shiftKey ? 10 : e.altKey ? 0.1 : 1;
53
+ const down = (e) => {
54
+ if (disabled || e.button !== 0) return;
55
+ e.preventDefault();
56
+ e.currentTarget.setPointerCapture(e.pointerId);
57
+ drag.current = { x: e.clientX, v: value, moved: false };
58
+ setScrubbing(true);
59
+ };
60
+ const move = (e) => {
61
+ if (!scrubbing) return;
62
+ const dx = e.clientX - drag.current.x;
63
+ if (Math.abs(dx) > 2) drag.current.moved = true;
64
+ if (drag.current.moved) set(drag.current.v + Math.round(dx / 2) * step * factor(e));
65
+ };
66
+ const up = () => {
67
+ setScrubbing(false);
68
+ if (!drag.current.moved) input.current?.select();
69
+ };
70
+ const commit = () => {
71
+ if (draft === null) return;
72
+ const n = Number(draft.replace(",", ".").replace(unit ?? "", "").trim());
73
+ if (draft.trim() !== "" && Number.isFinite(n)) set(n);
74
+ setDraft(null);
75
+ };
76
+ const onKey = (e) => {
77
+ if (e.key === "Enter") {
78
+ commit();
79
+ input.current?.blur();
80
+ } else if (e.key === "Escape") {
81
+ setDraft(null);
82
+ input.current?.blur();
83
+ } else if (e.key === "ArrowUp" || e.key === "ArrowDown") {
84
+ e.preventDefault();
85
+ setDraft(null);
86
+ set(value + (e.key === "ArrowUp" ? 1 : -1) * step * factor(e));
87
+ }
88
+ };
89
+ return /* @__PURE__ */ jsxs("label", { className: cx(FIELD, "flex min-w-0 items-center", disabled && "pointer-events-none opacity-45", scrubbing && "bg-paper shadow-[inset_0_0_0_1.5px_var(--brand)]"), children: [
90
+ /* @__PURE__ */ jsx(
91
+ "span",
92
+ {
93
+ onPointerDown: down,
94
+ onPointerMove: move,
95
+ onPointerUp: up,
96
+ onPointerCancel: up,
97
+ className: "grid h-full w-6 shrink-0 cursor-ew-resize touch-none select-none place-items-center text-[11px] text-mute [&>svg]:h-3.5 [&>svg]:w-3.5",
98
+ children: label
99
+ }
100
+ ),
101
+ /* @__PURE__ */ jsx(
102
+ "input",
103
+ {
104
+ ref: input,
105
+ "aria-label": name ?? (typeof label === "string" ? label : void 0),
106
+ inputMode: "decimal",
107
+ disabled,
108
+ value: draft ?? value.toFixed(precision),
109
+ onChange: (e) => setDraft(e.target.value),
110
+ onFocus: (e) => e.target.select(),
111
+ onBlur: commit,
112
+ onKeyDown: onKey,
113
+ className: "h-full min-w-0 flex-1 bg-transparent pr-1.5 font-mono text-[11.5px] tabular-nums outline-none"
114
+ }
115
+ ),
116
+ unit && /* @__PURE__ */ jsx("span", { className: "shrink-0 pr-2 text-[11px] text-mute", children: unit })
117
+ ] });
118
+ }
119
+ var HEX = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i;
120
+ var norm = (v) => {
121
+ const m = v.trim().match(HEX);
122
+ if (!m) return null;
123
+ const h = m[1].length === 3 ? m[1].replace(/./g, (c) => c + c) : m[1];
124
+ return `#${h.toLowerCase()}`;
125
+ };
126
+ function ColorField({ value, onChange, name = "Colour", disabled }) {
127
+ const [draft, setDraft] = useState(null);
128
+ const commit = () => {
129
+ if (draft === null) return;
130
+ const n = norm(draft);
131
+ if (n) onChange(n);
132
+ setDraft(null);
133
+ };
134
+ return /* @__PURE__ */ jsxs("div", { className: cx(FIELD, "flex min-w-0 items-center", disabled && "pointer-events-none opacity-45"), children: [
135
+ /* @__PURE__ */ jsx("label", { className: "relative ml-1 h-5 w-5 shrink-0 cursor-pointer overflow-hidden rounded-[4px] shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_15%,transparent)]", style: { background: value }, children: /* @__PURE__ */ jsx("input", { type: "color", "aria-label": `${name} picker`, disabled, value: norm(value) ?? "#000000", onChange: (e) => onChange(e.target.value), className: "absolute inset-0 cursor-pointer opacity-0" }) }),
136
+ /* @__PURE__ */ jsx(
137
+ "input",
138
+ {
139
+ "aria-label": `${name} hex`,
140
+ disabled,
141
+ value: draft ?? value.replace("#", "").toUpperCase(),
142
+ onChange: (e) => setDraft(e.target.value),
143
+ onFocus: (e) => e.target.select(),
144
+ onBlur: commit,
145
+ onKeyDown: (e) => {
146
+ if (e.key === "Enter") e.target.blur();
147
+ if (e.key === "Escape") {
148
+ setDraft(null);
149
+ e.target.blur();
150
+ }
151
+ },
152
+ spellCheck: false,
153
+ className: "h-full min-w-0 flex-1 bg-transparent px-2 font-mono text-[11.5px] uppercase outline-none"
154
+ }
155
+ )
156
+ ] });
157
+ }
158
+
159
+ export {
160
+ PropertiesPanel,
161
+ PropSection,
162
+ PropRow,
163
+ ScrubInput,
164
+ ColorField
165
+ };
@@ -109,7 +109,7 @@ function TradeTicket() {
109
109
  /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
110
110
  /* @__PURE__ */ jsxs("div", { className: "text-[clamp(2.2rem,7vw,3.4rem)] font-medium leading-none tracking-[-0.045em] text-ink tabular-nums", children: [
111
111
  amount.toFixed(3),
112
- /* @__PURE__ */ jsx("span", { className: "ml-2 text-[0.42em] font-normal tracking-normal text-mute", children: "ACME" })
112
+ /* @__PURE__ */ jsx("span", { className: "ml-2 text-[0.42em] font-normal tracking-normal text-mute", children: "ASTA" })
113
113
  ] }),
114
114
  /* @__PURE__ */ jsxs("p", { className: "mt-2 font-mono text-[12px] tabular-nums text-mute", children: [
115
115
  "\u2248 $",
@@ -192,7 +192,7 @@ function TradeTicket() {
192
192
  children: [
193
193
  /* @__PURE__ */ jsxs("span", { className: `absolute flex items-center gap-2 transition-[transform,opacity] duration-500 ease-[cubic-bezier(.16,1,.3,1)] ${phase === "idle" ? "translate-y-0 opacity-100" : "-translate-y-4 opacity-0"}`, children: [
194
194
  /* @__PURE__ */ jsx("span", { className: "capitalize", children: side }),
195
- " ACME"
195
+ " ASTA"
196
196
  ] }),
197
197
  /* @__PURE__ */ jsx("span", { className: `absolute transition-[transform,opacity] duration-500 ease-[cubic-bezier(.16,1,.3,1)] ${phase === "sending" ? "scale-100 opacity-100" : "scale-50 opacity-0"}`, children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", className: "h-5 w-5 animate-spin", fill: "none", "aria-hidden": true, children: [
198
198
  /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "6", stroke: "currentColor", strokeOpacity: ".3", strokeWidth: "2" }),
@@ -177,7 +177,7 @@ function PriceChart() {
177
177
  };
178
178
  return /* @__PURE__ */ jsxs("div", { className: "relative flex h-full w-full flex-col p-5 sm:p-6", children: [
179
179
  /* @__PURE__ */ jsxs("div", { className: "relative z-10", children: [
180
- /* @__PURE__ */ jsx("p", { className: "font-mono text-[11px] uppercase tracking-[0.12em] text-mute", children: "ACME / USD" }),
180
+ /* @__PURE__ */ jsx("p", { className: "font-mono text-[11px] uppercase tracking-[0.12em] text-mute", children: "ASTA / USD" }),
181
181
  /* @__PURE__ */ jsxs("div", { className: "mt-2 flex flex-wrap items-center gap-3", children: [
182
182
  /* @__PURE__ */ jsx("span", { className: "text-[clamp(1.9rem,5.5vw,3rem)] font-medium leading-none tracking-[-0.04em] text-ink", children: /* @__PURE__ */ jsx(Roll, { text: price.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }) }),
183
183
  /* @__PURE__ */ jsxs(
@@ -0,0 +1,167 @@
1
+ "use client";
2
+
3
+ // components/kit/workspace-switcher.tsx
4
+ import { useEffect, useId, useRef, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var cx = (...c) => c.filter(Boolean).join(" ");
7
+ var KEYFRAMES = `@keyframes asta-ws-in { from { opacity: 0; transform: translateY(-4px) scale(.97) } }
8
+ @media (prefers-reduced-motion: reduce) { .asta-ws-pop { animation: none !important } }`;
9
+ function Logo({ ws, size }) {
10
+ const box = size === "sm" ? "h-6 w-6 rounded-[6px] text-[11.5px]" : "h-8 w-8 rounded-[8px] text-[13px]";
11
+ if (ws.logo) return /* @__PURE__ */ jsx("img", { src: ws.logo, alt: "", width: 32, height: 32, loading: "lazy", className: cx(box, "shrink-0 object-cover") });
12
+ return /* @__PURE__ */ jsx("span", { className: cx(box, "grid shrink-0 place-items-center bg-brand font-semibold text-white"), children: ws.name.slice(0, 1).toUpperCase() });
13
+ }
14
+ var Check = () => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-4 w-4 text-brand", fill: "none", stroke: "currentColor", strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "m5 12.5 4.5 4.5L19 7.5" }) });
15
+ function WorkspaceSwitcher({ workspaces, value, defaultValue, onChange, onCreate, createLabel = "New workspace", account, footer, className }) {
16
+ const [inner, setInner] = useState(defaultValue ?? workspaces[0]?.id);
17
+ const current = workspaces.find((w) => w.id === (value ?? inner)) ?? workspaces[0];
18
+ const [open, setOpen] = useState(false);
19
+ const [active, setActive] = useState(0);
20
+ const root = useRef(null);
21
+ const trigger = useRef(null);
22
+ const listRef = useRef(null);
23
+ const id = useId();
24
+ const count = workspaces.length + (onCreate ? 1 : 0);
25
+ useEffect(() => {
26
+ if (!open) return;
27
+ const close = (e) => !root.current?.contains(e.target) && setOpen(false);
28
+ window.addEventListener("pointerdown", close);
29
+ return () => window.removeEventListener("pointerdown", close);
30
+ }, [open]);
31
+ useEffect(() => {
32
+ if (open) listRef.current?.focus();
33
+ }, [open]);
34
+ const show = () => {
35
+ setActive(Math.max(0, workspaces.findIndex((w) => w.id === current?.id)));
36
+ setOpen(true);
37
+ };
38
+ const choose = (i) => {
39
+ if (i === workspaces.length) onCreate?.();
40
+ else {
41
+ const ws = workspaces[i];
42
+ if (value === void 0) setInner(ws.id);
43
+ onChange?.(ws.id, ws);
44
+ }
45
+ setOpen(false);
46
+ trigger.current?.focus();
47
+ };
48
+ const onListKey = (e) => {
49
+ if (e.key === "ArrowDown") setActive((a) => (a + 1) % count);
50
+ else if (e.key === "ArrowUp") setActive((a) => (a - 1 + count) % count);
51
+ else if (e.key === "Home") setActive(0);
52
+ else if (e.key === "End") setActive(count - 1);
53
+ else if (e.key === "Enter" || e.key === " ") choose(active);
54
+ else if (e.key === "Escape" || e.key === "Tab") {
55
+ setOpen(false);
56
+ if (e.key === "Escape") trigger.current?.focus();
57
+ return;
58
+ } else return;
59
+ e.preventDefault();
60
+ };
61
+ if (!current) return null;
62
+ return /* @__PURE__ */ jsxs("div", { ref: root, className: cx("relative", className), children: [
63
+ /* @__PURE__ */ jsx("style", { href: "asta-workspace-switcher", precedence: "asta", children: KEYFRAMES }),
64
+ /* @__PURE__ */ jsxs(
65
+ "button",
66
+ {
67
+ ref: trigger,
68
+ type: "button",
69
+ "aria-haspopup": "listbox",
70
+ "aria-expanded": open,
71
+ "aria-controls": open ? id : void 0,
72
+ onClick: () => open ? setOpen(false) : show(),
73
+ onKeyDown: (e) => {
74
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
75
+ e.preventDefault();
76
+ show();
77
+ }
78
+ },
79
+ className: cx(
80
+ "group/ws flex w-full cursor-pointer items-center gap-2.5 rounded-[9px] px-2 py-1.5 text-left outline-none transition-colors duration-150",
81
+ "hover:bg-[color-mix(in_srgb,var(--ink)_6%,transparent)] focus-visible:shadow-[0_0_0_2px_var(--brand)]",
82
+ open && "bg-[color-mix(in_srgb,var(--ink)_6%,transparent)]"
83
+ ),
84
+ children: [
85
+ /* @__PURE__ */ jsx(Logo, { ws: current, size: "sm" }),
86
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-[13.5px] font-medium text-ink", children: current.name }),
87
+ current.plan && /* @__PURE__ */ jsx("span", { className: "shrink-0 rounded-[5px] bg-[color-mix(in_srgb,var(--brand)_12%,transparent)] px-1.5 py-0.5 text-[11px] font-medium text-brand", children: current.plan }),
88
+ /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: cx("h-3.5 w-3.5 shrink-0 text-mute transition-transform duration-300 ease-[cubic-bezier(.16,1,.3,1)]", open && "rotate-180"), fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" }) })
89
+ ]
90
+ }
91
+ ),
92
+ open && /* @__PURE__ */ jsxs(
93
+ "div",
94
+ {
95
+ className: cx(
96
+ "asta-ws-pop absolute left-0 right-0 top-full z-30 mt-1.5 min-w-[240px] origin-top rounded-[12px] bg-paper p-1.5",
97
+ "animate-[asta-ws-in_.2s_cubic-bezier(.16,1,.3,1)_both]",
98
+ "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_12px_32px_-12px_rgb(0_0_0/0.28),0_4px_10px_-6px_rgb(0_0_0/0.12)]"
99
+ ),
100
+ children: [
101
+ account && /* @__PURE__ */ jsxs("div", { className: "px-2.5 pb-2 pt-1.5", children: [
102
+ /* @__PURE__ */ jsx("p", { className: "truncate text-[13px] font-medium text-ink", children: account.name }),
103
+ account.email && /* @__PURE__ */ jsx("p", { className: "truncate text-[12px] text-mute", children: account.email })
104
+ ] }),
105
+ /* @__PURE__ */ jsxs(
106
+ "div",
107
+ {
108
+ ref: listRef,
109
+ id,
110
+ role: "listbox",
111
+ tabIndex: -1,
112
+ "aria-label": "Workspaces",
113
+ "aria-activedescendant": `${id}-${active}`,
114
+ onKeyDown: onListKey,
115
+ className: "outline-none",
116
+ children: [
117
+ workspaces.map((w, i) => /* @__PURE__ */ jsxs(
118
+ "div",
119
+ {
120
+ id: `${id}-${i}`,
121
+ role: "option",
122
+ "aria-selected": w.id === current.id,
123
+ onPointerMove: () => setActive(i),
124
+ onClick: () => choose(i),
125
+ className: cx("flex cursor-pointer items-center gap-2.5 rounded-[8px] px-2 py-1.5 transition-colors duration-100", active === i && "bg-[color-mix(in_srgb,var(--ink)_6%,transparent)]"),
126
+ children: [
127
+ /* @__PURE__ */ jsx(Logo, { ws: w, size: "md" }),
128
+ /* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
129
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
130
+ /* @__PURE__ */ jsx("span", { className: "truncate text-[13px] font-medium text-ink", children: w.name }),
131
+ w.plan && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[11px] text-mute", children: w.plan })
132
+ ] }),
133
+ w.meta && /* @__PURE__ */ jsx("span", { className: "block truncate text-[12px] text-mute", children: w.meta })
134
+ ] }),
135
+ w.id === current.id && /* @__PURE__ */ jsx(Check, {})
136
+ ]
137
+ },
138
+ w.id
139
+ )),
140
+ onCreate && /* @__PURE__ */ jsxs(
141
+ "div",
142
+ {
143
+ id: `${id}-${workspaces.length}`,
144
+ role: "option",
145
+ "aria-selected": false,
146
+ onPointerMove: () => setActive(workspaces.length),
147
+ onClick: () => choose(workspaces.length),
148
+ className: cx("mt-1 flex cursor-pointer items-center gap-2.5 rounded-[8px] px-2 py-1.5 text-[13px] text-ink-2 transition-colors duration-100", active === workspaces.length && "bg-[color-mix(in_srgb,var(--ink)_6%,transparent)] text-ink"),
149
+ children: [
150
+ /* @__PURE__ */ jsx("span", { className: "grid h-8 w-8 place-items-center rounded-[8px] shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)]", children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M12 5v14M5 12h14" }) }) }),
151
+ createLabel
152
+ ]
153
+ }
154
+ )
155
+ ]
156
+ }
157
+ ),
158
+ footer && /* @__PURE__ */ jsx("div", { className: "mt-1 pt-1", children: footer })
159
+ ]
160
+ }
161
+ )
162
+ ] });
163
+ }
164
+
165
+ export {
166
+ WorkspaceSwitcher
167
+ };
@@ -0,0 +1,88 @@
1
+ "use client";
2
+
3
+ // components/kit/file-card.tsx
4
+ import { useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var cx = (...c) => c.filter(Boolean).join(" ");
7
+ var KEYFRAMES = `@keyframes asta-file-star { 0% { transform: scale(.6) } 55% { transform: scale(1.25) } 100% { transform: scale(1) } }
8
+ @media (prefers-reduced-motion: reduce) { .asta-file-star { animation: none !important } }`;
9
+ function Star({ on }) {
10
+ return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: cx("h-4 w-4", on && "asta-file-star animate-[asta-file-star_.42s_cubic-bezier(.16,1,.3,1)]"), fill: on ? "currentColor" : "none", stroke: "currentColor", strokeWidth: 1.7, strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "m12 3.6 2.6 5.3 5.8.8-4.2 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8-4.2-4.1 5.8-.8z" }) });
11
+ }
12
+ function Thumb({ thumbnail, title }) {
13
+ if (typeof thumbnail === "string")
14
+ return /* @__PURE__ */ jsx(
15
+ "img",
16
+ {
17
+ src: thumbnail,
18
+ alt: "",
19
+ width: 640,
20
+ height: 400,
21
+ loading: "lazy",
22
+ decoding: "async",
23
+ className: "absolute inset-0 h-full w-full object-cover transition-transform duration-500 ease-[cubic-bezier(.16,1,.3,1)] group-hover/file:scale-[1.03]"
24
+ }
25
+ );
26
+ if (thumbnail) return /* @__PURE__ */ jsx("div", { className: "absolute inset-0 transition-transform duration-500 ease-[cubic-bezier(.16,1,.3,1)] group-hover/file:scale-[1.03]", children: thumbnail });
27
+ return /* @__PURE__ */ jsx("span", { className: "absolute inset-0 grid place-items-center text-[28px] font-semibold tracking-[-0.04em] text-mute", children: title.slice(0, 1).toUpperCase() });
28
+ }
29
+ function FileCard({ title, meta, thumbnail, icon, href, onOpen, starred, defaultStarred = false, onStarChange, actions, view = "grid", selected, className }) {
30
+ const [innerStar, setInnerStar] = useState(defaultStarred);
31
+ const on = starred ?? innerStar;
32
+ const toggle = () => {
33
+ if (starred === void 0) setInnerStar(!on);
34
+ onStarChange?.(!on);
35
+ };
36
+ const open = href ? /* @__PURE__ */ jsx("a", { href, className: "absolute inset-0 z-[1] rounded-[inherit] outline-none", "aria-label": `Open ${title}` }) : onOpen ? /* @__PURE__ */ jsx("button", { type: "button", onClick: onOpen, className: "absolute inset-0 z-[1] cursor-pointer rounded-[inherit] outline-none", "aria-label": `Open ${title}` }) : null;
37
+ const star = onStarChange && /* @__PURE__ */ jsx(
38
+ "button",
39
+ {
40
+ type: "button",
41
+ "aria-label": on ? `Unstar ${title}` : `Star ${title}`,
42
+ "aria-pressed": on,
43
+ onClick: toggle,
44
+ className: cx(
45
+ "relative z-[2] grid h-7 w-7 cursor-pointer place-items-center rounded-[7px] outline-none transition-[opacity,color,background-color] duration-150",
46
+ "focus-visible:opacity-100 focus-visible:shadow-[0_0_0_2px_var(--brand)]",
47
+ on ? "text-brand opacity-100" : "text-ink-2 opacity-0 hover:text-ink group-hover/file:opacity-100",
48
+ view === "grid" && "bg-paper shadow-[0_1px_3px_rgb(0_0_0/0.12)]"
49
+ ),
50
+ children: /* @__PURE__ */ jsx(Star, { on })
51
+ }
52
+ );
53
+ const ring = selected ? "shadow-[inset_0_0_0_2px_var(--brand)]" : "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent)] hover:shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_22%,transparent)] has-[:focus-visible]:shadow-[inset_0_0_0_2px_var(--brand)]";
54
+ const style = /* @__PURE__ */ jsx("style", { href: "asta-file-card", precedence: "asta", children: KEYFRAMES });
55
+ if (view === "list")
56
+ return /* @__PURE__ */ jsxs("div", { className: cx("group/file relative flex h-14 items-center gap-3 rounded-[10px] px-2 transition-[box-shadow,background-color] duration-150 hover:bg-[color-mix(in_srgb,var(--ink)_4%,transparent)]", selected && "bg-[color-mix(in_srgb,var(--brand)_8%,transparent)]", className), children: [
57
+ style,
58
+ open,
59
+ /* @__PURE__ */ jsx("span", { className: "relative h-10 w-16 shrink-0 overflow-hidden rounded-[6px] bg-paper-2 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_8%,transparent)]", children: /* @__PURE__ */ jsx(Thumb, { thumbnail, title }) }),
60
+ icon && /* @__PURE__ */ jsx("span", { className: "h-4 w-4 shrink-0 text-mute [&>svg]:h-full [&>svg]:w-full", children: icon }),
61
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-[13.5px] font-medium text-ink", children: title }),
62
+ meta && /* @__PURE__ */ jsx("span", { className: "hidden shrink-0 text-[12.5px] text-mute sm:block", children: meta }),
63
+ /* @__PURE__ */ jsxs("span", { className: "relative z-[2] flex shrink-0 items-center gap-1", children: [
64
+ star,
65
+ actions
66
+ ] })
67
+ ] });
68
+ return /* @__PURE__ */ jsxs("div", { className: cx("group/file relative overflow-hidden rounded-[12px] bg-paper transition-shadow duration-150", ring, className), children: [
69
+ style,
70
+ open,
71
+ /* @__PURE__ */ jsxs("div", { className: "relative aspect-[16/10] overflow-hidden bg-paper-2", children: [
72
+ /* @__PURE__ */ jsx(Thumb, { thumbnail, title }),
73
+ star && /* @__PURE__ */ jsx("span", { className: "absolute right-2.5 top-2.5 z-[2]", children: star })
74
+ ] }),
75
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2.5 px-3.5 py-3", children: [
76
+ icon && /* @__PURE__ */ jsx("span", { className: "h-4 w-4 shrink-0 text-mute [&>svg]:h-full [&>svg]:w-full", children: icon }),
77
+ /* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
78
+ /* @__PURE__ */ jsx("span", { className: "block truncate text-[13.5px] font-medium text-ink", children: title }),
79
+ meta && /* @__PURE__ */ jsx("span", { className: "mt-0.5 block truncate text-[12px] text-mute", children: meta })
80
+ ] }),
81
+ actions && /* @__PURE__ */ jsx("span", { className: "relative z-[2] shrink-0", children: actions })
82
+ ] })
83
+ ] });
84
+ }
85
+
86
+ export {
87
+ FileCard
88
+ };
@@ -199,7 +199,7 @@ function Candlestick() {
199
199
  S.current.hx = -1;
200
200
  setOhlc(null);
201
201
  },
202
- children: /* @__PURE__ */ jsx("canvas", { ref: canvas, className: "block", "aria-label": "Live candlestick chart for ACME / USD", role: "img" })
202
+ children: /* @__PURE__ */ jsx("canvas", { ref: canvas, className: "block", "aria-label": "Live candlestick chart for ASTA / USD", role: "img" })
203
203
  }
204
204
  ),
205
205
  /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute left-5 top-5 font-mono text-[11px] tabular-nums sm:left-6", children: ohlc ? /* @__PURE__ */ jsxs("span", { className: "text-mute", children: [
@@ -212,7 +212,7 @@ function Candlestick() {
212
212
  " C",
213
213
  " ",
214
214
  /* @__PURE__ */ jsx("span", { style: { color: ohlc.c >= ohlc.o ? "var(--brand)" : "var(--ink-2)" }, children: f(ohlc.c) })
215
- ] }) : /* @__PURE__ */ jsx("span", { className: "uppercase tracking-[0.12em] text-mute", children: "ACME / USD \xB7 1m" }) })
215
+ ] }) : /* @__PURE__ */ jsx("span", { className: "uppercase tracking-[0.12em] text-mute", children: "ASTA / USD \xB7 1m" }) })
216
216
  ] });
217
217
  }
218
218
 
@@ -0,0 +1,138 @@
1
+ "use client";
2
+
3
+ // components/kit/tool-dock.tsx
4
+ import { useEffect, useLayoutEffect, useRef, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var cx = (...c) => c.filter(Boolean).join(" ");
7
+ var EASE = "cubic-bezier(.16,1,.3,1)";
8
+ var typing = (t) => t instanceof HTMLElement && (t.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName));
9
+ function ToolDock({ tools, value, defaultValue, onChange, hotkeys = true, tooltip = "top", label = "Tools", className }) {
10
+ const list = tools.filter((t) => t !== "separator");
11
+ const [inner, setInner] = useState(defaultValue ?? list[0]?.id);
12
+ const current = value ?? inner;
13
+ const [hover, setHover] = useState(null);
14
+ const [pill, setPill] = useState(null);
15
+ const refs = useRef(/* @__PURE__ */ new Map());
16
+ const box = useRef(null);
17
+ const pick = (id) => {
18
+ if (value === void 0) setInner(id);
19
+ onChange?.(id);
20
+ };
21
+ const pickRef = useRef(pick);
22
+ useLayoutEffect(() => {
23
+ pickRef.current = pick;
24
+ });
25
+ useLayoutEffect(() => {
26
+ const measure = () => {
27
+ const el = current ? refs.current.get(current)?.parentElement : null;
28
+ if (el) setPill({ x: el.offsetLeft, w: el.offsetWidth });
29
+ };
30
+ measure();
31
+ const ro = new ResizeObserver(measure);
32
+ if (box.current) ro.observe(box.current);
33
+ return () => ro.disconnect();
34
+ }, [current]);
35
+ useEffect(() => {
36
+ if (!hotkeys) return;
37
+ const keys = new Map(list.filter((t) => t.shortcut && !t.disabled).map((t) => [t.shortcut.toLowerCase(), t.id]));
38
+ const onKey = (e) => {
39
+ if (e.metaKey || e.ctrlKey || e.altKey || typing(e.target)) return;
40
+ const id = keys.get(e.key.toLowerCase());
41
+ if (id) pickRef.current(id);
42
+ };
43
+ window.addEventListener("keydown", onKey);
44
+ return () => window.removeEventListener("keydown", onKey);
45
+ }, [hotkeys, list.map((t) => `${t.id}:${t.shortcut}:${t.disabled}`).join()]);
46
+ const onKeyDown = (e) => {
47
+ const enabled = list.filter((t) => !t.disabled);
48
+ const i = enabled.findIndex((t) => t.id === document.activeElement?.dataset.tool);
49
+ let next = -1;
50
+ if (e.key === "ArrowRight") next = (i + 1) % enabled.length;
51
+ else if (e.key === "ArrowLeft") next = (i - 1 + enabled.length) % enabled.length;
52
+ else if (e.key === "Home") next = 0;
53
+ else if (e.key === "End") next = enabled.length - 1;
54
+ if (next < 0) return;
55
+ e.preventDefault();
56
+ refs.current.get(enabled[next].id)?.focus();
57
+ };
58
+ return /* @__PURE__ */ jsxs(
59
+ "div",
60
+ {
61
+ ref: box,
62
+ role: "toolbar",
63
+ "aria-label": label,
64
+ onKeyDown,
65
+ className: cx(
66
+ "relative inline-flex items-center gap-0.5 rounded-[12px] bg-paper p-1",
67
+ "shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_12px_32px_-14px_rgb(0_0_0/0.3),0_2px_6px_-3px_rgb(0_0_0/0.12)]",
68
+ className
69
+ ),
70
+ children: [
71
+ pill && /* @__PURE__ */ jsx(
72
+ "span",
73
+ {
74
+ "aria-hidden": true,
75
+ className: "pointer-events-none absolute left-0 top-1 h-[calc(100%-8px)] rounded-[8px] bg-brand motion-reduce:transition-none",
76
+ style: {
77
+ width: pill.w,
78
+ transform: `translateX(${pill.x}px)`,
79
+ transition: `transform .32s ${EASE}, width .32s ${EASE}`
80
+ /* perf-ok: width follows the active tool once per change */
81
+ }
82
+ }
83
+ ),
84
+ tools.map(
85
+ (t, i) => t === "separator" ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "mx-1 h-5 w-px bg-[color-mix(in_srgb,var(--ink)_12%,transparent)]" }, `sep-${i}`) : /* @__PURE__ */ jsxs("span", { className: "relative", children: [
86
+ /* @__PURE__ */ jsx(
87
+ "button",
88
+ {
89
+ ref: (el) => {
90
+ if (el) refs.current.set(t.id, el);
91
+ else refs.current.delete(t.id);
92
+ },
93
+ type: "button",
94
+ "data-tool": t.id,
95
+ "aria-label": t.label,
96
+ "aria-pressed": current === t.id,
97
+ "aria-keyshortcuts": t.shortcut,
98
+ disabled: t.disabled,
99
+ tabIndex: current === t.id ? 0 : -1,
100
+ onClick: () => pick(t.id),
101
+ onPointerEnter: () => setHover(t.id),
102
+ onPointerLeave: () => setHover((h) => h === t.id ? null : h),
103
+ onFocus: () => setHover(t.id),
104
+ onBlur: () => setHover((h) => h === t.id ? null : h),
105
+ className: cx(
106
+ "relative grid h-9 w-9 cursor-pointer place-items-center rounded-[8px] outline-none transition-colors duration-150",
107
+ "focus-visible:shadow-[0_0_0_2px_var(--paper),0_0_0_4px_var(--brand)] disabled:cursor-not-allowed disabled:opacity-35",
108
+ current === t.id ? "text-white" : "text-ink-2 hover:bg-[color-mix(in_srgb,var(--ink)_7%,transparent)] hover:text-ink"
109
+ ),
110
+ children: /* @__PURE__ */ jsx("span", { className: "h-[18px] w-[18px] [&>svg]:h-full [&>svg]:w-full", children: t.icon })
111
+ }
112
+ ),
113
+ /* @__PURE__ */ jsxs(
114
+ "span",
115
+ {
116
+ role: "tooltip",
117
+ className: cx(
118
+ "pointer-events-none absolute left-1/2 z-10 flex items-center gap-2 whitespace-nowrap rounded-[7px] bg-ink px-2 py-1 text-[12px] text-paper",
119
+ "transition-[opacity,transform] duration-150",
120
+ tooltip === "top" ? "bottom-full mb-2" : "top-full mt-2",
121
+ hover === t.id ? "-translate-x-1/2 translate-y-0 opacity-100" : cx("-translate-x-1/2 opacity-0", tooltip === "top" ? "translate-y-1" : "-translate-y-1")
122
+ ),
123
+ children: [
124
+ t.label,
125
+ t.shortcut && /* @__PURE__ */ jsx("span", { className: "rounded-[4px] bg-[color-mix(in_srgb,var(--paper)_18%,transparent)] px-1 font-mono text-[10.5px]", children: t.shortcut })
126
+ ]
127
+ }
128
+ )
129
+ ] }, t.id)
130
+ )
131
+ ]
132
+ }
133
+ );
134
+ }
135
+
136
+ export {
137
+ ToolDock
138
+ };
@@ -0,0 +1 @@
1
+ export * from "./types/packages/asta-ui/src/file-card";
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import {
3
+ FileCard
4
+ } from "./chunk-PZJYDIJI.js";
5
+ export {
6
+ FileCard
7
+ };
package/dist/index.js CHANGED
@@ -139,7 +139,7 @@ import {
139
139
  } from "./chunk-CNY76NHF.js";
140
140
  import {
141
141
  TradeTicket
142
- } from "./chunk-Z6IAITZJ.js";
142
+ } from "./chunk-5VQV2I7C.js";
143
143
  import {
144
144
  CardCheckout
145
145
  } from "./chunk-UEOEWP7L.js";
@@ -154,10 +154,10 @@ import {
154
154
  } from "./chunk-F5I6EK7F.js";
155
155
  import {
156
156
  PriceChart
157
- } from "./chunk-JIVLBHHE.js";
157
+ } from "./chunk-OFPZUTBI.js";
158
158
  import {
159
159
  Candlestick
160
- } from "./chunk-7MGB7FVD.js";
160
+ } from "./chunk-RTAHGY6P.js";
161
161
  import {
162
162
  SplitFlap
163
163
  } from "./chunk-2Z5Z4YYZ.js";
@@ -479,6 +479,19 @@ import {
479
479
  import {
480
480
  ColorPicker
481
481
  } from "./chunk-FKHNK5VC.js";
482
+ import {
483
+ WorkspaceSwitcher
484
+ } from "./chunk-OXLBH4QM.js";
485
+ import {
486
+ ToolDock
487
+ } from "./chunk-VUDTGRS3.js";
488
+ import {
489
+ ColorField,
490
+ PropRow,
491
+ PropSection,
492
+ PropertiesPanel,
493
+ ScrubInput
494
+ } from "./chunk-4ZJEAWNG.js";
482
495
  import {
483
496
  Timeline
484
497
  } from "./chunk-4FR6KJOJ.js";
@@ -488,6 +501,9 @@ import {
488
501
  import {
489
502
  StatCard
490
503
  } from "./chunk-3KS5EN3Q.js";
504
+ import {
505
+ FileCard
506
+ } from "./chunk-PZJYDIJI.js";
491
507
  import {
492
508
  Pagination,
493
509
  pageRange
@@ -634,6 +650,7 @@ export {
634
650
  ChecklistPassword,
635
651
  Checkout,
636
652
  ClipboardButton,
653
+ ColorField,
637
654
  ColorPicker,
638
655
  ComboLock,
639
656
  Combobox,
@@ -663,6 +680,7 @@ export {
663
680
  EmptyState,
664
681
  EventCalendar,
665
682
  Field,
683
+ FileCard,
666
684
  FileUpload,
667
685
  FillButton,
668
686
  FloatingInput,
@@ -744,6 +762,9 @@ export {
744
762
  ProgressBar,
745
763
  ProgressRing,
746
764
  PromptBox,
765
+ PropRow,
766
+ PropSection,
767
+ PropertiesPanel,
747
768
  RadioGroup,
748
769
  radio_group_aui_055_default as RadioGroupAui055,
749
770
  radio_group_aui_056_default as RadioGroupAui056,
@@ -757,6 +778,7 @@ export {
757
778
  RollingNumber,
758
779
  SNIPPET_LANGUAGES,
759
780
  ScrambleText,
781
+ ScrubInput,
760
782
  SearchField,
761
783
  SeatPicker,
762
784
  SegmentRadio,
@@ -832,6 +854,7 @@ export {
832
854
  Toaster,
833
855
  ToggleGroup,
834
856
  TokenSwap,
857
+ ToolDock,
835
858
  Tooltip,
836
859
  TradeTicket,
837
860
  TreeCheckbox,
@@ -843,6 +866,7 @@ export {
843
866
  VerifyOtp,
844
867
  VolumeSlider,
845
868
  Wishlist,
869
+ WorkspaceSwitcher,
846
870
  avatarFill,
847
871
  buttonClass,
848
872
  checkWorkEmail,
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  PriceChart
4
- } from "./chunk-JIVLBHHE.js";
4
+ } from "./chunk-OFPZUTBI.js";
5
5
  export {
6
6
  PriceChart as default
7
7
  };
@@ -0,0 +1 @@
1
+ export * from "./types/packages/asta-ui/src/properties-panel";
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import {
3
+ ColorField,
4
+ PropRow,
5
+ PropSection,
6
+ PropertiesPanel,
7
+ ScrubInput
8
+ } from "./chunk-4ZJEAWNG.js";
9
+ export {
10
+ ColorField,
11
+ PropRow,
12
+ PropSection,
13
+ PropertiesPanel,
14
+ ScrubInput
15
+ };
@@ -0,0 +1 @@
1
+ export * from "./types/packages/asta-ui/src/tool-dock";
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import {
3
+ ToolDock
4
+ } from "./chunk-VUDTGRS3.js";
5
+ export {
6
+ ToolDock
7
+ };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  TradeTicket
4
- } from "./chunk-Z6IAITZJ.js";
4
+ } from "./chunk-5VQV2I7C.js";
5
5
  export {
6
6
  TradeTicket as default
7
7
  };
@@ -0,0 +1,28 @@
1
+ import { type ReactNode } from "react";
2
+ export interface FileCardProps {
3
+ title: string;
4
+ /** A short line under the title, e.g. "Edited 2 h ago". */
5
+ meta?: ReactNode;
6
+ /** An image URL, or any node (a rendered preview, an illustration). */
7
+ thumbnail?: string | ReactNode;
8
+ /** Small icon in front of the title that says what kind of file it is. */
9
+ icon?: ReactNode;
10
+ /** Makes the card a link. Use `onOpen` instead for client-side routing. */
11
+ href?: string;
12
+ onOpen?: () => void;
13
+ starred?: boolean;
14
+ defaultStarred?: boolean;
15
+ /** Shows the star button. Omit it to hide starring. */
16
+ onStarChange?: (starred: boolean) => void;
17
+ /** A menu or buttons shown on the right of the footer (grid) or the row (list), e.g. a dropdown trigger. */
18
+ actions?: ReactNode;
19
+ /** Grid card or a compact list row. */
20
+ view?: "grid" | "list";
21
+ selected?: boolean;
22
+ className?: string;
23
+ }
24
+ /**
25
+ * A file in a file browser: a big thumbnail with the name, a kind icon and when it was last edited. The preview
26
+ * zooms a little on hover, the star pops when you star it, and the same data renders as a compact list row.
27
+ */
28
+ export declare function FileCard({ title, meta, thumbnail, icon, href, onOpen, starred, defaultStarred, onStarChange, actions, view, selected, className }: FileCardProps): import("react").JSX.Element;
@@ -0,0 +1,56 @@
1
+ import { type ReactNode } from "react";
2
+ export interface PropertiesPanelProps {
3
+ /** Shown in the panel header, e.g. the selected layer's name. */
4
+ title?: ReactNode;
5
+ /** Small tag before the title, e.g. "Text" or "Frame". */
6
+ kind?: string;
7
+ /** Buttons on the right of the header. */
8
+ actions?: ReactNode;
9
+ children: ReactNode;
10
+ className?: string;
11
+ }
12
+ /**
13
+ * The inspector of a design editor: a header for the selection, collapsible sections, compact number fields you
14
+ * can drag to scrub (Shift for ×10, Alt for ×0.1), and a colour field with a swatch and a hex input.
15
+ */
16
+ export declare function PropertiesPanel({ title, kind, actions, children, className }: PropertiesPanelProps): import("react").JSX.Element;
17
+ export interface PropSectionProps {
18
+ title: string;
19
+ /** A button on the right of the title, e.g. "+" to add a fill. */
20
+ action?: ReactNode;
21
+ defaultOpen?: boolean;
22
+ children: ReactNode;
23
+ }
24
+ export declare function PropSection({ title, action, defaultOpen, children }: PropSectionProps): import("react").JSX.Element;
25
+ export interface PropRowProps {
26
+ /** Muted label on the left. Omit it to let the fields use the full width. */
27
+ label?: string;
28
+ /** How many equal columns the fields share. */
29
+ cols?: 1 | 2 | 3 | 4;
30
+ children: ReactNode;
31
+ }
32
+ export declare function PropRow({ label, cols, children }: PropRowProps): import("react").JSX.Element;
33
+ export interface ScrubInputProps {
34
+ /** A short prefix ("X", "W") or an icon. Drag it left and right to change the value. */
35
+ label: ReactNode;
36
+ /** Accessible name when the label is an icon or a single letter. */
37
+ name?: string;
38
+ value: number;
39
+ onChange: (value: number) => void;
40
+ step?: number;
41
+ min?: number;
42
+ max?: number;
43
+ /** Decimals kept. */
44
+ precision?: number;
45
+ unit?: string;
46
+ disabled?: boolean;
47
+ }
48
+ export declare function ScrubInput({ label, name, value, onChange, step, min, max, precision, unit, disabled }: ScrubInputProps): import("react").JSX.Element;
49
+ export interface ColorFieldProps {
50
+ /** Hex colour, "#2f54eb". */
51
+ value: string;
52
+ onChange: (hex: string) => void;
53
+ name?: string;
54
+ disabled?: boolean;
55
+ }
56
+ export declare function ColorField({ value, onChange, name, disabled }: ColorFieldProps): import("react").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { type ReactNode } from "react";
2
+ export interface DockTool {
3
+ id: string;
4
+ label: string;
5
+ icon: ReactNode;
6
+ /** A single key such as "V" or "R". Shown in the tooltip, and pressed anywhere to pick the tool when `hotkeys` is on. */
7
+ shortcut?: string;
8
+ disabled?: boolean;
9
+ }
10
+ export interface ToolDockProps {
11
+ /** Tools in order. Put the string "separator" between groups. */
12
+ tools: (DockTool | "separator")[];
13
+ value?: string;
14
+ defaultValue?: string;
15
+ onChange?: (id: string) => void;
16
+ /** Pick a tool by pressing its shortcut, unless the user is typing in a field. Default true. */
17
+ hotkeys?: boolean;
18
+ /** Where the tooltips open. */
19
+ tooltip?: "top" | "bottom";
20
+ label?: string;
21
+ className?: string;
22
+ }
23
+ /**
24
+ * The floating tool bar of a design editor. A highlight slides to the active tool, each tool shows its name and
25
+ * shortcut on hover, ← → move between tools, and single-key shortcuts work from anywhere on the page.
26
+ */
27
+ export declare function ToolDock({ tools, value, defaultValue, onChange, hotkeys, tooltip, label, className }: ToolDockProps): import("react").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { type ReactNode } from "react";
2
+ export interface Workspace {
3
+ id: string;
4
+ name: string;
5
+ /** A short tag after the name, e.g. "Pro" or "Free". */
6
+ plan?: string;
7
+ /** A logo URL. Falls back to the first letter. */
8
+ logo?: string;
9
+ /** Muted text under the name in the list, e.g. "4 members". */
10
+ meta?: string;
11
+ }
12
+ export interface WorkspaceSwitcherProps {
13
+ workspaces: Workspace[];
14
+ value?: string;
15
+ defaultValue?: string;
16
+ onChange?: (id: string, workspace: Workspace) => void;
17
+ /** Shows a "New workspace" row at the bottom. */
18
+ onCreate?: () => void;
19
+ createLabel?: string;
20
+ /** Who is signed in, shown at the top of the menu. */
21
+ account?: {
22
+ name: string;
23
+ email?: string;
24
+ };
25
+ /** Extra rows under the list, e.g. settings or sign out. */
26
+ footer?: ReactNode;
27
+ className?: string;
28
+ }
29
+ /**
30
+ * The account and workspace picker at the top of an app sidebar. The menu drops in from the trigger, ↑ ↓ move,
31
+ * Enter picks, Escape or a click outside closes it, and the current workspace carries a check.
32
+ */
33
+ export declare function WorkspaceSwitcher({ workspaces, value, defaultValue, onChange, onCreate, createLabel, account, footer, className }: WorkspaceSwitcherProps): import("react").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export * from "../../../../components/kit/file-card";
@@ -0,0 +1 @@
1
+ export * from "../../../../components/kit/properties-panel";
@@ -0,0 +1 @@
1
+ export * from "../../../../components/kit/tool-dock";
@@ -0,0 +1 @@
1
+ export * from "../../../../components/kit/workspace-switcher";
@@ -81,6 +81,14 @@ export { Carousel } from "../../../components/kit/carousel";
81
81
  export type { CarouselProps } from "../../../components/kit/carousel";
82
82
  export { StatCard } from "../../../components/kit/stat-card";
83
83
  export type { StatCardProps } from "../../../components/kit/stat-card";
84
+ export { FileCard } from "../../../components/kit/file-card";
85
+ export type { FileCardProps } from "../../../components/kit/file-card";
86
+ export { WorkspaceSwitcher } from "../../../components/kit/workspace-switcher";
87
+ export type { Workspace, WorkspaceSwitcherProps } from "../../../components/kit/workspace-switcher";
88
+ export { ToolDock } from "../../../components/kit/tool-dock";
89
+ export type { DockTool, ToolDockProps } from "../../../components/kit/tool-dock";
90
+ export { PropertiesPanel, PropSection, PropRow, ScrubInput, ColorField } from "../../../components/kit/properties-panel";
91
+ export type { PropertiesPanelProps, PropSectionProps, PropRowProps, ScrubInputProps, ColorFieldProps } from "../../../components/kit/properties-panel";
84
92
  export { EmptyState } from "../../../components/kit/base/empty-state";
85
93
  export type { EmptyStateVariant, EmptyStateAction, EmptyStateProps } from "../../../components/kit/base/empty-state";
86
94
  export { Sidebar } from "../../../components/kit/base/sidebar";
@@ -0,0 +1 @@
1
+ export * from "../../../components/kit/file-card";
@@ -81,6 +81,14 @@ export { Carousel } from "../../../components/kit/carousel";
81
81
  export type { CarouselProps } from "../../../components/kit/carousel";
82
82
  export { StatCard } from "../../../components/kit/stat-card";
83
83
  export type { StatCardProps } from "../../../components/kit/stat-card";
84
+ export { FileCard } from "../../../components/kit/file-card";
85
+ export type { FileCardProps } from "../../../components/kit/file-card";
86
+ export { WorkspaceSwitcher } from "../../../components/kit/workspace-switcher";
87
+ export type { Workspace, WorkspaceSwitcherProps } from "../../../components/kit/workspace-switcher";
88
+ export { ToolDock } from "../../../components/kit/tool-dock";
89
+ export type { DockTool, ToolDockProps } from "../../../components/kit/tool-dock";
90
+ export { PropertiesPanel, PropSection, PropRow, ScrubInput, ColorField } from "../../../components/kit/properties-panel";
91
+ export type { PropertiesPanelProps, PropSectionProps, PropRowProps, ScrubInputProps, ColorFieldProps } from "../../../components/kit/properties-panel";
84
92
  export { EmptyState } from "../../../components/kit/empty-state";
85
93
  export type { EmptyStateVariant, EmptyStateAction, EmptyStateProps } from "../../../components/kit/empty-state";
86
94
  export { Sidebar } from "../../../components/kit/sidebar";
@@ -0,0 +1 @@
1
+ export * from "../../../components/kit/properties-panel";
@@ -0,0 +1 @@
1
+ export * from "../../../components/kit/tool-dock";
@@ -0,0 +1 @@
1
+ export * from "../../../components/kit/workspace-switcher";
@@ -0,0 +1 @@
1
+ export * from "./types/packages/asta-ui/src/workspace-switcher";
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import {
3
+ WorkspaceSwitcher
4
+ } from "./chunk-OXLBH4QM.js";
5
+ export {
6
+ WorkspaceSwitcher
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asta-ui",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "description": "Astabyte UI: motion-first React + Tailwind v4 components (Radix or Base UI). Install as a package, or copy the source with the CLI.",
5
5
  "keywords": [
6
6
  "astabyte",