@fusion.dev/helix 0.217.0 → 0.219.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.json +1 -1
- package/custom-elements.json +1 -1
- package/dist/breadcrumbs/breadcrumb/breadcrumb.css.js +1 -1
- package/dist/canvas/root/canvas-root.d.ts +1 -0
- package/dist/canvas/root/canvas-root.js +1 -0
- package/dist/chat/composer/chat-composer.css.js +1 -1
- package/dist/chat/composer/chat-composer.d.ts +102 -5
- package/dist/chat/composer/chat-composer.js +134 -0
- package/dist/chat/message/chat-message.css.js +1 -1
- package/dist/chat/message/chat-message.d.ts +1 -0
- package/dist/checkbox/root/checkbox-root.css.js +1 -1
- package/dist/color-input/root/color-input-root.d.ts +1 -3
- package/dist/combobox/root/combobox-root.d.ts +1 -2
- package/dist/command/root/command-root.css.js +1 -1
- package/dist/command/root/command-root.d.ts +16 -1
- package/dist/command/root/command-root.js +16 -0
- package/dist/date-input/root/date-input-root.d.ts +1 -2
- package/dist/device-screen/root/device-screen-root.d.ts +1 -0
- package/dist/device-screen/root/device-screen-root.js +1 -0
- package/dist/dialog/root/dialog-root.css.js +1 -1
- package/dist/dialog/root/dialog-root.d.ts +14 -2
- package/dist/dialog/root/dialog-root.js +3 -0
- package/dist/drawer/root/drawer-root.css.js +1 -1
- package/dist/drawer/root/drawer-root.d.ts +1 -2
- package/dist/element-events.generated.js +1 -0
- package/dist/graph/root/graph-root.d.ts +1 -0
- package/dist/graph/root/graph-root.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/kbd/root/kbd-root.css.js +1 -1
- package/dist/log/group/log-group.css.js +1 -1
- package/dist/log/line/log-line.css.js +1 -1
- package/dist/log/root/log-root.css.js +1 -1
- package/dist/log/root/log-root.d.ts +5 -1
- package/dist/map/root/map-root.css.js +1 -1
- package/dist/map/root/map-root.d.ts +1 -0
- package/dist/map/root/map-root.js +1 -0
- package/dist/megamenu/root/megamenu-root.css.js +1 -1
- package/dist/megamenu/root/megamenu-root.d.ts +2 -2
- package/dist/menu/item/menu-item.css.js +1 -1
- package/dist/menu/root/menu-root.css.js +1 -1
- package/dist/menu/root/menu-root.d.ts +19 -1
- package/dist/menu/root/menu-root.js +4 -0
- package/dist/menu/section/menu-section.css.js +1 -1
- package/dist/meter/index.d.ts +1 -0
- package/dist/meter/index.js +1 -0
- package/dist/meter/root/meter-root.css.js +1 -1
- package/dist/meter/segment/meter-segment.css.d.ts +1 -0
- package/dist/meter/segment/meter-segment.css.js +2 -0
- package/dist/meter/segment/meter-segment.d.ts +39 -0
- package/dist/meter/segment/meter-segment.js +11 -0
- package/dist/popover/root/popover-root.css.js +1 -1
- package/dist/popover/root/popover-root.d.ts +20 -2
- package/dist/popover/root/popover-root.js +3 -0
- package/dist/radio/root/radio-root.css.js +1 -1
- package/dist/scroll-area/root/scroll-area-root.css.js +1 -1
- package/dist/scroll-area/root/scroll-area-root.d.ts +14 -2
- package/dist/scroll-area/root/scroll-area-root.js +29 -0
- package/dist/select/root/select-root.d.ts +1 -2
- package/dist/shared/floating/entrance.css.js +1 -1
- package/dist/skip-link/root/skip-link-root.d.ts +1 -2
- package/dist/spatial-bar-chart/root/spatial-bar-chart-root.css.js +1 -1
- package/dist/spatial-bar-chart/root/spatial-bar-chart-root.d.ts +9 -1
- package/dist/strands/renderer.d.ts +2 -0
- package/dist/strands/renderer.js +1 -0
- package/dist/strands/root/strands-root.css.js +1 -1
- package/dist/strands/root/strands-root.d.ts +14 -0
- package/dist/strands/root/strands-root.js +5 -0
- package/dist/strands/shader.d.ts +7 -1
- package/dist/strands/shader.js +11 -3
- package/dist/switch/root/switch-root.css.js +1 -1
- package/dist/tabs/root/tabs-root.css.js +1 -1
- package/dist/tabs/root/tabs-root.d.ts +36 -0
- package/dist/tabs/root/tabs-root.js +7 -0
- package/dist/tabs/tab/tab.css.js +1 -1
- package/dist/tabs/tab/tab.d.ts +2 -0
- package/dist/terminal/root/terminal-root.d.ts +1 -0
- package/dist/terminal/root/terminal-root.js +1 -0
- package/dist/time-input/root/time-input-root.d.ts +1 -2
- package/dist/toast/item/toast-item.d.ts +1 -2
- package/dist/tooltip/root/tooltip-root.css.js +1 -1
- package/dist/tour/root/tour-root.css.js +1 -1
- package/dist/tour/stop/tour-stop.d.ts +1 -2
- package/dist/tree/item/tree-item.css.js +1 -1
- package/dist/tree/root/tree-root.css.js +1 -1
- package/dist/tree/root/tree-root.d.ts +5 -1
- package/dist/voice-level/draw.d.ts +108 -0
- package/dist/voice-level/draw.js +53 -0
- package/dist/voice-level/index.d.ts +2 -0
- package/dist/voice-level/index.js +1 -0
- package/dist/voice-level/root/voice-level-root.css.d.ts +1 -0
- package/dist/voice-level/root/voice-level-root.css.js +2 -0
- package/dist/voice-level/root/voice-level-root.d.ts +186 -0
- package/dist/voice-level/root/voice-level-root.js +324 -0
- package/examples.json +1 -1
- package/lint.json +1 -1
- package/package.json +6 -6
- package/skills/helix/SKILL.md +2 -2
- package/types/jsx.d.ts +2145 -89
- package/types/svelte.d.ts +2 -0
- package/types/vue.d.ts +515 -26
- package/types/words.d.ts +15 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {--icon-button-size: var(--breadcrumbs-control-size, calc(var(--helix-text-control) * var(--helix-leading-normal) + var(--helix-space-2xs) * 2));--button-size: var(--breadcrumbs-control-size, calc(var(--helix-text-control) * var(--helix-leading-normal) + var(--helix-space-2xs) * 2));--button-padding-inline: var(--breadcrumbs-control-padding-inline, var(--helix-space-xs));--button-gap: var(--helix-space-2xs);align-items: center;display: inline-flex;gap: var(--breadcrumbs-gap, var(--helix-space-xs))}[part="separator"] {color: var(--breadcrumbs-separator-color, var(--helix-color-foreground-subtle));display: block;user-select: none}[part="separator"] svg {block-size: 1em;inline-size: 1em;vertical-align: calc(0.5cap - 0.5em)}:host(:first-child) [part="separator"] {display: none}::slotted(a) {background-color: transparent;border-radius: var(--breadcrumbs-radius, var(--helix-radii-sm));padding: var(--helix-space-2xs) var(--helix-space-xs);transition: background-color var(--helix-duration-fast) var(--helix-easing-standard)}:host(:first-child) ::slotted(a) {margin-inline-start: calc(var(--helix-space-xs) * -1)}::slotted(a:hover) {background-color: var(--breadcrumbs-hover-color, color-mix(in oklab, var(--helix-color-foreground) 8%, transparent))}::slotted(a:focus-visible) {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset)}:host {font-weight: var(--breadcrumbs-font-weight, var(--helix-weight-medium))}:host([current]) {color: var(--breadcrumbs-current-color, var(--helix-color-foreground))}[part="link"] {align-items: center;border-radius: var(--breadcrumbs-radius, var(--helix-radii-sm));color: var(--breadcrumbs-link-color, var(--helix-color-foreground-muted));display: inline-flex;gap: var(--helix-space-xs);padding: var(--helix-space-2xs) var(--helix-space-xs);text-decoration: none}:host(:first-child) a[part="link"] {margin-inline-start: calc(var(--helix-space-xs) * -1)}:host(:not([href])) [part="link"] {padding-block: var(--helix-space-none)}:host(:not([href]):not([current])) [part="link"] {padding-inline: var(--helix-space-none)}a[part="link"]:hover {background-color: var(--breadcrumbs-hover-color, color-mix(in oklab, var(--helix-color-foreground) 8%, transparent));color: var(--breadcrumbs-current-color, var(--helix-color-foreground))}a[part="link"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset)}:host([current]) [part="link"] {color: var(--breadcrumbs-current-color, var(--helix-color-foreground))}:host(:state(end)) [part="link"], :host(:state(end)) ::slotted(a) {border-end-end-radius: var(--helix-radii-none);border-start-end-radius: var(--helix-radii-none);padding-inline-end: var(--helix-space-2xs)}:host(:state(end)) slot[name="end"] {--button-radius: var(--breadcrumbs-radius, var(--helix-radii-sm));--button-radius-start: var(--helix-radii-none);--helix-size-focus-offset: calc(var(--helix-size-focus-ring) * -1);--icon-button-background-color-hover: var(--breadcrumbs-hover-color, color-mix(in oklab, var(--helix-color-foreground) 8%, transparent));--icon-button-radius: var(--breadcrumbs-radius, var(--helix-radii-sm));--icon-size: 1.15em;align-items: center;display: inline-flex;margin-inline-start: calc(var(--breadcrumbs-gap, var(--helix-space-xs)) * -1)}:host(:state(end)) a[part="link"]:focus-visible, :host(:state(end)) ::slotted(a:focus-visible) {outline-offset: calc(var(--helix-size-focus-offset) * -1)}:host(:state(end)) [part="link"]:focus-visible, :host(:state(end)) ::slotted(a:focus-visible), :host(:state(end)) slot[name="end"]:focus-within {position: relative;z-index: var(--helix-layer-raised)}:host(:state(end)) [part="link"]:hover ~ slot[name="end"] {--icon-button-background-color: var(--_breadcrumbs-split-fill, transparent)}:host(:state(end)) [part="link"]:has(~ slot[name="end"]:hover), :host(:state(end)) [part="link"]:has(~ slot[name="end"]:hover) ::slotted(a) {background-color: var(--_breadcrumbs-split-fill, transparent)}:host(:state(end)) [part="link"] {position: relative}:host(:state(end)) [part="link"]::after {background-color: var(--_breadcrumbs-split-rule, transparent);content: "";inline-size: var(--helix-border-thin);inset-block: 20%;inset-inline-end: calc(var(--helix-border-thin) * -1);pointer-events: none;position: absolute}:host([hidden]), :host(:state(folded)) {display: none}[part="fold-separator"] {color: var(--breadcrumbs-separator-color, var(--helix-color-foreground-subtle));display: block;user-select: none}[part="fold-separator"] svg {block-size: 1em;inline-size: 1em;vertical-align: calc(0.5cap - 0.5em)}[part="expand"] {all: unset;border-radius: var(--breadcrumbs-radius, var(--helix-radii-sm));box-sizing: border-box;color: var(--breadcrumbs-link-color, var(--helix-color-foreground-muted));cursor: pointer;line-height: var(--helix-leading-normal);padding: var(--helix-space-2xs) var(--helix-space-xs)}[part="expand"]:hover {background-color: var(--breadcrumbs-hover-color, color-mix(in oklab, var(--helix-color-foreground) 8%, transparent));color: var(--breadcrumbs-current-color, var(--helix-color-foreground))}[part="expand"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset)}`);
|
|
2
|
+
export const styles = createSheet(`:host {--icon-button-size: var(--breadcrumbs-control-size, calc(var(--helix-text-control) * var(--helix-leading-normal) + var(--helix-space-2xs) * 2));--button-size: var(--breadcrumbs-control-size, calc(var(--helix-text-control) * var(--helix-leading-normal) + var(--helix-space-2xs) * 2));--button-padding-inline: var(--breadcrumbs-control-padding-inline, var(--helix-space-xs));--button-gap: var(--helix-space-2xs);align-items: center;display: inline-flex;gap: var(--breadcrumbs-gap, var(--helix-space-xs))}[part="separator"] {color: var(--breadcrumbs-separator-color, var(--helix-color-foreground-subtle));display: block;user-select: none}[part="separator"] svg {block-size: 1em;inline-size: 1em;vertical-align: calc(0.5cap - 0.5em)}[data-mark="slash"] {display: inline-block;inline-size: 1em;text-align: center}:host(:first-child) [part="separator"] {display: none}::slotted(a) {background-color: transparent;border-radius: var(--breadcrumbs-radius, var(--helix-radii-sm));padding: var(--helix-space-2xs) var(--helix-space-xs);transition: background-color var(--helix-duration-fast) var(--helix-easing-standard)}:host(:first-child) ::slotted(a) {margin-inline-start: calc(var(--helix-space-xs) * -1)}::slotted(a:hover) {background-color: var(--breadcrumbs-hover-color, color-mix(in oklab, var(--helix-color-foreground) 8%, transparent))}::slotted(a:focus-visible) {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset)}:host {font-weight: var(--breadcrumbs-font-weight, var(--helix-weight-medium))}:host([current]) {color: var(--breadcrumbs-current-color, var(--helix-color-foreground))}[part="link"] {align-items: center;border-radius: var(--breadcrumbs-radius, var(--helix-radii-sm));color: var(--breadcrumbs-link-color, var(--helix-color-foreground-muted));display: inline-flex;gap: var(--helix-space-xs);padding: var(--helix-space-2xs) var(--helix-space-xs);text-decoration: none}:host(:first-child) a[part="link"] {margin-inline-start: calc(var(--helix-space-xs) * -1)}:host(:not([href])) [part="link"] {padding-block: var(--helix-space-none)}:host(:not([href]):not([current])) [part="link"] {padding-inline: var(--helix-space-none)}a[part="link"]:hover {background-color: var(--breadcrumbs-hover-color, color-mix(in oklab, var(--helix-color-foreground) 8%, transparent));color: var(--breadcrumbs-current-color, var(--helix-color-foreground))}a[part="link"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset)}:host([current]) [part="link"] {color: var(--breadcrumbs-current-color, var(--helix-color-foreground))}:host(:state(end)) [part="link"], :host(:state(end)) ::slotted(a) {border-end-end-radius: var(--helix-radii-none);border-start-end-radius: var(--helix-radii-none);padding-inline-end: var(--helix-space-2xs)}:host(:state(end)) slot[name="end"] {--button-radius: var(--breadcrumbs-radius, var(--helix-radii-sm));--button-radius-start: var(--helix-radii-none);--helix-size-focus-offset: calc(var(--helix-size-focus-ring) * -1);--icon-button-background-color-hover: var(--breadcrumbs-hover-color, color-mix(in oklab, var(--helix-color-foreground) 8%, transparent));--icon-button-radius: var(--breadcrumbs-radius, var(--helix-radii-sm));--icon-size: 1.15em;align-items: center;display: inline-flex;margin-inline-start: calc(var(--breadcrumbs-gap, var(--helix-space-xs)) * -1)}:host(:state(end)) a[part="link"]:focus-visible, :host(:state(end)) ::slotted(a:focus-visible) {outline-offset: calc(var(--helix-size-focus-offset) * -1)}:host(:state(end)) [part="link"]:focus-visible, :host(:state(end)) ::slotted(a:focus-visible), :host(:state(end)) slot[name="end"]:focus-within {position: relative;z-index: var(--helix-layer-raised)}:host(:state(end)) [part="link"]:hover ~ slot[name="end"] {--icon-button-background-color: var(--_breadcrumbs-split-fill, transparent)}:host(:state(end)) [part="link"]:has(~ slot[name="end"]:hover), :host(:state(end)) [part="link"]:has(~ slot[name="end"]:hover) ::slotted(a) {background-color: var(--_breadcrumbs-split-fill, transparent)}:host(:state(end)) [part="link"] {position: relative}:host(:state(end)) [part="link"]::after {background-color: var(--_breadcrumbs-split-rule, transparent);content: "";inline-size: var(--helix-border-thin);inset-block: 20%;inset-inline-end: calc(var(--helix-border-thin) * -1);pointer-events: none;position: absolute}:host([hidden]), :host(:state(folded)) {display: none}[part="fold-separator"] {color: var(--breadcrumbs-separator-color, var(--helix-color-foreground-subtle));display: block;user-select: none}[part="fold-separator"] svg {block-size: 1em;inline-size: 1em;vertical-align: calc(0.5cap - 0.5em)}[part="expand"] {all: unset;border-radius: var(--breadcrumbs-radius, var(--helix-radii-sm));box-sizing: border-box;color: var(--breadcrumbs-link-color, var(--helix-color-foreground-muted));cursor: pointer;line-height: var(--helix-leading-normal);padding: var(--helix-space-2xs) var(--helix-space-xs)}[part="expand"]:hover {background-color: var(--breadcrumbs-hover-color, color-mix(in oklab, var(--helix-color-foreground) 8%, transparent));color: var(--breadcrumbs-current-color, var(--helix-color-foreground))}[part="expand"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset)}`);
|
|
@@ -2,6 +2,7 @@ import { type ViewportControlAxes } from '@fusion.dev/helix-core';
|
|
|
2
2
|
import { HelixHeadlessCanvas } from '@fusion.dev/helix-headless/canvas';
|
|
3
3
|
import type { CSSResultGroup } from 'lit';
|
|
4
4
|
import '../../icon-button/index.js';
|
|
5
|
+
import '../../tooltip/index.js';
|
|
5
6
|
/**
|
|
6
7
|
* @summary A board of cards and the connections between them, which can be navigated, rearranged, and connected.
|
|
7
8
|
*
|
|
@@ -6,6 +6,7 @@ import { styles as liveStyles } from '../../shared/live/live.css.js';
|
|
|
6
6
|
import { styles as viewportStyles } from '../../shared/viewport/viewport.css.js';
|
|
7
7
|
import { styles } from './canvas-root.css.js';
|
|
8
8
|
import '../../icon-button/index.js';
|
|
9
|
+
import '../../tooltip/index.js';
|
|
9
10
|
let HelixCanvas = class HelixCanvas extends HelixHeadlessCanvas {
|
|
10
11
|
static { this.tier = 'helix-'; }
|
|
11
12
|
get controlAxes() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {display: block}[part="composer"] {background-color: var(--chat-composer-background-color, var(--helix-color-surface));border: var(--chat-composer-border-width, var(--helix-border-thin)) solid var(--helix-color-border);border-radius: var(--helix-radii-md);display: grid;gap: var(--helix-space-2xs);padding: var(--helix-space-xs)}[part="composer"]:focus-within {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: 0}:host(:state(invalid)) [part="composer"], :host(:state(invalid)) [part="composer"]:focus-within {border-color: var(--helix-color-danger);outline-color: var(--helix-color-danger)}[part="feedback"] {color: var(--helix-color-danger);font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);font-weight: var(--helix-weight-medium);line-height: var(--helix-leading-normal);margin: var(--helix-space-none);margin-block-start: var(--helix-space-2xs)}[part="field"] {background-color: transparent;border: 0;color: var(--helix-color-foreground);field-sizing: content;font-family: var(--helix-font-sans);font-size: max(var(--helix-text-field-min), var(--helix-text-sm));line-height: var(--helix-leading-normal);max-block-size: var(--chat-composer-max-block-size, 12rem);padding-block: var(--helix-space-2xs);padding-inline: calc(var(--helix-space-sm) - var(--helix-space-xs) - var(--helix-border-thin));resize: none}[part="field"]:focus-visible {outline: none}[part="tools"] {align-items: center;display: flex;gap: var(--helix-space-2xs);justify-content: flex-end}[part="start"], [part="end"] {--helix-size-control: var(--helix-size-control-sm);--helix-size-control-loose: calc(var(--helix-size-control) * 1.2);--helix-size-control-tight: calc(var(--helix-size-control) * 0.8);--helix-size-icon: var(--helix-size-icon-sm);--helix-size-icon-loose: calc(var(--helix-size-icon) * 1.2);--helix-size-icon-tight: calc(var(--helix-size-icon) * 0.8)
|
|
2
|
+
export const styles = createSheet(`:host {display: block}[part="composer"] {background-color: var(--chat-composer-background-color, var(--helix-color-surface));border: var(--chat-composer-border-width, var(--helix-border-thin)) solid var(--helix-color-border);border-radius: var(--helix-radii-md);display: grid;gap: var(--helix-space-2xs);padding: var(--helix-space-xs)}[part="composer"]:focus-within {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: 0}:host([glow]) [part="composer"] {--_chat-composer-reach-x: 5rem;--_chat-composer-reach-y: 2.5rem;position: relative;transition: box-shadow var(--helix-duration-normal) var(--helix-easing-standard)}:host([glow]) [part="composer"]:focus-within {box-shadow: 0 0 0 var(--helix-border-thin) color-mix(in oklab, var(--chat-composer-glow-color, var(--helix-color-primary)) 60%, transparent), 0 0 1.25rem -0.25rem color-mix(in oklab, var(--chat-composer-glow-color, var(--helix-color-primary)) 45%, transparent);outline: none;transition: box-shadow var(--helix-duration-slow) var(--helix-easing-standard) var(--helix-duration-normal)}:host([glow]) [part="composer"]::before {background: radial-gradient(min(5rem, var(--_chat-composer-reach-x)) min(2.5rem, var(--_chat-composer-reach-y)) at var(--_chat-composer-light-x, 0px) var(--_chat-composer-light-y, 0px), color-mix(in oklab, var(--chat-composer-glow-color, var(--helix-color-primary)) 60%, white), var(--chat-composer-glow-color, var(--helix-color-primary)) 35%, transparent 100%);--_chat-composer-light-x: 0px;--_chat-composer-light-y: 0px;border-radius: inherit;content: "";inset: 0;mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);opacity: 0;padding: var(--helix-border-thick);pointer-events: none;position: absolute}:host([glow]) [part="composer"]::after {--_chat-composer-bloom: var(--helix-space-sm);--_chat-composer-bloom-in: var(--helix-space-xs);--_chat-composer-bloom-out: transparent, rgb(0 0 0 / 0.25) calc(var(--_chat-composer-bloom) / 3), rgb(0 0 0 / 0.6) calc(var(--_chat-composer-bloom) * 2 / 3), #000 var(--_chat-composer-bloom), #000 calc(100% - var(--_chat-composer-bloom)), rgb(0 0 0 / 0.6) calc(100% - var(--_chat-composer-bloom) * 2 / 3), rgb(0 0 0 / 0.25) calc(100% - var(--_chat-composer-bloom) / 3), transparent;--_chat-composer-bloom-into: #000 var(--_chat-composer-bloom), rgb(0 0 0 / 0.45) calc(var(--_chat-composer-bloom) + var(--_chat-composer-bloom-in) / 3), transparent calc(var(--_chat-composer-bloom) + var(--_chat-composer-bloom-in)), transparent calc(100% - var(--_chat-composer-bloom) - var(--_chat-composer-bloom-in)), rgb(0 0 0 / 0.45) calc(100% - var(--_chat-composer-bloom) - var(--_chat-composer-bloom-in) / 3), #000 calc(100% - var(--_chat-composer-bloom));--_chat-composer-light-x: 0px;--_chat-composer-light-y: 0px;background: radial-gradient(min(5rem, var(--_chat-composer-reach-x)) min(2.5rem, var(--_chat-composer-reach-y)) at calc(var(--_chat-composer-light-x, 0px) + var(--_chat-composer-bloom)) calc(var(--_chat-composer-light-y, 0px) + var(--_chat-composer-bloom)), color-mix(in oklab, var(--chat-composer-glow-color, var(--helix-color-primary)) 70%, transparent), transparent 100%);content: "";inset: calc(var(--_chat-composer-bloom) * -1);mask: linear-gradient(to right, var(--_chat-composer-bloom-out)), linear-gradient(to bottom, var(--_chat-composer-bloom-out)), linear-gradient(to right, var(--_chat-composer-bloom-into)), linear-gradient(to bottom, var(--_chat-composer-bloom-into));mask-composite: intersect, intersect, add, add;opacity: 0;pointer-events: none;position: absolute;z-index: var(--helix-layer-beneath)}@media (prefers-reduced-motion: reduce) {:host([glow]) [part="composer"]:focus-within {transition-delay: 0s}}:host([glow]:state(invalid)) {--chat-composer-glow-color: var(--helix-color-danger)}@media (forced-colors: active) {:host([glow]) [part="composer"]:focus-within {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: 0}}:host(:state(invalid)) [part="composer"], :host(:state(invalid)) [part="composer"]:focus-within {border-color: var(--helix-color-danger);outline-color: var(--helix-color-danger)}[part="feedback"] {color: var(--helix-color-danger);font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);font-weight: var(--helix-weight-medium);line-height: var(--helix-leading-normal);margin: var(--helix-space-none);margin-block-start: var(--helix-space-2xs)}[part="field"] {background-color: transparent;border: 0;color: var(--helix-color-foreground);field-sizing: content;font-family: var(--helix-font-sans);font-size: max(var(--helix-text-field-min), var(--helix-text-sm));line-height: var(--helix-leading-normal);max-block-size: var(--chat-composer-max-block-size, 12rem);padding-block: var(--helix-space-2xs);padding-inline: calc(var(--helix-space-sm) - var(--helix-space-xs) - var(--helix-border-thin));resize: none}[part="attachments"] {--_chat-composer-inset: calc(var(--helix-space-sm) - var(--helix-space-xs) - var(--helix-border-thin));align-items: flex-start;display: flex;flex-wrap: wrap;gap: var(--helix-space-xs);min-inline-size: 0;padding-block-start: var(--_chat-composer-inset);padding-inline: var(--_chat-composer-inset)}[part="attachments"][hidden] {display: none}[part="field"]:focus-visible {outline: none}@supports (anchor-name: --a) {[part="composer"] {position: relative}[part="field"] {--_chat-composer-held: auto;anchor-name: --_chat-composer-field;min-block-size: var(--_chat-composer-held)}[part="field"]:has(+ [part~="example"])::placeholder {color: transparent}[part~="example"] {background-color: transparent;block-size: anchor-size(--_chat-composer-field block);border: 0;color: var(--helix-color-foreground);field-sizing: fixed;font-family: var(--helix-font-sans);font-size: max(var(--helix-text-field-min), var(--helix-text-sm));inline-size: anchor-size(--_chat-composer-field inline);inset-block-start: anchor(--_chat-composer-field start);inset-inline-start: anchor(--_chat-composer-field start);line-height: var(--helix-leading-normal);margin: var(--helix-space-none);overflow: hidden;padding-block: var(--helix-space-2xs);padding-inline: calc(var(--helix-space-sm) - var(--helix-space-xs) - var(--helix-border-thin));pointer-events: none;position: absolute;resize: none}[part="field"]:not(:placeholder-shown) ~ [part~="example"] {visibility: hidden}[part~="example-leaving"] {animation: helix-composer-example-out calc(var(--helix-duration-normal) * 1.25) var(--helix-easing-standard) forwards}:host(:state(example-entering)) [part~="example"]:not([part~="example-leaving"]) {animation: helix-composer-example-in var(--helix-duration-slow) var(--helix-easing-standard)}@keyframes helix-composer-example-out {to {filter: blur(0.125em);opacity: 0;translate: 0 -0.35em}}@keyframes helix-composer-example-in {from {opacity: 0;translate: 0 0.35em}}@media (prefers-reduced-motion: reduce) {[part~="example-leaving"], :host(:state(example-entering)) [part~="example"]:not([part~="example-leaving"]) {animation: none}}}@supports not (anchor-name: --a) {[part~="example"] {display: none}[part="field"]::placeholder {transition: opacity var(--helix-duration-fast) var(--helix-easing-standard)}:host(:state(example-leaving)) [part="field"]::placeholder {opacity: 0}}[part="tools"] {align-items: center;display: flex;gap: var(--helix-space-2xs);justify-content: flex-end}[part="attachments"], [part="start"], [part="end"] {--helix-size-control: var(--helix-size-control-sm);--helix-size-control-loose: calc(var(--helix-size-control) * 1.2);--helix-size-control-tight: calc(var(--helix-size-control) * 0.8);--helix-size-icon: var(--helix-size-icon-sm);--helix-size-icon-loose: calc(var(--helix-size-icon) * 1.2);--helix-size-icon-tight: calc(var(--helix-size-icon) * 0.8)}[part="start"], [part="end"] {align-items: center;display: flex;gap: var(--helix-space-2xs)}[part="start"] {margin-inline-end: auto}[part="end"] {margin-inline-end: var(--helix-space-2xs)}[part="start"][data-empty], [part="end"][data-empty] {display: none}[part="send"], [part~="voice"] {align-items: center;background-color: transparent;block-size: calc(var(--helix-size-control-tight) - var(--helix-space-2xs));border: 0;border-radius: var(--helix-radii-sm);color: var(--helix-color-foreground-muted);cursor: pointer;display: inline-flex;inline-size: calc(var(--helix-size-control-tight) - var(--helix-space-2xs));justify-content: center;padding: var(--helix-space-none)}[part="mark"], [part~="voice"] svg {block-size: var(--helix-size-icon-tight);inline-size: var(--helix-size-icon-tight)}[part="send"]:hover:not(:disabled, [aria-disabled="true"]), [part~="voice"]:hover:not(:disabled) {background-color: color-mix(in oklab, var(--helix-color-foreground) 8%, transparent);color: var(--helix-color-foreground)}[part="send"]:disabled, [part="send"][aria-disabled="true"], [part~="voice"]:disabled {cursor: not-allowed;opacity: 0.5}[part="idle"] {align-items: center;animation: helix-composer-swap var(--helix-duration-fast) var(--helix-easing-standard);display: inline-flex}[part="idle"][hidden] {display: none}[part="send"] {animation: helix-composer-swap var(--helix-duration-fast) var(--helix-easing-standard)}@keyframes helix-composer-swap {from {opacity: 0}}@media (prefers-reduced-motion: reduce) {[part="idle"], [part="send"] {animation: none}}[part="send"]:focus-visible, [part~="voice"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset)}`);
|
|
@@ -1,33 +1,130 @@
|
|
|
1
1
|
import { HelixHeadlessChatComposer } from '@fusion.dev/helix-headless/chat';
|
|
2
|
-
import type
|
|
2
|
+
import { type CSSResultGroup, type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
import '../../tooltip/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* The keyframes of one lap of the light around a box `w` wide and `h` tall,
|
|
6
|
+
* clockwise from its top-left corner, each side taking the share of the lap
|
|
7
|
+
* its length is of the edge, so the light moves at one speed. None for a box
|
|
8
|
+
* with no size.
|
|
9
|
+
*/
|
|
10
|
+
export declare function lapOf(w: number, h: number): Keyframe[];
|
|
3
11
|
/**
|
|
4
12
|
* @summary A field for writing a turn in a conversation.
|
|
5
13
|
*
|
|
6
14
|
* @description
|
|
7
|
-
* The composer is one
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
15
|
+
* The composer is one box. What the draft carries sits at its top, in a row
|
|
16
|
+
* that wraps, inset to the line the caret starts on. The field grows with its
|
|
17
|
+
* text up to a maximum height, through `field-sizing: content`. Where that is
|
|
18
|
+
* not supported, the field keeps its rows and scrolls. The maximum height
|
|
19
|
+
* keeps the composer from covering the transcript.
|
|
20
|
+
*
|
|
21
|
+
* With two `placeholders` or more, each example rolls into the next: the one
|
|
22
|
+
* showing rises a little as it fades and blurs, and the next rises into its
|
|
23
|
+
* place from below as it fades in, the two crossing so the field is never
|
|
24
|
+
* empty. A box that changes height for the next example changes as it
|
|
25
|
+
* lands. Where the browser has no CSS anchor
|
|
26
|
+
* positioning, the examples fade into each other in the field's own
|
|
27
|
+
* placeholder.
|
|
11
28
|
*
|
|
12
29
|
* @since 0.1.0
|
|
13
30
|
* @status stable
|
|
14
31
|
* @category forms
|
|
15
32
|
* @documentation https://fusion.dev/helix/components/chat
|
|
16
33
|
*
|
|
34
|
+
* @slot attachments - What the draft carries, such as images or files, inside the box and above the field.
|
|
17
35
|
* @slot end - Content under the field, beside the send button.
|
|
18
36
|
* @slot start - Content under the field at the leading edge, such as an attachment button or a model picker.
|
|
19
37
|
*
|
|
38
|
+
* @csspart attachments - The row above the field that holds the `attachments` slot, inset to the field's text and hidden while the slot is empty.
|
|
39
|
+
* @csspart example - The example drawn over the empty field while `placeholders` holds two or more, in the field's box. It is a second field that shows only its placeholder, hidden from screen readers. Style its `::placeholder` where you style the field's.
|
|
40
|
+
* @csspart example-leaving - The example on its way out while the next comes in, for its first 250 milliseconds. Set together with `example`.
|
|
20
41
|
* @csspart field - The text field.
|
|
21
42
|
* @csspart send - The send button.
|
|
22
43
|
* @csspart tools - The row under the field.
|
|
23
44
|
*
|
|
24
45
|
* @cssproperty --chat-composer-background-color - Fill behind the composer.
|
|
25
46
|
* @cssproperty --chat-composer-border-width - Width of the composer's edge, so your theme can remove it.
|
|
47
|
+
* @cssproperty --chat-composer-glow-color - Color of the focus glow under `glow`. Defaults to the primary color.
|
|
26
48
|
* @cssproperty --chat-composer-max-block-size - Maximum height the field grows to.
|
|
27
49
|
* @cssproperty --dictation-level - How loud the microphone is while the field listens for dictation, from 0 to 1, which the element sets; the ring around the dictation button grows with it.
|
|
28
50
|
*/
|
|
29
51
|
export declare class HelixChatComposer extends HelixHeadlessChatComposer {
|
|
30
52
|
static tier: string;
|
|
53
|
+
/**
|
|
54
|
+
* Draws the composer's focus as a glow: a light that runs once around the
|
|
55
|
+
* edge as the composer takes focus, then a soft steady edge while it holds
|
|
56
|
+
* it, in place of the focus ring.
|
|
57
|
+
*
|
|
58
|
+
* **On focus, and only then.** It says the composer is listening. A glow
|
|
59
|
+
* that ran while a reply was on its way would be a second indicator of what
|
|
60
|
+
* the conversation already shows, and one that ran all the time would be
|
|
61
|
+
* decoration that moves. With reduced motion asked for, the edge lights
|
|
62
|
+
* without the sweep.
|
|
63
|
+
*
|
|
64
|
+
* The steady edge is the focus indicator, so the ring is not drawn as well.
|
|
65
|
+
* Its color is `--chat-composer-glow-color`, the primary color unless set.
|
|
66
|
+
*/
|
|
67
|
+
glow: boolean;
|
|
68
|
+
/** The light's lap, and its bloom's, while they run. */
|
|
69
|
+
private laps;
|
|
70
|
+
connectedCallback(): void;
|
|
71
|
+
disconnectedCallback(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Runs the light once as focus arrives. Focus moving between the
|
|
74
|
+
* composer's own controls, such as from the field to the send button, has
|
|
75
|
+
* not arrived, so the light stays down.
|
|
76
|
+
*/
|
|
77
|
+
private readonly arrive;
|
|
78
|
+
/**
|
|
79
|
+
* One lap of the light around the edge, **at one speed all the way**.
|
|
80
|
+
*
|
|
81
|
+
* A conic gradient turned through a full circle moves its light by angle,
|
|
82
|
+
* so on a composer many times wider than it is tall the light crawls along
|
|
83
|
+
* the middle of each long side and races through the corners. Here the lap
|
|
84
|
+
* is measured: each side takes the share of the time its length is of the
|
|
85
|
+
* edge, and the whole lap takes as long as the edge is, within a range.
|
|
86
|
+
*/
|
|
87
|
+
private sweep;
|
|
88
|
+
/**
|
|
89
|
+
* The examples the empty field shows, drawn over the field so they can
|
|
90
|
+
* move: the one showing, and while two cross, the one leaving.
|
|
91
|
+
*
|
|
92
|
+
* **Each is a field showing only its placeholder**, so the example is drawn
|
|
93
|
+
* by the same rules as the field's own: the browser's placeholder color,
|
|
94
|
+
* and the same wrapping and clipping at every width and in either
|
|
95
|
+
* direction. A field's `::placeholder` cannot move, blur, or take a
|
|
96
|
+
* transform, and this whole box can. The sheet places each on the field's
|
|
97
|
+
* box and makes the field's own placeholder transparent, which stays the
|
|
98
|
+
* example a screen reader hears. These are `inert` and `aria-hidden`, and
|
|
99
|
+
* take no pointer.
|
|
100
|
+
*
|
|
101
|
+
* **Keyed by the example's place in the list**, so the example showing is
|
|
102
|
+
* the same element as it starts to leave, and its exit starts from where it
|
|
103
|
+
* rests.
|
|
104
|
+
*/
|
|
105
|
+
protected renderExample(example: {
|
|
106
|
+
index: number;
|
|
107
|
+
text: string;
|
|
108
|
+
}, leaving?: {
|
|
109
|
+
index: number;
|
|
110
|
+
text: string;
|
|
111
|
+
}): TemplateResult;
|
|
112
|
+
/**
|
|
113
|
+
* Holds the field at the height it has as the next example appears, so a
|
|
114
|
+
* box that grows for it grows at once and one that shrinks waits for the
|
|
115
|
+
* example to land. Only where the sheet draws the examples.
|
|
116
|
+
*/
|
|
117
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
118
|
+
protected updated(changed: PropertyValues): void;
|
|
119
|
+
/**
|
|
120
|
+
* Lets the field take the height of the example showing.
|
|
121
|
+
*
|
|
122
|
+
* **On the element's clock, never on an animation event.** WebKit sends no
|
|
123
|
+
* `animationcancel`, so a hold released by one stayed on whenever the
|
|
124
|
+
* entrance was cut short, and the field kept the leaving example's height
|
|
125
|
+
* until the next turn. Measured in Linux WebKit on October 17, 2026.
|
|
126
|
+
*/
|
|
127
|
+
protected exampleLanded(): void;
|
|
31
128
|
static styles: CSSResultGroup;
|
|
32
129
|
}
|
|
33
130
|
declare global {
|
|
@@ -1,12 +1,146 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement } from '@fusion.dev/helix-core';
|
|
3
3
|
import { HelixHeadlessChatComposer } from '@fusion.dev/helix-headless/chat';
|
|
4
|
+
import { html } from 'lit';
|
|
5
|
+
import { property } from 'lit/decorators.js';
|
|
6
|
+
import { repeat } from 'lit/directives/repeat.js';
|
|
4
7
|
import { styles as dictationStyles } from '../../shared/dictation/dictation.css.js';
|
|
5
8
|
import { styles } from './chat-composer.css.js';
|
|
9
|
+
import '../../tooltip/index.js';
|
|
10
|
+
const LIGHT_X = '--_chat-composer-light-x';
|
|
11
|
+
const LIGHT_Y = '--_chat-composer-light-y';
|
|
12
|
+
const REACH_X = '--_chat-composer-reach-x';
|
|
13
|
+
const REACH_Y = '--_chat-composer-reach-y';
|
|
14
|
+
const PACE = 1.2;
|
|
15
|
+
const SHORTEST = 800;
|
|
16
|
+
const LONGEST = 1600;
|
|
17
|
+
let registered = false;
|
|
18
|
+
function registerLight() {
|
|
19
|
+
if (registered || typeof CSS === 'undefined' || !('registerProperty' in CSS)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
registered = true;
|
|
23
|
+
for (const name of [LIGHT_X, LIGHT_Y]) {
|
|
24
|
+
try {
|
|
25
|
+
CSS.registerProperty({ inherits: false, initialValue: '0px', name, syntax: '<length>' });
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export function lapOf(w, h) {
|
|
32
|
+
const edge = 2 * (w + h);
|
|
33
|
+
if (edge === 0) {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
const at = (x, y, offset) => ({
|
|
37
|
+
[LIGHT_X]: `${x}px`,
|
|
38
|
+
[LIGHT_Y]: `${y}px`,
|
|
39
|
+
offset,
|
|
40
|
+
});
|
|
41
|
+
return [
|
|
42
|
+
{ ...at(0, 0, 0), opacity: 0 },
|
|
43
|
+
at(w, 0, w / edge),
|
|
44
|
+
at(w, h, (w + h) / edge),
|
|
45
|
+
at(0, h, (2 * w + h) / edge),
|
|
46
|
+
{ ...at(0, 0, 1), opacity: 0 },
|
|
47
|
+
{ offset: 0.08, opacity: 1 },
|
|
48
|
+
{ offset: 0.82, opacity: 1 },
|
|
49
|
+
].sort((one, two) => (one.offset ?? 0) - (two.offset ?? 0));
|
|
50
|
+
}
|
|
6
51
|
let HelixChatComposer = class HelixChatComposer extends HelixHeadlessChatComposer {
|
|
52
|
+
constructor() {
|
|
53
|
+
super(...arguments);
|
|
54
|
+
this.glow = false;
|
|
55
|
+
this.laps = [];
|
|
56
|
+
this.arrive = (event) => {
|
|
57
|
+
const from = event.relatedTarget;
|
|
58
|
+
const within = from instanceof Node &&
|
|
59
|
+
(from === this || this.contains(from) || this.renderRoot.contains(from));
|
|
60
|
+
if (!this.glow || within || matchMedia('(prefers-reduced-motion: reduce)').matches) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
this.sweep();
|
|
64
|
+
};
|
|
65
|
+
}
|
|
7
66
|
static { this.tier = 'helix-'; }
|
|
67
|
+
connectedCallback() {
|
|
68
|
+
super.connectedCallback();
|
|
69
|
+
registerLight();
|
|
70
|
+
this.addEventListener('focusin', this.arrive);
|
|
71
|
+
}
|
|
72
|
+
disconnectedCallback() {
|
|
73
|
+
super.disconnectedCallback();
|
|
74
|
+
this.removeEventListener('focusin', this.arrive);
|
|
75
|
+
for (const lap of this.laps) {
|
|
76
|
+
lap.cancel();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
sweep() {
|
|
80
|
+
const frame = this.renderRoot.querySelector('[part="composer"]');
|
|
81
|
+
if (!frame || typeof frame.animate !== 'function') {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const { height, width } = frame.getBoundingClientRect();
|
|
85
|
+
const keyframes = lapOf(width, height);
|
|
86
|
+
if (keyframes.length === 0) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const edge = 2 * (width + height);
|
|
90
|
+
const timing = {
|
|
91
|
+
duration: Math.min(LONGEST, Math.max(SHORTEST, edge / PACE)),
|
|
92
|
+
easing: 'linear',
|
|
93
|
+
};
|
|
94
|
+
for (const lap of this.laps) {
|
|
95
|
+
lap.cancel();
|
|
96
|
+
}
|
|
97
|
+
frame.style.setProperty(REACH_X, `${width / 2}px`);
|
|
98
|
+
frame.style.setProperty(REACH_Y, `${height / 2}px`);
|
|
99
|
+
this.laps = ['::before', '::after'].map((pseudoElement) => frame.animate(keyframes, { ...timing, pseudoElement }));
|
|
100
|
+
}
|
|
101
|
+
renderExample(example, leaving) {
|
|
102
|
+
const drawn = leaving === undefined
|
|
103
|
+
? [{ ...example, out: false }]
|
|
104
|
+
: leaving.index === example.index
|
|
105
|
+
? [{ ...leaving, out: true }]
|
|
106
|
+
: [
|
|
107
|
+
{ ...leaving, out: true },
|
|
108
|
+
{ ...example, out: false },
|
|
109
|
+
];
|
|
110
|
+
return html `${repeat(drawn, (one) => one.index, (one) => html `<textarea
|
|
111
|
+
part="example${one.out ? ' example-leaving' : ''}"
|
|
112
|
+
aria-hidden="true"
|
|
113
|
+
inert
|
|
114
|
+
readonly
|
|
115
|
+
tabindex="-1"
|
|
116
|
+
placeholder=${one.text}
|
|
117
|
+
?disabled=${this.isDisabled}
|
|
118
|
+
></textarea>`)}`;
|
|
119
|
+
}
|
|
120
|
+
willUpdate(changed) {
|
|
121
|
+
super.willUpdate(changed);
|
|
122
|
+
if (!changed.has('example') || !this.hasUpdated || !this.matches(':state(example-leaving)')) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const field = this.partNamed('field');
|
|
126
|
+
if (field && typeof CSS !== 'undefined' && CSS.supports('anchor-name: --a')) {
|
|
127
|
+
field.style.setProperty('--_chat-composer-held', `${field.getBoundingClientRect().height}px`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
updated(changed) {
|
|
131
|
+
super.updated(changed);
|
|
132
|
+
if (this.placeholders.length < 2) {
|
|
133
|
+
this.exampleLanded();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exampleLanded() {
|
|
137
|
+
this.partNamed('field')?.style.removeProperty('--_chat-composer-held');
|
|
138
|
+
}
|
|
8
139
|
static { this.styles = [styles, dictationStyles]; }
|
|
9
140
|
};
|
|
141
|
+
__decorate([
|
|
142
|
+
property({ reflect: true, type: Boolean })
|
|
143
|
+
], HelixChatComposer.prototype, "glow", void 0);
|
|
10
144
|
HelixChatComposer = __decorate([
|
|
11
145
|
customElement('helix-chat-composer')
|
|
12
146
|
], HelixChatComposer);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {display: block}:host(:focus-visible) {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1)}[part="message"] {align-items: start;display: grid;grid-template-columns: auto minmax(0, 1fr)}[part="avatar"] > slot::slotted(*) {margin-inline-end: var(--helix-space-sm)}[part="avatar"] {align-items: center;display: flex;font-size: var(--helix-text-sm);grid-column: 1;line-height: var(--helix-leading-normal);min-block-size: calc(1lh + var(--helix-space-xs) * 2)}[part="body"] {grid-column: 2}:host([author="me"]) [part="avatar"] {display: none}[part="body"] {display: grid;gap: var(--helix-space-2xs);justify-items: start;max-inline-size: min(var(--chat-message-measure, 42rem), 80%)}:host([author="me"]) [part="body"] {justify-items: end;justify-self: end}[part="actions"] {opacity: 0;pointer-events: none;transition: opacity var(--helix-duration-fast) var(--helix-easing-standard)}:host(:hover) [part="actions"], :host(:focus-within) [part="actions"] {opacity: 1;pointer-events: auto}@media (hover: none) {[part="actions"] {opacity: 1;pointer-events: auto}}[part="actions"] {--helix-size-control: calc(var(--helix-size-control-sm) - var(--helix-space-2xs));--helix-size-control-loose: calc(var(--helix-size-control) * 1.2);--helix-size-control-tight: calc(var(--helix-size-control) * 0.8);--helix-size-icon: var(--helix-size-icon-sm);--helix-size-icon-loose: calc(var(--helix-size-icon) * 1.2);--helix-size-icon-tight: calc(var(--helix-size-icon) * 0.8);align-items: center;display: inline-flex;gap: var(--helix-space-2xs)}[part="actions"][hidden] {display: none}[part="sources"] {--helix-size-avatar: var(--helix-size-avatar-sm);--helix-size-tag: var(--helix-size-tag-sm);--helix-size-icon: var(--helix-size-icon-sm);--helix-size-icon-loose: calc(var(--helix-size-icon) * 1.2);--helix-size-icon-tight: calc(var(--helix-size-icon) * 0.8);align-items: center;color: var(--helix-color-foreground-muted);display: flex;flex-wrap: wrap;font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);gap: var(--helix-space-2xs);line-height: var(--helix-leading-normal)}[part="sources"][hidden] {display: none}[part="work"] {color: var(--helix-color-foreground-muted);justify-self: stretch;min-inline-size: 0}[part="work"][hidden] {display: none}[part="content"] {background-color: var(--chat-message-background-color, color-mix(in oklab, var(--helix-color-foreground) 14%, transparent));border-radius: var(--chat-message-radius, var(--helix-radii-md));color: var(--chat-message-color, var(--helix-color-foreground));font-family: var(--helix-font-sans);font-size: var(--helix-text-sm);line-height: var(--helix-leading-normal);padding-block: var(--chat-message-padding-block, var(--helix-space-xs));padding-inline: var(--chat-message-padding-inline, var(--helix-space-sm))}:host([separation="plain"]) [part="content"] {background-color: transparent;padding-inline: var(--helix-space-none)}:host([separation="plain"]) [part="body"] {justify-items: stretch;max-inline-size: 100%}:host([separation="plain"]) [part="content"] {inline-size: auto}:host([author="me"]) [part="content"] {background-color: var(--chat-message-background-color-me, color-mix(in oklab, var(--helix-color-primary) 28%, transparent));color: var(--chat-message-color-me, var(--chat-message-color, var(--helix-color-foreground)))}[part="meta"] {align-items: center;color: var(--chat-message-meta-color, var(--helix-color-foreground-muted));display: flex;font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);gap: var(--helix-space-2xs)}:host([author="me"]) [part="meta"] {justify-content: flex-end}[part="content"] {inline-size: fit-content;max-inline-size: 100%;min-inline-size: 0;overflow-x: auto}[part="content"] slot[name="indicator"] {display: none}:host([state="streaming"]) [part="content"][data-empty] slot[name="indicator"] {display: block}slot[name="indicator"]::slotted(*) {background-color: var(--chat-indicator-background-color, var(--helix-color-surface-sunken));border-radius: var(--helix-radii-full);font-size: var(--helix-text-xs);padding-block: var(--helix-space-2xs);padding-inline: var(--helix-space-xs);--orb-size: var(--helix-size-icon-sm)}slot[name="indicator"]::slotted(helix-orb) {background-color: transparent;padding: var(--helix-space-none)}:host([state="failed"]) [part="meta"] {color: var(--helix-color-danger)}[part="state"] {align-items: center;display: inline-flex;font-weight: var(--helix-weight-medium);gap: var(--helix-space-2xs)}[part="mark"] {block-size: var(--helix-size-icon-tight);flex: 0 0 auto;inline-size: var(--helix-size-icon-tight)}:host([state="sending"]) [part="content"] {opacity: 0.6}[part="retry"] {background: none;border: 0;border-radius: var(--helix-radii-sm);color: var(--helix-color-foreground);cursor: pointer;font: inherit;font-weight: var(--helix-weight-medium);margin-inline-end: calc(var(--helix-space-2xs) * -1);min-block-size: calc(var(--helix-size-control-tight) - var(--helix-space-2xs));padding-block: var(--helix-space-2xs);padding-inline: var(--helix-space-2xs);text-decoration: underline;text-underline-offset: 0.2em}[part="retry"]:hover {background-color: var(--helix-color-hover)}[part="retry"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset)}@media print {[part="retry"] {display: none}[part="actions"] {display: none}[part="content"] slot[name="indicator"] {display: none}}`);
|
|
2
|
+
export const styles = createSheet(`:host {display: block}:host(:focus-visible) {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1)}[part="message"] {align-items: start;display: grid;grid-template-columns: auto minmax(0, 1fr)}[part="avatar"] > slot::slotted(*) {margin-inline-end: var(--helix-space-sm)}[part="avatar"] {align-items: center;display: flex;font-size: var(--helix-text-sm);grid-column: 1;line-height: var(--helix-leading-normal);min-block-size: calc(1lh + var(--helix-space-xs) * 2)}[part="body"] {grid-column: 2}:host([author="me"]) [part="avatar"] {display: none}[part="body"] {display: grid;gap: var(--helix-space-2xs);justify-items: start;max-inline-size: min(var(--chat-message-measure, 42rem), 80%)}:host([author="me"]) [part="body"] {justify-items: end;justify-self: end}[part="actions"] {opacity: 0;pointer-events: none;transition: opacity var(--helix-duration-fast) var(--helix-easing-standard)}:host(:hover) [part="actions"], :host(:focus-within) [part="actions"] {opacity: 1;pointer-events: auto}@media (hover: none) {[part="actions"] {opacity: 1;pointer-events: auto}}[part="actions"] {--helix-size-control: calc(var(--helix-size-control-sm) - var(--helix-space-2xs));--helix-size-control-loose: calc(var(--helix-size-control) * 1.2);--helix-size-control-tight: calc(var(--helix-size-control) * 0.8);--helix-size-icon: var(--helix-size-icon-sm);--helix-size-icon-loose: calc(var(--helix-size-icon) * 1.2);--helix-size-icon-tight: calc(var(--helix-size-icon) * 0.8);align-items: center;display: inline-flex;gap: var(--helix-space-2xs)}[part="actions"][hidden] {display: none}[part="sources"] {--helix-size-avatar: var(--helix-size-avatar-sm);--helix-size-tag: var(--helix-size-tag-sm);--helix-size-icon: var(--helix-size-icon-sm);--helix-size-icon-loose: calc(var(--helix-size-icon) * 1.2);--helix-size-icon-tight: calc(var(--helix-size-icon) * 0.8);align-items: center;color: var(--helix-color-foreground-muted);display: flex;flex-wrap: wrap;font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);gap: var(--helix-space-2xs);line-height: var(--helix-leading-normal)}[part="sources"][hidden] {display: none}[part="work"] {color: var(--helix-color-foreground-muted);justify-self: stretch;min-inline-size: 0}[part="work"][hidden] {display: none}[part="attachments"] {display: flex;flex-wrap: wrap;gap: var(--helix-space-2xs);max-inline-size: 100%;min-inline-size: 0}:host([author="me"]) [part="attachments"] {justify-content: flex-end}[part="attachments"][hidden] {display: none}[part="content"] {background-color: var(--chat-message-background-color, color-mix(in oklab, var(--helix-color-foreground) 14%, transparent));border-radius: var(--chat-message-radius, var(--helix-radii-md));color: var(--chat-message-color, var(--helix-color-foreground));font-family: var(--helix-font-sans);font-size: var(--helix-text-sm);line-height: var(--helix-leading-normal);padding-block: var(--chat-message-padding-block, var(--helix-space-xs));padding-inline: var(--chat-message-padding-inline, var(--helix-space-sm))}:host([separation="plain"]) [part="content"] {background-color: transparent;padding-inline: var(--helix-space-none)}:host([separation="plain"]) [part="body"] {justify-items: stretch;max-inline-size: 100%}:host([separation="plain"]) [part="content"] {inline-size: auto}:host([author="me"]) [part="content"] {background-color: var(--chat-message-background-color-me, color-mix(in oklab, var(--helix-color-primary) 28%, transparent));color: var(--chat-message-color-me, var(--chat-message-color, var(--helix-color-foreground)))}[part="meta"] {align-items: center;color: var(--chat-message-meta-color, var(--helix-color-foreground-muted));display: flex;font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);gap: var(--helix-space-2xs)}:host([author="me"]) [part="meta"] {justify-content: flex-end}[part="content"] {inline-size: fit-content;max-inline-size: 100%;min-inline-size: 0;overflow-wrap: break-word;overflow-x: auto}[part="content"] slot[name="indicator"] {display: none}:host([state="streaming"]) [part="content"][data-empty] slot[name="indicator"] {display: block}slot[name="indicator"]::slotted(*) {background-color: var(--chat-indicator-background-color, var(--helix-color-surface-sunken));border-radius: var(--helix-radii-full);font-size: var(--helix-text-xs);padding-block: var(--helix-space-2xs);padding-inline: var(--helix-space-xs);--orb-size: var(--helix-size-icon-sm)}slot[name="indicator"]::slotted(helix-orb) {background-color: transparent;padding: var(--helix-space-none)}:host([state="failed"]) [part="meta"] {color: var(--helix-color-danger)}[part="state"] {align-items: center;display: inline-flex;font-weight: var(--helix-weight-medium);gap: var(--helix-space-2xs)}[part="mark"] {block-size: var(--helix-size-icon-tight);flex: 0 0 auto;inline-size: var(--helix-size-icon-tight)}:host([state="sending"]) [part="content"] {opacity: 0.6}[part="retry"] {background: none;border: 0;border-radius: var(--helix-radii-sm);color: var(--helix-color-foreground);cursor: pointer;font: inherit;font-weight: var(--helix-weight-medium);margin-inline-end: calc(var(--helix-space-2xs) * -1);min-block-size: calc(var(--helix-size-control-tight) - var(--helix-space-2xs));padding-block: var(--helix-space-2xs);padding-inline: var(--helix-space-2xs);text-decoration: underline;text-underline-offset: 0.2em}[part="retry"]:hover {background-color: var(--helix-color-hover)}[part="retry"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset)}@media print {[part="retry"] {display: none}[part="actions"] {display: none}[part="content"] slot[name="indicator"] {display: none}}`);
|
|
@@ -18,6 +18,7 @@ import type { CSSResultGroup } from 'lit';
|
|
|
18
18
|
*
|
|
19
19
|
* @slot - The turn's content.
|
|
20
20
|
* @slot actions - Controls for the turn.
|
|
21
|
+
* @slot attachments - What the turn carries, such as images or files, above the bubble.
|
|
21
22
|
* @slot avatar - The author's avatar.
|
|
22
23
|
* @slot indicator - The indicator shown before the first token arrives. Replaces the three dots.
|
|
23
24
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {--_checkbox-size: var(--checkbox-size, var(--helix-size-checkbox));--_field-control-inline-size: var(--_checkbox-size);display: inline-flex;flex-direction: column;gap: var(--helix-space-2xs)}[part="field"] {align-items: center;cursor: pointer;display: inline-flex;gap: var(--helix-space-xs)}:host(:disabled) [part="field"] {cursor: default}:host(:disabled) {opacity: 0.5}[part="box"] {display: grid;flex: 0 0 auto;place-items: center}[part="box"] > * {grid-area: 1 / 1}[part="control"] {appearance: none;background-color: var(--checkbox-background-color,
|
|
2
|
+
export const styles = createSheet(`:host {--_checkbox-size: var(--checkbox-size, var(--helix-size-checkbox));--_field-control-inline-size: var(--_checkbox-size);display: inline-flex;flex-direction: column;gap: var(--helix-space-2xs)}[part="field"] {align-items: center;cursor: pointer;display: inline-flex;gap: var(--helix-space-xs)}:host(:disabled) [part="field"] {cursor: default}:host(:disabled) {opacity: 0.5}[part="box"] {display: grid;flex: 0 0 auto;place-items: center}[part="box"] > * {grid-area: 1 / 1}[part="control"] {appearance: none;background-color: var(--checkbox-background-color, transparent);block-size: var(--_checkbox-size);border: var(--helix-border-thin) solid var(--checkbox-border-color, var(--helix-color-foreground-subtle));border-radius: var(--helix-radii-sm);cursor: inherit;inline-size: var(--_checkbox-size);margin: var(--helix-space-none);transition: background-color var(--helix-duration-fast) var(--helix-easing-standard), border-color var(--helix-duration-fast) var(--helix-easing-standard)}:host(:not(:disabled)) [part="field"]:hover [part="control"] {border-color: var(--checkbox-border-color, var(--helix-color-foreground-muted))}:host(:state(checked)) [part="control"], :host(:state(indeterminate)) [part="control"] {border-color: var(--checkbox-border-color, var(--checkbox-checked-color, var(--helix-color-foreground)))}[part~="mark"] {background-color: var(--checkbox-mark-color, var(--helix-color-foreground));block-size: var(--_checkbox-size);inline-size: var(--_checkbox-size);mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5 10.2 16.7 18 8.4'/%3E%3C/svg%3E");mask-position: center;mask-repeat: no-repeat;mask-size: 100%;pointer-events: none;scale: 0;transition: scale var(--helix-duration-fast) var(--helix-easing-emphasized)}:host(:state(checked)) [part~="mark"], :host(:state(indeterminate)) [part~="mark"] {scale: 1}[part~="mark-dash"] {mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M7 12h10'/%3E%3C/svg%3E")}:host(:state(has-check)) [part~="mark"]:not([part~="mark-dash"]), :host(:state(has-dash)) [part~="mark-dash"] {background-color: transparent;color: var(--checkbox-mark-color, var(--helix-color-foreground));display: grid;mask-image: none;place-items: center}slot[name="check"]::slotted(*), slot[name="dash"]::slotted(*) {block-size: var(--checkbox-icon-size, 100%);inline-size: var(--checkbox-icon-size, 100%)}[part="control"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset)}:host(:state(invalid)) [part="control"], :host(:state(invalid)) [part="field"]:hover [part="control"] {border-color: var(--helix-color-danger)}:host(:state(invalid):state(checked)) [part="control"], :host(:state(invalid):state(indeterminate)) [part="control"] {border-color: var(--helix-color-danger)}:host(:not(:state(has-label))) [part="label"]:not([data-hidden]) {display: none}:host(:is([separation="filled"], [separation="outlined"])) {display: block}:host(:is([separation="filled"], [separation="outlined"])) [part="field"] {align-items: start;background-color: var(--checkbox-card-background-color, var(--helix-color-surface));border: var(--helix-border-thin) solid var(--checkbox-card-border-color, var(--helix-color-border));border-radius: var(--helix-radii-sm);display: flex;gap: var(--helix-space-sm);inline-size: 100%;padding: var(--checkbox-card-padding, var(--helix-space-md));transition: background-color var(--helix-duration-fast) var(--helix-easing-standard), border-color var(--helix-duration-fast) var(--helix-easing-standard)}:host([separation="filled"]) [part="field"] {border-color: transparent}:host(:not(:disabled):is([separation="filled"], [separation="outlined"])) [part="field"]:hover {border-color: var(--helix-color-foreground-muted)}:host(:is([separation="filled"], [separation="outlined"]):state(checked)) [part="field"] {background-color: var(--helix-color-surface-raised);border-color: var(--helix-color-primary);box-shadow: 0 0 0 var(--helix-border-thick) var(--helix-color-primary)}:host(:is([separation="filled"], [separation="outlined"])) [part="field"]:has([part="control"]:focus-visible) {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset)}:host(:is([separation="filled"], [separation="outlined"])) [part="control"]:focus-visible {outline: none}:host(:is([separation="filled"], [separation="outlined"])) [part="label"] {font-size: var(--helix-text-md);line-height: var(--helix-leading-normal)}:host(:is([separation="filled"], [separation="outlined"])) [part="box"] {font-size: var(--helix-text-md);line-height: var(--helix-leading-normal);min-block-size: 1lh}@media print {:host {box-shadow: none;print-color-adjust: exact}}`);
|
|
@@ -24,9 +24,7 @@ import '../../color-picker/index.js';
|
|
|
24
24
|
*
|
|
25
25
|
* @cssproperty --color-input-background-color - Fill behind the field.
|
|
26
26
|
* @cssproperty --color-input-border-color - Color of the panel's edge.
|
|
27
|
-
* @cssproperty --color-input-border-width - Width of the panel's edge. Defaults to `--helix-border-floating`,
|
|
28
|
-
* `--helix-border-floating`, which is `0`, so the panel is told apart by its lift unless a
|
|
29
|
-
* theme says otherwise.
|
|
27
|
+
* @cssproperty --color-input-border-width - Width of the panel's edge. Defaults to `--helix-border-floating`, a hairline, so the panel has an edge as well as its shadow over a dark page. Set it to `0` for the shadow alone.
|
|
30
28
|
* @cssproperty --color-input-panel-size - Width of the panel, and so of the square.
|
|
31
29
|
* @cssproperty --color-input-shadow - Shadow under the panel. Defaults to `--helix-shadow-floating`, so the panel keeps a shadow over any content below it.
|
|
32
30
|
* `--helix-shadow-floating`: a floating surface sits over content nobody can predict, so it
|
|
@@ -19,8 +19,7 @@ import '../../tag/root/index.js';
|
|
|
19
19
|
* @cssproperty --combobox-background-color - Fill behind the field.
|
|
20
20
|
* @cssproperty --combobox-border-color - Color of the panel's edge.
|
|
21
21
|
* @cssproperty --combobox-border-width - Width of the panel's edge. Follows
|
|
22
|
-
* `--helix-border-floating`,
|
|
23
|
-
* sets it apart.
|
|
22
|
+
* `--helix-border-floating`, a hairline, so the panel has an edge as well as its shadow over a dark page. Set it to `0` for the shadow alone.
|
|
24
23
|
* @cssproperty --combobox-control-size - Smallest the text field shrinks to once tags share its line.
|
|
25
24
|
* @cssproperty --combobox-panel-size - Width of the panel. Follows the field by default.
|
|
26
25
|
* @cssproperty --combobox-shadow - Shadow under the panel. Follows `--helix-shadow-floating`.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`helix-dialog::part(surface) {align-self: start;inline-size: min(var(--command-size, 40rem), calc(100vw - var(--helix-space-xl) * 2));margin-block-start: 20vh;padding: var(--helix-space-none)}:host {--option-padding: var(--helix-space-sm)}[part="listbox"] {--listbox-background-color: transparent;border: none;display: block}helix-listbox::part(items) {background-color: transparent;border: none;max-block-size: var(--command-list-size, 22rem);padding-block: var(--helix-space-xs)}helix-listbox::part(search) {border-block-end: var(--helix-border-thin) solid var(--helix-color-border);padding: var(--option-padding)}helix-listbox::part(search-field) {font-size: max(var(--helix-text-field-min), var(--helix-text-md))}:host {--_command-row: var(--helix-space-sm);--option-block-padding: var(--_command-row)}:host([data-density="sm"]), :host(:where([data-density="sm"] *)) {--_command-row: var(--helix-space-2xs)}:host([data-density="lg"]), :host(:where([data-density="lg"] *)) {--_command-row: var(--helix-space-md)}[part="footer"] {align-items: center;border-block-start: var(--helix-border-thin) solid var(--helix-color-border);color: var(--helix-color-foreground-muted);display: flex;font-size: var(--helix-text-xs);gap: var(--helix-space-sm);padding: var(--helix-space-xs) var(--option-padding)}[part="footer"][hidden] {display: none}:host([inline]) {background-color: var(--helix-color-surface);border: var(--helix-border-thin) solid var(--helix-color-border);border-radius: var(--helix-radii-sm);display: block;inline-size: min(var(--command-size, 40rem), 100%);overflow: hidden}@media print {:host {display: none}}`);
|
|
2
|
+
export const styles = createSheet(`helix-dialog::part(surface) {align-self: start;inline-size: min(var(--command-size, 40rem), calc(100vw - var(--helix-space-xl) * 2));margin-block-start: 20vh;padding: var(--helix-space-none)}:host {--option-padding: var(--helix-space-sm)}:host {--dialog-radius: var(--command-radius, var(--helix-radii-sm))}[part="listbox"] {--listbox-background-color: transparent;border: none;display: block}helix-listbox::part(items) {background-color: transparent;border: none;max-block-size: var(--command-list-size, 22rem);padding-block: var(--helix-space-xs)}helix-listbox::part(search) {border-block-end: var(--helix-border-thin) solid var(--helix-color-border);padding: var(--option-padding)}helix-listbox::part(search-field) {font-size: max(var(--helix-text-field-min), var(--helix-text-md))}:host {--_command-row: var(--helix-space-sm);--option-block-padding: var(--_command-row)}:host([data-density="sm"]), :host(:where([data-density="sm"] *)) {--_command-row: var(--helix-space-2xs)}:host([data-density="lg"]), :host(:where([data-density="lg"] *)) {--_command-row: var(--helix-space-md)}[part="footer"] {align-items: center;border-block-start: var(--helix-border-thin) solid var(--helix-color-border);color: var(--helix-color-foreground-muted);display: flex;font-size: var(--helix-text-xs);gap: var(--helix-space-sm);padding: var(--helix-space-xs) var(--option-padding)}[part="footer"][hidden] {display: none}:host([inline]) {background-color: var(--helix-color-surface);border: var(--helix-border-thin) solid var(--helix-color-border);border-radius: var(--helix-radii-sm);display: block;inline-size: min(var(--command-size, 40rem), 100%);overflow: hidden}@media print {:host {display: none}}`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HelixHeadlessCommand } from '@fusion.dev/helix-headless/command';
|
|
2
|
-
import type { CSSResultGroup } from 'lit';
|
|
2
|
+
import type { CSSResultGroup, PropertyValues } from 'lit';
|
|
3
3
|
import '../../dialog/index.js';
|
|
4
4
|
import '../../listbox/index.js';
|
|
5
5
|
import '../../option/index.js';
|
|
@@ -18,11 +18,26 @@ import '../../option/index.js';
|
|
|
18
18
|
* @documentation https://fusion.dev/helix/components/command
|
|
19
19
|
*
|
|
20
20
|
* @cssproperty --command-list-size - How tall the list grows before it scrolls.
|
|
21
|
+
* @cssproperty --command-radius - The corners of the palette's panel. Defaults to the dialog's.
|
|
21
22
|
* @cssproperty --command-size - How wide the palette is. Defaults to `40rem`.
|
|
22
23
|
*/
|
|
23
24
|
export declare class HelixCommand extends HelixHeadlessCommand {
|
|
24
25
|
static tier: string;
|
|
26
|
+
/**
|
|
27
|
+
* The panel's surface: `frosted` or `glass`, as on `Dialog`, which the
|
|
28
|
+
* palette opens in and hands the value to.
|
|
29
|
+
*
|
|
30
|
+
* Absent is the opaque overlay surface. `glass` is the page's translucent
|
|
31
|
+
* ground over the theme's blur, and `frosted` the same pair turned up, so a
|
|
32
|
+
* page whose panels are frosted has a palette that matches. Its strength is
|
|
33
|
+
* the theme's, as on `Popover`, `Menu` and `Drawer`.
|
|
34
|
+
*
|
|
35
|
+
* **No `transparent`, deliberately.** A palette over arbitrary page content
|
|
36
|
+
* is only readable because it has a ground.
|
|
37
|
+
*/
|
|
38
|
+
material?: 'frosted' | 'glass';
|
|
25
39
|
static styles: CSSResultGroup;
|
|
40
|
+
protected updated(changed: PropertyValues): void;
|
|
26
41
|
}
|
|
27
42
|
declare global {
|
|
28
43
|
interface HTMLElementTagNameMap {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement } from '@fusion.dev/helix-core';
|
|
3
3
|
import { HelixHeadlessCommand } from '@fusion.dev/helix-headless/command';
|
|
4
|
+
import { property } from 'lit/decorators.js';
|
|
4
5
|
import '../../dialog/index.js';
|
|
5
6
|
import '../../listbox/index.js';
|
|
6
7
|
import '../../option/index.js';
|
|
@@ -9,7 +10,22 @@ import { styles } from './command-root.css.js';
|
|
|
9
10
|
let HelixCommand = class HelixCommand extends HelixHeadlessCommand {
|
|
10
11
|
static { this.tier = 'helix-'; }
|
|
11
12
|
static { this.styles = [liveStyles, styles]; }
|
|
13
|
+
updated(changed) {
|
|
14
|
+
super.updated?.(changed);
|
|
15
|
+
const dialog = this.renderRoot.querySelector('helix-dialog');
|
|
16
|
+
if (dialog && dialog.material !== this.material) {
|
|
17
|
+
if (this.material === undefined) {
|
|
18
|
+
dialog.removeAttribute('material');
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
dialog.material = this.material;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
12
25
|
};
|
|
26
|
+
__decorate([
|
|
27
|
+
property({ reflect: true })
|
|
28
|
+
], HelixCommand.prototype, "material", void 0);
|
|
13
29
|
HelixCommand = __decorate([
|
|
14
30
|
customElement('helix-command')
|
|
15
31
|
], HelixCommand);
|
|
@@ -25,8 +25,7 @@ import '../../tag/root/index.js';
|
|
|
25
25
|
* @cssproperty --date-input-background-color - The fill behind the field.
|
|
26
26
|
* @cssproperty --date-input-border-color - The color of the panel's border.
|
|
27
27
|
* @cssproperty --date-input-border-width - The width of the panel's border. It
|
|
28
|
-
* follows `--helix-border-floating`,
|
|
29
|
-
* shadow unless a theme sets a border.
|
|
28
|
+
* follows `--helix-border-floating`, a hairline, so the panel has an edge as well as its shadow over a dark page. Set it to `0` for the shadow alone.
|
|
30
29
|
* @cssproperty --date-input-segment-focus-background-color - The fill behind the
|
|
31
30
|
* segment with focus, in `segmented`. It follows `--helix-color-primary-surface`.
|
|
32
31
|
* @cssproperty --date-input-segment-focus-color - The text of the segment with
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HelixHeadlessDeviceScreen } from '@fusion.dev/helix-headless/device-screen';
|
|
2
2
|
import type { CSSResultGroup } from 'lit';
|
|
3
3
|
import '../../icon-button/index.js';
|
|
4
|
+
import '../../tooltip/index.js';
|
|
4
5
|
/**
|
|
5
6
|
* @summary A device's screen, drawn from a stream you supply, that sends taps, swipes, keys, and button presses back to the device.
|
|
6
7
|
*
|
|
@@ -3,6 +3,7 @@ import { customElement } from '@fusion.dev/helix-core';
|
|
|
3
3
|
import { HelixHeadlessDeviceScreen } from '@fusion.dev/helix-headless/device-screen';
|
|
4
4
|
import { property } from 'lit/decorators.js';
|
|
5
5
|
import '../../icon-button/index.js';
|
|
6
|
+
import '../../tooltip/index.js';
|
|
6
7
|
import { styles as glyphStyles } from '../../shared/glyph/glyph.css.js';
|
|
7
8
|
import { styles } from './device-screen-root.css.js';
|
|
8
9
|
let HelixDeviceScreen = class HelixDeviceScreen extends HelixHeadlessDeviceScreen {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {display: contents}[part="surface"] {background-color: var(--dialog-background-color, var(--helix-color-surface-overlay));border: var(--dialog-border-width, var(--helix-border-floating)) solid var(--dialog-border-color, var(--helix-color-border));border-radius: var(--dialog-radius, var(--helix-radii-sm));box-shadow: var(--dialog-shadow, var(--helix-shadow-floating));box-sizing: border-box;color: var(--dialog-color, var(--helix-color-foreground));display: flex;flex-direction: column;gap: var(--helix-space-md);inline-size: min(var(--dialog-inline-size, 28rem), calc(100vw - var(--helix-space-xl)));max-block-size: calc(100dvh - var(--helix-space-xl));overflow-y: auto;padding: var(--dialog-padding, var(--helix-space-lg))}[part="surface"]:not([open]) {display: none}:host([size="sm"]) [part="surface"] {--dialog-inline-size: 22rem}:host([size="md"]) [part="surface"] {--dialog-inline-size: 28rem}:host([size="lg"]) [part="surface"] {--dialog-inline-size: 44rem}:host([size="full"]) [part="surface"] {--dialog-inline-size: 100vw}[part="surface"]:focus, [part="surface"]:focus-visible {outline: none}:host {--_dialog-scrim: var(--helix-color-overlay)}[part="surface"]::backdrop {background-color: var(--dialog-scrim, var(--_dialog-scrim))}::slotted([slot="header"]) {color: var(--helix-color-foreground);font-family: var(--helix-font-sans);font-size: var(--helix-text-xl);font-weight: var(--helix-weight-semibold);letter-spacing: var(--helix-tracking-tight);line-height: var(--helix-leading-tight);margin: var(--helix-space-none)}::slotted([slot="footer"]) {display: flex;gap: var(--helix-space-xs);justify-content: flex-start}[part="surface"] {opacity: 0;transition: opacity var(--helix-duration-normal) var(--helix-easing-standard), translate var(--helix-duration-normal) var(--helix-easing-decelerate), display var(--helix-duration-normal) allow-discrete, overlay var(--helix-duration-normal) allow-discrete;translate: 0 var(--dialog-rise, var(--helix-space-lg))}[part="surface"][open] {opacity: 1;translate: 0 0}@starting-style {[part="surface"][open] {opacity: 0;translate: 0 var(--dialog-rise, var(--helix-space-lg))}}[part="surface"]::backdrop {opacity: 0;transition: opacity var(--helix-duration-normal) var(--helix-easing-standard), display var(--helix-duration-normal) allow-discrete, overlay var(--helix-duration-normal) allow-discrete}[part="surface"][open]::backdrop {opacity: 1}@starting-style {[part="surface"][open]::backdrop {opacity: 0}}@media (width < 30rem) {[part="surface"] {margin-block-end: var(--helix-space-none);margin-block-start: auto;inline-size: 100vw;max-inline-size: 100vw;max-block-size: calc(100dvh - var(--helix-space-3xl));border-start-start-radius: var(--helix-radii-sm);border-start-end-radius: var(--helix-radii-sm);border-end-start-radius: var(--helix-radii-none);border-end-end-radius: var(--helix-radii-none);translate: 0 100%}@starting-style {[part="surface"][open] {translate: 0 100%}}}[part="surface"][data-refused] {animation: helix-dialog-refuse var(--helix-duration-normal) var(--helix-easing-emphasized)}@keyframes helix-dialog-refuse {50% {scale: 1.02}}@media (prefers-reduced-motion: reduce) {[part="surface"], [part="surface"]::backdrop {transition: none}[part="surface"][data-refused] {animation: none}}::slotted([slot="icon"]) {block-size: var(--dialog-icon-size, calc(var(--helix-size-icon-lg) * 2));display: block;inline-size: var(--dialog-icon-size, calc(var(--helix-size-icon-lg) * 2))}:host([text-align="center"]) [part="surface"] {text-align: center}:host([text-align="center"]) ::slotted([slot="footer"]) {justify-content: center}:host([text-align="center"]) ::slotted([slot="icon"]) {margin-inline: auto}[part="dismiss"] {all: unset;box-sizing: border-box;position: absolute;inset-block-start: calc(var(--dialog-padding, var(--helix-space-lg)) + (var(--helix-text-xl) * var(--helix-leading-tight) - var(--helix-size-control-sm)) / 2);inset-inline-end: var(--helix-space-md);block-size: var(--helix-size-control-sm);border-radius: var(--helix-radii-sm);color: var(--helix-color-foreground-muted);cursor: pointer;display: inline-flex;inline-size: var(--helix-size-control-sm);place-content: center;place-items: center;transition: color var(--helix-duration-fast) var(--helix-easing-standard)}[part="dismiss"] svg {block-size: var(--helix-size-icon-sm);inline-size: var(--helix-size-icon-sm)}[part="dismiss"]:hover {background-color: color-mix(in oklab, var(--helix-color-foreground) 8%, transparent);color: var(--helix-color-foreground)}[part="dismiss"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset)}:host([dismissible]) ::slotted([slot="header"]) {padding-inline-end: calc(var(--helix-size-control-sm) + var(--helix-space-xs))}@media (prefers-reduced-motion: reduce) {[part="dismiss"] {transition: none}}@media print {:host {display: none}}`);
|
|
2
|
+
export const styles = createSheet(`:host {display: contents}[part="surface"] {background-color: var(--dialog-background-color, var(--helix-color-surface-overlay));border: var(--dialog-border-width, var(--helix-border-floating)) solid var(--dialog-border-color, var(--helix-color-border));border-radius: var(--dialog-radius, var(--helix-radii-sm));box-shadow: var(--dialog-shadow, var(--helix-shadow-floating));box-sizing: border-box;color: var(--dialog-color, var(--helix-color-foreground));display: flex;flex-direction: column;gap: var(--helix-space-md);inline-size: min(var(--dialog-inline-size, 28rem), calc(100vw - var(--helix-space-xl)));max-block-size: calc(100dvh - var(--helix-space-xl));overflow-y: auto;padding: var(--dialog-padding, var(--helix-space-lg))}[part="surface"]:not([open]) {display: none}:host([size="sm"]) [part="surface"] {--dialog-inline-size: 22rem}:host([size="md"]) [part="surface"] {--dialog-inline-size: 28rem}:host([size="lg"]) [part="surface"] {--dialog-inline-size: 44rem}:host([size="full"]) [part="surface"] {--dialog-inline-size: 100vw}[part="surface"]:focus, [part="surface"]:focus-visible {outline: none}:host {--_dialog-scrim: var(--helix-color-overlay)}[part="surface"]::backdrop {background-color: var(--dialog-scrim, var(--_dialog-scrim))}::slotted([slot="header"]) {color: var(--helix-color-foreground);font-family: var(--helix-font-sans);font-size: var(--helix-text-xl);font-weight: var(--helix-weight-semibold);letter-spacing: var(--helix-tracking-tight);line-height: var(--helix-leading-tight);margin: var(--helix-space-none)}::slotted([slot="footer"]) {display: flex;gap: var(--helix-space-xs);justify-content: flex-start}[part="surface"] {opacity: 0;transition: opacity var(--helix-duration-normal) var(--helix-easing-standard), translate var(--helix-duration-normal) var(--helix-easing-decelerate), display var(--helix-duration-normal) allow-discrete, overlay var(--helix-duration-normal) allow-discrete;translate: 0 var(--dialog-rise, var(--helix-space-lg))}[part="surface"][open] {opacity: 1;translate: 0 0}@starting-style {[part="surface"][open] {opacity: 0;translate: 0 var(--dialog-rise, var(--helix-space-lg))}}[part="surface"]::backdrop {opacity: 0;transition: opacity var(--helix-duration-normal) var(--helix-easing-standard), display var(--helix-duration-normal) allow-discrete, overlay var(--helix-duration-normal) allow-discrete}[part="surface"][open]::backdrop {opacity: 1}@starting-style {[part="surface"][open]::backdrop {opacity: 0}}@media (width < 30rem) {[part="surface"] {margin-block-end: var(--helix-space-none);margin-block-start: auto;inline-size: 100vw;max-inline-size: 100vw;max-block-size: calc(100dvh - var(--helix-space-3xl));border-start-start-radius: var(--helix-radii-sm);border-start-end-radius: var(--helix-radii-sm);border-end-start-radius: var(--helix-radii-none);border-end-end-radius: var(--helix-radii-none);translate: 0 100%}@starting-style {[part="surface"][open] {translate: 0 100%}}}[part="surface"][data-refused] {animation: helix-dialog-refuse var(--helix-duration-normal) var(--helix-easing-emphasized)}@keyframes helix-dialog-refuse {50% {scale: 1.02}}@media (prefers-reduced-motion: reduce) {[part="surface"], [part="surface"]::backdrop {transition: none}[part="surface"][data-refused] {animation: none}}::slotted([slot="icon"]) {block-size: var(--dialog-icon-size, calc(var(--helix-size-icon-lg) * 2));display: block;inline-size: var(--dialog-icon-size, calc(var(--helix-size-icon-lg) * 2))}:host([text-align="center"]) [part="surface"] {text-align: center}:host([text-align="center"]) ::slotted([slot="footer"]) {justify-content: center}:host([text-align="center"]) ::slotted([slot="icon"]) {margin-inline: auto}[part="dismiss"] {all: unset;box-sizing: border-box;position: absolute;inset-block-start: calc(var(--dialog-padding, var(--helix-space-lg)) + (var(--helix-text-xl) * var(--helix-leading-tight) - var(--helix-size-control-sm)) / 2);inset-inline-end: var(--helix-space-md);block-size: var(--helix-size-control-sm);border-radius: var(--helix-radii-sm);color: var(--helix-color-foreground-muted);cursor: pointer;display: inline-flex;inline-size: var(--helix-size-control-sm);place-content: center;place-items: center;transition: color var(--helix-duration-fast) var(--helix-easing-standard)}[part="dismiss"] svg {block-size: var(--helix-size-icon-sm);inline-size: var(--helix-size-icon-sm)}[part="dismiss"]:hover {background-color: color-mix(in oklab, var(--helix-color-foreground) 8%, transparent);color: var(--helix-color-foreground)}[part="dismiss"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset)}:host([dismissible]) ::slotted([slot="header"]) {padding-inline-end: calc(var(--helix-size-control-sm) + var(--helix-space-xs))}@media (prefers-reduced-motion: reduce) {[part="dismiss"] {transition: none}}:host([material="glass"]) [part="surface"] {backdrop-filter: var(--dialog-backdrop, var(--helix-material-backdrop));background-color: var(--dialog-background-color, light-dark(var(--helix-material-translucent-strong), var(--helix-material-translucent)))}:host([material="frosted"]) [part="surface"] {backdrop-filter: var(--dialog-backdrop, blur(var(--helix-material-blur-lg)));background-color: var(--dialog-background-color, var(--helix-material-translucent-strong))}@supports not (overlay: auto) {[part="surface"], [part="surface"]::backdrop {transition-behavior: normal}}@media print {:host {display: none}}`);
|
|
@@ -14,11 +14,11 @@ import type { CSSResultGroup } from 'lit';
|
|
|
14
14
|
* @aliases Modal, Sheet
|
|
15
15
|
* @documentation https://fusion.dev/helix/components/dialog
|
|
16
16
|
*
|
|
17
|
+
* @cssproperty --dialog-backdrop - Filter applied behind a `frosted` or `glass` panel. Follows the theme's material policy.
|
|
17
18
|
* @cssproperty --dialog-background-color - The panel's fill. Follows `--helix-color-surface-overlay`.
|
|
18
19
|
* @cssproperty --dialog-border-color - Color of the panel's edge.
|
|
19
20
|
* @cssproperty --dialog-border-width - Width of the panel's edge. Follows
|
|
20
|
-
* `--helix-border-floating`,
|
|
21
|
-
* theme sets a border.
|
|
21
|
+
* `--helix-border-floating`, a hairline, so the panel has an edge as well as its shadow over a dark page. Set it to `0` for the shadow alone.
|
|
22
22
|
* @cssproperty --dialog-color - Color of the words in the panel. Follows `--helix-color-foreground`.
|
|
23
23
|
* @cssproperty --dialog-icon-size - How big the mark above the title is.
|
|
24
24
|
* @cssproperty --dialog-inline-size - Width of the panel.
|
|
@@ -33,6 +33,18 @@ import type { CSSResultGroup } from 'lit';
|
|
|
33
33
|
* @replaces dialog
|
|
34
34
|
*/
|
|
35
35
|
export declare class HelixDialog extends HelixHeadlessDialog {
|
|
36
|
+
/**
|
|
37
|
+
* The panel's surface: `frosted` or `glass`.
|
|
38
|
+
*
|
|
39
|
+
* Absent is the opaque overlay surface. `glass` is the page's translucent
|
|
40
|
+
* ground over the theme's blur, and `frosted` the same pair turned up, as
|
|
41
|
+
* on `Popover`, `Menu`, `Drawer` and `Tooltip`, so a page whose panels are
|
|
42
|
+
* frosted has dialogs that match.
|
|
43
|
+
*
|
|
44
|
+
* **No `transparent`, deliberately.** A dialog over arbitrary page content
|
|
45
|
+
* is only readable because it has a ground.
|
|
46
|
+
*/
|
|
47
|
+
material?: 'frosted' | 'glass';
|
|
36
48
|
/**
|
|
37
49
|
* How wide the panel is allowed to be.
|
|
38
50
|
*
|