@devalok/shilp-sutra 0.22.2 → 0.23.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/_chunks/tree-view.js +26 -26
- package/dist/_chunks/use-calendar.js +106 -106
- package/dist/composed/activity-feed.js +10 -10
- package/dist/composed/avatar-group.js +74 -75
- package/dist/composed/command-palette.js +8 -8
- package/dist/composed/content-card.js +10 -10
- package/dist/composed/empty-state.js +6 -6
- package/dist/composed/error-boundary.js +2 -2
- package/dist/composed/loading-skeleton.js +83 -83
- package/dist/composed/member-picker.js +6 -6
- package/dist/composed/page-skeletons.js +5 -5
- package/dist/composed/rich-text-editor.js +63 -63
- package/dist/composed/schedule-view.js +26 -26
- package/dist/composed/status-badge.js +8 -8
- package/dist/shell/bottom-navbar.js +4 -4
- package/dist/shell/notification-center.js +29 -29
- package/dist/shell/notification-preferences.js +2 -2
- package/dist/shell/sidebar.js +6 -6
- package/dist/shell/top-bar.js +71 -71
- package/dist/tailwind/index.cjs +33 -11
- package/dist/tailwind/preset.d.ts.map +1 -1
- package/dist/tailwind/preset.js +33 -11
- package/dist/tokens/primitives.css +2 -0
- package/dist/tokens/semantic.css +83 -14
- package/dist/tokens/typography.css +1 -1
- package/dist/ui/accordion.js +1 -1
- package/dist/ui/alert-dialog.js +32 -32
- package/dist/ui/alert.js +12 -12
- package/dist/ui/autocomplete.js +16 -16
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/avatar.js +81 -74
- package/dist/ui/badge.js +2 -2
- package/dist/ui/banner.js +1 -1
- package/dist/ui/button.js +8 -8
- package/dist/ui/card.d.ts +1 -1
- package/dist/ui/card.js +10 -10
- package/dist/ui/charts/index.js +312 -312
- package/dist/ui/checkbox.js +3 -3
- package/dist/ui/chip.js +4 -4
- package/dist/ui/code.js +2 -2
- package/dist/ui/color-input.js +1 -1
- package/dist/ui/combobox.js +37 -37
- package/dist/ui/context-menu.js +6 -6
- package/dist/ui/data-table-toolbar.js +18 -18
- package/dist/ui/data-table.js +132 -132
- package/dist/ui/dialog.js +12 -12
- package/dist/ui/dropdown-menu.js +67 -67
- package/dist/ui/file-upload.js +3 -3
- package/dist/ui/hover-card.js +13 -13
- package/dist/ui/input-otp.js +9 -9
- package/dist/ui/input.js +10 -10
- package/dist/ui/menubar.js +33 -33
- package/dist/ui/navigation-menu.js +52 -52
- package/dist/ui/number-input.js +14 -14
- package/dist/ui/pagination.js +25 -25
- package/dist/ui/popover.js +17 -17
- package/dist/ui/progress.js +1 -1
- package/dist/ui/radio.js +2 -2
- package/dist/ui/search-input.js +3 -3
- package/dist/ui/segmented-control.d.ts +1 -1
- package/dist/ui/segmented-control.js +16 -16
- package/dist/ui/select.js +17 -17
- package/dist/ui/sheet.js +21 -21
- package/dist/ui/sidebar.js +13 -13
- package/dist/ui/slider.js +2 -2
- package/dist/ui/stat-card.js +52 -52
- package/dist/ui/stepper.js +1 -1
- package/dist/ui/switch.js +11 -11
- package/dist/ui/table.js +19 -19
- package/dist/ui/tabs.js +2 -2
- package/dist/ui/textarea.js +6 -6
- package/dist/ui/toast.js +3 -3
- package/dist/ui/toggle.js +7 -7
- package/dist/ui/tooltip.js +17 -17
- package/docs/components/composed/avatar-group.md +5 -0
- package/docs/components/ui/avatar.md +4 -0
- package/llms-full.txt +10 -1
- package/llms.txt +66 -5
- package/package.json +1 -1
|
@@ -13,8 +13,8 @@ function v(t, d) {
|
|
|
13
13
|
return t.getFullYear() === d.getFullYear() && t.getMonth() === d.getMonth() && t.getDate() === d.getDate();
|
|
14
14
|
}
|
|
15
15
|
function M(t) {
|
|
16
|
-
const d = new Date(t),
|
|
17
|
-
return l.setDate(
|
|
16
|
+
const d = new Date(t), n = /* @__PURE__ */ new Date(), l = /* @__PURE__ */ new Date();
|
|
17
|
+
return l.setDate(n.getDate() - 1), v(d, n) ? "Today" : v(d, l) ? "Yesterday" : "Earlier";
|
|
18
18
|
}
|
|
19
19
|
const w = {
|
|
20
20
|
INFO: "bg-info-9",
|
|
@@ -24,25 +24,25 @@ const w = {
|
|
|
24
24
|
function ee({
|
|
25
25
|
notification: t,
|
|
26
26
|
onRead: d,
|
|
27
|
-
onNavigate:
|
|
27
|
+
onNavigate: n,
|
|
28
28
|
getRoute: l,
|
|
29
29
|
onDismiss: u
|
|
30
30
|
}) {
|
|
31
|
-
const
|
|
32
|
-
t.isRead || d(t.id),
|
|
31
|
+
const h = l(t), i = () => {
|
|
32
|
+
t.isRead || d(t.id), h && n(h);
|
|
33
33
|
};
|
|
34
34
|
return /* @__PURE__ */ a(
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
37
37
|
role: "button",
|
|
38
38
|
tabIndex: 0,
|
|
39
|
-
onClick:
|
|
39
|
+
onClick: i,
|
|
40
40
|
onKeyDown: (r) => {
|
|
41
|
-
(r.key === "Enter" || r.key === " ") && (r.preventDefault(),
|
|
41
|
+
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), i());
|
|
42
42
|
},
|
|
43
43
|
className: p(
|
|
44
44
|
"group relative flex w-full cursor-pointer items-start gap-ds-04 px-ds-05 py-ds-04 text-left transition-colors duration-fast-02 ease-productive-standard",
|
|
45
|
-
"hover:bg-surface-
|
|
45
|
+
"hover:bg-surface-raised",
|
|
46
46
|
!t.isRead && "bg-accent-1"
|
|
47
47
|
),
|
|
48
48
|
children: [
|
|
@@ -85,7 +85,7 @@ function ee({
|
|
|
85
85
|
onKeyDown: (c) => c.stopPropagation(),
|
|
86
86
|
className: p(
|
|
87
87
|
"rounded-ds-md px-ds-03 py-ds-01 text-ds-sm font-medium transition-colors duration-fast-02 ease-productive-standard",
|
|
88
|
-
r.variant === "primary" ? "bg-accent-9 text-accent-fg hover:bg-accent-10" : r.variant === "danger" ? "text-error-11 hover:bg-error-3" : "text-surface-fg-muted hover:bg-surface-
|
|
88
|
+
r.variant === "primary" ? "bg-accent-9 text-accent-fg hover:bg-accent-10" : r.variant === "danger" ? "text-error-11 hover:bg-error-3" : "text-surface-fg-muted hover:bg-surface-raised-hover"
|
|
89
89
|
),
|
|
90
90
|
children: r.label
|
|
91
91
|
},
|
|
@@ -101,7 +101,7 @@ function ee({
|
|
|
101
101
|
r.stopPropagation(), u(t.id);
|
|
102
102
|
},
|
|
103
103
|
onKeyDown: (r) => r.stopPropagation(),
|
|
104
|
-
className: "absolute right-ds-03 top-ds-03 hidden rounded-ds-sm p-ds-01 text-surface-fg-subtle transition-[color,background-color,opacity] duration-fast-01 ease-productive-standard hover:bg-surface-
|
|
104
|
+
className: "absolute right-ds-03 top-ds-03 hidden rounded-ds-sm p-ds-01 text-surface-fg-subtle transition-[color,background-color,opacity] duration-fast-01 ease-productive-standard hover:bg-surface-raised-hover hover:text-surface-fg-muted group-hover:flex group-focus-within:flex",
|
|
105
105
|
children: /* @__PURE__ */ e(W, { className: "h-ico-sm w-ico-sm" })
|
|
106
106
|
}
|
|
107
107
|
)
|
|
@@ -113,12 +113,12 @@ const te = z.forwardRef(
|
|
|
113
113
|
({
|
|
114
114
|
notifications: t = [],
|
|
115
115
|
unreadCount: d,
|
|
116
|
-
open:
|
|
116
|
+
open: n,
|
|
117
117
|
onOpenChange: l,
|
|
118
118
|
isLoading: u = !1,
|
|
119
|
-
hasMore:
|
|
120
|
-
onFetchMore:
|
|
121
|
-
onMarkRead:
|
|
119
|
+
hasMore: h = !1,
|
|
120
|
+
onFetchMore: i,
|
|
121
|
+
onMarkRead: g,
|
|
122
122
|
onMarkAllRead: r,
|
|
123
123
|
onNavigate: c,
|
|
124
124
|
getNotificationRoute: D,
|
|
@@ -130,48 +130,48 @@ const te = z.forwardRef(
|
|
|
130
130
|
className: R,
|
|
131
131
|
...k
|
|
132
132
|
}, P) => {
|
|
133
|
-
const y = B(null),
|
|
133
|
+
const y = B(null), o = d ?? t.filter((s) => !s.isRead).length, K = D ?? (() => null), Y = x(
|
|
134
134
|
(s) => {
|
|
135
135
|
l == null || l(!1), c == null || c(s);
|
|
136
136
|
},
|
|
137
137
|
[c, l]
|
|
138
138
|
), E = x(
|
|
139
139
|
(s) => {
|
|
140
|
-
|
|
140
|
+
g == null || g(s);
|
|
141
141
|
},
|
|
142
|
-
[
|
|
142
|
+
[g]
|
|
143
143
|
), S = x(() => {
|
|
144
144
|
const s = y.current;
|
|
145
|
-
!s || u || !
|
|
146
|
-
}, [u,
|
|
145
|
+
!s || u || !h || s.scrollTop + s.clientHeight >= s.scrollHeight - 50 && (i == null || i());
|
|
146
|
+
}, [u, h, i]), A = t.reduce(
|
|
147
147
|
(s, m) => {
|
|
148
148
|
const f = M(m.createdAt);
|
|
149
149
|
return s[f] || (s[f] = []), s[f].push(m), s;
|
|
150
150
|
},
|
|
151
151
|
{}
|
|
152
152
|
), H = ["Today", "Yesterday", "Earlier"];
|
|
153
|
-
return /* @__PURE__ */ a(X, { open:
|
|
153
|
+
return /* @__PURE__ */ a(X, { open: n, onOpenChange: l, children: [
|
|
154
154
|
/* @__PURE__ */ a(F, { children: [
|
|
155
155
|
/* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(_, { asChild: !0, children: /* @__PURE__ */ a(
|
|
156
156
|
"button",
|
|
157
157
|
{
|
|
158
158
|
...k,
|
|
159
159
|
ref: P,
|
|
160
|
-
"aria-label":
|
|
160
|
+
"aria-label": o > 0 ? `Notifications, ${o} unread` : "Notifications",
|
|
161
161
|
className: p(
|
|
162
|
-
"relative flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-full border border-surface-border-strong bg-surface-
|
|
162
|
+
"relative flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-full border border-surface-border-strong bg-surface-raised text-surface-fg-muted transition-colors ease-productive-standard hover:bg-surface-raised-hover",
|
|
163
163
|
R
|
|
164
164
|
),
|
|
165
165
|
children: [
|
|
166
166
|
/* @__PURE__ */ e(Q, { className: "h-ico-sm w-ico-sm", "aria-hidden": "true" }),
|
|
167
|
-
|
|
167
|
+
o > 0 && /* @__PURE__ */ e(
|
|
168
168
|
N.span,
|
|
169
169
|
{
|
|
170
170
|
initial: { rotate: 0 },
|
|
171
171
|
animate: { rotate: [0, -3, 3, -1, 1, 0] },
|
|
172
172
|
transition: { duration: 0.4, ease: "easeInOut" },
|
|
173
173
|
className: "absolute -right-ds-01 -top-ds-01 flex h-4 min-w-4 items-center justify-center rounded-ds-full bg-accent-9 px-ds-02 text-ds-xs font-semibold text-accent-fg",
|
|
174
|
-
children:
|
|
174
|
+
children: o > 99 ? "99+" : o
|
|
175
175
|
}
|
|
176
176
|
)
|
|
177
177
|
]
|
|
@@ -183,7 +183,7 @@ const te = z.forwardRef(
|
|
|
183
183
|
q,
|
|
184
184
|
{
|
|
185
185
|
className: p(
|
|
186
|
-
"w-[380px] rounded-ds-xl border border-surface-border-strong bg-surface-
|
|
186
|
+
"w-[380px] rounded-ds-xl border border-surface-border-strong bg-surface-overlay p-0 shadow-floating",
|
|
187
187
|
j
|
|
188
188
|
),
|
|
189
189
|
sideOffset: 8,
|
|
@@ -192,10 +192,10 @@ const te = z.forwardRef(
|
|
|
192
192
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between border-b border-surface-border-strong px-ds-05 py-ds-04", children: [
|
|
193
193
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-ds-03", children: [
|
|
194
194
|
/* @__PURE__ */ e("h3", { className: "text-ds-md font-semibold text-surface-fg", children: "Notifications" }),
|
|
195
|
-
|
|
195
|
+
o > 0 && /* @__PURE__ */ e("span", { className: "flex h-5 min-w-5 items-center justify-center rounded-ds-full bg-accent-2 px-ds-02b text-ds-sm font-semibold text-accent-11", children: o })
|
|
196
196
|
] }),
|
|
197
197
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-ds-03", children: [
|
|
198
|
-
|
|
198
|
+
o > 0 && r && /* @__PURE__ */ a(
|
|
199
199
|
"button",
|
|
200
200
|
{
|
|
201
201
|
type: "button",
|
|
@@ -218,13 +218,13 @@ const te = z.forwardRef(
|
|
|
218
218
|
className: "max-h-[420px] overflow-y-auto",
|
|
219
219
|
children: [
|
|
220
220
|
t.length === 0 ? T || /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center px-ds-05 py-ds-09", children: [
|
|
221
|
-
/* @__PURE__ */ e("div", { className: "flex h-ds-lg w-ds-lg items-center justify-center rounded-ds-full bg-surface-
|
|
221
|
+
/* @__PURE__ */ e("div", { className: "flex h-ds-lg w-ds-lg items-center justify-center rounded-ds-full bg-surface-raised", children: /* @__PURE__ */ e(V, { className: "h-ico-lg w-ico-lg text-surface-fg-subtle" }) }),
|
|
222
222
|
/* @__PURE__ */ e("p", { className: "mt-ds-04 text-ds-md text-surface-fg-subtle", children: "No notifications yet" }),
|
|
223
223
|
/* @__PURE__ */ e("p", { className: "mt-ds-02 text-ds-sm text-surface-fg-subtle", children: "You're all caught up!" })
|
|
224
224
|
] }) : H.map((s) => {
|
|
225
225
|
const m = A[s];
|
|
226
226
|
return !m || m.length === 0 ? null : /* @__PURE__ */ a("div", { children: [
|
|
227
|
-
/* @__PURE__ */ e("div", { className: "sticky top-0 z-raised bg-surface-
|
|
227
|
+
/* @__PURE__ */ e("div", { className: "sticky top-0 z-raised bg-surface-overlay px-ds-05 py-ds-02b", children: /* @__PURE__ */ e("span", { className: "text-ds-sm font-medium text-surface-fg-subtle", children: s }) }),
|
|
228
228
|
m.map((f, O) => /* @__PURE__ */ e(
|
|
229
229
|
N.div,
|
|
230
230
|
{
|
|
@@ -79,7 +79,7 @@ const _ = {
|
|
|
79
79
|
t < f.length - 1 && "border-b border-surface-border-strong"
|
|
80
80
|
),
|
|
81
81
|
children: [
|
|
82
|
-
/* @__PURE__ */ e("div", { className: "flex h-ds-sm w-ds-sm shrink-0 items-center justify-center rounded-ds-lg bg-surface-
|
|
82
|
+
/* @__PURE__ */ e("div", { className: "flex h-ds-sm w-ds-sm shrink-0 items-center justify-center rounded-ds-lg bg-surface-raised", children: /* @__PURE__ */ e("span", { className: "[&>svg]:h-ico-sm [&>svg]:w-ico-sm text-surface-fg-muted", "aria-hidden": "true", children: a.icon }) }),
|
|
83
83
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
84
84
|
/* @__PURE__ */ e("p", { className: "text-ds-md font-medium text-surface-fg", children: a.label }),
|
|
85
85
|
/* @__PURE__ */ e("p", { className: "text-ds-sm text-surface-fg-subtle", children: V(l.projectId) })
|
|
@@ -110,7 +110,7 @@ const _ = {
|
|
|
110
110
|
{
|
|
111
111
|
type: "button",
|
|
112
112
|
onClick: () => p == null ? void 0 : p(l.id),
|
|
113
|
-
className: "shrink-0 rounded p-ds-02b text-surface-fg-subtle transition-colors hover:bg-surface-
|
|
113
|
+
className: "shrink-0 rounded p-ds-02b text-surface-fg-subtle transition-colors hover:bg-surface-raised hover:text-error-11",
|
|
114
114
|
children: /* @__PURE__ */ e(ee, { className: "h-ico-sm w-ico-sm" })
|
|
115
115
|
}
|
|
116
116
|
)
|
package/dist/shell/sidebar.js
CHANGED
|
@@ -45,7 +45,7 @@ function re({ className: r }) {
|
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
|
-
const B = "relative gap-ds-04 rounded-ds-lg px-ds-04 py-ds-03 transition-colors duration-fast-02", F = "bg-accent-2 text-accent-11 after:absolute after:right-0 after:top-0 after:h-full after:w-ds-01 after:rounded-l-ds-full after:bg-accent-9 after:content-['']", G = "text-surface-fg-subtle hover:bg-surface-
|
|
48
|
+
const B = "relative gap-ds-04 rounded-ds-lg px-ds-04 py-ds-03 transition-colors duration-fast-02", F = "bg-accent-2 text-accent-11 after:absolute after:right-0 after:top-0 after:h-full after:w-ds-01 after:rounded-l-ds-full after:bg-accent-9 after:content-['']", G = "text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg";
|
|
49
49
|
function se({
|
|
50
50
|
item: r,
|
|
51
51
|
isActive: t,
|
|
@@ -86,7 +86,7 @@ function se({
|
|
|
86
86
|
/* @__PURE__ */ e(Y, { asChild: !0, children: /* @__PURE__ */ e(
|
|
87
87
|
"button",
|
|
88
88
|
{
|
|
89
|
-
className: "absolute right-ds-02 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-ds-md text-surface-fg-subtle transition-colors hover:bg-surface-
|
|
89
|
+
className: "absolute right-ds-02 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-ds-md text-surface-fg-subtle transition-colors hover:bg-surface-raised-hover hover:text-surface-fg group-data-[collapsible=icon]:hidden",
|
|
90
90
|
"aria-label": `Toggle ${r.title}`,
|
|
91
91
|
children: /* @__PURE__ */ e(ae, { className: "h-4 w-4 transition-transform duration-fast-02 ease-productive-standard group-data-[state=open]/collapsible:rotate-90" })
|
|
92
92
|
}
|
|
@@ -167,7 +167,7 @@ const ne = m.forwardRef(
|
|
|
167
167
|
ref: W,
|
|
168
168
|
"aria-label": "Main navigation",
|
|
169
169
|
className: b(
|
|
170
|
-
"z-raised hidden h-full flex-col border-r border-surface-border-strong bg-surface-
|
|
170
|
+
"z-raised hidden h-full flex-col border-r border-surface-border-strong bg-surface-sunken md:flex",
|
|
171
171
|
D
|
|
172
172
|
),
|
|
173
173
|
children: [
|
|
@@ -175,7 +175,7 @@ const ne = m.forwardRef(
|
|
|
175
175
|
t && /* @__PURE__ */ s("div", { className: "flex items-center gap-ds-04 px-ds-06 pb-ds-05", children: [
|
|
176
176
|
/* @__PURE__ */ s(_, { className: "h-ds-sm-plus w-ds-sm-plus", children: [
|
|
177
177
|
t.image ? /* @__PURE__ */ e(P, { src: t.image, alt: t.name }) : null,
|
|
178
|
-
/* @__PURE__ */ e(ee, { className: "bg-surface-
|
|
178
|
+
/* @__PURE__ */ e(ee, { className: "bg-surface-raised-hover text-surface-fg", children: (N = t.name) == null ? void 0 : N.charAt(0).toUpperCase() })
|
|
179
179
|
] }),
|
|
180
180
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 flex-col", children: [
|
|
181
181
|
/* @__PURE__ */ e("span", { className: "truncate text-ds-md text-surface-fg", children: t.name }),
|
|
@@ -216,13 +216,13 @@ const ne = m.forwardRef(
|
|
|
216
216
|
] }),
|
|
217
217
|
a ? /* @__PURE__ */ s(M, { className: "gap-ds-03 px-ds-06 py-ds-05", children: [
|
|
218
218
|
a.slot && /* @__PURE__ */ e("div", { children: a.slot }),
|
|
219
|
-
a.promo && /* @__PURE__ */ s("div", { className: "relative rounded-ds-lg border border-surface-border bg-surface-
|
|
219
|
+
a.promo && /* @__PURE__ */ s("div", { className: "relative rounded-ds-lg border border-surface-border bg-surface-raised p-ds-04 shadow-raised", children: [
|
|
220
220
|
a.promo.onDismiss && /* @__PURE__ */ e(
|
|
221
221
|
"button",
|
|
222
222
|
{
|
|
223
223
|
onClick: a.promo.onDismiss,
|
|
224
224
|
"aria-label": "Dismiss",
|
|
225
|
-
className: "absolute right-ds-02 top-ds-02 flex h-5 w-5 items-center justify-center rounded-ds-md text-surface-fg-subtle transition-colors hover:bg-surface-
|
|
225
|
+
className: "absolute right-ds-02 top-ds-02 flex h-5 w-5 items-center justify-center rounded-ds-md text-surface-fg-subtle transition-colors hover:bg-surface-raised-hover hover:text-surface-fg",
|
|
226
226
|
children: /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" })
|
|
227
227
|
}
|
|
228
228
|
),
|
package/dist/shell/top-bar.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
2
|
+
import { jsx as e, jsxs as d, Fragment as D } from "react/jsx-runtime";
|
|
3
3
|
import * as l from "react";
|
|
4
4
|
import { useColorMode as U } from "../hooks/use-color-mode.js";
|
|
5
5
|
import { Avatar as A, AvatarImage as I, AvatarFallback as L } from "../ui/avatar.js";
|
|
6
6
|
import { DropdownMenu as S, DropdownMenuTrigger as F, DropdownMenuContent as O, DropdownMenuItem as f, DropdownMenuSeparator as h } from "../ui/dropdown-menu.js";
|
|
7
7
|
import { Tooltip as x, TooltipTrigger as b, TooltipContent as w } from "../ui/tooltip.js";
|
|
8
8
|
import { IconUser as _, IconSun as z, IconMoon as E, IconLogout as P } from "@tabler/icons-react";
|
|
9
|
-
import { cn as
|
|
9
|
+
import { cn as c } from "../ui/lib/utils.js";
|
|
10
10
|
const N = l.forwardRef(
|
|
11
|
-
({ className: r, children: s, ...t },
|
|
11
|
+
({ className: r, children: s, ...t }, o) => {
|
|
12
12
|
const n = l.Children.toArray(s).some(
|
|
13
13
|
(i) => l.isValidElement(i) && i.type === p
|
|
14
14
|
);
|
|
@@ -16,9 +16,9 @@ const N = l.forwardRef(
|
|
|
16
16
|
"div",
|
|
17
17
|
{
|
|
18
18
|
...t,
|
|
19
|
-
ref:
|
|
20
|
-
className:
|
|
21
|
-
"z-sticky w-full border-b border-surface-border-strong bg-surface-
|
|
19
|
+
ref: o,
|
|
20
|
+
className: c(
|
|
21
|
+
"z-sticky w-full border-b border-surface-border-strong bg-surface-sunken px-ds-05 py-ds-04 md:px-ds-06",
|
|
22
22
|
n ? "grid grid-cols-[1fr_auto_1fr] items-center" : "flex items-center",
|
|
23
23
|
r
|
|
24
24
|
),
|
|
@@ -28,81 +28,81 @@ const N = l.forwardRef(
|
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
30
|
N.displayName = "TopBar";
|
|
31
|
-
const
|
|
32
|
-
({ className: r, children: s, ...t },
|
|
31
|
+
const y = l.forwardRef(
|
|
32
|
+
({ className: r, children: s, ...t }, o) => /* @__PURE__ */ e(
|
|
33
33
|
"div",
|
|
34
34
|
{
|
|
35
|
-
ref:
|
|
36
|
-
className:
|
|
35
|
+
ref: o,
|
|
36
|
+
className: c("flex items-center gap-ds-04", r),
|
|
37
37
|
...t,
|
|
38
38
|
children: s
|
|
39
39
|
}
|
|
40
40
|
)
|
|
41
41
|
);
|
|
42
|
-
|
|
42
|
+
y.displayName = "TopBar.Left";
|
|
43
43
|
const p = l.forwardRef(
|
|
44
|
-
({ className: r, children: s, ...t },
|
|
44
|
+
({ className: r, children: s, ...t }, o) => /* @__PURE__ */ e(
|
|
45
45
|
"div",
|
|
46
46
|
{
|
|
47
|
-
ref:
|
|
48
|
-
className:
|
|
47
|
+
ref: o,
|
|
48
|
+
className: c("flex items-center justify-center px-ds-04", r),
|
|
49
49
|
...t,
|
|
50
50
|
children: s
|
|
51
51
|
}
|
|
52
52
|
)
|
|
53
53
|
);
|
|
54
54
|
p.displayName = "TopBar.Center";
|
|
55
|
-
const
|
|
56
|
-
({ className: r, children: s, ...t },
|
|
55
|
+
const T = l.forwardRef(
|
|
56
|
+
({ className: r, children: s, ...t }, o) => /* @__PURE__ */ e(
|
|
57
57
|
"div",
|
|
58
58
|
{
|
|
59
|
-
ref:
|
|
60
|
-
className:
|
|
59
|
+
ref: o,
|
|
60
|
+
className: c("ml-auto flex items-center gap-ds-04", r),
|
|
61
61
|
...t,
|
|
62
62
|
children: s
|
|
63
63
|
}
|
|
64
64
|
)
|
|
65
65
|
);
|
|
66
|
-
|
|
66
|
+
T.displayName = "TopBar.Right";
|
|
67
67
|
const V = {
|
|
68
68
|
tight: "gap-ds-02",
|
|
69
69
|
default: "gap-ds-04",
|
|
70
70
|
loose: "gap-ds-06"
|
|
71
71
|
}, B = l.forwardRef(
|
|
72
|
-
({ gap: r = "default", className: s, children: t, ...
|
|
72
|
+
({ gap: r = "default", className: s, children: t, ...o }, n) => /* @__PURE__ */ e(
|
|
73
73
|
"div",
|
|
74
74
|
{
|
|
75
75
|
ref: n,
|
|
76
|
-
className:
|
|
77
|
-
...
|
|
76
|
+
className: c("flex items-center", V[r], s),
|
|
77
|
+
...o,
|
|
78
78
|
children: t
|
|
79
79
|
}
|
|
80
80
|
)
|
|
81
81
|
);
|
|
82
82
|
B.displayName = "TopBar.Section";
|
|
83
|
-
const C = l.forwardRef(({ icon: r, tooltip: s, className: t, ...
|
|
83
|
+
const C = l.forwardRef(({ icon: r, tooltip: s, className: t, ...o }, n) => /* @__PURE__ */ d(x, { children: [
|
|
84
84
|
/* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ e(
|
|
85
85
|
"button",
|
|
86
86
|
{
|
|
87
87
|
ref: n,
|
|
88
88
|
type: "button",
|
|
89
|
-
className:
|
|
90
|
-
"flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-full border border-surface-border-strong bg-surface-
|
|
89
|
+
className: c(
|
|
90
|
+
"flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-full border border-surface-border-strong bg-surface-raised-hover text-surface-fg-muted transition-[color,background-color,border-color,transform] hover:bg-surface-raised-active active:scale-90 duration-fast-01 ease-productive-standard",
|
|
91
91
|
t
|
|
92
92
|
),
|
|
93
|
-
...
|
|
93
|
+
...o,
|
|
94
94
|
children: /* @__PURE__ */ e("span", { className: "[&>svg]:h-ico-sm [&>svg]:w-ico-sm", "aria-hidden": "true", children: r })
|
|
95
95
|
}
|
|
96
96
|
) }),
|
|
97
97
|
/* @__PURE__ */ e(w, { side: "bottom", align: "center", children: s })
|
|
98
98
|
] }));
|
|
99
99
|
C.displayName = "TopBar.IconButton";
|
|
100
|
-
const
|
|
101
|
-
({ className: r, children: s, ...t },
|
|
100
|
+
const v = l.forwardRef(
|
|
101
|
+
({ className: r, children: s, ...t }, o) => /* @__PURE__ */ e(
|
|
102
102
|
"h2",
|
|
103
103
|
{
|
|
104
|
-
ref:
|
|
105
|
-
className:
|
|
104
|
+
ref: o,
|
|
105
|
+
className: c(
|
|
106
106
|
"hidden text-ds-lg text-surface-fg md:block",
|
|
107
107
|
r
|
|
108
108
|
),
|
|
@@ -111,42 +111,42 @@ const k = l.forwardRef(
|
|
|
111
111
|
}
|
|
112
112
|
)
|
|
113
113
|
);
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
({ user: r, onNavigate: s, onLogout: t, userMenuItems:
|
|
114
|
+
v.displayName = "TopBar.Title";
|
|
115
|
+
const k = l.forwardRef(
|
|
116
|
+
({ user: r, onNavigate: s, onLogout: t, userMenuItems: o, className: n }, i) => {
|
|
117
117
|
var u;
|
|
118
|
-
const { colorMode: m, toggleColorMode:
|
|
119
|
-
return /* @__PURE__ */
|
|
120
|
-
/* @__PURE__ */
|
|
118
|
+
const { colorMode: m, toggleColorMode: M } = U();
|
|
119
|
+
return /* @__PURE__ */ d(S, { children: [
|
|
120
|
+
/* @__PURE__ */ d(x, { children: [
|
|
121
121
|
/* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ e(F, { asChild: !0, children: /* @__PURE__ */ e(
|
|
122
122
|
"button",
|
|
123
123
|
{
|
|
124
124
|
ref: i,
|
|
125
125
|
type: "button",
|
|
126
|
-
className:
|
|
127
|
-
children: /* @__PURE__ */
|
|
126
|
+
className: c("flex items-center gap-ds-03 outline-none", n),
|
|
127
|
+
children: /* @__PURE__ */ d(A, { className: "h-ds-sm-plus w-ds-sm-plus cursor-pointer", children: [
|
|
128
128
|
r.image ? /* @__PURE__ */ e(I, { src: r.image, alt: r.name }) : null,
|
|
129
|
-
/* @__PURE__ */ e(L, { className: "bg-surface-
|
|
129
|
+
/* @__PURE__ */ e(L, { className: "bg-surface-raised-hover text-surface-fg", children: (u = r.name) == null ? void 0 : u.charAt(0).toUpperCase() })
|
|
130
130
|
] })
|
|
131
131
|
}
|
|
132
132
|
) }) }),
|
|
133
133
|
/* @__PURE__ */ e(w, { side: "bottom", align: "center", children: "User Menu" })
|
|
134
134
|
] }),
|
|
135
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ d(
|
|
136
136
|
O,
|
|
137
137
|
{
|
|
138
|
-
className: "w-[200px] rounded-ds-xl border border-surface-border-strong bg-surface-
|
|
138
|
+
className: "w-[200px] rounded-ds-xl border border-surface-border-strong bg-surface-overlay p-0 shadow-floating",
|
|
139
139
|
sideOffset: 8,
|
|
140
140
|
align: "end",
|
|
141
141
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ d("div", { className: "border-b border-surface-border-strong px-ds-05 py-ds-04", children: [
|
|
143
143
|
/* @__PURE__ */ e("p", { className: "text-ds-md text-surface-fg", children: r.name }),
|
|
144
144
|
r.email && /* @__PURE__ */ e("p", { className: "text-ds-sm text-surface-fg-subtle", children: r.email })
|
|
145
145
|
] }),
|
|
146
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ d(
|
|
147
147
|
f,
|
|
148
148
|
{
|
|
149
|
-
className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-
|
|
149
|
+
className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-raised",
|
|
150
150
|
onClick: () => s == null ? void 0 : s("/profile"),
|
|
151
151
|
children: [
|
|
152
152
|
/* @__PURE__ */ e(_, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }),
|
|
@@ -154,61 +154,61 @@ const M = l.forwardRef(
|
|
|
154
154
|
]
|
|
155
155
|
}
|
|
156
156
|
),
|
|
157
|
-
|
|
157
|
+
o == null ? void 0 : o.map((a, R) => {
|
|
158
158
|
const j = {
|
|
159
159
|
error: "text-error-11",
|
|
160
160
|
success: "text-success-11",
|
|
161
161
|
warning: "text-warning-11",
|
|
162
162
|
info: "text-info-11"
|
|
163
|
-
}, g =
|
|
164
|
-
return /* @__PURE__ */
|
|
165
|
-
|
|
166
|
-
/* @__PURE__ */
|
|
163
|
+
}, g = a.color ? j[a.color] ?? "text-surface-fg-muted" : "text-surface-fg-muted";
|
|
164
|
+
return /* @__PURE__ */ d(l.Fragment, { children: [
|
|
165
|
+
a.separator && /* @__PURE__ */ e(h, { className: "bg-surface-border" }),
|
|
166
|
+
/* @__PURE__ */ d(
|
|
167
167
|
f,
|
|
168
168
|
{
|
|
169
|
-
className:
|
|
170
|
-
"flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-
|
|
171
|
-
|
|
169
|
+
className: c(
|
|
170
|
+
"flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-raised",
|
|
171
|
+
a.disabled && "pointer-events-none opacity-action-disabled"
|
|
172
172
|
),
|
|
173
|
-
disabled:
|
|
173
|
+
disabled: a.disabled,
|
|
174
174
|
onClick: () => {
|
|
175
|
-
|
|
175
|
+
a.disabled || (a.onClick ? a.onClick() : a.href && (s == null || s(a.href)));
|
|
176
176
|
},
|
|
177
177
|
children: [
|
|
178
|
-
|
|
178
|
+
a.icon && /* @__PURE__ */ e(
|
|
179
179
|
"span",
|
|
180
180
|
{
|
|
181
|
-
className:
|
|
181
|
+
className: c(
|
|
182
182
|
"[&>svg]:h-ico-sm [&>svg]:w-ico-sm",
|
|
183
183
|
g
|
|
184
184
|
),
|
|
185
|
-
children:
|
|
185
|
+
children: a.icon
|
|
186
186
|
}
|
|
187
187
|
),
|
|
188
|
-
/* @__PURE__ */ e("span", { className:
|
|
189
|
-
|
|
188
|
+
/* @__PURE__ */ e("span", { className: c("text-ds-md", g), children: a.label }),
|
|
189
|
+
a.badge != null && a.badge !== !1 && (typeof a.badge == "string" ? /* @__PURE__ */ e("span", { className: "ml-auto inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-ds-full bg-error-9 px-ds-02 text-[10px] font-semibold leading-none text-accent-fg", children: a.badge }) : /* @__PURE__ */ e("span", { className: "ml-auto h-[8px] w-[8px] rounded-ds-full bg-error-9" }))
|
|
190
190
|
]
|
|
191
191
|
}
|
|
192
192
|
)
|
|
193
|
-
] },
|
|
193
|
+
] }, a.label + R);
|
|
194
194
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ d(
|
|
196
196
|
f,
|
|
197
197
|
{
|
|
198
|
-
className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-
|
|
199
|
-
onClick:
|
|
198
|
+
className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-raised",
|
|
199
|
+
onClick: M,
|
|
200
200
|
children: [
|
|
201
201
|
m === "dark" ? /* @__PURE__ */ e(z, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }) : /* @__PURE__ */ e(E, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }),
|
|
202
202
|
/* @__PURE__ */ e("span", { className: "text-ds-md text-surface-fg-muted", children: m === "dark" ? "Light Mode" : "Dark Mode" })
|
|
203
203
|
]
|
|
204
204
|
}
|
|
205
205
|
),
|
|
206
|
-
t && /* @__PURE__ */
|
|
206
|
+
t && /* @__PURE__ */ d(D, { children: [
|
|
207
207
|
/* @__PURE__ */ e(h, { className: "bg-surface-border" }),
|
|
208
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ d(
|
|
209
209
|
f,
|
|
210
210
|
{
|
|
211
|
-
className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-
|
|
211
|
+
className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-raised",
|
|
212
212
|
onClick: t,
|
|
213
213
|
children: [
|
|
214
214
|
/* @__PURE__ */ e(P, { className: "h-ico-sm w-ico-sm text-error-11" }),
|
|
@@ -223,15 +223,15 @@ const M = l.forwardRef(
|
|
|
223
223
|
] });
|
|
224
224
|
}
|
|
225
225
|
);
|
|
226
|
-
|
|
226
|
+
k.displayName = "TopBar.UserMenu";
|
|
227
227
|
const X = Object.assign(N, {
|
|
228
|
-
Left:
|
|
228
|
+
Left: y,
|
|
229
229
|
Center: p,
|
|
230
|
-
Right:
|
|
230
|
+
Right: T,
|
|
231
231
|
Section: B,
|
|
232
232
|
IconButton: C,
|
|
233
|
-
Title:
|
|
234
|
-
UserMenu:
|
|
233
|
+
Title: v,
|
|
234
|
+
UserMenu: k
|
|
235
235
|
});
|
|
236
236
|
export {
|
|
237
237
|
X as TopBar
|
package/dist/tailwind/index.cjs
CHANGED
|
@@ -178,15 +178,28 @@ const o = {
|
|
|
178
178
|
"secondary-12": "var(--color-secondary-12)",
|
|
179
179
|
"secondary-fg": "var(--color-secondary-fg)",
|
|
180
180
|
// ═══ NEW: Surface ═══
|
|
181
|
-
"surface-
|
|
182
|
-
"surface-
|
|
183
|
-
"surface-
|
|
184
|
-
"surface-
|
|
181
|
+
"surface-base": "var(--color-surface-base)",
|
|
182
|
+
"surface-sunken": "var(--color-surface-sunken)",
|
|
183
|
+
"surface-raised": "var(--color-surface-raised)",
|
|
184
|
+
"surface-overlay": "var(--color-surface-overlay)",
|
|
185
|
+
"surface-raised-hover": "var(--color-surface-raised-hover)",
|
|
186
|
+
"surface-raised-active": "var(--color-surface-raised-active)",
|
|
187
|
+
"surface-inverted": "var(--color-surface-inverted)",
|
|
188
|
+
"surface-inverted-fg": "var(--color-surface-inverted-fg)",
|
|
189
|
+
"surface-disabled": "var(--color-surface-disabled)",
|
|
190
|
+
"surface-fg-disabled": "var(--color-surface-fg-disabled)",
|
|
191
|
+
// Deprecated — remove in next major
|
|
192
|
+
"surface-1": "var(--color-surface-base)",
|
|
193
|
+
"surface-2": "var(--color-surface-raised)",
|
|
194
|
+
"surface-3": "var(--color-surface-raised-hover)",
|
|
195
|
+
"surface-4": "var(--color-surface-raised-active)",
|
|
185
196
|
"surface-fg": "var(--color-surface-fg)",
|
|
186
197
|
"surface-fg-muted": "var(--color-surface-fg-muted)",
|
|
187
198
|
"surface-fg-subtle": "var(--color-surface-fg-subtle)",
|
|
188
199
|
"surface-border": "var(--color-surface-border)",
|
|
189
200
|
"surface-border-strong": "var(--color-surface-border-strong)",
|
|
201
|
+
"surface-border-subtle": "var(--color-surface-border-subtle)",
|
|
202
|
+
backdrop: "var(--color-backdrop)",
|
|
190
203
|
// ═══ NEW: Status (step subsets) ═══
|
|
191
204
|
"error-3": "var(--color-error-3)",
|
|
192
205
|
"error-7": "var(--color-error-7)",
|
|
@@ -310,12 +323,21 @@ const o = {
|
|
|
310
323
|
"gradient-brand-dark": "var(--gradient-brand-dark)"
|
|
311
324
|
},
|
|
312
325
|
boxShadow: {
|
|
313
|
-
|
|
314
|
-
"
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
326
|
+
raised: "var(--shadow-raised)",
|
|
327
|
+
"raised-hover": "var(--shadow-raised-hover)",
|
|
328
|
+
floating: "var(--shadow-floating)",
|
|
329
|
+
overlay: "var(--shadow-overlay)",
|
|
330
|
+
brand: "var(--shadow-brand)",
|
|
331
|
+
glow: "var(--shadow-glow)",
|
|
332
|
+
inset: "var(--shadow-inset)",
|
|
333
|
+
"ring-sm": "var(--shadow-ring-sm)",
|
|
334
|
+
ring: "var(--shadow-ring)",
|
|
335
|
+
// Deprecated — remove in next major
|
|
336
|
+
"01": "var(--shadow-raised)",
|
|
337
|
+
"02": "var(--shadow-raised-hover)",
|
|
338
|
+
"03": "var(--shadow-floating)",
|
|
339
|
+
"04": "var(--shadow-overlay)",
|
|
340
|
+
"05": "var(--shadow-overlay)"
|
|
319
341
|
},
|
|
320
342
|
transitionDuration: {
|
|
321
343
|
instant: "var(--duration-instant)",
|
|
@@ -358,7 +380,7 @@ const o = {
|
|
|
358
380
|
".focus-ring": {
|
|
359
381
|
"&:focus-visible": {
|
|
360
382
|
outline: "none",
|
|
361
|
-
"box-shadow": "0 0 0 2px var(--color-surface-
|
|
383
|
+
"box-shadow": "0 0 0 2px var(--color-surface-base), 0 0 0 4px var(--color-accent-9)"
|
|
362
384
|
}
|
|
363
385
|
},
|
|
364
386
|
".focus-ring-inset": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../src/tailwind/preset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,QAAA,MAAM,MAAM,EAAE,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../src/tailwind/preset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,QAAA,MAAM,MAAM,EAAE,OAAO,CAAC,MAAM,CAuZ3B,CAAA;AAED,eAAe,MAAM,CAAA"}
|