@f-ewald/components 1.24.0 → 1.26.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/README.md CHANGED
@@ -163,6 +163,17 @@ custom properties itself; an earlier version re-declared them there as
163
163
  value instead of the inherited one, silently discarding whatever `:root`
164
164
  set. Don't reintroduce that pattern.)
165
165
 
166
+ ### Gradient theme
167
+
168
+ Setting `data-theme="gradient"` on `<html>` layers a glossy gradient look
169
+ onto `ui-button` (primary, danger, and secondary variants) and
170
+ `toast-notification` (all four variants: success, error, info, warning) on
171
+ top of the flat light palette — see `gradientTokenValues` in
172
+ [`src/tokens.ts`](./src/tokens.ts). Every other token stays at its light-mode
173
+ value. It takes precedence over the
174
+ OS dark preference (like `data-theme="light"` does), since the gradient's
175
+ color stops are hardcoded for a light surface.
176
+
166
177
  The full token set is defined in [`src/tokens.ts`](./src/tokens.ts).
167
178
  Typography, spacing, control, icon, radius, panel, chart, and accessibility
168
179
  measurements follow the canonical
@@ -3570,7 +3570,7 @@
3570
3570
  "declarations": [
3571
3571
  {
3572
3572
  "kind": "class",
3573
- "description": "GitHub/Slack-style comment composer: a one-line text field that expands\ninto a multi-line textarea with a bottom-right Cancel/Submit footer\n(`form-actions`) as soon as it's focused or clicked. Submitting fires\n`submit` with the trimmed value, then clears the field and collapses back\nto one line — it's meant for posting one comment at a time, not editing a\npersistent value in place (see `editable-text` for that). Canceling (the\nCancel button or `Escape`) discards the draft and collapses without\nfiring `submit`. Clicking away (blur) does neither — the composer stays\nexpanded until the user explicitly submits or cancels. `Cmd`/`Ctrl`+`Enter`\nsubmits from the textarea, matching `editable-text`'s multiline shortcut.\nPurely token-styled (no bespoke colors), so it's themeable via the same\n`--ui-*` custom properties as every other value-entry field.",
3573
+ "description": "GitHub/Slack-style comment composer: a one-line text field that expands\ninto a multi-line textarea with a bottom-right Cancel/Submit footer\n(`form-actions`) as soon as it's focused or clicked. Submitting fires\n`submit` with the trimmed value, then clears the field and collapses back\nto one line — it's meant for posting one comment at a time, not editing a\npersistent value in place (see `editable-text` for that). Canceling (the\nCancel button or `Escape`) discards the draft and collapses without\nfiring `submit`. Clicking away (blur) does neither — the composer stays\nexpanded until the user explicitly submits or cancels. `Cmd`/`Ctrl`+`Enter`\nsubmits from the textarea, matching `editable-text`'s multiline shortcut —\nthe Submit button always shows a `kbd-hint` for it, so the shortcut is\ndiscoverable rather than a hidden power-user feature. Calling the standard\n`.focus()` method expands the composer (if collapsed) and focuses its\nfield, for an ancestor that wants to drive it programmatically.\nPurely token-styled (no bespoke colors), so it's themeable via the same\n`--ui-*` custom properties as every other value-entry field.",
3574
3574
  "name": "CommentComposer",
3575
3575
  "members": [
3576
3576
  {
@@ -3679,6 +3679,25 @@
3679
3679
  }
3680
3680
  }
3681
3681
  },
3682
+ {
3683
+ "kind": "method",
3684
+ "name": "focus",
3685
+ "return": {
3686
+ "type": {
3687
+ "text": "void"
3688
+ }
3689
+ },
3690
+ "parameters": [
3691
+ {
3692
+ "name": "options",
3693
+ "optional": true,
3694
+ "type": {
3695
+ "text": "FocusOptions"
3696
+ }
3697
+ }
3698
+ ],
3699
+ "description": "Expands the composer (if collapsed) and focuses its field, so an\nancestor can drive it programmatically — e.g. a \"reply\" affordance\nelsewhere on the page that should land the user in this composer\nalready expanded, not just visually scrolled to a one-line input.\nA no-op while `disabled`. Expanding re-renders asynchronously; the\nactual focus happens in `updated()` once the textarea exists."
3700
+ },
3682
3701
  {
3683
3702
  "kind": "method",
3684
3703
  "name": "_onInput",
@@ -6911,6 +6930,17 @@
6911
6930
  ],
6912
6931
  "description": "A light-theme toggle, or to represent daytime/light mode."
6913
6932
  },
6933
+ {
6934
+ "kind": "function",
6935
+ "name": "iconSparkles",
6936
+ "parameters": [
6937
+ {
6938
+ "name": "size",
6939
+ "default": "16"
6940
+ }
6941
+ ],
6942
+ "description": "A gradient-theme toggle, or to represent a decorative/enhanced visual style."
6943
+ },
6914
6944
  {
6915
6945
  "kind": "function",
6916
6946
  "name": "iconShieldExclamation",
@@ -7493,6 +7523,14 @@
7493
7523
  "module": "src/icons.ts"
7494
7524
  }
7495
7525
  },
