@adea-ai/ui 0.159.7 → 0.159.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/components/composites/update-dialog/update-model.js +1 -1
- package/dist/components/composites/update-dialog/update-model.js.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.js +9 -4
- package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/r/src/components/composites/update-dialog/update-model.ts +1 -1
- package/dist/r/src/components/ui/breadcrumb/breadcrumb.tsx +3 -1
- package/package.json +1 -1
- package/src/components/composites/update-dialog/update-model.ts +1 -1
- package/src/components/ui/breadcrumb/breadcrumb.tsx +3 -1
|
@@ -67,7 +67,7 @@ function triggerLabel(input) {
|
|
|
67
67
|
case "downloading":
|
|
68
68
|
case "installing": return "Installing update…";
|
|
69
69
|
case "failed": return `Version ${state.currentVersion || fallback} · Retry`;
|
|
70
|
-
default: return `${appName} v${state.currentVersion
|
|
70
|
+
default: return `${appName} ${state.currentVersion ? `v${state.currentVersion}` : fallback}`;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
export { PLACEHOLDER_VERSION, errorMessage, installedVersion, isActionable, isBusy, isInFlight, progressPercent, triggerLabel, withPendingCancel };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-model.js","names":[],"sources":["../../../../src/components/composites/update-dialog/update-model.ts"],"sourcesContent":["/**\n * The update dialog's state vocabulary, free of the component: which phases\n * mean the updater is working, how a snapshot reads in the trigger, and how an\n * adapter's failure becomes a message.\n */\n\n/** The phase an update is in. The union is the state machine. */\nexport type UpdatePhase =\n | 'idle'\n | 'checking'\n | 'current'\n | 'available'\n | 'downloading'\n | 'installing'\n | 'installed'\n | 'cancelling'\n | 'cancelled'\n | 'unavailable'\n | 'failed'\n\n/** A snapshot of the updater. Every field the dialog renders, and nothing else. */\nexport type UpdateState = Readonly<{\n phase: UpdatePhase\n /** The version currently installed. */\n currentVersion: string\n /** The version that can be installed, when one can. */\n availableVersion?: string | null\n /** A changelog for the installed channel, as markdown. */\n changelog?: string\n /** Notes for the available release, as markdown. */\n releaseNotes?: string | null\n /** The available release's date, as an ISO string. */\n releaseDate?: string | null\n /** Bytes downloaded so far, during `downloading`. */\n downloadedBytes?: number\n /** Total bytes, when the server sent a length. */\n totalBytes?: number | null\n /** Set when `phase` is `failed`, and sometimes when it is not. */\n error?: string | null\n /** A URL for the release's page. */\n releaseUrl?: string | null\n /** True when the application must restart to finish. */\n restartRequired?: boolean\n}>\n\n/** Shown as the installed version until the host supplies one. */\nexport const PLACEHOLDER_VERSION = '0.1.0'\n\n/** The phases during which a download or install is under way in the shell. */\nexport function isInFlight(phase: UpdatePhase | undefined): boolean {\n return phase === 'downloading' || phase === 'installing' || phase === 'cancelling'\n}\n\n/**\n * The phases during which the updater is working. `downloading` and `installing`\n * are included because the shell can be in either while the dialog is open, and\n * offering an enabled Install button during a download is how a double-install\n * happens.\n */\nexport function isBusy(state: UpdateState | null): boolean {\n return state?.phase === 'checking' || isInFlight(state?.phase)\n}\n\n/** A snapshot that offers or is carrying out an update. */\nexport function isActionable(state: UpdateState | null): boolean {\n return state?.phase === 'available' || isBusy(state)\n}\n\n/** A snapshot as the dialog shows it while a cancel it asked for is still pending. */\nexport function withPendingCancel(next: UpdateState, cancelPending: boolean): UpdateState {\n return cancelPending && (next.phase === 'downloading' || next.phase === 'installing')\n ? { ...next, phase: 'cancelling' }\n : next\n}\n\nfunction messageText(value: unknown): string | undefined {\n if (typeof value !== 'string') return undefined\n const message = value.trim()\n return message && message !== '[object Object]' ? message : undefined\n}\n\n/**\n * The message for an adapter failure: an `Error`, a string, or a structured\n * error carrying a `safe.message` (at the top level or under `error`), which is\n * how a desktop shell marks the part of an error that may be shown. Nothing\n * else of an unknown object is shown; `fallback` is.\n */\nexport function errorMessage(caught: unknown, fallback: string): string {\n if (caught instanceof Error) return messageText(caught.message) ?? fallback\n const plainMessage = messageText(caught)\n if (plainMessage) return plainMessage\n if (!caught || typeof caught !== 'object') return fallback\n\n const record = caught as { error?: unknown; safe?: unknown }\n const safe = record.safe as { message?: unknown } | null | undefined\n const nestedError = record.error as { safe?: { message?: unknown } | null } | null | undefined\n return messageText(safe?.message) ?? messageText(nestedError?.safe?.message) ?? fallback\n}\n\n/** The installed version to show: the snapshot's, the host's fallback, or the placeholder. */\nexport function installedVersion(state: UpdateState | null, fallbackVersion?: string): string {\n return state?.currentVersion || fallbackVersion || PLACEHOLDER_VERSION\n}\n\n/** Download progress as a whole percentage, or `null` while the size is unknown. */\nexport function progressPercent(state: UpdateState | null): number | null {\n if (!state?.totalBytes || !state.downloadedBytes) return null\n return Math.min(100, Math.round((state.downloadedBytes / state.totalBytes) * 100))\n}\n\n/** What the dialog's trigger says about the updater. */\nexport function triggerLabel(input: {\n state: UpdateState | null\n checkFailed: boolean\n appName: string\n fallbackVersion?: string\n}): string {\n const { state, appName } = input\n const fallback = `v${input.fallbackVersion ?? PLACEHOLDER_VERSION}`\n if (input.checkFailed) return `Version ${state?.currentVersion || fallback} · Retry`\n if (!state) return `${appName} ${fallback}`\n switch (state.phase) {\n case 'checking':\n return 'Checking for updates…'\n case 'available':\n return state.availableVersion\n ? `Update v${state.availableVersion} available`\n : 'Update available'\n case 'downloading':\n case 'installing':\n return 'Installing update…'\n case 'failed':\n return `Version ${state.currentVersion || fallback} · Retry`\n default:\n return `${appName} v${state.currentVersion
|
|
1
|
+
{"version":3,"file":"update-model.js","names":[],"sources":["../../../../src/components/composites/update-dialog/update-model.ts"],"sourcesContent":["/**\n * The update dialog's state vocabulary, free of the component: which phases\n * mean the updater is working, how a snapshot reads in the trigger, and how an\n * adapter's failure becomes a message.\n */\n\n/** The phase an update is in. The union is the state machine. */\nexport type UpdatePhase =\n | 'idle'\n | 'checking'\n | 'current'\n | 'available'\n | 'downloading'\n | 'installing'\n | 'installed'\n | 'cancelling'\n | 'cancelled'\n | 'unavailable'\n | 'failed'\n\n/** A snapshot of the updater. Every field the dialog renders, and nothing else. */\nexport type UpdateState = Readonly<{\n phase: UpdatePhase\n /** The version currently installed. */\n currentVersion: string\n /** The version that can be installed, when one can. */\n availableVersion?: string | null\n /** A changelog for the installed channel, as markdown. */\n changelog?: string\n /** Notes for the available release, as markdown. */\n releaseNotes?: string | null\n /** The available release's date, as an ISO string. */\n releaseDate?: string | null\n /** Bytes downloaded so far, during `downloading`. */\n downloadedBytes?: number\n /** Total bytes, when the server sent a length. */\n totalBytes?: number | null\n /** Set when `phase` is `failed`, and sometimes when it is not. */\n error?: string | null\n /** A URL for the release's page. */\n releaseUrl?: string | null\n /** True when the application must restart to finish. */\n restartRequired?: boolean\n}>\n\n/** Shown as the installed version until the host supplies one. */\nexport const PLACEHOLDER_VERSION = '0.1.0'\n\n/** The phases during which a download or install is under way in the shell. */\nexport function isInFlight(phase: UpdatePhase | undefined): boolean {\n return phase === 'downloading' || phase === 'installing' || phase === 'cancelling'\n}\n\n/**\n * The phases during which the updater is working. `downloading` and `installing`\n * are included because the shell can be in either while the dialog is open, and\n * offering an enabled Install button during a download is how a double-install\n * happens.\n */\nexport function isBusy(state: UpdateState | null): boolean {\n return state?.phase === 'checking' || isInFlight(state?.phase)\n}\n\n/** A snapshot that offers or is carrying out an update. */\nexport function isActionable(state: UpdateState | null): boolean {\n return state?.phase === 'available' || isBusy(state)\n}\n\n/** A snapshot as the dialog shows it while a cancel it asked for is still pending. */\nexport function withPendingCancel(next: UpdateState, cancelPending: boolean): UpdateState {\n return cancelPending && (next.phase === 'downloading' || next.phase === 'installing')\n ? { ...next, phase: 'cancelling' }\n : next\n}\n\nfunction messageText(value: unknown): string | undefined {\n if (typeof value !== 'string') return undefined\n const message = value.trim()\n return message && message !== '[object Object]' ? message : undefined\n}\n\n/**\n * The message for an adapter failure: an `Error`, a string, or a structured\n * error carrying a `safe.message` (at the top level or under `error`), which is\n * how a desktop shell marks the part of an error that may be shown. Nothing\n * else of an unknown object is shown; `fallback` is.\n */\nexport function errorMessage(caught: unknown, fallback: string): string {\n if (caught instanceof Error) return messageText(caught.message) ?? fallback\n const plainMessage = messageText(caught)\n if (plainMessage) return plainMessage\n if (!caught || typeof caught !== 'object') return fallback\n\n const record = caught as { error?: unknown; safe?: unknown }\n const safe = record.safe as { message?: unknown } | null | undefined\n const nestedError = record.error as { safe?: { message?: unknown } | null } | null | undefined\n return messageText(safe?.message) ?? messageText(nestedError?.safe?.message) ?? fallback\n}\n\n/** The installed version to show: the snapshot's, the host's fallback, or the placeholder. */\nexport function installedVersion(state: UpdateState | null, fallbackVersion?: string): string {\n return state?.currentVersion || fallbackVersion || PLACEHOLDER_VERSION\n}\n\n/** Download progress as a whole percentage, or `null` while the size is unknown. */\nexport function progressPercent(state: UpdateState | null): number | null {\n if (!state?.totalBytes || !state.downloadedBytes) return null\n return Math.min(100, Math.round((state.downloadedBytes / state.totalBytes) * 100))\n}\n\n/** What the dialog's trigger says about the updater. */\nexport function triggerLabel(input: {\n state: UpdateState | null\n checkFailed: boolean\n appName: string\n fallbackVersion?: string\n}): string {\n const { state, appName } = input\n const fallback = `v${input.fallbackVersion ?? PLACEHOLDER_VERSION}`\n if (input.checkFailed) return `Version ${state?.currentVersion || fallback} · Retry`\n if (!state) return `${appName} ${fallback}`\n switch (state.phase) {\n case 'checking':\n return 'Checking for updates…'\n case 'available':\n return state.availableVersion\n ? `Update v${state.availableVersion} available`\n : 'Update available'\n case 'downloading':\n case 'installing':\n return 'Installing update…'\n case 'failed':\n return `Version ${state.currentVersion || fallback} · Retry`\n default:\n return `${appName} ${state.currentVersion ? `v${state.currentVersion}` : fallback}`\n }\n}\n"],"mappings":";;AA8CA,IAAa,sBAAsB;;AAGnC,SAAgB,WAAW,OAAyC;CAClE,OAAO,UAAU,iBAAiB,UAAU,gBAAgB,UAAU;AACxE;;;;;;;AAQA,SAAgB,OAAO,OAAoC;CACzD,OAAO,OAAO,UAAU,cAAc,WAAW,OAAO,KAAK;AAC/D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AAM,mBACT,WAAW,MAAM,iBAAiB,cAClC;EACN,KAAK;EACL,KAAK,cACH,OAAO;EACT,KAAK,UACH,OAAO,WAAW,MAAM,kBAAkB,SAAS;EACrD,SACE,OAAO,GAAG,QAAQ,GAAG,MAAM,iBAAiB,IAAI,MAAM,mBAAmB;CAC7E;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/breadcrumb/breadcrumb.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAS9C;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCAWtD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,kCASzD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,kCASzD;AAED,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG;IACtD,wDAAwD;IACxD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/breadcrumb/breadcrumb.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAS9C;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,kCAWtD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,kCASzD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,kCASzD;AAED,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG;IACtD,wDAAwD;IACxD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,kCAqBxD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,kCAU3D;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,kCAc9D;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,kCAe/D"}
|
|
@@ -61,7 +61,7 @@ function BreadcrumbItem(props) {
|
|
|
61
61
|
})();
|
|
62
62
|
}
|
|
63
63
|
function BreadcrumbLink(props) {
|
|
64
|
-
const [local, rest] = splitProps(props, ["class", "current"]);
|
|
64
|
+
const [local, link, rest] = splitProps(props, ["class", "current"], ["href"]);
|
|
65
65
|
return createComponent(Show, {
|
|
66
66
|
get when() {
|
|
67
67
|
return !local.current;
|
|
@@ -73,9 +73,14 @@ function BreadcrumbLink(props) {
|
|
|
73
73
|
},
|
|
74
74
|
get children() {
|
|
75
75
|
var _el$4 = _tmpl$4();
|
|
76
|
-
spread(_el$4, mergeProps({
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
spread(_el$4, mergeProps({
|
|
77
|
+
get ["class"]() {
|
|
78
|
+
return cn("rounded-sm transition-colors ease-out outline-none hover:text-foreground", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle", local.class);
|
|
79
|
+
},
|
|
80
|
+
get href() {
|
|
81
|
+
return link.href;
|
|
82
|
+
}
|
|
83
|
+
}, rest), false, false);
|
|
79
84
|
return _el$4;
|
|
80
85
|
}
|
|
81
86
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.js","names":["ChevronRight","LucideChevronRight","MoreHorizontal","LucideMoreHorizontal","Show","splitProps","cn","fastIcon","Breadcrumb","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","BreadcrumbList","_el$2","_tmpl$2","BreadcrumbItem","_el$3","_tmpl$3","current","BreadcrumbLink","_$createComponent","when","fallback","BreadcrumbPage","children","_el$4","_tmpl$4","_el$5","_tmpl$5","BreadcrumbSeparator","_el$6","_tmpl$6","_$insert","BreadcrumbEllipsis","_el$7","_tmpl$7","_el$8","firstChild"],"sources":["../../../../src/components/ui/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import {\n ChevronRight as LucideChevronRight,\n MoreHorizontal as LucideMoreHorizontal,\n} from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronRight = fastIcon(LucideChevronRight)\nconst MoreHorizontal = fastIcon(LucideMoreHorizontal)\n\n/**\n * Breadcrumb.\n *\n * The path to the current view, in a real `<nav>` wrapping an ordered list so\n * the structure is announced rather than read as loose text. The final crumb is\n * the current page and is marked `aria-current=\"page\"` instead of being a link\n * to itself.\n *\n * A long path collapses from the middle: the root says where the user started\n * and the last crumbs say what they are looking at, so those are the parts that\n * have to survive.\n */\nexport function Breadcrumb(props: ComponentProps<'nav'>) {\n const [local, rest] = splitProps(props, ['class', 'aria-label'])\n\n return (\n <nav\n data-slot=\"breadcrumb\"\n aria-label={local['aria-label'] ?? 'Breadcrumb'}\n class={cn('text-muted-foreground', local.class)}\n {...rest}\n />\n )\n}\n\nexport function BreadcrumbList(props: ComponentProps<'ol'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <ol\n data-slot=\"breadcrumb-list\"\n class={cn('flex flex-wrap items-center gap-1.5 text-sm break-words', local.class)}\n {...rest}\n />\n )\n}\n\nexport function BreadcrumbItem(props: ComponentProps<'li'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <li\n data-slot=\"breadcrumb-item\"\n class={cn('inline-flex items-center gap-1.5', local.class)}\n {...rest}\n />\n )\n}\n\nexport type BreadcrumbLinkProps = ComponentProps<'a'> & {\n /** Render as the current page rather than as a link. */\n current?: boolean\n}\n\nexport function BreadcrumbLink(props: BreadcrumbLinkProps) {\n const [local, rest] = splitProps(props, ['class', 'current'])\n\n return (\n <Show\n when={!local.current}\n fallback={<BreadcrumbPage class={local.class} {...(rest as ComponentProps<'span'>)} />}\n >\n <a\n data-slot=\"breadcrumb-link\"\n class={cn(\n 'rounded-sm transition-colors ease-out outline-none hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n {...rest}\n />\n </Show>\n )\n}\n\n/**\n * The current page: the last crumb, as text rather than a link to itself, and\n * marked `aria-current=\"page\"`. The same element `BreadcrumbLink current`\n * renders, for a trail whose last crumb is never a link.\n */\nexport function BreadcrumbPage(props: ComponentProps<'span'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <span\n data-slot=\"breadcrumb-page\"\n aria-current=\"page\"\n class={cn('font-medium text-foreground', local.class)}\n {...rest}\n />\n )\n}\n\nexport function BreadcrumbSeparator(props: ComponentProps<'li'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <li\n data-slot=\"breadcrumb-separator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n class={cn('[&_svg]:size-3.5', local.class)}\n {...rest}\n >\n {local.children ?? <ChevronRight />}\n </li>\n )\n}\n\nexport function BreadcrumbEllipsis(props: ComponentProps<'span'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <span\n data-slot=\"breadcrumb-ellipsis\"\n role=\"presentation\"\n aria-hidden=\"true\"\n class={cn('flex size-6 items-center justify-center', local.class)}\n {...rest}\n >\n <MoreHorizontal class=\"size-4\" />\n <span class=\"visually-hidden\">More</span>\n </span>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAUA,IAAMA,iBAAeO,SAASN,YAAkB;AAChD,IAAMC,mBAAiBK,SAASJ,cAAoB;;;;;;;;;;;;;AAcpD,SAAgBK,WAAWC,OAA8B;CACvD,MAAM,CAACC,OAAOC,QAAQN,WAAWI,OAAO,CAAC,SAAS,YAAY,CAAC;CAE/D,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA;GAAA,KAAA,gBAAA;IAAA,OAGgBL,MAAM,iBAAiB;GAAY;GAAA,KAAA,WAAA;IAAA,OACxCJ,GAAG,yBAAyBI,MAAMM,KAAK;GAAC;EAAA,GAC3CL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAC;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBK,eAAeR,OAA6B;CAC1D,MAAM,CAACC,OAAOC,QAAQN,WAAWI,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAS,QAAAC,QAAA;EAAAL,OAAAI,OAAAH,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWT,GAAG,2DAA2DI,MAAMM,KAAK;EAAC,EAAA,GAC7EL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAO;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBE,eAAeX,OAA6B;CAC1D,MAAM,CAACC,OAAOC,QAAQN,WAAWI,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAY,QAAAC,QAAA;EAAAR,OAAAO,OAAAN,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWT,GAAG,oCAAoCI,MAAMM,KAAK;EAAC,EAAA,GACtDL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAU;CAAA,EAAA,CAAA;AAGd;AAOA,SAAgBG,eAAef,OAA4B;CACzD,MAAM,CAACC,
|
|
1
|
+
{"version":3,"file":"breadcrumb.js","names":["ChevronRight","LucideChevronRight","MoreHorizontal","LucideMoreHorizontal","Show","splitProps","cn","fastIcon","Breadcrumb","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","BreadcrumbList","_el$2","_tmpl$2","BreadcrumbItem","_el$3","_tmpl$3","current","BreadcrumbLink","link","_$createComponent","when","fallback","BreadcrumbPage","children","_el$4","_tmpl$4","href","_el$5","_tmpl$5","BreadcrumbSeparator","_el$6","_tmpl$6","_$insert","BreadcrumbEllipsis","_el$7","_tmpl$7","_el$8","firstChild"],"sources":["../../../../src/components/ui/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import {\n ChevronRight as LucideChevronRight,\n MoreHorizontal as LucideMoreHorizontal,\n} from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronRight = fastIcon(LucideChevronRight)\nconst MoreHorizontal = fastIcon(LucideMoreHorizontal)\n\n/**\n * Breadcrumb.\n *\n * The path to the current view, in a real `<nav>` wrapping an ordered list so\n * the structure is announced rather than read as loose text. The final crumb is\n * the current page and is marked `aria-current=\"page\"` instead of being a link\n * to itself.\n *\n * A long path collapses from the middle: the root says where the user started\n * and the last crumbs say what they are looking at, so those are the parts that\n * have to survive.\n */\nexport function Breadcrumb(props: ComponentProps<'nav'>) {\n const [local, rest] = splitProps(props, ['class', 'aria-label'])\n\n return (\n <nav\n data-slot=\"breadcrumb\"\n aria-label={local['aria-label'] ?? 'Breadcrumb'}\n class={cn('text-muted-foreground', local.class)}\n {...rest}\n />\n )\n}\n\nexport function BreadcrumbList(props: ComponentProps<'ol'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <ol\n data-slot=\"breadcrumb-list\"\n class={cn('flex flex-wrap items-center gap-1.5 text-sm break-words', local.class)}\n {...rest}\n />\n )\n}\n\nexport function BreadcrumbItem(props: ComponentProps<'li'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <li\n data-slot=\"breadcrumb-item\"\n class={cn('inline-flex items-center gap-1.5', local.class)}\n {...rest}\n />\n )\n}\n\nexport type BreadcrumbLinkProps = ComponentProps<'a'> & {\n /** Render as the current page rather than as a link. */\n current?: boolean\n}\n\nexport function BreadcrumbLink(props: BreadcrumbLinkProps) {\n const [local, link, rest] = splitProps(props, ['class', 'current'], ['href'])\n\n return (\n <Show\n when={!local.current}\n // The current page is text, so the link's href stays off it.\n fallback={<BreadcrumbPage class={local.class} {...(rest as ComponentProps<'span'>)} />}\n >\n <a\n data-slot=\"breadcrumb-link\"\n class={cn(\n 'rounded-sm transition-colors ease-out outline-none hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n href={link.href}\n {...rest}\n />\n </Show>\n )\n}\n\n/**\n * The current page: the last crumb, as text rather than a link to itself, and\n * marked `aria-current=\"page\"`. The same element `BreadcrumbLink current`\n * renders, for a trail whose last crumb is never a link.\n */\nexport function BreadcrumbPage(props: ComponentProps<'span'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <span\n data-slot=\"breadcrumb-page\"\n aria-current=\"page\"\n class={cn('font-medium text-foreground', local.class)}\n {...rest}\n />\n )\n}\n\nexport function BreadcrumbSeparator(props: ComponentProps<'li'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <li\n data-slot=\"breadcrumb-separator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n class={cn('[&_svg]:size-3.5', local.class)}\n {...rest}\n >\n {local.children ?? <ChevronRight />}\n </li>\n )\n}\n\nexport function BreadcrumbEllipsis(props: ComponentProps<'span'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <span\n data-slot=\"breadcrumb-ellipsis\"\n role=\"presentation\"\n aria-hidden=\"true\"\n class={cn('flex size-6 items-center justify-center', local.class)}\n {...rest}\n >\n <MoreHorizontal class=\"size-4\" />\n <span class=\"visually-hidden\">More</span>\n </span>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAUA,IAAMA,iBAAeO,SAASN,YAAkB;AAChD,IAAMC,mBAAiBK,SAASJ,cAAoB;;;;;;;;;;;;;AAcpD,SAAgBK,WAAWC,OAA8B;CACvD,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T,GAAG,2CAA2CI,MAAMM,KAAK;EAAC,EAAA,GAC7DL,IAAI,GAAA,OAAA,IAAA;EAAA4B,OAAAE,OAAAf,gBAEPxB,kBAAc,EAAA,SAAA,SAAA,CAAA,GAAAyC,KAAA;EAAA,OAAAF;CAAA,EAAA,CAAA;AAIrB"}
|
|
@@ -132,6 +132,6 @@ export function triggerLabel(input: {
|
|
|
132
132
|
case 'failed':
|
|
133
133
|
return `Version ${state.currentVersion || fallback} · Retry`
|
|
134
134
|
default:
|
|
135
|
-
return `${appName} v${state.currentVersion
|
|
135
|
+
return `${appName} ${state.currentVersion ? `v${state.currentVersion}` : fallback}`
|
|
136
136
|
}
|
|
137
137
|
}
|
|
@@ -64,11 +64,12 @@ export type BreadcrumbLinkProps = ComponentProps<'a'> & {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
export function BreadcrumbLink(props: BreadcrumbLinkProps) {
|
|
67
|
-
const [local, rest] = splitProps(props, ['class', 'current'])
|
|
67
|
+
const [local, link, rest] = splitProps(props, ['class', 'current'], ['href'])
|
|
68
68
|
|
|
69
69
|
return (
|
|
70
70
|
<Show
|
|
71
71
|
when={!local.current}
|
|
72
|
+
// The current page is text, so the link's href stays off it.
|
|
72
73
|
fallback={<BreadcrumbPage class={local.class} {...(rest as ComponentProps<'span'>)} />}
|
|
73
74
|
>
|
|
74
75
|
<a
|
|
@@ -78,6 +79,7 @@ export function BreadcrumbLink(props: BreadcrumbLinkProps) {
|
|
|
78
79
|
'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',
|
|
79
80
|
local.class
|
|
80
81
|
)}
|
|
82
|
+
href={link.href}
|
|
81
83
|
{...rest}
|
|
82
84
|
/>
|
|
83
85
|
</Show>
|
package/package.json
CHANGED
|
@@ -132,6 +132,6 @@ export function triggerLabel(input: {
|
|
|
132
132
|
case 'failed':
|
|
133
133
|
return `Version ${state.currentVersion || fallback} · Retry`
|
|
134
134
|
default:
|
|
135
|
-
return `${appName} v${state.currentVersion
|
|
135
|
+
return `${appName} ${state.currentVersion ? `v${state.currentVersion}` : fallback}`
|
|
136
136
|
}
|
|
137
137
|
}
|
|
@@ -64,11 +64,12 @@ export type BreadcrumbLinkProps = ComponentProps<'a'> & {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
export function BreadcrumbLink(props: BreadcrumbLinkProps) {
|
|
67
|
-
const [local, rest] = splitProps(props, ['class', 'current'])
|
|
67
|
+
const [local, link, rest] = splitProps(props, ['class', 'current'], ['href'])
|
|
68
68
|
|
|
69
69
|
return (
|
|
70
70
|
<Show
|
|
71
71
|
when={!local.current}
|
|
72
|
+
// The current page is text, so the link's href stays off it.
|
|
72
73
|
fallback={<BreadcrumbPage class={local.class} {...(rest as ComponentProps<'span'>)} />}
|
|
73
74
|
>
|
|
74
75
|
<a
|
|
@@ -78,6 +79,7 @@ export function BreadcrumbLink(props: BreadcrumbLinkProps) {
|
|
|
78
79
|
'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',
|
|
79
80
|
local.class
|
|
80
81
|
)}
|
|
82
|
+
href={link.href}
|
|
81
83
|
{...rest}
|
|
82
84
|
/>
|
|
83
85
|
</Show>
|