@apliteni/apliteni-ui 0.140.0 → 0.142.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/package.json +1 -1
- package/react/README.md +3 -0
- package/react/dist/index.css +97 -1
- package/react/dist/index.d.ts +23 -19
- package/react/dist/index.js +471 -229
package/react/dist/index.js
CHANGED
|
@@ -3821,8 +3821,117 @@ var SearchField = forwardRef7(function SearchField2({ ariaLabel, className, ...p
|
|
|
3821
3821
|
// src/Toast.tsx
|
|
3822
3822
|
import { createContext as createContext3, useCallback as useCallback6, useContext as useContext3, useEffect as useEffect13, useLayoutEffect as useLayoutEffect4, useRef as useRef19, useState as useState14 } from "react";
|
|
3823
3823
|
import { createPortal as createPortal5 } from "react-dom";
|
|
3824
|
+
|
|
3825
|
+
// src/lib/toast-stack.ts
|
|
3826
|
+
var TOAST_PEEK = 8;
|
|
3827
|
+
var TOAST_SCALE_STEP = 0.04;
|
|
3828
|
+
var TOAST_TIERS = 2;
|
|
3829
|
+
var TOAST_PILE_MIN = 2;
|
|
3830
|
+
var TOAST_GAP = 12;
|
|
3831
|
+
function toastPileGeometry(heights, gap = TOAST_GAP) {
|
|
3832
|
+
const count = heights.length;
|
|
3833
|
+
if (!count) return { cards: [], collapsedHeight: 0, fannedHeight: 0 };
|
|
3834
|
+
const front = heights[count - 1];
|
|
3835
|
+
const cards = heights.map((height, index) => {
|
|
3836
|
+
const depth = count - 1 - index;
|
|
3837
|
+
const tier = Math.min(depth, TOAST_TIERS);
|
|
3838
|
+
const scale = 1 - tier * TOAST_SCALE_STEP;
|
|
3839
|
+
const reach = (front + tier * TOAST_PEEK) / scale;
|
|
3840
|
+
const box = depth > 0 ? Math.min(height, reach) : height;
|
|
3841
|
+
const lift = box * scale - front - tier * TOAST_PEEK;
|
|
3842
|
+
let fan = 0;
|
|
3843
|
+
for (let after = index + 1; after < count; after += 1) fan -= heights[after] + gap;
|
|
3844
|
+
return { depth, tier, scale, lift, fan, box, natural: height };
|
|
3845
|
+
});
|
|
3846
|
+
return {
|
|
3847
|
+
cards,
|
|
3848
|
+
collapsedHeight: front + Math.min(count - 1, TOAST_TIERS) * TOAST_PEEK,
|
|
3849
|
+
fannedHeight: heights.reduce((sum, height) => sum + height, 0) + (count - 1) * gap
|
|
3850
|
+
};
|
|
3851
|
+
}
|
|
3852
|
+
var pileCards = (stack2) => [...stack2.children].filter((el) => el.classList.contains("ui-toast"));
|
|
3853
|
+
var naturalHeight = (card) => {
|
|
3854
|
+
const style = card.ownerDocument.defaultView.getComputedStyle(card);
|
|
3855
|
+
const frame = (parseFloat(style.paddingBottom) || 0) + (parseFloat(style.borderTopWidth) || 0) + (parseFloat(style.borderBottomWidth) || 0);
|
|
3856
|
+
const content = [...card.children].filter((el) => !el.classList.contains("ui-toast__timer")).reduce((end, el) => Math.max(end, el.offsetTop + el.offsetHeight), 0);
|
|
3857
|
+
return Math.max(card.offsetHeight, content + frame);
|
|
3858
|
+
};
|
|
3859
|
+
function applyToastPile(stack2) {
|
|
3860
|
+
if (!stack2) return null;
|
|
3861
|
+
const cards = pileCards(stack2);
|
|
3862
|
+
const geometry = toastPileGeometry(cards.map(naturalHeight));
|
|
3863
|
+
stack2.style.setProperty("--toast-pile-height", `${geometry.collapsedHeight}px`);
|
|
3864
|
+
stack2.style.setProperty("--toast-fan-height", `${geometry.fannedHeight}px`);
|
|
3865
|
+
cards.forEach((card, index) => {
|
|
3866
|
+
const { lift, scale, fan, depth, box, natural } = geometry.cards[index];
|
|
3867
|
+
card.style.setProperty("--toast-card-lift", `${lift}px`);
|
|
3868
|
+
card.style.setProperty("--toast-card-scale", String(scale));
|
|
3869
|
+
card.style.setProperty("--toast-card-fan", `${fan}px`);
|
|
3870
|
+
card.style.setProperty("--toast-card-depth", String(cards.length - depth));
|
|
3871
|
+
if (depth > 0) {
|
|
3872
|
+
card.style.setProperty("--toast-card-clip", "0px");
|
|
3873
|
+
card.style.setProperty("--toast-card-fan-clip", `${fan}px`);
|
|
3874
|
+
} else {
|
|
3875
|
+
card.style.removeProperty("--toast-card-clip");
|
|
3876
|
+
card.style.removeProperty("--toast-card-fan-clip");
|
|
3877
|
+
}
|
|
3878
|
+
if (box < natural) {
|
|
3879
|
+
card.style.setProperty("--toast-card-box", `${box}px`);
|
|
3880
|
+
card.style.setProperty("--toast-card-natural", `${natural}px`);
|
|
3881
|
+
} else {
|
|
3882
|
+
card.style.removeProperty("--toast-card-box");
|
|
3883
|
+
card.style.removeProperty("--toast-card-natural");
|
|
3884
|
+
}
|
|
3885
|
+
});
|
|
3886
|
+
return geometry;
|
|
3887
|
+
}
|
|
3888
|
+
var PILE_PROPERTIES = ["--toast-pile-height", "--toast-fan-height"];
|
|
3889
|
+
var CARD_PROPERTIES = [
|
|
3890
|
+
"--toast-card-lift",
|
|
3891
|
+
"--toast-card-scale",
|
|
3892
|
+
"--toast-card-fan",
|
|
3893
|
+
"--toast-card-depth",
|
|
3894
|
+
"--toast-card-clip",
|
|
3895
|
+
"--toast-card-fan-clip",
|
|
3896
|
+
"--toast-card-box",
|
|
3897
|
+
"--toast-card-natural"
|
|
3898
|
+
];
|
|
3899
|
+
function clearToastPile(stack2) {
|
|
3900
|
+
if (!stack2) return;
|
|
3901
|
+
for (const name of PILE_PROPERTIES) stack2.style.removeProperty(name);
|
|
3902
|
+
for (const card of pileCards(stack2)) for (const name of CARD_PROPERTIES) card.style.removeProperty(name);
|
|
3903
|
+
}
|
|
3904
|
+
function watchToastPile(stack2) {
|
|
3905
|
+
if (!stack2) return () => {
|
|
3906
|
+
};
|
|
3907
|
+
const view = stack2.ownerDocument.defaultView;
|
|
3908
|
+
const watched = /* @__PURE__ */ new WeakSet();
|
|
3909
|
+
let observer = null;
|
|
3910
|
+
const sync2 = () => {
|
|
3911
|
+
applyToastPile(stack2);
|
|
3912
|
+
for (const card of pileCards(stack2)) {
|
|
3913
|
+
for (const el of [card, ...card.children]) {
|
|
3914
|
+
if (watched.has(el)) continue;
|
|
3915
|
+
watched.add(el);
|
|
3916
|
+
observer?.observe(el);
|
|
3917
|
+
}
|
|
3918
|
+
}
|
|
3919
|
+
};
|
|
3920
|
+
observer = typeof view?.ResizeObserver === "function" ? new view.ResizeObserver(sync2) : null;
|
|
3921
|
+
const mutations = typeof view?.MutationObserver === "function" ? new view.MutationObserver(sync2) : null;
|
|
3922
|
+
mutations?.observe(stack2, { childList: true });
|
|
3923
|
+
sync2();
|
|
3924
|
+
return () => {
|
|
3925
|
+
observer?.disconnect();
|
|
3926
|
+
mutations?.disconnect();
|
|
3927
|
+
clearToastPile(stack2);
|
|
3928
|
+
};
|
|
3929
|
+
}
|
|
3930
|
+
|
|
3931
|
+
// src/Toast.tsx
|
|
3824
3932
|
import { jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3825
3933
|
var Context = createContext3(null);
|
|
3934
|
+
var PileHoldContext = createContext3(false);
|
|
3826
3935
|
var glyphs = { success: "circleCheck", danger: "circleX", warn: "circleAlert", info: "info", neutral: "bolt" };
|
|
3827
3936
|
function useToast() {
|
|
3828
3937
|
const push = useContext3(Context);
|
|
@@ -3835,7 +3944,8 @@ function Notice({ notice, remove }) {
|
|
|
3835
3944
|
const dismissed = useRef19(false);
|
|
3836
3945
|
const [hovered, setHovered] = useState14(false);
|
|
3837
3946
|
const [focused, setFocused] = useState14(false);
|
|
3838
|
-
const
|
|
3947
|
+
const pileHeld = useContext3(PileHoldContext);
|
|
3948
|
+
const paused = hovered || focused || pileHeld;
|
|
3839
3949
|
const tone = notice.tone ?? "success";
|
|
3840
3950
|
const timed = !notice.action && notice.timer !== false && notice.timer !== 0;
|
|
3841
3951
|
const duration = typeof notice.timer === "number" ? notice.timer * 1e3 : 5e3;
|
|
@@ -3936,8 +4046,21 @@ function usePublishedReach(stack2, count) {
|
|
|
3936
4046
|
};
|
|
3937
4047
|
}, [stack2, count]);
|
|
3938
4048
|
}
|
|
3939
|
-
function
|
|
4049
|
+
function usePile(stack2, piled, count) {
|
|
4050
|
+
useLayoutEffect4(() => {
|
|
4051
|
+
const element = stack2.current;
|
|
4052
|
+
if (!element) return;
|
|
4053
|
+
if (!piled) {
|
|
4054
|
+
clearToastPile(element);
|
|
4055
|
+
return;
|
|
4056
|
+
}
|
|
4057
|
+
return watchToastPile(element);
|
|
4058
|
+
}, [stack2, piled, count]);
|
|
4059
|
+
}
|
|
4060
|
+
function Toast({ children, collapse = false }) {
|
|
3940
4061
|
const [entries, setEntries] = useState14([]);
|
|
4062
|
+
const [pileHovered, setPileHovered] = useState14(false);
|
|
4063
|
+
const [pileFocused, setPileFocused] = useState14(false);
|
|
3941
4064
|
const nextId = useRef19(0);
|
|
3942
4065
|
const stack2 = useRef19(null);
|
|
3943
4066
|
const push = useCallback6((notice) => {
|
|
@@ -3945,11 +4068,31 @@ function Toast({ children }) {
|
|
|
3945
4068
|
const remove = () => setEntries((current) => current.filter((entry) => entry.id !== id));
|
|
3946
4069
|
setEntries((current) => [...current, { id, notice, remove }]);
|
|
3947
4070
|
}, []);
|
|
4071
|
+
const piled = collapse && entries.length >= TOAST_PILE_MIN;
|
|
4072
|
+
const pileHeld = piled && (pileHovered || pileFocused);
|
|
3948
4073
|
usePublishedReach(stack2, entries.length);
|
|
4074
|
+
usePile(stack2, piled, entries.length);
|
|
4075
|
+
const leavePileFocus = (event) => {
|
|
4076
|
+
if (!event.currentTarget.contains(event.relatedTarget)) setPileFocused(false);
|
|
4077
|
+
};
|
|
3949
4078
|
return /* @__PURE__ */ jsxs30(Context.Provider, { value: push, children: [
|
|
3950
4079
|
children,
|
|
3951
4080
|
typeof document !== "undefined" && createPortal5(
|
|
3952
|
-
/* @__PURE__ */ jsx35(
|
|
4081
|
+
/* @__PURE__ */ jsx35(
|
|
4082
|
+
"div",
|
|
4083
|
+
{
|
|
4084
|
+
className: `ui-toast-stack rx-toast-stack${piled ? " ui-toast-stack--collapsed" : ""}`,
|
|
4085
|
+
ref: stack2,
|
|
4086
|
+
tabIndex: piled ? 0 : void 0,
|
|
4087
|
+
role: piled ? "region" : void 0,
|
|
4088
|
+
"aria-label": piled ? "Notifications" : void 0,
|
|
4089
|
+
onMouseEnter: () => setPileHovered(true),
|
|
4090
|
+
onMouseLeave: () => setPileHovered(false),
|
|
4091
|
+
onFocus: () => setPileFocused(true),
|
|
4092
|
+
onBlur: leavePileFocus,
|
|
4093
|
+
children: /* @__PURE__ */ jsx35(PileHoldContext.Provider, { value: pileHeld, children: entries.map((entry) => /* @__PURE__ */ jsx35(Notice, { notice: entry.notice, remove: entry.remove }, entry.id)) })
|
|
4094
|
+
}
|
|
4095
|
+
),
|
|
3953
4096
|
document.body
|
|
3954
4097
|
)
|
|
3955
4098
|
] });
|
|
@@ -3957,7 +4100,33 @@ function Toast({ children }) {
|
|
|
3957
4100
|
|
|
3958
4101
|
// src/AppShell.tsx
|
|
3959
4102
|
import { useEffect as useEffect15, useId as useId12, useRef as useRef20, useState as useState16 } from "react";
|
|
3960
|
-
import {
|
|
4103
|
+
import { prism } from "@apliteni/apliteni-ui";
|
|
4104
|
+
|
|
4105
|
+
// src/lib/palette-hotkey.ts
|
|
4106
|
+
function paletteHotkey(platform = typeof navigator === "undefined" ? "" : navigator.platform) {
|
|
4107
|
+
return /mac|iphone|ipad|ipod/i.test(platform || "") ? "\u2318K" : "Ctrl K";
|
|
4108
|
+
}
|
|
4109
|
+
|
|
4110
|
+
// src/lib/rail.ts
|
|
4111
|
+
var RAIL_COOKIE = "apliteni-ui-rail";
|
|
4112
|
+
var RAIL_VALUE = new RegExp(`(?:^|;\\s*)${RAIL_COOKIE}=(collapsed|expanded)(?:;|$)`);
|
|
4113
|
+
var documentCookies = () => {
|
|
4114
|
+
try {
|
|
4115
|
+
return typeof document === "undefined" ? "" : document.cookie;
|
|
4116
|
+
} catch {
|
|
4117
|
+
return "";
|
|
4118
|
+
}
|
|
4119
|
+
};
|
|
4120
|
+
function railCollapsed(cookies = documentCookies()) {
|
|
4121
|
+
const match = RAIL_VALUE.exec(String(cookies ?? ""));
|
|
4122
|
+
return match ? match[1] === "collapsed" : null;
|
|
4123
|
+
}
|
|
4124
|
+
function storeRailCollapsed(collapsed) {
|
|
4125
|
+
try {
|
|
4126
|
+
document.cookie = `${RAIL_COOKIE}=${collapsed ? "collapsed" : "expanded"}; Max-Age=31536000; Path=/; SameSite=Lax`;
|
|
4127
|
+
} catch {
|
|
4128
|
+
}
|
|
4129
|
+
}
|
|
3961
4130
|
|
|
3962
4131
|
// src/SidebarNav.tsx
|
|
3963
4132
|
import { forwardRef as forwardRef8, useEffect as useEffect14, useId as useId11, useState as useState15 } from "react";
|
|
@@ -4056,10 +4225,48 @@ var SidebarNav = forwardRef8(function SidebarNav2({
|
|
|
4056
4225
|
] });
|
|
4057
4226
|
});
|
|
4058
4227
|
|
|
4228
|
+
// src/Breadcrumbs.tsx
|
|
4229
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
4230
|
+
import { icon as icon7, safeUrl as safeUrl2 } from "@apliteni/apliteni-ui";
|
|
4231
|
+
import { Fragment as Fragment15, jsx as jsx37, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
4232
|
+
var Breadcrumbs = forwardRef9(function Breadcrumbs2({
|
|
4233
|
+
items,
|
|
4234
|
+
renderLink,
|
|
4235
|
+
className,
|
|
4236
|
+
"aria-label": ariaLabel = "Breadcrumb",
|
|
4237
|
+
...rest
|
|
4238
|
+
}, ref) {
|
|
4239
|
+
return /* @__PURE__ */ jsx37(
|
|
4240
|
+
"nav",
|
|
4241
|
+
{
|
|
4242
|
+
...rest,
|
|
4243
|
+
ref,
|
|
4244
|
+
className: ["ui-nav", "ui-nav--crumbs", className].filter(Boolean).join(" "),
|
|
4245
|
+
"aria-label": ariaLabel,
|
|
4246
|
+
children: /* @__PURE__ */ jsx37("ol", { className: "ui-nav__crumbs", children: items.map((item, index) => {
|
|
4247
|
+
const current = index === items.length - 1;
|
|
4248
|
+
const inner = /* @__PURE__ */ jsxs32(Fragment15, { children: [
|
|
4249
|
+
item.icon && /* @__PURE__ */ jsx37("span", { className: "ui-nav__ic", dangerouslySetInnerHTML: { __html: icon7(item.icon) } }),
|
|
4250
|
+
/* @__PURE__ */ jsx37("span", { className: "ui-nav__crumb-label", children: item.label })
|
|
4251
|
+
] });
|
|
4252
|
+
const linkProps = !current && item.href ? { className: "ui-nav__crumb", href: safeUrl2(item.href), target: item.target, children: inner } : null;
|
|
4253
|
+
return /* @__PURE__ */ jsx37("li", { className: "ui-nav__crumb-item", children: linkProps ? renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx37("a", { ...linkProps }) : /* @__PURE__ */ jsx37(
|
|
4254
|
+
"span",
|
|
4255
|
+
{
|
|
4256
|
+
className: ["ui-nav__crumb", current && "is-current"].filter(Boolean).join(" "),
|
|
4257
|
+
"aria-current": current ? "page" : void 0,
|
|
4258
|
+
children: inner
|
|
4259
|
+
}
|
|
4260
|
+
) }, index);
|
|
4261
|
+
}) })
|
|
4262
|
+
}
|
|
4263
|
+
);
|
|
4264
|
+
});
|
|
4265
|
+
|
|
4059
4266
|
// src/ThemeToggle.tsx
|
|
4060
4267
|
import { useSyncExternalStore } from "react";
|
|
4061
4268
|
import { themeIcon } from "@apliteni/apliteni-ui";
|
|
4062
|
-
import { jsx as
|
|
4269
|
+
import { jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4063
4270
|
var STORAGE_KEY = "apliteni-strategy-theme";
|
|
4064
4271
|
var CHOICE_EVENT = "apliteni-theme-choice";
|
|
4065
4272
|
var THEME_INIT_SCRIPT = `(()=>{let t;try{t=localStorage.getItem('apliteni-strategy-theme')}catch{}document.documentElement.setAttribute('data-theme',t==='dark'||t==='light'?t:window.matchMedia?.('(prefers-color-scheme: light)').matches?'light':'dark')})()`;
|
|
@@ -4117,10 +4324,10 @@ function ThemeToggle({ labelled = false }) {
|
|
|
4117
4324
|
}
|
|
4118
4325
|
window.dispatchEvent(new Event(CHOICE_EVENT));
|
|
4119
4326
|
};
|
|
4120
|
-
const button = /* @__PURE__ */
|
|
4121
|
-
return labelled ? /* @__PURE__ */
|
|
4327
|
+
const button = /* @__PURE__ */ jsx38("button", { type: "button", className: "toggle", "aria-label": name, title: name, onClick: toggle, children: /* @__PURE__ */ jsx38("span", { className: "ic", "aria-hidden": "true", dangerouslySetInnerHTML: { __html: themeIcon(theme) } }) });
|
|
4328
|
+
return labelled ? /* @__PURE__ */ jsxs33("span", { className: "ui-theme-toggle", children: [
|
|
4122
4329
|
button,
|
|
4123
|
-
/* @__PURE__ */
|
|
4330
|
+
/* @__PURE__ */ jsxs33("span", { children: [
|
|
4124
4331
|
label,
|
|
4125
4332
|
" theme"
|
|
4126
4333
|
] })
|
|
@@ -4128,7 +4335,7 @@ function ThemeToggle({ labelled = false }) {
|
|
|
4128
4335
|
}
|
|
4129
4336
|
|
|
4130
4337
|
// src/AppShell.tsx
|
|
4131
|
-
import { Fragment as
|
|
4338
|
+
import { Fragment as Fragment16, jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4132
4339
|
var path = (value) => value.split(/[?#]/)[0].replace(/\/+$/, "") || "/";
|
|
4133
4340
|
function AppShell({
|
|
4134
4341
|
sections,
|
|
@@ -4137,9 +4344,11 @@ function AppShell({
|
|
|
4137
4344
|
children,
|
|
4138
4345
|
word = "apliteni-ui",
|
|
4139
4346
|
brand,
|
|
4347
|
+
layout = "topbar",
|
|
4140
4348
|
brandHref = "/",
|
|
4141
4349
|
width = "centered",
|
|
4142
4350
|
back,
|
|
4351
|
+
crumbs,
|
|
4143
4352
|
lede,
|
|
4144
4353
|
actions,
|
|
4145
4354
|
bandControl,
|
|
@@ -4175,6 +4384,7 @@ function AppShell({
|
|
|
4175
4384
|
return () => window.removeEventListener("resize", grown);
|
|
4176
4385
|
}, [menu]);
|
|
4177
4386
|
useEffect15(() => {
|
|
4387
|
+
if (layout === "rail") return;
|
|
4178
4388
|
const hotkey = (event) => {
|
|
4179
4389
|
if (!(event.metaKey || event.ctrlKey) || event.altKey || event.shiftKey || event.key.toLowerCase() !== "k") return;
|
|
4180
4390
|
const target = event.target;
|
|
@@ -4184,20 +4394,17 @@ function AppShell({
|
|
|
4184
4394
|
};
|
|
4185
4395
|
document.addEventListener("keydown", hotkey);
|
|
4186
4396
|
return () => document.removeEventListener("keydown", hotkey);
|
|
4187
|
-
}, []);
|
|
4397
|
+
}, [layout]);
|
|
4188
4398
|
const fold = () => {
|
|
4189
4399
|
const next = !collapsed;
|
|
4190
4400
|
setCollapsed(next);
|
|
4191
|
-
|
|
4192
|
-
document.cookie = `apliteni-ui-rail=${next ? "collapsed" : "expanded"}; Max-Age=31536000; Path=/; SameSite=Lax`;
|
|
4193
|
-
} catch {
|
|
4194
|
-
}
|
|
4401
|
+
storeRailCollapsed(next);
|
|
4195
4402
|
};
|
|
4196
|
-
const sidebar = (label) => /* @__PURE__ */
|
|
4403
|
+
const sidebar = (label) => /* @__PURE__ */ jsx39(
|
|
4197
4404
|
SidebarNav,
|
|
4198
4405
|
{
|
|
4199
4406
|
"aria-label": label,
|
|
4200
|
-
items: sections.map((section) => ({ ...section, id: section.href, badge: section.count })),
|
|
4407
|
+
items: sections.map((section) => ({ ...section, id: section.href, badge: layout === "rail" ? void 0 : section.count })),
|
|
4201
4408
|
active: active?.href,
|
|
4202
4409
|
activeIs: back ? "section" : "page",
|
|
4203
4410
|
renderLink: (item, props) => {
|
|
@@ -4205,33 +4412,112 @@ function AppShell({
|
|
|
4205
4412
|
const linkProps = { ...props, onClick: (event) => {
|
|
4206
4413
|
if (!event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey) setMenu(false);
|
|
4207
4414
|
} };
|
|
4208
|
-
return renderLink ? renderLink(section, linkProps) : /* @__PURE__ */
|
|
4415
|
+
return renderLink ? renderLink(section, linkProps) : /* @__PURE__ */ jsx39("a", { ...linkProps });
|
|
4209
4416
|
}
|
|
4210
4417
|
}
|
|
4211
4418
|
);
|
|
4212
4419
|
const foldLabel = collapsed ? "Expand sidebar" : "Collapse sidebar";
|
|
4213
4420
|
const navigable = sections.length > 1 || Boolean(back);
|
|
4214
|
-
const lockup = /* @__PURE__ */
|
|
4215
|
-
brand ?? /* @__PURE__ */
|
|
4216
|
-
/* @__PURE__ */
|
|
4421
|
+
const lockup = /* @__PURE__ */ jsxs34("a", { className: "ui-app__brand", href: brandHref, "aria-label": word, children: [
|
|
4422
|
+
brand ?? /* @__PURE__ */ jsx39("i", { "aria-hidden": "true", className: "ui-react-app__mark", dangerouslySetInnerHTML: { __html: prism(uid, 24) } }),
|
|
4423
|
+
/* @__PURE__ */ jsx39("span", { children: word })
|
|
4217
4424
|
] });
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4425
|
+
const accountBlock = () => /* @__PURE__ */ jsx39("div", { className: "ui-app__user", children: /* @__PURE__ */ jsx39(
|
|
4426
|
+
Dropdown,
|
|
4427
|
+
{
|
|
4428
|
+
variant: "menu",
|
|
4429
|
+
direction: "up",
|
|
4430
|
+
align: "start",
|
|
4431
|
+
chevron: true,
|
|
4432
|
+
ariaLabel: `Signed in as ${account.name}, ${account.email}`,
|
|
4433
|
+
triggerClass: "ui-app__user-trigger",
|
|
4434
|
+
panelClass: "ui-app__user-panel",
|
|
4435
|
+
triggerContent: /* @__PURE__ */ jsxs34(Fragment16, { children: [
|
|
4436
|
+
/* @__PURE__ */ jsx39("span", { className: "ui-app__av", "aria-hidden": "true", children: /* @__PURE__ */ jsx39(Avatar, { personKey: account.email || account.name, name: account.name, size: 32 }) }),
|
|
4437
|
+
/* @__PURE__ */ jsxs34("span", { className: "ui-app__who", children: [
|
|
4438
|
+
/* @__PURE__ */ jsx39("b", { children: account.name }),
|
|
4439
|
+
/* @__PURE__ */ jsx39("span", { children: account.email })
|
|
4440
|
+
] })
|
|
4441
|
+
] }),
|
|
4442
|
+
items: [{ label: "Sign out", icon: "logout", danger: true }],
|
|
4443
|
+
onSelect: onSignOut
|
|
4444
|
+
}
|
|
4445
|
+
) });
|
|
4446
|
+
const foldControl = /* @__PURE__ */ jsx39("div", { className: "ui-app__fold-row", children: /* @__PURE__ */ jsxs34(
|
|
4447
|
+
"button",
|
|
4448
|
+
{
|
|
4449
|
+
type: "button",
|
|
4450
|
+
className: "ui-nav__item ui-app__fold",
|
|
4451
|
+
"aria-expanded": !collapsed,
|
|
4452
|
+
"aria-label": foldLabel,
|
|
4453
|
+
onClick: fold,
|
|
4454
|
+
children: [
|
|
4455
|
+
/* @__PURE__ */ jsx39("span", { className: "ui-nav__ic", children: /* @__PURE__ */ jsxs34("svg", { className: "ui-icon", viewBox: "0 0 24 24", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
4456
|
+
/* @__PURE__ */ jsx39("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
|
|
4457
|
+
/* @__PURE__ */ jsx39("path", { className: "ui-app__fold-seam", d: "M9 3v18" }),
|
|
4458
|
+
/* @__PURE__ */ jsx39("path", { className: "ui-app__fold-arrow", d: "m16 15-3-3 3-3" })
|
|
4227
4459
|
] }) }),
|
|
4228
|
-
/* @__PURE__ */
|
|
4229
|
-
]
|
|
4460
|
+
/* @__PURE__ */ jsx39("span", { className: "ui-nav__label", children: foldLabel })
|
|
4461
|
+
]
|
|
4462
|
+
}
|
|
4463
|
+
) });
|
|
4464
|
+
const page = /* @__PURE__ */ jsxs34("main", { className: `ui-app__main${width === "wide" ? " ui-app__main--wide" : ""}`, children: [
|
|
4465
|
+
back ? /* @__PURE__ */ jsx39(BackLink, { ...back }) : crumbs?.length ? /* @__PURE__ */ jsx39(Breadcrumbs, { items: crumbs }) : null,
|
|
4466
|
+
/* @__PURE__ */ jsx39("h1", { children: title }),
|
|
4467
|
+
lede && /* @__PURE__ */ jsx39("p", { className: "ui-app__sub", children: lede }),
|
|
4468
|
+
actions && /* @__PURE__ */ jsx39("div", { className: "ui-react-app__actions", children: actions }),
|
|
4469
|
+
/* @__PURE__ */ jsx39("div", { className: "ui-app__body", children })
|
|
4470
|
+
] });
|
|
4471
|
+
if (layout === "rail") return /* @__PURE__ */ jsxs34("div", { className: `ui-app ui-react-app${collapsed ? " is-collapsed" : ""}`, children: [
|
|
4472
|
+
/* @__PURE__ */ jsxs34("div", { className: "ui-app__rail", role: "region", "aria-label": "Sidebar", children: [
|
|
4473
|
+
/* @__PURE__ */ jsxs34("div", { className: "ui-app__head", children: [
|
|
4474
|
+
lockup,
|
|
4475
|
+
foldControl
|
|
4476
|
+
] }),
|
|
4477
|
+
sidebar("Sections"),
|
|
4478
|
+
accountBlock()
|
|
4479
|
+
] }),
|
|
4480
|
+
/* @__PURE__ */ jsxs34("header", { className: "ui-app__bar ui-app__bar--phone", children: [
|
|
4481
|
+
/* @__PURE__ */ jsx39(
|
|
4482
|
+
Button,
|
|
4483
|
+
{
|
|
4484
|
+
ref: menuButton,
|
|
4485
|
+
variant: "ghost",
|
|
4486
|
+
icon: "menu",
|
|
4487
|
+
iconOnly: true,
|
|
4488
|
+
"aria-label": "Menu",
|
|
4489
|
+
className: "ui-app__menu",
|
|
4490
|
+
"aria-haspopup": "dialog",
|
|
4491
|
+
"aria-expanded": menu,
|
|
4492
|
+
onClick: () => setMenu(true)
|
|
4493
|
+
}
|
|
4494
|
+
),
|
|
4495
|
+
/* @__PURE__ */ jsx39("a", { className: "ui-app__brand ui-app__brand--band", href: brandHref, "aria-label": word, children: brand ?? /* @__PURE__ */ jsx39("i", { "aria-hidden": "true", className: "ui-react-app__mark", dangerouslySetInnerHTML: { __html: prism(`${uid}-band`, 24) } }) })
|
|
4230
4496
|
] }),
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4497
|
+
page,
|
|
4498
|
+
/* @__PURE__ */ jsx39(
|
|
4499
|
+
Drawer,
|
|
4500
|
+
{
|
|
4501
|
+
open: menu,
|
|
4502
|
+
onClose: () => setMenu(false),
|
|
4503
|
+
title: word,
|
|
4504
|
+
side: "left",
|
|
4505
|
+
size: "sm",
|
|
4506
|
+
footer: /* @__PURE__ */ jsx39("div", { className: "ui-app__drawer", children: accountBlock() }),
|
|
4507
|
+
children: /* @__PURE__ */ jsx39("div", { className: "ui-app__drawer", children: sidebar("Menu sections") })
|
|
4508
|
+
}
|
|
4509
|
+
)
|
|
4510
|
+
] });
|
|
4511
|
+
return /* @__PURE__ */ jsxs34("div", { className: `ui-app ui-app--topbar ui-react-app${collapsed ? " is-collapsed" : ""}`, children: [
|
|
4512
|
+
navigable && /* @__PURE__ */ jsxs34("div", { className: "ui-app__rail", role: "region", "aria-label": "Sidebar", children: [
|
|
4513
|
+
/* @__PURE__ */ jsx39("div", { className: "ui-app__head", children: lockup }),
|
|
4514
|
+
sidebar("Sections"),
|
|
4515
|
+
/* @__PURE__ */ jsx39("div", { className: "ui-app__foot", children: foldControl })
|
|
4516
|
+
] }),
|
|
4517
|
+
/* @__PURE__ */ jsxs34("div", { className: "ui-app__well", children: [
|
|
4518
|
+
/* @__PURE__ */ jsxs34("header", { className: "ui-app__bar", children: [
|
|
4519
|
+
navigable && /* @__PURE__ */ jsxs34(Fragment16, { children: [
|
|
4520
|
+
/* @__PURE__ */ jsx39(
|
|
4235
4521
|
Button,
|
|
4236
4522
|
{
|
|
4237
4523
|
ref: menuButton,
|
|
@@ -4245,19 +4531,19 @@ function AppShell({
|
|
|
4245
4531
|
onClick: () => setMenu(true)
|
|
4246
4532
|
}
|
|
4247
4533
|
),
|
|
4248
|
-
/* @__PURE__ */
|
|
4534
|
+
/* @__PURE__ */ jsx39("a", { className: "ui-app__brand ui-app__brand--band", href: brandHref, "aria-label": word, children: brand ?? /* @__PURE__ */ jsx39("i", { "aria-hidden": "true", className: "ui-react-app__mark", dangerouslySetInnerHTML: { __html: prism(`${uid}-band`, 24) } }) })
|
|
4249
4535
|
] }),
|
|
4250
4536
|
!navigable && lockup,
|
|
4251
|
-
/* @__PURE__ */
|
|
4252
|
-
/* @__PURE__ */
|
|
4253
|
-
/* @__PURE__ */
|
|
4254
|
-
/* @__PURE__ */
|
|
4255
|
-
/* @__PURE__ */
|
|
4537
|
+
/* @__PURE__ */ jsxs34("button", { type: "button", className: "ui-app__search", "aria-haspopup": "dialog", onClick: () => setSearch(true), children: [
|
|
4538
|
+
/* @__PURE__ */ jsx39("span", { className: "ui-app__search-ic", children: /* @__PURE__ */ jsx39(Icon, { name: "search" }) }),
|
|
4539
|
+
/* @__PURE__ */ jsx39("span", { className: "ui-app__search-txt", children: searchLabel }),
|
|
4540
|
+
/* @__PURE__ */ jsx39("span", { className: "ui-app__search-short", "aria-hidden": "true", children: searchShortLabel }),
|
|
4541
|
+
/* @__PURE__ */ jsx39("kbd", { className: "ui-cmdk__key", children: paletteHotkey() })
|
|
4256
4542
|
] }),
|
|
4257
|
-
/* @__PURE__ */
|
|
4258
|
-
bandControl && /* @__PURE__ */
|
|
4259
|
-
/* @__PURE__ */
|
|
4260
|
-
/* @__PURE__ */
|
|
4543
|
+
/* @__PURE__ */ jsx39("span", { className: "ui-app__bar-gap" }),
|
|
4544
|
+
bandControl && /* @__PURE__ */ jsx39("span", { className: "ui-react-app__band-control", children: bandControl }),
|
|
4545
|
+
/* @__PURE__ */ jsx39(ThemeToggle, {}),
|
|
4546
|
+
/* @__PURE__ */ jsx39("div", { className: "ui-app__user ui-app__user--bar", children: /* @__PURE__ */ jsx39(
|
|
4261
4547
|
Dropdown,
|
|
4262
4548
|
{
|
|
4263
4549
|
variant: "menu",
|
|
@@ -4266,43 +4552,37 @@ function AppShell({
|
|
|
4266
4552
|
ariaLabel: `Signed in as ${account.name}, ${account.email}`,
|
|
4267
4553
|
triggerClass: "ui-app__user-trigger",
|
|
4268
4554
|
panelClass: "ui-app__user-panel",
|
|
4269
|
-
triggerContent: /* @__PURE__ */
|
|
4270
|
-
header: /* @__PURE__ */
|
|
4271
|
-
/* @__PURE__ */
|
|
4272
|
-
/* @__PURE__ */
|
|
4555
|
+
triggerContent: /* @__PURE__ */ jsx39("span", { className: "ui-app__av", "aria-hidden": "true", children: /* @__PURE__ */ jsx39(Avatar, { personKey: account.email || account.name, name: account.name, size: 32 }) }),
|
|
4556
|
+
header: /* @__PURE__ */ jsxs34("div", { className: "ui-dropdown__head", children: [
|
|
4557
|
+
/* @__PURE__ */ jsx39("b", { children: account.name }),
|
|
4558
|
+
/* @__PURE__ */ jsx39("span", { children: account.email })
|
|
4273
4559
|
] }),
|
|
4274
4560
|
items: [{ label: "Sign out", icon: "logout", danger: true }],
|
|
4275
4561
|
onSelect: onSignOut
|
|
4276
4562
|
}
|
|
4277
4563
|
) })
|
|
4278
4564
|
] }),
|
|
4279
|
-
|
|
4280
|
-
back && /* @__PURE__ */ jsx38(BackLink, { ...back }),
|
|
4281
|
-
/* @__PURE__ */ jsx38("h1", { children: title }),
|
|
4282
|
-
lede && /* @__PURE__ */ jsx38("p", { className: "ui-app__sub", children: lede }),
|
|
4283
|
-
actions && /* @__PURE__ */ jsx38("div", { className: "ui-react-app__actions", children: actions }),
|
|
4284
|
-
/* @__PURE__ */ jsx38("div", { className: "ui-app__body", children })
|
|
4285
|
-
] })
|
|
4565
|
+
page
|
|
4286
4566
|
] }),
|
|
4287
|
-
navigable && /* @__PURE__ */
|
|
4288
|
-
/* @__PURE__ */
|
|
4567
|
+
navigable && /* @__PURE__ */ jsx39(Drawer, { open: menu, onClose: () => setMenu(false), title: word, side: "left", size: "sm", children: /* @__PURE__ */ jsx39("div", { className: "ui-react-app__menu", children: sidebar("Menu sections") }) }),
|
|
4568
|
+
/* @__PURE__ */ jsx39(CommandPalette, { ...palette ?? { groups: [{ items: sections.map((section) => ({ id: section.href, ...section })) }] }, open: search, onClose: () => setSearch(false) })
|
|
4289
4569
|
] });
|
|
4290
4570
|
}
|
|
4291
4571
|
|
|
4292
4572
|
// src/AuthShell.tsx
|
|
4293
|
-
import { forwardRef as
|
|
4294
|
-
import { jsx as
|
|
4295
|
-
var AuthShell =
|
|
4296
|
-
return /* @__PURE__ */
|
|
4297
|
-
/* @__PURE__ */
|
|
4573
|
+
import { forwardRef as forwardRef10 } from "react";
|
|
4574
|
+
import { jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
4575
|
+
var AuthShell = forwardRef10(function AuthShell2({ brand, children, className, ...rest }, ref) {
|
|
4576
|
+
return /* @__PURE__ */ jsx40("div", { ...rest, ref, className: ["ui-auth", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs35("div", { className: "ui-auth__card", children: [
|
|
4577
|
+
/* @__PURE__ */ jsx40("div", { className: "ui-auth__brand", children: brand }),
|
|
4298
4578
|
children
|
|
4299
4579
|
] }) });
|
|
4300
4580
|
});
|
|
4301
4581
|
|
|
4302
4582
|
// src/Footer.tsx
|
|
4303
4583
|
import { useId as useId13 } from "react";
|
|
4304
|
-
import { prism as prism2, safeUrl as
|
|
4305
|
-
import { jsx as
|
|
4584
|
+
import { prism as prism2, safeUrl as safeUrl3 } from "@apliteni/apliteni-ui";
|
|
4585
|
+
import { jsx as jsx41, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
4306
4586
|
var SOCIAL_GLYPHS = {
|
|
4307
4587
|
github: '<path d="M12 2a10 10 0 0 0-3.16 19.49c.5.09.68-.22.68-.48v-1.7c-2.78.6-3.37-1.34-3.37-1.34-.45-1.16-1.11-1.47-1.11-1.47-.9-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.9 1.53 2.34 1.09 2.91.83.09-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.09.39-1.98 1.03-2.68-.1-.25-.45-1.27.1-2.64 0 0 .84-.27 2.75 1.02a9.5 9.5 0 0 1 5 0c1.91-1.29 2.75-1.02 2.75-1.02.55 1.37.2 2.39.1 2.64.64.7 1.03 1.59 1.03 2.68 0 3.84-2.34 4.68-4.57 4.93.36.31.68.92.68 1.85v2.74c0 .27.18.58.69.48A10 10 0 0 0 12 2z"/>',
|
|
4308
4588
|
x: '<path d="M4 3h4.5l4 5.5L17.5 3H21l-6.5 8.5L21 21h-4.5l-4.3-5.9L7 21H3.5l6.8-8.9z"/>',
|
|
@@ -4311,10 +4591,10 @@ var SOCIAL_GLYPHS = {
|
|
|
4311
4591
|
};
|
|
4312
4592
|
var escapeText = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
4313
4593
|
function Legal({ legal, legalLinks, switcher }) {
|
|
4314
|
-
return /* @__PURE__ */
|
|
4315
|
-
/* @__PURE__ */
|
|
4316
|
-
legalLinks && legalLinks.length > 0 && /* @__PURE__ */
|
|
4317
|
-
switcher ? /* @__PURE__ */
|
|
4594
|
+
return /* @__PURE__ */ jsxs36("div", { className: "ui-footer__bar", children: [
|
|
4595
|
+
/* @__PURE__ */ jsx41("span", { className: "ui-footer__legal", children: legal }),
|
|
4596
|
+
legalLinks && legalLinks.length > 0 && /* @__PURE__ */ jsx41("nav", { className: "ui-footer__legal-links", "aria-label": "Legal", children: legalLinks.map(({ label, href: to }) => /* @__PURE__ */ jsx41("a", { href: safeUrl3(to ?? "#"), children: label }, label)) }),
|
|
4597
|
+
switcher ? /* @__PURE__ */ jsx41("div", { className: "ui-footer__switcher", children: switcher }) : null
|
|
4318
4598
|
] });
|
|
4319
4599
|
}
|
|
4320
4600
|
function Footer({
|
|
@@ -4334,35 +4614,35 @@ function Footer({
|
|
|
4334
4614
|
}) {
|
|
4335
4615
|
const uid = useId13();
|
|
4336
4616
|
const cls = ["ui-footer", `ui-footer--${variant}`, className].filter(Boolean).join(" ");
|
|
4337
|
-
const bar = /* @__PURE__ */
|
|
4617
|
+
const bar = /* @__PURE__ */ jsx41(Legal, { legal, legalLinks, switcher });
|
|
4338
4618
|
if (variant !== "full") {
|
|
4339
|
-
return /* @__PURE__ */
|
|
4619
|
+
return /* @__PURE__ */ jsx41("footer", { ...rest, className: cls, role: "contentinfo", children: /* @__PURE__ */ jsx41("div", { className: "ui-footer__in", children: bar }) });
|
|
4340
4620
|
}
|
|
4341
4621
|
const mark = prism2(uid.replace(/:/g, ""), 22);
|
|
4342
|
-
const lockup = brand ?? /* @__PURE__ */
|
|
4622
|
+
const lockup = brand ?? /* @__PURE__ */ jsx41(
|
|
4343
4623
|
"a",
|
|
4344
4624
|
{
|
|
4345
4625
|
className: "brand",
|
|
4346
|
-
href:
|
|
4626
|
+
href: safeUrl3(brandHref),
|
|
4347
4627
|
"aria-label": `Apliteni ${word}`,
|
|
4348
4628
|
dangerouslySetInnerHTML: { __html: `${mark}<span>${escapeText(word)}</span>` }
|
|
4349
4629
|
}
|
|
4350
4630
|
);
|
|
4351
|
-
return /* @__PURE__ */
|
|
4352
|
-
/* @__PURE__ */
|
|
4353
|
-
brand !== false && /* @__PURE__ */
|
|
4631
|
+
return /* @__PURE__ */ jsx41("footer", { ...rest, className: cls, role: "contentinfo", children: /* @__PURE__ */ jsxs36("div", { className: "ui-footer__in", children: [
|
|
4632
|
+
/* @__PURE__ */ jsxs36("div", { className: "ui-footer__top", children: [
|
|
4633
|
+
brand !== false && /* @__PURE__ */ jsxs36("div", { className: "ui-footer__brand", children: [
|
|
4354
4634
|
lockup,
|
|
4355
|
-
tagline && /* @__PURE__ */
|
|
4356
|
-
social.length > 0 && /* @__PURE__ */
|
|
4635
|
+
tagline && /* @__PURE__ */ jsx41("p", { className: "ui-footer__tagline", children: tagline }),
|
|
4636
|
+
social.length > 0 && /* @__PURE__ */ jsx41("div", { className: "ui-footer__socials", children: social.map(({ label, href: to, icon: icon9 = "github" }) => {
|
|
4357
4637
|
const markup = SOCIAL_GLYPHS[icon9];
|
|
4358
4638
|
const fill = icon9 === "mail" ? "none" : "currentColor";
|
|
4359
4639
|
const viewBox = icon9 === "linkedin" ? "0 0 448 512" : "0 0 24 24";
|
|
4360
|
-
return /* @__PURE__ */
|
|
4640
|
+
return /* @__PURE__ */ jsx41("a", { className: "ui-footer__social", href: safeUrl3(to ?? "#"), "aria-label": label, children: /* @__PURE__ */ jsx41("svg", { viewBox, fill, "aria-hidden": "true", dangerouslySetInnerHTML: { __html: markup } }) }, label);
|
|
4361
4641
|
}) })
|
|
4362
4642
|
] }),
|
|
4363
|
-
(links || columns.length > 0) && /* @__PURE__ */
|
|
4364
|
-
title && /* @__PURE__ */
|
|
4365
|
-
/* @__PURE__ */
|
|
4643
|
+
(links || columns.length > 0) && /* @__PURE__ */ jsx41("nav", { className: "ui-footer__nav", "aria-label": "Footer", children: links ?? columns.map(({ title, links: columnLinks }, i) => /* @__PURE__ */ jsxs36("div", { className: "ui-footer__col", children: [
|
|
4644
|
+
title && /* @__PURE__ */ jsx41("h2", { className: "ui-footer__col-title", children: title }),
|
|
4645
|
+
/* @__PURE__ */ jsx41("ul", { className: "ui-footer__links", children: columnLinks.map(({ label, href: to, target }) => /* @__PURE__ */ jsx41("li", { children: /* @__PURE__ */ jsx41("a", { href: safeUrl3(to ?? "#"), target, rel: target ? "noreferrer" : void 0, children: label }) }, label)) })
|
|
4366
4646
|
] }, title ?? i)) })
|
|
4367
4647
|
] }),
|
|
4368
4648
|
bar
|
|
@@ -4370,11 +4650,11 @@ function Footer({
|
|
|
4370
4650
|
}
|
|
4371
4651
|
|
|
4372
4652
|
// src/Success.tsx
|
|
4373
|
-
import { forwardRef as
|
|
4374
|
-
import { jsx as
|
|
4375
|
-
var SuccessCheck =
|
|
4653
|
+
import { forwardRef as forwardRef11, useEffect as useEffect16, useRef as useRef21, useState as useState17 } from "react";
|
|
4654
|
+
import { jsx as jsx42, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4655
|
+
var SuccessCheck = forwardRef11(function SuccessCheck2({ variant = "line", className, ...rest }, ref) {
|
|
4376
4656
|
const circled = variant === "circled";
|
|
4377
|
-
return /* @__PURE__ */
|
|
4657
|
+
return /* @__PURE__ */ jsxs37(
|
|
4378
4658
|
"svg",
|
|
4379
4659
|
{
|
|
4380
4660
|
...rest,
|
|
@@ -4386,18 +4666,18 @@ var SuccessCheck = forwardRef10(function SuccessCheck2({ variant = "line", class
|
|
|
4386
4666
|
"aria-hidden": "true",
|
|
4387
4667
|
focusable: "false",
|
|
4388
4668
|
children: [
|
|
4389
|
-
circled && /* @__PURE__ */
|
|
4390
|
-
/* @__PURE__ */
|
|
4669
|
+
circled && /* @__PURE__ */ jsx42("path", { className: "ui-sx__circle", d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
4670
|
+
/* @__PURE__ */ jsx42("path", { className: "ui-sx__tick", d: circled ? "M22 4L12 14.01l-3-3" : "M20 6L9 17l-5-5" })
|
|
4391
4671
|
]
|
|
4392
4672
|
}
|
|
4393
4673
|
);
|
|
4394
4674
|
});
|
|
4395
|
-
var SuccessPanel =
|
|
4675
|
+
var SuccessPanel = forwardRef11(function SuccessPanel2({ title = "Done", sub, check = "line", className, ...rest }, ref) {
|
|
4396
4676
|
const circled = check === "circled";
|
|
4397
|
-
return /* @__PURE__ */
|
|
4398
|
-
/* @__PURE__ */
|
|
4399
|
-
/* @__PURE__ */
|
|
4400
|
-
sub && /* @__PURE__ */
|
|
4677
|
+
return /* @__PURE__ */ jsxs37("div", { ...rest, ref, className: ["ui-success", className].filter(Boolean).join(" "), children: [
|
|
4678
|
+
/* @__PURE__ */ jsx42("div", { className: ["ui-success__check", circled && "ui-success__check--circled"].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx42(SuccessCheck, { variant: circled ? "circled" : "line" }) }),
|
|
4679
|
+
/* @__PURE__ */ jsx42("div", { className: "ui-success__title", children: title }),
|
|
4680
|
+
sub && /* @__PURE__ */ jsx42("div", { className: "ui-success__sub", children: sub })
|
|
4401
4681
|
] });
|
|
4402
4682
|
});
|
|
4403
4683
|
var pieces = [
|
|
@@ -4434,17 +4714,17 @@ function Countdown({ seconds, label = "Redirecting", onDone }) {
|
|
|
4434
4714
|
}, 1e3);
|
|
4435
4715
|
return () => clearInterval(timer);
|
|
4436
4716
|
}, [seconds]);
|
|
4437
|
-
return /* @__PURE__ */
|
|
4438
|
-
/* @__PURE__ */
|
|
4439
|
-
/* @__PURE__ */
|
|
4717
|
+
return /* @__PURE__ */ jsxs37("div", { className: "ui-sx__count", "data-sx-count": "", style: { "--sx-secs": `${seconds}s` }, children: [
|
|
4718
|
+
/* @__PURE__ */ jsx42("span", { className: "ui-sx__count-ring", "aria-hidden": "true" }),
|
|
4719
|
+
/* @__PURE__ */ jsxs37("span", { className: "ui-sx__count-text", children: [
|
|
4440
4720
|
label,
|
|
4441
4721
|
" in ",
|
|
4442
|
-
/* @__PURE__ */
|
|
4722
|
+
/* @__PURE__ */ jsx42("b", { "data-sx-num": "", children: remaining }),
|
|
4443
4723
|
"s"
|
|
4444
4724
|
] })
|
|
4445
4725
|
] });
|
|
4446
4726
|
}
|
|
4447
|
-
var Success =
|
|
4727
|
+
var Success = forwardRef11(function Success2({
|
|
4448
4728
|
layout = "hero",
|
|
4449
4729
|
level,
|
|
4450
4730
|
check = "line",
|
|
@@ -4466,7 +4746,7 @@ var Success = forwardRef10(function Success2({
|
|
|
4466
4746
|
const seconds = countdown?.seconds;
|
|
4467
4747
|
const duration = seconds != null && Number.isFinite(seconds) && seconds >= 1 ? Math.floor(seconds) : 5;
|
|
4468
4748
|
const mark = check === "circled" ? "circled" : "line";
|
|
4469
|
-
return /* @__PURE__ */
|
|
4749
|
+
return /* @__PURE__ */ jsxs37(
|
|
4470
4750
|
"div",
|
|
4471
4751
|
{
|
|
4472
4752
|
role: "status",
|
|
@@ -4475,16 +4755,16 @@ var Success = forwardRef10(function Success2({
|
|
|
4475
4755
|
ref,
|
|
4476
4756
|
className: ["ui-sx", `ui-sx--${layout}`, `ui-sx--check-${mark}`, confetti && "ui-sx--confetti", className].filter(Boolean).join(" "),
|
|
4477
4757
|
children: [
|
|
4478
|
-
confetti && /* @__PURE__ */
|
|
4479
|
-
([x, d, r, t, s], index) => /* @__PURE__ */
|
|
4758
|
+
confetti && /* @__PURE__ */ jsx42("div", { className: "ui-sx__confetti", "aria-hidden": "true", children: pieces.map(
|
|
4759
|
+
([x, d, r, t, s], index) => /* @__PURE__ */ jsx42("i", { className: `ui-sx__piece ui-sx__piece--${t}`, style: { left: `${x}%`, "--sx-d": `${d}s`, "--sx-r": `${r}deg`, "--sx-s": s } }, index)
|
|
4480
4760
|
) }),
|
|
4481
|
-
/* @__PURE__ */
|
|
4482
|
-
/* @__PURE__ */
|
|
4483
|
-
/* @__PURE__ */
|
|
4484
|
-
/* @__PURE__ */
|
|
4485
|
-
body && /* @__PURE__ */
|
|
4486
|
-
hasActions && /* @__PURE__ */
|
|
4487
|
-
countdown && /* @__PURE__ */
|
|
4761
|
+
/* @__PURE__ */ jsxs37("div", { className: "ui-sx__inner", children: [
|
|
4762
|
+
/* @__PURE__ */ jsx42("div", { className: "ui-sx__visual", children: /* @__PURE__ */ jsx42(SuccessCheck, { variant: mark }) }),
|
|
4763
|
+
/* @__PURE__ */ jsxs37("div", { className: "ui-sx__content", children: [
|
|
4764
|
+
/* @__PURE__ */ jsx42(Heading, { className: "ui-sx__title", children: title }),
|
|
4765
|
+
body && /* @__PURE__ */ jsx42("p", { className: "ui-sx__body", children: body }),
|
|
4766
|
+
hasActions && /* @__PURE__ */ jsx42("div", { className: "ui-sx__actions", children: actions }),
|
|
4767
|
+
countdown && /* @__PURE__ */ jsx42(Countdown, { seconds: duration, label: countdown.label, onDone: onCountdownEnd }, duration)
|
|
4488
4768
|
] })
|
|
4489
4769
|
] })
|
|
4490
4770
|
]
|
|
@@ -4503,7 +4783,7 @@ import {
|
|
|
4503
4783
|
useState as useState18
|
|
4504
4784
|
} from "react";
|
|
4505
4785
|
import { CHART_FLOOR, bridgeWalk, chartScale, pointTarget } from "@apliteni/apliteni-ui";
|
|
4506
|
-
import { Fragment as
|
|
4786
|
+
import { Fragment as Fragment17, jsx as jsx43, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
4507
4787
|
var HEIGHT = { months: 216, bridge: 216, spark: 32 };
|
|
4508
4788
|
var PAD = 2;
|
|
4509
4789
|
var ZERO_INSET = 1.5;
|
|
@@ -4879,7 +5159,7 @@ function Chart(props) {
|
|
|
4879
5159
|
const estimated = columns.filter((c) => c.estimated);
|
|
4880
5160
|
const estimatedTone = marks.find((m) => m.estimated && m.kind === "bar")?.tone ?? keys[0]?.tone ?? "neutral";
|
|
4881
5161
|
const hitBand = (band) => band === "up" ? { y: PAD, h: Math.max(zero - PAD, TARGET) } : band === "down" ? { y: zero, h: Math.max(plotHeight - PAD - zero, TARGET) } : { y: PAD, h: Math.max(plotHeight - PAD * 2, TARGET) };
|
|
4882
|
-
return /* @__PURE__ */
|
|
5162
|
+
return /* @__PURE__ */ jsxs38(
|
|
4883
5163
|
"div",
|
|
4884
5164
|
{
|
|
4885
5165
|
className: cx8("ui-chart", `ui-chart--${variant}`, selectable && "ui-chart--pick", className),
|
|
@@ -4890,9 +5170,9 @@ function Chart(props) {
|
|
|
4890
5170
|
"--ui-chart-pad": `${PAD}px`
|
|
4891
5171
|
},
|
|
4892
5172
|
children: [
|
|
4893
|
-
!spark && keys.length > 0 && /* @__PURE__ */
|
|
4894
|
-
keys.map((key) => /* @__PURE__ */
|
|
4895
|
-
key.shape === "line" ? /* @__PURE__ */
|
|
5173
|
+
!spark && keys.length > 0 && /* @__PURE__ */ jsxs38("ul", { className: "ui-chart__legend", children: [
|
|
5174
|
+
keys.map((key) => /* @__PURE__ */ jsxs38("li", { className: cx8("ui-chart__key", `ui-chart__tone--${key.tone}`), children: [
|
|
5175
|
+
key.shape === "line" ? /* @__PURE__ */ jsx43("svg", { className: "ui-chart__key-mark", width: "18", height: "12", viewBox: "0 0 18 12", "aria-hidden": "true", children: /* @__PURE__ */ jsx43("path", { className: "ui-chart__key-line", d: "M1 9 L6 5 L12 7 L17 3" }) }) : /* @__PURE__ */ jsx43("svg", { className: "ui-chart__key-mark", width: "12", height: "12", viewBox: "0 0 12 12", "aria-hidden": "true", children: /* @__PURE__ */ jsx43(
|
|
4896
5176
|
"rect",
|
|
4897
5177
|
{
|
|
4898
5178
|
className: "ui-chart__key-swatch",
|
|
@@ -4905,12 +5185,12 @@ function Chart(props) {
|
|
|
4905
5185
|
) }),
|
|
4906
5186
|
key.name
|
|
4907
5187
|
] }, key.id)),
|
|
4908
|
-
estimated.length > 0 && /* @__PURE__ */
|
|
4909
|
-
/* @__PURE__ */
|
|
5188
|
+
estimated.length > 0 && /* @__PURE__ */ jsxs38("li", { className: cx8("ui-chart__key", `ui-chart__tone--${estimatedTone}`), children: [
|
|
5189
|
+
/* @__PURE__ */ jsx43("svg", { className: "ui-chart__key-mark", width: "12", height: "12", viewBox: "0 0 12 12", "aria-hidden": "true", children: /* @__PURE__ */ jsx43("rect", { className: "ui-chart__key-estimated", x: "1.5", y: "1.5", width: "9", height: "9", rx: "1" }) }),
|
|
4910
5190
|
"Estimated"
|
|
4911
5191
|
] })
|
|
4912
5192
|
] }),
|
|
4913
|
-
/* @__PURE__ */
|
|
5193
|
+
/* @__PURE__ */ jsxs38(
|
|
4914
5194
|
"div",
|
|
4915
5195
|
{
|
|
4916
5196
|
ref: frameEl,
|
|
@@ -4934,8 +5214,8 @@ function Chart(props) {
|
|
|
4934
5214
|
setSaid("");
|
|
4935
5215
|
},
|
|
4936
5216
|
children: [
|
|
4937
|
-
!spark && scale.ticks.length > 0 && /* @__PURE__ */
|
|
4938
|
-
/* @__PURE__ */
|
|
5217
|
+
!spark && scale.ticks.length > 0 && /* @__PURE__ */ jsx43("div", { className: "ui-chart__axis", "aria-hidden": "true", children: [...scale.ticks].reverse().map((tick) => /* @__PURE__ */ jsx43("span", { className: "ui-chart__tick", children: formatAxis(tick) }, tick)) }),
|
|
5218
|
+
/* @__PURE__ */ jsx43("div", { ref: scroller, className: "ui-chart__scroll", tabIndex: -1, onScroll: () => {
|
|
4939
5219
|
syncEdges();
|
|
4940
5220
|
const anchor = [...svgEl.current?.querySelectorAll("[data-anchor]") ?? []].find((el) => el.getAttribute("data-anchor") === openId);
|
|
4941
5221
|
if (!anchor || !scroller.current || !frameEl.current || !tipEl.current) return;
|
|
@@ -4943,8 +5223,8 @@ function Chart(props) {
|
|
|
4943
5223
|
const view = scroller.current.getBoundingClientRect();
|
|
4944
5224
|
if (mark.right <= view.left || mark.left >= view.right) setOpenId(null);
|
|
4945
5225
|
else placeTip(frameEl.current, anchor, tipEl.current, frameEl.current);
|
|
4946
|
-
}, children: /* @__PURE__ */
|
|
4947
|
-
/* @__PURE__ */
|
|
5226
|
+
}, children: /* @__PURE__ */ jsxs38("div", { ref: plot, className: "ui-chart__plot", children: [
|
|
5227
|
+
/* @__PURE__ */ jsxs38(
|
|
4948
5228
|
"svg",
|
|
4949
5229
|
{
|
|
4950
5230
|
ref: svgEl,
|
|
@@ -5004,7 +5284,7 @@ function Chart(props) {
|
|
|
5004
5284
|
announce(mark.column, selectable ? mark.column : pick);
|
|
5005
5285
|
},
|
|
5006
5286
|
children: [
|
|
5007
|
-
!spark && pick !== null && pick >= 0 && pick < count && /* @__PURE__ */
|
|
5287
|
+
!spark && pick !== null && pick >= 0 && pick < count && /* @__PURE__ */ jsx43(
|
|
5008
5288
|
"rect",
|
|
5009
5289
|
{
|
|
5010
5290
|
className: "ui-chart__band",
|
|
@@ -5017,7 +5297,7 @@ function Chart(props) {
|
|
|
5017
5297
|
frame.links && frame.bars.slice(0, -1).map((bar, i) => {
|
|
5018
5298
|
const from = byId.get(bar.id);
|
|
5019
5299
|
const to = byId.get(frame.bars[i + 1].id);
|
|
5020
|
-
return from && to ? /* @__PURE__ */
|
|
5300
|
+
return from && to ? /* @__PURE__ */ jsx43(
|
|
5021
5301
|
"line",
|
|
5022
5302
|
{
|
|
5023
5303
|
className: "ui-chart__carry",
|
|
@@ -5029,7 +5309,7 @@ function Chart(props) {
|
|
|
5029
5309
|
`carry-${bar.id}`
|
|
5030
5310
|
) : null;
|
|
5031
5311
|
}),
|
|
5032
|
-
!spark && scale.ticks.filter((tick) => tick !== 0).map((tick) => /* @__PURE__ */
|
|
5312
|
+
!spark && scale.ticks.filter((tick) => tick !== 0).map((tick) => /* @__PURE__ */ jsx43(
|
|
5033
5313
|
"line",
|
|
5034
5314
|
{
|
|
5035
5315
|
className: "ui-chart__grid",
|
|
@@ -5040,7 +5320,7 @@ function Chart(props) {
|
|
|
5040
5320
|
},
|
|
5041
5321
|
`grid-${tick}`
|
|
5042
5322
|
)),
|
|
5043
|
-
!spark && scale.ticks.includes(0) && /* @__PURE__ */
|
|
5323
|
+
!spark && scale.ticks.includes(0) && /* @__PURE__ */ jsx43(
|
|
5044
5324
|
"line",
|
|
5045
5325
|
{
|
|
5046
5326
|
className: "ui-chart__zero",
|
|
@@ -5050,7 +5330,7 @@ function Chart(props) {
|
|
|
5050
5330
|
y2: px(y(0))
|
|
5051
5331
|
}
|
|
5052
5332
|
),
|
|
5053
|
-
marks.filter((m) => m.kind === "bar").map((mark) => /* @__PURE__ */
|
|
5333
|
+
marks.filter((m) => m.kind === "bar").map((mark) => /* @__PURE__ */ jsx43(
|
|
5054
5334
|
"path",
|
|
5055
5335
|
{
|
|
5056
5336
|
className: cx8(
|
|
@@ -5063,7 +5343,7 @@ function Chart(props) {
|
|
|
5063
5343
|
`bar-${mark.id}`
|
|
5064
5344
|
)),
|
|
5065
5345
|
["casing", "stroke"].map((layer) => lines.flatMap(
|
|
5066
|
-
(line) => line.values.slice(1).map((value, i) => Number.isFinite(value) && Number.isFinite(line.values[i]) ? /* @__PURE__ */
|
|
5346
|
+
(line) => line.values.slice(1).map((value, i) => Number.isFinite(value) && Number.isFinite(line.values[i]) ? /* @__PURE__ */ jsx43(
|
|
5067
5347
|
"line",
|
|
5068
5348
|
{
|
|
5069
5349
|
className: layer === "casing" ? "ui-chart__line-casing" : cx8(
|
|
@@ -5079,7 +5359,7 @@ function Chart(props) {
|
|
|
5079
5359
|
`${line.id}-${layer}-${i}`
|
|
5080
5360
|
) : null)
|
|
5081
5361
|
)),
|
|
5082
|
-
lines.flatMap((line) => line.values.map((value, i) => Number.isFinite(value) && !Number.isFinite(line.values[i - 1]) && !Number.isFinite(line.values[i + 1]) ? /* @__PURE__ */
|
|
5362
|
+
lines.flatMap((line) => line.values.map((value, i) => Number.isFinite(value) && !Number.isFinite(line.values[i - 1]) && !Number.isFinite(line.values[i + 1]) ? /* @__PURE__ */ jsx43(
|
|
5083
5363
|
"circle",
|
|
5084
5364
|
{
|
|
5085
5365
|
className: cx8("ui-chart__isolated", `ui-chart__tone--${line.tone}`),
|
|
@@ -5089,8 +5369,8 @@ function Chart(props) {
|
|
|
5089
5369
|
},
|
|
5090
5370
|
`isolated-${line.id}-${i}`
|
|
5091
5371
|
) : null)),
|
|
5092
|
-
marks.map((mark) => /* @__PURE__ */
|
|
5093
|
-
mark.kind === "bar" ? /* @__PURE__ */
|
|
5372
|
+
marks.map((mark) => /* @__PURE__ */ jsxs38("g", { "data-mark": mark.id, children: [
|
|
5373
|
+
mark.kind === "bar" ? /* @__PURE__ */ jsx43(
|
|
5094
5374
|
"rect",
|
|
5095
5375
|
{
|
|
5096
5376
|
className: "ui-chart__hit",
|
|
@@ -5099,7 +5379,7 @@ function Chart(props) {
|
|
|
5099
5379
|
y: px(hitBand(mark.band).y),
|
|
5100
5380
|
height: px(hitBand(mark.band).h)
|
|
5101
5381
|
}
|
|
5102
|
-
) : /* @__PURE__ */
|
|
5382
|
+
) : /* @__PURE__ */ jsx43(
|
|
5103
5383
|
"rect",
|
|
5104
5384
|
{
|
|
5105
5385
|
className: "ui-chart__hit",
|
|
@@ -5109,7 +5389,7 @@ function Chart(props) {
|
|
|
5109
5389
|
height: px(mark.hit?.h ?? TARGET)
|
|
5110
5390
|
}
|
|
5111
5391
|
),
|
|
5112
|
-
/* @__PURE__ */
|
|
5392
|
+
/* @__PURE__ */ jsx43(
|
|
5113
5393
|
"rect",
|
|
5114
5394
|
{
|
|
5115
5395
|
"data-anchor": mark.id,
|
|
@@ -5124,7 +5404,7 @@ function Chart(props) {
|
|
|
5124
5404
|
]
|
|
5125
5405
|
}
|
|
5126
5406
|
),
|
|
5127
|
-
!spark && /* @__PURE__ */
|
|
5407
|
+
!spark && /* @__PURE__ */ jsx43("div", { className: "ui-chart__periods", "aria-hidden": "true", children: columns.map((column, i) => /* @__PURE__ */ jsx43(
|
|
5128
5408
|
"span",
|
|
5129
5409
|
{
|
|
5130
5410
|
className: cx8("ui-chart__period", pick === i && "is-selected"),
|
|
@@ -5133,35 +5413,35 @@ function Chart(props) {
|
|
|
5133
5413
|
`${column.label}-${i}`
|
|
5134
5414
|
)) })
|
|
5135
5415
|
] }) }),
|
|
5136
|
-
/* @__PURE__ */
|
|
5137
|
-
/* @__PURE__ */
|
|
5138
|
-
/* @__PURE__ */
|
|
5139
|
-
(stateOf(columns[open.column]) || open.detail) && /* @__PURE__ */
|
|
5416
|
+
/* @__PURE__ */ jsx43("span", { ref: tipEl, className: cx8("ui-tip", openId && "is-open"), role: open ? "tooltip" : void 0, children: open && /* @__PURE__ */ jsxs38(Fragment17, { children: [
|
|
5417
|
+
/* @__PURE__ */ jsx43("span", { className: "ui-tip__label", children: spark ? columns[open.column]?.label : `${open.name}, ${columns[open.column]?.label}` }),
|
|
5418
|
+
/* @__PURE__ */ jsx43("span", { className: "ui-tip__value", children: format(open.value) }),
|
|
5419
|
+
(stateOf(columns[open.column]) || open.detail) && /* @__PURE__ */ jsx43("span", { className: "ui-tip__detail", children: stateOf(columns[open.column]) || open.detail })
|
|
5140
5420
|
] }) })
|
|
5141
5421
|
]
|
|
5142
5422
|
}
|
|
5143
5423
|
),
|
|
5144
|
-
/* @__PURE__ */
|
|
5145
|
-
showTable && /* @__PURE__ */
|
|
5146
|
-
/* @__PURE__ */
|
|
5147
|
-
/* @__PURE__ */
|
|
5424
|
+
/* @__PURE__ */ jsx43("div", { className: "ui-sr", role: "status", children: said }),
|
|
5425
|
+
showTable && /* @__PURE__ */ jsxs38("details", { className: "ui-chart__data", children: [
|
|
5426
|
+
/* @__PURE__ */ jsx43("summary", { className: "ui-focusable", children: "Values as a table" }),
|
|
5427
|
+
/* @__PURE__ */ jsx43(
|
|
5148
5428
|
"div",
|
|
5149
5429
|
{
|
|
5150
5430
|
className: "ui-table-scroll",
|
|
5151
5431
|
role: "region",
|
|
5152
5432
|
tabIndex: 0,
|
|
5153
5433
|
"aria-label": `${title}, as a table. Scroll for more columns.`,
|
|
5154
|
-
children: /* @__PURE__ */
|
|
5155
|
-
/* @__PURE__ */
|
|
5156
|
-
/* @__PURE__ */
|
|
5157
|
-
/* @__PURE__ */
|
|
5434
|
+
children: /* @__PURE__ */ jsxs38("table", { className: "ui-table", "aria-label": title, children: [
|
|
5435
|
+
/* @__PURE__ */ jsx43("thead", { children: /* @__PURE__ */ jsx43("tr", { children: tableHead.map((head, i) => /* @__PURE__ */ jsx43("th", { scope: "col", className: cx8(i > 0 && "ui-table__num"), children: head }, head)) }) }),
|
|
5436
|
+
/* @__PURE__ */ jsx43("tbody", { children: tableRows.map((row, i) => /* @__PURE__ */ jsxs38("tr", { "aria-current": pick === i ? true : void 0, children: [
|
|
5437
|
+
/* @__PURE__ */ jsxs38("th", { scope: "row", children: [
|
|
5158
5438
|
row.column.label,
|
|
5159
|
-
row.column.estimated && /* @__PURE__ */
|
|
5439
|
+
row.column.estimated && /* @__PURE__ */ jsxs38(Fragment17, { children: [
|
|
5160
5440
|
" ",
|
|
5161
|
-
/* @__PURE__ */
|
|
5441
|
+
/* @__PURE__ */ jsx43("span", { className: "ui-chart__state", children: stateOf(row.column) })
|
|
5162
5442
|
] })
|
|
5163
5443
|
] }),
|
|
5164
|
-
row.cells.map((cell, j) => /* @__PURE__ */
|
|
5444
|
+
row.cells.map((cell, j) => /* @__PURE__ */ jsx43("td", { className: "ui-table__num", children: cell }, tableHead[j + 1]))
|
|
5165
5445
|
] }, `${row.column.label}-${i}`)) })
|
|
5166
5446
|
] })
|
|
5167
5447
|
}
|
|
@@ -5173,10 +5453,10 @@ function Chart(props) {
|
|
|
5173
5453
|
}
|
|
5174
5454
|
|
|
5175
5455
|
// src/AccentPicker.tsx
|
|
5176
|
-
import { forwardRef as
|
|
5456
|
+
import { forwardRef as forwardRef12 } from "react";
|
|
5177
5457
|
import { ACCENTS, accentSwatchStyle } from "@apliteni/apliteni-ui";
|
|
5178
|
-
import { jsx as
|
|
5179
|
-
var AccentPicker =
|
|
5458
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
5459
|
+
var AccentPicker = forwardRef12(function AccentPicker2({
|
|
5180
5460
|
value,
|
|
5181
5461
|
onChange,
|
|
5182
5462
|
options = ACCENTS,
|
|
@@ -5184,7 +5464,7 @@ var AccentPicker = forwardRef11(function AccentPicker2({
|
|
|
5184
5464
|
"aria-label": label = "Accent",
|
|
5185
5465
|
...rest
|
|
5186
5466
|
}, ref) {
|
|
5187
|
-
return /* @__PURE__ */
|
|
5467
|
+
return /* @__PURE__ */ jsx44(
|
|
5188
5468
|
"div",
|
|
5189
5469
|
{
|
|
5190
5470
|
...rest,
|
|
@@ -5195,7 +5475,7 @@ var AccentPicker = forwardRef11(function AccentPicker2({
|
|
|
5195
5475
|
"aria-label": label,
|
|
5196
5476
|
children: options.map((accent) => {
|
|
5197
5477
|
const title = accent.charAt(0).toUpperCase() + accent.slice(1);
|
|
5198
|
-
return /* @__PURE__ */
|
|
5478
|
+
return /* @__PURE__ */ jsx44(
|
|
5199
5479
|
"button",
|
|
5200
5480
|
{
|
|
5201
5481
|
type: "button",
|
|
@@ -5214,9 +5494,9 @@ var AccentPicker = forwardRef11(function AccentPicker2({
|
|
|
5214
5494
|
});
|
|
5215
5495
|
|
|
5216
5496
|
// src/TopBar.tsx
|
|
5217
|
-
import { Fragment as
|
|
5218
|
-
import { prism as prism3, safeUrl as
|
|
5219
|
-
import { Fragment as
|
|
5497
|
+
import { Fragment as Fragment18 } from "react";
|
|
5498
|
+
import { prism as prism3, safeUrl as safeUrl4, icon as icon8, ACCOUNT_NAV } from "@apliteni/apliteni-ui";
|
|
5499
|
+
import { Fragment as Fragment19, jsx as jsx45, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
5220
5500
|
function TopBar({
|
|
5221
5501
|
brand,
|
|
5222
5502
|
word = "Strategy",
|
|
@@ -5228,35 +5508,35 @@ function TopBar({
|
|
|
5228
5508
|
className,
|
|
5229
5509
|
...rest
|
|
5230
5510
|
}) {
|
|
5231
|
-
return /* @__PURE__ */
|
|
5232
|
-
brand ?? /* @__PURE__ */
|
|
5233
|
-
/* @__PURE__ */
|
|
5234
|
-
/* @__PURE__ */
|
|
5511
|
+
return /* @__PURE__ */ jsx45("header", { ...rest, className: ["topbar", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs39("div", { className: "topbar__in", children: [
|
|
5512
|
+
brand ?? /* @__PURE__ */ jsxs39("a", { className: "brand", href: safeUrl4(brandHref), "aria-label": `Apliteni ${word}`, children: [
|
|
5513
|
+
/* @__PURE__ */ jsx45("span", { "aria-hidden": "true", dangerouslySetInnerHTML: { __html: prism3("tb-mark", 22) } }),
|
|
5514
|
+
/* @__PURE__ */ jsx45("span", { children: word })
|
|
5235
5515
|
] }),
|
|
5236
5516
|
view,
|
|
5237
|
-
/* @__PURE__ */
|
|
5517
|
+
/* @__PURE__ */ jsx45("span", { className: "spacer" }),
|
|
5238
5518
|
version,
|
|
5239
5519
|
theme,
|
|
5240
5520
|
account
|
|
5241
5521
|
] }) });
|
|
5242
5522
|
}
|
|
5243
5523
|
function ViewSwitch({ items, active, label = "View", renderLink }) {
|
|
5244
|
-
return /* @__PURE__ */
|
|
5524
|
+
return /* @__PURE__ */ jsx45("div", { className: "dtsw on", role: "group", "aria-label": label, children: items.map((item) => {
|
|
5245
5525
|
const current = item.id === active;
|
|
5246
5526
|
const linkProps = {
|
|
5247
5527
|
className: current ? "cur" : void 0,
|
|
5248
|
-
href:
|
|
5528
|
+
href: safeUrl4(item.href || `#${item.id}`),
|
|
5249
5529
|
target: item.target,
|
|
5250
5530
|
"aria-current": current ? "page" : void 0,
|
|
5251
5531
|
children: item.label
|
|
5252
5532
|
};
|
|
5253
|
-
return /* @__PURE__ */
|
|
5533
|
+
return /* @__PURE__ */ jsx45(Fragment18, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx45("a", { ...linkProps }) }, item.id);
|
|
5254
5534
|
}) });
|
|
5255
5535
|
}
|
|
5256
5536
|
var BADGE = { live: "Live", archive: "Archive" };
|
|
5257
5537
|
function VersionSwitcher({ versions, value, onChange, label = "Version", defaultOpen }) {
|
|
5258
5538
|
const current = versions.find((v) => v.value === value);
|
|
5259
|
-
return /* @__PURE__ */
|
|
5539
|
+
return /* @__PURE__ */ jsx45("div", { className: "vsw", children: /* @__PURE__ */ jsx45(
|
|
5260
5540
|
Dropdown,
|
|
5261
5541
|
{
|
|
5262
5542
|
variant: "select",
|
|
@@ -5267,9 +5547,9 @@ function VersionSwitcher({ versions, value, onChange, label = "Version", default
|
|
|
5267
5547
|
chevron: false,
|
|
5268
5548
|
defaultOpen,
|
|
5269
5549
|
ariaLabel: `${label} \u2014 ${current?.label ?? ""}`,
|
|
5270
|
-
triggerContent: /* @__PURE__ */
|
|
5271
|
-
/* @__PURE__ */
|
|
5272
|
-
/* @__PURE__ */
|
|
5550
|
+
triggerContent: /* @__PURE__ */ jsxs39(Fragment19, { children: [
|
|
5551
|
+
/* @__PURE__ */ jsx45("span", { className: "cur", children: current?.label }),
|
|
5552
|
+
/* @__PURE__ */ jsx45("span", { className: "car", "aria-hidden": "true" })
|
|
5273
5553
|
] }),
|
|
5274
5554
|
items: versions.map((v) => ({
|
|
5275
5555
|
label: v.label,
|
|
@@ -5277,10 +5557,10 @@ function VersionSwitcher({ versions, value, onChange, label = "Version", default
|
|
|
5277
5557
|
badge: BADGE[v.badge ?? "archive"],
|
|
5278
5558
|
selected: v.value === value
|
|
5279
5559
|
})),
|
|
5280
|
-
row: (item, props) => /* @__PURE__ */
|
|
5281
|
-
/* @__PURE__ */
|
|
5282
|
-
/* @__PURE__ */
|
|
5283
|
-
/* @__PURE__ */
|
|
5560
|
+
row: (item, props) => /* @__PURE__ */ jsxs39("div", { ...props, className: `${props.className} vopt`, children: [
|
|
5561
|
+
/* @__PURE__ */ jsx45("span", { className: "vname", children: item.label }),
|
|
5562
|
+
/* @__PURE__ */ jsx45("span", { className: `vbadge ${item.badge === "Live" ? "live" : "arch"}`, children: String(item.badge) }),
|
|
5563
|
+
/* @__PURE__ */ jsx45("span", { className: "vtick", "aria-hidden": "true", dangerouslySetInnerHTML: { __html: icon8("check") } })
|
|
5284
5564
|
] }),
|
|
5285
5565
|
onSelect: (picked) => {
|
|
5286
5566
|
if (picked != null) onChange?.(String(picked));
|
|
@@ -5309,7 +5589,7 @@ function AccountMenu({
|
|
|
5309
5589
|
defaultOpen
|
|
5310
5590
|
}) {
|
|
5311
5591
|
const mark = initialsOf(name, email);
|
|
5312
|
-
return /* @__PURE__ */
|
|
5592
|
+
return /* @__PURE__ */ jsx45("div", { className: "acct on", children: /* @__PURE__ */ jsx45(
|
|
5313
5593
|
Dropdown,
|
|
5314
5594
|
{
|
|
5315
5595
|
variant: "menu",
|
|
@@ -5320,22 +5600,22 @@ function AccountMenu({
|
|
|
5320
5600
|
defaultOpen,
|
|
5321
5601
|
ariaLabel: "Account",
|
|
5322
5602
|
triggerContent: mark,
|
|
5323
|
-
header: /* @__PURE__ */
|
|
5324
|
-
/* @__PURE__ */
|
|
5325
|
-
/* @__PURE__ */
|
|
5326
|
-
/* @__PURE__ */
|
|
5327
|
-
/* @__PURE__ */
|
|
5603
|
+
header: /* @__PURE__ */ jsxs39("div", { className: "ahead", children: [
|
|
5604
|
+
/* @__PURE__ */ jsx45("span", { className: "avatar", children: mark }),
|
|
5605
|
+
/* @__PURE__ */ jsxs39("span", { className: "aw", children: [
|
|
5606
|
+
/* @__PURE__ */ jsx45("span", { className: "anm", children: name }),
|
|
5607
|
+
/* @__PURE__ */ jsx45("span", { className: "aem", title: email, children: email })
|
|
5328
5608
|
] })
|
|
5329
5609
|
] }),
|
|
5330
5610
|
items: [...items, "---", { label: "Sign out", icon: "logout", value: "sign-out", href: signOutHref }],
|
|
5331
|
-
row: (item, props) => /* @__PURE__ */
|
|
5611
|
+
row: (item, props) => /* @__PURE__ */ jsxs39(
|
|
5332
5612
|
"a",
|
|
5333
5613
|
{
|
|
5334
5614
|
...props,
|
|
5335
|
-
href: item.disabled ? void 0 : item.href ?
|
|
5615
|
+
href: item.disabled ? void 0 : item.href ? safeUrl4(item.href) : item.value === "sign-out" && onSignOut ? void 0 : safeUrl4(item.value === "sign-out" ? "#logout" : `#${item.value}`),
|
|
5336
5616
|
className: [props.className.replace(/\bui-dropdown__item\b/, "").trim(), !item.disabled && item.value === current && "cur", item.value === "sign-out" && "aout"].filter(Boolean).join(" "),
|
|
5337
5617
|
children: [
|
|
5338
|
-
item.icon && /* @__PURE__ */
|
|
5618
|
+
item.icon && /* @__PURE__ */ jsx45("span", { "aria-hidden": "true", dangerouslySetInnerHTML: { __html: icon8(item.icon) } }),
|
|
5339
5619
|
item.label
|
|
5340
5620
|
]
|
|
5341
5621
|
}
|
|
@@ -5349,10 +5629,10 @@ function AccountMenu({
|
|
|
5349
5629
|
}
|
|
5350
5630
|
|
|
5351
5631
|
// src/NavTabs.tsx
|
|
5352
|
-
import { Fragment as
|
|
5353
|
-
import { safeUrl as
|
|
5354
|
-
import { Fragment as
|
|
5355
|
-
var NavTabs =
|
|
5632
|
+
import { Fragment as Fragment20, forwardRef as forwardRef13, useEffect as useEffect18, useRef as useRef23, useImperativeHandle as useImperativeHandle2 } from "react";
|
|
5633
|
+
import { safeUrl as safeUrl5, observeNavFit, revealCurrentNav, revealFocusedNav } from "@apliteni/apliteni-ui";
|
|
5634
|
+
import { Fragment as Fragment21, jsx as jsx46, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
5635
|
+
var NavTabs = forwardRef13(function NavTabs2({
|
|
5356
5636
|
items,
|
|
5357
5637
|
active,
|
|
5358
5638
|
variant = "underline",
|
|
@@ -5369,7 +5649,7 @@ var NavTabs = forwardRef12(function NavTabs2({
|
|
|
5369
5649
|
useEffect18(() => {
|
|
5370
5650
|
if (navRef.current) revealCurrentNav(navRef.current);
|
|
5371
5651
|
}, [active, signature]);
|
|
5372
|
-
return /* @__PURE__ */
|
|
5652
|
+
return /* @__PURE__ */ jsx46(
|
|
5373
5653
|
"nav",
|
|
5374
5654
|
{
|
|
5375
5655
|
...rest,
|
|
@@ -5382,63 +5662,25 @@ var NavTabs = forwardRef12(function NavTabs2({
|
|
|
5382
5662
|
},
|
|
5383
5663
|
children: items.map((item) => {
|
|
5384
5664
|
const badge = item.badge != null && typeof item.badge === "object" ? item.badge : { text: item.badge, tone: void 0 };
|
|
5385
|
-
const inner = /* @__PURE__ */
|
|
5386
|
-
/* @__PURE__ */
|
|
5387
|
-
badge.text != null && badge.text !== "" && /* @__PURE__ */
|
|
5665
|
+
const inner = /* @__PURE__ */ jsxs40(Fragment21, { children: [
|
|
5666
|
+
/* @__PURE__ */ jsx46("span", { className: "ui-nav__tab-label", children: item.label }),
|
|
5667
|
+
badge.text != null && badge.text !== "" && /* @__PURE__ */ jsx46("span", { className: `ui-nav__badge is-${badge.tone || "neutral"}`, children: badge.text })
|
|
5388
5668
|
] });
|
|
5389
|
-
if (item.disabled) return /* @__PURE__ */
|
|
5669
|
+
if (item.disabled) return /* @__PURE__ */ jsx46("span", { className: "ui-nav__tab is-disabled", "aria-disabled": "true", children: inner }, item.id);
|
|
5390
5670
|
const current = item.id === active;
|
|
5391
5671
|
const linkProps = {
|
|
5392
5672
|
className: ["ui-nav__tab", current && "is-active"].filter(Boolean).join(" "),
|
|
5393
|
-
href:
|
|
5673
|
+
href: safeUrl5(item.href || `#${item.id}`),
|
|
5394
5674
|
target: item.target,
|
|
5395
5675
|
"aria-current": current ? "page" : void 0,
|
|
5396
5676
|
children: inner
|
|
5397
5677
|
};
|
|
5398
|
-
return /* @__PURE__ */
|
|
5678
|
+
return /* @__PURE__ */ jsx46(Fragment20, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx46("a", { ...linkProps }) }, item.id);
|
|
5399
5679
|
})
|
|
5400
5680
|
}
|
|
5401
5681
|
);
|
|
5402
5682
|
});
|
|
5403
5683
|
|
|
5404
|
-
// src/Breadcrumbs.tsx
|
|
5405
|
-
import { forwardRef as forwardRef13 } from "react";
|
|
5406
|
-
import { icon as icon8, safeUrl as safeUrl5 } from "@apliteni/apliteni-ui";
|
|
5407
|
-
import { Fragment as Fragment21, jsx as jsx46, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
5408
|
-
var Breadcrumbs = forwardRef13(function Breadcrumbs2({
|
|
5409
|
-
items,
|
|
5410
|
-
renderLink,
|
|
5411
|
-
className,
|
|
5412
|
-
"aria-label": ariaLabel = "Breadcrumb",
|
|
5413
|
-
...rest
|
|
5414
|
-
}, ref) {
|
|
5415
|
-
return /* @__PURE__ */ jsx46(
|
|
5416
|
-
"nav",
|
|
5417
|
-
{
|
|
5418
|
-
...rest,
|
|
5419
|
-
ref,
|
|
5420
|
-
className: ["ui-nav", "ui-nav--crumbs", className].filter(Boolean).join(" "),
|
|
5421
|
-
"aria-label": ariaLabel,
|
|
5422
|
-
children: /* @__PURE__ */ jsx46("ol", { className: "ui-nav__crumbs", children: items.map((item, index) => {
|
|
5423
|
-
const current = index === items.length - 1;
|
|
5424
|
-
const inner = /* @__PURE__ */ jsxs40(Fragment21, { children: [
|
|
5425
|
-
item.icon && /* @__PURE__ */ jsx46("span", { className: "ui-nav__ic", dangerouslySetInnerHTML: { __html: icon8(item.icon) } }),
|
|
5426
|
-
/* @__PURE__ */ jsx46("span", { className: "ui-nav__crumb-label", children: item.label })
|
|
5427
|
-
] });
|
|
5428
|
-
const linkProps = !current && item.href ? { className: "ui-nav__crumb", href: safeUrl5(item.href), target: item.target, children: inner } : null;
|
|
5429
|
-
return /* @__PURE__ */ jsx46("li", { className: "ui-nav__crumb-item", children: linkProps ? renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx46("a", { ...linkProps }) : /* @__PURE__ */ jsx46(
|
|
5430
|
-
"span",
|
|
5431
|
-
{
|
|
5432
|
-
className: ["ui-nav__crumb", current && "is-current"].filter(Boolean).join(" "),
|
|
5433
|
-
"aria-current": current ? "page" : void 0,
|
|
5434
|
-
children: inner
|
|
5435
|
-
}
|
|
5436
|
-
) }, index);
|
|
5437
|
-
}) })
|
|
5438
|
-
}
|
|
5439
|
-
);
|
|
5440
|
-
});
|
|
5441
|
-
|
|
5442
5684
|
// src/index.ts
|
|
5443
5685
|
var PAGE_SIZES = KIT_PAGE_SIZES;
|
|
5444
5686
|
var DEFAULT_PAGE_SIZE3 = KIT_DEFAULT_PAGE_SIZE;
|