@proveanything/smartlinks-utils-ui 0.10.7 → 0.10.9
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/{IconPicker-BMMQLR5I.d.ts → IconPicker-DKpL5Hcc.d.ts} +1 -1
- package/dist/chunk-2MW54ZVG.js +92 -0
- package/dist/chunk-2MW54ZVG.js.map +1 -0
- package/dist/components/AssetPicker/index.css +15 -0
- package/dist/components/AssetPicker/index.css.map +1 -1
- package/dist/components/AssetPicker/index.d.ts +1 -1
- package/dist/components/ConditionsEditor/index.css +15 -0
- package/dist/components/ConditionsEditor/index.css.map +1 -1
- package/dist/components/FontPicker/index.css +15 -0
- package/dist/components/FontPicker/index.css.map +1 -1
- package/dist/components/IconPicker/index.css +15 -0
- package/dist/components/IconPicker/index.css.map +1 -1
- package/dist/components/IconPicker/index.d.ts +2 -2
- package/dist/components/RecordsAdmin/index.css +15 -0
- package/dist/components/RecordsAdmin/index.css.map +1 -1
- package/dist/components/RecordsAdmin/index.d.ts +77 -5
- package/dist/components/RecordsAdmin/index.js +166 -109
- package/dist/components/RecordsAdmin/index.js.map +1 -1
- package/dist/index.css +197 -182
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +62 -4
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/{useAssets-BM1bzzkq.d.ts → useAssets-BAtXv6D5.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -40,4 +40,4 @@ interface IconPickerProps {
|
|
|
40
40
|
|
|
41
41
|
declare const IconPicker: React$1.FC<IconPickerProps>;
|
|
42
42
|
|
|
43
|
-
export {
|
|
43
|
+
export { type IconFamily as I, type IconStyle as a, IconPicker as b, type IconPickerProps as c, type IconSelection as d };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { useId } from 'react';
|
|
2
|
+
import { BookOpen, HelpCircle, AlertTriangle, CheckCircle2, Lightbulb, Info, X } from 'lucide-react';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/components/AdminPageHeader/AdminPageHeader.tsx
|
|
6
|
+
var TONE_ICON = {
|
|
7
|
+
info: Lightbulb,
|
|
8
|
+
success: CheckCircle2,
|
|
9
|
+
warning: AlertTriangle
|
|
10
|
+
};
|
|
11
|
+
function AdminPageHeader({
|
|
12
|
+
title,
|
|
13
|
+
subtitle,
|
|
14
|
+
icon,
|
|
15
|
+
helpUrl,
|
|
16
|
+
helpLabel,
|
|
17
|
+
actions,
|
|
18
|
+
aside,
|
|
19
|
+
intro,
|
|
20
|
+
className
|
|
21
|
+
}) {
|
|
22
|
+
const titleId = useId();
|
|
23
|
+
const resolvedHelpLabel = helpLabel ?? "Help & documentation";
|
|
24
|
+
const resolvedReopenLabel = intro?.reopenLabel ?? "How it works";
|
|
25
|
+
const showReopen = !!intro && intro.dismissed && !!intro.onReopen;
|
|
26
|
+
const showIntro = !!intro && !intro.dismissed;
|
|
27
|
+
return /* @__PURE__ */ jsxs("header", { className: `sl-aph${className ? ` ${className}` : ""}`, "aria-labelledby": titleId, children: [
|
|
28
|
+
/* @__PURE__ */ jsxs("div", { className: "sl-aph__row", children: [
|
|
29
|
+
/* @__PURE__ */ jsx("div", { className: "sl-aph__main", children: /* @__PURE__ */ jsxs("div", { className: "sl-aph__text", children: [
|
|
30
|
+
/* @__PURE__ */ jsxs("h1", { className: "sl-aph__title", id: titleId, children: [
|
|
31
|
+
icon ? /* @__PURE__ */ jsx("span", { className: "sl-aph__icon", "aria-hidden": "true", children: icon }) : null,
|
|
32
|
+
/* @__PURE__ */ jsx("span", { children: title })
|
|
33
|
+
] }),
|
|
34
|
+
subtitle ? /* @__PURE__ */ jsx("p", { className: "sl-aph__subtitle", children: subtitle }) : null
|
|
35
|
+
] }) }),
|
|
36
|
+
actions || aside || helpUrl || showReopen ? /* @__PURE__ */ jsxs("div", { className: "sl-aph__aside", children: [
|
|
37
|
+
actions,
|
|
38
|
+
aside,
|
|
39
|
+
helpUrl ? /* @__PURE__ */ jsx(
|
|
40
|
+
"a",
|
|
41
|
+
{
|
|
42
|
+
href: helpUrl,
|
|
43
|
+
target: "_blank",
|
|
44
|
+
rel: "noopener noreferrer",
|
|
45
|
+
className: "sl-aph__icon-btn",
|
|
46
|
+
"aria-label": resolvedHelpLabel,
|
|
47
|
+
title: resolvedHelpLabel,
|
|
48
|
+
children: /* @__PURE__ */ jsx(BookOpen, { "aria-hidden": "true" })
|
|
49
|
+
}
|
|
50
|
+
) : null,
|
|
51
|
+
showReopen ? /* @__PURE__ */ jsx(
|
|
52
|
+
"button",
|
|
53
|
+
{
|
|
54
|
+
type: "button",
|
|
55
|
+
onClick: intro.onReopen,
|
|
56
|
+
className: "sl-aph__icon-btn",
|
|
57
|
+
"aria-label": resolvedReopenLabel,
|
|
58
|
+
title: resolvedReopenLabel,
|
|
59
|
+
children: /* @__PURE__ */ jsx(HelpCircle, { "aria-hidden": "true" })
|
|
60
|
+
}
|
|
61
|
+
) : null
|
|
62
|
+
] }) : null
|
|
63
|
+
] }),
|
|
64
|
+
showIntro ? /* @__PURE__ */ jsx(AdminPageHeaderIntroCard, { intro }) : null
|
|
65
|
+
] });
|
|
66
|
+
}
|
|
67
|
+
function AdminPageHeaderIntroCard({ intro }) {
|
|
68
|
+
const tone = intro.tone ?? "info";
|
|
69
|
+
const Icon = TONE_ICON[tone] ?? Info;
|
|
70
|
+
return /* @__PURE__ */ jsxs("div", { className: "sl-aph__intro", "data-tone": tone, role: "note", children: [
|
|
71
|
+
/* @__PURE__ */ jsx("div", { className: "sl-aph__intro-icon", children: /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true", style: { width: "0.95rem", height: "0.95rem" } }) }),
|
|
72
|
+
/* @__PURE__ */ jsxs("div", { className: "sl-aph__intro-body", children: [
|
|
73
|
+
/* @__PURE__ */ jsx("h4", { className: "sl-aph__intro-title", children: intro.title }),
|
|
74
|
+
/* @__PURE__ */ jsx("span", { className: "sl-aph__intro-text", children: intro.body }),
|
|
75
|
+
intro.action ? /* @__PURE__ */ jsx("span", { className: "sl-aph__intro-action", children: intro.action }) : null
|
|
76
|
+
] }),
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
"button",
|
|
79
|
+
{
|
|
80
|
+
type: "button",
|
|
81
|
+
onClick: intro.onDismiss,
|
|
82
|
+
"aria-label": "Dismiss",
|
|
83
|
+
className: "sl-aph__intro-dismiss",
|
|
84
|
+
children: /* @__PURE__ */ jsx(X, { "aria-hidden": "true", style: { width: "0.875rem", height: "0.875rem" } })
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
] });
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export { AdminPageHeader };
|
|
91
|
+
//# sourceMappingURL=chunk-2MW54ZVG.js.map
|
|
92
|
+
//# sourceMappingURL=chunk-2MW54ZVG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/AdminPageHeader/AdminPageHeader.tsx"],"names":[],"mappings":";;;;;AA+EA,IAAM,SAAA,GAAY;AAAA,EAChB,IAAA,EAAM,SAAA;AAAA,EACN,OAAA,EAAS,YAAA;AAAA,EACT,OAAA,EAAS;AACX,CAAA;AAEO,SAAS,eAAA,CAAgB;AAAA,EAC9B,KAAA;AAAA,EAAO,QAAA;AAAA,EAAU,IAAA;AAAA,EAAM,OAAA;AAAA,EAAS,SAAA;AAAA,EAChC,OAAA;AAAA,EAAS,KAAA;AAAA,EAAO,KAAA;AAAA,EAAO;AACzB,CAAA,EAAyB;AACvB,EAAA,MAAM,UAAU,KAAA,EAAM;AACtB,EAAA,MAAM,oBAAoB,SAAA,IAAa,sBAAA;AACvC,EAAA,MAAM,mBAAA,GAAsB,OAAO,WAAA,IAAe,cAAA;AAClD,EAAA,MAAM,UAAA,GAAa,CAAC,CAAC,KAAA,IAAS,MAAM,SAAA,IAAa,CAAC,CAAC,KAAA,CAAM,QAAA;AACzD,EAAA,MAAM,SAAA,GAAY,CAAC,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AU,qBAAA,EAAuB,QAAA,EAAA,KAAA,CAAM,KAAA,EAAM,CAAA;AAAA,sBACjD,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,oBAAA,EAAsB,gBAAM,IAAA,EAAK,CAAA;AAAA,MAChD,KAAA,CAAM,yBAAS,GAAA,CAAC,MAAA,EAAA,EAAK,WAAU,sBAAA,EAAwB,QAAA,EAAA,KAAA,CAAM,QAAO,CAAA,GAAU;AAAA,KAAA,EACjF,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,IAAA,EAAK,QAAA;AAAA,QACL,SAAS,KAAA,CAAM,SAAA;AAAA,QACf,YAAA,EAAW,SAAA;AAAA,QACX,SAAA,EAAU,uBAAA;AAAA,QAEV,QAAA,kBAAA,GAAA,CAAC,CAAA,EAAA,EAAE,aAAA,EAAY,MAAA,EAAO,KAAA,EAAO,EAAE,KAAA,EAAO,UAAA,EAAY,MAAA,EAAQ,UAAA,EAAW,EAAG;AAAA;AAAA;AAC1E,GAAA,EACF,CAAA;AAEJ","file":"chunk-2MW54ZVG.js","sourcesContent":["// =============================================================================\r\n// AdminPageHeader\r\n//\r\n// A standardised page header for any SmartLinks admin surface. Designed to be\r\n// used standalone (lightweight apps that don't need the full RecordsAdminShell)\r\n// or composed inside other shells. Supports:\r\n//\r\n// • Inline icon + title + full-width subtitle\r\n// • Right-aligned slot for app-specific actions (e.g. \"+ New\" button)\r\n// • External help link (icon-button that opens docs in a new tab)\r\n// • Optional dismissible intro card with `?` reopen affordance\r\n// • Optional `aside` slot for extra header content (stats strips, etc.)\r\n//\r\n// Styling is self-contained under `.sl-aph` and reuses the shared `--ra-*`\r\n// design tokens with sensible fallbacks, so it themes correctly whether the\r\n// host has loaded the records-admin token sheet or not.\r\n// =============================================================================\r\nimport { type ReactNode, useId } from 'react';\r\nimport { BookOpen, HelpCircle, X, Lightbulb, CheckCircle2, AlertTriangle, Info } from 'lucide-react';\r\nimport './admin-page-header.css';\r\n\r\nexport type AdminPageHeaderIntroTone = 'info' | 'success' | 'warning';\r\n\r\nexport interface AdminPageHeaderIntro {\r\n /** Short headline shown in bold at the start of the intro card. */\r\n title: string;\r\n /** Body content — plain text or rich nodes. */\r\n body: ReactNode;\r\n /** Visual tone — controls icon and surface tint. Default `'info'`. */\r\n tone?: AdminPageHeaderIntroTone;\r\n /** Optional action node rendered inline after the body (e.g. a Learn-more link). */\r\n action?: ReactNode;\r\n /** Whether the intro is currently dismissed. Controlled. */\r\n dismissed: boolean;\r\n /** Called when the user clicks the dismiss `X`. */\r\n onDismiss: () => void;\r\n /**\r\n * Called when the user clicks the reopen `?` button (only rendered when\r\n * dismissed is true). Omit to hide the reopen affordance entirely.\r\n */\r\n onReopen?: () => void;\r\n /** Tooltip / aria-label for the reopen button. Default \"How it works\". */\r\n reopenLabel?: string;\r\n}\r\n\r\nexport interface AdminPageHeaderProps {\r\n /** Page title — required. */\r\n title: string;\r\n /** Single-line muted subtitle under the title. */\r\n subtitle?: string;\r\n /** Icon rendered inline before the title. Pass a Lucide element or any node. */\r\n icon?: ReactNode;\r\n /**\r\n * External help / documentation URL. When set, renders a small icon-button\r\n * that opens the URL in a new tab. Use this to point at app-specific docs.\r\n */\r\n helpUrl?: string;\r\n /** Tooltip / aria-label for the help link. Default \"Help & documentation\". */\r\n helpLabel?: string;\r\n /**\r\n * Right-aligned action slot — typically a primary \"+ New\" button and/or\r\n * secondary controls. Rendered before the help / intro-reopen icon-buttons.\r\n */\r\n actions?: ReactNode;\r\n /**\r\n * Extra header content rendered between `actions` and the trailing\r\n * help / reopen icon-buttons. Used by RecordsAdminShell for its stats strip;\r\n * standalone apps rarely need it.\r\n */\r\n aside?: ReactNode;\r\n /**\r\n * Optional dismissible intro card rendered below the header row.\r\n * See {@link AdminPageHeaderIntro}.\r\n */\r\n intro?: AdminPageHeaderIntro;\r\n /** Extra class on the root container for layout overrides. */\r\n className?: string;\r\n}\r\n\r\nconst TONE_ICON = {\r\n info: Lightbulb,\r\n success: CheckCircle2,\r\n warning: AlertTriangle,\r\n} as const;\r\n\r\nexport function AdminPageHeader({\r\n title, subtitle, icon, helpUrl, helpLabel,\r\n actions, aside, intro, className,\r\n}: AdminPageHeaderProps) {\r\n const titleId = useId();\r\n const resolvedHelpLabel = helpLabel ?? 'Help & documentation';\r\n const resolvedReopenLabel = intro?.reopenLabel ?? 'How it works';\r\n const showReopen = !!intro && intro.dismissed && !!intro.onReopen;\r\n const showIntro = !!intro && !intro.dismissed;\r\n\r\n return (\r\n <header className={`sl-aph${className ? ` ${className}` : ''}`} aria-labelledby={titleId}>\r\n <div className=\"sl-aph__row\">\r\n <div className=\"sl-aph__main\">\r\n <div className=\"sl-aph__text\">\r\n <h1 className=\"sl-aph__title\" id={titleId}>\r\n {icon ? (\r\n <span className=\"sl-aph__icon\" aria-hidden=\"true\">{icon}</span>\r\n ) : null}\r\n <span>{title}</span>\r\n </h1>\r\n {subtitle ? <p className=\"sl-aph__subtitle\">{subtitle}</p> : null}\r\n </div>\r\n </div>\r\n {(actions || aside || helpUrl || showReopen) ? (\r\n <div className=\"sl-aph__aside\">\r\n {actions}\r\n {aside}\r\n {helpUrl ? (\r\n <a\r\n href={helpUrl}\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n className=\"sl-aph__icon-btn\"\r\n aria-label={resolvedHelpLabel}\r\n title={resolvedHelpLabel}\r\n >\r\n <BookOpen aria-hidden=\"true\" />\r\n </a>\r\n ) : null}\r\n {showReopen ? (\r\n <button\r\n type=\"button\"\r\n onClick={intro!.onReopen}\r\n className=\"sl-aph__icon-btn\"\r\n aria-label={resolvedReopenLabel}\r\n title={resolvedReopenLabel}\r\n >\r\n <HelpCircle aria-hidden=\"true\" />\r\n </button>\r\n ) : null}\r\n </div>\r\n ) : null}\r\n </div>\r\n {showIntro ? <AdminPageHeaderIntroCard intro={intro!} /> : null}\r\n </header>\r\n );\r\n}\r\n\r\nfunction AdminPageHeaderIntroCard({ intro }: { intro: AdminPageHeaderIntro }) {\r\n const tone = intro.tone ?? 'info';\r\n const Icon = TONE_ICON[tone] ?? Info;\r\n return (\r\n <div className=\"sl-aph__intro\" data-tone={tone} role=\"note\">\r\n <div className=\"sl-aph__intro-icon\">\r\n <Icon aria-hidden=\"true\" style={{ width: '0.95rem', height: '0.95rem' }} />\r\n </div>\r\n <div className=\"sl-aph__intro-body\">\r\n <h4 className=\"sl-aph__intro-title\">{intro.title}</h4>\r\n <span className=\"sl-aph__intro-text\">{intro.body}</span>\r\n {intro.action ? <span className=\"sl-aph__intro-action\">{intro.action}</span> : null}\r\n </div>\r\n <button\r\n type=\"button\"\r\n onClick={intro.onDismiss}\r\n aria-label=\"Dismiss\"\r\n className=\"sl-aph__intro-dismiss\"\r\n >\r\n <X aria-hidden=\"true\" style={{ width: '0.875rem', height: '0.875rem' }} />\r\n </button>\r\n </div>\r\n );\r\n}"]}
|
|
@@ -1746,6 +1746,21 @@
|
|
|
1746
1746
|
.ra-shell .ra-status-icon--missing {
|
|
1747
1747
|
color: hsl(var(--ra-status-missing) / 0.7);
|
|
1748
1748
|
}
|
|
1749
|
+
.ra-shell .ra-status-icon--success {
|
|
1750
|
+
color: hsl(var(--ra-success));
|
|
1751
|
+
}
|
|
1752
|
+
.ra-shell .ra-status-icon--warning {
|
|
1753
|
+
color: hsl(var(--ra-warning));
|
|
1754
|
+
}
|
|
1755
|
+
.ra-shell .ra-status-icon--danger {
|
|
1756
|
+
color: hsl(var(--ra-danger));
|
|
1757
|
+
}
|
|
1758
|
+
.ra-shell .ra-status-icon--info {
|
|
1759
|
+
color: hsl(var(--ra-info));
|
|
1760
|
+
}
|
|
1761
|
+
.ra-shell .ra-status-icon--muted {
|
|
1762
|
+
color: hsl(var(--ra-status-missing) / 0.7);
|
|
1763
|
+
}
|
|
1749
1764
|
.ra-shell .ra-row-status {
|
|
1750
1765
|
display: inline-flex;
|
|
1751
1766
|
align-items: center;
|