@almadar/ui 6.51.2 → 6.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{EntityBindingContext-BbxrwSb9.d.ts → AwaitingSkeletonContext-Bh399p1x.d.ts} +17 -2
- package/dist/{Canvas3DHost-CLC_jXh_.d.ts → Canvas3DHost-B-y2TNij.d.ts} +1 -1
- package/dist/{FileTree-RKQqRhIM.d.ts → FileTree-DUi7e7Z8.d.ts} +5 -5
- package/dist/{GameAudioProvider-BgWLggIy.d.ts → GameAudioProvider-DyBvYP2c.d.ts} +1 -1
- package/dist/{NavStackContext-B-XLULCO.d.ts → NavStackContext-04NLdXsY.d.ts} +8 -0
- package/dist/Typography-JGSDH4JP.js +5 -0
- package/dist/{UISlotContext-DNM8iXna.d.ts → UISlotContext-CS487Uoc.d.ts} +1 -1
- package/dist/{UISlotRenderer-7UYHFW4S.js → UISlotRenderer-JT34I3O7.js} +9 -9
- package/dist/avl/index.cjs +39958 -38525
- package/dist/avl/index.d.ts +8 -5
- package/dist/avl/index.js +37 -26
- package/dist/{chunk-JXUYEO7U.js → chunk-2LFBQ4IS.js} +7 -1
- package/dist/{chunk-GIPZSCND.js → chunk-3EF5SDIJ.js} +31157 -31206
- package/dist/{chunk-GHXWGQTX.js → chunk-4OZDHCZV.js} +1 -1
- package/dist/{chunk-HQDKHLFG.js → chunk-64WACXM7.js} +15 -1
- package/dist/{chunk-FGHRVJCI.js → chunk-6O37FCX4.js} +13 -2
- package/dist/{chunk-BUEIZY54.js → chunk-7LM6I3NA.js} +8 -7
- package/dist/chunk-CBIJP5PL.js +284 -0
- package/dist/{chunk-MWPX2O4M.js → chunk-GMDMOYXD.js} +3 -16
- package/dist/{chunk-YKHNK5JH.js → chunk-GODZKHAL.js} +11 -4
- package/dist/{chunk-T7IH5ABO.js → chunk-IKULQIDX.js} +199 -88
- package/dist/{chunk-NTO555KF.js → chunk-JRW33U35.js} +183 -62
- package/dist/{chunk-OLZ3EEML.js → chunk-KQXXO42S.js} +106 -90
- package/dist/chunk-OKWD7LPO.js +80 -0
- package/dist/{chunk-YHY5K2Y7.js → chunk-PEST66PN.js} +6 -0
- package/dist/{chunk-L55SAFKL.js → chunk-UGHAADU5.js} +77 -1
- package/dist/{chunk-6CFYRP4S.js → chunk-VHTJRS2N.js} +4 -8
- package/dist/{chunk-R4V7IZQP.js → chunk-WPNM2KC6.js} +2 -2
- package/dist/{cn-CO-0rolG.d.ts → cn-ClXGlIOY.d.ts} +2 -2
- package/dist/components/index.cjs +46084 -44766
- package/dist/components/index.d.ts +645 -699
- package/dist/components/index.js +621 -13
- package/dist/context/index.cjs +20 -7
- package/dist/context/index.d.ts +3 -3
- package/dist/context/index.js +3 -3
- package/dist/hooks/index.cjs +126 -9
- package/dist/hooks/index.d.ts +32 -7
- package/dist/hooks/index.js +7 -7
- package/dist/lib/drawable/three/index.cjs +79 -2
- package/dist/lib/drawable/three/index.d.ts +3 -3
- package/dist/lib/drawable/three/index.js +7 -7
- package/dist/lib/index.cjs +116 -2
- package/dist/lib/index.d.ts +29 -6
- package/dist/lib/index.js +6 -5
- package/dist/locales/index.cjs +231 -3
- package/dist/locales/index.js +155 -3
- package/dist/{paintDispatch-CMgOyVjS.d.ts → paintDispatch-_6EhJCiL.d.ts} +6 -6
- package/dist/providers/index.cjs +36404 -35028
- package/dist/providers/index.d.ts +34 -9
- package/dist/providers/index.js +82 -19
- package/dist/renderer/index.cjs +6 -0
- package/dist/renderer/index.d.ts +1 -1
- package/dist/renderer/index.js +1 -1
- package/dist/runtime/index.cjs +37861 -36437
- package/dist/runtime/index.d.ts +6 -4
- package/dist/runtime/index.js +11 -11
- package/dist/ssr/index.cjs +584 -181
- package/dist/ssr/index.d.cts +36 -44
- package/dist/ssr/index.d.ts +36 -44
- package/dist/ssr/index.js +527 -124
- package/dist/{themeTokens-CN9WCXQc.d.ts → themeTokens-Ccu7EmGY.d.ts} +4 -2
- package/dist/{useUISlots-CwUWM1ra.d.ts → useUISlots-1dk2TR4j.d.ts} +1 -9
- package/dist/{verificationRegistry-DBHfOR9y.d.ts → verificationRegistry-CD7Xb40L.d.ts} +1 -1
- package/locales/ar.json +77 -1
- package/locales/en.json +77 -1
- package/locales/sl.json +77 -1
- package/package.json +13 -10
- package/tailwind-preset.cjs +37 -1
- package/themes/_base.css +114 -8
- package/themes/_contract.md +6 -0
- package/themes/almadar-website.css +2 -0
- package/themes/almadar.css +2 -0
- package/themes/aqua.css +5 -3
- package/themes/arabesque.css +9 -7
- package/themes/art-deco.css +5 -3
- package/themes/art-nouveau.css +4 -0
- package/themes/atelier.css +10 -8
- package/themes/bauhaus.css +2 -0
- package/themes/bloomberg-dense.css +13 -11
- package/themes/blueprint.css +2 -0
- package/themes/clay.css +2 -0
- package/themes/comic.css +12 -10
- package/themes/constructivist.css +2 -0
- package/themes/corporate.css +4 -2
- package/themes/cyberpunk.css +2 -0
- package/themes/frutiger-aero.css +2 -0
- package/themes/game-adventure.css +1 -0
- package/themes/game-rpg.css +1 -0
- package/themes/game-sci-fi.css +1 -0
- package/themes/game-ui-pack.css +1 -0
- package/themes/gazette.css +10 -8
- package/themes/glass.css +17 -15
- package/themes/gothic.css +2 -0
- package/themes/ink-wash.css +2 -0
- package/themes/kawaii.css +2 -0
- package/themes/kiosk.css +17 -15
- package/themes/linear-clean.css +12 -10
- package/themes/luxury.css +2 -0
- package/themes/mac-classic.css +2 -0
- package/themes/material.css +2 -0
- package/themes/memphis.css +2 -0
- package/themes/mid-century.css +2 -0
- package/themes/minimalist.css +2 -0
- package/themes/mudcloth.css +2 -0
- package/themes/neon.css +2 -0
- package/themes/neumorphic.css +2 -0
- package/themes/newsprint.css +2 -0
- package/themes/notion-editorial.css +12 -10
- package/themes/pixel.css +2 -0
- package/themes/prism.css +20 -18
- package/themes/retro.css +2 -0
- package/themes/risograph.css +2 -0
- package/themes/scandi.css +2 -0
- package/themes/sketch.css +2 -0
- package/themes/solarpunk.css +2 -0
- package/themes/steampunk.css +2 -0
- package/themes/swiss.css +2 -0
- package/themes/terminal.css +8 -6
- package/themes/trait-wars.css +2 -0
- package/themes/ukiyo-e.css +2 -0
- package/themes/vaporwave.css +2 -0
- package/themes/victorian.css +2 -0
- package/themes/wabi-sabi.css +2 -0
- package/themes/win95.css +2 -0
- package/themes/wireframe.css +2 -0
- package/themes/zine.css +2 -0
- package/dist/Typography-2Z3JKWHN.js +0 -5
package/dist/ssr/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React17 from 'react';
|
|
2
|
+
import React17__default, { createContext, useCallback, useState, useRef, useEffect, useContext, useMemo, useSyncExternalStore, useLayoutEffect, useId } from 'react';
|
|
3
3
|
import { createLogger } from '@almadar/logger';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import * as LucideIcons2 from 'lucide-react';
|
|
@@ -2862,7 +2862,7 @@ var positionStyles = {
|
|
|
2862
2862
|
fixed: "fixed",
|
|
2863
2863
|
sticky: "sticky"
|
|
2864
2864
|
};
|
|
2865
|
-
var Box =
|
|
2865
|
+
var Box = React17__default.forwardRef(
|
|
2866
2866
|
({
|
|
2867
2867
|
padding,
|
|
2868
2868
|
paddingX,
|
|
@@ -2931,7 +2931,7 @@ var Box = React15__default.forwardRef(
|
|
|
2931
2931
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
2932
2932
|
const isClickable = action || onClick;
|
|
2933
2933
|
const actionControl = action && rest.role === void 0 && rest.tabIndex === void 0 ? pressableProps(handleClick) : {};
|
|
2934
|
-
return
|
|
2934
|
+
return React17__default.createElement(
|
|
2935
2935
|
Component,
|
|
2936
2936
|
{
|
|
2937
2937
|
ref,
|
|
@@ -2970,10 +2970,11 @@ var Box = React15__default.forwardRef(
|
|
|
2970
2970
|
Box.displayName = "Box";
|
|
2971
2971
|
|
|
2972
2972
|
// lib/domPassthrough.ts
|
|
2973
|
+
var GLOBAL_ATTRIBUTES = /* @__PURE__ */ new Set(["role", "id", "lang", "dir", "tabIndex"]);
|
|
2973
2974
|
function domPassthrough(props) {
|
|
2974
2975
|
const out = {};
|
|
2975
2976
|
for (const [key, value] of Object.entries(props)) {
|
|
2976
|
-
if (key.startsWith("aria-") || key.startsWith("data-") || key
|
|
2977
|
+
if (key.startsWith("aria-") || key.startsWith("data-") || GLOBAL_ATTRIBUTES.has(key)) {
|
|
2977
2978
|
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === void 0) {
|
|
2978
2979
|
out[key] = value;
|
|
2979
2980
|
}
|
|
@@ -3035,7 +3036,7 @@ var Stack = ({
|
|
|
3035
3036
|
};
|
|
3036
3037
|
const isHorizontal = direction === "horizontal";
|
|
3037
3038
|
const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
|
|
3038
|
-
return
|
|
3039
|
+
return React17__default.createElement(
|
|
3039
3040
|
Component,
|
|
3040
3041
|
{
|
|
3041
3042
|
...domPassthrough(rest),
|
|
@@ -3178,6 +3179,7 @@ var en_default = {
|
|
|
3178
3179
|
"aria.removeFilter": "Remove filter",
|
|
3179
3180
|
"aria.closeDrawer": "Close drawer",
|
|
3180
3181
|
"aria.closePanel": "Close panel",
|
|
3182
|
+
"aria.dockPanel": "Side panel",
|
|
3181
3183
|
"aria.previousImage": "Previous image",
|
|
3182
3184
|
"aria.nextImage": "Next image",
|
|
3183
3185
|
"aria.dismiss": "Dismiss",
|
|
@@ -3199,6 +3201,7 @@ var en_default = {
|
|
|
3199
3201
|
"aria.openMenu": "Open menu",
|
|
3200
3202
|
"aria.closeMenu": "Close menu",
|
|
3201
3203
|
"aria.openSidebar": "Open sidebar",
|
|
3204
|
+
"aria.openRow": "Open item {{position}}",
|
|
3202
3205
|
"sidebar.expand": "Expand sidebar",
|
|
3203
3206
|
"sidebar.collapse": "Collapse sidebar",
|
|
3204
3207
|
"sidebar.close": "Close sidebar",
|
|
@@ -4214,7 +4217,81 @@ var en_default = {
|
|
|
4214
4217
|
"flowCanvas.presetSize": "{{label}} ({{width}}px)",
|
|
4215
4218
|
"avl.breadcrumb.transitionNumber": "Transition #{{n}}",
|
|
4216
4219
|
"orbInspector.pattern": "Pattern",
|
|
4217
|
-
"orbInspector.slotLabel": "slot: {{slot}}"
|
|
4220
|
+
"orbInspector.slotLabel": "slot: {{slot}}",
|
|
4221
|
+
"detailPanel.section.activity": "Activity",
|
|
4222
|
+
"detailPanel.section.lineItems": "Line items",
|
|
4223
|
+
"detailPanel.tab.overview": "Overview",
|
|
4224
|
+
"detailPanel.thread.empty": "No messages yet",
|
|
4225
|
+
"detailPanel.openImage": "Open image",
|
|
4226
|
+
"detailPanel.showImage": "Show image {{index}}",
|
|
4227
|
+
"aria.clearSelection": "Clear selection",
|
|
4228
|
+
"aria.searchOptions": "Search options",
|
|
4229
|
+
"aria.zoomIn": "Zoom in",
|
|
4230
|
+
"aria.zoomOut": "Zoom out",
|
|
4231
|
+
"aria.previousPage": "Previous page",
|
|
4232
|
+
"aria.nextPage": "Next page",
|
|
4233
|
+
"aria.downloadDocument": "Download document",
|
|
4234
|
+
"aria.printDocument": "Print document",
|
|
4235
|
+
"aria.wrapLines": "Wrap lines",
|
|
4236
|
+
"aria.copyCode": "Copy code",
|
|
4237
|
+
"aria.clearInput": "Clear input",
|
|
4238
|
+
"aria.skipToContent": "Skip to content",
|
|
4239
|
+
"aria.mainNavigation": "Main navigation",
|
|
4240
|
+
"aria.carouselSlides": "Slides",
|
|
4241
|
+
"aria.minimap": "Minimap",
|
|
4242
|
+
"aria.canvasScene": "Game scene",
|
|
4243
|
+
"aria.learningCanvas": "Interactive diagram",
|
|
4244
|
+
"aria.scene3d": "3D scene",
|
|
4245
|
+
"aria.graphCanvas": "Graph",
|
|
4246
|
+
"aria.positionedCanvas": "Floor plan",
|
|
4247
|
+
"aria.walkTraitDone": "completed",
|
|
4248
|
+
"aria.walkTraitPending": "pending",
|
|
4249
|
+
"aria.walkGraph": "State graph for {{trait}}: {{from}} to {{to}}",
|
|
4250
|
+
"aria.loading": "Loading",
|
|
4251
|
+
"agentActivity.toolCall": "Called {{tool}}",
|
|
4252
|
+
"agentActivity.toolResult": "{{tool}} returned",
|
|
4253
|
+
"agentActivity.toolRows": "{{count}} rows",
|
|
4254
|
+
"agentActivity.thinking": "Thinking\u2026",
|
|
4255
|
+
"agentActivity.analyzed": "Analyzed your request \u2014 {{organism}}",
|
|
4256
|
+
"agentActivity.renamed": "Rename {{from}} \u2192 {{to}}",
|
|
4257
|
+
"agentActivity.deleted": "Remove {{orbitalName}}",
|
|
4258
|
+
"agentActivity.roster": "Planning {{count}} orbitals",
|
|
4259
|
+
"agentActivity.orbitalStarted": "Working on {{orbitalName}}\u2026",
|
|
4260
|
+
"agentActivity.orbitalStartedSettled": "Started {{orbitalName}}",
|
|
4261
|
+
"agentActivity.orbitalDone": "{{orbitalName}} ready",
|
|
4262
|
+
"agentActivity.orbitalCounts": "{{traitCount}} traits, {{transitionCount}} transitions",
|
|
4263
|
+
"agentActivity.change.orbital-added": "Added {{orbitalName}}",
|
|
4264
|
+
"agentActivity.change.orbital-removed": "Removed {{orbitalName}}",
|
|
4265
|
+
"agentActivity.change.entity-fields-changed": "Changed the data fields of {{orbitalName}}",
|
|
4266
|
+
"agentActivity.change.trait-added": "Added a behavior to {{orbitalName}}",
|
|
4267
|
+
"agentActivity.change.trait-removed": "Removed a behavior from {{orbitalName}}",
|
|
4268
|
+
"agentActivity.change.state-machine-changed": "Changed the flow of {{orbitalName}}",
|
|
4269
|
+
"agentActivity.change.guard-changed": "Changed a rule in {{orbitalName}}",
|
|
4270
|
+
"agentActivity.change.effect-changed": "Changed what {{orbitalName}} does",
|
|
4271
|
+
"agentActivity.change.render-ui-changed": "Changed the design of {{orbitalName}}",
|
|
4272
|
+
"agentActivity.change.event-wiring-changed": "Changed the connections of {{orbitalName}}",
|
|
4273
|
+
"agentActivity.change.page-changed": "Changed the pages of {{orbitalName}}",
|
|
4274
|
+
"agentActivity.change.behavior-composed": "Composed a behavior into {{orbitalName}}",
|
|
4275
|
+
"agentActivity.done": "Done \u2014 {{count}} orbitals ready",
|
|
4276
|
+
"agentActivity.cancelled": "Cancelled",
|
|
4277
|
+
"agentActivity.jump": "Show",
|
|
4278
|
+
"agentActivity.emptyTitle": "No activity yet",
|
|
4279
|
+
"agentActivity.emptyDescription": "Send a message and the agent's work shows up here.",
|
|
4280
|
+
"agentActivity.fileOperation": "{{operation}}",
|
|
4281
|
+
"agentActivity.schemaDiff": "Edited {{filePath}}",
|
|
4282
|
+
"agentActivity.coordinatorDecision": "Chose {{organism}}",
|
|
4283
|
+
"agentActivity.change.trait-config-changed": "Changed the settings of {{orbitalName}}",
|
|
4284
|
+
"agentActivity.change.theme-changed": "Changed the theme of {{orbitalName}}",
|
|
4285
|
+
"agentActivity.llmResponse": "Raw LLM response",
|
|
4286
|
+
"agentActivity.llmDuration": "{{seconds}}s",
|
|
4287
|
+
"agentActivity.llmTokens": "{{prompt}} in / {{completion}} out tokens",
|
|
4288
|
+
"agentActivity.llmResponseLabel": "Response",
|
|
4289
|
+
"agentActivity.llmSystemPrompt": "System prompt",
|
|
4290
|
+
"agentActivity.llmUserPrompt": "User prompt",
|
|
4291
|
+
"agentActivity.llmToolCalls": "Tool calls",
|
|
4292
|
+
"agentActivity.showRawLlm": "Raw LLM",
|
|
4293
|
+
"agentActivity.earlierConversations": "Earlier conversations ({{count}})",
|
|
4294
|
+
"agentActivity.earlierActivity": "Earlier activity"
|
|
4218
4295
|
};
|
|
4219
4296
|
|
|
4220
4297
|
// lib/format.ts
|
|
@@ -4292,7 +4369,6 @@ var I18nContext = createContext({
|
|
|
4292
4369
|
}
|
|
4293
4370
|
});
|
|
4294
4371
|
I18nContext.displayName = "I18nContext";
|
|
4295
|
-
I18nContext.Provider;
|
|
4296
4372
|
function useTranslate() {
|
|
4297
4373
|
return useContext(I18nContext);
|
|
4298
4374
|
}
|
|
@@ -4404,7 +4480,7 @@ var Typography = ({
|
|
|
4404
4480
|
if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
|
|
4405
4481
|
body = formatValue(body, format, fmt);
|
|
4406
4482
|
}
|
|
4407
|
-
return
|
|
4483
|
+
return React17__default.createElement(
|
|
4408
4484
|
Component,
|
|
4409
4485
|
{
|
|
4410
4486
|
...domPassthrough(rest),
|
|
@@ -4436,6 +4512,50 @@ var Typography = ({
|
|
|
4436
4512
|
);
|
|
4437
4513
|
};
|
|
4438
4514
|
Typography.displayName = "Typography";
|
|
4515
|
+
var counts = /* @__PURE__ */ new Map();
|
|
4516
|
+
var keyListeners = /* @__PURE__ */ new Map();
|
|
4517
|
+
var seq = 0;
|
|
4518
|
+
function newPendingKey() {
|
|
4519
|
+
seq += 1;
|
|
4520
|
+
return `pending-${seq}`;
|
|
4521
|
+
}
|
|
4522
|
+
function isPending(key) {
|
|
4523
|
+
return (counts.get(key) ?? 0) > 0;
|
|
4524
|
+
}
|
|
4525
|
+
function subscribePending(key, cb) {
|
|
4526
|
+
let set = keyListeners.get(key);
|
|
4527
|
+
if (!set) {
|
|
4528
|
+
set = /* @__PURE__ */ new Set();
|
|
4529
|
+
keyListeners.set(key, set);
|
|
4530
|
+
}
|
|
4531
|
+
set.add(cb);
|
|
4532
|
+
return () => {
|
|
4533
|
+
set?.delete(cb);
|
|
4534
|
+
if (set && set.size === 0) keyListeners.delete(key);
|
|
4535
|
+
};
|
|
4536
|
+
}
|
|
4537
|
+
var PendingScopeContext = createContext(null);
|
|
4538
|
+
function usePendingAction() {
|
|
4539
|
+
const scope = useContext(PendingScopeContext);
|
|
4540
|
+
const [key, setKey] = useState(null);
|
|
4541
|
+
const pending = useSyncExternalStore(
|
|
4542
|
+
useCallback((cb) => key ? subscribePending(key, cb) : () => {
|
|
4543
|
+
}, [key]),
|
|
4544
|
+
() => key ? isPending(key) : false,
|
|
4545
|
+
() => false
|
|
4546
|
+
);
|
|
4547
|
+
useEffect(() => {
|
|
4548
|
+
if (key && !pending) setKey(null);
|
|
4549
|
+
}, [key, pending]);
|
|
4550
|
+
const activate = useCallback((emit) => {
|
|
4551
|
+
const k = newPendingKey();
|
|
4552
|
+
emit(k);
|
|
4553
|
+
if (!isPending(k)) return;
|
|
4554
|
+
scope?.track(k);
|
|
4555
|
+
setKey(k);
|
|
4556
|
+
}, [scope]);
|
|
4557
|
+
return { pending, activate };
|
|
4558
|
+
}
|
|
4439
4559
|
var DEFAULT_FAMILY = "lucide";
|
|
4440
4560
|
var VALID_FAMILIES = [DEFAULT_FAMILY];
|
|
4441
4561
|
function themeIconFamily() {
|
|
@@ -4566,7 +4686,7 @@ function resolveLucide(name) {
|
|
|
4566
4686
|
}
|
|
4567
4687
|
function makeLucideAdapter(name) {
|
|
4568
4688
|
const LucideComp = resolveLucide(name);
|
|
4569
|
-
const Adapter =
|
|
4689
|
+
const Adapter = React17__default.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
4570
4690
|
LucideComp,
|
|
4571
4691
|
{
|
|
4572
4692
|
ref,
|
|
@@ -4647,15 +4767,16 @@ var Icon = ({
|
|
|
4647
4767
|
animation = "none",
|
|
4648
4768
|
className,
|
|
4649
4769
|
strokeWidth,
|
|
4650
|
-
style
|
|
4770
|
+
style,
|
|
4771
|
+
...rest
|
|
4651
4772
|
}) => {
|
|
4652
4773
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
4653
4774
|
const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
|
|
4654
4775
|
const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
|
|
4655
4776
|
const family = useIconFamily();
|
|
4656
|
-
const svgRef =
|
|
4777
|
+
const svgRef = React17__default.useRef(null);
|
|
4657
4778
|
const themeStroke = useThemeIconStrokeApplies(svgRef);
|
|
4658
|
-
const RenderedComponent =
|
|
4779
|
+
const RenderedComponent = React17__default.useMemo(() => {
|
|
4659
4780
|
if (directIcon) return null;
|
|
4660
4781
|
return effectiveName ? resolveIconForFamily(effectiveName) : null;
|
|
4661
4782
|
}, [directIcon, effectiveName, family]);
|
|
@@ -4678,7 +4799,8 @@ var Icon = ({
|
|
|
4678
4799
|
ref: svgRef,
|
|
4679
4800
|
className: composedClassName,
|
|
4680
4801
|
strokeWidth: effectiveStrokeWidth,
|
|
4681
|
-
style: inlineStyle
|
|
4802
|
+
style: inlineStyle,
|
|
4803
|
+
...domPassthrough(rest)
|
|
4682
4804
|
}
|
|
4683
4805
|
);
|
|
4684
4806
|
}
|
|
@@ -4689,7 +4811,8 @@ var Icon = ({
|
|
|
4689
4811
|
ref: svgRef,
|
|
4690
4812
|
className: composedClassName,
|
|
4691
4813
|
strokeWidth: effectiveStrokeWidth,
|
|
4692
|
-
style: inlineStyle
|
|
4814
|
+
style: inlineStyle,
|
|
4815
|
+
...domPassthrough(rest)
|
|
4693
4816
|
}
|
|
4694
4817
|
);
|
|
4695
4818
|
}
|
|
@@ -4700,7 +4823,8 @@ var Icon = ({
|
|
|
4700
4823
|
ref: svgRef,
|
|
4701
4824
|
className: composedClassName,
|
|
4702
4825
|
strokeWidth: effectiveStrokeWidth,
|
|
4703
|
-
style: inlineStyle
|
|
4826
|
+
style: inlineStyle,
|
|
4827
|
+
...domPassthrough(rest)
|
|
4704
4828
|
}
|
|
4705
4829
|
);
|
|
4706
4830
|
};
|
|
@@ -4791,15 +4915,16 @@ function AtlasImage({
|
|
|
4791
4915
|
alt,
|
|
4792
4916
|
className,
|
|
4793
4917
|
style,
|
|
4794
|
-
"aria-hidden": ariaHidden
|
|
4918
|
+
"aria-hidden": ariaHidden,
|
|
4919
|
+
...rest
|
|
4795
4920
|
}) {
|
|
4796
|
-
const [, bump] =
|
|
4797
|
-
const canvasRef =
|
|
4921
|
+
const [, bump] = React17.useReducer((x) => x + 1, 0);
|
|
4922
|
+
const canvasRef = React17.useRef(null);
|
|
4798
4923
|
const sliced = isAtlasAsset(asset);
|
|
4799
4924
|
const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
|
|
4800
4925
|
const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
4801
4926
|
const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
|
|
4802
|
-
|
|
4927
|
+
React17.useEffect(() => {
|
|
4803
4928
|
const canvas = canvasRef.current;
|
|
4804
4929
|
if (!canvas || !img || !rect) return;
|
|
4805
4930
|
canvas.width = rect.sw;
|
|
@@ -4832,6 +4957,7 @@ function AtlasImage({
|
|
|
4832
4957
|
role: ariaHidden ? void 0 : "img",
|
|
4833
4958
|
"aria-hidden": ariaHidden,
|
|
4834
4959
|
"aria-label": ariaHidden ? void 0 : alt ?? asset.name ?? asset.category ?? "",
|
|
4960
|
+
...domPassthrough(rest),
|
|
4835
4961
|
className: cn("flex-shrink-0", className),
|
|
4836
4962
|
style: boxStyle
|
|
4837
4963
|
}
|
|
@@ -4843,6 +4969,7 @@ function AtlasImage({
|
|
|
4843
4969
|
src: asset.url,
|
|
4844
4970
|
alt: alt ?? asset.name ?? asset.category ?? "",
|
|
4845
4971
|
"aria-hidden": ariaHidden,
|
|
4972
|
+
...domPassthrough(rest),
|
|
4846
4973
|
...typeof w === "number" ? { width: w } : {},
|
|
4847
4974
|
...typeof h === "number" ? { height: h } : {},
|
|
4848
4975
|
className: cn("flex-shrink-0", className),
|
|
@@ -4859,7 +4986,8 @@ var INERT_API = {
|
|
|
4859
4986
|
beginNavigate: () => void 0,
|
|
4860
4987
|
back: () => void 0,
|
|
4861
4988
|
goTo: () => void 0,
|
|
4862
|
-
setCurrentLabel: () => void 0
|
|
4989
|
+
setCurrentLabel: () => void 0,
|
|
4990
|
+
registerNavItems: () => void 0
|
|
4863
4991
|
};
|
|
4864
4992
|
var NavStackContext = createContext(INERT_API);
|
|
4865
4993
|
function isInertNavStack(api) {
|
|
@@ -4875,7 +5003,9 @@ function isAbsoluteHref(href) {
|
|
|
4875
5003
|
}
|
|
4876
5004
|
function followHref(href, navStack) {
|
|
4877
5005
|
if (href.startsWith("#")) {
|
|
4878
|
-
document.getElementById(decodeURIComponent(href.slice(1)))
|
|
5006
|
+
const target = document.getElementById(decodeURIComponent(href.slice(1)));
|
|
5007
|
+
target?.scrollIntoView({ behavior: "smooth" });
|
|
5008
|
+
target?.focus({ preventScroll: true });
|
|
4879
5009
|
} else if (isAbsoluteHref(href) || isInertNavStack(navStack)) {
|
|
4880
5010
|
window.location.assign(href);
|
|
4881
5011
|
} else {
|
|
@@ -4959,7 +5089,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
4959
5089
|
const IconComp = value;
|
|
4960
5090
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
4961
5091
|
}
|
|
4962
|
-
if (
|
|
5092
|
+
if (React17__default.isValidElement(value)) {
|
|
4963
5093
|
return value;
|
|
4964
5094
|
}
|
|
4965
5095
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -4968,7 +5098,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
4968
5098
|
}
|
|
4969
5099
|
return value;
|
|
4970
5100
|
}
|
|
4971
|
-
var Button =
|
|
5101
|
+
var Button = React17__default.forwardRef(
|
|
4972
5102
|
({
|
|
4973
5103
|
className,
|
|
4974
5104
|
variant = "primary",
|
|
@@ -4986,22 +5116,42 @@ var Button = React15__default.forwardRef(
|
|
|
4986
5116
|
href,
|
|
4987
5117
|
children,
|
|
4988
5118
|
onClick,
|
|
5119
|
+
onFocus,
|
|
5120
|
+
onBlur,
|
|
4989
5121
|
"data-testid": dataTestId,
|
|
4990
5122
|
...props
|
|
4991
5123
|
}, ref) => {
|
|
4992
5124
|
const eventBus = useEventBus();
|
|
4993
5125
|
const navStack = useNavStack();
|
|
5126
|
+
const { pending, activate } = usePendingAction();
|
|
5127
|
+
const busy = isLoading || pending;
|
|
5128
|
+
const [focused, setFocused] = React17__default.useState(false);
|
|
5129
|
+
const inert = Boolean(disabled) || busy;
|
|
5130
|
+
const emitAction = () => {
|
|
5131
|
+
if (!action) return;
|
|
5132
|
+
activate((pendingKey) => eventBus.emit(`UI:${action}`, actionPayload ?? {}, { pendingKey }));
|
|
5133
|
+
};
|
|
4994
5134
|
const leftIconValue = leftIcon || iconProp;
|
|
4995
5135
|
const rightIconValue = rightIcon || iconRightProp;
|
|
4996
5136
|
const px = size === "sm" ? 16 : size === "lg" ? 20 : 16;
|
|
4997
5137
|
const resolvedLeftIcon = iconAsset?.url ? /* @__PURE__ */ jsx(AtlasImage, { asset: iconAsset, size: px, alt: iconAsset.name ?? iconAsset.category ?? "", className: "flex-shrink-0" }) : resolveIconProp(leftIconValue, iconSizeStyles[size]);
|
|
4998
5138
|
const resolvedRightIcon = resolveIconProp(rightIconValue, iconSizeStyles[size]);
|
|
4999
5139
|
const handleClick = (e) => {
|
|
5000
|
-
if (
|
|
5001
|
-
|
|
5140
|
+
if (inert) {
|
|
5141
|
+
e.preventDefault();
|
|
5142
|
+
return;
|
|
5002
5143
|
}
|
|
5144
|
+
emitAction();
|
|
5003
5145
|
onClick?.(e);
|
|
5004
5146
|
};
|
|
5147
|
+
const handleFocus = (e) => {
|
|
5148
|
+
setFocused(true);
|
|
5149
|
+
onFocus?.(e);
|
|
5150
|
+
};
|
|
5151
|
+
const handleBlur = (e) => {
|
|
5152
|
+
setFocused(false);
|
|
5153
|
+
onBlur?.(e);
|
|
5154
|
+
};
|
|
5005
5155
|
const classes = cn(
|
|
5006
5156
|
"relative inline-flex items-center justify-center gap-2",
|
|
5007
5157
|
"font-medium",
|
|
@@ -5013,23 +5163,26 @@ var Button = React15__default.forwardRef(
|
|
|
5013
5163
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
5014
5164
|
variantStyles2[variant],
|
|
5015
5165
|
variant === "link" ? "h-auto px-0 text-sm" : sizeStyles[size],
|
|
5166
|
+
busy && "cursor-progress",
|
|
5167
|
+
disabled && focused && "opacity-50 cursor-not-allowed",
|
|
5016
5168
|
className
|
|
5017
5169
|
);
|
|
5018
5170
|
const testId = dataTestId ?? (action ? `action-${action}` : void 0);
|
|
5019
5171
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5172
|
+
busy && /* @__PURE__ */ jsx("span", { className: "almadar-busy-indicator absolute inset-0 flex items-center justify-center", "aria-hidden": "true", children: /* @__PURE__ */ jsx(Loader2, { className: "h-icon-default w-icon-default animate-spin" }) }),
|
|
5173
|
+
/* @__PURE__ */ jsxs("span", { className: cn("inline-flex items-center justify-center gap-2", busy && "almadar-busy-content"), children: [
|
|
5174
|
+
resolvedLeftIcon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedLeftIcon }),
|
|
5175
|
+
(Array.isArray(children) ? children.length > 0 : Boolean(children)) ? children : label ? /* @__PURE__ */ jsx("span", { ...{ [INLINE_TEXT_ATTR]: "label" }, children: label }) : label,
|
|
5176
|
+
resolvedRightIcon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedRightIcon })
|
|
5177
|
+
] })
|
|
5023
5178
|
] });
|
|
5024
5179
|
if (href !== void 0 && href !== "") {
|
|
5025
5180
|
const handleLinkClick = (e) => {
|
|
5026
|
-
if (disabled ||
|
|
5181
|
+
if (disabled || busy) {
|
|
5027
5182
|
e.preventDefault();
|
|
5028
5183
|
return;
|
|
5029
5184
|
}
|
|
5030
|
-
|
|
5031
|
-
eventBus.emit(`UI:${action}`, actionPayload ?? {});
|
|
5032
|
-
}
|
|
5185
|
+
emitAction();
|
|
5033
5186
|
if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0) return;
|
|
5034
5187
|
if (!href.startsWith("#") && isInertNavStack(navStack)) return;
|
|
5035
5188
|
e.preventDefault();
|
|
@@ -5044,7 +5197,8 @@ var Button = React15__default.forwardRef(
|
|
|
5044
5197
|
title: props.title,
|
|
5045
5198
|
style: props.style,
|
|
5046
5199
|
"aria-label": props["aria-label"],
|
|
5047
|
-
"aria-disabled": disabled ||
|
|
5200
|
+
"aria-disabled": disabled || busy || void 0,
|
|
5201
|
+
"aria-busy": busy || void 0,
|
|
5048
5202
|
className: classes,
|
|
5049
5203
|
onClick: handleLinkClick,
|
|
5050
5204
|
"data-testid": testId,
|
|
@@ -5057,9 +5211,13 @@ var Button = React15__default.forwardRef(
|
|
|
5057
5211
|
{
|
|
5058
5212
|
ref,
|
|
5059
5213
|
type: "button",
|
|
5060
|
-
disabled: disabled
|
|
5214
|
+
disabled: Boolean(disabled) && !focused,
|
|
5215
|
+
"aria-disabled": inert || void 0,
|
|
5216
|
+
"aria-busy": busy || void 0,
|
|
5061
5217
|
className: classes,
|
|
5062
5218
|
onClick: handleClick,
|
|
5219
|
+
onFocus: handleFocus,
|
|
5220
|
+
onBlur: handleBlur,
|
|
5063
5221
|
...props,
|
|
5064
5222
|
"data-testid": testId,
|
|
5065
5223
|
children: content
|
|
@@ -5105,8 +5263,8 @@ var sizeStyles2 = {
|
|
|
5105
5263
|
md: "px-2.5 py-1 text-sm",
|
|
5106
5264
|
lg: "px-3 py-1.5 text-base"
|
|
5107
5265
|
};
|
|
5108
|
-
var Badge =
|
|
5109
|
-
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
5266
|
+
var Badge = React17__default.forwardRef(
|
|
5267
|
+
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, onClick, ...props }, ref) => {
|
|
5110
5268
|
const { t } = useTranslate();
|
|
5111
5269
|
const iconSizes = {
|
|
5112
5270
|
sm: "h-icon-default w-icon-default",
|
|
@@ -5117,6 +5275,12 @@ var Badge = React15__default.forwardRef(
|
|
|
5117
5275
|
const resolvedIcon = iconAsset?.url ? /* @__PURE__ */ jsx(AtlasImage, { asset: iconAsset, size: iconPx, alt: iconAsset.name ?? iconAsset.category ?? "", className: "flex-shrink-0" }) : typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon, className: iconSizes[size] }) : icon ? /* @__PURE__ */ jsx(Icon, { icon, className: iconSizes[size] }) : null;
|
|
5118
5276
|
const hasText = Boolean(children) || amount != null || label !== void 0 && label !== null && label !== "";
|
|
5119
5277
|
if (!hasText && !resolvedIcon && !onRemove) return null;
|
|
5278
|
+
const text = typeof children === "string" || typeof children === "number" ? String(children) : amount != null ? `${label ? `${label} ` : ""}${amount}` : label !== void 0 && label !== null ? String(label) : "";
|
|
5279
|
+
const removeName = removeLabel ?? `${t("common.remove")}${text ? `: ${text}` : ""}`;
|
|
5280
|
+
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5281
|
+
resolvedIcon,
|
|
5282
|
+
children || (amount != null ? `${label ? `${label} ` : ""}${amount}` : label ? /* @__PURE__ */ jsx("span", { ...{ [INLINE_TEXT_ATTR]: "label" }, children: label }) : label)
|
|
5283
|
+
] });
|
|
5120
5284
|
return /* @__PURE__ */ jsxs(
|
|
5121
5285
|
"span",
|
|
5122
5286
|
{
|
|
@@ -5130,13 +5294,20 @@ var Badge = React15__default.forwardRef(
|
|
|
5130
5294
|
),
|
|
5131
5295
|
...props,
|
|
5132
5296
|
children: [
|
|
5133
|
-
|
|
5134
|
-
|
|
5297
|
+
onClick ? /* @__PURE__ */ jsx(
|
|
5298
|
+
"button",
|
|
5299
|
+
{
|
|
5300
|
+
type: "button",
|
|
5301
|
+
onClick,
|
|
5302
|
+
className: "inline-flex items-center gap-1 rounded-pill focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
5303
|
+
children: body
|
|
5304
|
+
}
|
|
5305
|
+
) : body,
|
|
5135
5306
|
onRemove ? /* @__PURE__ */ jsx(
|
|
5136
5307
|
"button",
|
|
5137
5308
|
{
|
|
5138
5309
|
type: "button",
|
|
5139
|
-
"aria-label":
|
|
5310
|
+
"aria-label": removeName,
|
|
5140
5311
|
onClick: (e) => {
|
|
5141
5312
|
e.stopPropagation();
|
|
5142
5313
|
onRemove();
|
|
@@ -5156,19 +5327,34 @@ var Badge = React15__default.forwardRef(
|
|
|
5156
5327
|
}
|
|
5157
5328
|
);
|
|
5158
5329
|
Badge.displayName = "Badge";
|
|
5330
|
+
var SurfaceContext = React17__default.createContext(false);
|
|
5331
|
+
function SurfaceBoundary({ children }) {
|
|
5332
|
+
return /* @__PURE__ */ jsx(SurfaceContext.Provider, { value: true, children });
|
|
5333
|
+
}
|
|
5334
|
+
function useContentSurface(surface = "auto") {
|
|
5335
|
+
const onSurface = React17__default.useContext(SurfaceContext);
|
|
5336
|
+
const paints = surface === "auto" && !onSurface;
|
|
5337
|
+
return {
|
|
5338
|
+
className: paints ? "surface-content" : void 0,
|
|
5339
|
+
provide: (node) => paints ? /* @__PURE__ */ jsx(SurfaceBoundary, { children: node }) : /* @__PURE__ */ jsx(Fragment, { children: node })
|
|
5340
|
+
};
|
|
5341
|
+
}
|
|
5159
5342
|
var sizeStyles3 = {
|
|
5160
5343
|
xs: "h-3 w-3",
|
|
5161
5344
|
sm: "h-icon-default w-icon-default",
|
|
5162
5345
|
md: "h-6 w-6",
|
|
5163
5346
|
lg: "h-8 w-8"
|
|
5164
5347
|
};
|
|
5165
|
-
var Spinner =
|
|
5348
|
+
var Spinner = React17__default.forwardRef(
|
|
5166
5349
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
5350
|
+
const { t } = useTranslate();
|
|
5167
5351
|
if (overlay) {
|
|
5168
5352
|
return /* @__PURE__ */ jsx(
|
|
5169
5353
|
"div",
|
|
5170
5354
|
{
|
|
5171
5355
|
ref,
|
|
5356
|
+
role: "status",
|
|
5357
|
+
"aria-label": t("aria.loading"),
|
|
5172
5358
|
...{ [LOADING_STATE_MARKER]: "" },
|
|
5173
5359
|
className: cn(
|
|
5174
5360
|
"absolute inset-0 z-10 flex items-center justify-center",
|
|
@@ -5184,6 +5370,8 @@ var Spinner = React15__default.forwardRef(
|
|
|
5184
5370
|
"div",
|
|
5185
5371
|
{
|
|
5186
5372
|
ref,
|
|
5373
|
+
role: "status",
|
|
5374
|
+
"aria-label": t("aria.loading"),
|
|
5187
5375
|
...{ [LOADING_STATE_MARKER]: "" },
|
|
5188
5376
|
className: cn("text-foreground", className),
|
|
5189
5377
|
...props,
|
|
@@ -5195,16 +5383,12 @@ var Spinner = React15__default.forwardRef(
|
|
|
5195
5383
|
Spinner.displayName = "Spinner";
|
|
5196
5384
|
var variantStyles4 = {
|
|
5197
5385
|
default: [
|
|
5198
|
-
"
|
|
5199
|
-
"border-[length:var(--border-width)] border-border",
|
|
5200
|
-
"shadow-elevation-card",
|
|
5386
|
+
"surface-content",
|
|
5201
5387
|
"transition-all duration-normal",
|
|
5202
5388
|
"hover:shadow-elevation-dialog hover:translate-y-[var(--hover-translate-y)]"
|
|
5203
5389
|
].join(" "),
|
|
5204
5390
|
bordered: [
|
|
5205
|
-
"
|
|
5206
|
-
"border-[length:var(--border-width)] border-border",
|
|
5207
|
-
"shadow-elevation-card",
|
|
5391
|
+
"surface-content",
|
|
5208
5392
|
"transition-all duration-normal",
|
|
5209
5393
|
"hover:shadow-elevation-dialog hover:translate-y-[var(--hover-translate-y)]"
|
|
5210
5394
|
].join(" "),
|
|
@@ -5246,7 +5430,7 @@ var lookStyles = {
|
|
|
5246
5430
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
5247
5431
|
"tile-image-first": "p-0 overflow-hidden"
|
|
5248
5432
|
};
|
|
5249
|
-
var Card =
|
|
5433
|
+
var Card = React17__default.forwardRef(
|
|
5250
5434
|
({
|
|
5251
5435
|
className,
|
|
5252
5436
|
variant = "bordered",
|
|
@@ -5289,16 +5473,16 @@ var Card = React15__default.forwardRef(
|
|
|
5289
5473
|
title && /* @__PURE__ */ jsx("h3", { className: "text-lg text-card-foreground heading-voice", children: title }),
|
|
5290
5474
|
subtitle && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: subtitle })
|
|
5291
5475
|
] }),
|
|
5292
|
-
children
|
|
5476
|
+
/* @__PURE__ */ jsx(SurfaceBoundary, { children })
|
|
5293
5477
|
]
|
|
5294
5478
|
}
|
|
5295
5479
|
);
|
|
5296
5480
|
}
|
|
5297
5481
|
);
|
|
5298
5482
|
Card.displayName = "Card";
|
|
5299
|
-
var CardHeader =
|
|
5483
|
+
var CardHeader = React17__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
5300
5484
|
CardHeader.displayName = "CardHeader";
|
|
5301
|
-
var CardTitle =
|
|
5485
|
+
var CardTitle = React17__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5302
5486
|
"h3",
|
|
5303
5487
|
{
|
|
5304
5488
|
ref,
|
|
@@ -5311,11 +5495,11 @@ var CardTitle = React15__default.forwardRef(({ className, ...props }, ref) => /*
|
|
|
5311
5495
|
}
|
|
5312
5496
|
));
|
|
5313
5497
|
CardTitle.displayName = "CardTitle";
|
|
5314
|
-
var CardContent =
|
|
5498
|
+
var CardContent = React17__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
5315
5499
|
CardContent.displayName = "CardContent";
|
|
5316
5500
|
var CardBody = CardContent;
|
|
5317
5501
|
CardBody.displayName = "CardBody";
|
|
5318
|
-
var CardFooter =
|
|
5502
|
+
var CardFooter = React17__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5319
5503
|
"div",
|
|
5320
5504
|
{
|
|
5321
5505
|
ref,
|
|
@@ -5333,7 +5517,8 @@ var Divider = ({
|
|
|
5333
5517
|
orientation = "horizontal",
|
|
5334
5518
|
label,
|
|
5335
5519
|
variant = "solid",
|
|
5336
|
-
className
|
|
5520
|
+
className,
|
|
5521
|
+
...rest
|
|
5337
5522
|
}) => {
|
|
5338
5523
|
if (orientation === "vertical") {
|
|
5339
5524
|
return /* @__PURE__ */ jsx(
|
|
@@ -5344,6 +5529,7 @@ var Divider = ({
|
|
|
5344
5529
|
variantStyles5[variant],
|
|
5345
5530
|
className
|
|
5346
5531
|
),
|
|
5532
|
+
...domPassthrough(rest),
|
|
5347
5533
|
role: "separator",
|
|
5348
5534
|
"aria-orientation": "vertical"
|
|
5349
5535
|
}
|
|
@@ -5354,8 +5540,9 @@ var Divider = ({
|
|
|
5354
5540
|
"div",
|
|
5355
5541
|
{
|
|
5356
5542
|
className: cn("flex items-center gap-3 my-4", className),
|
|
5543
|
+
...domPassthrough(rest),
|
|
5357
5544
|
role: "separator",
|
|
5358
|
-
"aria-label": label,
|
|
5545
|
+
"aria-label": rest["aria-label"] ?? label,
|
|
5359
5546
|
children: [
|
|
5360
5547
|
/* @__PURE__ */ jsx(
|
|
5361
5548
|
"div",
|
|
@@ -5388,6 +5575,7 @@ var Divider = ({
|
|
|
5388
5575
|
variantStyles5[variant],
|
|
5389
5576
|
className
|
|
5390
5577
|
),
|
|
5578
|
+
...domPassthrough(rest),
|
|
5391
5579
|
role: "separator",
|
|
5392
5580
|
"aria-orientation": "horizontal"
|
|
5393
5581
|
}
|
|
@@ -5404,10 +5592,12 @@ var Center = ({
|
|
|
5404
5592
|
className,
|
|
5405
5593
|
style,
|
|
5406
5594
|
children,
|
|
5407
|
-
as: Component = "div"
|
|
5595
|
+
as: Component = "div",
|
|
5596
|
+
...rest
|
|
5408
5597
|
}) => {
|
|
5409
5598
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
5410
|
-
return
|
|
5599
|
+
return React17__default.createElement(Component, {
|
|
5600
|
+
...domPassthrough(rest),
|
|
5411
5601
|
className: cn(
|
|
5412
5602
|
inline ? "inline-flex" : "flex",
|
|
5413
5603
|
horizontal && "justify-center",
|
|
@@ -5439,16 +5629,18 @@ var verticalSizes = {
|
|
|
5439
5629
|
var Spacer = ({
|
|
5440
5630
|
size = "auto",
|
|
5441
5631
|
axis = "horizontal",
|
|
5442
|
-
className
|
|
5632
|
+
className,
|
|
5633
|
+
...rest
|
|
5443
5634
|
}) => {
|
|
5444
5635
|
if (size === "auto") {
|
|
5445
|
-
return /* @__PURE__ */ jsx("div", { className: cn("flex-1", className), "aria-hidden": "true" });
|
|
5636
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex-1", className), ...domPassthrough(rest), "aria-hidden": "true" });
|
|
5446
5637
|
}
|
|
5447
5638
|
const sizeClass = axis === "horizontal" ? horizontalSizes[size] : verticalSizes[size];
|
|
5448
5639
|
return /* @__PURE__ */ jsx(
|
|
5449
5640
|
"div",
|
|
5450
5641
|
{
|
|
5451
5642
|
className: cn("flex-shrink-0", sizeClass, className),
|
|
5643
|
+
...domPassthrough(rest),
|
|
5452
5644
|
"aria-hidden": "true"
|
|
5453
5645
|
}
|
|
5454
5646
|
);
|
|
@@ -5506,12 +5698,13 @@ var Avatar = ({
|
|
|
5506
5698
|
className,
|
|
5507
5699
|
onClick,
|
|
5508
5700
|
action,
|
|
5509
|
-
actionPayload
|
|
5701
|
+
actionPayload,
|
|
5702
|
+
...rest
|
|
5510
5703
|
}) => {
|
|
5511
5704
|
const eventBus = useEventBus();
|
|
5512
5705
|
const { t } = useTranslate();
|
|
5513
|
-
const [imgFailed, setImgFailed] =
|
|
5514
|
-
|
|
5706
|
+
const [imgFailed, setImgFailed] = React17__default.useState(false);
|
|
5707
|
+
React17__default.useEffect(() => {
|
|
5515
5708
|
setImgFailed(false);
|
|
5516
5709
|
}, [src]);
|
|
5517
5710
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -5527,7 +5720,7 @@ var Avatar = ({
|
|
|
5527
5720
|
onClick?.();
|
|
5528
5721
|
};
|
|
5529
5722
|
const press = pressableProps(isClickable ? handleClick : void 0);
|
|
5530
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative inline-block", children: [
|
|
5723
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative inline-block", ...domPassthrough(rest), children: [
|
|
5531
5724
|
/* @__PURE__ */ jsx(
|
|
5532
5725
|
"div",
|
|
5533
5726
|
{
|
|
@@ -5636,7 +5829,8 @@ var Image2 = ({
|
|
|
5636
5829
|
rounded = "md",
|
|
5637
5830
|
bordered = false,
|
|
5638
5831
|
loading = "lazy",
|
|
5639
|
-
className
|
|
5832
|
+
className,
|
|
5833
|
+
...rest
|
|
5640
5834
|
}) => {
|
|
5641
5835
|
if (!src) return null;
|
|
5642
5836
|
return /* @__PURE__ */ jsx(
|
|
@@ -5644,7 +5838,8 @@ var Image2 = ({
|
|
|
5644
5838
|
{
|
|
5645
5839
|
src,
|
|
5646
5840
|
alt,
|
|
5647
|
-
|
|
5841
|
+
...domPassthrough(rest),
|
|
5842
|
+
role: alt === "" ? "presentation" : rest.role,
|
|
5648
5843
|
loading,
|
|
5649
5844
|
decoding: "async",
|
|
5650
5845
|
className: cn(
|
|
@@ -5674,7 +5869,7 @@ var alignToStack = {
|
|
|
5674
5869
|
left: "start",
|
|
5675
5870
|
right: "end"
|
|
5676
5871
|
};
|
|
5677
|
-
var SectionHeader = ({ title, subtitle, align = "center", level = 2, className }) => {
|
|
5872
|
+
var SectionHeader = ({ title, subtitle, align = "center", level = 2, className, ...rest }) => {
|
|
5678
5873
|
const variant = levelToVariant[level];
|
|
5679
5874
|
return /* @__PURE__ */ jsxs(
|
|
5680
5875
|
VStack,
|
|
@@ -5682,6 +5877,7 @@ var SectionHeader = ({ title, subtitle, align = "center", level = 2, className }
|
|
|
5682
5877
|
gap: "sm",
|
|
5683
5878
|
align: alignToStack[align],
|
|
5684
5879
|
className: cn(alignClasses[align], className),
|
|
5880
|
+
...domPassthrough(rest),
|
|
5685
5881
|
children: [
|
|
5686
5882
|
/* @__PURE__ */ jsx(Typography, { variant, weight: "bold", children: title }),
|
|
5687
5883
|
subtitle ? /* @__PURE__ */ jsx(Typography, { variant: "body", color: "muted", children: subtitle }) : null
|
|
@@ -5708,7 +5904,8 @@ var FeatureCard = ({
|
|
|
5708
5904
|
linkLabel,
|
|
5709
5905
|
variant = "bordered",
|
|
5710
5906
|
size = "md",
|
|
5711
|
-
className
|
|
5907
|
+
className,
|
|
5908
|
+
...rest
|
|
5712
5909
|
}) => {
|
|
5713
5910
|
const { t } = useTranslate();
|
|
5714
5911
|
const renderIcon = () => {
|
|
@@ -5731,6 +5928,7 @@ var FeatureCard = ({
|
|
|
5731
5928
|
return /* @__PURE__ */ jsx(
|
|
5732
5929
|
Card,
|
|
5733
5930
|
{
|
|
5931
|
+
...domPassthrough(rest),
|
|
5734
5932
|
variant,
|
|
5735
5933
|
padding: size,
|
|
5736
5934
|
className: cn(
|
|
@@ -5765,6 +5963,14 @@ var gapStyles2 = {
|
|
|
5765
5963
|
lg: "gap-6",
|
|
5766
5964
|
xl: "gap-8"
|
|
5767
5965
|
};
|
|
5966
|
+
var gapLengths = {
|
|
5967
|
+
none: "0px",
|
|
5968
|
+
xs: "0.25rem",
|
|
5969
|
+
sm: "0.5rem",
|
|
5970
|
+
md: "1rem",
|
|
5971
|
+
lg: "1.5rem",
|
|
5972
|
+
xl: "2rem"
|
|
5973
|
+
};
|
|
5768
5974
|
var colStyles = {
|
|
5769
5975
|
1: "grid-cols-1",
|
|
5770
5976
|
2: "grid-cols-1 sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
@@ -5779,22 +5985,22 @@ var SimpleGrid = ({
|
|
|
5779
5985
|
cols,
|
|
5780
5986
|
gap = "md",
|
|
5781
5987
|
className,
|
|
5782
|
-
children
|
|
5988
|
+
children,
|
|
5989
|
+
...rest
|
|
5783
5990
|
}) => {
|
|
5991
|
+
const passthrough = domPassthrough(rest);
|
|
5784
5992
|
if (cols) {
|
|
5785
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("grid", colStyles[cols], gapStyles2[gap], className), children });
|
|
5993
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("grid", colStyles[cols], gapStyles2[gap], className), ...passthrough, children });
|
|
5786
5994
|
}
|
|
5787
5995
|
const minWidth = typeof minChildWidth === "number" ? `${minChildWidth}px` : minChildWidth;
|
|
5788
|
-
const templateColumns = maxCols ? `repeat(auto-fit, minmax(min(${minWidth}, 100%), 1fr))` : `repeat(auto-fit, minmax(${minWidth}, 1fr))`;
|
|
5996
|
+
const templateColumns = maxCols ? `repeat(auto-fit, minmax(max(min(${minWidth}, 100%), calc((100% - ${maxCols - 1} * ${gapLengths[gap]}) / ${maxCols})), 1fr))` : `repeat(auto-fit, minmax(${minWidth}, 1fr))`;
|
|
5789
5997
|
return /* @__PURE__ */ jsx(
|
|
5790
5998
|
Box,
|
|
5791
5999
|
{
|
|
6000
|
+
...domPassthrough(rest),
|
|
5792
6001
|
className: cn("grid", gapStyles2[gap], className),
|
|
5793
|
-
style: {
|
|
5794
|
-
|
|
5795
|
-
// Limit max columns if specified
|
|
5796
|
-
...maxCols && { maxWidth: `calc(${maxCols} * (${minWidth} + var(--gap, 1rem)))` }
|
|
5797
|
-
},
|
|
6002
|
+
style: { gridTemplateColumns: templateColumns },
|
|
6003
|
+
...passthrough,
|
|
5798
6004
|
children
|
|
5799
6005
|
}
|
|
5800
6006
|
);
|
|
@@ -5804,11 +6010,13 @@ var FeatureGrid = ({
|
|
|
5804
6010
|
items,
|
|
5805
6011
|
columns = 3,
|
|
5806
6012
|
gap = "md",
|
|
5807
|
-
className
|
|
6013
|
+
className,
|
|
6014
|
+
...rest
|
|
5808
6015
|
}) => {
|
|
5809
6016
|
return /* @__PURE__ */ jsx(
|
|
5810
6017
|
SimpleGrid,
|
|
5811
6018
|
{
|
|
6019
|
+
...domPassthrough(rest),
|
|
5812
6020
|
cols: columns,
|
|
5813
6021
|
gap,
|
|
5814
6022
|
className: cn(className),
|
|
@@ -5848,12 +6056,14 @@ var Container = ({
|
|
|
5848
6056
|
center = true,
|
|
5849
6057
|
className,
|
|
5850
6058
|
children,
|
|
5851
|
-
as: Component = "div"
|
|
6059
|
+
as: Component = "div",
|
|
6060
|
+
...rest
|
|
5852
6061
|
}) => {
|
|
5853
6062
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
5854
|
-
return
|
|
6063
|
+
return React17__default.createElement(
|
|
5855
6064
|
Component,
|
|
5856
6065
|
{
|
|
6066
|
+
...domPassthrough(rest),
|
|
5857
6067
|
className: cn(
|
|
5858
6068
|
"w-full",
|
|
5859
6069
|
sizeStyles4[resolvedSize],
|
|
@@ -5866,6 +6076,186 @@ var Container = ({
|
|
|
5866
6076
|
);
|
|
5867
6077
|
};
|
|
5868
6078
|
Container.displayName = "Container";
|
|
6079
|
+
var pulseClass = "almadar-shimmer animate-shimmer rounded-container";
|
|
6080
|
+
function SkeletonLine({ className }) {
|
|
6081
|
+
return /* @__PURE__ */ jsx(Box, { className: cn(pulseClass, "h-4", className) });
|
|
6082
|
+
}
|
|
6083
|
+
function SkeletonBlock({ className }) {
|
|
6084
|
+
return /* @__PURE__ */ jsx(Box, { className: cn(pulseClass, className) });
|
|
6085
|
+
}
|
|
6086
|
+
function HeaderSkeleton({ className }) {
|
|
6087
|
+
return /* @__PURE__ */ jsxs(HStack, { className: cn("items-center justify-between px-6 py-5", className), children: [
|
|
6088
|
+
/* @__PURE__ */ jsxs(VStack, { gap: "sm", className: "flex-1", children: [
|
|
6089
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-7 w-48" }),
|
|
6090
|
+
/* @__PURE__ */ jsx(SkeletonLine, { className: "w-64" })
|
|
6091
|
+
] }),
|
|
6092
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "sm", children: [
|
|
6093
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-9 w-24 rounded-interactive" }),
|
|
6094
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-9 w-32 rounded-interactive" })
|
|
6095
|
+
] })
|
|
6096
|
+
] });
|
|
6097
|
+
}
|
|
6098
|
+
function TableSkeleton({ rows = 5, columns = 4, className }) {
|
|
6099
|
+
return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: cn("border border-border rounded-container overflow-hidden", className), children: [
|
|
6100
|
+
/* @__PURE__ */ jsx(HStack, { className: "px-4 py-3 bg-muted/30 border-b border-border", children: Array.from({ length: columns }).map((_, i) => /* @__PURE__ */ jsx(SkeletonBlock, { className: "h-4 flex-1 mx-2" }, i)) }),
|
|
6101
|
+
Array.from({ length: rows }).map((_, rowIdx) => /* @__PURE__ */ jsx(
|
|
6102
|
+
HStack,
|
|
6103
|
+
{
|
|
6104
|
+
className: cn(
|
|
6105
|
+
"px-4 py-3",
|
|
6106
|
+
rowIdx < rows - 1 && "border-b border-border"
|
|
6107
|
+
),
|
|
6108
|
+
children: Array.from({ length: columns }).map((_2, colIdx) => /* @__PURE__ */ jsx(SkeletonLine, { className: "flex-1 mx-2" }, colIdx))
|
|
6109
|
+
},
|
|
6110
|
+
rowIdx
|
|
6111
|
+
))
|
|
6112
|
+
] });
|
|
6113
|
+
}
|
|
6114
|
+
function FormSkeleton({ fields = 4, className }) {
|
|
6115
|
+
return /* @__PURE__ */ jsxs(VStack, { gap: "lg", className: cn("p-6", className), children: [
|
|
6116
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-6 w-40" }),
|
|
6117
|
+
Array.from({ length: fields }).map((_, i) => /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
|
|
6118
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-4 w-24" }),
|
|
6119
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-10 w-full rounded-interactive" })
|
|
6120
|
+
] }, i)),
|
|
6121
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "md", className: "justify-end pt-2", children: [
|
|
6122
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-10 w-20 rounded-interactive" }),
|
|
6123
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-10 w-24 rounded-interactive" })
|
|
6124
|
+
] })
|
|
6125
|
+
] });
|
|
6126
|
+
}
|
|
6127
|
+
function CardSkeleton({ className }) {
|
|
6128
|
+
return /* @__PURE__ */ jsxs(
|
|
6129
|
+
VStack,
|
|
6130
|
+
{
|
|
6131
|
+
gap: "md",
|
|
6132
|
+
className: cn(
|
|
6133
|
+
"p-5 border border-border rounded-container",
|
|
6134
|
+
className
|
|
6135
|
+
),
|
|
6136
|
+
children: [
|
|
6137
|
+
/* @__PURE__ */ jsxs(HStack, { className: "items-center", gap: "md", children: [
|
|
6138
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-10 w-10 rounded-full" }),
|
|
6139
|
+
/* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1", children: [
|
|
6140
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-5 w-32" }),
|
|
6141
|
+
/* @__PURE__ */ jsx(SkeletonLine, { className: "w-48" })
|
|
6142
|
+
] })
|
|
6143
|
+
] }),
|
|
6144
|
+
/* @__PURE__ */ jsx(SkeletonLine, { className: "w-full" }),
|
|
6145
|
+
/* @__PURE__ */ jsx(SkeletonLine, { className: "w-3/4" }),
|
|
6146
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "pt-2", children: [
|
|
6147
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-6 w-16 rounded-full" }),
|
|
6148
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-6 w-20 rounded-full" })
|
|
6149
|
+
] })
|
|
6150
|
+
]
|
|
6151
|
+
}
|
|
6152
|
+
);
|
|
6153
|
+
}
|
|
6154
|
+
function TextSkeleton({ rows = 3, className }) {
|
|
6155
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className, children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsx(
|
|
6156
|
+
SkeletonLine,
|
|
6157
|
+
{
|
|
6158
|
+
className: i === rows - 1 ? "w-2/3" : "w-full"
|
|
6159
|
+
},
|
|
6160
|
+
i
|
|
6161
|
+
)) });
|
|
6162
|
+
}
|
|
6163
|
+
function ListSkeleton({ rows = 5, className }) {
|
|
6164
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("border border-border rounded-container overflow-hidden", className), children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsxs(HStack, { gap: "md", className: cn("items-center px-4 py-3", i < rows - 1 && "border-b border-border"), children: [
|
|
6165
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-10 w-10 rounded-full shrink-0" }),
|
|
6166
|
+
/* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1 min-w-0", children: [
|
|
6167
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-4 w-1/3" }),
|
|
6168
|
+
/* @__PURE__ */ jsx(SkeletonLine, { className: "w-2/3 h-3" })
|
|
6169
|
+
] }),
|
|
6170
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-6 w-16 rounded-full" })
|
|
6171
|
+
] }, i)) });
|
|
6172
|
+
}
|
|
6173
|
+
function GridSkeleton({ rows = 6, className }) {
|
|
6174
|
+
return /* @__PURE__ */ jsx(SimpleGrid, { minChildWidth: "260px", gap: "md", className, children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsx(CardSkeleton, {}, i)) });
|
|
6175
|
+
}
|
|
6176
|
+
function StatsSkeleton({ columns = 4, className }) {
|
|
6177
|
+
return /* @__PURE__ */ jsx(SimpleGrid, { minChildWidth: "180px", gap: "md", className, children: Array.from({ length: columns }).map((_, i) => /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: "p-4 border border-border rounded-container", children: [
|
|
6178
|
+
/* @__PURE__ */ jsx(SkeletonLine, { className: "w-1/2 h-3" }),
|
|
6179
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-7 w-2/3" })
|
|
6180
|
+
] }, i)) });
|
|
6181
|
+
}
|
|
6182
|
+
function DetailSkeleton({ rows = 6, className }) {
|
|
6183
|
+
return /* @__PURE__ */ jsxs(VStack, { gap: "lg", className: cn("p-6 border border-border rounded-container", className), children: [
|
|
6184
|
+
/* @__PURE__ */ jsxs(HStack, { className: "items-start justify-between", gap: "md", children: [
|
|
6185
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center", children: [
|
|
6186
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-8 w-56" }),
|
|
6187
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-6 w-20 rounded-full" })
|
|
6188
|
+
] }),
|
|
6189
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "sm", children: [
|
|
6190
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-9 w-24 rounded-interactive" }),
|
|
6191
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-9 w-9 rounded-interactive" })
|
|
6192
|
+
] })
|
|
6193
|
+
] }),
|
|
6194
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "md", children: [
|
|
6195
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-20 flex-1" }),
|
|
6196
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-20 flex-1" }),
|
|
6197
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-20 flex-1" })
|
|
6198
|
+
] }),
|
|
6199
|
+
/* @__PURE__ */ jsx(SimpleGrid, { minChildWidth: "200px", maxCols: 3, gap: "md", children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
6200
|
+
/* @__PURE__ */ jsx(SkeletonLine, { className: "w-1/3 h-3" }),
|
|
6201
|
+
/* @__PURE__ */ jsx(SkeletonBlock, { className: "h-5 w-2/3" })
|
|
6202
|
+
] }, i)) }),
|
|
6203
|
+
/* @__PURE__ */ jsx(TextSkeleton, { rows: 3 })
|
|
6204
|
+
] });
|
|
6205
|
+
}
|
|
6206
|
+
function Skeleton({
|
|
6207
|
+
variant = "text",
|
|
6208
|
+
spec,
|
|
6209
|
+
rows,
|
|
6210
|
+
columns,
|
|
6211
|
+
fields,
|
|
6212
|
+
className,
|
|
6213
|
+
...rest
|
|
6214
|
+
}) {
|
|
6215
|
+
const { t } = useTranslate();
|
|
6216
|
+
const shape = spec !== void 0 ? shapeOfSpec(spec) : { variant, rows, columns, fields };
|
|
6217
|
+
if (shape === null) return null;
|
|
6218
|
+
return /* @__PURE__ */ jsx(
|
|
6219
|
+
Box,
|
|
6220
|
+
{
|
|
6221
|
+
...domPassthrough(rest),
|
|
6222
|
+
role: "status",
|
|
6223
|
+
"aria-busy": "true",
|
|
6224
|
+
"aria-label": rest["aria-label"] ?? t("common.loading"),
|
|
6225
|
+
"data-skeleton": shape.variant,
|
|
6226
|
+
...{ [LOADING_STATE_MARKER]: "" },
|
|
6227
|
+
className: "w-full",
|
|
6228
|
+
children: renderVariant(shape.variant, shape.rows, shape.columns, shape.fields, className)
|
|
6229
|
+
}
|
|
6230
|
+
);
|
|
6231
|
+
}
|
|
6232
|
+
function shapeOfSpec(spec) {
|
|
6233
|
+
if (spec === "none") return null;
|
|
6234
|
+
return typeof spec === "string" ? { variant: spec } : spec;
|
|
6235
|
+
}
|
|
6236
|
+
function renderVariant(variant, rows, columns, fields, className) {
|
|
6237
|
+
switch (variant) {
|
|
6238
|
+
case "header":
|
|
6239
|
+
return /* @__PURE__ */ jsx(HeaderSkeleton, { className });
|
|
6240
|
+
case "table":
|
|
6241
|
+
return /* @__PURE__ */ jsx(TableSkeleton, { rows, columns, className });
|
|
6242
|
+
case "list":
|
|
6243
|
+
return /* @__PURE__ */ jsx(ListSkeleton, { rows, className });
|
|
6244
|
+
case "grid":
|
|
6245
|
+
return /* @__PURE__ */ jsx(GridSkeleton, { rows, className });
|
|
6246
|
+
case "detail":
|
|
6247
|
+
return /* @__PURE__ */ jsx(DetailSkeleton, { rows, className });
|
|
6248
|
+
case "stats":
|
|
6249
|
+
return /* @__PURE__ */ jsx(StatsSkeleton, { columns, className });
|
|
6250
|
+
case "form":
|
|
6251
|
+
return /* @__PURE__ */ jsx(FormSkeleton, { fields, className });
|
|
6252
|
+
case "card":
|
|
6253
|
+
return /* @__PURE__ */ jsx(CardSkeleton, { className });
|
|
6254
|
+
case "text":
|
|
6255
|
+
return /* @__PURE__ */ jsx(TextSkeleton, { rows, className });
|
|
6256
|
+
}
|
|
6257
|
+
}
|
|
6258
|
+
Skeleton.displayName = "Skeleton";
|
|
5869
6259
|
var COLOR_VAR = {
|
|
5870
6260
|
primary: "var(--color-primary)",
|
|
5871
6261
|
success: "var(--color-success)",
|
|
@@ -5881,7 +6271,8 @@ var Sparkline = ({
|
|
|
5881
6271
|
height = 32,
|
|
5882
6272
|
strokeWidth = 2,
|
|
5883
6273
|
fill = false,
|
|
5884
|
-
className
|
|
6274
|
+
className,
|
|
6275
|
+
...rest
|
|
5885
6276
|
}) => {
|
|
5886
6277
|
if (data.length < 2) return null;
|
|
5887
6278
|
const pad = 2;
|
|
@@ -5902,7 +6293,8 @@ var Sparkline = ({
|
|
|
5902
6293
|
height,
|
|
5903
6294
|
viewBox: `0 0 ${width} ${height}`,
|
|
5904
6295
|
className: cn("flex-shrink-0", className),
|
|
5905
|
-
|
|
6296
|
+
...domPassthrough(rest),
|
|
6297
|
+
"aria-hidden": rest["aria-hidden"] ?? true,
|
|
5906
6298
|
children: [
|
|
5907
6299
|
areaPath && /* @__PURE__ */ jsx("path", { d: areaPath, fill: resolvedColor, opacity: 0.15 }),
|
|
5908
6300
|
/* @__PURE__ */ jsx(
|
|
@@ -5923,7 +6315,7 @@ var Sparkline = ({
|
|
|
5923
6315
|
Sparkline.displayName = "Sparkline";
|
|
5924
6316
|
var lookStyles2 = {
|
|
5925
6317
|
elevated: "",
|
|
5926
|
-
flat: "shadow-none
|
|
6318
|
+
flat: "shadow-none",
|
|
5927
6319
|
"progress-backed": "",
|
|
5928
6320
|
gauge: "",
|
|
5929
6321
|
sparkline: ""
|
|
@@ -5963,8 +6355,12 @@ var StatDisplay = ({
|
|
|
5963
6355
|
look = "elevated",
|
|
5964
6356
|
className,
|
|
5965
6357
|
isLoading = false,
|
|
5966
|
-
|
|
6358
|
+
skeleton = { variant: "stats", columns: 1 },
|
|
6359
|
+
error = null,
|
|
6360
|
+
surface = "auto",
|
|
6361
|
+
...rest
|
|
5967
6362
|
}) => {
|
|
6363
|
+
const contentSurface = useContentSurface(surface);
|
|
5968
6364
|
const eventBus = useEventBus();
|
|
5969
6365
|
const fmt = useFormatContext();
|
|
5970
6366
|
const handleClick = useCallback(() => {
|
|
@@ -5985,18 +6381,18 @@ var StatDisplay = ({
|
|
|
5985
6381
|
const trendSuffix = trendFormat === "percent" ? "%" : "";
|
|
5986
6382
|
const trendLabel = showTrend ? `${trendUp ? "\u2191" : "\u2193"} ${trendMagnitude}${trendSuffix}` : "";
|
|
5987
6383
|
if (error) {
|
|
5988
|
-
return
|
|
6384
|
+
return contentSurface.provide(
|
|
6385
|
+
/* @__PURE__ */ jsx(Box, { ...domPassthrough(rest), className: cn(contentSurface.className, "rounded-container", padSizes[size], className), children: /* @__PURE__ */ jsx(Typography, { variant: "small", color: "error", children: error.message }) })
|
|
6386
|
+
);
|
|
5989
6387
|
}
|
|
5990
6388
|
if (isLoading) {
|
|
5991
|
-
return /* @__PURE__ */ jsx(
|
|
5992
|
-
/* @__PURE__ */ jsx(Box, { className: "h-3 bg-muted rounded w-16" }),
|
|
5993
|
-
/* @__PURE__ */ jsx(Box, { className: "h-6 bg-muted rounded w-12" })
|
|
5994
|
-
] }) });
|
|
6389
|
+
return /* @__PURE__ */ jsx(Skeleton, { spec: skeleton, className });
|
|
5995
6390
|
}
|
|
5996
6391
|
if (compact) {
|
|
5997
6392
|
return /* @__PURE__ */ jsxs(
|
|
5998
6393
|
HStack,
|
|
5999
6394
|
{
|
|
6395
|
+
...domPassthrough(rest),
|
|
6000
6396
|
gap: "sm",
|
|
6001
6397
|
className: cn("items-center", clickEvent && "cursor-pointer hover:opacity-80", className),
|
|
6002
6398
|
...pressableProps(clickEvent ? handleClick : void 0),
|
|
@@ -6010,39 +6406,42 @@ var StatDisplay = ({
|
|
|
6010
6406
|
}
|
|
6011
6407
|
);
|
|
6012
6408
|
}
|
|
6013
|
-
return
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
/* @__PURE__ */ jsxs(
|
|
6022
|
-
/* @__PURE__ */ jsx(Typography, { variant: "
|
|
6023
|
-
|
|
6024
|
-
Typography,
|
|
6409
|
+
return contentSurface.provide(
|
|
6410
|
+
/* @__PURE__ */ jsx(
|
|
6411
|
+
Box,
|
|
6412
|
+
{
|
|
6413
|
+
...domPassthrough(rest),
|
|
6414
|
+
className: cn(contentSurface.className, "rounded-container", padSizes[size], lookStyles2[look], clickEvent && "cursor-pointer hover:shadow-elevation-dialog transition-shadow", className),
|
|
6415
|
+
...pressableProps(clickEvent ? handleClick : void 0),
|
|
6416
|
+
children: /* @__PURE__ */ jsxs(HStack, { align: "start", justify: "between", children: [
|
|
6417
|
+
/* @__PURE__ */ jsxs(VStack, { gap: "none", className: "space-y-1 flex-1", children: [
|
|
6418
|
+
/* @__PURE__ */ jsx(Typography, { variant: "overline", color: "secondary", children: label }),
|
|
6419
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "end", children: [
|
|
6420
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: cn("", valueSizes[size], variantColor[variant]), children: displayValue }),
|
|
6421
|
+
showTrend && /* @__PURE__ */ jsx(
|
|
6422
|
+
Typography,
|
|
6423
|
+
{
|
|
6424
|
+
variant: "caption",
|
|
6425
|
+
className: cn("font-semibold pb-1", trendIsGood ? "text-success" : "text-error"),
|
|
6426
|
+
children: trendLabel
|
|
6427
|
+
}
|
|
6428
|
+
)
|
|
6429
|
+
] }),
|
|
6430
|
+
showTarget && /* @__PURE__ */ jsx(Box, { className: "mt-2 h-1.5 w-full bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
6431
|
+
Box,
|
|
6025
6432
|
{
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
children: trendLabel
|
|
6433
|
+
className: cn("h-full rounded-full transition-all", `bg-${variant === "default" ? "primary" : variant}`),
|
|
6434
|
+
style: { width: `${targetPct}%` }
|
|
6029
6435
|
}
|
|
6030
|
-
)
|
|
6436
|
+
) })
|
|
6031
6437
|
] }),
|
|
6032
|
-
|
|
6033
|
-
Box,
|
|
6034
|
-
{
|
|
6035
|
-
|
|
6036
|
-
style: { width: `${targetPct}%` }
|
|
6037
|
-
}
|
|
6038
|
-
) })
|
|
6039
|
-
] }),
|
|
6040
|
-
/* @__PURE__ */ jsxs(VStack, { gap: "xs", align: "end", children: [
|
|
6041
|
-
ResolvedIcon && /* @__PURE__ */ jsx(Box, { className: cn("p-3 rounded-container", iconBg), children: /* @__PURE__ */ jsx(ResolvedIcon, { className: cn(iconSizes[size], iconColor) }) }),
|
|
6042
|
-
sparklineData && sparklineData.length > 1 && /* @__PURE__ */ jsx(Sparkline, { data: sparklineData, color: "auto" })
|
|
6438
|
+
/* @__PURE__ */ jsxs(VStack, { gap: "xs", align: "end", children: [
|
|
6439
|
+
ResolvedIcon && /* @__PURE__ */ jsx(Box, { className: cn("p-3 rounded-container", iconBg), children: /* @__PURE__ */ jsx(ResolvedIcon, { className: cn(iconSizes[size], iconColor) }) }),
|
|
6440
|
+
sparklineData && sparklineData.length > 1 && /* @__PURE__ */ jsx(Sparkline, { data: sparklineData, color: "auto" })
|
|
6441
|
+
] })
|
|
6043
6442
|
] })
|
|
6044
|
-
|
|
6045
|
-
|
|
6443
|
+
}
|
|
6444
|
+
)
|
|
6046
6445
|
);
|
|
6047
6446
|
};
|
|
6048
6447
|
StatDisplay.displayName = "StatDisplay";
|
|
@@ -6056,12 +6455,14 @@ var colorTokenVars = {
|
|
|
6056
6455
|
};
|
|
6057
6456
|
var GradientDivider = ({
|
|
6058
6457
|
color,
|
|
6059
|
-
className
|
|
6458
|
+
className,
|
|
6459
|
+
...rest
|
|
6060
6460
|
}) => {
|
|
6061
6461
|
const centerColor = color ? color in colorTokenVars ? colorTokenVars[color] : color : "var(--color-primary)";
|
|
6062
6462
|
return /* @__PURE__ */ jsx(
|
|
6063
6463
|
Box,
|
|
6064
6464
|
{
|
|
6465
|
+
...domPassthrough(rest),
|
|
6065
6466
|
className: cn("w-full h-px", className),
|
|
6066
6467
|
style: {
|
|
6067
6468
|
background: `linear-gradient(to right, transparent, ${centerColor}, transparent)`
|
|
@@ -6112,7 +6513,8 @@ var AnimatedCounter = ({
|
|
|
6112
6513
|
prefix,
|
|
6113
6514
|
suffix,
|
|
6114
6515
|
format,
|
|
6115
|
-
className
|
|
6516
|
+
className,
|
|
6517
|
+
...rest
|
|
6116
6518
|
}) => {
|
|
6117
6519
|
const fmt = useFormatContext();
|
|
6118
6520
|
const ref = useRef(null);
|
|
@@ -6164,7 +6566,7 @@ var AnimatedCounter = ({
|
|
|
6164
6566
|
};
|
|
6165
6567
|
}, [visible, target, duration]);
|
|
6166
6568
|
const text = parsed.num === null ? parsed.suffix : `${prefix ?? ""}${parsed.prefix}${formatNumber(display, format, parsed.decimals, fmt)}${parsed.suffix}${suffix ?? ""}`;
|
|
6167
|
-
return /* @__PURE__ */ jsxs(Box, { ref, className: cn("flex flex-col items-center gap-1", className), children: [
|
|
6569
|
+
return /* @__PURE__ */ jsxs(Box, { ...domPassthrough(rest), ref, className: cn("flex flex-col items-center gap-1", className), children: [
|
|
6168
6570
|
/* @__PURE__ */ jsx(Typography, { variant: "h2", className: "text-primary tabular-nums", children: text }),
|
|
6169
6571
|
label ? /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "muted", className: "text-center", children: label }) : null
|
|
6170
6572
|
] });
|
|
@@ -6190,7 +6592,7 @@ var animatedStyles = {
|
|
|
6190
6592
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6191
6593
|
"none": {}
|
|
6192
6594
|
};
|
|
6193
|
-
var AnimatedReveal =
|
|
6595
|
+
var AnimatedReveal = React17__default.forwardRef(
|
|
6194
6596
|
({
|
|
6195
6597
|
trigger = "scroll",
|
|
6196
6598
|
animation = "fade-up",
|
|
@@ -6343,7 +6745,7 @@ function applyMorphAnimation(container, animate, duration, delay, easing) {
|
|
|
6343
6745
|
el.style.opacity = animate ? "1" : "0";
|
|
6344
6746
|
});
|
|
6345
6747
|
}
|
|
6346
|
-
var AnimatedGraphic =
|
|
6748
|
+
var AnimatedGraphic = React17__default.forwardRef(
|
|
6347
6749
|
({
|
|
6348
6750
|
src,
|
|
6349
6751
|
svgContent,
|
|
@@ -6366,7 +6768,7 @@ var AnimatedGraphic = React15__default.forwardRef(
|
|
|
6366
6768
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6367
6769
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6368
6770
|
const prevAnimateRef = useRef(animate);
|
|
6369
|
-
const setRef =
|
|
6771
|
+
const setRef = React17__default.useCallback(
|
|
6370
6772
|
(node) => {
|
|
6371
6773
|
containerRef.current = node;
|
|
6372
6774
|
if (typeof ref === "function") ref(node);
|
|
@@ -6917,10 +7319,11 @@ var PatternTile = ({
|
|
|
6917
7319
|
size = 60,
|
|
6918
7320
|
color = "var(--color-primary)",
|
|
6919
7321
|
strokeWidth = 0.5,
|
|
6920
|
-
className
|
|
7322
|
+
className,
|
|
7323
|
+
...rest
|
|
6921
7324
|
}) => {
|
|
6922
7325
|
const Variant = VARIANT_MAP[variant];
|
|
6923
|
-
return /* @__PURE__ */ jsx("g", { className, children: /* @__PURE__ */ jsx(Variant, { size, color, strokeWidth }) });
|
|
7326
|
+
return /* @__PURE__ */ jsx("g", { className, ...domPassthrough(rest), children: /* @__PURE__ */ jsx(Variant, { size, color, strokeWidth }) });
|
|
6924
7327
|
};
|
|
6925
7328
|
PatternTile.displayName = "PatternTile";
|
|
6926
7329
|
function getTileDimensions(variant, size) {
|