7526
+ {
7527
+ "kind": "js",
7528
+ "name": "iconSparkles",
7529
+ "declaration": {
7530
+ "name": "iconSparkles",
7531
+ "module": "src/icons.ts"
7532
+ }
7533
+ },
7496
7534
  {
7497
7535
  "kind": "js",
7498
7536
  "name": "iconShieldExclamation",
@@ -16000,7 +16038,7 @@
16000
16038
  "declarations": [
16001
16039
  {
16002
16040
  "kind": "class",
16003
- "description": "Fixed-position stack of dismissible notifications, anchored top-right\n(top-full-width on mobile). Every toast shares one fixed width so entries\nnever appear narrower or wider than one another. Not wired to any app state\nyet — callers add toasts imperatively via the `show()` method on a live\nelement reference,\ne.g. `document.querySelector('toast-notification')?.show('Offline', { variant: 'error' })`,\nor via the `notifySuccess`/`notifyError`/`notifyInfo` module-level helpers\nexported from this file. The first argument is the required bold headline; an\noptional `description` renders a smaller, non-bold second line. Each variant\nleads with a matching status icon (success → check, error → exclamation\ncircle, info → information circle, warning → exclamation triangle). Each toast\nauto-dismisses after `duration` ms and can also be dismissed via its ✕\nbutton. Appears/disappears instantly — no slide/fade transitions.",
16041
+ "description": "Fixed-position stack of dismissible notifications, anchored top-right\n(top-full-width on mobile). Every toast shares one fixed width so entries\nnever appear narrower or wider than one another. Not wired to any app state\nyet — callers add toasts imperatively via the `show()` method on a live\nelement reference,\ne.g. `document.querySelector('toast-notification')?.show('Offline', { variant: 'error' })`,\nor via the `notifySuccess`/`notifyError`/`notifyInfo` module-level helpers\nexported from this file. The first argument is the required bold headline; an\noptional `description` renders a smaller, non-bold second line. Each variant\nleads with a matching status icon (success → check, error → exclamation\ncircle, info → information circle, warning → exclamation triangle). Each toast\nauto-dismisses after `duration` ms and can also be dismissed via its ✕\nbutton. Appears/disappears instantly — no slide/fade transitions.\n\nEach variant's background reads a dedicated `--ui-toast-*-background` hook\n(`success`/`error`/`info`/`warning`), which defaults to the flat\n`--ui-success`/`--ui-danger`/`--ui-info`/`--ui-warning` tokens unchanged —\nso those stay the single source of truth for every other component. A\nconsumer can override just these toast-specific tokens with a\n`linear-gradient(...)` to opt every toast into a gradient look without\ntouching component markup — `gradientTokenValues` in `tokens.ts` ships\nexactly this, wired up via `data-theme=\"gradient\"` (see `tokens.css`'s\n\"Gradient theme\" section), the same mechanism `ui-button` uses.\n`--ui-toast-highlight` (a glossy top-edge box-shadow, layered onto the\nexisting elevation shadow) and `--ui-toast-text-shadow` (legibility\nagainst the gradient's lighter stop) round out the effect, mirroring\n`ui-button`'s `--ui-button-highlight`/`--ui-button-text-shadow`.",
16004
16042
  "name": "ToastNotification",
16005
16043
  "members": [
16006
16044
  {
@@ -16233,7 +16271,7 @@
16233
16271
  "type": {
16234
16272
  "text": "Record<string, string>"
16235
16273
  },
16236
- "default": "{ // Colors \"--ui-primary\": \"#4f46e5\", // indigo-600 \"--ui-primary-hover\": \"#4338ca\", // indigo-700 // Button-specific background/border hooks: default to the flat --ui-primary // / --ui-danger tokens above unchanged, so those stay the single source of // truth for every other component. Overriding just these lets a theme opt // ui-button into a gradient (or any other) background without touching // component markup; --ui-button-border/--ui-button-danger-border default // to transparent (today's look) and are meant to be paired with a shade // darker than the gradient's dark stop when one is set. The `-active` // variants default to whatever `-background` already resolved to (so a // solid override still applies while pressed) — a gradient theme should // set them to the same stops in reverse, for a pressed/\"indented\" look. \"--ui-button-background\": \"var(--ui-primary, #4f46e5)\", \"--ui-button-background-hover\": \"var(--ui-primary-hover, #4338ca)\", \"--ui-button-background-active\": \"var(--ui-button-background, var(--ui-primary, #4f46e5))\", \"--ui-button-border\": \"transparent\", // The bordered, transparent-background secondary variant's equivalents — // shared with confirm-dialog's Cancel button, which is the same visual // pattern. Defaults reproduce today's literal secondary styling exactly // (no background at any state, border colors matching --ui-border / // --ui-text-muted), so a theme only needs to override these to make // secondary/Cancel buttons match a primary/danger gradient theme. \"--ui-button-secondary-background\": \"none\", \"--ui-button-secondary-background-hover\": \"none\", \"--ui-button-secondary-background-active\": \"var(--ui-button-secondary-background, none)\", \"--ui-button-secondary-border\": \"var(--ui-border, #e2e8f0)\", \"--ui-button-secondary-border-hover\": \"var(--ui-text-muted, #64748b)\", // A muted-gray surface used wherever something already paints // --ui-surface-muted as a state indicator in flat mode — button-group's // unchecked-segment hover, pagination-nav's button hover, and // radio-cards/radio-pills' checked background — which is a genuinely // different default than secondary's borderless flat hover, so it can't // reuse --ui-button-secondary-background-hover's \"none\" default. \"--ui-button-secondary-surface-muted\": \"var(--ui-surface-muted, #f8fafc)\", // Shared by both primary/danger — a purely cosmetic gloss/legibility pair, // not color-specific, so one token covers both variants. `-highlight` is a // full box-shadow value (e.g. `inset 0 1px 0 rgb(255 255 255 / 0.35)`) for // a glossy top edge, defaulting to a fully transparent (so invisible) // shadow rather than the keyword `none` — some usages combine it with // another literal shadow in a comma-separated list, where a bare `none` // item is invalid CSS and would zero out the *whole* declaration. // `-text-shadow` is a full text-shadow value for label legibility against // a gradient's lighter stop, always used standalone, so it keeps `none`. \"--ui-button-highlight\": \"0 0 0 0 transparent\", \"--ui-button-text-shadow\": \"none\", // A solid stand-in for the same accent, for spots that can't render a // background gradient at all — a native <input>'s accent-color only // accepts a plain color, and a hard-stop background gradient (e.g. // range-slider's filled track) can't nest another gradient inside its own // color-stop list. Consumers that theme the buttons into a gradient should // set this to the gradient's dark stop, so these non-button accents (radio // selection indicators, the range-slider track/thumb) stay visually // coordinated with it even though they can't literally paint a gradient. \"--ui-button-accent\": \"var(--ui-primary, #4f46e5)\", \"--ui-info\": \"#0ea5e9\", // sky-500 \"--ui-info-hover\": \"#0284c7\", // sky-600 \"--ui-danger\": \"#dc2626\", // red-600 \"--ui-danger-hover\": \"#b91c1c\", // red-700 \"--ui-button-danger-background\": \"var(--ui-danger, #dc2626)\", \"--ui-button-danger-background-hover\": \"var(--ui-danger-hover, #b91c1c)\", \"--ui-button-danger-background-active\": \"var(--ui-button-danger-background, var(--ui-danger, #dc2626))\", \"--ui-button-danger-border\": \"transparent\", \"--ui-success\": \"#16a34a\", // green-600 \"--ui-warning\": \"#d97706\", // amber-600 \"--ui-warning-hover\": \"#b45309\", // amber-700 \"--ui-on-accent\": \"#ffffff\", \"--ui-text\": \"#0f172a\", // slate-900 \"--ui-text-muted\": \"#64748b\", // slate-500 \"--ui-border\": \"#e2e8f0\", // slate-200 \"--ui-surface\": \"#ffffff\", // white \"--ui-surface-muted\": \"#f8fafc\", // slate-50 \"--ui-highlight\": \"#fde68a\", // amber-200 — transient \"just changed\" flash \"--ui-tooltip\": \"#0f172a\", // slate-900 \"--ui-hover-overlay\": \"rgb(255 255 255 / 0.32)\", \"--ui-overlay\": \"rgb(15 23 42 / 0.45)\", // slate-900 / 45% // Shape / depth \"--ui-radius\": \"0.5rem\", // rounded-lg \"--ui-radius-sm\": \"0.25rem\", // rounded \"--ui-shadow\": \"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)\", // shadow-md \"--ui-shadow-lg\": \"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)\", // shadow-xl \"--ui-focus-ring\": \"0 0 0 3px rgb(79 70 229 / 0.35)\", // Type \"--ui-font\": 'ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"', \"--ui-font-mono\": \"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace\", \"--ui-font-size-lg\": \"1rem\", // text-base \"--ui-font-size\": \"0.875rem\", // text-sm \"--ui-font-size-sm\": \"0.75rem\", // text-xs \"--ui-font-size-xs\": \"0.6875rem\", // Font weights — the only four weights the system uses. \"--ui-font-weight-regular\": \"400\", \"--ui-font-weight-medium\": \"500\", \"--ui-font-weight-semibold\": \"600\", \"--ui-font-weight-bold\": \"700\", // Line heights — glyph (icon/marker box), tight (headings), normal (body). \"--ui-line-height-glyph\": \"1\", \"--ui-line-height-tight\": \"1.25\", \"--ui-line-height-normal\": \"1.5\", // Letter spacing / tracking — default and the single widened step. \"--ui-tracking-normal\": \"0\", \"--ui-tracking-wide\": \"0.04em\", }",
16274
+ "default": "{ // Colors \"--ui-primary\": \"#4f46e5\", // indigo-600 \"--ui-primary-hover\": \"#4338ca\", // indigo-700 // Button-specific background/border hooks: default to the flat --ui-primary // / --ui-danger tokens above unchanged, so those stay the single source of // truth for every other component. Overriding just these lets a theme opt // ui-button into a gradient (or any other) background without touching // component markup; --ui-button-border/--ui-button-danger-border default // to transparent (today's look) and are meant to be paired with a shade // darker than the gradient's dark stop when one is set. The `-active` // variants default to whatever `-background` already resolved to (so a // solid override still applies while pressed) — a gradient theme should // set them to the same stops in reverse, for a pressed/\"indented\" look. \"--ui-button-background\": \"var(--ui-primary, #4f46e5)\", \"--ui-button-background-hover\": \"var(--ui-primary-hover, #4338ca)\", \"--ui-button-background-active\": \"var(--ui-button-background, var(--ui-primary, #4f46e5))\", \"--ui-button-border\": \"transparent\", // The bordered, transparent-background secondary variant's equivalents — // shared with confirm-dialog's Cancel button, which is the same visual // pattern. Defaults reproduce today's literal secondary styling exactly // (no background at any state, border colors matching --ui-border / // --ui-text-muted), so a theme only needs to override these to make // secondary/Cancel buttons match a primary/danger gradient theme. \"--ui-button-secondary-background\": \"none\", \"--ui-button-secondary-background-hover\": \"none\", \"--ui-button-secondary-background-active\": \"var(--ui-button-secondary-background, none)\", \"--ui-button-secondary-border\": \"var(--ui-border, #e2e8f0)\", \"--ui-button-secondary-border-hover\": \"var(--ui-text-muted, #64748b)\", // A muted-gray surface used wherever something already paints // --ui-surface-muted as a state indicator in flat mode — button-group's // unchecked-segment hover, pagination-nav's button hover, and // radio-cards/radio-pills' checked background — which is a genuinely // different default than secondary's borderless flat hover, so it can't // reuse --ui-button-secondary-background-hover's \"none\" default. \"--ui-button-secondary-surface-muted\": \"var(--ui-surface-muted, #f8fafc)\", // Shared by both primary/danger — a purely cosmetic gloss/legibility pair, // not color-specific, so one token covers both variants. `-highlight` is a // full box-shadow value (e.g. `inset 0 1px 0 rgb(255 255 255 / 0.35)`) for // a glossy top edge, defaulting to a fully transparent (so invisible) // shadow rather than the keyword `none` — some usages combine it with // another literal shadow in a comma-separated list, where a bare `none` // item is invalid CSS and would zero out the *whole* declaration. // `-text-shadow` is a full text-shadow value for label legibility against // a gradient's lighter stop, always used standalone, so it keeps `none`. \"--ui-button-highlight\": \"0 0 0 0 transparent\", \"--ui-button-text-shadow\": \"none\", // A solid stand-in for the same accent, for spots that can't render a // background gradient at all — a native <input>'s accent-color only // accepts a plain color, and a hard-stop background gradient (e.g. // range-slider's filled track) can't nest another gradient inside its own // color-stop list. Consumers that theme the buttons into a gradient should // set this to the gradient's dark stop, so these non-button accents (radio // selection indicators, the range-slider track/thumb) stay visually // coordinated with it even though they can't literally paint a gradient. \"--ui-button-accent\": \"var(--ui-primary, #4f46e5)\", \"--ui-info\": \"#0ea5e9\", // sky-500 \"--ui-info-hover\": \"#0284c7\", // sky-600 \"--ui-danger\": \"#dc2626\", // red-600 \"--ui-danger-hover\": \"#b91c1c\", // red-700 \"--ui-button-danger-background\": \"var(--ui-danger, #dc2626)\", \"--ui-button-danger-background-hover\": \"var(--ui-danger-hover, #b91c1c)\", \"--ui-button-danger-background-active\": \"var(--ui-button-danger-background, var(--ui-danger, #dc2626))\", \"--ui-button-danger-border\": \"transparent\", \"--ui-success\": \"#16a34a\", // green-600 \"--ui-warning\": \"#d97706\", // amber-600 \"--ui-warning-hover\": \"#b45309\", // amber-700 // toast-notification's per-variant background hooks: default to the flat // --ui-success/--ui-danger/--ui-info/--ui-warning tokens unchanged, so // those stay the single source of truth for every other component — // the same pattern as --ui-button-background/--ui-button-danger-background // above. `-highlight`/`-text-shadow` are the same glossy-top-edge / // legibility-shadow pair as --ui-button-highlight/--ui-button-text-shadow, // kept as separate tokens so a theme can gloss toasts and buttons // independently. \"--ui-toast-success-background\": \"var(--ui-success, #16a34a)\", \"--ui-toast-error-background\": \"var(--ui-danger, #dc2626)\", \"--ui-toast-info-background\": \"var(--ui-info, #0ea5e9)\", \"--ui-toast-warning-background\": \"var(--ui-warning, #d97706)\", \"--ui-toast-highlight\": \"0 0 0 0 transparent\", \"--ui-toast-text-shadow\": \"none\", \"--ui-on-accent\": \"#ffffff\", \"--ui-text\": \"#0f172a\", // slate-900 \"--ui-text-muted\": \"#64748b\", // slate-500 \"--ui-border\": \"#e2e8f0\", // slate-200 \"--ui-surface\": \"#ffffff\", // white \"--ui-surface-muted\": \"#f8fafc\", // slate-50 \"--ui-highlight\": \"#fde68a\", // amber-200 — transient \"just changed\" flash \"--ui-tooltip\": \"#0f172a\", // slate-900 \"--ui-hover-overlay\": \"rgb(255 255 255 / 0.32)\", \"--ui-overlay\": \"rgb(15 23 42 / 0.45)\", // slate-900 / 45% // Shape / depth \"--ui-radius\": \"0.5rem\", // rounded-lg \"--ui-radius-sm\": \"0.25rem\", // rounded \"--ui-shadow\": \"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)\", // shadow-md \"--ui-shadow-lg\": \"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)\", // shadow-xl \"--ui-focus-ring\": \"0 0 0 3px rgb(79 70 229 / 0.35)\", // Type \"--ui-font\": 'ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"', \"--ui-font-mono\": \"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace\", \"--ui-font-size-lg\": \"1rem\", // text-base \"--ui-font-size\": \"0.875rem\", // text-sm \"--ui-font-size-sm\": \"0.75rem\", // text-xs \"--ui-font-size-xs\": \"0.6875rem\", // Font weights — the only four weights the system uses. \"--ui-font-weight-regular\": \"400\", \"--ui-font-weight-medium\": \"500\", \"--ui-font-weight-semibold\": \"600\", \"--ui-font-weight-bold\": \"700\", // Line heights — glyph (icon/marker box), tight (headings), normal (body). \"--ui-line-height-glyph\": \"1\", \"--ui-line-height-tight\": \"1.25\", \"--ui-line-height-normal\": \"1.5\", // Letter spacing / tracking — default and the single widened step. \"--ui-tracking-normal\": \"0\", \"--ui-tracking-wide\": \"0.04em\", }",
16237
16275
  "description": "Design token values, sourced from Tailwind v4's default theme palette.\nEach entry maps a `--ui-*` custom property name to its default value.\nThese are the same values baked in as `var(--ui-*, <fallback>)` fallbacks\nthroughout component styles, so components render correctly with zero\nexternal CSS. Consumers may override any of these by setting the custom\nproperty on `:root` or an ancestor element (see `tokens.css`)."
16238
16276
  },
16239
16277
  {
@@ -16245,6 +16283,15 @@
16245
16283
  "default": "{ \"--ui-primary\": \"#6366f1\", // indigo-500 \"--ui-primary-hover\": \"#818cf8\", // indigo-400 \"--ui-info\": \"#38bdf8\", // sky-400 \"--ui-info-hover\": \"#7dd3fc\", // sky-300 \"--ui-danger\": \"#ef4444\", // red-500 \"--ui-danger-hover\": \"#f87171\", // red-400 \"--ui-success\": \"#22c55e\", // green-500 \"--ui-warning\": \"#f59e0b\", // amber-500 \"--ui-warning-hover\": \"#fbbf24\", // amber-400 \"--ui-on-accent\": \"#ffffff\", \"--ui-text\": \"#f1f5f9\", // slate-100 \"--ui-text-muted\": \"#94a3b8\", // slate-400 \"--ui-border\": \"#334155\", // slate-700 \"--ui-surface\": \"#0f172a\", // slate-900 \"--ui-surface-muted\": \"#1e293b\", // slate-800 \"--ui-highlight\": \"#854d0e\", // amber-800 — transient \"just changed\" flash on dark \"--ui-tooltip\": \"#020617\", // slate-950 \"--ui-hover-overlay\": \"rgb(255 255 255 / 0.12)\", \"--ui-overlay\": \"rgb(2 6 23 / 0.6)\", // slate-950 / 60% \"--ui-focus-ring\": \"0 0 0 3px rgb(99 102 241 / 0.45)\", }",
16246
16284
  "description": "Dark-mode overrides for the same `--ui-*` custom properties, applied by\n`tokens.css` via `@media (prefers-color-scheme: dark)` and `[data-theme]`\n(see generate-tokens-css.mjs). Same Tailwind slate scale as the light\npalette, inverted, with primary/danger/success lightened one step (500\ninstead of 600) for sufficient contrast against dark surfaces. Shape/type\ntokens are theme-independent and not repeated here."
16247
16285
  },
16286
+ {
16287
+ "kind": "variable",
16288
+ "name": "gradientTokenValues",
16289
+ "type": {
16290
+ "text": "Record<string, string>"
16291
+ },
16292
+ "default": "{ \"--ui-button-background\": \"linear-gradient(180deg, #6366f1 0%, #4f46e5 100%)\", // indigo-500 -> 600 \"--ui-button-background-hover\": \"linear-gradient(180deg, #818cf8 0%, #6366f1 100%)\", // indigo-400 -> 500 \"--ui-button-background-active\": \"linear-gradient(180deg, #4f46e5 0%, #6366f1 100%)\", // reversed 600 -> 500 \"--ui-button-border\": \"#4338ca\", // indigo-700 \"--ui-button-danger-background\": \"linear-gradient(180deg, #ef4444 0%, #dc2626 100%)\", // red-500 -> 600 \"--ui-button-danger-background-hover\": \"linear-gradient(180deg, #f87171 0%, #ef4444 100%)\", // red-400 -> 500 \"--ui-button-danger-background-active\": \"linear-gradient(180deg, #dc2626 0%, #ef4444 100%)\", // reversed 600 -> 500 \"--ui-button-danger-border\": \"#b91c1c\", // red-700 // Secondary stays neutral gray rather than a saturated hue, matching its // flat \"not the primary action\" role, but one shade darker than the // original white -> slate-50 pairing: at a small button size, that pair // read as flat white with no visible gradient at all. slate-50 -> 100 // keeps enough contrast to actually look like a gradient while still // being clearly lighter/quieter than primary/danger. Border stays // slate-300 (a step past the flat slate-200) so its edge still reads // against the fill. \"--ui-button-secondary-background\": \"linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%)\", // slate-50 -> 100 \"--ui-button-secondary-background-hover\": \"linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%)\", // slate-100 -> 200 \"--ui-button-secondary-background-active\": \"linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%)\", // reversed 100 -> 50 \"--ui-button-secondary-border\": \"#cbd5e1\", // slate-300 \"--ui-button-secondary-border-hover\": \"#94a3b8\", // slate-400 \"--ui-button-highlight\": \"inset 0 1px 0 rgb(255 255 255 / 0.35)\", // glossy top edge \"--ui-button-text-shadow\": \"0 1px 1px rgb(0 0 0 / 0.25)\", // legibility on primary/danger \"--ui-button-accent\": \"#4338ca\", // indigo-700, matches --ui-button-border // toast-notification: same light-to-dark, one-shade-step gradient // convention as the button variants above; the bottom stop always matches // the flat --ui-success/--ui-danger/--ui-info/--ui-warning value exactly. \"--ui-toast-success-background\": \"linear-gradient(180deg, #22c55e 0%, #16a34a 100%)\", // green-500 -> 600 \"--ui-toast-error-background\": \"linear-gradient(180deg, #ef4444 0%, #dc2626 100%)\", // red-500 -> 600 \"--ui-toast-info-background\": \"linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%)\", // sky-400 -> 500 \"--ui-toast-warning-background\": \"linear-gradient(180deg, #f59e0b 0%, #d97706 100%)\", // amber-500 -> 600 \"--ui-toast-highlight\": \"inset 0 1px 0 rgb(255 255 255 / 0.35)\", // glossy top edge, same as --ui-button-highlight \"--ui-toast-text-shadow\": \"0 1px 1px rgb(0 0 0 / 0.25)\", // legibility, same as --ui-button-text-shadow }",
16293
+ "description": "\"Gradient\" theme overrides, applied via `data-theme=\"gradient\"` on `<html>`\n(see `generate-tokens-css.mjs`) — forces `color-scheme: light` like the\n`\"light\"` override and layers a glossy gradient look on top of the flat\nlight palette, using exactly the `--ui-button-*`/`--ui-button-danger-*`/\n`--ui-button-secondary-*` hooks `ui-button.ts` already reads (see that\nfile's doc comment), plus the `--ui-toast-*` hooks `toast-notification.ts`\nreads (see its doc comment). Every other token (`--ui-text`, `--ui-surface`,\n…) is left at its light-mode default — this theme only glosses buttons and\ntoasts by design. Each variant's gradient runs light-to-dark top-to-bottom\n(`180deg`) across one Tailwind shade step lighter/darker than the flat\ntoken so it still reads as \"the same color, glossy\" rather than a\ndifferent hue; `-hover` shifts the whole pair one shade lighter, `-active`\nreverses the two stops for a pressed/\"indented\" look, and `-border` is a\nshade darker than the gradient's dark stop for a defining edge."
16294
+ },
16248
16295
  {
16249
16296
  "kind": "variable",
16250
16297
  "name": "tokens",
@@ -16269,6 +16316,14 @@
16269
16316
  "module": "src/tokens.ts"
16270
16317
  }
16271
16318
  },
16319
+ {
16320
+ "kind": "js",
16321
+ "name": "gradientTokenValues",
16322
+ "declaration": {
16323
+ "name": "gradientTokenValues",
16324
+ "module": "src/tokens.ts"
16325
+ }
16326
+ },
16272
16327
  {
16273
16328
  "kind": "js",
16274
16329
  "name": "tokens",
@@ -16548,7 +16603,7 @@
16548
16603
  "declarations": [
16549
16604
  {
16550
16605
  "kind": "class",
16551
- "description": "Button (or link styled as one) with an optional leading icon, in three\nvisual weights. Set `href` to render an `<a>` instead of a `<button>` —\nsame styling either way — for cross-page navigation that should look like\nan action button; a disabled/busy link stays a real `<a>` with\n`aria-disabled` + `pointer-events: none` rather than losing its href.\nPut the icon in the `icon` slot and the label in the default slot.\n\nForm-associated (`type=\"submit\"`/`\"reset\"`): the actual `<button>` lives in\nthis element's shadow root, which native HTML form association does not\ncross into from an ancestor light-DOM `<form>`. `type=\"submit\"`/`\"reset\"`\nis instead wired through `ElementInternals.form` — the same mechanism\n`address-autocomplete` uses to associate with an ancestor form.\n\n`primary`/`danger` backgrounds read `--ui-button-background`/\n`--ui-button-danger-background` (and their `-hover`/`-active`\ncounterparts), which default to the flat `--ui-primary`/`--ui-danger`\ntokens unchanged — so `--ui-primary`/`--ui-danger` stay the single source\nof truth for every other component. A consumer can override just these\nbutton-specific tokens with a `linear-gradient(...)` to opt every\n`ui-button` into a gradient look without touching component markup,\npairing it with `--ui-button-border`/`--ui-button-danger-border` (default\n`transparent`) for a defining edge a shade darker than the gradient's dark\nstop, and setting the `-active` variant's stops in reverse for a\npressed/\"indented\" look while the button is held down. `secondary`'s\nbackground/border read the equivalent `--ui-button-secondary-*` tokens\n(shared with `confirm-dialog`'s Cancel button), defaulting to today's\ntransparent/bordered look, so it can be themed into a matching (e.g.\nwhite-to-gray) gradient too.",
16606
+ "description": "Button (or link styled as one) with an optional leading icon, in three\nvisual weights. Set `href` to render an `<a>` instead of a `<button>` —\nsame styling either way — for cross-page navigation that should look like\nan action button; a disabled/busy link stays a real `<a>` with\n`aria-disabled` + `pointer-events: none` rather than losing its href.\nPut the icon in the `icon` slot and the label in the default slot.\n\nForm-associated (`type=\"submit\"`/`\"reset\"`): the actual `<button>` lives in\nthis element's shadow root, which native HTML form association does not\ncross into from an ancestor light-DOM `<form>`. `type=\"submit\"`/`\"reset\"`\nis instead wired through `ElementInternals.form` — the same mechanism\n`address-autocomplete` uses to associate with an ancestor form.\n\n`primary`/`danger` backgrounds read `--ui-button-background`/\n`--ui-button-danger-background` (and their `-hover`/`-active`\ncounterparts), which default to the flat `--ui-primary`/`--ui-danger`\ntokens unchanged — so `--ui-primary`/`--ui-danger` stay the single source\nof truth for every other component. A consumer can override just these\nbutton-specific tokens with a `linear-gradient(...)` to opt every\n`ui-button` into a gradient look without touching component markup —\n`gradientTokenValues` in `tokens.ts` ships exactly this, wired up via\n`data-theme=\"gradient\"` (see `tokens.css`'s \"Gradient theme\" section) —\npairing it with `--ui-button-border`/`--ui-button-danger-border` (default\n`transparent`) for a defining edge a shade darker than the gradient's dark\nstop, and setting the `-active` variant's stops in reverse for a\npressed/\"indented\" look while the button is held down. `secondary`'s\nbackground/border read the equivalent `--ui-button-secondary-*` tokens\n(shared with `confirm-dialog`'s Cancel button), defaulting to today's\ntransparent/bordered look, so it can be themed into a matching (e.g.\nwhite-to-gray) gradient too.",
16552
16607
  "name": "UiButton",
16553
16608
  "slots": [
16554
16609
  {
@@ -1,5 +1,6 @@
1
1
  import { LitElement } from "lit";
2
2
  import "./form-actions.js";
3
+ import "./kbd-hint.js";
3
4
  import "./ui-button.js";
4
5
  /**
5
6
  * GitHub/Slack-style comment composer: a one-line text field that expands
@@ -11,7 +12,11 @@ import "./ui-button.js";
11
12
  * Cancel button or `Escape`) discards the draft and collapses without
12
13
  * firing `submit`. Clicking away (blur) does neither — the composer stays
13
14
  * expanded until the user explicitly submits or cancels. `Cmd`/`Ctrl`+`Enter`
14
- * submits from the textarea, matching `editable-text`'s multiline shortcut.
15
+ * submits from the textarea, matching `editable-text`'s multiline shortcut —
16
+ * the Submit button always shows a `kbd-hint` for it, so the shortcut is
17
+ * discoverable rather than a hidden power-user feature. Calling the standard
18
+ * `.focus()` method expands the composer (if collapsed) and focuses its
19
+ * field, for an ancestor that wants to drive it programmatically.
15
20
  * Purely token-styled (no bespoke colors), so it's themeable via the same
16
21
  * `--ui-*` custom properties as every other value-entry field.
17
22
  *
@@ -39,6 +44,15 @@ export declare class CommentComposer extends LitElement {
39
44
  private _draft;
40
45
  private _textarea?;
41
46
  private _expand;
47
+ /**
48
+ * Expands the composer (if collapsed) and focuses its field, so an
49
+ * ancestor can drive it programmatically — e.g. a "reply" affordance
50
+ * elsewhere on the page that should land the user in this composer
51
+ * already expanded, not just visually scrolled to a one-line input.
52
+ * A no-op while `disabled`. Expanding re-renders asynchronously; the
53
+ * actual focus happens in `updated()` once the textarea exists.
54
+ */
55
+ focus(options?: FocusOptions): void;
42
56
  private _onInput;
43
57
  private _cancel;
44
58
  private _submit;
@@ -1 +1 @@
1
- {"version":3,"file":"comment-composer.d.ts","sourceRoot":"","sources":["../src/comment-composer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,OAAO,mBAAmB,CAAC;AAC3B,OAAO,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,eAAgB,SAAQ,UAAU;IAC7C,OAAgB,MAAM,4BAkEpB;IAEF,6DAA6D;IACjD,KAAK,SAAM;IACvB,yCAAyC;IAC7B,WAAW,SAAoB;IAC3C,qDAAqD;IACzC,KAAK,SAAa;IAC9B,uCAAuC;IACX,IAAI,SAAK;IACrC,2CAA2C;IACF,WAAW,SAAY;IAChE,6CAA6C;IACJ,WAAW,SAAY;IAChE,mCAAmC;IACN,QAAQ,UAAS;IAErC,OAAO,CAAC,SAAS,CAAS;IAC1B,O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IAUlB,UAAmB,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAQ9D;IAEQ,MAAM,yCAgDd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,eAAe,CAAC;KACrC;CACF"}
@@ -8,6 +8,7 @@ import { LitElement, css, html } from "lit";
8
8
  import { customElement, property, query, state } from "lit/decorators.js";
9
9
  import { tokens } from "./tokens.js";
10
10
  import "./form-actions.js";
11
+ import "./kbd-hint.js";
11
12
  import "./ui-button.js";
12
13
  /**
13
14
  * GitHub/Slack-style comment composer: a one-line text field that expands
@@ -19,7 +20,11 @@ import "./ui-button.js";
19
20
  * Cancel button or `Escape`) discards the draft and collapses without
20
21
  * firing `submit`. Clicking away (blur) does neither — the composer stays
21
22
  * expanded until the user explicitly submits or cancels. `Cmd`/`Ctrl`+`Enter`
22
- * submits from the textarea, matching `editable-text`'s multiline shortcut.
23
+ * submits from the textarea, matching `editable-text`'s multiline shortcut —
24
+ * the Submit button always shows a `kbd-hint` for it, so the shortcut is
25
+ * discoverable rather than a hidden power-user feature. Calling the standard
26
+ * `.focus()` method expands the composer (if collapsed) and focuses its
27
+ * field, for an ancestor that wants to drive it programmatically.
23
28
  * Purely token-styled (no bespoke colors), so it's themeable via the same
24
29
  * `--ui-*` custom properties as every other value-entry field.
25
30
  *
@@ -120,6 +125,23 @@ let CommentComposer = class CommentComposer extends LitElement {
120
125
  this._draft = this.value;
121
126
  this._expanded = true;
122
127
  }
128
+ /**
129
+ * Expands the composer (if collapsed) and focuses its field, so an
130
+ * ancestor can drive it programmatically — e.g. a "reply" affordance
131
+ * elsewhere on the page that should land the user in this composer
132
+ * already expanded, not just visually scrolled to a one-line input.
133
+ * A no-op while `disabled`. Expanding re-renders asynchronously; the
134
+ * actual focus happens in `updated()` once the textarea exists.
135
+ */
136
+ focus(options) {
137
+ if (this.disabled)
138
+ return;
139
+ if (!this._expanded) {
140
+ this._expand();
141
+ return;
142
+ }
143
+ this._textarea?.focus(options);
144
+ }
123
145
  _onInput(e) {
124
146
  this._draft = e.target.value;
125
147
  }
@@ -187,8 +209,8 @@ let CommentComposer = class CommentComposer extends LitElement {
187
209
  size="sm"
188
210
  ?disabled=${!canSubmit}
189
211
  @click=${this._submit}
190
- >${this.submitLabel}</ui-button
191
- >
212
+ >${this.submitLabel} <kbd-hint keys="Mod+Enter"></kbd-hint
213
+ ></ui-button>
192
214
  </form-actions>
193
215
  </div>
194
216
  `
@@ -1 +1 @@
1
- {"version":3,"file":"comment-composer.js","sourceRoot":"","sources":["../src/comment-composer.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,mBAAmB,CAAC;AAC3B,OAAO,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;;GAiBG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QAqEL,6DAA6D;QACjD,UAAK,GAAG,EAAE,CAAC;QACvB,yCAAyC;QAC7B,gBAAW,GAAG,gBAAgB,CAAC;QAC3C,qDAAqD;QACzC,UAAK,GAAG,SAAS,CAAC;QAC9B,uCAAuC;QACX,SAAI,GAAG,CAAC,CAAC;QACrC,2CAA2C;QACF,gBAAW,GAAG,QAAQ,CAAC;QAChE,6CAA6C;QACJ,gBAAW,GAAG,QAAQ,CAAC;QAChE,mCAAmC;QACN,aAAQ,GAAG,KAAK,CAAC;QAE7B,cAAS,GAAG,KAAK,CAAC;QAClB,WAAM,GAAG,EAAE,CAAC;IAoG/B,CAAC;aAxLiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;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8BACL,IAAI,CAAC,WAAW;6BACjB,IAAI,CAAC,KAAK;4BACX,IAAI,CAAC,QAAQ;yBAChB,IAAI,CAAC,OAAO;yBACZ,IAAI,CAAC,OAAO;;aAExB;;KAER,CAAC;IACJ,CAAC;CACF,CAAA;AAnHa;IAAX,QAAQ,EAAE;8CAAY;AAEX;IAAX,QAAQ,EAAE;oDAAgC;AAE/B;IAAX,QAAQ,EAAE;8CAAmB;AAEF;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAU;AAEI;IAAxC,QAAQ,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;oDAAwB;AAEvB;IAAxC,QAAQ,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;oDAAwB;AAEnC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDAAkB;AAE7B;IAAhB,KAAK,EAAE;kDAA2B;AAClB;IAAhB,KAAK,EAAE;+CAAqB;AAEF;IAA1B,KAAK,CAAC,UAAU,CAAC;kDAAyC;AAvFhD,eAAe;IAD3B,aAAa,CAAC,kBAAkB,CAAC;GACrB,eAAe,CAyL3B","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\nimport \"./form-actions.js\";\nimport \"./ui-button.js\";\n\n/**\n * GitHub/Slack-style comment composer: a one-line text field that expands\n * into a multi-line textarea with a bottom-right Cancel/Submit footer\n * (`form-actions`) as soon as it's focused or clicked. Submitting fires\n * `submit` with the trimmed value, then clears the field and collapses back\n * to one line — it's meant for posting one comment at a time, not editing a\n * persistent value in place (see `editable-text` for that). Canceling (the\n * Cancel button or `Escape`) discards the draft and collapses without\n * firing `submit`. Clicking away (blur) does neither — the composer stays\n * expanded until the user explicitly submits or cancels. `Cmd`/`Ctrl`+`Enter`\n * submits from the textarea, matching `editable-text`'s multiline shortcut.\n * Purely token-styled (no bespoke colors), so it's themeable via the same\n * `--ui-*` custom properties as every other value-entry field.\n *\n * @element comment-composer\n * @fires submit - User submitted a non-empty comment; detail: `{ value: string }`.\n * @fires cancel - User discarded the draft via the Cancel button or `Escape`.\n */\n@customElement(\"comment-composer\")\nexport class CommentComposer extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n .shell {\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n background: var(--ui-surface, #ffffff);\n }\n .shell.expanded {\n border-radius: var(--ui-radius, 0.5rem);\n }\n input,\n textarea {\n display: block;\n box-sizing: border-box;\n width: 100%;\n border: 0;\n background: none;\n color: var(--ui-text, #0f172a);\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size, 0.875rem);\n line-height: var(--ui-line-height-normal, 1.5);\n padding: 0.5rem 0.75rem;\n outline: none;\n }\n textarea {\n resize: none;\n }\n input:focus-visible,\n .shell:not(.expanded):focus-within {\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n border-radius: var(--ui-radius-sm, 0.25rem);\n }\n textarea:focus-visible {\n outline: none;\n }\n .footer {\n display: flex;\n justify-content: flex-end;\n padding: 0.5rem 0.75rem 0.75rem;\n }\n input:disabled,\n textarea:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n @media (forced-colors: active) {\n .shell:not(.expanded):focus-within {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n }\n `,\n ];\n\n /** Committed value shown in the collapsed one-line field. */\n @property() value = \"\";\n /** Placeholder text shown when empty. */\n @property() placeholder = \"Add a comment…\";\n /** Accessible name applied to the input/textarea. */\n @property() label = \"Comment\";\n /** Visible row count once expanded. */\n @property({ type: Number }) rows = 4;\n /** Label for the primary submit button. */\n @property({ attribute: \"submit-label\" }) submitLabel = \"Submit\";\n /** Label for the secondary cancel button. */\n @property({ attribute: \"cancel-label\" }) cancelLabel = \"Cancel\";\n /** Disables the field entirely. */\n @property({ type: Boolean }) disabled = false;\n\n @state() private _expanded = false;\n @state() private _draft = \"\";\n\n @query(\"textarea\") private _textarea?: HTMLTextAreaElement;\n\n private _expand(): void {\n if (this.disabled || this._expanded) return;\n this._draft = this.value;\n this._expanded = true;\n }\n\n private _onInput(e: Event): void {\n this._draft = (e.target as HTMLInputElement | HTMLTextAreaElement).value;\n }\n\n private _cancel(): void {\n this._draft = this.value;\n this._expanded = false;\n this.dispatchEvent(new CustomEvent(\"cancel\", { bubbles: true, composed: true }));\n }\n\n private _submit(): void {\n const trimmed = this._draft.trim();\n if (trimmed === \"\") return;\n this.value = \"\";\n this._draft = \"\";\n this._expanded = false;\n this.dispatchEvent(\n new CustomEvent(\"submit\", { detail: { value: trimmed }, bubbles: true, composed: true }),\n );\n }\n\n private _onKeydown(e: KeyboardEvent): void {\n if (e.key === \"Escape\") {\n e.preventDefault();\n this._cancel();\n } else if (e.key === \"Enter\" && (e.metaKey || e.ctrlKey)) {\n e.preventDefault();\n this._submit();\n }\n }\n\n protected override updated(changed: Map<string, unknown>): void {\n if (changed.has(\"_expanded\") && this._expanded) {\n const field = this._textarea;\n if (!field) return;\n field.focus();\n const end = field.value.length;\n field.setSelectionRange(end, end);\n }\n }\n\n override render() {\n const canSubmit = this._draft.trim() !== \"\";\n return html`\n <div class=\"shell ${this._expanded ? \"expanded\" : \"\"}\">\n ${this._expanded\n ? html`\n <textarea\n rows=${this.rows}\n .value=${this._draft}\n placeholder=${this.placeholder}\n aria-label=${this.label}\n ?disabled=${this.disabled}\n @input=${this._onInput}\n @keydown=${this._onKeydown}\n ></textarea>\n <div class=\"footer\">\n <form-actions>\n <ui-button\n slot=\"secondary\"\n variant=\"secondary\"\n size=\"sm\"\n @click=${this._cancel}\n >${this.cancelLabel}</ui-button\n >\n <ui-button\n slot=\"primary\"\n variant=\"primary\"\n size=\"sm\"\n ?disabled=${!canSubmit}\n @click=${this._submit}\n >${this.submitLabel}</ui-button\n >\n </form-actions>\n </div>\n `\n : html`\n <input\n type=\"text\"\n .value=${this.value}\n placeholder=${this.placeholder}\n aria-label=${this.label}\n ?disabled=${this.disabled}\n @focus=${this._expand}\n @click=${this._expand}\n />\n `}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"comment-composer\": CommentComposer;\n }\n}\n"]}
1
+ {"version":3,"file":"comment-composer.js","sourceRoot":"","sources":["../src/comment-composer.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,mBAAmB,CAAC;AAC3B,OAAO,eAAe,CAAC;AACvB,OAAO,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QAqEL,6DAA6D;QACjD,UAAK,GAAG,EAAE,CAAC;QACvB,yCAAyC;QAC7B,gBAAW,GAAG,gBAAgB,CAAC;QAC3C,qDAAqD;QACzC,UAAK,GAAG,SAAS,CAAC;QAC9B,uCAAuC;QACX,SAAI,GAAG,CAAC,CAAC;QACrC,2CAA2C;QACF,gBAAW,GAAG,QAAQ,CAAC;QAChE,6CAA6C;QACJ,gBAAW,GAAG,QAAQ,CAAC;QAChE,mCAAmC;QACN,aAAQ,GAAG,KAAK,CAAC;QAE7B,cAAS,GAAG,KAAK,CAAC;QAClB,WAAM,GAAG,EAAE,CAAC;IAqH/B,CAAC;aAzMiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;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AAQ;yBAChB,IAAI,CAAC,QAAQ;2BACX,IAAI,CAAC,UAAU;;;;;;;;6BAQb,IAAI,CAAC,OAAO;uBAClB,IAAI,CAAC,WAAW;;;;;;gCAMP,CAAC,SAAS;6BACb,IAAI,CAAC,OAAO;uBAClB,IAAI,CAAC,WAAW;;;;aAI1B;YACH,CAAC,CAAC,IAAI,CAAA;;;yBAGS,IAAI,CAAC,KAAK;8BACL,IAAI,CAAC,WAAW;6BACjB,IAAI,CAAC,KAAK;4BACX,IAAI,CAAC,QAAQ;yBAChB,IAAI,CAAC,OAAO;yBACZ,IAAI,CAAC,OAAO;;aAExB;;KAER,CAAC;IACJ,CAAC;CACF,CAAA;AApIa;IAAX,QAAQ,EAAE;8CAAY;AAEX;IAAX,QAAQ,EAAE;oDAAgC;AAE/B;IAAX,QAAQ,EAAE;8CAAmB;AAEF;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAU;AAEI;IAAxC,QAAQ,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;oDAAwB;AAEvB;IAAxC,QAAQ,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;oDAAwB;AAEnC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDAAkB;AAE7B;IAAhB,KAAK,EAAE;kDAA2B;AAClB;IAAhB,KAAK,EAAE;+CAAqB;AAEF;IAA1B,KAAK,CAAC,UAAU,CAAC;kDAAyC;AAvFhD,eAAe;IAD3B,aAAa,CAAC,kBAAkB,CAAC;GACrB,eAAe,CA0M3B","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\nimport \"./form-actions.js\";\nimport \"./kbd-hint.js\";\nimport \"./ui-button.js\";\n\n/**\n * GitHub/Slack-style comment composer: a one-line text field that expands\n * into a multi-line textarea with a bottom-right Cancel/Submit footer\n * (`form-actions`) as soon as it's focused or clicked. Submitting fires\n * `submit` with the trimmed value, then clears the field and collapses back\n * to one line — it's meant for posting one comment at a time, not editing a\n * persistent value in place (see `editable-text` for that). Canceling (the\n * Cancel button or `Escape`) discards the draft and collapses without\n * firing `submit`. Clicking away (blur) does neither — the composer stays\n * expanded until the user explicitly submits or cancels. `Cmd`/`Ctrl`+`Enter`\n * submits from the textarea, matching `editable-text`'s multiline shortcut —\n * the Submit button always shows a `kbd-hint` for it, so the shortcut is\n * discoverable rather than a hidden power-user feature. Calling the standard\n * `.focus()` method expands the composer (if collapsed) and focuses its\n * field, for an ancestor that wants to drive it programmatically.\n * Purely token-styled (no bespoke colors), so it's themeable via the same\n * `--ui-*` custom properties as every other value-entry field.\n *\n * @element comment-composer\n * @fires submit - User submitted a non-empty comment; detail: `{ value: string }`.\n * @fires cancel - User discarded the draft via the Cancel button or `Escape`.\n */\n@customElement(\"comment-composer\")\nexport class CommentComposer extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n .shell {\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n background: var(--ui-surface, #ffffff);\n }\n .shell.expanded {\n border-radius: var(--ui-radius, 0.5rem);\n }\n input,\n textarea {\n display: block;\n box-sizing: border-box;\n width: 100%;\n border: 0;\n background: none;\n color: var(--ui-text, #0f172a);\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size, 0.875rem);\n line-height: var(--ui-line-height-normal, 1.5);\n padding: 0.5rem 0.75rem;\n outline: none;\n }\n textarea {\n resize: none;\n }\n input:focus-visible,\n .shell:not(.expanded):focus-within {\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n border-radius: var(--ui-radius-sm, 0.25rem);\n }\n textarea:focus-visible {\n outline: none;\n }\n .footer {\n display: flex;\n justify-content: flex-end;\n padding: 0.5rem 0.75rem 0.75rem;\n }\n input:disabled,\n textarea:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n @media (forced-colors: active) {\n .shell:not(.expanded):focus-within {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n }\n `,\n ];\n\n /** Committed value shown in the collapsed one-line field. */\n @property() value = \"\";\n /** Placeholder text shown when empty. */\n @property() placeholder = \"Add a comment…\";\n /** Accessible name applied to the input/textarea. */\n @property() label = \"Comment\";\n /** Visible row count once expanded. */\n @property({ type: Number }) rows = 4;\n /** Label for the primary submit button. */\n @property({ attribute: \"submit-label\" }) submitLabel = \"Submit\";\n /** Label for the secondary cancel button. */\n @property({ attribute: \"cancel-label\" }) cancelLabel = \"Cancel\";\n /** Disables the field entirely. */\n @property({ type: Boolean }) disabled = false;\n\n @state() private _expanded = false;\n @state() private _draft = \"\";\n\n @query(\"textarea\") private _textarea?: HTMLTextAreaElement;\n\n private _expand(): void {\n if (this.disabled || this._expanded) return;\n this._draft = this.value;\n this._expanded = true;\n }\n\n /**\n * Expands the composer (if collapsed) and focuses its field, so an\n * ancestor can drive it programmatically — e.g. a \"reply\" affordance\n * elsewhere on the page that should land the user in this composer\n * already expanded, not just visually scrolled to a one-line input.\n * A no-op while `disabled`. Expanding re-renders asynchronously; the\n * actual focus happens in `updated()` once the textarea exists.\n */\n override focus(options?: FocusOptions): void {\n if (this.disabled) return;\n if (!this._expanded) {\n this._expand();\n return;\n }\n this._textarea?.focus(options);\n }\n\n private _onInput(e: Event): void {\n this._draft = (e.target as HTMLInputElement | HTMLTextAreaElement).value;\n }\n\n private _cancel(): void {\n this._draft = this.value;\n this._expanded = false;\n this.dispatchEvent(new CustomEvent(\"cancel\", { bubbles: true, composed: true }));\n }\n\n private _submit(): void {\n const trimmed = this._draft.trim();\n if (trimmed === \"\") return;\n this.value = \"\";\n this._draft = \"\";\n this._expanded = false;\n this.dispatchEvent(\n new CustomEvent(\"submit\", { detail: { value: trimmed }, bubbles: true, composed: true }),\n );\n }\n\n private _onKeydown(e: KeyboardEvent): void {\n if (e.key === \"Escape\") {\n e.preventDefault();\n this._cancel();\n } else if (e.key === \"Enter\" && (e.metaKey || e.ctrlKey)) {\n e.preventDefault();\n this._submit();\n }\n }\n\n protected override updated(changed: Map<string, unknown>): void {\n if (changed.has(\"_expanded\") && this._expanded) {\n const field = this._textarea;\n if (!field) return;\n field.focus();\n const end = field.value.length;\n field.setSelectionRange(end, end);\n }\n }\n\n override render() {\n const canSubmit = this._draft.trim() !== \"\";\n return html`\n <div class=\"shell ${this._expanded ? \"expanded\" : \"\"}\">\n ${this._expanded\n ? html`\n <textarea\n rows=${this.rows}\n .value=${this._draft}\n placeholder=${this.placeholder}\n aria-label=${this.label}\n ?disabled=${this.disabled}\n @input=${this._onInput}\n @keydown=${this._onKeydown}\n ></textarea>\n <div class=\"footer\">\n <form-actions>\n <ui-button\n slot=\"secondary\"\n variant=\"secondary\"\n size=\"sm\"\n @click=${this._cancel}\n >${this.cancelLabel}</ui-button\n >\n <ui-button\n slot=\"primary\"\n variant=\"primary\"\n size=\"sm\"\n ?disabled=${!canSubmit}\n @click=${this._submit}\n >${this.submitLabel} <kbd-hint keys=\"Mod+Enter\"></kbd-hint\n ></ui-button>\n </form-actions>\n </div>\n `\n : html`\n <input\n type=\"text\"\n .value=${this.value}\n placeholder=${this.placeholder}\n aria-label=${this.label}\n ?disabled=${this.disabled}\n @focus=${this._expand}\n @click=${this._expand}\n />\n `}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"comment-composer\": CommentComposer;\n }\n}\n"]}
package/dist/icons.d.ts CHANGED
@@ -44,6 +44,8 @@ export declare const iconMap: (size?: number) => import("lit-html").TemplateResu
44
44
  export declare const iconCheckCircle: (size?: number) => import("lit-html").TemplateResult<2>;
45
45
  /** A light-theme toggle, or to represent daytime/light mode. */
46
46
  export declare const iconSun: (size?: number) => import("lit-html").TemplateResult<2>;
47
+ /** A gradient-theme toggle, or to represent a decorative/enhanced visual style. */
48
+ export declare const iconSparkles: (size?: number) => import("lit-html").TemplateResult<2>;
47
49
  /** Security warnings, or at-risk/compromised states. */
48
50
  export declare const iconShieldExclamation: (size?: number) => import("lit-html").TemplateResult<2>;
49
51
  /** Refresh actions, or an animated busy/loading spinner. */
@@ -1 +1 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.ts"],"names":[],"mappings":"AAKA,0EAA0E;AAC1E,eAAO,MAAM,KAAK,yDAC2O,CAAC;AAE9P,gFAAgF;AAChF,eAAO,MAAM,SAAS,yDAC+P,CAAC;AAEtR,wEAAwE;AACxE,eAAO,MAAM,eAAe,yDACwO,CAAC;AAErQ,sEAAsE;AACtE,eAAO,MAAM,gBAAgB,yDACqO,CAAC;AAEnQ,iEAAiE;AACjE,eAAO,MAAM,aAAa,yDACyO,CAAC;AAEpQ,4DAA4D;AAC5D,eAAO,MAAM,OAAO,yDAC2xC,CAAC;AAEhzC,2EAA2E;AAC3E,eAAO,MAAM,QAAQ,yDAC4W,CAAC;AAElY,mDAAmD;AACnD,eAAO,MAAM,sBAAsB,yDAC6Y,CAAC;AAEjb,oEAAoE;AACpE,eAAO,MAAM,UAAU,yDACqX,CAAC;AAE7Y,+EAA+E;AAC/E,eAAO,MAAM,SAAS,yDACgnB,CAAC;AAEvoB,+EAA+E;AAC/E,eAAO,MAAM,oBAAoB,yDACoV,CAAC;AAEtX,0DAA0D;AAC1D,eAAO,MAAM,QAAQ,yDAC0O,CAAC;AAEhQ,6DAA6D;AAC7D,eAAO,MAAM,cAAc,yDACme,CAAC;AAE/f,4DAA4D;AAC5D,eAAO,MAAM,kBAAkB,yDACob,CAAC;AAEpd,gEAAgE;AAChE,eAAO,MAAM,QAAQ,yDAC8b,CAAC;AAEpd,0CAA0C;AAC1C,eAAO,MAAM,UAAU,yDACiY,CAAC;AAEzZ,uDAAuD;AACvD,eAAO,MAAM,SAAS,yD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O,MAAM,aAAa,yDACoU,CAAC;AAE/V,sEAAsE;AACtE,eAAO,MAAM,uBAAuB,yDACqX,CAAC;AAE1Z,kEAAkE;AAClE,eAAO,MAAM,qBAAqB,yDACkR,CAAC;AAErT,4DAA4D;AAC5D,eAAO,MAAM,QAAQ,yDACwY,CAAC;AAE9Z,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,yDACqd,CAAC;AAEtf,gEAAgE;AAChE,eAAO,MAAM,qBAAqB,yDACgX,CAAC;AAEnZ,4DAA4D;AAC5D,eAAO,MAAM,eAAe,yDAC+vC,CAAC;AAE5xC,0DAA0D;AAC1D,eAAO,MAAM,SAAS,yDAC4kB,CAAC;AAEnmB,+BAA+B;AAC/B,eAAO,MAAM,yBAAyB,yDACqV,CAAC;AAE5X,0DAA0D;AAC1D,eAAO,MAAM,qBAAqB,yDACgtB,CAAC;AAEnvB,+EAA+E;AAC/E,eAAO,MAAM,QAAQ,yDACkV,CAAC;AAExW,iFAAiF;AACjF,eAAO,MAAM,SAAS,yDACkP,CAAC;AAEzQ,+EAA+E;AAC/E,eAAO,MAAM,eAAe,yDAC8d,CAAC;AAE3f,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB,yDAC4d,CAAC;AAE1f,0FAA0F;AAC1F,eAAO,MAAM,oBAAoB,yDAC6U,CAAC"}
package/dist/icons.js CHANGED
@@ -47,6 +47,8 @@ export const iconMap = (size = 16) => svg `<svg xmlns="http://www.w3.org/2000/sv
47
47
  export const iconCheckCircle = (size = 16) => svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="1.5" stroke="currentColor" width=${size} height=${size} aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>`;
48
48
  /** A light-theme toggle, or to represent daytime/light mode. */
49
49
  export const iconSun = (size = 16) => svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="1.5" stroke="currentColor" width=${size} height=${size} aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"/></svg>`;
50
+ /** A gradient-theme toggle, or to represent a decorative/enhanced visual style. */
51
+ export const iconSparkles = (size = 16) => svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="1.5" stroke="currentColor" width=${size} height=${size} aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"/></svg>`;
50
52
  /** Security warnings, or at-risk/compromised states. */
51
53
  export const iconShieldExclamation = (size = 16) => svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke-width="1.5" stroke="currentColor" width=${size} height=${size} aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m0-10.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.75c0 5.592 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.57-.598-3.75h-.152c-3.196 0-6.1-1.25-8.25-3.286Zm0 13.036h.008v.008H12v-.008Z"/></svg>`;
52
54
  /** Refresh actions, or an animated busy/loading spinner. */