jenosize-ui 0.1.0 → 0.2.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.
- package/README.md +13 -10
- package/dist/Cartesian-ZIKPEYWP.d.ts +26 -0
- package/dist/{PaymentInput-CKPIPNWH.d.ts → PaymentInput-Dn5WVQVy.d.ts} +4 -0
- package/dist/{Select-CVbEQ2Ep.d.ts → Select-Dt5ARIH8.d.ts} +4 -0
- package/dist/{TagInput-CTJYOB4J.d.ts → TagInput-BaBeve6L.d.ts} +4 -0
- package/dist/area-chart.d.ts +54 -0
- package/dist/area-chart.js +9 -0
- package/dist/avatar.d.ts +24 -0
- package/dist/avatar.js +13 -7
- package/dist/badge.d.ts +4 -0
- package/dist/badge.js +6 -5
- package/dist/bar-chart.d.ts +32 -0
- package/dist/bar-chart.js +9 -0
- package/dist/breadcrumb.d.ts +4 -0
- package/dist/breadcrumb.js +5 -3
- package/dist/button.d.ts +16 -1
- package/dist/button.js +10 -8
- package/dist/calendar.d.ts +5 -0
- package/dist/calendar.js +18 -14
- package/dist/callout.d.ts +6 -6
- package/dist/callout.js +12 -9
- package/dist/card-D56VxyAe.d.ts +123 -0
- package/dist/card.d.ts +3 -1
- package/dist/card.js +7 -3
- package/dist/checkbox.js +9 -7
- package/dist/chunk-22M75A3N.js +396 -0
- package/dist/{chunk-D5BTFSL7.js → chunk-33TOK7ES.js} +7 -5
- package/dist/{chunk-THC2ISYP.js → chunk-3H444OJA.js} +6 -4
- package/dist/{chunk-GFOAJVW5.js → chunk-3QXLIZIX.js} +4 -13
- package/dist/chunk-3ZEEGXYF.js +8 -0
- package/dist/chunk-45Y2ZGNK.js +34 -0
- package/dist/{chunk-FHHAPGCR.js → chunk-4RBIWI2Q.js} +3 -3
- package/dist/chunk-4VGEJG4M.js +1510 -0
- package/dist/{chunk-PWKWNDBS.js → chunk-54SIZR63.js} +16 -8
- package/dist/chunk-5AZKP4KZ.js +49 -0
- package/dist/chunk-5DP7W5HX.js +254 -0
- package/dist/{chunk-J2BCKBHC.js → chunk-5KSD4WKN.js} +14 -5
- package/dist/{chunk-ZOOX3TUB.js → chunk-5XPMY2LF.js} +6 -6
- package/dist/chunk-5ZEUTSCV.js +147 -0
- package/dist/chunk-5ZPUAGOP.js +19 -0
- package/dist/{chunk-JTNFJLIY.js → chunk-667ZHY3T.js} +114 -42
- package/dist/{chunk-JP26LPCY.js → chunk-6B6BWTXC.js} +30 -13
- package/dist/{chunk-W5GGOUUI.js → chunk-6H4LNWQ7.js} +3 -3
- package/dist/{chunk-WFY7DKQD.js → chunk-6MMBQVRO.js} +61 -51
- package/dist/{chunk-7HOIZ3UO.js → chunk-7GUPNTAH.js} +15 -7
- package/dist/chunk-7VLYQR4D.js +44 -0
- package/dist/{chunk-KNYKWUYX.js → chunk-7ZM7SNCZ.js} +3 -3
- package/dist/{chunk-E7ZSWBAK.js → chunk-A323V6AI.js} +6 -4
- package/dist/chunk-AFYXSZGW.js +23 -0
- package/dist/chunk-AIARANKE.js +33 -0
- package/dist/{chunk-4OLULPQG.js → chunk-AIGYMTCU.js} +10 -6
- package/dist/{chunk-JVJRHBTD.js → chunk-AZ7DKRBY.js} +21 -8
- package/dist/{chunk-JYGR44ZC.js → chunk-BBKE4W3B.js} +19 -11
- package/dist/{chunk-Z3ETJN5G.js → chunk-BFVJHH7S.js} +8 -12
- package/dist/chunk-BLIZ3CL3.js +49 -0
- package/dist/{chunk-F2K7VJUV.js → chunk-CFFWYXDW.js} +19 -7
- package/dist/{chunk-MQGD2OUF.js → chunk-CGHYXWTT.js} +11 -5
- package/dist/{chunk-CYPPEUX5.js → chunk-CKMWBVRR.js} +27 -12
- package/dist/{chunk-GTHJWR3Q.js → chunk-D7EE5GWU.js} +21 -22
- package/dist/{chunk-5NOBSXJN.js → chunk-E2YZ7IMT.js} +24 -8
- package/dist/{chunk-T7FCG7XV.js → chunk-FFMTYQXE.js} +31 -11
- package/dist/{chunk-J36M3KRX.js → chunk-FH7Z7SGQ.js} +67 -32
- package/dist/chunk-FKVPAEJ6.js +57 -0
- package/dist/{chunk-GRLSUQQE.js → chunk-FNQJJO63.js} +4 -4
- package/dist/{chunk-5RAPA22E.js → chunk-FWRHBMWT.js} +4 -4
- package/dist/chunk-GLKFFA7N.js +171 -0
- package/dist/{chunk-KDLPXXD2.js → chunk-GQRSABRN.js} +4 -4
- package/dist/{chunk-DRZCJCBO.js → chunk-GZMDZF2V.js} +8 -7
- package/dist/chunk-HHYEAFCL.js +525 -0
- package/dist/{chunk-LME57Z6J.js → chunk-I6WMNXC7.js} +6 -6
- package/dist/chunk-IQNVSQRK.js +605 -0
- package/dist/chunk-KHGW72BM.js +10 -0
- package/dist/{chunk-ZZA2LUTL.js → chunk-KZP6B6B3.js} +41 -16
- package/dist/chunk-LCG34A5T.js +98 -0
- package/dist/chunk-LLPWQDF7.js +26 -0
- package/dist/{chunk-J7ZQQFPT.js → chunk-LO22VQL5.js} +18 -18
- package/dist/{chunk-BVJWBYIG.js → chunk-LQURV7HQ.js} +9 -7
- package/dist/{chunk-R6RGJF4L.js → chunk-LYXPJERB.js} +15 -5
- package/dist/{chunk-CME4DIML.js → chunk-MCQG4H6T.js} +54 -3
- package/dist/{chunk-VWC72TR3.js → chunk-MVG5MABV.js} +11 -8
- package/dist/{chunk-5FATN5YD.js → chunk-N3RVMBPX.js} +6 -9
- package/dist/chunk-NKG4N6HA.js +188 -0
- package/dist/{chunk-W46K56XU.js → chunk-OACWA4TC.js} +15 -69
- package/dist/chunk-OLLD2BZN.js +33 -0
- package/dist/{chunk-KMSYEE23.js → chunk-P6CON2R2.js} +25 -11
- package/dist/chunk-PO2TYK3C.js +17 -0
- package/dist/{chunk-7EWQKTNQ.js → chunk-POQTE7JI.js} +66 -25
- package/dist/{chunk-HMUZE6EK.js → chunk-QDKETK7D.js} +4 -4
- package/dist/{chunk-GCVA3OIV.js → chunk-QDYE5LVT.js} +13 -3
- package/dist/{chunk-WEUJYDCV.js → chunk-QHH6AUR3.js} +16 -8
- package/dist/chunk-RJTVCA62.js +42 -0
- package/dist/{chunk-MUFHLP4S.js → chunk-S5TEWPWW.js} +50 -41
- package/dist/{chunk-D6TPWNRK.js → chunk-SB3DG572.js} +15 -8
- package/dist/chunk-SKRR3ZMP.js +10 -0
- package/dist/chunk-T4ZFZTY6.js +62 -0
- package/dist/{chunk-I7WU4GTY.js → chunk-T5574MXM.js} +34 -46
- package/dist/{chunk-MKC5HNA7.js → chunk-U4WSJAYK.js} +374 -147
- package/dist/{chunk-BJUZVYQC.js → chunk-UGKELBNC.js} +60 -44
- package/dist/chunk-ULGCGKOE.js +77 -0
- package/dist/{chunk-QA74ITR4.js → chunk-X2VMIBK5.js} +45 -17
- package/dist/chunk-X2X7Q7NW.js +17 -0
- package/dist/chunk-YHBI52P2.js +10 -0
- package/dist/chunk-YIHKQ63K.js +13 -0
- package/dist/{chunk-3Y5X7B5C.js → chunk-YQYVGWIC.js} +6 -11
- package/dist/{chunk-WZQFC7ZN.js → chunk-ZHAT2XZ4.js} +139 -66
- package/dist/{chunk-7IU5TMFL.js → chunk-ZMFY7WAY.js} +124 -40
- package/dist/{chunk-SV56BSUQ.js → chunk-ZZSNTCCL.js} +6 -5
- package/dist/combobox.d.ts +5 -0
- package/dist/combobox.js +15 -12
- package/dist/control-size-CaxQhkKh.d.ts +3 -0
- package/dist/date-input.d.ts +4 -0
- package/dist/date-input.js +12 -9
- package/dist/date-picker.d.ts +6 -0
- package/dist/date-picker.js +25 -20
- package/dist/dialog.d.ts +37 -5
- package/dist/dialog.js +12 -8
- package/dist/drawer.d.ts +20 -3
- package/dist/drawer.js +11 -7
- package/dist/dropdown-menu.d.ts +26 -2
- package/dist/dropdown-menu.js +9 -4
- package/dist/dropzone.d.ts +35 -0
- package/dist/dropzone.js +23 -0
- package/dist/form.d.ts +82 -3
- package/dist/form.js +205 -45
- package/dist/header-navigation.d.ts +19 -4
- package/dist/header-navigation.js +23 -16
- package/dist/helper.d.ts +36 -0
- package/dist/helper.js +3 -0
- package/dist/index.d.ts +32 -8
- package/dist/index.js +87 -62
- package/dist/indicator.js +4 -4
- package/dist/input.d.ts +4 -0
- package/dist/input.js +10 -8
- package/dist/kanban-board.d.ts +489 -0
- package/dist/kanban-board.js +25 -0
- package/dist/labels-DPrh0se9.d.ts +627 -0
- package/dist/line-chart.d.ts +36 -0
- package/dist/line-chart.js +9 -0
- package/dist/{nav-Bla0o_-1.d.ts → nav-CKKqjBs6.d.ts} +18 -11
- package/dist/number-input.d.ts +4 -0
- package/dist/number-input.js +10 -8
- package/dist/pagination.d.ts +7 -1
- package/dist/pagination.js +14 -10
- package/dist/panel-El4oI68p.d.ts +9 -0
- package/dist/payment-input.d.ts +3 -2
- package/dist/payment-input.js +10 -8
- package/dist/pie-chart.d.ts +64 -0
- package/dist/pie-chart.js +9 -0
- package/dist/popover.d.ts +9 -3
- package/dist/popover.js +11 -7
- package/dist/progress-steps.d.ts +275 -0
- package/dist/progress-steps.js +8 -0
- package/dist/progress.d.ts +21 -1
- package/dist/progress.js +3 -2
- package/dist/provider.d.ts +212 -0
- package/dist/provider.js +7 -0
- package/dist/radar-chart.d.ts +77 -0
- package/dist/radar-chart.js +9 -0
- package/dist/radial-chart.d.ts +73 -0
- package/dist/radial-chart.js +9 -0
- package/dist/radio.js +9 -7
- package/dist/rule-BqzaIwJy.d.ts +80 -0
- package/dist/scroll-area.d.ts +62 -0
- package/dist/scroll-area.js +7 -0
- package/dist/select.d.ts +3 -3
- package/dist/select.js +17 -14
- package/dist/separator.d.ts +114 -0
- package/dist/separator.js +5 -0
- package/dist/shared-CxAedkiy.d.ts +68 -0
- package/dist/sidebar-navigation.d.ts +80 -12
- package/dist/sidebar-navigation.js +18 -9
- package/dist/skeleton.d.ts +61 -0
- package/dist/skeleton.js +5 -0
- package/dist/styles.css +1 -1
- package/dist/switch.js +4 -4
- package/dist/table.d.ts +148 -42
- package/dist/table.js +39 -33
- package/dist/tabs.d.ts +22 -0
- package/dist/tabs.js +3 -3
- package/dist/tag-input.d.ts +3 -2
- package/dist/tag-input.js +13 -11
- package/dist/tag.d.ts +4 -0
- package/dist/tag.js +4 -3
- package/dist/textarea.js +7 -5
- package/dist/theme.css +151 -6
- package/dist/theme.js +11 -9
- package/dist/toast.d.ts +11 -2
- package/dist/toast.js +12 -9
- package/dist/tooltip-surface-C2I9o2QM.d.ts +35 -0
- package/dist/tooltip.d.ts +15 -1
- package/dist/tooltip.js +3 -2
- package/dist/tree.d.ts +5 -0
- package/dist/tree.js +8 -6
- package/dist/types-DR9rAEy1.d.ts +188 -0
- package/dist/use-uploads-KaPqDklo.d.ts +482 -0
- package/dist/verification-code-input.d.ts +84 -0
- package/dist/verification-code-input.js +14 -0
- package/package.json +70 -9
- package/dist/card-nWicloNi.d.ts +0 -80
- package/dist/chunk-24TO7E32.js +0 -42
- package/dist/chunk-FXIBGTS5.js +0 -14
- package/dist/chunk-MFJP5FA7.js +0 -20
- package/dist/chunk-ZZT2E5VT.js +0 -24
- package/dist/shared-BNXAdgh2.d.ts +0 -9
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { Indicator } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Indicator } from './chunk-N3RVMBPX.js';
|
|
2
|
+
import { Skeleton } from './chunk-LLPWQDF7.js';
|
|
3
|
+
import { ScrollView } from './chunk-FKVPAEJ6.js';
|
|
4
|
+
import { TooltipExport } from './chunk-KZP6B6B3.js';
|
|
4
5
|
import { POPUP_MOTION } from './chunk-O4GRKO3I.js';
|
|
5
|
-
import {
|
|
6
|
+
import { PlusIcon, UserIcon, CheckIcon } from './chunk-BLIZ3CL3.js';
|
|
6
7
|
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
8
|
+
import { useLabels } from './chunk-RJTVCA62.js';
|
|
9
|
+
import { warnExclusive, devWarn } from './chunk-QDYE5LVT.js';
|
|
7
10
|
import * as React4 from 'react';
|
|
8
11
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
12
|
import { Avatar as Avatar$1 } from '@base-ui/react/avatar';
|
|
@@ -38,6 +41,72 @@ function AvatarAddButton(props) {
|
|
|
38
41
|
) });
|
|
39
42
|
}
|
|
40
43
|
|
|
44
|
+
// src/components/avatar/labels.ts
|
|
45
|
+
var AVATAR_LABELS = {
|
|
46
|
+
/** The verified indicator's accessible name — the one Avatar marker that carries meaning. */
|
|
47
|
+
verified: "Verified",
|
|
48
|
+
/** The `+N` tile's trigger, when the group's overflow opens a list. */
|
|
49
|
+
showMore: (ctx) => `Show ${ctx.count} more`,
|
|
50
|
+
/** The `+N` tile itself, which is a `role="img"` and needs a name of its own. */
|
|
51
|
+
overflowCount: (ctx) => `${ctx.count} more`,
|
|
52
|
+
/** The overflow list with nothing in it. */
|
|
53
|
+
empty: "No one to show",
|
|
54
|
+
/** A revealed avatar that carries no `name`. */
|
|
55
|
+
unknownName: "Unknown",
|
|
56
|
+
/** The presence dot's two states — the marker is a dot, so its name is all it says. */
|
|
57
|
+
online: "Online",
|
|
58
|
+
offline: "Offline"
|
|
59
|
+
};
|
|
60
|
+
var GLOSS_MASK = "linear-gradient(to bottom, black 0%, transparent 25%, transparent 75%, black 100%)";
|
|
61
|
+
function ContrastBorder({
|
|
62
|
+
radius,
|
|
63
|
+
gloss = false,
|
|
64
|
+
hairline = "0.5",
|
|
65
|
+
glossWidth = "1"
|
|
66
|
+
}) {
|
|
67
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
"span",
|
|
70
|
+
{
|
|
71
|
+
"aria-hidden": "true",
|
|
72
|
+
className: cn(
|
|
73
|
+
"pointer-events-none absolute inset-0 outline outline-black/16",
|
|
74
|
+
hairline === "0.75" ? "outline-[0.75px] -outline-offset-[0.75px]" : "outline-[0.5px] -outline-offset-[0.5px]",
|
|
75
|
+
radius
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
gloss ? /* @__PURE__ */ jsx(
|
|
80
|
+
"span",
|
|
81
|
+
{
|
|
82
|
+
"aria-hidden": "true",
|
|
83
|
+
style: { maskImage: GLOSS_MASK, WebkitMaskImage: GLOSS_MASK },
|
|
84
|
+
className: cn("pointer-events-none absolute inset-0 border-white/32", glossWidth === "1.5" ? "border-[1.5px]" : "border", radius)
|
|
85
|
+
}
|
|
86
|
+
) : null
|
|
87
|
+
] });
|
|
88
|
+
}
|
|
89
|
+
function AvatarIndicator({ badge, verified, status, count, boxClass, dotClass, positionClass = "right-0 bottom-0" }) {
|
|
90
|
+
const pos = cn("absolute", positionClass);
|
|
91
|
+
const t = useLabels("avatar", AVATAR_LABELS, void 0);
|
|
92
|
+
if (badge != null) return /* @__PURE__ */ jsx(Indicator, { icon: badge, color: "brand", bordered: true, className: cn(pos, boxClass) });
|
|
93
|
+
if (verified) return /* @__PURE__ */ jsx(Indicator, { shape: "scalloped", color: "info", icon: /* @__PURE__ */ jsx(CheckIcon, {}), label: t.verified, className: cn(pos, boxClass) });
|
|
94
|
+
if (status != null) {
|
|
95
|
+
return /* @__PURE__ */ jsx(
|
|
96
|
+
Indicator,
|
|
97
|
+
{
|
|
98
|
+
raised: true,
|
|
99
|
+
bordered: true,
|
|
100
|
+
color: status === "online" ? "success" : "neutral",
|
|
101
|
+
label: status === "online" ? t.online : t.offline,
|
|
102
|
+
className: cn(pos, dotClass)
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
if (count != null) return /* @__PURE__ */ jsx(Indicator, { count, bordered: true, className: cn(pos, boxClass) });
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
|
|
41
110
|
// src/components/avatar/shared.ts
|
|
42
111
|
var AVATAR_SIZE = {
|
|
43
112
|
xxs: { box: "size-4", text: "text-xs", icon: "size-2.5", dot: "size-1" },
|
|
@@ -62,13 +131,6 @@ var BORDER_PAD = {
|
|
|
62
131
|
xl: "p-0.5",
|
|
63
132
|
"2xl": "p-0.5"
|
|
64
133
|
};
|
|
65
|
-
var STATUS = {
|
|
66
|
-
// Untitled UI online dot = success-500 (the dedicated --color-fg-success-secondary role,
|
|
67
|
-
// one step brighter than the success-600 solid fill).
|
|
68
|
-
online: { dot: "bg-fg-success-secondary", label: "Online" },
|
|
69
|
-
// Light neutral dot (≈ gray-300) — a touch lighter than `fg-subtle`/gray-500.
|
|
70
|
-
offline: { dot: "bg-border-primary", label: "Offline" }
|
|
71
|
-
};
|
|
72
134
|
var INDICATOR_BOX = {
|
|
73
135
|
xxs: "size-2",
|
|
74
136
|
xs: "size-2.5",
|
|
@@ -84,45 +146,6 @@ function getInitials(name) {
|
|
|
84
146
|
if (parts.length === 1) return parts[0].charAt(0).toUpperCase();
|
|
85
147
|
return (parts[0].charAt(0) + parts.at(-1).charAt(0)).toUpperCase();
|
|
86
148
|
}
|
|
87
|
-
var GLOSS_MASK = "linear-gradient(to bottom, black 0%, transparent 25%, transparent 75%, black 100%)";
|
|
88
|
-
function ContrastBorder({
|
|
89
|
-
radius,
|
|
90
|
-
gloss = false,
|
|
91
|
-
hairline = "0.5",
|
|
92
|
-
glossWidth = "1"
|
|
93
|
-
}) {
|
|
94
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
95
|
-
/* @__PURE__ */ jsx(
|
|
96
|
-
"span",
|
|
97
|
-
{
|
|
98
|
-
"aria-hidden": "true",
|
|
99
|
-
className: cn(
|
|
100
|
-
"pointer-events-none absolute inset-0 outline outline-black/16",
|
|
101
|
-
hairline === "0.75" ? "outline-[0.75px] -outline-offset-[0.75px]" : "outline-[0.5px] -outline-offset-[0.5px]",
|
|
102
|
-
radius
|
|
103
|
-
)
|
|
104
|
-
}
|
|
105
|
-
),
|
|
106
|
-
gloss ? /* @__PURE__ */ jsx(
|
|
107
|
-
"span",
|
|
108
|
-
{
|
|
109
|
-
"aria-hidden": "true",
|
|
110
|
-
style: { maskImage: GLOSS_MASK, WebkitMaskImage: GLOSS_MASK },
|
|
111
|
-
className: cn("pointer-events-none absolute inset-0 border-white/32", glossWidth === "1.5" ? "border-[1.5px]" : "border", radius)
|
|
112
|
-
}
|
|
113
|
-
) : null
|
|
114
|
-
] });
|
|
115
|
-
}
|
|
116
|
-
function AvatarIndicator({ badge, verified, status, count, boxClass, dotClass, positionClass = "right-0 bottom-0" }) {
|
|
117
|
-
const pos = cn("absolute", positionClass);
|
|
118
|
-
if (badge != null) return /* @__PURE__ */ jsx(Indicator, { icon: badge, color: "brand", bordered: true, className: cn(pos, boxClass) });
|
|
119
|
-
if (verified) return /* @__PURE__ */ jsx(Indicator, { shape: "scalloped", color: "info", icon: /* @__PURE__ */ jsx(CheckIcon, {}), label: "Verified", className: cn(pos, boxClass) });
|
|
120
|
-
if (status != null) {
|
|
121
|
-
return /* @__PURE__ */ jsx(Indicator, { raised: true, bordered: true, color: status === "online" ? "success" : "neutral", label: STATUS[status].label, className: cn(pos, dotClass) });
|
|
122
|
-
}
|
|
123
|
-
if (count != null) return /* @__PURE__ */ jsx(Indicator, { count, bordered: true, className: cn(pos, boxClass) });
|
|
124
|
-
return null;
|
|
125
|
-
}
|
|
126
149
|
var FALLBACK_DELAY = 600;
|
|
127
150
|
function Avatar(props) {
|
|
128
151
|
const {
|
|
@@ -220,7 +243,20 @@ var OVERLAP = {
|
|
|
220
243
|
"2xl": { normal: "-ml-4", tight: "-ml-7" }
|
|
221
244
|
};
|
|
222
245
|
function AvatarGroup(props) {
|
|
223
|
-
const {
|
|
246
|
+
const {
|
|
247
|
+
max,
|
|
248
|
+
total,
|
|
249
|
+
size = "md",
|
|
250
|
+
shape = "circle",
|
|
251
|
+
spacing = "normal",
|
|
252
|
+
"aria-label": ariaLabel,
|
|
253
|
+
onReveal,
|
|
254
|
+
revealing = false,
|
|
255
|
+
labels,
|
|
256
|
+
children,
|
|
257
|
+
className
|
|
258
|
+
} = props;
|
|
259
|
+
const t = useLabels("avatar", AVATAR_LABELS, labels);
|
|
224
260
|
if (!ariaLabel) devWarn("<AvatarGroup> should have an `aria-label` to name the list of avatars.");
|
|
225
261
|
const items = React4.Children.toArray(children).filter(React4.isValidElement);
|
|
226
262
|
const limit = max != null ? Math.max(0, max) : items.length;
|
|
@@ -257,7 +293,7 @@ function AvatarGroup(props) {
|
|
|
257
293
|
/* @__PURE__ */ jsxs(
|
|
258
294
|
Popover.Trigger,
|
|
259
295
|
{
|
|
260
|
-
"aria-label":
|
|
296
|
+
"aria-label": t.showMore({ count: overflow }),
|
|
261
297
|
className: cn(
|
|
262
298
|
tile,
|
|
263
299
|
"cursor-pointer transition-colors duration-100 ease-linear outline-none hover:bg-quaternary focus-visible:ring-2 focus-visible:ring-focus-ring"
|
|
@@ -271,20 +307,17 @@ function AvatarGroup(props) {
|
|
|
271
307
|
/* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, { side: "top", sideOffset: 8, className: "z-50 outline-none", children: /* @__PURE__ */ jsx(
|
|
272
308
|
Popover.Popup,
|
|
273
309
|
{
|
|
274
|
-
className: cn(
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
children: /* @__PURE__ */ jsx("ul", { role: "list", "aria-busy": revealing || void 0, className: "flex flex-col gap-0.5", children: revealing ? Array.from({ length: pendingRows }, (_, i) => /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2 rounded-md px-2 py-1.5", children: [
|
|
279
|
-
/* @__PURE__ */ jsx("span", { className: cn("animate-pulse bg-tertiary", AVATAR_SIZE.sm.box, radius) }),
|
|
280
|
-
/* @__PURE__ */ jsx("span", { className: "h-3 w-24 animate-pulse rounded-full bg-tertiary" })
|
|
310
|
+
className: cn("min-w-36 rounded-lg bg-primary p-1 text-sm text-primary shadow-lg ring-1 ring-secondary_alt ring-inset", POPUP_MOTION),
|
|
311
|
+
children: /* @__PURE__ */ jsx(ScrollView, { viewportClassName: "max-h-72", children: /* @__PURE__ */ jsx("ul", { role: "list", "aria-busy": revealing || void 0, className: "flex flex-col gap-0.5", children: revealing ? Array.from({ length: pendingRows }, (_, i) => /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2 rounded-md px-2 py-1.5", children: [
|
|
312
|
+
/* @__PURE__ */ jsx(Skeleton, { className: cn(AVATAR_SIZE.sm.box, radius) }),
|
|
313
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-24" })
|
|
281
314
|
] }, i)) : hidden.length > 0 ? hidden.map((child, i) => /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2 rounded-md px-2 py-1.5", children: [
|
|
282
315
|
React4.cloneElement(child, { size: "sm", shape }),
|
|
283
|
-
/* @__PURE__ */ jsx("span", { className: "truncate text-secondary", children: child.props.name ??
|
|
284
|
-
] }, i)) : /* @__PURE__ */ jsx("li", { className: "px-2 py-1.5 text-tertiary", children:
|
|
316
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-secondary", children: child.props.name ?? t.unknownName })
|
|
317
|
+
] }, i)) : /* @__PURE__ */ jsx("li", { className: "px-2 py-1.5 text-tertiary", children: t.empty }) }) })
|
|
285
318
|
}
|
|
286
319
|
) }) })
|
|
287
|
-
] }) : /* @__PURE__ */ jsxs("span", { role: "img", "aria-label":
|
|
320
|
+
] }) : /* @__PURE__ */ jsxs("span", { role: "img", "aria-label": t.overflowCount({ count: overflow }), className: tile, children: [
|
|
288
321
|
"+",
|
|
289
322
|
overflow
|
|
290
323
|
] }) }) : null
|
|
@@ -300,8 +333,27 @@ var LABEL_GAP = {
|
|
|
300
333
|
md: "gap-2",
|
|
301
334
|
lg: "gap-2"
|
|
302
335
|
};
|
|
336
|
+
var LABEL_SKELETON = {
|
|
337
|
+
sm: { title: "h-3.5 w-24", subtitle: "h-3 w-32" },
|
|
338
|
+
md: { title: "h-3.5 w-28", subtitle: "h-3.5 w-36" },
|
|
339
|
+
lg: { title: "h-4 w-32", subtitle: "h-4 w-40" }
|
|
340
|
+
};
|
|
303
341
|
function AvatarLabelGroup(props) {
|
|
304
|
-
const { src, alt, title, subtitle, size = "md", shape = "circle", status, verified, placeholderIcon, imageProps, className } = props;
|
|
342
|
+
const { src, alt, title, subtitle, size = "md", shape = "circle", status, verified, placeholderIcon, imageProps, loading = false, className } = props;
|
|
343
|
+
if (loading) {
|
|
344
|
+
const bars = LABEL_SKELETON[size];
|
|
345
|
+
return (
|
|
346
|
+
// `aria-busy` on the region, never on the bars — they are `aria-hidden`, so this is the one
|
|
347
|
+
// place the "loading" state is announced (see `src/components/skeleton/Skeleton.tsx`).
|
|
348
|
+
/* @__PURE__ */ jsxs("div", { "aria-busy": "true", className: cn("inline-flex items-center", LABEL_GAP[size], className), children: [
|
|
349
|
+
/* @__PURE__ */ jsx(Skeleton, { shape: shape === "circle" ? "circle" : "bar", className: cn(AVATAR_SIZE[size].box, shape === "square" && AVATAR_SHAPE.square) }),
|
|
350
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1.5", children: [
|
|
351
|
+
/* @__PURE__ */ jsx(Skeleton, { className: bars.title }),
|
|
352
|
+
/* @__PURE__ */ jsx(Skeleton, { className: bars.subtitle })
|
|
353
|
+
] })
|
|
354
|
+
] })
|
|
355
|
+
);
|
|
356
|
+
}
|
|
305
357
|
const text = LABEL_TEXT[size];
|
|
306
358
|
const name = typeof title === "string" ? title : void 0;
|
|
307
359
|
return /* @__PURE__ */ jsxs("div", { className: cn("inline-flex items-center", LABEL_GAP[size], className), children: [
|
|
@@ -378,7 +430,21 @@ var SHAPE = {
|
|
|
378
430
|
square: "rounded-2xl"
|
|
379
431
|
};
|
|
380
432
|
function AvatarProfilePhoto(props) {
|
|
381
|
-
const {
|
|
433
|
+
const {
|
|
434
|
+
src,
|
|
435
|
+
alt,
|
|
436
|
+
name,
|
|
437
|
+
size = "md",
|
|
438
|
+
shape = "circle",
|
|
439
|
+
status,
|
|
440
|
+
verified = false,
|
|
441
|
+
placeholderIcon,
|
|
442
|
+
placeholder,
|
|
443
|
+
badge,
|
|
444
|
+
imageProps,
|
|
445
|
+
loading = false,
|
|
446
|
+
className
|
|
447
|
+
} = props;
|
|
382
448
|
const [imageLoaded, setImageLoaded] = React4.useState(false);
|
|
383
449
|
const showImage = src != null && imageLoaded;
|
|
384
450
|
const hasName = typeof name === "string" && name.trim().length > 0;
|
|
@@ -390,6 +456,13 @@ function AvatarProfilePhoto(props) {
|
|
|
390
456
|
["verified", verified],
|
|
391
457
|
["status", status != null]
|
|
392
458
|
]);
|
|
459
|
+
if (loading) {
|
|
460
|
+
return (
|
|
461
|
+
// `aria-busy` on the region, never on the bar — it is `aria-hidden`, so this is the one place
|
|
462
|
+
// the "loading" state is announced (see `src/components/skeleton/Skeleton.tsx`).
|
|
463
|
+
/* @__PURE__ */ jsx("div", { "aria-busy": "true", className: cn("inline-flex shrink-0", className), children: /* @__PURE__ */ jsx(Skeleton, { shape: shape === "circle" ? "circle" : "bar", className: cn(sizing.box, shape === "square" && SHAPE.square) }) })
|
|
464
|
+
);
|
|
465
|
+
}
|
|
393
466
|
return /* @__PURE__ */ jsxs(
|
|
394
467
|
Avatar$1.Root,
|
|
395
468
|
{
|
|
@@ -444,5 +517,5 @@ function AvatarProfilePhoto(props) {
|
|
|
444
517
|
}
|
|
445
518
|
|
|
446
519
|
export { Avatar, AvatarAddButton, AvatarGroup, AvatarLabelGroup, AvatarProfilePhoto };
|
|
447
|
-
//# sourceMappingURL=chunk-
|
|
448
|
-
//# sourceMappingURL=chunk-
|
|
520
|
+
//# sourceMappingURL=chunk-ZHAT2XZ4.js.map
|
|
521
|
+
//# sourceMappingURL=chunk-ZHAT2XZ4.js.map
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { DropdownMenu } from './chunk-6B6BWTXC.js';
|
|
2
|
+
import { SKELETON_WIDTHS, Skeleton } from './chunk-LLPWQDF7.js';
|
|
3
|
+
import { ScrollView } from './chunk-FKVPAEJ6.js';
|
|
4
|
+
import { Separator } from './chunk-7VLYQR4D.js';
|
|
5
|
+
import { useLinkElement, LinkOrButton } from './chunk-5AZKP4KZ.js';
|
|
6
|
+
import { ButtonUtility } from './chunk-AZ7DKRBY.js';
|
|
7
|
+
import { useIsomorphicLayoutEffect } from './chunk-EDSK6FEH.js';
|
|
4
8
|
import { Slot } from './chunk-52IFGFTL.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { devWarn } from './chunk-GCVA3OIV.js';
|
|
9
|
+
import { TooltipExport } from './chunk-KZP6B6B3.js';
|
|
10
|
+
import { PanelLeftIcon, ChevronRightIcon, ChevronDownIcon } from './chunk-BLIZ3CL3.js';
|
|
8
11
|
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
12
|
+
import { useLabels } from './chunk-RJTVCA62.js';
|
|
13
|
+
import { devWarn } from './chunk-QDYE5LVT.js';
|
|
9
14
|
import * as React from 'react';
|
|
10
15
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
16
|
|
|
@@ -36,7 +41,7 @@ function readStored(storageKey, fallback) {
|
|
|
36
41
|
}
|
|
37
42
|
function SidebarProvider(props) {
|
|
38
43
|
const { collapsed: controlled, defaultCollapsed = false, onCollapsedChange, storageKey, shortcut = true, collapseBelow, children } = props;
|
|
39
|
-
const [uncontrolled, setUncontrolled] = React.useState(
|
|
44
|
+
const [uncontrolled, setUncontrolled] = React.useState(defaultCollapsed);
|
|
40
45
|
const collapsed = controlled ?? uncontrolled;
|
|
41
46
|
const collapsedRef = React.useRef(collapsed);
|
|
42
47
|
collapsedRef.current = collapsed;
|
|
@@ -57,6 +62,11 @@ function SidebarProvider(props) {
|
|
|
57
62
|
);
|
|
58
63
|
const setCollapsed = React.useCallback((next) => commit(next, true), [commit]);
|
|
59
64
|
const toggle = React.useCallback(() => commit(!collapsedRef.current, true), [commit]);
|
|
65
|
+
useIsomorphicLayoutEffect(() => {
|
|
66
|
+
if (controlled !== void 0 || !storageKey) return;
|
|
67
|
+
const stored = readStored(storageKey, defaultCollapsed);
|
|
68
|
+
setUncontrolled((current) => current === stored ? current : stored);
|
|
69
|
+
}, [controlled, storageKey]);
|
|
60
70
|
React.useEffect(() => {
|
|
61
71
|
if (!shortcut) return;
|
|
62
72
|
const onKeyDown = (event) => {
|
|
@@ -67,7 +77,7 @@ function SidebarProvider(props) {
|
|
|
67
77
|
document.addEventListener("keydown", onKeyDown);
|
|
68
78
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
69
79
|
}, [shortcut, commit]);
|
|
70
|
-
|
|
80
|
+
useIsomorphicLayoutEffect(() => {
|
|
71
81
|
if (!collapseBelow || typeof window === "undefined" || !globalThis.matchMedia) return;
|
|
72
82
|
const query = globalThis.matchMedia(BREAKPOINT_QUERY[collapseBelow]);
|
|
73
83
|
const apply = () => commit(query.matches, false);
|
|
@@ -146,6 +156,12 @@ function resolveActive(items, activeHref) {
|
|
|
146
156
|
}
|
|
147
157
|
return { current: best, trail: new Set(bestTrail) };
|
|
148
158
|
}
|
|
159
|
+
|
|
160
|
+
// src/components/sidebar-navigation/labels.ts
|
|
161
|
+
var SIDEBAR_NAVIGATION_LABELS = {
|
|
162
|
+
expand: "Expand sidebar",
|
|
163
|
+
collapse: "Collapse sidebar"
|
|
164
|
+
};
|
|
149
165
|
var ROW_WRAP = "group/row relative flex items-center";
|
|
150
166
|
var ROW_BASE = "relative flex min-w-0 flex-1 cursor-pointer items-center rounded-lg p-2 text-left outline-focus-ring transition-colors duration-100 ease-linear select-none focus-visible:z-10 focus-visible:outline-2 focus-visible:outline-offset-2";
|
|
151
167
|
var ROW_IDLE = "group-hover/row:bg-secondary";
|
|
@@ -178,10 +194,6 @@ var NEST = {
|
|
|
178
194
|
};
|
|
179
195
|
var GUIDE_DOT = "absolute top-1/2 left-4 size-1 -translate-y-1/2 rounded-full bg-current";
|
|
180
196
|
var GUIDE_DOT_ROW = "-ml-7 pl-9";
|
|
181
|
-
var SEPARATOR_VARIANT = {
|
|
182
|
-
line: "h-px bg-border-secondary",
|
|
183
|
-
dot: "h-0.5 bg-[image:radial-gradient(circle,var(--color-border-secondary)_1px,transparent_1px)] bg-[length:5px_2px] bg-repeat-x"
|
|
184
|
-
};
|
|
185
197
|
var ACTION_BUTTON = "absolute top-1/2 right-1 z-10 grid size-6 -translate-y-1/2 cursor-pointer place-items-center rounded-md outline-focus-ring transition-[opacity,color,background-color] duration-100 ease-linear hover:bg-ghost-hover hover:text-secondary focus-visible:outline-2 focus-visible:outline-offset-1";
|
|
186
198
|
var ACTION_REVEAL = {
|
|
187
199
|
hover: "opacity-0 group-hover/row:opacity-100 focus-visible:opacity-100 aria-expanded:opacity-100",
|
|
@@ -217,6 +229,7 @@ function RowAction({ action, icon }) {
|
|
|
217
229
|
}
|
|
218
230
|
function NavRow({ link, ctx, reserve, dot }) {
|
|
219
231
|
const isCurrent = link === ctx.current;
|
|
232
|
+
const navLink = useLinkElement(link.href);
|
|
220
233
|
const className = cn(
|
|
221
234
|
ROW_BASE,
|
|
222
235
|
dot && GUIDE_DOT_ROW,
|
|
@@ -231,14 +244,7 @@ function NavRow({ link, ctx, reserve, dot }) {
|
|
|
231
244
|
ctx.onNavigate?.(link, event);
|
|
232
245
|
link.onClick?.(event);
|
|
233
246
|
};
|
|
234
|
-
|
|
235
|
-
if (link.disabled) {
|
|
236
|
-
row = /* @__PURE__ */ jsx("span", { "aria-disabled": "true", className, children: content });
|
|
237
|
-
} else if (link.href) {
|
|
238
|
-
row = /* @__PURE__ */ jsx("a", { href: link.href, "aria-current": isCurrent ? "page" : void 0, onClick: handleClick, className, children: content });
|
|
239
|
-
} else {
|
|
240
|
-
row = /* @__PURE__ */ jsx("button", { type: "button", "aria-current": isCurrent ? "page" : void 0, onClick: handleClick, className, children: content });
|
|
241
|
-
}
|
|
247
|
+
const row = link.disabled ? /* @__PURE__ */ jsx("span", { "aria-disabled": "true", className, children: content }) : /* @__PURE__ */ jsx(LinkOrButton, { render: link.render ?? navLink, className, ariaCurrent: isCurrent, onClick: handleClick, children: content });
|
|
242
248
|
return /* @__PURE__ */ jsxs("div", { className: ROW_WRAP, children: [
|
|
243
249
|
row,
|
|
244
250
|
link.action && !link.disabled ? /* @__PURE__ */ jsx(RowAction, { action: link.action, icon }) : null
|
|
@@ -315,13 +321,24 @@ function railTrigger(link, current, accent) {
|
|
|
315
321
|
}
|
|
316
322
|
function RailRow({ link, ctx }) {
|
|
317
323
|
const current = link === ctx.current;
|
|
324
|
+
const railLink = useLinkElement(link.href);
|
|
318
325
|
const className = railClass(link, current, ctx.accent);
|
|
319
326
|
const icon = /* @__PURE__ */ jsx(RailIcon, { link, current, accent: ctx.accent });
|
|
320
327
|
const handleClick = (event) => {
|
|
321
328
|
ctx.onNavigate?.(link, event);
|
|
322
329
|
link.onClick?.(event);
|
|
323
330
|
};
|
|
324
|
-
const element = link.
|
|
331
|
+
const element = link.disabled ? (
|
|
332
|
+
/* Shaped to match `NavRow`'s expanded branch exactly — same element, same one attribute — because
|
|
333
|
+
* these two ARE one row at two widths and the defect was them disagreeing. The label rides an
|
|
334
|
+
* `sr-only` span rather than `aria-label`: this row is icon-only, and a name set on a span with
|
|
335
|
+
* no role is dropped by every screen reader, so the rail would go from wrongly-usable to
|
|
336
|
+
* correctly-inert but nameless. (`link.label` is caller data, not authored copy.) */
|
|
337
|
+
/* @__PURE__ */ jsxs("span", { "aria-disabled": "true", className, children: [
|
|
338
|
+
icon,
|
|
339
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: link.label })
|
|
340
|
+
] })
|
|
341
|
+
) : /* @__PURE__ */ jsx(LinkOrButton, { render: link.render ?? railLink, className, ariaCurrent: current, ariaLabel: link.label, onClick: handleClick, children: icon });
|
|
325
342
|
return /* @__PURE__ */ jsx(TooltipExport, { content: link.label, side: "right", children: element });
|
|
326
343
|
}
|
|
327
344
|
function toMenuItems(links, ctx) {
|
|
@@ -338,6 +355,10 @@ function toMenuItems(links, ctx) {
|
|
|
338
355
|
return {
|
|
339
356
|
label: child.label,
|
|
340
357
|
href: child.href,
|
|
358
|
+
// The per-item element, forwarded — this row is the SAME `NavLink` the expanded column renders
|
|
359
|
+
// through `link.render ?? navLink`, so collapsing the rail must not downgrade it to the
|
|
360
|
+
// provider's link. `DropdownMenuActionItem.render` exists for exactly this hand-off.
|
|
361
|
+
render: child.render,
|
|
341
362
|
leading: child.leading,
|
|
342
363
|
trailing: child.trailing,
|
|
343
364
|
active: child === ctx.current,
|
|
@@ -360,14 +381,49 @@ function RailNode({ link, ctx }) {
|
|
|
360
381
|
function RailRows({ links, ctx }) {
|
|
361
382
|
return /* @__PURE__ */ jsx("ul", { className: "flex flex-col items-center gap-0.5", children: links.map((link) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(RailNode, { link, ctx }) }, link.label)) });
|
|
362
383
|
}
|
|
363
|
-
function
|
|
364
|
-
return /* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: cn("flex flex-col py-2", collapsed ? "items-center gap-2" : "gap-2 px-2"), children: SKELETON_WIDTHS.map((width) => /* @__PURE__ */ jsx(
|
|
384
|
+
function NavSkeleton({ collapsed }) {
|
|
385
|
+
return /* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: cn("flex flex-col py-2", collapsed ? "items-center gap-2" : "gap-2 px-2"), children: SKELETON_WIDTHS.map((width) => /* @__PURE__ */ jsx(Skeleton, { className: cn("h-6", collapsed ? "w-6" : width) }, width)) });
|
|
386
|
+
}
|
|
387
|
+
var BRAND_ROW = "flex items-center gap-2 rounded-lg outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2";
|
|
388
|
+
function Brand({ brand, collapsed }) {
|
|
389
|
+
const { logo, name, href, onClick } = brand;
|
|
390
|
+
const interactive = href != null || onClick != null;
|
|
391
|
+
const brandLink = useLinkElement(href);
|
|
392
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
393
|
+
/* @__PURE__ */ jsx(Slot, { className: "[&>svg]:size-8", children: logo }),
|
|
394
|
+
!collapsed && name != null ? /* @__PURE__ */ jsx("span", { className: "truncate text-md font-semibold text-primary", children: name }) : null
|
|
395
|
+
] });
|
|
396
|
+
if (!interactive) {
|
|
397
|
+
return /* @__PURE__ */ jsx("div", { className: cn(BRAND_ROW, collapsed && "justify-center"), children: content });
|
|
398
|
+
}
|
|
399
|
+
const shared = {
|
|
400
|
+
"aria-label": collapsed ? name : void 0,
|
|
401
|
+
className: cn(BRAND_ROW, "cursor-pointer", collapsed && "justify-center")
|
|
402
|
+
};
|
|
403
|
+
return /* @__PURE__ */ jsx(LinkOrButton, { render: brandLink, className: shared.className, ariaLabel: shared["aria-label"], onClick, children: content });
|
|
365
404
|
}
|
|
366
405
|
function SidebarNavigation(props) {
|
|
367
|
-
const {
|
|
406
|
+
const {
|
|
407
|
+
items,
|
|
408
|
+
activeHref,
|
|
409
|
+
onNavigate,
|
|
410
|
+
accent = "brand",
|
|
411
|
+
guide = "line",
|
|
412
|
+
brand,
|
|
413
|
+
header,
|
|
414
|
+
footerItems,
|
|
415
|
+
footer,
|
|
416
|
+
toggle = false,
|
|
417
|
+
loading = false,
|
|
418
|
+
labels,
|
|
419
|
+
className
|
|
420
|
+
} = props;
|
|
368
421
|
const ariaLabel = props["aria-label"] ?? "Main";
|
|
422
|
+
const t = useLabels("sidebarNavigation", SIDEBAR_NAVIGATION_LABELS, labels);
|
|
369
423
|
const sidebar = useSidebarContext();
|
|
370
424
|
const collapsed = props.collapsed ?? sidebar?.collapsed ?? false;
|
|
425
|
+
const pad = collapsed ? "px-3" : "px-4";
|
|
426
|
+
const slot = (value) => typeof value === "function" ? value({ collapsed }) : value;
|
|
371
427
|
if (toggle && !sidebar) devWarn("<SidebarNavigation toggle> renders nothing outside a <SidebarProvider> \u2014 there is no state for it to flip.");
|
|
372
428
|
const { current, trail } = React.useMemo(
|
|
373
429
|
() => resolveActive(footerItems && footerItems.length > 0 ? [...items, ...footerItems] : items, activeHref),
|
|
@@ -375,7 +431,12 @@ function SidebarNavigation(props) {
|
|
|
375
431
|
);
|
|
376
432
|
const ctx = React.useMemo(() => ({ current, trail, accent, guide, onNavigate }), [current, trail, accent, guide, onNavigate]);
|
|
377
433
|
const renderGroup = (group, key) => /* @__PURE__ */ jsxs("li", { children: [
|
|
378
|
-
collapsed ?
|
|
434
|
+
collapsed ? (
|
|
435
|
+
// `render={<hr />}` because a thematic break in a document flow IS an `<hr>` — and a `<div>`
|
|
436
|
+
// would be the wrong element for it. `w-6` beats the component's `w-full` through
|
|
437
|
+
// tailwind-merge, since `className` lands last.
|
|
438
|
+
/* @__PURE__ */ jsx(Separator, { render: /* @__PURE__ */ jsx("hr", {}), className: "mx-auto my-2 w-6" })
|
|
439
|
+
) : /* @__PURE__ */ jsx("div", { className: "px-2 pb-1", children: /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-fg-quaternary uppercase", children: group.group }) }),
|
|
379
440
|
collapsed ? /* @__PURE__ */ jsx(RailRows, { links: group.items, ctx }) : /* @__PURE__ */ jsx(NavRows, { links: group.items, ctx, className: "pb-5" })
|
|
380
441
|
] }, key);
|
|
381
442
|
return /* @__PURE__ */ jsxs(
|
|
@@ -398,18 +459,41 @@ function SidebarNavigation(props) {
|
|
|
398
459
|
// moment (a rail row is a tooltip'd icon, not a squeezed row), so the width
|
|
399
460
|
// carries the motion and the content lands where it settles.
|
|
400
461
|
"transition-[width] duration-200 ease-out",
|
|
401
|
-
|
|
402
|
-
|
|
462
|
+
// The seam against the page. Its sibling `HeaderNavigation` has always drawn one
|
|
463
|
+
// (`DIVIDER`, there); this column drew none, so on a white page the nav and the content
|
|
464
|
+
// were one undivided sheet. A `border-<side>` rather than a ring because this is ONE
|
|
465
|
+
// structural edge between regions, not a box perimeter (`Drawer`'s `SIDE_EDGE` is the same
|
|
466
|
+
// call). To drop it — a nav nested in a `<Drawer>`, which draws its own — pass
|
|
467
|
+
// `className="border-r-0"`: tailwind-merge resolves both in the `border-w-r` group.
|
|
468
|
+
"border-r border-secondary",
|
|
469
|
+
// The EXPANDED width is the caller's to set — it is a function of THEIR labels, and
|
|
470
|
+
// `className="w-60"` is the documented way to say so (layout only, merged via `cn()`).
|
|
471
|
+
!collapsed && "w-70",
|
|
472
|
+
className,
|
|
473
|
+
// The COLLAPSED width is NOT, and that is why it is emitted AFTER `className` — the one
|
|
474
|
+
// deliberate ordering asymmetry in this component. A rail is 36px of row plus the column's
|
|
475
|
+
// own `px-3`; it is derived geometry, not a design number, and no reading of "make my
|
|
476
|
+
// sidebar 240px wide" means "make the icon rail 240px wide". Emitted BEFORE `className` it
|
|
477
|
+
// was silently clobbered: tailwind-merge resolves `w-16` and a caller's `w-60` in one group,
|
|
478
|
+
// so an app that only ever talked about the EXPANDED column got a 240px rail with its icons
|
|
479
|
+
// stranded in the middle of it — and `items-center` (still ours, still applied) is what made
|
|
480
|
+
// that read as a layout bug rather than as the caller's own width coming back.
|
|
481
|
+
collapsed && "w-16 items-center"
|
|
403
482
|
),
|
|
404
483
|
children: [
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
484
|
+
brand != null ? /* @__PURE__ */ jsx("div", { className: cn("shrink-0 overflow-hidden pt-5", header != null ? "pb-4" : "pb-2", pad, collapsed && "flex w-full justify-center"), children: /* @__PURE__ */ jsx(Brand, { brand, collapsed }) }) : null,
|
|
485
|
+
header != null ? /* @__PURE__ */ jsx("div", { className: cn("shrink-0 pb-2", brand == null && "pt-5", pad, collapsed && "flex w-full justify-center overflow-hidden"), children: slot(header) }) : null,
|
|
486
|
+
loading ? /* @__PURE__ */ jsx("div", { className: cn("min-h-0 flex-1", pad), children: /* @__PURE__ */ jsx(NavSkeleton, { collapsed }) }) : (
|
|
487
|
+
// The gutter is the VIEWPORT's, not this box's — that is what puts the bar on the panel's
|
|
488
|
+
// edge instead of 16px inside it.
|
|
489
|
+
/* @__PURE__ */ jsx(ScrollView, { className: "min-h-0 flex-1", viewportClassName: cn("py-2", pad), children: /* @__PURE__ */ jsx("ul", { className: cn("flex flex-col", collapsed && "w-full items-center gap-0.5"), children: items.map((item, index) => {
|
|
490
|
+
if (isNavSeparator(item)) {
|
|
491
|
+
return /* @__PURE__ */ jsx("li", { className: cn("w-full", collapsed ? "py-2" : "px-0.5 py-2"), children: /* @__PURE__ */ jsx(Separator, { render: /* @__PURE__ */ jsx("hr", {}), texture: item.texture ?? "line", className: collapsed ? "mx-auto w-6" : "w-full" }) }, `separator-${index}`);
|
|
492
|
+
}
|
|
493
|
+
if (isNavGroup(item)) return renderGroup(item, `group-${index}`);
|
|
494
|
+
return /* @__PURE__ */ jsx("li", { className: collapsed ? void 0 : "py-px", children: collapsed ? /* @__PURE__ */ jsx(RailNode, { link: item, ctx }) : /* @__PURE__ */ jsx(NavRows, { links: [item], ctx }) }, item.label);
|
|
495
|
+
}) }) })
|
|
496
|
+
),
|
|
413
497
|
footerItems != null && footerItems.length > 0 && !loading ? (
|
|
414
498
|
// `max-h-[40%]` + its own scroll, because the two lists resolve their heights
|
|
415
499
|
// BACKWARDS otherwise. `footerItems` is a bounded cluster (Support, Settings) and
|
|
@@ -421,14 +505,14 @@ function SidebarNavigation(props) {
|
|
|
421
505
|
// The cap makes it degrade the honest way round: the cluster keeps at most a
|
|
422
506
|
// minority share and scrolls inside it, and the menu — the reason the column
|
|
423
507
|
// exists — always keeps the rest. `min-h-0` so the cap can actually bite.
|
|
424
|
-
/* @__PURE__ */ jsx(
|
|
508
|
+
/* @__PURE__ */ jsx(ScrollView, { className: "max-h-[40%] min-h-0 shrink-0", viewportClassName: cn("pt-2", pad, collapsed && "flex w-full justify-center"), children: collapsed ? /* @__PURE__ */ jsx(RailRows, { links: footerItems, ctx }) : /* @__PURE__ */ jsx(NavRows, { links: footerItems, ctx }) })
|
|
425
509
|
) : null,
|
|
426
|
-
footer != null ? /* @__PURE__ */ jsx("div", { className: cn("mt-auto shrink-0 py-4", collapsed && "flex w-full justify-center overflow-hidden"), children: footer }) : null,
|
|
510
|
+
footer != null ? /* @__PURE__ */ jsx("div", { className: cn("mt-auto shrink-0 py-4", pad, collapsed && "flex w-full justify-center overflow-hidden"), children: slot(footer) }) : null,
|
|
427
511
|
toggle && sidebar ? /* @__PURE__ */ jsx(
|
|
428
512
|
"button",
|
|
429
513
|
{
|
|
430
514
|
type: "button",
|
|
431
|
-
"aria-label": collapsed ?
|
|
515
|
+
"aria-label": collapsed ? t.expand : t.collapse,
|
|
432
516
|
"aria-expanded": !collapsed,
|
|
433
517
|
onClick: sidebar.toggle,
|
|
434
518
|
className: "group/handle absolute inset-y-0 right-0 z-20 flex w-3 cursor-pointer items-center justify-center outline-focus-ring focus-visible:outline-2 focus-visible:-outline-offset-2",
|
|
@@ -448,5 +532,5 @@ function SidebarNavigation(props) {
|
|
|
448
532
|
SidebarNavigation.displayName = "SidebarNavigation";
|
|
449
533
|
|
|
450
534
|
export { SidebarNavigation, SidebarProvider, SidebarTrigger, linkMatches, resolveActive, useSidebar };
|
|
451
|
-
//# sourceMappingURL=chunk-
|
|
452
|
-
//# sourceMappingURL=chunk-
|
|
535
|
+
//# sourceMappingURL=chunk-ZMFY7WAY.js.map
|
|
536
|
+
//# sourceMappingURL=chunk-ZMFY7WAY.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { OptionRow } from './chunk-GTHJWR3Q.js';
|
|
2
1
|
import { mapOptions } from './chunk-7JBNLEJ7.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { OptionRow } from './chunk-D7EE5GWU.js';
|
|
3
|
+
import { useFieldValidity, FieldGroupFrame } from './chunk-5KSD4WKN.js';
|
|
5
4
|
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
5
|
+
import { warnNeedsName } from './chunk-QDYE5LVT.js';
|
|
6
6
|
import { Radio } from '@base-ui/react/radio';
|
|
7
7
|
import { RadioGroup as RadioGroup$1 } from '@base-ui/react/radio-group';
|
|
8
8
|
import * as React from 'react';
|
|
@@ -48,6 +48,7 @@ function RadioGroupItem(props) {
|
|
|
48
48
|
return /* @__PURE__ */ jsx(
|
|
49
49
|
OptionRow,
|
|
50
50
|
{
|
|
51
|
+
scoped: true,
|
|
51
52
|
size: ctx.size,
|
|
52
53
|
bordered: ctx.bordered,
|
|
53
54
|
disabled: isDisabled,
|
|
@@ -158,5 +159,5 @@ RadioGroupRoot.displayName = "RadioGroup";
|
|
|
158
159
|
var RadioGroup = RadioGroupRoot;
|
|
159
160
|
|
|
160
161
|
export { RadioGroup };
|
|
161
|
-
//# sourceMappingURL=chunk-
|
|
162
|
-
//# sourceMappingURL=chunk-
|
|
162
|
+
//# sourceMappingURL=chunk-ZZSNTCCL.js.map
|
|
163
|
+
//# sourceMappingURL=chunk-ZZSNTCCL.js.map
|
package/dist/combobox.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { M as MultiDisplay } from './multi-value-CJb_tnvi.js';
|
|
3
3
|
import { O as OptionList, L as ListboxOption, a as ListboxAction } from './options-CPEIgjtd.js';
|
|
4
|
+
import { d as ComboboxLabels } from './labels-DPrh0se9.js';
|
|
4
5
|
import { ComboboxRootProps as ComboboxRootProps$1 } from '@base-ui/react/combobox';
|
|
5
6
|
|
|
6
7
|
type ComboboxSize = "sm" | "md" | "lg";
|
|
@@ -169,6 +170,10 @@ interface ComboboxProps<Value extends string = string, Multiple extends boolean
|
|
|
169
170
|
* `Enter` cannot coin it either) — e.g. `(q) => /^\S+@\S+\.\S+$/.test(q)` for a
|
|
170
171
|
* recipient field. @default always creatable */
|
|
171
172
|
validateCreate?: (query: string) => boolean;
|
|
173
|
+
/** Override the component's own copy — the trigger, the clear button, a chip's remove name, the
|
|
174
|
+
* `creatable` row, and what `placeholder` / `emptyMessage` / the loading line default to. Merges
|
|
175
|
+
* under `<JenosizeUIProvider labels={{ combobox }}>`; see `docs/i18n-policy.md`. */
|
|
176
|
+
labels?: ComboboxLabels;
|
|
172
177
|
}
|
|
173
178
|
declare function ComboboxFlat<Value extends string = string, Multiple extends boolean | undefined = false, Creatable extends boolean | undefined = undefined>(props: ComboboxProps<Value, Multiple, Creatable>): React.JSX.Element;
|
|
174
179
|
declare namespace ComboboxFlat {
|