@lushly-dev/violet-elements 0.2.0-preview.2 → 0.2.0-preview.4
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 +8 -6
- package/custom-elements.json +23 -2
- package/dist/alert/violet-alert.js +19 -1
- package/dist/alert/violet-alert.js.map +1 -1
- package/dist/badge/violet-badge.js +3 -1
- package/dist/badge/violet-badge.js.map +1 -1
- package/dist/card/violet-card.js +6 -0
- package/dist/card/violet-card.js.map +1 -1
- package/dist/color-picker/violet-color-picker.js +3 -2
- package/dist/color-picker/violet-color-picker.js.map +1 -1
- package/dist/conversation/violet-approval-card.js +18 -4
- package/dist/conversation/violet-approval-card.js.map +1 -1
- package/dist/conversation/violet-chat-composer.js +2 -2
- package/dist/conversation/violet-chat-composer.js.map +1 -1
- package/dist/conversation/violet-chat-suggestions.js +5 -5
- package/dist/conversation/violet-chat-suggestions.js.map +1 -1
- package/dist/conversation/violet-conversation-thread.js +1 -1
- package/dist/conversation/violet-conversation-thread.js.map +1 -1
- package/dist/conversation/violet-message-media.js +4 -4
- package/dist/conversation/violet-message-media.js.map +1 -1
- package/dist/conversation/violet-message-status.js +6 -6
- package/dist/conversation/violet-message-status.js.map +1 -1
- package/dist/conversation/violet-message.js +5 -5
- package/dist/conversation/violet-message.js.map +1 -1
- package/dist/conversation/violet-reasoning-block.js +4 -4
- package/dist/conversation/violet-reasoning-block.js.map +1 -1
- package/dist/conversation/violet-source-citation.js +7 -7
- package/dist/conversation/violet-source-citation.js.map +1 -1
- package/dist/conversation/violet-tool-call-card.js +28 -14
- package/dist/conversation/violet-tool-call-card.js.map +1 -1
- package/dist/conversation/violet-tool-result-card.js +20 -6
- package/dist/conversation/violet-tool-result-card.js.map +1 -1
- package/dist/data-grid/violet-data-grid.styles.js +4 -1
- package/dist/data-grid/violet-data-grid.styles.js.map +1 -1
- package/dist/dialog/violet-dialog.js +6 -0
- package/dist/dialog/violet-dialog.js.map +1 -1
- package/dist/icon/icon-registry.js +19 -0
- package/dist/icon/icon-registry.js.map +1 -1
- package/dist/progress/violet-progress.js +15 -1
- package/dist/progress/violet-progress.js.map +1 -1
- package/dist/skeleton/violet-skeleton.js +3 -1
- package/dist/skeleton/violet-skeleton.js.map +1 -1
- package/dist/snackbar/violet-snackbar.js +14 -0
- package/dist/snackbar/violet-snackbar.js.map +1 -1
- package/dist/tab/violet-tab.js +3 -3
- package/dist/tab/violet-tab.js.map +1 -1
- package/dist/tab-panel/violet-tab-panel.js +14 -2
- package/dist/tab-panel/violet-tab-panel.js.map +1 -1
- package/dist/tabs/violet-tabs.d.ts +5 -0
- package/dist/tabs/violet-tabs.js +13 -5
- package/dist/tabs/violet-tabs.js.map +1 -1
- package/dist/teaching-tip/violet-teaching-tip.js +1 -1
- package/dist/teaching-tip/violet-teaching-tip.js.map +1 -1
- package/dist/text-area/violet-text-area.js +5 -0
- package/dist/text-area/violet-text-area.js.map +1 -1
- package/dist/text-field/violet-text-field.js +5 -0
- package/dist/text-field/violet-text-field.js.map +1 -1
- package/dist/theme/generated/violet-theme.generated.d.ts +15 -15
- package/dist/theme/generated/violet-theme.generated.js +15 -15
- package/dist/theme/generated/violet-theme.generated.js.map +1 -1
- package/dist/toast/violet-toast.js +14 -0
- package/dist/toast/violet-toast.js.map +1 -1
- package/package.json +6 -6
- package/tokens/raw-palette.proposal.jsonc +84 -81
- package/tokens/violet-theme.export.json +15 -15
package/README.md
CHANGED
|
@@ -55,12 +55,14 @@ import "@lushly-dev/violet-elements";
|
|
|
55
55
|
- `@lushly-dev/violet-elements/theme-css` is the Node-safe theme-set helpers (`findVioletThemeSetGaps` and the types), side-effect free; see [Runtime Theme](#runtime-theme).
|
|
56
56
|
- Element modules register themselves when imported, so the package declares `sideEffects: true`.
|
|
57
57
|
|
|
58
|
-
##
|
|
58
|
+
## Story Review
|
|
59
59
|
|
|
60
|
-
Reusable components in this package should be reviewed
|
|
61
|
-
|
|
60
|
+
Reusable components in this package should be reviewed through their stories
|
|
61
|
+
before they are treated as reference-grade. The stories run on Specimen
|
|
62
|
+
(`@lushly-dev/specimen`), which replaced Storybook here.
|
|
62
63
|
|
|
63
|
-
- Run `pnpm
|
|
64
|
+
- Run `pnpm test:stories` from the repo root: it typechecks the stories, runs
|
|
65
|
+
each one with its accessibility check and builds the review page.
|
|
64
66
|
- New components should include co-located `*.stories.ts` files.
|
|
65
67
|
- Stories are required as part of component creation, not a follow-up task.
|
|
66
68
|
|
|
@@ -224,8 +226,8 @@ applyVioletThemeRoot(panel, "dark");
|
|
|
224
226
|
</violet-theme>
|
|
225
227
|
```
|
|
226
228
|
|
|
227
|
-
Inside this repository (for example
|
|
228
|
-
imported from `packages/violet-elements/src/theme`.
|
|
229
|
+
Inside this repository (for example Specimen's preview, `specimen/preview.ts`),
|
|
230
|
+
the same functions are imported from `packages/violet-elements/src/theme`.
|
|
229
231
|
|
|
230
232
|
## Gantt foundation
|
|
231
233
|
|
package/custom-elements.json
CHANGED
|
@@ -15613,7 +15613,7 @@
|
|
|
15613
15613
|
{
|
|
15614
15614
|
"kind": "variable",
|
|
15615
15615
|
"name": "styles",
|
|
15616
|
-
"default": "css` :host { display: block; container-type: inline-size; color: var(--color-text-primary, #181b1a); font-family: var(--violet-data-grid-font-family, var(--font-family-body, \"Inter\", system-ui, sans-serif)); --_surface-page: var(--color-surface-page, #f4f0ea); --_surface-card: var(--color-surface-card, #f8f9f3); --_surface-subtle: var(--color-surface-subtle, #e9e5de); --_surface-selected: var(--color-surface-selected, #dfeae3); --_control-selected-background: var(--color-control-selected-background, #badecf); --_control-selected-foreground: var(--color-control-selected-foreground, #2c5e4b); --_control-selected-border: var(--color-control-selected-border, rgba(44, 94, 75, 0.5)); --_surface-floating: var(--color-surface-floating, #ffffff); --_text-primary: var(--color-text-primary, #181b1a); --_text-secondary: var(--color-text-secondary, #48534b); --_text-muted: var(--color-text-muted, #5e6460); --_border-subtle: var(--color-border-subtle, rgba(24, 27, 26, 0.10)); --_border-strong: var(--color-border-strong, #6b7d6e); --_focus-ring: var(--color-focus-ring, #146ba0); --_error-background: var(--color-state-danger-background, #f7e4df); --_error-border: var(--color-state-danger-border, transparent); --_error-text: var(--color-state-danger-text, #c42a1a); --_active-cell-ring: var(--violet-data-grid-active-cell-ring, color-mix(in srgb, var(--_focus-ring) 82%, transparent)); --_active-cell-ring-width: var(--violet-data-grid-active-cell-ring-width, var(--size-focus-ring-width, 2px)); --_space-inline-sm: var(--space-inline-sm, 4px); --_space-inline-md: var(--space-inline-md, 8px); --_space-stack-xs: var(--space-stack-xs, 4px); --_space-stack-sm: var(--space-stack-sm, 8px); --_radius-md: var(--radius-md, 8px); --_shadow-card: var(--shadow-card, 0 0 0 1px rgba(24, 27, 26, 0.06), 0 1px 2px rgba(24, 27, 26, 0.06), 0 4px 10px -2px rgba(24, 27, 26, 0.06)); /* Stacking layers. Declared here rather than inherited: an undefined custom property makes the z-index declaration invalid at computed-value time, so it is dropped and the element falls back to z-index auto — a sticky header then scrolls behind the rows instead of above them. Values match violet-token-defaults. */ --_layer-raised: var(--z-index-raised, 1); --_layer-sticky: var(--z-index-sticky, 10); --_focus-outline-offset: 2px; --_type-meta-size: 0.875rem; --_type-cell-size: 0.9375rem; --_target-size-compact: var(--size-target-compact, 24px); --_target-size-natural: var(--size-target-natural, 32px); --_target-size-comfortable: var(--size-target-comfortable, 44px); --_row-target-size: var(--_target-size-natural); --_column-resizer-target-size: var(--_target-size-compact); --_filter-max-inline: min(24rem, 100%); --_toolbar-primary-column: 20rem; --_selection-column-size: 3.25rem; --_selection-control-size: 1rem; --_loading-min-block-size: 10rem; --_overlay-blur: 4px; --_visually-hidden-size: 1px; --_row-padding-inline: var(--violet-data-grid-row-padding-inline, 0.875rem); --_virtualized-max-block-size: var(--violet-data-grid-virtualized-max-block-size, 32rem); } :host([density=\"compact\"]) { --_row-target-size: var(--_target-size-compact); --_row-padding-inline: var(--violet-data-grid-row-padding-inline-compact, 0.875rem); } :host([density=\"comfortable\"]) { --_row-target-size: var(--_target-size-comfortable); --_row-padding-inline: var(--violet-data-grid-row-padding-inline-comfortable, 1rem); } :host(:focus-visible) { outline: 2px solid var(--_focus-ring); outline-offset: var(--_focus-outline-offset); } :host([busy]) .table-scroll { cursor: progress; } .grid-shell { display: grid; gap: var(--_space-stack-sm); min-inline-size: 0; min-block-size: 0; block-size: 100%; } .toolbar { display: grid; gap: var(--_space-inline-sm); align-items: start; } .fill-actions { display: flex; flex-wrap: wrap; gap: var(--_space-inline-sm); } .fill-status { align-self: center; color: var(--_text-secondary); font-size: var(--_type-meta-size); } .fill-action { min-inline-size: 24px; min-block-size: 32px; padding: var(--_space-stack-xs) var(--_space-inline-md); border: 1px solid var(--_border-strong); border-radius: var(--_radius-md); background: var(--_surface-card); color: var(--_text-primary); font: inherit; font-size: var(--_type-meta-size); cursor: pointer; } .fill-action:disabled { color: var(--_text-muted); cursor: default; } .fill-action:focus-visible { outline: 2px solid var(--_focus-ring); outline-offset: var(--_focus-outline-offset); } .toolbar-meta { display: flex; justify-content: space-between; align-items: center; gap: var(--_space-inline-sm); color: var(--_text-secondary); font-size: var(--_type-meta-size); } .toolbar-slot { display: flex; flex-wrap: wrap; gap: var(--_space-inline-sm); } .filter-shell { display: grid; max-inline-size: var(--_filter-max-inline); } .filter-field { inline-size: 100%; } .table-region { position: relative; min-inline-size: 0; min-block-size: 0; } .edit-status { position: absolute; z-index: var(--_layer-sticky); inset-block-start: var(--_space-stack-xs); inset-inline-end: var(--_space-inline-sm); max-inline-size: min(24rem, calc(100% - (var(--_space-inline-sm) * 2))); padding: var(--_space-stack-xs) var(--_space-inline-sm); border: 1px solid var(--_error-border); border-radius: calc(var(--_radius-md) / 2); background: var(--_error-background); color: var(--_error-text); box-shadow: var(--_shadow-card); font-size: 0.8125rem; line-height: 1.35; pointer-events: none; } .edit-status:empty { display: none; } .table-scroll { box-sizing: border-box; max-inline-size: 100%; min-inline-size: 0; overflow: auto; border: 1px solid var(--_border-subtle); border-radius: calc(var(--_radius-md) - 2px); background: var(--_surface-card); scrollbar-color: color-mix(in srgb, var(--_border-strong) 65%, transparent) transparent; outline: none; } .table-scroll:focus-visible { box-shadow: 0 0 0 2px var(--_focus-ring); } :host([virtualize]) .table-scroll { block-size: 100%; max-block-size: var(--_virtualized-max-block-size); overflow-anchor: none; } .table-canvas { min-inline-size: 100%; overflow: visible; } :host([virtualize]) .table-canvas { min-block-size: calc(var(--_virtual-total-size, 0px) + var(--_row-target-size)); } .table-scroll::-webkit-scrollbar { inline-size: 0.625rem; block-size: 0.625rem; } .table-scroll::-webkit-scrollbar-track { background: transparent; } .table-scroll::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--_border-strong) 72%, transparent); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; } .table-scroll::-webkit-scrollbar-corner { background: transparent; } .table-full-table { min-inline-size: 100%; inline-size: max-content; border-collapse: separate; border-spacing: 0; table-layout: fixed; } thead { background: var(--_surface-subtle); } :host([sticky-header]) .table-full-table thead th { position: sticky; inset-block-start: 0; z-index: var(--_layer-raised); background: var(--_surface-subtle); } th, td { box-sizing: border-box; block-size: var(--_row-target-size); border-block-end: 1px solid var(--_border-subtle); padding-inline: var(--_row-padding-inline); padding-block: 0; text-align: start; vertical-align: middle; } tbody tr:last-of-type td { border-block-end: none; } .virtual-spacer-row, .virtual-spacer-row td { padding: 0; border: 0; background: transparent; overflow-anchor: none; } .virtual-spacer-row td { min-block-size: 0; } th { color: var(--_text-secondary); font-size: var(--_type-meta-size); font-weight: 600; position: relative; } th[data-column-id] { padding-inline-end: var(--_column-resizer-target-size); } th:not(:last-child), td:not(:last-child) { border-inline-end: 1px solid var(--_border-subtle); } .header-button { display: inline-flex; align-items: center; justify-content: space-between; gap: var(--_space-inline-sm); inline-size: 100%; block-size: 100%; padding: 0; padding-inline-end: calc(var(--_space-inline-sm) + 0.5rem); border: none; background: transparent; color: inherit; font: inherit; text-align: inherit; cursor: pointer; } .header-button:focus-visible { outline: 2px solid var(--_focus-ring); outline-offset: var(--_focus-outline-offset); border-radius: calc(var(--_radius-md) / 2); } th[tabindex]:focus-visible { outline: 2px solid var(--_focus-ring); outline-offset: -2px; } .header-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sort-indicator { display: inline-flex; align-items: center; justify-content: center; inline-size: var(--_selection-control-size); block-size: var(--_selection-control-size); color: var(--_text-muted); flex: 0 0 auto; transition: opacity 120ms ease, color 120ms ease; } .sort-indicator[data-sorted=\"false\"] { opacity: 0; color: color-mix(in srgb, var(--_text-muted) 72%, var(--_surface-card)); } th:hover .sort-indicator[data-sorted=\"false\"], .header-button:hover .sort-indicator[data-sorted=\"false\"], .header-button:focus-visible .sort-indicator[data-sorted=\"false\"] { opacity: 1; } .column-resizer { position: absolute; inset-block: 0; inset-inline-end: 0; box-sizing: border-box; inline-size: var(--_column-resizer-target-size); padding: 0; border: none; background: transparent; cursor: col-resize; touch-action: none; z-index: var(--_layer-sticky); } .column-resizer::before { content: \"\"; position: absolute; inset-block: 0; inset-inline-end: 0; inline-size: 1px; background: color-mix(in srgb, var(--_border-strong) 58%, transparent); opacity: 0; transition: opacity 120ms ease; } th:hover .column-resizer::before, .column-resizer:focus-visible::before { opacity: 1; } .column-resizer:focus-visible { outline: 2px solid var(--_focus-ring); outline-offset: 1px; border-radius: 999px; } td { background: var(--_surface-page); color: var(--_text-primary); font-size: var(--_type-cell-size); position: relative; user-select: text; -webkit-user-select: text; } :host([focus-mode=\"cell\"]) td { user-select: none; -webkit-user-select: none; } td[data-selected=\"true\"] { background: color-mix(in srgb, var(--_surface-selected) 48%, var(--_surface-page)); } td[data-fill-preview=\"true\"] { background: color-mix(in srgb, var(--_surface-selected) 62%, var(--_surface-page)); } td[data-active=\"true\"]::after { content: \"\"; position: absolute; inset: calc(-1 * var(--_active-cell-ring-width)); pointer-events: none; z-index: var(--_layer-raised); border: var(--_active-cell-ring-width) solid var(--_active-cell-ring); box-sizing: border-box; } td[data-active=\"true\"] { background: color-mix(in srgb, var(--_surface-selected) 70%, var(--_surface-page)); } /* Keep the 24px target inside the corner cell, including at scroll edges. */ .fill-handle { position: absolute; inset-inline-end: 0; inset-block-end: 0; inline-size: 24px; block-size: 24px; touch-action: none; cursor: crosshair; z-index: var(--_layer-sticky); } .fill-handle::after { content: \"\"; position: absolute; inset-inline-end: -3px; inset-block-end: -3px; inline-size: 6px; block-size: 6px; border: 1px solid var(--_active-cell-ring); border-radius: 2px; background: var(--_surface-card); pointer-events: none; box-shadow: 0 0 0 1px var(--_surface-card); } .cell-content { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cell-widget { display: inline-grid; align-items: center; justify-items: start; inline-size: 100%; min-inline-size: 0; } .cell-sizing-content { display: block; visibility: hidden; pointer-events: none; } .cell-widget[data-align=\"center\"] { justify-items: center; } .cell-checkbox { display: inline-grid; inline-size: var(--_selection-control-size); block-size: var(--_selection-control-size); line-height: 0; --violet-checkbox-inline-target-size: var(--_selection-control-size); } .cell-radio { display: inline-grid; inline-size: var(--_selection-control-size); block-size: var(--_selection-control-size); line-height: 0; --violet-radio-inline-target-size: var(--_selection-control-size); --violet-radio-inline-gap: 0; } .cell-editor { position: absolute; inset-inline-start: var(--_row-padding-inline); inset-inline-end: var(--_row-padding-inline); inset-block-start: 50%; transform: translateY(-50%); display: block; box-sizing: border-box; inline-size: auto; min-inline-size: 0; max-inline-size: calc(100% - (var(--_row-padding-inline) * 2)); padding: 0; border: none; background: transparent; color: var(--_text-primary); font: inherit; line-height: inherit; text-align: inherit; outline: none; appearance: none; } violet-data-grid-pill-select.cell-editor { inset-inline-start: var(--_row-padding-inline); inset-inline-end: auto; inset-block-start: 50%; transform: translateY(-50%); display: inline-grid; inline-size: fit-content; max-inline-size: calc(100% - (var(--_row-padding-inline) * 2)); justify-self: start; z-index: var(--_layer-raised); } input.cell-editor[type=\"number\"] { appearance: textfield; -moz-appearance: textfield; } input.cell-editor[type=\"number\"]::-webkit-outer-spin-button, input.cell-editor[type=\"number\"]::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; } .cell-editor:focus { outline: none; } .cell-editor-hint { position: absolute; /* Above the fill handle, which shares the sticky layer. */ z-index: calc(var(--_layer-sticky) + 1); inset-inline-start: var(--_row-padding-inline); inset-block-start: calc(100% - var(--_space-stack-xs)); /* A sentence rather than a word: wider than the edit error, still bounded. */ inline-size: max-content; max-inline-size: 18rem; padding: 2px var(--_space-stack-xs); border: 1px solid var(--_border-strong); border-radius: calc(var(--_radius-md) / 2); background: var(--_surface-floating); color: var(--_text-primary); box-shadow: var(--_shadow-card); font-size: 0.75rem; line-height: 1.25; white-space: normal; } .cell-editor-error { position: absolute; z-index: var(--_layer-sticky); inset-inline-start: var(--_row-padding-inline); inset-block-start: calc(100% - var(--_space-stack-xs)); max-inline-size: calc(100% - (var(--_row-padding-inline) * 2)); padding: 2px var(--_space-stack-xs); border: 1px solid var(--_error-border); border-radius: calc(var(--_radius-md) / 2); background: var(--_error-background); color: var(--_error-text); box-shadow: var(--_shadow-card); font-size: 0.75rem; line-height: 1.25; white-space: normal; } .selection-cell, .selection-header { inline-size: var(--_selection-column-size); padding-inline: 0; line-height: 0; text-align: center; } .selection-control { inline-size: var(--_selection-control-size); block-size: var(--_selection-control-size); accent-color: var(--_control-selected-foreground); user-select: auto; -webkit-user-select: auto; } .selection-checkbox { display: block; inline-size: var(--_selection-control-size); block-size: var(--_selection-control-size); line-height: 0; justify-self: center; --violet-checkbox-inline-target-size: var(--_selection-control-size); user-select: auto; -webkit-user-select: auto; } .selection-radio { display: block; inline-size: var(--_selection-control-size); block-size: var(--_selection-control-size); line-height: 0; justify-self: center; --violet-radio-inline-target-size: var(--_selection-control-size); --violet-radio-inline-gap: 0; user-select: auto; -webkit-user-select: auto; } tbody tr[data-selected=\"true\"] { background: var(--_surface-selected); } tbody tr[data-selected=\"true\"] td { color: var(--_text-primary); } .loading-state, .empty-state { display: grid; place-items: center; gap: var(--_space-stack-xs); min-block-size: var(--_loading-min-block-size); padding: calc(var(--_row-padding-inline) * 1.5); text-align: center; color: var(--_text-secondary); background: var(--_surface-card); } .loading-overlay { position: absolute; inset: 1px; display: grid; place-items: center; padding: var(--_space-inline-md); border-radius: calc(var(--_radius-md) - 2px); background: var(--violet-data-grid-loading-overlay-background, rgba(250, 249, 245, 0.58)); color: var(--_text-secondary); backdrop-filter: blur(calc(var(--_overlay-blur) * 1.75)); -webkit-backdrop-filter: blur(calc(var(--_overlay-blur) * 1.75)); } .default-slot { display: contents; } .visually-hidden { position: absolute; inline-size: var(--_visually-hidden-size); block-size: var(--_visually-hidden-size); padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; } th[data-align=\"center\"], td[data-align=\"center\"] { text-align: center; } th[data-align=\"end\"], td[data-align=\"end\"] { text-align: end; } @container (min-width: 48rem) { .toolbar { grid-template-columns: minmax(0, var(--_toolbar-primary-column)) minmax(0, 1fr); align-items: end; } .toolbar-meta { justify-content: flex-end; } } `"
|
|
15616
|
+
"default": "css` :host { display: block; container-type: inline-size; color: var(--color-text-primary, #181b1a); font-family: var(--violet-data-grid-font-family, var(--font-family-body, \"Inter\", system-ui, sans-serif)); --_surface-page: var(--color-surface-page, #f4f0ea); --_surface-card: var(--color-surface-card, #f8f9f3); --_surface-subtle: var(--color-surface-subtle, #e9e5de); --_surface-selected: var(--color-surface-selected, #dfeae3); --_control-selected-background: var(--color-control-selected-background, #badecf); --_control-selected-foreground: var(--color-control-selected-foreground, #2c5e4b); --_control-selected-border: var(--color-control-selected-border, rgba(44, 94, 75, 0.5)); --_surface-floating: var(--color-surface-floating, #ffffff); --_text-primary: var(--color-text-primary, #181b1a); --_text-secondary: var(--color-text-secondary, #48534b); --_text-muted: var(--color-text-muted, #5e6460); --_border-subtle: var(--color-border-subtle, rgba(24, 27, 26, 0.10)); --_border-strong: var(--color-border-strong, #6b7d6e); --_focus-ring: var(--color-focus-ring, #146ba0); --_error-background: var(--color-state-danger-background, #f7e4df); --_error-border: var(--color-state-danger-border, transparent); --_error-text: var(--color-state-danger-text, #c42a1a); --_active-cell-ring: var(--violet-data-grid-active-cell-ring, color-mix(in srgb, var(--_focus-ring) 82%, transparent)); --_active-cell-ring-width: var(--violet-data-grid-active-cell-ring-width, var(--size-focus-ring-width, 2px)); --_space-inline-sm: var(--space-inline-sm, 4px); --_space-inline-md: var(--space-inline-md, 8px); --_space-stack-xs: var(--space-stack-xs, 4px); --_space-stack-sm: var(--space-stack-sm, 8px); --_radius-md: var(--radius-md, 8px); --_shadow-card: var(--shadow-card, 0 0 0 1px rgba(24, 27, 26, 0.06), 0 1px 2px rgba(24, 27, 26, 0.06), 0 4px 10px -2px rgba(24, 27, 26, 0.06)); /* Stacking layers. Declared here rather than inherited: an undefined custom property makes the z-index declaration invalid at computed-value time, so it is dropped and the element falls back to z-index auto — a sticky header then scrolls behind the rows instead of above them. Values match violet-token-defaults. */ --_layer-raised: var(--z-index-raised, 1); --_layer-sticky: var(--z-index-sticky, 10); --_focus-outline-offset: 2px; --_type-meta-size: 0.875rem; --_type-cell-size: 0.9375rem; --_target-size-compact: var(--size-target-compact, 24px); --_target-size-natural: var(--size-target-natural, 32px); --_target-size-comfortable: var(--size-target-comfortable, 44px); --_row-target-size: var(--_target-size-natural); --_column-resizer-target-size: var(--_target-size-compact); --_filter-max-inline: min(24rem, 100%); --_toolbar-primary-column: 20rem; --_selection-column-size: 3.25rem; --_selection-control-size: 1rem; --_loading-min-block-size: 10rem; --_overlay-blur: 4px; --_visually-hidden-size: 1px; --_row-padding-inline: var(--violet-data-grid-row-padding-inline, 0.875rem); --_virtualized-max-block-size: var(--violet-data-grid-virtualized-max-block-size, 32rem); } :host([density=\"compact\"]) { --_row-target-size: var(--_target-size-compact); --_row-padding-inline: var(--violet-data-grid-row-padding-inline-compact, 0.875rem); } :host([density=\"comfortable\"]) { --_row-target-size: var(--_target-size-comfortable); --_row-padding-inline: var(--violet-data-grid-row-padding-inline-comfortable, 1rem); } :host(:focus-visible) { outline: 2px solid var(--_focus-ring); outline-offset: var(--_focus-outline-offset); } :host([busy]) .table-scroll { cursor: progress; } .grid-shell { display: grid; gap: var(--_space-stack-sm); min-inline-size: 0; min-block-size: 0; block-size: 100%; } .toolbar { display: grid; gap: var(--_space-inline-sm); align-items: start; } .fill-actions { display: flex; flex-wrap: wrap; gap: var(--_space-inline-sm); } .fill-status { align-self: center; color: var(--_text-secondary); font-size: var(--_type-meta-size); } .fill-action { min-inline-size: 24px; min-block-size: 32px; padding: var(--_space-stack-xs) var(--_space-inline-md); border: 1px solid var(--_border-strong); border-radius: var(--_radius-md); background: var(--_surface-card); color: var(--_text-primary); font: inherit; font-size: var(--_type-meta-size); cursor: pointer; } .fill-action:disabled { color: var(--_text-muted); cursor: default; } .fill-action:focus-visible { outline: 2px solid var(--_focus-ring); outline-offset: var(--_focus-outline-offset); } .toolbar-meta { display: flex; justify-content: space-between; align-items: center; gap: var(--_space-inline-sm); color: var(--_text-secondary); font-size: var(--_type-meta-size); } .toolbar-slot { display: flex; flex-wrap: wrap; gap: var(--_space-inline-sm); } .filter-shell { display: grid; max-inline-size: var(--_filter-max-inline); } .filter-field { inline-size: 100%; } .table-region { position: relative; min-inline-size: 0; min-block-size: 0; } .edit-status { position: absolute; z-index: var(--_layer-sticky); inset-block-start: var(--_space-stack-xs); inset-inline-end: var(--_space-inline-sm); max-inline-size: min(24rem, calc(100% - (var(--_space-inline-sm) * 2))); padding: var(--_space-stack-xs) var(--_space-inline-sm); border: 1px solid var(--_error-border); border-radius: calc(var(--_radius-md) / 2); background: var(--_error-background); color: var(--_error-text); box-shadow: var(--_shadow-card); font-size: 0.8125rem; line-height: 1.35; pointer-events: none; } .edit-status:empty { display: none; } .table-scroll { box-sizing: border-box; max-inline-size: 100%; min-inline-size: 0; overflow: auto; border: 1px solid var(--_border-subtle); border-radius: calc(var(--_radius-md) - 2px); background: var(--_surface-card); scrollbar-color: color-mix(in srgb, var(--_border-strong) 65%, transparent) transparent; outline: none; } .table-scroll:focus-visible { box-shadow: 0 0 0 2px var(--_focus-ring); } :host([virtualize]) .table-scroll { block-size: 100%; max-block-size: var(--_virtualized-max-block-size); overflow-anchor: none; } .table-canvas { min-inline-size: 100%; overflow: visible; } :host([virtualize]) .table-canvas { min-block-size: calc(var(--_virtual-total-size, 0px) + var(--_row-target-size)); } .table-scroll::-webkit-scrollbar { inline-size: 0.625rem; block-size: 0.625rem; } .table-scroll::-webkit-scrollbar-track { background: transparent; } .table-scroll::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--_border-strong) 72%, transparent); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; } .table-scroll::-webkit-scrollbar-corner { background: transparent; } .table-full-table { min-inline-size: 100%; inline-size: max-content; border-collapse: separate; border-spacing: 0; table-layout: fixed; } thead { background: var(--_surface-subtle); } :host([sticky-header]) .table-full-table thead th { position: sticky; inset-block-start: 0; z-index: var(--_layer-raised); background: var(--_surface-subtle); } th, td { box-sizing: border-box; block-size: var(--_row-target-size); border-block-end: 1px solid var(--_border-subtle); padding-inline: var(--_row-padding-inline); padding-block: 0; text-align: start; vertical-align: middle; } tbody tr:last-of-type td { border-block-end: none; } .virtual-spacer-row, .virtual-spacer-row td { padding: 0; border: 0; background: transparent; overflow-anchor: none; } .virtual-spacer-row td { min-block-size: 0; } th { color: var(--_text-secondary); font-size: var(--_type-meta-size); font-weight: 600; position: relative; } th[data-column-id] { padding-inline-end: var(--_column-resizer-target-size); } th:not(:last-child), td:not(:last-child) { border-inline-end: 1px solid var(--_border-subtle); } .header-button { display: inline-flex; align-items: center; justify-content: space-between; gap: var(--_space-inline-sm); inline-size: 100%; block-size: 100%; padding: 0; padding-inline-end: calc(var(--_space-inline-sm) + 0.5rem); border: none; background: transparent; color: inherit; font: inherit; text-align: inherit; cursor: pointer; } .header-button:focus-visible { outline: 2px solid var(--_focus-ring); outline-offset: var(--_focus-outline-offset); border-radius: calc(var(--_radius-md) / 2); } th[tabindex]:focus-visible { outline: 2px solid var(--_focus-ring); outline-offset: -2px; } .header-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sort-indicator { display: inline-flex; align-items: center; justify-content: center; inline-size: var(--_selection-control-size); block-size: var(--_selection-control-size); color: var(--_text-muted); flex: 0 0 auto; transition: opacity 120ms ease, color 120ms ease; } .sort-indicator[data-sorted=\"false\"] { opacity: 0; color: color-mix(in srgb, var(--_text-muted) 72%, var(--_surface-card)); } th:hover .sort-indicator[data-sorted=\"false\"], .header-button:hover .sort-indicator[data-sorted=\"false\"], .header-button:focus-visible .sort-indicator[data-sorted=\"false\"] { opacity: 1; } .column-resizer { position: absolute; inset-block: 0; inset-inline-end: 0; box-sizing: border-box; inline-size: var(--_column-resizer-target-size); padding: 0; border: none; background: transparent; cursor: col-resize; touch-action: none; z-index: var(--_layer-sticky); } .column-resizer::before { content: \"\"; position: absolute; inset-block: 0; inset-inline-end: 0; inline-size: 1px; background: color-mix(in srgb, var(--_border-strong) 58%, transparent); opacity: 0; transition: opacity 120ms ease; } th:hover .column-resizer::before, .column-resizer:focus-visible::before { opacity: 1; } .column-resizer:focus-visible { outline: 2px solid var(--_focus-ring); outline-offset: 1px; border-radius: 999px; } td { background: var(--_surface-page); color: var(--_text-primary); font-size: var(--_type-cell-size); position: relative; user-select: text; -webkit-user-select: text; } :host([focus-mode=\"cell\"]) td { user-select: none; -webkit-user-select: none; } td[data-selected=\"true\"] { background: color-mix(in srgb, var(--_surface-selected) 48%, var(--_surface-page)); } td[data-fill-preview=\"true\"] { background: color-mix(in srgb, var(--_surface-selected) 62%, var(--_surface-page)); } td[data-active=\"true\"]::after { content: \"\"; position: absolute; inset: calc(-1 * var(--_active-cell-ring-width)); pointer-events: none; z-index: var(--_layer-raised); border: var(--_active-cell-ring-width) solid var(--_active-cell-ring); box-sizing: border-box; } td[data-active=\"true\"] { background: color-mix(in srgb, var(--_surface-selected) 70%, var(--_surface-page)); } /* Keep the 24px target inside the corner cell, including at scroll edges. */ .fill-handle { position: absolute; inset-inline-end: 0; inset-block-end: 0; inline-size: 24px; block-size: 24px; touch-action: none; cursor: crosshair; z-index: var(--_layer-sticky); } .fill-handle::after { content: \"\"; position: absolute; inset-inline-end: -3px; inset-block-end: -3px; inline-size: 6px; block-size: 6px; border: 1px solid var(--_active-cell-ring); border-radius: 2px; background: var(--_surface-card); pointer-events: none; box-shadow: 0 0 0 1px var(--_surface-card); } .cell-content { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cell-widget { display: inline-grid; align-items: center; justify-items: start; inline-size: 100%; min-inline-size: 0; } .cell-sizing-content { display: block; visibility: hidden; pointer-events: none; } .cell-widget[data-align=\"center\"] { justify-items: center; } .cell-checkbox { display: inline-grid; inline-size: var(--_selection-control-size); block-size: var(--_selection-control-size); line-height: 0; --violet-checkbox-inline-target-size: var(--_selection-control-size); } .cell-radio { display: inline-grid; inline-size: var(--_selection-control-size); block-size: var(--_selection-control-size); line-height: 0; --violet-radio-inline-target-size: var(--_selection-control-size); --violet-radio-inline-gap: 0; } .cell-editor { position: absolute; inset-inline-start: var(--_row-padding-inline); inset-inline-end: var(--_row-padding-inline); inset-block-start: 50%; transform: translateY(-50%); display: block; box-sizing: border-box; inline-size: auto; min-inline-size: 0; max-inline-size: calc(100% - (var(--_row-padding-inline) * 2)); padding: 0; border: none; background: transparent; color: var(--_text-primary); font: inherit; line-height: inherit; text-align: inherit; outline: none; appearance: none; } violet-data-grid-pill-select.cell-editor { inset-inline-start: var(--_row-padding-inline); inset-inline-end: auto; inset-block-start: 50%; transform: translateY(-50%); display: inline-grid; inline-size: fit-content; max-inline-size: calc(100% - (var(--_row-padding-inline) * 2)); justify-self: start; z-index: var(--_layer-raised); } input.cell-editor[type=\"number\"] { appearance: textfield; -moz-appearance: textfield; } input.cell-editor[type=\"number\"]::-webkit-outer-spin-button, input.cell-editor[type=\"number\"]::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; } .cell-editor:focus { outline: none; } .cell-editor-hint { position: absolute; /* Above the fill handle, which shares the sticky layer. */ z-index: calc(var(--_layer-sticky) + 1); inset-inline-start: var(--_row-padding-inline); inset-block-start: calc(100% - var(--_space-stack-xs)); /* A sentence rather than a word: wider than the edit error, still bounded. */ inline-size: max-content; max-inline-size: 18rem; padding: 2px var(--_space-stack-xs); border: 1px solid var(--_border-strong); border-radius: calc(var(--_radius-md) / 2); background: var(--_surface-floating); color: var(--_text-primary); box-shadow: var(--_shadow-card); font-size: 0.75rem; line-height: 1.25; white-space: normal; } .cell-editor-error { position: absolute; z-index: var(--_layer-sticky); inset-inline-start: var(--_row-padding-inline); inset-block-start: calc(100% - var(--_space-stack-xs)); max-inline-size: calc(100% - (var(--_row-padding-inline) * 2)); padding: 2px var(--_space-stack-xs); border: 1px solid var(--_error-border); border-radius: calc(var(--_radius-md) / 2); background: var(--_error-background); color: var(--_error-text); box-shadow: var(--_shadow-card); font-size: 0.75rem; line-height: 1.25; white-space: normal; } .selection-cell, .selection-header { inline-size: var(--_selection-column-size); padding-inline: 0; line-height: 0; text-align: center; } .selection-control { inline-size: var(--_selection-control-size); block-size: var(--_selection-control-size); accent-color: var(--_control-selected-foreground); user-select: auto; -webkit-user-select: auto; } .selection-checkbox { display: block; inline-size: var(--_selection-control-size); block-size: var(--_selection-control-size); line-height: 0; justify-self: center; --violet-checkbox-inline-target-size: var(--_selection-control-size); user-select: auto; -webkit-user-select: auto; } .selection-radio { display: block; inline-size: var(--_selection-control-size); block-size: var(--_selection-control-size); line-height: 0; justify-self: center; --violet-radio-inline-target-size: var(--_selection-control-size); --violet-radio-inline-gap: 0; user-select: auto; -webkit-user-select: auto; } tbody tr[data-selected=\"true\"] { background: var(--_surface-selected); } tbody tr[data-selected=\"true\"] td { color: var(--_text-primary); } .loading-state, .empty-state { display: grid; place-items: center; gap: var(--_space-stack-xs); min-block-size: var(--_loading-min-block-size); padding: calc(var(--_row-padding-inline) * 1.5); text-align: center; color: var(--_text-secondary); background: var(--_surface-card); } .loading-overlay { position: absolute; inset: 1px; display: grid; place-items: center; padding: var(--_space-inline-md); border-radius: calc(var(--_radius-md) - 2px); background: var( --violet-data-grid-loading-overlay-background, color-mix(in srgb, var(--_surface-card) 58%, transparent) ); color: var(--_text-secondary); backdrop-filter: blur(calc(var(--_overlay-blur) * 1.75)); -webkit-backdrop-filter: blur(calc(var(--_overlay-blur) * 1.75)); } .default-slot { display: contents; } .visually-hidden { position: absolute; inline-size: var(--_visually-hidden-size); block-size: var(--_visually-hidden-size); padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; } th[data-align=\"center\"], td[data-align=\"center\"] { text-align: center; } th[data-align=\"end\"], td[data-align=\"end\"] { text-align: end; } @container (min-width: 48rem) { .toolbar { grid-template-columns: minmax(0, var(--_toolbar-primary-column)) minmax(0, 1fr); align-items: end; } .toolbar-meta { justify-content: flex-end; } } `"
|
|
15617
15617
|
}
|
|
15618
15618
|
],
|
|
15619
15619
|
"exports": [
|
|
@@ -37305,6 +37305,18 @@
|
|
|
37305
37305
|
"privacy": "public",
|
|
37306
37306
|
"default": "false"
|
|
37307
37307
|
},
|
|
37308
|
+
{
|
|
37309
|
+
"kind": "field",
|
|
37310
|
+
"name": "label",
|
|
37311
|
+
"type": {
|
|
37312
|
+
"text": "string"
|
|
37313
|
+
},
|
|
37314
|
+
"privacy": "public",
|
|
37315
|
+
"description": "Accessible name for the tab list, which is inside the shadow root, so the host's aria-label\ncannot name it. It is not shown.",
|
|
37316
|
+
"default": "\"\"",
|
|
37317
|
+
"attribute": "label",
|
|
37318
|
+
"reflects": true
|
|
37319
|
+
},
|
|
37308
37320
|
{
|
|
37309
37321
|
"kind": "field",
|
|
37310
37322
|
"name": "orientation",
|
|
@@ -37393,6 +37405,15 @@
|
|
|
37393
37405
|
},
|
|
37394
37406
|
"default": "\"\"",
|
|
37395
37407
|
"fieldName": "activeid"
|
|
37408
|
+
},
|
|
37409
|
+
{
|
|
37410
|
+
"name": "label",
|
|
37411
|
+
"description": "Accessible name for the tab list, which is inside the shadow root, so the host's aria-label\ncannot name it. It is not shown.",
|
|
37412
|
+
"type": {
|
|
37413
|
+
"text": "string"
|
|
37414
|
+
},
|
|
37415
|
+
"default": "\"\"",
|
|
37416
|
+
"fieldName": "label"
|
|
37396
37417
|
}
|
|
37397
37418
|
],
|
|
37398
37419
|
"customElement": true,
|
|
@@ -39419,7 +39440,7 @@
|
|
|
39419
39440
|
{
|
|
39420
39441
|
"kind": "variable",
|
|
39421
39442
|
"name": "violetThemeBuiltInSet",
|
|
39422
|
-
"default": "{ defaultPreset: \"light\", presets: { \"light\": [ { id: \"color.action.danger.background\", value: \"#c42a1a\" }, { id: \"color.action.danger.hover\", value: \"#ad2416\" }, { id: \"color.action.danger.pressed\", value: \"#96200f\" }, { id: \"color.action.danger.text\", value: \"#ffffff\" }, { id: \"color.action.primary.background\", value: \"#181b1a\" }, { id: \"color.action.primary.hover\", value: \"#2e3a33\" }, { id: \"color.action.primary.pressed\", value: \"#252e29\" }, { id: \"color.action.primary.text\", value: \"#f4f0ea\" }, { id: \"color.action.secondary.background\", value: \"rgba(24, 27, 26, 0.07)\" }, { id: \"color.action.secondary.border\", value: \"transparent\" }, { id: \"color.action.secondary.hover\", value: \"rgba(24, 27, 26, 0.11)\" }, { id: \"color.action.secondary.pressed\", value: \"rgba(24, 27, 26, 0.15)\" }, { id: \"color.action.secondary.text\", value: \"#181b1a\" }, { id: \"color.border.strong\", value: \"#6b7d6e\" }, { id: \"color.border.subtle\", value: \"rgba(24, 27, 26, 0.10)\" }, { id: \"color.control.selected.background\", value: \"#badecf\" }, { id: \"color.control.selected.border\", value: \"rgba(44, 94, 75, 0.5)\" }, { id: \"color.control.selected.foreground\", value: \"#2c5e4b\" }, { id: \"color.field.background\", value: \"#ffffff\" }, { id: \"color.field.background.readonly\", value: \"rgba(24, 27, 26, 0.05)\" }, { id: \"color.field.border\", value: \"#869089\" }, { id: \"color.field.border.focus\", value: \"#146ba0\" }, { id: \"color.field.border.hover\", value: \"#48534b\" }, { id: \"color.field.border.invalid\", value: \"#c42a1a\" }, { id: \"color.field.placeholder\", value: \"#5e6460\" }, { id: \"color.field.text\", value: \"#181b1a\" }, { id: \"color.focus.ring\", value: \"#146ba0\" }, { id: \"color.state.danger.background\", value: \"#f7e4df\" }, { id: \"color.state.danger.border\", value: \"transparent\" }, { id: \"color.state.danger.foreground\", value: \"#c42a1a\" }, { id: \"color.state.danger.text\", value: \"#c42a1a\" }, { id: \"color.state.success.background\", value: \"#dfeae3\" }, { id: \"color.state.success.border\", value: \"transparent\" }, { id: \"color.state.success.foreground\", value: \"#2c5e4b\" }, { id: \"color.state.success.text\", value: \"#2c5e4b\" }, { id: \"color.state.warning.background\", value: \"#f3e8d2\" }, { id: \"color.state.warning.border\", value: \"transparent\" }, { id: \"color.state.warning.text\", value: \"#92400e\" }, { id: \"color.surface.card\", value: \"#f8f9f3\" }, { id: \"color.surface.floating\", value: \"#ffffff\" }, { id: \"color.surface.highlight\", value: \"#ffffff\" }, { id: \"color.surface.page\", value: \"#f4f0ea\" }, { id: \"color.surface.pressed\", value: \"#d8dcd6\" }, { id: \"color.surface.selected\", value: \"#dfeae3\" }, { id: \"color.surface.subtle\", value: \"#e9e5de\" }, { id: \"color.text.muted\", value: \"#5e6460\" }, { id: \"color.text.primary\", value: \"#181b1a\" }, { id: \"color.text.secondary\", value: \"#48534b\" }, { id: \"duration.base\", value: \"180ms\" }, { id: \"duration.fast\", value: \"120ms\" }, { id: \"duration.slow\", value: \"280ms\" }, { id: \"easing.emphasized\", value: \"cubic-bezier(0.16, 1, 0.3, 1)\" }, { id: \"easing.standard\", value: \"cubic-bezier(0.2, 0, 0, 1)\" }, { id: \"font.family.body\", value: \"\\\"Inter\\\", system-ui, sans-serif\" }, { id: \"font.family.heading\", value: \"\\\"Space Grotesk\\\", \\\"Segoe UI\\\", system-ui, sans-serif\" }, { id: \"font.family.mono\", value: \"\\\"IBM Plex Mono\\\", ui-monospace, Consolas, monospace\" }, { id: \"radius.lg\", value: \"12px\" }, { id: \"radius.md\", value: \"8px\" }, { id: \"radius.round\", value: \"9999px\" }, { id: \"radius.sm\", value: \"4px\" }, { id: \"shadow.card\", value: \"0 0 0 1px rgba(24, 27, 26, 0.06), 0 1px 2px rgba(24, 27, 26, 0.06), 0 4px 10px -2px rgba(24, 27, 26, 0.06)\" }, { id: \"shadow.control\", value: \"0 0 0 1px rgba(24, 27, 26, 0.05), 0 1px 2px rgba(24, 27, 26, 0.10)\" }, { id: \"shadow.floating\", value: \"0 0 0 1px rgba(24, 27, 26, 0.08), 0 4px 12px -2px rgba(24, 27, 26, 0.12), 0 18px 40px -8px rgba(24, 27, 26, 0.20)\" }, { id: \"shadow.well\", value: \"inset 0 2px 3px -1px rgba(0, 0, 0, 0.1)\" }, { id: \"size.focus-ring.width\", value: \"2px\" }, { id: \"size.font.lg\", value: \"18px\" }, { id: \"size.font.md\", value: \"14px\" }, { id: \"size.font.sm\", value: \"12px\" }, { id: \"size.font.xl\", value: \"24px\" }, { id: \"size.font.xs\", value: \"11px\" }, { id: \"size.line.lg\", value: \"24px\" }, { id: \"size.line.md\", value: \"20px\" }, { id: \"size.line.sm\", value: \"16px\" }, { id: \"size.line.xl\", value: \"32px\" }, { id: \"size.line.xs\", value: \"14px\" }, { id: \"size.space.lg\", value: \"12px\" }, { id: \"size.space.md\", value: \"8px\" }, { id: \"size.space.sm\", value: \"4px\" }, { id: \"size.space.xl\", value: \"24px\" }, { id: \"size.space.xs\", value: \"2px\" }, { id: \"size.target.comfortable\", value: \"44px\" }, { id: \"size.target.compact\", value: \"24px\" }, { id: \"size.target.natural\", value: \"32px\" }, { id: \"space.inline.lg\", value: \"12px\" }, { id: \"space.inline.md\", value: \"8px\" }, { id: \"space.inline.sm\", value: \"4px\" }, { id: \"space.layout.md\", value: \"24px\" }, { id: \"space.layout.sm\", value: \"12px\" }, { id: \"space.stack.md\", value: \"12px\" }, { id: \"space.stack.sm\", value: \"8px\" }, { id: \"space.stack.xs\", value: \"4px\" }, { id: \"type.body.md.line\", value: \"20px\" }, { id: \"type.body.md.size\", value: \"14px\" }, { id: \"type.body.md.weight\", value: \"400\" }, { id: \"type.caption.xs.line\", value: \"16px\" }, { id: \"type.caption.xs.size\", value: \"12px\" }, { id: \"type.caption.xs.weight\", value: \"400\" }, { id: \"type.label.sm.line\", value: \"16px\" }, { id: \"type.label.sm.size\", value: \"13px\" }, { id: \"type.label.sm.weight\", value: \"500\" }, { id: \"type.title.md.line\", value: \"32px\" }, { id: \"type.title.md.size\", value: \"24px\" }, { id: \"type.title.md.weight\", value: \"600\" }, { id: \"type.title.sm.line\", value: \"24px\" }, { id: \"type.title.sm.size\", value: \"18px\" }, { id: \"type.title.sm.weight\", value: \"600\" }, { id: \"weight.light\", value: \"100\" }, { id: \"weight.medium\", value: \"500\" }, { id: \"weight.regular\", value: \"400\" }, { id: \"weight.semibold\", value: \"600\" }, { id: \"z-index.base\", value: \"0\" }, { id: \"z-index.modal\", value: \"300\" }, { id: \"z-index.overlay\", value: \"100\" }, { id: \"z-index.popover\", value: \"200\" }, { id: \"z-index.raised\", value: \"1\" }, { id: \"z-index.sticky\", value: \"10\" }, { id: \"z-index.toast\", value: \"400\" }, ], \"dark\": [ { id: \"color.action.danger.background\", value: \"#c42a1a\" }, { id: \"color.action.danger.hover\", value: \"#ad2416\" }, { id: \"color.action.danger.pressed\", value: \"#96200f\" }, { id: \"color.action.danger.text\", value: \"#ffffff\" }, { id: \"color.action.primary.background\", value: \"#f4f0ea\" }, { id: \"color.action.primary.hover\", value: \"#d8dcd6\" }, { id: \"color.action.primary.pressed\", value: \"#bec6bd\" }, { id: \"color.action.primary.text\", value: \"#181b1a\" }, { id: \"color.action.secondary.background\", value: \"rgba(244, 240, 234, 0.09)\" }, { id: \"color.action.secondary.border\", value: \"transparent\" }, { id: \"color.action.secondary.hover\", value: \"rgba(244, 240, 234, 0.13)\" }, { id: \"color.action.secondary.pressed\", value: \"rgba(244, 240, 234, 0.17)\" }, { id: \"color.action.secondary.text\", value: \"#f4f0ea\" }, { id: \"color.border.strong\", value: \"#939c95\" }, { id: \"color.border.subtle\", value: \"rgba(244, 240, 234, 0.10)\" }, { id: \"color.control.selected.background\", value: \"#20352c\" }, { id: \"color.control.selected.border\", value: \"rgba(163, 235, 205, 0.45)\" }, { id: \"color.control.selected.foreground\", value: \"#a3ebcd\" }, { id: \"color.field.background\", value: \"rgba(0, 0, 0, 0.26)\" }, { id: \"color.field.background.readonly\", value: \"rgba(244, 240, 234, 0.06)\" }, { id: \"color.field.border\", value: \"#6b7d6e\" }, { id: \"color.field.border.focus\", value: \"#a3ebcd\" }, { id: \"color.field.border.hover\", value: \"#adb6ab\" }, { id: \"color.field.border.invalid\", value: \"#ff897a\" }, { id: \"color.field.placeholder\", value: \"#adb6ab\" }, { id: \"color.field.text\", value: \"#f4f0ea\" }, { id: \"color.focus.ring\", value: \"#a3ebcd\" }, { id: \"color.state.danger.background\", value: \"#3d211d\" }, { id: \"color.state.danger.border\", value: \"transparent\" }, { id: \"color.state.danger.foreground\", value: \"#ff897a\" }, { id: \"color.state.danger.text\", value: \"#ffab99\" }, { id: \"color.state.success.background\", value: \"#20352c\" }, { id: \"color.state.success.border\", value: \"transparent\" }, { id: \"color.state.success.foreground\", value: \"#a3ebcd\" }, { id: \"color.state.success.text\", value: \"#a3ebcd\" }, { id: \"color.state.warning.background\", value: \"#3a2b18\" }, { id: \"color.state.warning.border\", value: \"transparent\" }, { id: \"color.state.warning.text\", value: \"#f3d6a3\" }, { id: \"color.surface.card\", value: \"#222824\" }, { id: \"color.surface.floating\", value: \"#252e29\" }, { id: \"color.surface.highlight\", value: \"#4d5b50\" }, { id: \"color.surface.page\", value: \"#181b1a\" }, { id: \"color.surface.pressed\", value: \"rgba(244, 240, 234, 0.14)\" }, { id: \"color.surface.selected\", value: \"#20352c\" }, { id: \"color.surface.subtle\", value: \"#2e3a33\" }, { id: \"color.text.muted\", value: \"#adb6ab\" }, { id: \"color.text.primary\", value: \"#f4f0ea\" }, { id: \"color.text.secondary\", value: \"#bdcfc1\" }, { id: \"duration.base\", value: \"180ms\" }, { id: \"duration.fast\", value: \"120ms\" }, { id: \"duration.slow\", value: \"280ms\" }, { id: \"easing.emphasized\", value: \"cubic-bezier(0.16, 1, 0.3, 1)\" }, { id: \"easing.standard\", value: \"cubic-bezier(0.2, 0, 0, 1)\" }, { id: \"font.family.body\", value: \"\\\"Inter\\\", system-ui, sans-serif\" }, { id: \"font.family.heading\", value: \"\\\"Space Grotesk\\\", \\\"Segoe UI\\\", system-ui, sans-serif\" }, { id: \"font.family.mono\", value: \"\\\"IBM Plex Mono\\\", ui-monospace, Consolas, monospace\" }, { id: \"radius.lg\", value: \"12px\" }, { id: \"radius.md\", value: \"8px\" }, { id: \"radius.round\", value: \"9999px\" }, { id: \"radius.sm\", value: \"4px\" }, { id: \"shadow.card\", value: \"0 0 0 1px rgba(244, 240, 234, 0.07), 0 1px 2px rgba(0, 0, 0, 0.32), 0 6px 14px -2px rgba(0, 0, 0, 0.30)\" }, { id: \"shadow.control\", value: \"0 0 0 1px rgba(244, 240, 234, 0.07), 0 1px 2px rgba(0, 0, 0, 0.40)\" }, { id: \"shadow.floating\", value: \"0 0 0 1px rgba(244, 240, 234, 0.13), 0 6px 16px -2px rgba(0, 0, 0, 0.45), 0 22px 48px -8px rgba(0, 0, 0, 0.60)\" }, { id: \"shadow.well\", value: \"inset 0 2px 3px -1px rgba(0, 0, 0, 0.28)\" }, { id: \"size.focus-ring.width\", value: \"2px\" }, { id: \"size.font.lg\", value: \"18px\" }, { id: \"size.font.md\", value: \"14px\" }, { id: \"size.font.sm\", value: \"12px\" }, { id: \"size.font.xl\", value: \"24px\" }, { id: \"size.font.xs\", value: \"11px\" }, { id: \"size.line.lg\", value: \"24px\" }, { id: \"size.line.md\", value: \"20px\" }, { id: \"size.line.sm\", value: \"16px\" }, { id: \"size.line.xl\", value: \"32px\" }, { id: \"size.line.xs\", value: \"14px\" }, { id: \"size.space.lg\", value: \"12px\" }, { id: \"size.space.md\", value: \"8px\" }, { id: \"size.space.sm\", value: \"4px\" }, { id: \"size.space.xl\", value: \"24px\" }, { id: \"size.space.xs\", value: \"2px\" }, { id: \"size.target.comfortable\", value: \"44px\" }, { id: \"size.target.compact\", value: \"24px\" }, { id: \"size.target.natural\", value: \"32px\" }, { id: \"space.inline.lg\", value: \"12px\" }, { id: \"space.inline.md\", value: \"8px\" }, { id: \"space.inline.sm\", value: \"4px\" }, { id: \"space.layout.md\", value: \"24px\" }, { id: \"space.layout.sm\", value: \"12px\" }, { id: \"space.stack.md\", value: \"12px\" }, { id: \"space.stack.sm\", value: \"8px\" }, { id: \"space.stack.xs\", value: \"4px\" }, { id: \"type.body.md.line\", value: \"20px\" }, { id: \"type.body.md.size\", value: \"14px\" }, { id: \"type.body.md.weight\", value: \"400\" }, { id: \"type.caption.xs.line\", value: \"16px\" }, { id: \"type.caption.xs.size\", value: \"12px\" }, { id: \"type.caption.xs.weight\", value: \"400\" }, { id: \"type.label.sm.line\", value: \"16px\" }, { id: \"type.label.sm.size\", value: \"13px\" }, { id: \"type.label.sm.weight\", value: \"500\" }, { id: \"type.title.md.line\", value: \"32px\" }, { id: \"type.title.md.size\", value: \"24px\" }, { id: \"type.title.md.weight\", value: \"600\" }, { id: \"type.title.sm.line\", value: \"24px\" }, { id: \"type.title.sm.size\", value: \"18px\" }, { id: \"type.title.sm.weight\", value: \"600\" }, { id: \"weight.light\", value: \"100\" }, { id: \"weight.medium\", value: \"500\" }, { id: \"weight.regular\", value: \"400\" }, { id: \"weight.semibold\", value: \"600\" }, { id: \"z-index.base\", value: \"0\" }, { id: \"z-index.modal\", value: \"300\" }, { id: \"z-index.overlay\", value: \"100\" }, { id: \"z-index.popover\", value: \"200\" }, { id: \"z-index.raised\", value: \"1\" }, { id: \"z-index.sticky\", value: \"10\" }, { id: \"z-index.toast\", value: \"400\" }, ], \"high-contrast\": [ { id: \"color.action.danger.background\", value: \"#A30000\" }, { id: \"color.action.danger.hover\", value: \"#8A0000\" }, { id: \"color.action.danger.pressed\", value: \"#700000\" }, { id: \"color.action.danger.text\", value: \"#ffffff\" }, { id: \"color.action.primary.background\", value: \"#000000\" }, { id: \"color.action.primary.hover\", value: \"#333333\" }, { id: \"color.action.primary.pressed\", value: \"#4D4D4D\" }, { id: \"color.action.primary.text\", value: \"#ffffff\" }, { id: \"color.action.secondary.background\", value: \"#ffffff\" }, { id: \"color.action.secondary.border\", value: \"#000000\" }, { id: \"color.action.secondary.hover\", value: \"#E6E6E6\" }, { id: \"color.action.secondary.pressed\", value: \"#CCCCCC\" }, { id: \"color.action.secondary.text\", value: \"#000000\" }, { id: \"color.border.strong\", value: \"#000000\" }, { id: \"color.border.subtle\", value: \"#595959\" }, { id: \"color.control.selected.background\", value: \"#E0E0E0\" }, { id: \"color.control.selected.border\", value: \"#000000\" }, { id: \"color.control.selected.foreground\", value: \"#000000\" }, { id: \"color.field.background\", value: \"#ffffff\" }, { id: \"color.field.background.readonly\", value: \"#F2F2F2\" }, { id: \"color.field.border\", value: \"#595959\" }, { id: \"color.field.border.focus\", value: \"#000000\" }, { id: \"color.field.border.hover\", value: \"#000000\" }, { id: \"color.field.border.invalid\", value: \"#A30000\" }, { id: \"color.field.placeholder\", value: \"#3D3D3D\" }, { id: \"color.field.text\", value: \"#000000\" }, { id: \"color.focus.ring\", value: \"#000000\" }, { id: \"color.state.danger.background\", value: \"#ffffff\" }, { id: \"color.state.danger.border\", value: \"#A30000\" }, { id: \"color.state.danger.foreground\", value: \"#A30000\" }, { id: \"color.state.danger.text\", value: \"#A30000\" }, { id: \"color.state.success.background\", value: \"#ffffff\" }, { id: \"color.state.success.border\", value: \"#0B5A1E\" }, { id: \"color.state.success.foreground\", value: \"#0B5A1E\" }, { id: \"color.state.success.text\", value: \"#0B5A1E\" }, { id: \"color.state.warning.background\", value: \"#ffffff\" }, { id: \"color.state.warning.border\", value: \"#6B3200\" }, { id: \"color.state.warning.text\", value: \"#6B3200\" }, { id: \"color.surface.card\", value: \"#ffffff\" }, { id: \"color.surface.floating\", value: \"#ffffff\" }, { id: \"color.surface.highlight\", value: \"#ffffff\" }, { id: \"color.surface.page\", value: \"#ffffff\" }, { id: \"color.surface.pressed\", value: \"#E6E6E6\" }, { id: \"color.surface.selected\", value: \"#E0E0E0\" }, { id: \"color.surface.subtle\", value: \"#F2F2F2\" }, { id: \"color.text.muted\", value: \"#3D3D3D\" }, { id: \"color.text.primary\", value: \"#000000\" }, { id: \"color.text.secondary\", value: \"#1F1F1F\" }, { id: \"duration.base\", value: \"180ms\" }, { id: \"duration.fast\", value: \"120ms\" }, { id: \"duration.slow\", value: \"280ms\" }, { id: \"easing.emphasized\", value: \"cubic-bezier(0.16, 1, 0.3, 1)\" }, { id: \"easing.standard\", value: \"cubic-bezier(0.2, 0, 0, 1)\" }, { id: \"font.family.body\", value: \"\\\"Inter\\\", system-ui, sans-serif\" }, { id: \"font.family.heading\", value: \"\\\"Space Grotesk\\\", \\\"Segoe UI\\\", system-ui, sans-serif\" }, { id: \"font.family.mono\", value: \"\\\"IBM Plex Mono\\\", ui-monospace, Consolas, monospace\" }, { id: \"radius.lg\", value: \"12px\" }, { id: \"radius.md\", value: \"8px\" }, { id: \"radius.round\", value: \"9999px\" }, { id: \"radius.sm\", value: \"4px\" }, { id: \"shadow.card\", value: \"0 0 0 1px #000000\" }, { id: \"shadow.control\", value: \"0 0 0 1px #000000\" }, { id: \"shadow.floating\", value: \"0 0 0 2px #000000\" }, { id: \"shadow.well\", value: \"inset 0 0 0 0 #000000\" }, { id: \"size.focus-ring.width\", value: \"2px\" }, { id: \"size.font.lg\", value: \"18px\" }, { id: \"size.font.md\", value: \"14px\" }, { id: \"size.font.sm\", value: \"12px\" }, { id: \"size.font.xl\", value: \"24px\" }, { id: \"size.font.xs\", value: \"11px\" }, { id: \"size.line.lg\", value: \"24px\" }, { id: \"size.line.md\", value: \"20px\" }, { id: \"size.line.sm\", value: \"16px\" }, { id: \"size.line.xl\", value: \"32px\" }, { id: \"size.line.xs\", value: \"14px\" }, { id: \"size.space.lg\", value: \"12px\" }, { id: \"size.space.md\", value: \"8px\" }, { id: \"size.space.sm\", value: \"4px\" }, { id: \"size.space.xl\", value: \"24px\" }, { id: \"size.space.xs\", value: \"2px\" }, { id: \"size.target.comfortable\", value: \"44px\" }, { id: \"size.target.compact\", value: \"24px\" }, { id: \"size.target.natural\", value: \"32px\" }, { id: \"space.inline.lg\", value: \"12px\" }, { id: \"space.inline.md\", value: \"8px\" }, { id: \"space.inline.sm\", value: \"4px\" }, { id: \"space.layout.md\", value: \"24px\" }, { id: \"space.layout.sm\", value: \"12px\" }, { id: \"space.stack.md\", value: \"12px\" }, { id: \"space.stack.sm\", value: \"8px\" }, { id: \"space.stack.xs\", value: \"4px\" }, { id: \"type.body.md.line\", value: \"20px\" }, { id: \"type.body.md.size\", value: \"14px\" }, { id: \"type.body.md.weight\", value: \"400\" }, { id: \"type.caption.xs.line\", value: \"16px\" }, { id: \"type.caption.xs.size\", value: \"12px\" }, { id: \"type.caption.xs.weight\", value: \"400\" }, { id: \"type.label.sm.line\", value: \"16px\" }, { id: \"type.label.sm.size\", value: \"13px\" }, { id: \"type.label.sm.weight\", value: \"500\" }, { id: \"type.title.md.line\", value: \"32px\" }, { id: \"type.title.md.size\", value: \"24px\" }, { id: \"type.title.md.weight\", value: \"600\" }, { id: \"type.title.sm.line\", value: \"24px\" }, { id: \"type.title.sm.size\", value: \"18px\" }, { id: \"type.title.sm.weight\", value: \"600\" }, { id: \"weight.light\", value: \"100\" }, { id: \"weight.medium\", value: \"500\" }, { id: \"weight.regular\", value: \"400\" }, { id: \"weight.semibold\", value: \"600\" }, { id: \"z-index.base\", value: \"0\" }, { id: \"z-index.modal\", value: \"300\" }, { id: \"z-index.overlay\", value: \"100\" }, { id: \"z-index.popover\", value: \"200\" }, { id: \"z-index.raised\", value: \"1\" }, { id: \"z-index.sticky\", value: \"10\" }, { id: \"z-index.toast\", value: \"400\" }, ], }, } as const satisfies VioletThemeSet",
|
|
39443
|
+
"default": "{ defaultPreset: \"light\", presets: { \"light\": [ { id: \"color.action.danger.background\", value: \"#c42a1a\" }, { id: \"color.action.danger.hover\", value: \"#ad2416\" }, { id: \"color.action.danger.pressed\", value: \"#96200f\" }, { id: \"color.action.danger.text\", value: \"#ffffff\" }, { id: \"color.action.primary.background\", value: \"#181b1a\" }, { id: \"color.action.primary.hover\", value: \"#2e3a33\" }, { id: \"color.action.primary.pressed\", value: \"#252e29\" }, { id: \"color.action.primary.text\", value: \"#f4f0ea\" }, { id: \"color.action.secondary.background\", value: \"rgba(24, 27, 26, 0.07)\" }, { id: \"color.action.secondary.border\", value: \"transparent\" }, { id: \"color.action.secondary.hover\", value: \"rgba(24, 27, 26, 0.11)\" }, { id: \"color.action.secondary.pressed\", value: \"rgba(24, 27, 26, 0.15)\" }, { id: \"color.action.secondary.text\", value: \"#181b1a\" }, { id: \"color.border.strong\", value: \"#6b7d6e\" }, { id: \"color.border.subtle\", value: \"rgba(24, 27, 26, 0.10)\" }, { id: \"color.control.selected.background\", value: \"#badecf\" }, { id: \"color.control.selected.border\", value: \"rgba(44, 94, 75, 0.5)\" }, { id: \"color.control.selected.foreground\", value: \"#2c5e4b\" }, { id: \"color.field.background\", value: \"#ffffff\" }, { id: \"color.field.background.readonly\", value: \"rgba(24, 27, 26, 0.05)\" }, { id: \"color.field.border\", value: \"#869089\" }, { id: \"color.field.border.focus\", value: \"#146ba0\" }, { id: \"color.field.border.hover\", value: \"#48534b\" }, { id: \"color.field.border.invalid\", value: \"#c42a1a\" }, { id: \"color.field.placeholder\", value: \"#5e6460\" }, { id: \"color.field.text\", value: \"#181b1a\" }, { id: \"color.focus.ring\", value: \"#146ba0\" }, { id: \"color.state.danger.background\", value: \"#f7e4df\" }, { id: \"color.state.danger.border\", value: \"transparent\" }, { id: \"color.state.danger.foreground\", value: \"#c42a1a\" }, { id: \"color.state.danger.text\", value: \"#c42a1a\" }, { id: \"color.state.success.background\", value: \"#dfeae3\" }, { id: \"color.state.success.border\", value: \"transparent\" }, { id: \"color.state.success.foreground\", value: \"#2c5e4b\" }, { id: \"color.state.success.text\", value: \"#2c5e4b\" }, { id: \"color.state.warning.background\", value: \"#f3e8d2\" }, { id: \"color.state.warning.border\", value: \"transparent\" }, { id: \"color.state.warning.text\", value: \"#92400e\" }, { id: \"color.surface.card\", value: \"#f8f9f3\" }, { id: \"color.surface.floating\", value: \"#ffffff\" }, { id: \"color.surface.highlight\", value: \"#ffffff\" }, { id: \"color.surface.page\", value: \"#f4f0ea\" }, { id: \"color.surface.pressed\", value: \"#d8dcd6\" }, { id: \"color.surface.selected\", value: \"#dfeae3\" }, { id: \"color.surface.subtle\", value: \"#e9e5de\" }, { id: \"color.text.muted\", value: \"#5e6460\" }, { id: \"color.text.primary\", value: \"#181b1a\" }, { id: \"color.text.secondary\", value: \"#48534b\" }, { id: \"duration.base\", value: \"180ms\" }, { id: \"duration.fast\", value: \"120ms\" }, { id: \"duration.slow\", value: \"280ms\" }, { id: \"easing.emphasized\", value: \"cubic-bezier(0.16, 1, 0.3, 1)\" }, { id: \"easing.standard\", value: \"cubic-bezier(0.2, 0, 0, 1)\" }, { id: \"font.family.body\", value: \"\\\"Inter\\\", system-ui, sans-serif\" }, { id: \"font.family.heading\", value: \"\\\"Space Grotesk\\\", \\\"Segoe UI\\\", system-ui, sans-serif\" }, { id: \"font.family.mono\", value: \"\\\"IBM Plex Mono\\\", ui-monospace, Consolas, monospace\" }, { id: \"radius.lg\", value: \"12px\" }, { id: \"radius.md\", value: \"8px\" }, { id: \"radius.round\", value: \"9999px\" }, { id: \"radius.sm\", value: \"4px\" }, { id: \"shadow.card\", value: \"0 0 0 1px rgba(24, 27, 26, 0.06), 0 1px 2px rgba(24, 27, 26, 0.06), 0 4px 10px -2px rgba(24, 27, 26, 0.06)\" }, { id: \"shadow.control\", value: \"0 0 0 1px rgba(24, 27, 26, 0.05), 0 1px 2px rgba(24, 27, 26, 0.10)\" }, { id: \"shadow.floating\", value: \"0 0 0 1px rgba(24, 27, 26, 0.08), 0 4px 12px -2px rgba(24, 27, 26, 0.12), 0 18px 40px -8px rgba(24, 27, 26, 0.20)\" }, { id: \"shadow.well\", value: \"inset 0 2px 3px -1px rgba(0, 0, 0, 0.1)\" }, { id: \"size.focus-ring.width\", value: \"2px\" }, { id: \"size.font.lg\", value: \"18px\" }, { id: \"size.font.md\", value: \"14px\" }, { id: \"size.font.sm\", value: \"12px\" }, { id: \"size.font.xl\", value: \"24px\" }, { id: \"size.font.xs\", value: \"11px\" }, { id: \"size.line.lg\", value: \"24px\" }, { id: \"size.line.md\", value: \"20px\" }, { id: \"size.line.sm\", value: \"16px\" }, { id: \"size.line.xl\", value: \"32px\" }, { id: \"size.line.xs\", value: \"14px\" }, { id: \"size.space.lg\", value: \"12px\" }, { id: \"size.space.md\", value: \"8px\" }, { id: \"size.space.sm\", value: \"4px\" }, { id: \"size.space.xl\", value: \"24px\" }, { id: \"size.space.xs\", value: \"2px\" }, { id: \"size.target.comfortable\", value: \"44px\" }, { id: \"size.target.compact\", value: \"24px\" }, { id: \"size.target.natural\", value: \"32px\" }, { id: \"space.inline.lg\", value: \"12px\" }, { id: \"space.inline.md\", value: \"8px\" }, { id: \"space.inline.sm\", value: \"4px\" }, { id: \"space.layout.md\", value: \"24px\" }, { id: \"space.layout.sm\", value: \"12px\" }, { id: \"space.stack.md\", value: \"12px\" }, { id: \"space.stack.sm\", value: \"8px\" }, { id: \"space.stack.xs\", value: \"4px\" }, { id: \"type.body.md.line\", value: \"20px\" }, { id: \"type.body.md.size\", value: \"14px\" }, { id: \"type.body.md.weight\", value: \"400\" }, { id: \"type.caption.xs.line\", value: \"16px\" }, { id: \"type.caption.xs.size\", value: \"12px\" }, { id: \"type.caption.xs.weight\", value: \"400\" }, { id: \"type.label.sm.line\", value: \"16px\" }, { id: \"type.label.sm.size\", value: \"13px\" }, { id: \"type.label.sm.weight\", value: \"500\" }, { id: \"type.title.md.line\", value: \"32px\" }, { id: \"type.title.md.size\", value: \"24px\" }, { id: \"type.title.md.weight\", value: \"600\" }, { id: \"type.title.sm.line\", value: \"24px\" }, { id: \"type.title.sm.size\", value: \"18px\" }, { id: \"type.title.sm.weight\", value: \"600\" }, { id: \"weight.light\", value: \"100\" }, { id: \"weight.medium\", value: \"500\" }, { id: \"weight.regular\", value: \"400\" }, { id: \"weight.semibold\", value: \"600\" }, { id: \"z-index.base\", value: \"0\" }, { id: \"z-index.modal\", value: \"300\" }, { id: \"z-index.overlay\", value: \"100\" }, { id: \"z-index.popover\", value: \"200\" }, { id: \"z-index.raised\", value: \"1\" }, { id: \"z-index.sticky\", value: \"10\" }, { id: \"z-index.toast\", value: \"400\" }, ], \"dark\": [ { id: \"color.action.danger.background\", value: \"#c42a1a\" }, { id: \"color.action.danger.hover\", value: \"#ad2416\" }, { id: \"color.action.danger.pressed\", value: \"#96200f\" }, { id: \"color.action.danger.text\", value: \"#ffffff\" }, { id: \"color.action.primary.background\", value: \"#f4f0ea\" }, { id: \"color.action.primary.hover\", value: \"#d8dcd6\" }, { id: \"color.action.primary.pressed\", value: \"#bec6bd\" }, { id: \"color.action.primary.text\", value: \"#141515\" }, { id: \"color.action.secondary.background\", value: \"rgba(244, 240, 234, 0.09)\" }, { id: \"color.action.secondary.border\", value: \"transparent\" }, { id: \"color.action.secondary.hover\", value: \"rgba(244, 240, 234, 0.13)\" }, { id: \"color.action.secondary.pressed\", value: \"rgba(244, 240, 234, 0.17)\" }, { id: \"color.action.secondary.text\", value: \"#f4f0ea\" }, { id: \"color.border.strong\", value: \"#999e9b\" }, { id: \"color.border.subtle\", value: \"rgba(244, 240, 234, 0.10)\" }, { id: \"color.control.selected.background\", value: \"#1b2823\" }, { id: \"color.control.selected.border\", value: \"rgba(163, 235, 205, 0.45)\" }, { id: \"color.control.selected.foreground\", value: \"#a3ebcd\" }, { id: \"color.field.background\", value: \"rgba(0, 0, 0, 0.26)\" }, { id: \"color.field.background.readonly\", value: \"rgba(244, 240, 234, 0.06)\" }, { id: \"color.field.border\", value: \"#767b78\" }, { id: \"color.field.border.focus\", value: \"#a3ebcd\" }, { id: \"color.field.border.hover\", value: \"#999e9b\" }, { id: \"color.field.border.invalid\", value: \"#ff897a\" }, { id: \"color.field.placeholder\", value: \"#999e9b\" }, { id: \"color.field.text\", value: \"#f4f0ea\" }, { id: \"color.focus.ring\", value: \"#a3ebcd\" }, { id: \"color.state.danger.background\", value: \"#3d211d\" }, { id: \"color.state.danger.border\", value: \"transparent\" }, { id: \"color.state.danger.foreground\", value: \"#ff897a\" }, { id: \"color.state.danger.text\", value: \"#ffab99\" }, { id: \"color.state.success.background\", value: \"#1b2823\" }, { id: \"color.state.success.border\", value: \"transparent\" }, { id: \"color.state.success.foreground\", value: \"#a3ebcd\" }, { id: \"color.state.success.text\", value: \"#a3ebcd\" }, { id: \"color.state.warning.background\", value: \"#3a2b18\" }, { id: \"color.state.warning.border\", value: \"transparent\" }, { id: \"color.state.warning.text\", value: \"#f3d6a3\" }, { id: \"color.surface.card\", value: \"#1b1c1c\" }, { id: \"color.surface.floating\", value: \"#252727\" }, { id: \"color.surface.highlight\", value: \"#333333\" }, { id: \"color.surface.page\", value: \"#141515\" }, { id: \"color.surface.pressed\", value: \"rgba(244, 240, 234, 0.14)\" }, { id: \"color.surface.selected\", value: \"#1b2823\" }, { id: \"color.surface.subtle\", value: \"#202222\" }, { id: \"color.text.muted\", value: \"#999e9b\" }, { id: \"color.text.primary\", value: \"#f4f0ea\" }, { id: \"color.text.secondary\", value: \"#CCCCCC\" }, { id: \"duration.base\", value: \"180ms\" }, { id: \"duration.fast\", value: \"120ms\" }, { id: \"duration.slow\", value: \"280ms\" }, { id: \"easing.emphasized\", value: \"cubic-bezier(0.16, 1, 0.3, 1)\" }, { id: \"easing.standard\", value: \"cubic-bezier(0.2, 0, 0, 1)\" }, { id: \"font.family.body\", value: \"\\\"Inter\\\", system-ui, sans-serif\" }, { id: \"font.family.heading\", value: \"\\\"Space Grotesk\\\", \\\"Segoe UI\\\", system-ui, sans-serif\" }, { id: \"font.family.mono\", value: \"\\\"IBM Plex Mono\\\", ui-monospace, Consolas, monospace\" }, { id: \"radius.lg\", value: \"12px\" }, { id: \"radius.md\", value: \"8px\" }, { id: \"radius.round\", value: \"9999px\" }, { id: \"radius.sm\", value: \"4px\" }, { id: \"shadow.card\", value: \"0 0 0 1px rgba(244, 240, 234, 0.07), 0 1px 2px rgba(0, 0, 0, 0.32), 0 6px 14px -2px rgba(0, 0, 0, 0.30)\" }, { id: \"shadow.control\", value: \"0 0 0 1px rgba(244, 240, 234, 0.07), 0 1px 2px rgba(0, 0, 0, 0.40)\" }, { id: \"shadow.floating\", value: \"0 0 0 1px rgba(244, 240, 234, 0.13), 0 6px 16px -2px rgba(0, 0, 0, 0.45), 0 22px 48px -8px rgba(0, 0, 0, 0.60)\" }, { id: \"shadow.well\", value: \"inset 0 2px 3px -1px rgba(0, 0, 0, 0.28)\" }, { id: \"size.focus-ring.width\", value: \"2px\" }, { id: \"size.font.lg\", value: \"18px\" }, { id: \"size.font.md\", value: \"14px\" }, { id: \"size.font.sm\", value: \"12px\" }, { id: \"size.font.xl\", value: \"24px\" }, { id: \"size.font.xs\", value: \"11px\" }, { id: \"size.line.lg\", value: \"24px\" }, { id: \"size.line.md\", value: \"20px\" }, { id: \"size.line.sm\", value: \"16px\" }, { id: \"size.line.xl\", value: \"32px\" }, { id: \"size.line.xs\", value: \"14px\" }, { id: \"size.space.lg\", value: \"12px\" }, { id: \"size.space.md\", value: \"8px\" }, { id: \"size.space.sm\", value: \"4px\" }, { id: \"size.space.xl\", value: \"24px\" }, { id: \"size.space.xs\", value: \"2px\" }, { id: \"size.target.comfortable\", value: \"44px\" }, { id: \"size.target.compact\", value: \"24px\" }, { id: \"size.target.natural\", value: \"32px\" }, { id: \"space.inline.lg\", value: \"12px\" }, { id: \"space.inline.md\", value: \"8px\" }, { id: \"space.inline.sm\", value: \"4px\" }, { id: \"space.layout.md\", value: \"24px\" }, { id: \"space.layout.sm\", value: \"12px\" }, { id: \"space.stack.md\", value: \"12px\" }, { id: \"space.stack.sm\", value: \"8px\" }, { id: \"space.stack.xs\", value: \"4px\" }, { id: \"type.body.md.line\", value: \"20px\" }, { id: \"type.body.md.size\", value: \"14px\" }, { id: \"type.body.md.weight\", value: \"400\" }, { id: \"type.caption.xs.line\", value: \"16px\" }, { id: \"type.caption.xs.size\", value: \"12px\" }, { id: \"type.caption.xs.weight\", value: \"400\" }, { id: \"type.label.sm.line\", value: \"16px\" }, { id: \"type.label.sm.size\", value: \"13px\" }, { id: \"type.label.sm.weight\", value: \"500\" }, { id: \"type.title.md.line\", value: \"32px\" }, { id: \"type.title.md.size\", value: \"24px\" }, { id: \"type.title.md.weight\", value: \"600\" }, { id: \"type.title.sm.line\", value: \"24px\" }, { id: \"type.title.sm.size\", value: \"18px\" }, { id: \"type.title.sm.weight\", value: \"600\" }, { id: \"weight.light\", value: \"100\" }, { id: \"weight.medium\", value: \"500\" }, { id: \"weight.regular\", value: \"400\" }, { id: \"weight.semibold\", value: \"600\" }, { id: \"z-index.base\", value: \"0\" }, { id: \"z-index.modal\", value: \"300\" }, { id: \"z-index.overlay\", value: \"100\" }, { id: \"z-index.popover\", value: \"200\" }, { id: \"z-index.raised\", value: \"1\" }, { id: \"z-index.sticky\", value: \"10\" }, { id: \"z-index.toast\", value: \"400\" }, ], \"high-contrast\": [ { id: \"color.action.danger.background\", value: \"#A30000\" }, { id: \"color.action.danger.hover\", value: \"#8A0000\" }, { id: \"color.action.danger.pressed\", value: \"#700000\" }, { id: \"color.action.danger.text\", value: \"#ffffff\" }, { id: \"color.action.primary.background\", value: \"#000000\" }, { id: \"color.action.primary.hover\", value: \"#333333\" }, { id: \"color.action.primary.pressed\", value: \"#4D4D4D\" }, { id: \"color.action.primary.text\", value: \"#ffffff\" }, { id: \"color.action.secondary.background\", value: \"#ffffff\" }, { id: \"color.action.secondary.border\", value: \"#000000\" }, { id: \"color.action.secondary.hover\", value: \"#E6E6E6\" }, { id: \"color.action.secondary.pressed\", value: \"#CCCCCC\" }, { id: \"color.action.secondary.text\", value: \"#000000\" }, { id: \"color.border.strong\", value: \"#000000\" }, { id: \"color.border.subtle\", value: \"#595959\" }, { id: \"color.control.selected.background\", value: \"#E0E0E0\" }, { id: \"color.control.selected.border\", value: \"#000000\" }, { id: \"color.control.selected.foreground\", value: \"#000000\" }, { id: \"color.field.background\", value: \"#ffffff\" }, { id: \"color.field.background.readonly\", value: \"#F2F2F2\" }, { id: \"color.field.border\", value: \"#595959\" }, { id: \"color.field.border.focus\", value: \"#000000\" }, { id: \"color.field.border.hover\", value: \"#000000\" }, { id: \"color.field.border.invalid\", value: \"#A30000\" }, { id: \"color.field.placeholder\", value: \"#3D3D3D\" }, { id: \"color.field.text\", value: \"#000000\" }, { id: \"color.focus.ring\", value: \"#000000\" }, { id: \"color.state.danger.background\", value: \"#ffffff\" }, { id: \"color.state.danger.border\", value: \"#A30000\" }, { id: \"color.state.danger.foreground\", value: \"#A30000\" }, { id: \"color.state.danger.text\", value: \"#A30000\" }, { id: \"color.state.success.background\", value: \"#ffffff\" }, { id: \"color.state.success.border\", value: \"#0B5A1E\" }, { id: \"color.state.success.foreground\", value: \"#0B5A1E\" }, { id: \"color.state.success.text\", value: \"#0B5A1E\" }, { id: \"color.state.warning.background\", value: \"#ffffff\" }, { id: \"color.state.warning.border\", value: \"#6B3200\" }, { id: \"color.state.warning.text\", value: \"#6B3200\" }, { id: \"color.surface.card\", value: \"#ffffff\" }, { id: \"color.surface.floating\", value: \"#ffffff\" }, { id: \"color.surface.highlight\", value: \"#ffffff\" }, { id: \"color.surface.page\", value: \"#ffffff\" }, { id: \"color.surface.pressed\", value: \"#E6E6E6\" }, { id: \"color.surface.selected\", value: \"#E0E0E0\" }, { id: \"color.surface.subtle\", value: \"#F2F2F2\" }, { id: \"color.text.muted\", value: \"#3D3D3D\" }, { id: \"color.text.primary\", value: \"#000000\" }, { id: \"color.text.secondary\", value: \"#1F1F1F\" }, { id: \"duration.base\", value: \"180ms\" }, { id: \"duration.fast\", value: \"120ms\" }, { id: \"duration.slow\", value: \"280ms\" }, { id: \"easing.emphasized\", value: \"cubic-bezier(0.16, 1, 0.3, 1)\" }, { id: \"easing.standard\", value: \"cubic-bezier(0.2, 0, 0, 1)\" }, { id: \"font.family.body\", value: \"\\\"Inter\\\", system-ui, sans-serif\" }, { id: \"font.family.heading\", value: \"\\\"Space Grotesk\\\", \\\"Segoe UI\\\", system-ui, sans-serif\" }, { id: \"font.family.mono\", value: \"\\\"IBM Plex Mono\\\", ui-monospace, Consolas, monospace\" }, { id: \"radius.lg\", value: \"12px\" }, { id: \"radius.md\", value: \"8px\" }, { id: \"radius.round\", value: \"9999px\" }, { id: \"radius.sm\", value: \"4px\" }, { id: \"shadow.card\", value: \"0 0 0 1px #000000\" }, { id: \"shadow.control\", value: \"0 0 0 1px #000000\" }, { id: \"shadow.floating\", value: \"0 0 0 2px #000000\" }, { id: \"shadow.well\", value: \"inset 0 0 0 0 #000000\" }, { id: \"size.focus-ring.width\", value: \"2px\" }, { id: \"size.font.lg\", value: \"18px\" }, { id: \"size.font.md\", value: \"14px\" }, { id: \"size.font.sm\", value: \"12px\" }, { id: \"size.font.xl\", value: \"24px\" }, { id: \"size.font.xs\", value: \"11px\" }, { id: \"size.line.lg\", value: \"24px\" }, { id: \"size.line.md\", value: \"20px\" }, { id: \"size.line.sm\", value: \"16px\" }, { id: \"size.line.xl\", value: \"32px\" }, { id: \"size.line.xs\", value: \"14px\" }, { id: \"size.space.lg\", value: \"12px\" }, { id: \"size.space.md\", value: \"8px\" }, { id: \"size.space.sm\", value: \"4px\" }, { id: \"size.space.xl\", value: \"24px\" }, { id: \"size.space.xs\", value: \"2px\" }, { id: \"size.target.comfortable\", value: \"44px\" }, { id: \"size.target.compact\", value: \"24px\" }, { id: \"size.target.natural\", value: \"32px\" }, { id: \"space.inline.lg\", value: \"12px\" }, { id: \"space.inline.md\", value: \"8px\" }, { id: \"space.inline.sm\", value: \"4px\" }, { id: \"space.layout.md\", value: \"24px\" }, { id: \"space.layout.sm\", value: \"12px\" }, { id: \"space.stack.md\", value: \"12px\" }, { id: \"space.stack.sm\", value: \"8px\" }, { id: \"space.stack.xs\", value: \"4px\" }, { id: \"type.body.md.line\", value: \"20px\" }, { id: \"type.body.md.size\", value: \"14px\" }, { id: \"type.body.md.weight\", value: \"400\" }, { id: \"type.caption.xs.line\", value: \"16px\" }, { id: \"type.caption.xs.size\", value: \"12px\" }, { id: \"type.caption.xs.weight\", value: \"400\" }, { id: \"type.label.sm.line\", value: \"16px\" }, { id: \"type.label.sm.size\", value: \"13px\" }, { id: \"type.label.sm.weight\", value: \"500\" }, { id: \"type.title.md.line\", value: \"32px\" }, { id: \"type.title.md.size\", value: \"24px\" }, { id: \"type.title.md.weight\", value: \"600\" }, { id: \"type.title.sm.line\", value: \"24px\" }, { id: \"type.title.sm.size\", value: \"18px\" }, { id: \"type.title.sm.weight\", value: \"600\" }, { id: \"weight.light\", value: \"100\" }, { id: \"weight.medium\", value: \"500\" }, { id: \"weight.regular\", value: \"400\" }, { id: \"weight.semibold\", value: \"600\" }, { id: \"z-index.base\", value: \"0\" }, { id: \"z-index.modal\", value: \"300\" }, { id: \"z-index.overlay\", value: \"100\" }, { id: \"z-index.popover\", value: \"200\" }, { id: \"z-index.raised\", value: \"1\" }, { id: \"z-index.sticky\", value: \"10\" }, { id: \"z-index.toast\", value: \"400\" }, ], }, } as const satisfies VioletThemeSet",
|
|
39423
39444
|
"description": "The built-in default theme set, installed when a product installs none of its own."
|
|
39424
39445
|
}
|
|
39425
39446
|
],
|
|
@@ -181,9 +181,26 @@ const styles = css `
|
|
|
181
181
|
color: CanvasText;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
.layout {
|
|
189
|
+
forced-color-adjust: none;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.title,
|
|
193
|
+
.content {
|
|
194
|
+
color: CanvasText;
|
|
195
|
+
}
|
|
196
|
+
|
|
184
197
|
.leading {
|
|
185
198
|
color: ButtonText;
|
|
186
199
|
}
|
|
200
|
+
|
|
201
|
+
slot {
|
|
202
|
+
forced-color-adjust: auto;
|
|
203
|
+
}
|
|
187
204
|
}
|
|
188
205
|
`;
|
|
189
206
|
const template = html `
|
|
@@ -255,11 +272,12 @@ export class VioletAlert extends FASTElement {
|
|
|
255
272
|
this.dismissible = false;
|
|
256
273
|
}
|
|
257
274
|
connectedCallback() {
|
|
258
|
-
|
|
275
|
+
// Before the first render, so the first alert of a tone draws its own icon, not the fallback.
|
|
259
276
|
registerSystemCheckmarkIcon();
|
|
260
277
|
registerSystemCloseIcon();
|
|
261
278
|
registerSystemDismissIcon();
|
|
262
279
|
registerSystemWarningIcon();
|
|
280
|
+
super.connectedCallback();
|
|
263
281
|
this.handleTitleSlotChange();
|
|
264
282
|
this.handleActionsSlotChange();
|
|
265
283
|
this.handleIconSlotChange();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"violet-alert.js","sourceRoot":"","sources":["../../src/alert/violet-alert.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,yBAAyB,CAAC;AACjC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,mCAAmC,CAAC;AAE3C,MAAM,MAAM,GAAG,GAAG,CAAA;MACZ,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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SAAS,EAAE,CAAC,CAAC,WAAW,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AAEhE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC;IACtC,MAAM,WAAW,CAAC,MAAM,CAAC,WAAW,EAAE;QAClC,IAAI,EAAE,cAAc;QACpB,QAAQ;QACR,MAAM;QACN,aAAa,EAAE;YACX,cAAc,EAAE,IAAI;SACvB;KACJ,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { FASTElement, attr, css, html, observable } from \"@lushly-dev/fast-element\";\n\nimport { violetSurfaceTokenDefaults } from \"../theme/violet-token-defaults\";\nimport { registerSystemCheckmarkIcon } from \"../icon/generated/icons/system-checkmark\";\nimport { registerSystemCloseIcon } from \"../icon/generated/icons/system-close\";\nimport { registerSystemDismissIcon } from \"../icon/generated/icons/system-dismiss\";\nimport { registerSystemWarningIcon } from \"../icon/generated/icons/system-warning\";\nimport \"../button/violet-button\";\nimport \"../card/violet-card\";\nimport \"../icon/violet-icon\";\nimport \"../icon-button/violet-icon-button\";\n\nconst styles = css`\n ${violetSurfaceTokenDefaults}\n\n :host {\n display: block;\n color: var(--_text-primary);\n --_alert-radius: var(--violet-alert-radius, var(--_radius-lg));\n --_alert-padding: var(--violet-alert-padding, var(--_space-md));\n --_alert-gap: var(--violet-alert-gap, var(--_space-sm));\n --_alert-icon-size: var(--violet-alert-icon-size, 1rem);\n --_alert-title-size: var(--violet-alert-title-size, var(--_body-size));\n --_alert-title-line: var(--violet-alert-title-line, var(--_body-line));\n --_alert-body-size: var(--violet-alert-body-size, var(--_body-size));\n --_alert-body-line: var(--violet-alert-body-line, var(--_body-line));\n --_alert-meta-size: var(--violet-alert-meta-size, var(--_caption-size));\n /* The tone is the fill, the icon and the words; a plain or info alert is the quiet surface. */\n --_alert-border: var(--violet-alert-border, transparent);\n --_alert-surface: var(--violet-alert-surface, var(--_surface-subtle));\n --_alert-emphasis: var(--violet-alert-emphasis, var(--_text-secondary));\n --_alert-shadow: var(--violet-alert-shadow, none);\n }\n\n :host([tone=\"info\"]) {\n --_alert-emphasis: var(--_text-secondary);\n }\n\n :host([tone=\"success\"]) {\n --_alert-surface: var(--color-state-success-background, #dfeae3);\n --_alert-border: var(--color-state-success-border, transparent);\n --_alert-emphasis: var(--color-state-success-text, #2c5e4b);\n }\n\n :host([tone=\"warning\"]) {\n --_alert-surface: var(--color-state-warning-background, #f3e8d2);\n --_alert-border: var(--color-state-warning-border, transparent);\n --_alert-emphasis: var(--color-state-warning-text, #92400E);\n }\n\n :host([tone=\"danger\"]) {\n --_alert-surface: var(--color-state-danger-background, #f7e4df);\n --_alert-border: var(--color-state-danger-border, transparent);\n --_alert-emphasis: var(--color-state-danger-text, #c42a1a);\n }\n\n .frame {\n --violet-card-radius: var(--_alert-radius);\n --violet-card-padding: var(--_alert-padding);\n --violet-card-background: var(--_alert-surface);\n --violet-card-border-color: var(--_alert-border);\n --violet-card-shadow: var(--_alert-shadow);\n }\n\n .layout {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr) auto;\n align-items: start;\n gap: var(--_alert-gap);\n }\n\n /* The icon alone, on the title's line. */\n .leading {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: var(--_alert-icon-size);\n block-size: var(--_alert-title-line);\n color: var(--_alert-emphasis);\n flex: 0 0 auto;\n }\n\n .leading[hidden] {\n display: none;\n }\n\n .leading ::slotted(violet-icon) {\n --violet-icon-size: var(--_alert-icon-size);\n color: currentColor;\n }\n\n .icon-slot {\n display: contents;\n }\n\n .body {\n display: grid;\n gap: var(--_space-stack-2xs);\n min-inline-size: 0;\n font-size: var(--_alert-body-size);\n line-height: var(--_alert-body-line);\n }\n\n .copy {\n display: grid;\n gap: var(--_space-stack-2xs);\n min-inline-size: 0;\n }\n\n .title {\n margin: 0;\n color: var(--_alert-emphasis);\n font-size: var(--_alert-title-size);\n line-height: var(--_alert-title-line);\n font-weight: 500;\n }\n\n .title[hidden] {\n display: none;\n }\n\n .content {\n display: grid;\n gap: var(--_space-stack-2xs);\n color: var(--_text-primary);\n }\n\n .content slot::slotted(*) {\n margin: 0;\n }\n\n .actions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--_space-sm);\n margin-block-start: var(--_space-stack-xs);\n }\n\n .actions[hidden] {\n display: none;\n }\n\n .actions slot::slotted(*) {\n margin: 0;\n }\n\n /* The button is centred on the title's line and sits out to the alert's inset. */\n .dismiss {\n flex: 0 0 auto;\n margin-block-start: calc((var(--_alert-title-line) - var(--size-target-natural, 32px)) / 2);\n margin-inline-end: calc(var(--_space-stack-xs) * -1);\n color: var(--_alert-emphasis);\n }\n\n .dismiss[hidden] {\n display: none;\n }\n\n @media (max-width: 480px) {\n .layout {\n grid-template-columns: auto minmax(0, 1fr);\n }\n\n .dismiss {\n grid-column: 2;\n justify-self: end;\n margin-block-start: 0;\n }\n }\n\n @media (forced-colors: active) {\n .frame::part(root) {\n forced-color-adjust: none;\n border-color: ButtonText;\n background: Canvas;\n color: CanvasText;\n }\n\n .leading {\n color: ButtonText;\n }\n }\n`;\n\nconst template = html<VioletAlert>`\n <violet-card class=\"frame\" part=\"root\" appearance=\"outline\" padding=\"medium\">\n <div class=\"layout\" part=\"layout\">\n <span class=\"leading\" part=\"icon\" ?hidden=\"${x => !x.showLeading}\">\n <slot class=\"icon-slot\" name=\"icon\" @slotchange=\"${x => x.handleIconSlotChange()}\"></slot>\n ${x => (x.hasIcon ? html`` : x.defaultIconTemplate)}\n </span>\n\n <div class=\"body\" part=\"body\">\n <div\n class=\"copy\"\n part=\"copy\"\n role=\"${x => x.liveRegionRole || null}\"\n aria-live=\"${x => x.liveRegionPoliteness || null}\"\n >\n <p class=\"title\" part=\"title\" ?hidden=\"${x => !x.hasTitle}\">\n <slot name=\"title\" @slotchange=\"${x => x.handleTitleSlotChange()}\"></slot>\n </p>\n <div class=\"content\" part=\"content\">\n <slot></slot>\n </div>\n </div>\n <div class=\"actions\" part=\"actions\" ?hidden=\"${x => !x.hasActions}\">\n <slot name=\"actions\" @slotchange=\"${x => x.handleActionsSlotChange()}\"></slot>\n </div>\n </div>\n\n <violet-icon-button\n class=\"dismiss\"\n part=\"dismiss-button\"\n appearance=\"transparent\"\n label=\"Dismiss alert\"\n ?hidden=\"${x => !x.dismissible}\"\n @click=\"${x => x.handleDismiss()}\"\n >\n <violet-icon icon=\"system/close\" decorative></violet-icon>\n </violet-icon-button>\n </div>\n </violet-card>\n`;\n\n/**\n * Persistent inline or banner-style message surface.\n *\n * @summary Token-driven alert composed with Violet card, icon, and button primitives.\n * @fires dismiss - Emitted when the dismiss control is activated.\n * @slot icon - Optional leading icon that overrides the default tone icon.\n * @slot title - Optional alert heading.\n * @slot - Alert body content.\n * @slot actions - Optional action buttons or links.\n * @csspart root - The outer card surface.\n * @csspart layout - Internal layout wrapper.\n * @csspart icon - Leading icon container.\n * @csspart body - Text and actions wrapper.\n * @csspart title - Heading text wrapper.\n * @csspart content - Body content wrapper.\n * @csspart actions - Action row wrapper.\n * @csspart dismiss-button - Optional dismiss button.\n */\nexport class VioletAlert extends FASTElement {\n @observable\n declare public hasTitle: boolean;\n\n @observable\n declare public hasActions: boolean;\n\n @observable\n declare public hasIcon: boolean;\n\n declare public tone: string;\n declare public announcement: string;\n declare public dismissible: boolean;\n\n public constructor() {\n super();\n this.hasTitle = false;\n this.hasActions = false;\n this.hasIcon = false;\n this.tone = \"default\";\n this.announcement = \"off\";\n this.dismissible = false;\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n registerSystemCheckmarkIcon();\n registerSystemCloseIcon();\n registerSystemDismissIcon();\n registerSystemWarningIcon();\n this.handleTitleSlotChange();\n this.handleActionsSlotChange();\n this.handleIconSlotChange();\n }\n\n public get showLeading(): boolean {\n return this.hasIcon || this.tone === \"success\" || this.tone === \"warning\" || this.tone === \"danger\";\n }\n\n public get liveRegionRole(): \"alert\" | \"status\" | null {\n if (this.announcement === \"assertive\") {\n return \"alert\";\n }\n\n if (this.announcement === \"polite\") {\n return \"status\";\n }\n\n return null;\n }\n\n public get liveRegionPoliteness(): \"assertive\" | \"polite\" | null {\n if (this.announcement === \"assertive\") {\n return \"assertive\";\n }\n\n if (this.announcement === \"polite\") {\n return \"polite\";\n }\n\n return null;\n }\n\n public get defaultIconTemplate() {\n if (this.tone === \"success\") {\n return html`<violet-icon icon=\"system/checkmark\" decorative></violet-icon>`;\n }\n\n if (this.tone === \"danger\") {\n return html`<violet-icon icon=\"system/dismiss\" decorative></violet-icon>`;\n }\n\n if (this.tone === \"warning\") {\n return html`<violet-icon icon=\"system/warning\" decorative></violet-icon>`;\n }\n\n return html``;\n }\n\n public handleTitleSlotChange(): void {\n this.hasTitle = this.#slotHasContent('slot[name=\"title\"]');\n }\n\n public handleActionsSlotChange(): void {\n this.hasActions = this.#slotHasContent('slot[name=\"actions\"]');\n }\n\n public handleIconSlotChange(): void {\n this.hasIcon = this.#slotHasContent('slot[name=\"icon\"]');\n }\n\n public handleDismiss(): void {\n this.$emit(\"dismiss\");\n }\n\n #slotHasContent(selector: string): boolean {\n const slot = this.shadowRoot?.querySelector(selector) as HTMLSlotElement | null;\n return (slot?.assignedNodes({ flatten: true }) ?? []).some(node => {\n if (node.nodeType === Node.TEXT_NODE) {\n return Boolean(node.textContent?.trim());\n }\n return true;\n });\n }\n}\n\nexport type VioletAlertTone = \"default\" | \"info\" | \"success\" | \"warning\" | \"danger\";\nexport type VioletAlertAnnouncement = \"off\" | \"polite\" | \"assertive\";\n\nattr(VioletAlert.prototype, \"tone\");\nattr(VioletAlert.prototype, \"announcement\");\nattr({ mode: \"boolean\" })(VioletAlert.prototype, \"dismissible\");\n\nif (!customElements.get(\"violet-alert\")) {\n await FASTElement.define(VioletAlert, {\n name: \"violet-alert\",\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true,\n },\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"violet-alert.js","sourceRoot":"","sources":["../../src/alert/violet-alert.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,E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AAC,UAAU,EAAE,aAAa,CAAC,QAAQ,CAA2B,CAAC;QAChF,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC9D,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,EAAE,CAAC;gBACnC,OAAO,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;YAC7C,CAAC;YACD,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAvGkB;IADd,UAAU;6CACsB;AAGlB;IADd,UAAU;+CACwB;AAGpB;IADd,UAAU;4CACqB;AAsGpC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AACpC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;AAC5C,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AAEhE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC;IACtC,MAAM,WAAW,CAAC,MAAM,CAAC,WAAW,EAAE;QAClC,IAAI,EAAE,cAAc;QACpB,QAAQ;QACR,MAAM;QACN,aAAa,EAAE;YACX,cAAc,EAAE,IAAI;SACvB;KACJ,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { FASTElement, attr, css, html, observable } from \"@lushly-dev/fast-element\";\n\nimport { violetSurfaceTokenDefaults } from \"../theme/violet-token-defaults\";\nimport { registerSystemCheckmarkIcon } from \"../icon/generated/icons/system-checkmark\";\nimport { registerSystemCloseIcon } from \"../icon/generated/icons/system-close\";\nimport { registerSystemDismissIcon } from \"../icon/generated/icons/system-dismiss\";\nimport { registerSystemWarningIcon } from \"../icon/generated/icons/system-warning\";\nimport \"../button/violet-button\";\nimport \"../card/violet-card\";\nimport \"../icon/violet-icon\";\nimport \"../icon-button/violet-icon-button\";\n\nconst styles = css`\n ${violetSurfaceTokenDefaults}\n\n :host {\n display: block;\n color: var(--_text-primary);\n --_alert-radius: var(--violet-alert-radius, var(--_radius-lg));\n --_alert-padding: var(--violet-alert-padding, var(--_space-md));\n --_alert-gap: var(--violet-alert-gap, var(--_space-sm));\n --_alert-icon-size: var(--violet-alert-icon-size, 1rem);\n --_alert-title-size: var(--violet-alert-title-size, var(--_body-size));\n --_alert-title-line: var(--violet-alert-title-line, var(--_body-line));\n --_alert-body-size: var(--violet-alert-body-size, var(--_body-size));\n --_alert-body-line: var(--violet-alert-body-line, var(--_body-line));\n --_alert-meta-size: var(--violet-alert-meta-size, var(--_caption-size));\n /* The tone is the fill, the icon and the words; a plain or info alert is the quiet surface. */\n --_alert-border: var(--violet-alert-border, transparent);\n --_alert-surface: var(--violet-alert-surface, var(--_surface-subtle));\n --_alert-emphasis: var(--violet-alert-emphasis, var(--_text-secondary));\n --_alert-shadow: var(--violet-alert-shadow, none);\n }\n\n :host([tone=\"info\"]) {\n --_alert-emphasis: var(--_text-secondary);\n }\n\n :host([tone=\"success\"]) {\n --_alert-surface: var(--color-state-success-background, #dfeae3);\n --_alert-border: var(--color-state-success-border, transparent);\n --_alert-emphasis: var(--color-state-success-text, #2c5e4b);\n }\n\n :host([tone=\"warning\"]) {\n --_alert-surface: var(--color-state-warning-background, #f3e8d2);\n --_alert-border: var(--color-state-warning-border, transparent);\n --_alert-emphasis: var(--color-state-warning-text, #92400E);\n }\n\n :host([tone=\"danger\"]) {\n --_alert-surface: var(--color-state-danger-background, #f7e4df);\n --_alert-border: var(--color-state-danger-border, transparent);\n --_alert-emphasis: var(--color-state-danger-text, #c42a1a);\n }\n\n .frame {\n --violet-card-radius: var(--_alert-radius);\n --violet-card-padding: var(--_alert-padding);\n --violet-card-background: var(--_alert-surface);\n --violet-card-border-color: var(--_alert-border);\n --violet-card-shadow: var(--_alert-shadow);\n }\n\n .layout {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr) auto;\n align-items: start;\n gap: var(--_alert-gap);\n }\n\n /* The icon alone, on the title's line. */\n .leading {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: var(--_alert-icon-size);\n block-size: var(--_alert-title-line);\n color: var(--_alert-emphasis);\n flex: 0 0 auto;\n }\n\n .leading[hidden] {\n display: none;\n }\n\n .leading ::slotted(violet-icon) {\n --violet-icon-size: var(--_alert-icon-size);\n color: currentColor;\n }\n\n .icon-slot {\n display: contents;\n }\n\n .body {\n display: grid;\n gap: var(--_space-stack-2xs);\n min-inline-size: 0;\n font-size: var(--_alert-body-size);\n line-height: var(--_alert-body-line);\n }\n\n .copy {\n display: grid;\n gap: var(--_space-stack-2xs);\n min-inline-size: 0;\n }\n\n .title {\n margin: 0;\n color: var(--_alert-emphasis);\n font-size: var(--_alert-title-size);\n line-height: var(--_alert-title-line);\n font-weight: 500;\n }\n\n .title[hidden] {\n display: none;\n }\n\n .content {\n display: grid;\n gap: var(--_space-stack-2xs);\n color: var(--_text-primary);\n }\n\n .content slot::slotted(*) {\n margin: 0;\n }\n\n .actions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--_space-sm);\n margin-block-start: var(--_space-stack-xs);\n }\n\n .actions[hidden] {\n display: none;\n }\n\n .actions slot::slotted(*) {\n margin: 0;\n }\n\n /* The button is centred on the title's line and sits out to the alert's inset. */\n .dismiss {\n flex: 0 0 auto;\n margin-block-start: calc((var(--_alert-title-line) - var(--size-target-natural, 32px)) / 2);\n margin-inline-end: calc(var(--_space-stack-xs) * -1);\n color: var(--_alert-emphasis);\n }\n\n .dismiss[hidden] {\n display: none;\n }\n\n @media (max-width: 480px) {\n .layout {\n grid-template-columns: auto minmax(0, 1fr);\n }\n\n .dismiss {\n grid-column: 2;\n justify-self: end;\n margin-block-start: 0;\n }\n }\n\n @media (forced-colors: active) {\n .frame::part(root) {\n forced-color-adjust: none;\n border-color: ButtonText;\n background: Canvas;\n color: CanvasText;\n }\n\n /*\n * The frame's slot opts its content back in, so the layout, which the alert paints, opts out\n * again; what is slotted into the alert takes the system colours.\n */\n .layout {\n forced-color-adjust: none;\n }\n\n .title,\n .content {\n color: CanvasText;\n }\n\n .leading {\n color: ButtonText;\n }\n\n slot {\n forced-color-adjust: auto;\n }\n }\n`;\n\nconst template = html<VioletAlert>`\n <violet-card class=\"frame\" part=\"root\" appearance=\"outline\" padding=\"medium\">\n <div class=\"layout\" part=\"layout\">\n <span class=\"leading\" part=\"icon\" ?hidden=\"${x => !x.showLeading}\">\n <slot class=\"icon-slot\" name=\"icon\" @slotchange=\"${x => x.handleIconSlotChange()}\"></slot>\n ${x => (x.hasIcon ? html`` : x.defaultIconTemplate)}\n </span>\n\n <div class=\"body\" part=\"body\">\n <div\n class=\"copy\"\n part=\"copy\"\n role=\"${x => x.liveRegionRole || null}\"\n aria-live=\"${x => x.liveRegionPoliteness || null}\"\n >\n <p class=\"title\" part=\"title\" ?hidden=\"${x => !x.hasTitle}\">\n <slot name=\"title\" @slotchange=\"${x => x.handleTitleSlotChange()}\"></slot>\n </p>\n <div class=\"content\" part=\"content\">\n <slot></slot>\n </div>\n </div>\n <div class=\"actions\" part=\"actions\" ?hidden=\"${x => !x.hasActions}\">\n <slot name=\"actions\" @slotchange=\"${x => x.handleActionsSlotChange()}\"></slot>\n </div>\n </div>\n\n <violet-icon-button\n class=\"dismiss\"\n part=\"dismiss-button\"\n appearance=\"transparent\"\n label=\"Dismiss alert\"\n ?hidden=\"${x => !x.dismissible}\"\n @click=\"${x => x.handleDismiss()}\"\n >\n <violet-icon icon=\"system/close\" decorative></violet-icon>\n </violet-icon-button>\n </div>\n </violet-card>\n`;\n\n/**\n * Persistent inline or banner-style message surface.\n *\n * @summary Token-driven alert composed with Violet card, icon, and button primitives.\n * @fires dismiss - Emitted when the dismiss control is activated.\n * @slot icon - Optional leading icon that overrides the default tone icon.\n * @slot title - Optional alert heading.\n * @slot - Alert body content.\n * @slot actions - Optional action buttons or links.\n * @csspart root - The outer card surface.\n * @csspart layout - Internal layout wrapper.\n * @csspart icon - Leading icon container.\n * @csspart body - Text and actions wrapper.\n * @csspart title - Heading text wrapper.\n * @csspart content - Body content wrapper.\n * @csspart actions - Action row wrapper.\n * @csspart dismiss-button - Optional dismiss button.\n */\nexport class VioletAlert extends FASTElement {\n @observable\n declare public hasTitle: boolean;\n\n @observable\n declare public hasActions: boolean;\n\n @observable\n declare public hasIcon: boolean;\n\n declare public tone: string;\n declare public announcement: string;\n declare public dismissible: boolean;\n\n public constructor() {\n super();\n this.hasTitle = false;\n this.hasActions = false;\n this.hasIcon = false;\n this.tone = \"default\";\n this.announcement = \"off\";\n this.dismissible = false;\n }\n\n public connectedCallback(): void {\n // Before the first render, so the first alert of a tone draws its own icon, not the fallback.\n registerSystemCheckmarkIcon();\n registerSystemCloseIcon();\n registerSystemDismissIcon();\n registerSystemWarningIcon();\n super.connectedCallback();\n this.handleTitleSlotChange();\n this.handleActionsSlotChange();\n this.handleIconSlotChange();\n }\n\n public get showLeading(): boolean {\n return this.hasIcon || this.tone === \"success\" || this.tone === \"warning\" || this.tone === \"danger\";\n }\n\n public get liveRegionRole(): \"alert\" | \"status\" | null {\n if (this.announcement === \"assertive\") {\n return \"alert\";\n }\n\n if (this.announcement === \"polite\") {\n return \"status\";\n }\n\n return null;\n }\n\n public get liveRegionPoliteness(): \"assertive\" | \"polite\" | null {\n if (this.announcement === \"assertive\") {\n return \"assertive\";\n }\n\n if (this.announcement === \"polite\") {\n return \"polite\";\n }\n\n return null;\n }\n\n public get defaultIconTemplate() {\n if (this.tone === \"success\") {\n return html`<violet-icon icon=\"system/checkmark\" decorative></violet-icon>`;\n }\n\n if (this.tone === \"danger\") {\n return html`<violet-icon icon=\"system/dismiss\" decorative></violet-icon>`;\n }\n\n if (this.tone === \"warning\") {\n return html`<violet-icon icon=\"system/warning\" decorative></violet-icon>`;\n }\n\n return html``;\n }\n\n public handleTitleSlotChange(): void {\n this.hasTitle = this.#slotHasContent('slot[name=\"title\"]');\n }\n\n public handleActionsSlotChange(): void {\n this.hasActions = this.#slotHasContent('slot[name=\"actions\"]');\n }\n\n public handleIconSlotChange(): void {\n this.hasIcon = this.#slotHasContent('slot[name=\"icon\"]');\n }\n\n public handleDismiss(): void {\n this.$emit(\"dismiss\");\n }\n\n #slotHasContent(selector: string): boolean {\n const slot = this.shadowRoot?.querySelector(selector) as HTMLSlotElement | null;\n return (slot?.assignedNodes({ flatten: true }) ?? []).some(node => {\n if (node.nodeType === Node.TEXT_NODE) {\n return Boolean(node.textContent?.trim());\n }\n return true;\n });\n }\n}\n\nexport type VioletAlertTone = \"default\" | \"info\" | \"success\" | \"warning\" | \"danger\";\nexport type VioletAlertAnnouncement = \"off\" | \"polite\" | \"assertive\";\n\nattr(VioletAlert.prototype, \"tone\");\nattr(VioletAlert.prototype, \"announcement\");\nattr({ mode: \"boolean\" })(VioletAlert.prototype, \"dismissible\");\n\nif (!customElements.get(\"violet-alert\")) {\n await FASTElement.define(VioletAlert, {\n name: \"violet-alert\",\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true,\n },\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"violet-badge.js","sourceRoot":"","sources":["../../src/badge/violet-badge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAE9E,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAM5E,MAAM,MAAM,GAAG,GAAG,CAAA;MACZ,0BAA0B
|
|
1
|
+
{"version":3,"file":"violet-badge.js","sourceRoot":"","sources":["../../src/badge/violet-badge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MA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Element, attr, css, html, when } from \"@lushly-dev/fast-element\";\n\nimport \"../icon/violet-icon\";\nimport { violetSurfaceTokenDefaults } from \"../theme/violet-token-defaults\";\n\nexport type VioletBadgeAppearance = \"filled\" | \"outline\" | \"subtle\";\nexport type VioletBadgeColor = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\";\nexport type VioletBadgeSize = \"sm\" | \"md\" | \"lg\";\n\nconst styles = css`\n ${violetSurfaceTokenDefaults}\n\n :host {\n display: inline-flex;\n /* The tone is the fill and the words. A neutral badge is a wash of the text colour. */\n --_badge-bg: color-mix(in srgb, var(--_text-primary) 8%, transparent);\n --_badge-text: var(--_text-secondary);\n --_badge-padding-inline: var(--_space-md);\n --_badge-min-block: 1.25rem;\n --_badge-font-size: var(--_caption-size);\n --_badge-line-height: var(--_caption-line);\n }\n\n :host([size=\"sm\"]) {\n --_badge-padding-inline: var(--_space-sm);\n --_badge-min-block: 1.125rem;\n }\n\n :host([size=\"md\"]) {\n --_badge-padding-inline: var(--_space-md);\n --_badge-min-block: 1.25rem;\n }\n\n :host([size=\"lg\"]) {\n --_badge-padding-inline: var(--_space-lg);\n --_badge-min-block: 1.5rem;\n --_badge-font-size: var(--_body-size);\n --_badge-line-height: var(--_body-line);\n }\n\n :host([color=\"accent\"]) {\n --_badge-bg: var(--color-control-selected-background, #badecf);\n --_badge-text: var(--color-control-selected-foreground, #2c5e4b);\n }\n\n :host([color=\"success\"]) {\n --_badge-bg: var(--color-state-success-background, #dfeae3);\n --_badge-text: var(--color-state-success-text, #2c5e4b);\n }\n\n :host([color=\"warning\"]) {\n --_badge-bg: var(--color-state-warning-background, #f3e8d2);\n --_badge-text: var(--color-state-warning-text, #92400E);\n }\n\n :host([color=\"danger\"]) {\n --_badge-bg: var(--color-state-danger-background, #f7e4df);\n --_badge-text: var(--color-state-danger-text, #c42a1a);\n }\n\n .badge {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--_space-sm);\n min-block-size: var(--_badge-min-block);\n min-inline-size: var(--_badge-min-block);\n padding-inline: var(--_badge-padding-inline);\n border: 1px solid transparent;\n border-radius: calc(var(--_radius-md) - 2px);\n background: var(--_badge-bg);\n color: var(--_badge-text);\n font-size: var(--_badge-font-size);\n font-weight: var(--_type-label-weight);\n line-height: var(--_badge-line-height);\n white-space: nowrap;\n }\n\n /* An outline badge is the one place the outline is the point. */\n :host([appearance=\"outline\"]) .badge {\n background: transparent;\n border-color: color-mix(in srgb, currentColor 45%, transparent);\n }\n\n :host([appearance=\"subtle\"]) .badge {\n background: color-mix(in srgb, var(--_badge-bg) 65%, transparent);\n }\n\n .content {\n display: inline-flex;\n align-items: center;\n }\n\n .content::slotted(*) {\n margin: 0;\n }\n\n violet-icon {\n --violet-icon-size: 0.9em;\n }\n\n /* The second selector matches the appearance rules' specificity, so the system colours win for each. */\n @media (forced-colors: active) {\n .badge,\n :host([appearance]) .badge {\n forced-color-adjust: none;\n background: Canvas;\n color: CanvasText;\n border-color: ButtonText;\n }\n }\n`;\n\nconst template = html<VioletBadge>`\n <span class=\"badge\" part=\"badge\" aria-hidden=\"${x => (x.decorative ? \"true\" : \"false\")}\">\n ${when(\n x => Boolean(x.icon),\n html<VioletBadge>`\n <violet-icon icon=\"${x => x.icon}\" decorative=\"true\" part=\"icon\"></violet-icon>\n `\n )}\n <span class=\"content\" part=\"content\">\n <slot></slot>\n </span>\n </span>\n`;\n\n/**\n * Compact semantic badge for status, category, and count-like labeling.\n *\n * @summary Token-driven inline badge with semantic color and emphasis variants.\n * @slot - Badge text or short inline content.\n * @csspart badge - The outer pill surface.\n * @csspart icon - Optional leading icon.\n * @csspart content - Wrapper around slotted badge content.\n */\nexport class VioletBadge extends FASTElement {\n declare public appearance: VioletBadgeAppearance;\n declare public color: VioletBadgeColor;\n declare public size: VioletBadgeSize;\n declare public decorative: boolean;\n declare public icon: string;\n declare public label: string;\n\n public constructor() {\n super();\n this.label = \"\";\n this.appearance = \"filled\";\n this.color = \"neutral\";\n this.size = \"md\";\n this.decorative = false;\n this.icon = \"\";\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n this.syncAccessibilityState();\n }\n\n public decorativeChanged(): void {\n this.syncAccessibilityState();\n }\n\n public labelChanged(): void {\n this.syncAccessibilityState();\n }\n\n private syncAccessibilityState(): void {\n if (this.decorative) {\n this.setAttribute(\"aria-hidden\", \"true\");\n this.removeAttribute(\"aria-label\");\n this.removeAttribute(\"role\");\n return;\n }\n\n this.removeAttribute(\"aria-hidden\");\n\n const label = (this.label ?? \"\").trim();\n\n if (label) {\n this.setAttribute(\"role\", \"img\");\n this.setAttribute(\"aria-label\", label);\n return;\n }\n\n this.removeAttribute(\"role\");\n this.removeAttribute(\"aria-label\");\n }\n}\n\nattr(VioletBadge.prototype, \"appearance\");\nattr(VioletBadge.prototype, \"color\");\nattr(VioletBadge.prototype, \"size\");\nattr({ mode: \"boolean\" })(VioletBadge.prototype, \"decorative\");\nattr(VioletBadge.prototype, \"icon\");\nattr(VioletBadge.prototype, \"label\");\n\nif (!customElements.get(\"violet-badge\")) {\n await FASTElement.define(VioletBadge, {\n name: \"violet-badge\",\n template,\n styles,\n });\n}\n"]}
|
package/dist/card/violet-card.js
CHANGED
|
@@ -113,11 +113,17 @@ const styles = css `
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
@media (forced-colors: active) {
|
|
116
|
+
|
|
116
117
|
.root {
|
|
117
118
|
forced-color-adjust: none;
|
|
118
119
|
border: var(--_card-border-width) solid ButtonText;
|
|
119
120
|
background: Canvas;
|
|
120
121
|
box-shadow: none;
|
|
122
|
+
color: CanvasText;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
slot {
|
|
126
|
+
forced-color-adjust: auto;
|
|
121
127
|
}
|
|
122
128
|
|
|
123
129
|
.header,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"violet-card.js","sourceRoot":"","sources":["../../src/card/violet-card.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,E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a,CAAC,CAAC;AAE1C,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;IACrC,MAAM,WAAW,CAAC,MAAM,CAAC,UAAU,EAAE;QACjC,IAAI,EAAE,aAAa;QACnB,QAAQ;QACR,MAAM;QACN,aAAa,EAAE;YACX,cAAc,EAAE,IAAI;SACvB;KACJ,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { FASTElement, attr, css, html, observable } from \"@lushly-dev/fast-element\";\n\nimport { violetSurfaceTokenDefaults } from \"../theme/violet-token-defaults\";\n\nconst styles = css`\n ${violetSurfaceTokenDefaults}\n\n :host {\n display: block;\n\n --_card-border-width: 1px;\n --_card-padding: var(--violet-card-padding, 0);\n --_card-radius: var(--violet-card-radius, var(--_radius-lg));\n --_card-background: var(--violet-card-background, var(--_surface-card));\n --_card-band-background: var(--violet-card-band-background, var(--_surface-subtle));\n --_card-border-color: var(--violet-card-border-color, transparent);\n --_card-shadow: var(--violet-card-shadow, var(--_shadow-card));\n }\n\n :host([padding=\"small\"]) {\n --_card-padding: var(--violet-card-padding, var(--_space-sm));\n }\n\n :host([padding=\"medium\"]) {\n --_card-padding: var(--violet-card-padding, var(--_space-md));\n }\n\n :host([padding=\"large\"]) {\n --_card-padding: var(--violet-card-padding, var(--_space-lg));\n }\n\n /* An outline card is the same surface one step lower: a hairline in the shadow, no drawn border. */\n :host([appearance=\"outline\"]) {\n --_card-shadow: var(--violet-card-shadow, var(--_shadow-control));\n }\n\n :host([appearance=\"subtle\"]) {\n --_card-background: var(--violet-card-background, var(--_surface-subtle));\n --_card-border-color: var(--violet-card-border-color, transparent);\n --_card-shadow: var(--violet-card-shadow, none);\n }\n\n .root {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n border: var(--_card-border-width) solid var(--_card-border-color);\n border-radius: var(--_card-radius);\n background: var(--_card-background);\n box-shadow: var(--_card-shadow);\n overflow: hidden;\n transition: box-shadow var(--_duration-base) var(--_easing-standard);\n }\n\n :host([orientation=\"horizontal\"]) .root {\n flex-direction: row;\n }\n\n :host([interactive]) .root {\n cursor: pointer;\n }\n\n :host([interactive]) .root:hover {\n box-shadow:\n var(--_card-shadow),\n 0 0 0 1px var(--_border-subtle);\n }\n\n :host([interactive]:focus-visible) .root {\n box-shadow:\n var(--_card-shadow),\n 0 0 0 2px var(--_focus-ring);\n }\n\n /* Header and footer are bands: a tonal step with a clean edge. */\n .header,\n .footer {\n padding: var(--_card-padding);\n background: var(--_card-band-background);\n }\n\n .header[hidden] {\n display: none;\n }\n\n .header:not([hidden]) + .body {\n border-block-start: var(--_card-border-width) solid var(--_border-subtle);\n }\n\n .body {\n display: flex;\n flex-direction: column;\n padding: var(--_card-padding);\n flex: 1;\n }\n\n :host([orientation=\"horizontal\"]) .body {\n flex-direction: row;\n }\n\n\n\n .footer[hidden] {\n display: none;\n }\n\n .footer:not([hidden]) {\n border-block-start: var(--_card-border-width) solid var(--_border-subtle);\n }\n\n @media (forced-colors: active) {\n .root {\n forced-color-adjust: none;\n border: var(--_card-border-width) solid ButtonText;\n background: Canvas;\n box-shadow: none;\n }\n\n .header,\n .footer {\n background: Canvas;\n }\n\n .header:not([hidden]) + .body {\n border-block-start-color: ButtonText;\n }\n\n .footer:not([hidden]) {\n border-block-start-color: ButtonText;\n }\n }\n`;\n\nconst template = html<VioletCard>`\n <div class=\"root\" part=\"root\">\n <div class=\"header\" part=\"header\" ?hidden=\"${x => !x.hasHeader}\">\n <slot name=\"header\" @slotchange=\"${x => x.handleHeaderSlotChange()}\"></slot>\n </div>\n <div class=\"body\" part=\"body\">\n <slot></slot>\n </div>\n <div class=\"footer\" part=\"footer\" ?hidden=\"${x => !x.hasFooter}\">\n <slot name=\"footer\" @slotchange=\"${x => x.handleFooterSlotChange()}\"></slot>\n </div>\n </div>\n`;\n\n/**\n * Violet reusable card surface.\n *\n * @summary Token-driven card frame with optional padding, appearance variants, header/footer slots, and interactive mode.\n * @slot - Card body content.\n * @slot header - Optional header area rendered above the body with a separator border.\n * @slot footer - Optional footer area rendered below the body with a separator border.\n * @csspart root - Card container.\n * @csspart header - Header section wrapper.\n * @csspart body - Body section wrapper.\n * @csspart footer - Footer section wrapper.\n */\nexport class VioletCard extends FASTElement {\n @observable\n declare public hasHeader: boolean;\n\n @observable\n declare public hasFooter: boolean;\n\n declare public padding: string;\n declare public appearance: string;\n declare public interactive: boolean;\n declare public orientation: string;\n\n public constructor() {\n super();\n this.hasHeader = false;\n this.hasFooter = false;\n this.padding = \"none\";\n this.appearance = \"filled\";\n this.interactive = false;\n this.orientation = \"vertical\";\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n this.handleHeaderSlotChange();\n this.handleFooterSlotChange();\n this.#syncInteractiveState();\n }\n\n public interactiveChanged(): void {\n if (this.$fastController.isConnected) {\n this.#syncInteractiveState();\n }\n }\n\n public handleHeaderSlotChange(): void {\n const slot = this.shadowRoot?.querySelector('slot[name=\"header\"]') as HTMLSlotElement | null;\n this.hasHeader = Boolean(this.querySelector('[slot=\"header\"]')) || (slot?.assignedNodes({ flatten: true }) ?? []).some(node => {\n if (node.nodeType === Node.TEXT_NODE) {\n return Boolean(node.textContent?.trim());\n }\n return true;\n });\n const header = this.shadowRoot?.querySelector(\".header\") as HTMLElement | null;\n if (header) {\n header.hidden = !this.hasHeader;\n }\n }\n\n public handleFooterSlotChange(): void {\n const slot = this.shadowRoot?.querySelector('slot[name=\"footer\"]') as HTMLSlotElement | null;\n this.hasFooter = Boolean(this.querySelector('[slot=\"footer\"]')) || (slot?.assignedNodes({ flatten: true }) ?? []).some(node => {\n if (node.nodeType === Node.TEXT_NODE) {\n return Boolean(node.textContent?.trim());\n }\n return true;\n });\n const footer = this.shadowRoot?.querySelector(\".footer\") as HTMLElement | null;\n if (footer) {\n footer.hidden = !this.hasFooter;\n }\n }\n\n #syncInteractiveState(): void {\n if (this.interactive) {\n if (!this.hasAttribute(\"tabindex\")) {\n this.setAttribute(\"tabindex\", \"0\");\n }\n if (!this.hasAttribute(\"role\")) {\n this.setAttribute(\"role\", \"group\");\n }\n } else {\n if (this.getAttribute(\"tabindex\") === \"0\") {\n this.removeAttribute(\"tabindex\");\n }\n if (this.getAttribute(\"role\") === \"group\") {\n this.removeAttribute(\"role\");\n }\n }\n }\n}\n\nexport type VioletCardPadding = \"none\" | \"small\" | \"medium\" | \"large\";\nexport type VioletCardAppearance = \"filled\" | \"outline\" | \"subtle\";\nexport type VioletCardOrientation = \"vertical\" | \"horizontal\";\n\nattr(VioletCard.prototype, \"padding\");\nattr(VioletCard.prototype, \"appearance\");\nattr({ mode: \"boolean\" })(VioletCard.prototype, \"interactive\");\nattr(VioletCard.prototype, \"orientation\");\n\nif (!customElements.get(\"violet-card\")) {\n await FASTElement.define(VioletCard, {\n name: \"violet-card\",\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true,\n },\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"violet-card.js","sourceRoot":"","sources":["../../src/card/violet-card.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAE5E,MAAM,MAAM,GAAG,GAAG,CAAA;MACZ,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoI/B,CAAC;AAEF,MAAM,QAAQ,GAAG,IAAI,CAAY;;qDAEoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;+CACvB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,sBAAsB,EAAE;;;;;qDAKzB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;+CACvB,CAAC,CAAC,EAAE,CA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AAC;aAAM,CAAC;YACJ,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAC;gBACxC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;YACrC,CAAC;YACD,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,OAAO,EAAE,CAAC;gBACxC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YACjC,CAAC;QACL,CAAC;IACL,CAAC;CACJ;AA9EkB;IADd,UAAU;6CACuB;AAGnB;IADd,UAAU;6CACuB;AAiFtC,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AACtC,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AACzC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AAC/D,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AAE1C,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;IACrC,MAAM,WAAW,CAAC,MAAM,CAAC,UAAU,EAAE;QACjC,IAAI,EAAE,aAAa;QACnB,QAAQ;QACR,MAAM;QACN,aAAa,EAAE;YACX,cAAc,EAAE,IAAI;SACvB;KACJ,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { FASTElement, attr, css, html, observable } from \"@lushly-dev/fast-element\";\n\nimport { violetSurfaceTokenDefaults } from \"../theme/violet-token-defaults\";\n\nconst styles = css`\n ${violetSurfaceTokenDefaults}\n\n :host {\n display: block;\n\n --_card-border-width: 1px;\n --_card-padding: var(--violet-card-padding, 0);\n --_card-radius: var(--violet-card-radius, var(--_radius-lg));\n --_card-background: var(--violet-card-background, var(--_surface-card));\n --_card-band-background: var(--violet-card-band-background, var(--_surface-subtle));\n --_card-border-color: var(--violet-card-border-color, transparent);\n --_card-shadow: var(--violet-card-shadow, var(--_shadow-card));\n }\n\n :host([padding=\"small\"]) {\n --_card-padding: var(--violet-card-padding, var(--_space-sm));\n }\n\n :host([padding=\"medium\"]) {\n --_card-padding: var(--violet-card-padding, var(--_space-md));\n }\n\n :host([padding=\"large\"]) {\n --_card-padding: var(--violet-card-padding, var(--_space-lg));\n }\n\n /* An outline card is the same surface one step lower: a hairline in the shadow, no drawn border. */\n :host([appearance=\"outline\"]) {\n --_card-shadow: var(--violet-card-shadow, var(--_shadow-control));\n }\n\n :host([appearance=\"subtle\"]) {\n --_card-background: var(--violet-card-background, var(--_surface-subtle));\n --_card-border-color: var(--violet-card-border-color, transparent);\n --_card-shadow: var(--violet-card-shadow, none);\n }\n\n .root {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n border: var(--_card-border-width) solid var(--_card-border-color);\n border-radius: var(--_card-radius);\n background: var(--_card-background);\n box-shadow: var(--_card-shadow);\n overflow: hidden;\n transition: box-shadow var(--_duration-base) var(--_easing-standard);\n }\n\n :host([orientation=\"horizontal\"]) .root {\n flex-direction: row;\n }\n\n :host([interactive]) .root {\n cursor: pointer;\n }\n\n :host([interactive]) .root:hover {\n box-shadow:\n var(--_card-shadow),\n 0 0 0 1px var(--_border-subtle);\n }\n\n :host([interactive]:focus-visible) .root {\n box-shadow:\n var(--_card-shadow),\n 0 0 0 2px var(--_focus-ring);\n }\n\n /* Header and footer are bands: a tonal step with a clean edge. */\n .header,\n .footer {\n padding: var(--_card-padding);\n background: var(--_card-band-background);\n }\n\n .header[hidden] {\n display: none;\n }\n\n .header:not([hidden]) + .body {\n border-block-start: var(--_card-border-width) solid var(--_border-subtle);\n }\n\n .body {\n display: flex;\n flex-direction: column;\n padding: var(--_card-padding);\n flex: 1;\n }\n\n :host([orientation=\"horizontal\"]) .body {\n flex-direction: row;\n }\n\n\n\n .footer[hidden] {\n display: none;\n }\n\n .footer:not([hidden]) {\n border-block-start: var(--_card-border-width) solid var(--_border-subtle);\n }\n\n @media (forced-colors: active) {\n /* The frame paints itself; what is slotted into it takes the system colours. */\n .root {\n forced-color-adjust: none;\n border: var(--_card-border-width) solid ButtonText;\n background: Canvas;\n box-shadow: none;\n color: CanvasText;\n }\n\n slot {\n forced-color-adjust: auto;\n }\n\n .header,\n .footer {\n background: Canvas;\n }\n\n .header:not([hidden]) + .body {\n border-block-start-color: ButtonText;\n }\n\n .footer:not([hidden]) {\n border-block-start-color: ButtonText;\n }\n }\n`;\n\nconst template = html<VioletCard>`\n <div class=\"root\" part=\"root\">\n <div class=\"header\" part=\"header\" ?hidden=\"${x => !x.hasHeader}\">\n <slot name=\"header\" @slotchange=\"${x => x.handleHeaderSlotChange()}\"></slot>\n </div>\n <div class=\"body\" part=\"body\">\n <slot></slot>\n </div>\n <div class=\"footer\" part=\"footer\" ?hidden=\"${x => !x.hasFooter}\">\n <slot name=\"footer\" @slotchange=\"${x => x.handleFooterSlotChange()}\"></slot>\n </div>\n </div>\n`;\n\n/**\n * Violet reusable card surface.\n *\n * @summary Token-driven card frame with optional padding, appearance variants, header/footer slots, and interactive mode.\n * @slot - Card body content.\n * @slot header - Optional header area rendered above the body with a separator border.\n * @slot footer - Optional footer area rendered below the body with a separator border.\n * @csspart root - Card container.\n * @csspart header - Header section wrapper.\n * @csspart body - Body section wrapper.\n * @csspart footer - Footer section wrapper.\n */\nexport class VioletCard extends FASTElement {\n @observable\n declare public hasHeader: boolean;\n\n @observable\n declare public hasFooter: boolean;\n\n declare public padding: string;\n declare public appearance: string;\n declare public interactive: boolean;\n declare public orientation: string;\n\n public constructor() {\n super();\n this.hasHeader = false;\n this.hasFooter = false;\n this.padding = \"none\";\n this.appearance = \"filled\";\n this.interactive = false;\n this.orientation = \"vertical\";\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n this.handleHeaderSlotChange();\n this.handleFooterSlotChange();\n this.#syncInteractiveState();\n }\n\n public interactiveChanged(): void {\n if (this.$fastController.isConnected) {\n this.#syncInteractiveState();\n }\n }\n\n public handleHeaderSlotChange(): void {\n const slot = this.shadowRoot?.querySelector('slot[name=\"header\"]') as HTMLSlotElement | null;\n this.hasHeader = Boolean(this.querySelector('[slot=\"header\"]')) || (slot?.assignedNodes({ flatten: true }) ?? []).some(node => {\n if (node.nodeType === Node.TEXT_NODE) {\n return Boolean(node.textContent?.trim());\n }\n return true;\n });\n const header = this.shadowRoot?.querySelector(\".header\") as HTMLElement | null;\n if (header) {\n header.hidden = !this.hasHeader;\n }\n }\n\n public handleFooterSlotChange(): void {\n const slot = this.shadowRoot?.querySelector('slot[name=\"footer\"]') as HTMLSlotElement | null;\n this.hasFooter = Boolean(this.querySelector('[slot=\"footer\"]')) || (slot?.assignedNodes({ flatten: true }) ?? []).some(node => {\n if (node.nodeType === Node.TEXT_NODE) {\n return Boolean(node.textContent?.trim());\n }\n return true;\n });\n const footer = this.shadowRoot?.querySelector(\".footer\") as HTMLElement | null;\n if (footer) {\n footer.hidden = !this.hasFooter;\n }\n }\n\n #syncInteractiveState(): void {\n if (this.interactive) {\n if (!this.hasAttribute(\"tabindex\")) {\n this.setAttribute(\"tabindex\", \"0\");\n }\n if (!this.hasAttribute(\"role\")) {\n this.setAttribute(\"role\", \"group\");\n }\n } else {\n if (this.getAttribute(\"tabindex\") === \"0\") {\n this.removeAttribute(\"tabindex\");\n }\n if (this.getAttribute(\"role\") === \"group\") {\n this.removeAttribute(\"role\");\n }\n }\n }\n}\n\nexport type VioletCardPadding = \"none\" | \"small\" | \"medium\" | \"large\";\nexport type VioletCardAppearance = \"filled\" | \"outline\" | \"subtle\";\nexport type VioletCardOrientation = \"vertical\" | \"horizontal\";\n\nattr(VioletCard.prototype, \"padding\");\nattr(VioletCard.prototype, \"appearance\");\nattr({ mode: \"boolean\" })(VioletCard.prototype, \"interactive\");\nattr(VioletCard.prototype, \"orientation\");\n\nif (!customElements.get(\"violet-card\")) {\n await FASTElement.define(VioletCard, {\n name: \"violet-card\",\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true,\n },\n });\n}\n"]}
|
|
@@ -5,8 +5,9 @@ import { registerSystemChevronRightIcon } from "../icon/generated/icons/system-c
|
|
|
5
5
|
import { installFormDisabled } from "../foundations/violet-form-disabled";
|
|
6
6
|
import { clamp, hexToHsl, hslToHex, lightnessGradient, normalizeHexColor, saturationGradient, } from "./violet-color-utils";
|
|
7
7
|
import { violetFieldTokenDefaults } from "../theme/violet-token-defaults";
|
|
8
|
-
|
|
9
|
-
const
|
|
8
|
+
// AFD Refined palette defaults (D159): fixed component defaults, not theme tokens.
|
|
9
|
+
const DEFAULT_COLOR = "#146ba0";
|
|
10
|
+
const DEFAULT_PRESETS = ["#181b1a", "#2c5e4b", "#a3ebcd", "#146ba0", "#c42a1a", "#f96e5b", "#92400e", "#6b7d6e"];
|
|
10
11
|
let violetColorPickerCount = 0;
|
|
11
12
|
registerSystemChevronRightIcon();
|
|
12
13
|
const styles = css `
|