@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"violet-teaching-tip.js","sourceRoot":"","sources":["../../src/teaching-tip/violet-teaching-tip.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEpF,OAAO,qBAAqB,CAAC;AAC7B,OAAO,mCAAmC,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE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AAE,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AAC/L,IAAI,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AAE7L,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,qBAAqB,CAAC,EAAE,CAAC;IAC7C,MAAM,WAAW,CAAC,MAAM,CAAC,iBAAiB,EAAE;QACxC,IAAI,EAAE,qBAAqB;QAC3B,QAAQ;QACR,MAAM;KACT,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { FASTElement, attr, css, html, observable } from \"@lushly-dev/fast-element\";\n\nimport \"../icon/violet-icon\";\nimport \"../icon-button/violet-icon-button\";\nimport { registerSystemCloseIcon } from \"../icon/generated\";\nimport { violetSurfaceTokenDefaults } from \"../theme/violet-token-defaults\";\n\nregisterSystemCloseIcon();\n\nlet violetTeachingTipId = 0;\n\nconst styles = css`\n ${violetSurfaceTokenDefaults}\n\n :host {\n display: inline-block;\n position: relative;\n\n --_tip-border-width: var(--violet-teaching-tip-border-width, var(--_card-border-width, 1px));\n --_tip-padding: var(--violet-teaching-tip-padding, var(--_space-md));\n --_tip-max-width: var(--violet-teaching-tip-max-width, 320px);\n --_tip-radius: var(--violet-teaching-tip-radius, var(--_radius-lg));\n --_tip-gap: var(--violet-teaching-tip-gap, var(--_space-sm));\n --_tip-background: var(--violet-teaching-tip-background, var(--_surface-card));\n --_tip-shadow: var(--violet-teaching-tip-shadow, var(--_shadow-floating));\n --_tip-border-color: var(--violet-teaching-tip-border-color, var(--_border-subtle));\n }\n\n .anchor {\n display: inline-block;\n anchor-name: --violet-teaching-tip-anchor;\n }\n\n .tip {\n box-sizing: border-box;\n position: fixed;\n position-anchor: --violet-teaching-tip-anchor;\n margin: 0;\n padding: 0;\n border: var(--_tip-border-width) solid var(--_tip-border-color);\n border-radius: var(--_tip-radius);\n background: var(--_tip-background);\n box-shadow: var(--_tip-shadow);\n color: inherit;\n font-family: inherit;\n max-inline-size: var(--_tip-max-width);\n inline-size: var(--_tip-max-width);\n z-index: var(--_layer-popover);\n\n opacity: 0;\n transform: scale(0.96);\n transition:\n opacity var(--_duration-fast) var(--_easing-standard),\n transform var(--_duration-fast) var(--_easing-standard),\n display var(--_duration-fast) var(--_easing-standard) allow-discrete,\n overlay var(--_duration-fast) var(--_easing-standard) allow-discrete;\n }\n\n .tip:popover-open {\n opacity: 1;\n transform: scale(1);\n\n @starting-style {\n opacity: 0;\n transform: scale(0.96);\n }\n }\n\n :host([positioning=\"above\"]) .tip {\n position-area: block-start center;\n margin-block-end: var(--_tip-gap);\n position-try-fallbacks: flip-block;\n }\n\n :host([positioning=\"below\"]) .tip {\n position-area: block-end center;\n margin-block-start: var(--_tip-gap);\n position-try-fallbacks: flip-block;\n }\n\n :host([positioning=\"before\"]) .tip {\n position-area: center left;\n margin-inline-end: var(--_tip-gap);\n position-try-fallbacks: flip-inline;\n }\n\n :host([positioning=\"after\"]) .tip {\n position-area: center right;\n margin-inline-start: var(--_tip-gap);\n position-try-fallbacks: flip-inline;\n }\n\n .header {\n display: flex;\n align-items: center;\n gap: var(--_space-sm);\n padding: var(--_tip-padding);\n padding-block-end: 0;\n }\n\n .header[hidden] {\n display: none;\n }\n\n .title {\n flex: 1;\n font-weight: 600;\n font-size: 13px;\n min-inline-size: 0;\n }\n\n .close-button {\n flex-shrink: 0;\n margin-inline-start: auto;\n }\n\n .body {\n padding: var(--_tip-padding);\n font-size: 12px;\n line-height: 16px;\n }\n\n .footer {\n display: flex;\n align-items: center;\n gap: var(--_space-sm);\n padding: var(--_tip-padding);\n padding-block-start: 0;\n }\n\n .footer[hidden] {\n display: none;\n }\n\n .step-indicator {\n font-size: 11px;\n color: var(--_text-secondary, #48534b);\n margin-inline-end: auto;\n }\n\n .step-indicator[hidden] {\n display: none;\n }\n\n @media (forced-colors: active) {\n .tip {\n forced-color-adjust: none;\n border: var(--_tip-border-width) solid ButtonText;\n background: Canvas;\n box-shadow: none;\n }\n }\n`;\n\nconst template = html<VioletTeachingTip>`\n <span class=\"anchor\" part=\"anchor\">\n <slot @slotchange=\"${x => x.handleSlotChange()}\"></slot>\n </span>\n <div\n class=\"tip\"\n part=\"tip\"\n id=\"${x => x.tipId}\"\n role=\"dialog\"\n aria-labelledby=\"${x => x.hasTitle ? x.titleId : undefined}\"\n aria-label=\"${x => x.hasTitle ? undefined : \"Teaching tip\"}\"\n popover=\"auto\"\n >\n <div class=\"header\" part=\"header\" ?hidden=\"${x => !x.hasTitle && x.noCloseButton}\">\n <span class=\"title\" part=\"title\" id=\"${x => x.titleId}\">\n <slot name=\"title\" @slotchange=\"${x => x.handleTitleSlotChange()}\"></slot>\n </span>\n <violet-icon-button\n class=\"close-button\"\n part=\"close-button\"\n ?hidden=\"${x => x.noCloseButton}\"\n appearance=\"quiet\"\n label=\"Dismiss tip\"\n @click=\"${x => x.hide()}\"\n >\n <violet-icon icon=\"system/close\" decorative></violet-icon>\n </violet-icon-button>\n </div>\n <div class=\"body\" part=\"body\">\n <slot name=\"body\">${x => x.content}</slot>\n </div>\n <div class=\"footer\" part=\"footer\" ?hidden=\"${x => !x.hasFooter && !x.totalSteps}\">\n <span\n class=\"step-indicator\"\n part=\"step-indicator\"\n ?hidden=\"${x => !x.totalSteps}\"\n >${x => x.totalSteps ? `${x.currentStep} of ${x.totalSteps}` : \"\"}</span>\n <slot name=\"footer\" @slotchange=\"${x => x.handleFooterSlotChange()}\"></slot>\n </div>\n </div>\n`;\n\n/**\n * Violet reusable teaching tip.\n *\n * @summary Positioned onboarding overlay anchored to a trigger element with title,\n * body content, optional step indicators, and a close button.\n * @fires open-change - Emitted when the teaching tip opens or closes. Detail: `{ open: boolean }`.\n * @fires dismiss - Emitted when the teaching tip is closed by the user.\n * @slot - Trigger element that the teaching tip anchors to.\n * @slot title - Teaching tip title text.\n * @slot body - Teaching tip body content (alternative to the content attribute).\n * @slot footer - Action buttons area (e.g., Next, Back, Done).\n * @csspart anchor - The wrapper around the trigger slot.\n * @csspart tip - The teaching tip popup element.\n * @csspart header - Header section wrapper.\n * @csspart title - Title text wrapper.\n * @csspart close-button - The dismiss button.\n * @csspart body - Body section wrapper.\n * @csspart footer - Footer section wrapper.\n * @csspart step-indicator - The step counter text.\n */\nexport class VioletTeachingTip extends FASTElement {\n @observable\n declare public hasTitle: boolean;\n\n @observable\n declare public hasFooter: boolean;\n\n declare public content: string;\n declare public positioning: string;\n declare public open: boolean;\n declare public anchor: string;\n declare public noCloseButton: boolean;\n declare public currentStep: number;\n declare public totalSteps: number;\n\n public readonly tipId: string;\n public readonly titleId: string;\n\n #triggerElement: Element | null = null;\n #externalAnchor: HTMLElement | null = null;\n #externalListenersAttached = false;\n\n public constructor() {\n super();\n this.hasTitle = false;\n this.hasFooter = false;\n this.content = \"\";\n this.positioning = \"below\";\n this.open = false;\n this.noCloseButton = false;\n this.currentStep = 0;\n this.totalSteps = 0;\n\n const id = violetTeachingTipId;\n violetTeachingTipId += 1;\n this.tipId = `violet-teaching-tip-${id}`;\n this.titleId = `violet-teaching-tip-title-${id}`;\n }\n\n get #tipElement(): HTMLElement | null {\n return this.shadowRoot?.querySelector(\".tip\") ?? null;\n }\n\n public show(): void {\n this.open = true;\n }\n\n public hide(): void {\n this.open = false;\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n\n const tip = this.#tipElement;\n if (tip) {\n tip.addEventListener(\"toggle\", this.#handleToggle);\n }\n\n this.#resolveExternalAnchor();\n this.#syncTriggerAria();\n\n if (this.open) {\n this.#showTip();\n }\n }\n\n public disconnectedCallback(): void {\n super.disconnectedCallback();\n\n const tip = this.#tipElement;\n if (tip) {\n tip.removeEventListener(\"toggle\", this.#handleToggle);\n }\n\n this.#detachExternalListeners();\n }\n\n public openChanged(): void {\n if (!this.$fastController.isConnected) {\n return;\n }\n\n if (this.open) {\n this.#showTip();\n } else {\n this.#hideTip();\n }\n\n this.#syncTriggerAria();\n }\n\n public anchorChanged(): void {\n if (!this.$fastController.isConnected) {\n return;\n }\n\n this.#detachExternalListeners();\n this.#resolveExternalAnchor();\n this.#syncTriggerAria();\n }\n\n public handleSlotChange(): void {\n const slot = this.shadowRoot?.querySelector(\"slot:not([name])\") as HTMLSlotElement | null;\n const assigned = slot?.assignedElements({ flatten: true }) ?? [];\n if (this.#triggerElement instanceof HTMLElement && !this.#externalListenersAttached) {\n this.#clearTriggerAria(this.#triggerElement);\n }\n this.#triggerElement = assigned[0] ?? null;\n this.#syncTriggerAria();\n }\n\n public handleTitleSlotChange(): void {\n const slot = this.shadowRoot?.querySelector('slot[name=\"title\"]') as HTMLSlotElement | null;\n this.hasTitle = (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 public handleFooterSlotChange(): void {\n const slot = this.shadowRoot?.querySelector('slot[name=\"footer\"]') as HTMLSlotElement | null;\n this.hasFooter = (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 #handleToggle = (event: Event): void => {\n const toggle = event as ToggleEvent;\n const isOpen = toggle.newState === \"open\";\n this.open = isOpen;\n this.#syncTriggerAria();\n this.$emit(\"open-change\", { open: isOpen });\n if (!isOpen) {\n this.$emit(\"dismiss\");\n }\n };\n\n #resolveExternalAnchor(): void {\n if (!this.anchor) {\n return;\n }\n\n const external = document.getElementById(this.anchor);\n if (!(external instanceof HTMLElement)) {\n return;\n }\n\n this.#externalAnchor = external;\n this.#triggerElement = external;\n external.style.setProperty(\"anchor-name\", \"--violet-teaching-tip-anchor\");\n this.#externalListenersAttached = true;\n }\n\n #detachExternalListeners(): void {\n if (!this.#externalListenersAttached || !this.#externalAnchor) {\n return;\n }\n\n this.#clearTriggerAria(this.#externalAnchor);\n this.#externalAnchor.style.removeProperty(\"anchor-name\");\n this.#externalAnchor = null;\n this.#externalListenersAttached = false;\n }\n\n #syncTriggerAria(): void {\n if (!(this.#triggerElement instanceof HTMLElement)) {\n return;\n }\n\n this.#triggerElement.setAttribute(\"aria-haspopup\", \"dialog\");\n this.#triggerElement.setAttribute(\"aria-expanded\", String(this.open));\n\n // The tip is in this shadow root, where an id from the trigger's tree cannot reach it.\n // Where shadow roots support a reference target, name this host and let its shadow root\n // forward the reference to the tip; elsewhere set no aria-controls rather than one that\n // points at nothing.\n const root = this.shadowRoot as (ShadowRoot & { referenceTarget?: string | null }) | null;\n if (root && \"referenceTarget\" in ShadowRoot.prototype) {\n root.referenceTarget = this.tipId;\n if (!this.id) {\n this.id = `${this.tipId}-host`;\n }\n this.#triggerElement.setAttribute(\"aria-controls\", this.id);\n } else {\n this.#triggerElement.removeAttribute(\"aria-controls\");\n }\n }\n\n #clearTriggerAria(element: HTMLElement): void {\n element.removeAttribute(\"aria-haspopup\");\n element.removeAttribute(\"aria-expanded\");\n element.removeAttribute(\"aria-controls\");\n }\n\n #showTip(): void {\n const tip = this.#tipElement;\n if (!tip) {\n return;\n }\n\n try {\n tip.showPopover();\n } catch {\n tip.toggleAttribute(\"popover-open\", true);\n tip.style.display = \"block\";\n }\n }\n\n #hideTip(): void {\n const tip = this.#tipElement;\n if (!tip) {\n return;\n }\n\n try {\n tip.hidePopover();\n } catch {\n tip.removeAttribute(\"popover-open\");\n tip.style.display = \"\";\n }\n }\n}\n\nexport type VioletTeachingTipPositioning = \"above\" | \"below\" | \"before\" | \"after\";\n\nattr(VioletTeachingTip.prototype, \"content\");\nattr(VioletTeachingTip.prototype, \"positioning\");\nattr({ mode: \"boolean\" })(VioletTeachingTip.prototype, \"open\");\nattr(VioletTeachingTip.prototype, \"anchor\");\nattr({ attribute: \"no-close-button\", mode: \"boolean\" })(VioletTeachingTip.prototype, \"noCloseButton\");\nattr({ attribute: \"current-step\", converter: { fromView: (val: string) => Number.parseInt(val, 10) || 0, toView: (val: number) => String(val) } })(VioletTeachingTip.prototype, \"currentStep\");\nattr({ attribute: \"total-steps\", converter: { fromView: (val: string) => Number.parseInt(val, 10) || 0, toView: (val: number) => String(val) } })(VioletTeachingTip.prototype, \"totalSteps\");\n\nif (!customElements.get(\"violet-teaching-tip\")) {\n await FASTElement.define(VioletTeachingTip, {\n name: \"violet-teaching-tip\",\n template,\n styles,\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"violet-teaching-tip.js","sourceRoot":"","sources":["../../src/teaching-tip/violet-teaching-tip.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEpF,OAAO,qBAAqB,CAAC;AAC7B,OAAO,mCAAmC,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAE5E,uBAAuB,EAAE,CAAC;AAE1B,IAAI,mBAAmB,GAAG,CAAC,CAAC;AAE5B,MAAM,MAAM,GAAG,GAAG,CAAA;MACZ,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4I/B,CAAC;AAEF,MAAM,QAAQ,GAAG,IAAI,CAAmB;;6BAEX,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,EAAE;;;;;cAKxC,C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GAAG,CAAC,qBAAqB,CAAC,EAAE,CAAC;IAC7C,MAAM,WAAW,CAAC,MAAM,CAAC,iBAAiB,EAAE;QACxC,IAAI,EAAE,qBAAqB;QAC3B,QAAQ;QACR,MAAM;KACT,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { FASTElement, attr, css, html, observable } from \"@lushly-dev/fast-element\";\n\nimport \"../icon/violet-icon\";\nimport \"../icon-button/violet-icon-button\";\nimport { registerSystemCloseIcon } from \"../icon/generated\";\nimport { violetSurfaceTokenDefaults } from \"../theme/violet-token-defaults\";\n\nregisterSystemCloseIcon();\n\nlet violetTeachingTipId = 0;\n\nconst styles = css`\n ${violetSurfaceTokenDefaults}\n\n :host {\n display: inline-block;\n position: relative;\n\n --_tip-border-width: var(--violet-teaching-tip-border-width, var(--_card-border-width, 1px));\n --_tip-padding: var(--violet-teaching-tip-padding, var(--_space-md));\n --_tip-max-width: var(--violet-teaching-tip-max-width, 320px);\n --_tip-radius: var(--violet-teaching-tip-radius, var(--_radius-lg));\n --_tip-gap: var(--violet-teaching-tip-gap, var(--_space-sm));\n --_tip-background: var(--violet-teaching-tip-background, var(--_surface-card));\n --_tip-shadow: var(--violet-teaching-tip-shadow, var(--_shadow-floating));\n --_tip-border-color: var(--violet-teaching-tip-border-color, var(--_border-subtle));\n }\n\n .anchor {\n display: inline-block;\n anchor-name: --violet-teaching-tip-anchor;\n }\n\n .tip {\n box-sizing: border-box;\n position: fixed;\n position-anchor: --violet-teaching-tip-anchor;\n margin: 0;\n padding: 0;\n border: var(--_tip-border-width) solid var(--_tip-border-color);\n border-radius: var(--_tip-radius);\n background: var(--_tip-background);\n box-shadow: var(--_tip-shadow);\n color: inherit;\n font-family: inherit;\n max-inline-size: var(--_tip-max-width);\n inline-size: var(--_tip-max-width);\n z-index: var(--_layer-popover);\n\n opacity: 0;\n transform: scale(0.96);\n transition:\n opacity var(--_duration-fast) var(--_easing-standard),\n transform var(--_duration-fast) var(--_easing-standard),\n display var(--_duration-fast) var(--_easing-standard) allow-discrete,\n overlay var(--_duration-fast) var(--_easing-standard) allow-discrete;\n }\n\n .tip:popover-open {\n opacity: 1;\n transform: scale(1);\n\n @starting-style {\n opacity: 0;\n transform: scale(0.96);\n }\n }\n\n :host([positioning=\"above\"]) .tip {\n position-area: block-start center;\n margin-block-end: var(--_tip-gap);\n position-try-fallbacks: flip-block;\n }\n\n :host([positioning=\"below\"]) .tip {\n position-area: block-end center;\n margin-block-start: var(--_tip-gap);\n position-try-fallbacks: flip-block;\n }\n\n :host([positioning=\"before\"]) .tip {\n position-area: center left;\n margin-inline-end: var(--_tip-gap);\n position-try-fallbacks: flip-inline;\n }\n\n :host([positioning=\"after\"]) .tip {\n position-area: center right;\n margin-inline-start: var(--_tip-gap);\n position-try-fallbacks: flip-inline;\n }\n\n .header {\n display: flex;\n align-items: center;\n gap: var(--_space-sm);\n padding: var(--_tip-padding);\n padding-block-end: 0;\n }\n\n .header[hidden] {\n display: none;\n }\n\n .title {\n flex: 1;\n font-weight: 600;\n font-size: 13px;\n min-inline-size: 0;\n }\n\n .close-button {\n flex-shrink: 0;\n margin-inline-start: auto;\n }\n\n .body {\n padding: var(--_tip-padding);\n font-size: 12px;\n line-height: 16px;\n }\n\n .footer {\n display: flex;\n align-items: center;\n gap: var(--_space-sm);\n padding: var(--_tip-padding);\n padding-block-start: 0;\n }\n\n .footer[hidden] {\n display: none;\n }\n\n .step-indicator {\n font-size: 11px;\n color: var(--_text-secondary);\n margin-inline-end: auto;\n }\n\n .step-indicator[hidden] {\n display: none;\n }\n\n @media (forced-colors: active) {\n .tip {\n forced-color-adjust: none;\n border: var(--_tip-border-width) solid ButtonText;\n background: Canvas;\n box-shadow: none;\n }\n }\n`;\n\nconst template = html<VioletTeachingTip>`\n <span class=\"anchor\" part=\"anchor\">\n <slot @slotchange=\"${x => x.handleSlotChange()}\"></slot>\n </span>\n <div\n class=\"tip\"\n part=\"tip\"\n id=\"${x => x.tipId}\"\n role=\"dialog\"\n aria-labelledby=\"${x => x.hasTitle ? x.titleId : undefined}\"\n aria-label=\"${x => x.hasTitle ? undefined : \"Teaching tip\"}\"\n popover=\"auto\"\n >\n <div class=\"header\" part=\"header\" ?hidden=\"${x => !x.hasTitle && x.noCloseButton}\">\n <span class=\"title\" part=\"title\" id=\"${x => x.titleId}\">\n <slot name=\"title\" @slotchange=\"${x => x.handleTitleSlotChange()}\"></slot>\n </span>\n <violet-icon-button\n class=\"close-button\"\n part=\"close-button\"\n ?hidden=\"${x => x.noCloseButton}\"\n appearance=\"quiet\"\n label=\"Dismiss tip\"\n @click=\"${x => x.hide()}\"\n >\n <violet-icon icon=\"system/close\" decorative></violet-icon>\n </violet-icon-button>\n </div>\n <div class=\"body\" part=\"body\">\n <slot name=\"body\">${x => x.content}</slot>\n </div>\n <div class=\"footer\" part=\"footer\" ?hidden=\"${x => !x.hasFooter && !x.totalSteps}\">\n <span\n class=\"step-indicator\"\n part=\"step-indicator\"\n ?hidden=\"${x => !x.totalSteps}\"\n >${x => x.totalSteps ? `${x.currentStep} of ${x.totalSteps}` : \"\"}</span>\n <slot name=\"footer\" @slotchange=\"${x => x.handleFooterSlotChange()}\"></slot>\n </div>\n </div>\n`;\n\n/**\n * Violet reusable teaching tip.\n *\n * @summary Positioned onboarding overlay anchored to a trigger element with title,\n * body content, optional step indicators, and a close button.\n * @fires open-change - Emitted when the teaching tip opens or closes. Detail: `{ open: boolean }`.\n * @fires dismiss - Emitted when the teaching tip is closed by the user.\n * @slot - Trigger element that the teaching tip anchors to.\n * @slot title - Teaching tip title text.\n * @slot body - Teaching tip body content (alternative to the content attribute).\n * @slot footer - Action buttons area (e.g., Next, Back, Done).\n * @csspart anchor - The wrapper around the trigger slot.\n * @csspart tip - The teaching tip popup element.\n * @csspart header - Header section wrapper.\n * @csspart title - Title text wrapper.\n * @csspart close-button - The dismiss button.\n * @csspart body - Body section wrapper.\n * @csspart footer - Footer section wrapper.\n * @csspart step-indicator - The step counter text.\n */\nexport class VioletTeachingTip extends FASTElement {\n @observable\n declare public hasTitle: boolean;\n\n @observable\n declare public hasFooter: boolean;\n\n declare public content: string;\n declare public positioning: string;\n declare public open: boolean;\n declare public anchor: string;\n declare public noCloseButton: boolean;\n declare public currentStep: number;\n declare public totalSteps: number;\n\n public readonly tipId: string;\n public readonly titleId: string;\n\n #triggerElement: Element | null = null;\n #externalAnchor: HTMLElement | null = null;\n #externalListenersAttached = false;\n\n public constructor() {\n super();\n this.hasTitle = false;\n this.hasFooter = false;\n this.content = \"\";\n this.positioning = \"below\";\n this.open = false;\n this.noCloseButton = false;\n this.currentStep = 0;\n this.totalSteps = 0;\n\n const id = violetTeachingTipId;\n violetTeachingTipId += 1;\n this.tipId = `violet-teaching-tip-${id}`;\n this.titleId = `violet-teaching-tip-title-${id}`;\n }\n\n get #tipElement(): HTMLElement | null {\n return this.shadowRoot?.querySelector(\".tip\") ?? null;\n }\n\n public show(): void {\n this.open = true;\n }\n\n public hide(): void {\n this.open = false;\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n\n const tip = this.#tipElement;\n if (tip) {\n tip.addEventListener(\"toggle\", this.#handleToggle);\n }\n\n this.#resolveExternalAnchor();\n this.#syncTriggerAria();\n\n if (this.open) {\n this.#showTip();\n }\n }\n\n public disconnectedCallback(): void {\n super.disconnectedCallback();\n\n const tip = this.#tipElement;\n if (tip) {\n tip.removeEventListener(\"toggle\", this.#handleToggle);\n }\n\n this.#detachExternalListeners();\n }\n\n public openChanged(): void {\n if (!this.$fastController.isConnected) {\n return;\n }\n\n if (this.open) {\n this.#showTip();\n } else {\n this.#hideTip();\n }\n\n this.#syncTriggerAria();\n }\n\n public anchorChanged(): void {\n if (!this.$fastController.isConnected) {\n return;\n }\n\n this.#detachExternalListeners();\n this.#resolveExternalAnchor();\n this.#syncTriggerAria();\n }\n\n public handleSlotChange(): void {\n const slot = this.shadowRoot?.querySelector(\"slot:not([name])\") as HTMLSlotElement | null;\n const assigned = slot?.assignedElements({ flatten: true }) ?? [];\n if (this.#triggerElement instanceof HTMLElement && !this.#externalListenersAttached) {\n this.#clearTriggerAria(this.#triggerElement);\n }\n this.#triggerElement = assigned[0] ?? null;\n this.#syncTriggerAria();\n }\n\n public handleTitleSlotChange(): void {\n const slot = this.shadowRoot?.querySelector('slot[name=\"title\"]') as HTMLSlotElement | null;\n this.hasTitle = (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 public handleFooterSlotChange(): void {\n const slot = this.shadowRoot?.querySelector('slot[name=\"footer\"]') as HTMLSlotElement | null;\n this.hasFooter = (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 #handleToggle = (event: Event): void => {\n const toggle = event as ToggleEvent;\n const isOpen = toggle.newState === \"open\";\n this.open = isOpen;\n this.#syncTriggerAria();\n this.$emit(\"open-change\", { open: isOpen });\n if (!isOpen) {\n this.$emit(\"dismiss\");\n }\n };\n\n #resolveExternalAnchor(): void {\n if (!this.anchor) {\n return;\n }\n\n const external = document.getElementById(this.anchor);\n if (!(external instanceof HTMLElement)) {\n return;\n }\n\n this.#externalAnchor = external;\n this.#triggerElement = external;\n external.style.setProperty(\"anchor-name\", \"--violet-teaching-tip-anchor\");\n this.#externalListenersAttached = true;\n }\n\n #detachExternalListeners(): void {\n if (!this.#externalListenersAttached || !this.#externalAnchor) {\n return;\n }\n\n this.#clearTriggerAria(this.#externalAnchor);\n this.#externalAnchor.style.removeProperty(\"anchor-name\");\n this.#externalAnchor = null;\n this.#externalListenersAttached = false;\n }\n\n #syncTriggerAria(): void {\n if (!(this.#triggerElement instanceof HTMLElement)) {\n return;\n }\n\n this.#triggerElement.setAttribute(\"aria-haspopup\", \"dialog\");\n this.#triggerElement.setAttribute(\"aria-expanded\", String(this.open));\n\n // The tip is in this shadow root, where an id from the trigger's tree cannot reach it.\n // Where shadow roots support a reference target, name this host and let its shadow root\n // forward the reference to the tip; elsewhere set no aria-controls rather than one that\n // points at nothing.\n const root = this.shadowRoot as (ShadowRoot & { referenceTarget?: string | null }) | null;\n if (root && \"referenceTarget\" in ShadowRoot.prototype) {\n root.referenceTarget = this.tipId;\n if (!this.id) {\n this.id = `${this.tipId}-host`;\n }\n this.#triggerElement.setAttribute(\"aria-controls\", this.id);\n } else {\n this.#triggerElement.removeAttribute(\"aria-controls\");\n }\n }\n\n #clearTriggerAria(element: HTMLElement): void {\n element.removeAttribute(\"aria-haspopup\");\n element.removeAttribute(\"aria-expanded\");\n element.removeAttribute(\"aria-controls\");\n }\n\n #showTip(): void {\n const tip = this.#tipElement;\n if (!tip) {\n return;\n }\n\n try {\n tip.showPopover();\n } catch {\n tip.toggleAttribute(\"popover-open\", true);\n tip.style.display = \"block\";\n }\n }\n\n #hideTip(): void {\n const tip = this.#tipElement;\n if (!tip) {\n return;\n }\n\n try {\n tip.hidePopover();\n } catch {\n tip.removeAttribute(\"popover-open\");\n tip.style.display = \"\";\n }\n }\n}\n\nexport type VioletTeachingTipPositioning = \"above\" | \"below\" | \"before\" | \"after\";\n\nattr(VioletTeachingTip.prototype, \"content\");\nattr(VioletTeachingTip.prototype, \"positioning\");\nattr({ mode: \"boolean\" })(VioletTeachingTip.prototype, \"open\");\nattr(VioletTeachingTip.prototype, \"anchor\");\nattr({ attribute: \"no-close-button\", mode: \"boolean\" })(VioletTeachingTip.prototype, \"noCloseButton\");\nattr({ attribute: \"current-step\", converter: { fromView: (val: string) => Number.parseInt(val, 10) || 0, toView: (val: number) => String(val) } })(VioletTeachingTip.prototype, \"currentStep\");\nattr({ attribute: \"total-steps\", converter: { fromView: (val: string) => Number.parseInt(val, 10) || 0, toView: (val: number) => String(val) } })(VioletTeachingTip.prototype, \"totalSteps\");\n\nif (!customElements.get(\"violet-teaching-tip\")) {\n await FASTElement.define(VioletTeachingTip, {\n name: \"violet-teaching-tip\",\n template,\n styles,\n });\n}\n"]}
|
|
@@ -27,11 +27,15 @@ const styles = css `
|
|
|
27
27
|
|
|
28
28
|
:host {
|
|
29
29
|
display: grid;
|
|
30
|
+
grid-template-columns: minmax(0, 1fr);
|
|
31
|
+
min-inline-size: 0;
|
|
30
32
|
--_space-layout-sm: var(--space-layout-sm, 12px);
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
.field {
|
|
34
36
|
display: grid;
|
|
37
|
+
grid-template-columns: minmax(0, 1fr);
|
|
38
|
+
min-inline-size: 0;
|
|
35
39
|
gap: 0;
|
|
36
40
|
}
|
|
37
41
|
|
|
@@ -48,6 +52,7 @@ const styles = css `
|
|
|
48
52
|
display: flex;
|
|
49
53
|
align-items: flex-start;
|
|
50
54
|
inline-size: 100%;
|
|
55
|
+
min-inline-size: 0;
|
|
51
56
|
min-block-size: calc(var(--_target-size) * 2 + var(--_space-layout-sm));
|
|
52
57
|
padding-inline: max(var(--_space-inline-md), calc(var(--_target-size) * 0.375));
|
|
53
58
|
padding-block: calc(var(--_target-size) * 0.25);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"violet-text-area.js","sourceRoot":"","sources":["../../src/text-area/violet-text-area.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAE9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,MAAM,YAAY,GAAG;IACjB,QAAQ,CAAC,KAAoB;QACzB,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC;IACD,MAAM,CAAC,KAAa;QAChB,OA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me/violet-token-defaults\";\nimport { installFormDisabled } from \"../foundations/violet-form-disabled\";\n\nconst rowConverter = {\n fromView(value: string | null): number {\n const parsed = Number(value);\n return Number.isFinite(parsed) && parsed > 0 ? parsed : 4;\n },\n toView(value: number): string {\n return String(value);\n },\n};\n\nconst maxlengthConverter = {\n fromView(value: unknown): number | null {\n if (value === null || value === undefined || value === \"\") {\n return null;\n }\n const parsed = Number(value);\n return Number.isInteger(parsed) && parsed >= 0 ? parsed : null;\n },\n toView(value: number | null): string | null {\n return value === null || value === undefined ? null : String(value);\n },\n};\n\nconst styles = css`\n ${violetFieldTokenDefaults}\n\n :host {\n display: grid;\n --_space-layout-sm: var(--space-layout-sm, 12px);\n }\n\n .field {\n display: grid;\n gap: 0;\n }\n\n .label {\n color: var(--_text-secondary);\n font-size: var(--_control-label-size);\n font-weight: var(--_type-label-weight);\n line-height: var(--_type-label-line);\n margin-block-end: var(--_space-field-gap);\n }\n\n .control-frame {\n box-sizing: border-box;\n display: flex;\n align-items: flex-start;\n inline-size: 100%;\n min-block-size: calc(var(--_target-size) * 2 + var(--_space-layout-sm));\n padding-inline: max(var(--_space-inline-md), calc(var(--_target-size) * 0.375));\n padding-block: calc(var(--_target-size) * 0.25);\n border: 1px solid var(--_border-subtle);\n border-radius: var(--_radius-md);\n background: var(--_field-background);\n color: var(--_field-text);\n box-shadow: var(--_field-shadow);\n font-family: inherit;\n transition:\n border-color var(--_duration-fast) var(--_easing-standard),\n box-shadow var(--_duration-base) var(--_easing-standard);\n }\n\n .control {\n flex: 1 1 auto;\n min-inline-size: 0;\n min-block-size: calc(var(--_target-size) * 1.5);\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--_field-text);\n box-shadow: none;\n font-family: inherit;\n font-size: var(--_control-body-size);\n line-height: var(--_type-body-line);\n resize: vertical;\n }\n\n .control::placeholder {\n color: var(--_field-placeholder);\n }\n\n .control:focus {\n outline: none;\n }\n\n .control-frame:hover {\n box-shadow: var(--_field-shadow-hover);\n }\n\n .control-frame:focus-within {\n border-color: var(--_field-border-focus);\n box-shadow: var(--_field-shadow-focus);\n }\n\n /*\n * A read-only field's fill is a wash of the text colour, too light behind the resting border\n * and the placeholder: its top line takes the strong border and its placeholder the secondary\n * text, so both keep their contrast on every surface (Loam's D159).\n */\n :host([readonly]) {\n --_field-border: var(--_field-border-readonly);\n --_field-placeholder: var(--_text-secondary);\n }\n\n :host([readonly]) .control-frame {\n background: var(--_field-background-readonly);\n }\n\n :host([disabled]) .control-frame,\n :host(:disabled) .control-frame {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n :host([disabled]) .control,\n :host(:disabled) .control {\n cursor: not-allowed;\n }\n\n :host([invalid]) .control-frame {\n border-color: var(--_danger-border);\n }\n\n slot[name=\"before\"] {\n display: inline-flex;\n align-items: flex-start;\n flex: 0 0 auto;\n color: var(--_text-muted);\n padding-block-start: calc((var(--_type-body-line) - 1em) / 2);\n }\n\n ::slotted([slot=\"before\"]) {\n margin-inline-end: var(--_space-inline-sm);\n }\n\n .supporting {\n color: var(--_text-muted);\n font-size: var(--_control-caption-size);\n line-height: var(--_type-caption-line);\n margin-block-start: var(--_space-field-gap);\n }\n\n /* There is no error line here, so under an invalid value the supporting text is the reason. */\n :host([invalid]) .supporting {\n color: var(--color-state-danger-text, var(--_text-muted));\n }\n\n @media (forced-colors: active) {\n .control-frame {\n border-color: ButtonText;\n }\n\n .control-frame:focus-within {\n outline: 2px solid Highlight;\n outline-offset: 1px;\n }\n\n :host([disabled]) .control-frame,\n :host(:disabled) .control-frame {\n border-color: GrayText;\n }\n }\n`;\n\nconst template = html<VioletTextArea>`\n <div class=\"field\" part=\"field\">\n ${when(\n x => Boolean(x.label),\n html<VioletTextArea>`\n <label class=\"label\" part=\"label\" for=\"${x => x.inputId}\">${x => x.label}</label>\n `,\n )}\n <div class=\"control-frame\" part=\"control-frame\">\n <slot name=\"before\" part=\"before\"></slot>\n <textarea\n id=\"${x => x.inputId}\"\n class=\"control\"\n part=\"control\"\n name=\"${x => x.name}\"\n rows=\"${x => x.rows}\"\n placeholder=\"${x => x.placeholder}\"\n maxlength=\"${x => x.maxLength ?? void 0}\"\n aria-describedby=\"${x => (x.supportingText ? x.supportingId : void 0)}\"\n :value=\"${x => x.value}\"\n ?disabled=\"${x => x.effectiveDisabled}\"\n ?readonly=\"${x => x.readonly}\"\n ?required=\"${x => x.required}\"\n aria-invalid=\"${x => x.invalid ? \"true\" : \"false\"}\"\n @input=\"${(x, c) => x.handleInput(c.event)}\"\n @change=\"${(x, c) => x.handleCommit(c.event)}\"\n ></textarea>\n </div>\n ${when(\n x => Boolean(x.supportingText),\n html<VioletTextArea>`\n <p id=\"${x => x.supportingId}\" class=\"supporting\" part=\"supporting-text\">${x => x.supportingText}</p>\n `,\n )}\n </div>\n`;\n\nlet violetTextAreaCount = 0;\n\n/**\n * Violet reusable text area primitive.\n *\n * @summary Token-driven multiline text area with built-in label and supporting text.\n * @slot before - Leading inline content such as a note or search affordance.\n * @fires input - Emitted when the value changes while typing.\n * @fires change - Emitted when the value is committed.\n * @csspart field - Field wrapper.\n * @csspart label - Label text element.\n * @csspart control-frame - Framed wrapper around the textarea and leading slot.\n * @csspart before - Leading slot for inline affordances.\n * @csspart control - Native textarea control.\n * @csspart supporting-text - Supporting text element.\n */\nexport class VioletTextArea extends FASTElement {\n public static readonly formAssociated = true;\n\n readonly #internals: ElementInternals;\n #defaultValue: string;\n\n public readonly inputId: string;\n\n /**\n * Id of the supporting text, which describes the textarea.\n */\n public readonly supportingId: string;\n\n /**\n * Optional field label.\n */\n declare public label: string;\n\n /**\n * Optional placeholder text.\n */\n declare public placeholder: string;\n\n /**\n * Current textarea value.\n */\n declare public value: string;\n\n /**\n * Optional supporting text shown below the field.\n */\n declare public supportingText: string;\n\n /**\n * Maximum number of characters, forwarded to the native textarea.\n */\n declare public maxLength: number | null;\n\n /**\n * Number of visible rows.\n */\n declare public rows: number;\n\n /**\n * Disables the field.\n */\n declare public disabled: boolean;\n\n /**\n * True while an ancestor `<fieldset disabled>` disables the control.\n */\n declare public fieldsetDisabled: boolean;\n\n /**\n * Author `disabled` or fieldset-disabled.\n */\n declare public readonly effectiveDisabled: boolean;\n\n /**\n * Marks the field readonly.\n */\n declare public readonly: boolean;\n\n /**\n * Marks the field invalid.\n */\n declare public invalid: boolean;\n\n /**\n * Native form name used during submission.\n */\n declare public name: string;\n\n /**\n * Marks the field as required.\n */\n declare public required: boolean;\n\n public constructor() {\n super();\n this.#internals = this.attachInternals();\n violetTextAreaCount += 1;\n this.inputId = `violet-text-area-${violetTextAreaCount}`;\n this.supportingId = `${this.inputId}-supporting`;\n this.label = \"\";\n this.placeholder = \"\";\n this.value = \"\";\n this.supportingText = \"\";\n this.maxLength = null;\n this.rows = 4;\n this.disabled = false;\n this.readonly = false;\n this.invalid = false;\n this.name = \"\";\n this.required = false;\n this.#defaultValue = \"\";\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n this.#defaultValue = this.getAttribute(\"value\") ?? this.value;\n this.#syncFormState();\n }\n\n public handleInput(event: Event): void {\n // The native `input` is composed and would reach the host as a second event; this element emits its own.\n event.stopPropagation();\n const control = event.currentTarget as HTMLTextAreaElement | null;\n this.value = control?.value ?? \"\";\n this.$emit(\"input\", { value: this.value });\n }\n\n public handleCommit(event: Event): void {\n const control = event.currentTarget as HTMLTextAreaElement | null;\n this.value = control?.value ?? \"\";\n this.$emit(\"change\", { value: this.value });\n }\n\n public formStateRestoreCallback(state: File | string | FormData | null): void {\n if (typeof state === \"string\") {\n this.value = state;\n }\n }\n\n public formResetCallback(): void {\n this.value = this.#defaultValue;\n }\n\n public get form(): HTMLFormElement | null {\n return this.#internals.form;\n }\n\n public get validity(): ValidityState {\n return this.#internals.validity;\n }\n\n public get validationMessage(): string {\n return this.#internals.validationMessage;\n }\n\n public get willValidate(): boolean {\n return this.#internals.willValidate;\n }\n\n public checkValidity(): boolean {\n return this.#internals.checkValidity();\n }\n\n public reportValidity(): boolean {\n return this.#internals.reportValidity();\n }\n\n public valueChanged(): void {\n this.#syncFormState();\n }\n\n public disabledChanged(): void {\n this.#syncFormState();\n }\n\n public invalidChanged(): void {\n this.#syncFormState();\n }\n\n public readonlyChanged(): void {\n this.#syncFormState();\n }\n\n public requiredChanged(): void {\n this.#syncFormState();\n }\n\n #syncFormState(): void {\n if (!this.$fastController.isConnected) {\n return;\n }\n\n const control = this.shadowRoot?.querySelector(\"textarea\") as HTMLTextAreaElement | null;\n\n this.#internals.ariaInvalid = this.invalid ? \"true\" : \"false\";\n this.#internals.setFormValue(this.effectiveDisabled ? null : this.value);\n\n if (this.effectiveDisabled || this.readonly) {\n this.#internals.setValidity({});\n return;\n }\n\n if (this.invalid) {\n this.#internals.setValidity({ customError: true }, \"Please correct this field.\", control ?? undefined);\n return;\n }\n\n if (this.required && !this.value.trim()) {\n this.#internals.setValidity({ valueMissing: true }, \"Please fill out this field.\", control ?? undefined);\n return;\n }\n\n this.#internals.setValidity({});\n }\n}\n\nattr(VioletTextArea.prototype, \"label\");\nattr(VioletTextArea.prototype, \"placeholder\");\n// fromView: typed text must not be reflected back into the DOM `value` attribute.\nattr({ mode: \"fromView\" })(VioletTextArea.prototype, \"value\");\nattr({ attribute: \"supporting-text\" })(VioletTextArea.prototype, \"supportingText\");\nattr({ attribute: \"maxlength\", converter: maxlengthConverter })(VioletTextArea.prototype, \"maxLength\");\nattr({ converter: rowConverter })(VioletTextArea.prototype, \"rows\");\nattr({ mode: \"boolean\" })(VioletTextArea.prototype, \"disabled\");\ninstallFormDisabled(VioletTextArea.prototype);\nattr({ mode: \"boolean\" })(VioletTextArea.prototype, \"readonly\");\nattr({ mode: \"boolean\" })(VioletTextArea.prototype, \"invalid\");\nattr(VioletTextArea.prototype, \"name\");\nattr({ mode: \"boolean\" })(VioletTextArea.prototype, \"required\");\n\nif (!customElements.get(\"violet-text-area\")) {\n await FASTElement.define(VioletTextArea, {\n name: \"violet-text-area\",\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true,\n },\n });\n}\n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IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAC/D,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AACvC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,cAAc,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AAEhE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE,CAAC;IAC1C,MAAM,WAAW,CAAC,MAAM,CAAC,cAAc,EAAE;QACrC,IAAI,EAAE,kBAAkB;QACxB,QAAQ;QACR,MAAM;QACN,aAAa,EAAE;YACX,cAAc,EAAE,IAAI;SACvB;KACJ,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { FASTElement, attr, css, html, when } from \"@lushly-dev/fast-element\";\n\nimport { violetFieldTokenDefaults } from \"../theme/violet-token-defaults\";\nimport { installFormDisabled } from \"../foundations/violet-form-disabled\";\n\nconst rowConverter = {\n fromView(value: string | null): number {\n const parsed = Number(value);\n return Number.isFinite(parsed) && parsed > 0 ? parsed : 4;\n },\n toView(value: number): string {\n return String(value);\n },\n};\n\nconst maxlengthConverter = {\n fromView(value: unknown): number | null {\n if (value === null || value === undefined || value === \"\") {\n return null;\n }\n const parsed = Number(value);\n return Number.isInteger(parsed) && parsed >= 0 ? parsed : null;\n },\n toView(value: number | null): string | null {\n return value === null || value === undefined ? null : String(value);\n },\n};\n\nconst styles = css`\n ${violetFieldTokenDefaults}\n\n :host {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n min-inline-size: 0;\n --_space-layout-sm: var(--space-layout-sm, 12px);\n }\n\n .field {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n min-inline-size: 0;\n gap: 0;\n }\n\n .label {\n color: var(--_text-secondary);\n font-size: var(--_control-label-size);\n font-weight: var(--_type-label-weight);\n line-height: var(--_type-label-line);\n margin-block-end: var(--_space-field-gap);\n }\n\n .control-frame {\n box-sizing: border-box;\n display: flex;\n align-items: flex-start;\n inline-size: 100%;\n min-inline-size: 0;\n min-block-size: calc(var(--_target-size) * 2 + var(--_space-layout-sm));\n padding-inline: max(var(--_space-inline-md), calc(var(--_target-size) * 0.375));\n padding-block: calc(var(--_target-size) * 0.25);\n border: 1px solid var(--_border-subtle);\n border-radius: var(--_radius-md);\n background: var(--_field-background);\n color: var(--_field-text);\n box-shadow: var(--_field-shadow);\n font-family: inherit;\n transition:\n border-color var(--_duration-fast) var(--_easing-standard),\n box-shadow var(--_duration-base) var(--_easing-standard);\n }\n\n .control {\n flex: 1 1 auto;\n min-inline-size: 0;\n min-block-size: calc(var(--_target-size) * 1.5);\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--_field-text);\n box-shadow: none;\n font-family: inherit;\n font-size: var(--_control-body-size);\n line-height: var(--_type-body-line);\n resize: vertical;\n }\n\n .control::placeholder {\n color: var(--_field-placeholder);\n }\n\n .control:focus {\n outline: none;\n }\n\n .control-frame:hover {\n box-shadow: var(--_field-shadow-hover);\n }\n\n .control-frame:focus-within {\n border-color: var(--_field-border-focus);\n box-shadow: var(--_field-shadow-focus);\n }\n\n /*\n * A read-only field's fill is a wash of the text colour, too light behind the resting border\n * and the placeholder: its top line takes the strong border and its placeholder the secondary\n * text, so both keep their contrast on every surface (Loam's D159).\n */\n :host([readonly]) {\n --_field-border: var(--_field-border-readonly);\n --_field-placeholder: var(--_text-secondary);\n }\n\n :host([readonly]) .control-frame {\n background: var(--_field-background-readonly);\n }\n\n :host([disabled]) .control-frame,\n :host(:disabled) .control-frame {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n :host([disabled]) .control,\n :host(:disabled) .control {\n cursor: not-allowed;\n }\n\n :host([invalid]) .control-frame {\n border-color: var(--_danger-border);\n }\n\n slot[name=\"before\"] {\n display: inline-flex;\n align-items: flex-start;\n flex: 0 0 auto;\n color: var(--_text-muted);\n padding-block-start: calc((var(--_type-body-line) - 1em) / 2);\n }\n\n ::slotted([slot=\"before\"]) {\n margin-inline-end: var(--_space-inline-sm);\n }\n\n .supporting {\n color: var(--_text-muted);\n font-size: var(--_control-caption-size);\n line-height: var(--_type-caption-line);\n margin-block-start: var(--_space-field-gap);\n }\n\n /* There is no error line here, so under an invalid value the supporting text is the reason. */\n :host([invalid]) .supporting {\n color: var(--color-state-danger-text, var(--_text-muted));\n }\n\n @media (forced-colors: active) {\n .control-frame {\n border-color: ButtonText;\n }\n\n .control-frame:focus-within {\n outline: 2px solid Highlight;\n outline-offset: 1px;\n }\n\n :host([disabled]) .control-frame,\n :host(:disabled) .control-frame {\n border-color: GrayText;\n }\n }\n`;\n\nconst template = html<VioletTextArea>`\n <div class=\"field\" part=\"field\">\n ${when(\n x => Boolean(x.label),\n html<VioletTextArea>`\n <label class=\"label\" part=\"label\" for=\"${x => x.inputId}\">${x => x.label}</label>\n `,\n )}\n <div class=\"control-frame\" part=\"control-frame\">\n <slot name=\"before\" part=\"before\"></slot>\n <textarea\n id=\"${x => x.inputId}\"\n class=\"control\"\n part=\"control\"\n name=\"${x => x.name}\"\n rows=\"${x => x.rows}\"\n placeholder=\"${x => x.placeholder}\"\n maxlength=\"${x => x.maxLength ?? void 0}\"\n aria-describedby=\"${x => (x.supportingText ? x.supportingId : void 0)}\"\n :value=\"${x => x.value}\"\n ?disabled=\"${x => x.effectiveDisabled}\"\n ?readonly=\"${x => x.readonly}\"\n ?required=\"${x => x.required}\"\n aria-invalid=\"${x => x.invalid ? \"true\" : \"false\"}\"\n @input=\"${(x, c) => x.handleInput(c.event)}\"\n @change=\"${(x, c) => x.handleCommit(c.event)}\"\n ></textarea>\n </div>\n ${when(\n x => Boolean(x.supportingText),\n html<VioletTextArea>`\n <p id=\"${x => x.supportingId}\" class=\"supporting\" part=\"supporting-text\">${x => x.supportingText}</p>\n `,\n )}\n </div>\n`;\n\nlet violetTextAreaCount = 0;\n\n/**\n * Violet reusable text area primitive.\n *\n * @summary Token-driven multiline text area with built-in label and supporting text.\n * @slot before - Leading inline content such as a note or search affordance.\n * @fires input - Emitted when the value changes while typing.\n * @fires change - Emitted when the value is committed.\n * @csspart field - Field wrapper.\n * @csspart label - Label text element.\n * @csspart control-frame - Framed wrapper around the textarea and leading slot.\n * @csspart before - Leading slot for inline affordances.\n * @csspart control - Native textarea control.\n * @csspart supporting-text - Supporting text element.\n */\nexport class VioletTextArea extends FASTElement {\n public static readonly formAssociated = true;\n\n readonly #internals: ElementInternals;\n #defaultValue: string;\n\n public readonly inputId: string;\n\n /**\n * Id of the supporting text, which describes the textarea.\n */\n public readonly supportingId: string;\n\n /**\n * Optional field label.\n */\n declare public label: string;\n\n /**\n * Optional placeholder text.\n */\n declare public placeholder: string;\n\n /**\n * Current textarea value.\n */\n declare public value: string;\n\n /**\n * Optional supporting text shown below the field.\n */\n declare public supportingText: string;\n\n /**\n * Maximum number of characters, forwarded to the native textarea.\n */\n declare public maxLength: number | null;\n\n /**\n * Number of visible rows.\n */\n declare public rows: number;\n\n /**\n * Disables the field.\n */\n declare public disabled: boolean;\n\n /**\n * True while an ancestor `<fieldset disabled>` disables the control.\n */\n declare public fieldsetDisabled: boolean;\n\n /**\n * Author `disabled` or fieldset-disabled.\n */\n declare public readonly effectiveDisabled: boolean;\n\n /**\n * Marks the field readonly.\n */\n declare public readonly: boolean;\n\n /**\n * Marks the field invalid.\n */\n declare public invalid: boolean;\n\n /**\n * Native form name used during submission.\n */\n declare public name: string;\n\n /**\n * Marks the field as required.\n */\n declare public required: boolean;\n\n public constructor() {\n super();\n this.#internals = this.attachInternals();\n violetTextAreaCount += 1;\n this.inputId = `violet-text-area-${violetTextAreaCount}`;\n this.supportingId = `${this.inputId}-supporting`;\n this.label = \"\";\n this.placeholder = \"\";\n this.value = \"\";\n this.supportingText = \"\";\n this.maxLength = null;\n this.rows = 4;\n this.disabled = false;\n this.readonly = false;\n this.invalid = false;\n this.name = \"\";\n this.required = false;\n this.#defaultValue = \"\";\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n this.#defaultValue = this.getAttribute(\"value\") ?? this.value;\n this.#syncFormState();\n }\n\n public handleInput(event: Event): void {\n // The native `input` is composed and would reach the host as a second event; this element emits its own.\n event.stopPropagation();\n const control = event.currentTarget as HTMLTextAreaElement | null;\n this.value = control?.value ?? \"\";\n this.$emit(\"input\", { value: this.value });\n }\n\n public handleCommit(event: Event): void {\n const control = event.currentTarget as HTMLTextAreaElement | null;\n this.value = control?.value ?? \"\";\n this.$emit(\"change\", { value: this.value });\n }\n\n public formStateRestoreCallback(state: File | string | FormData | null): void {\n if (typeof state === \"string\") {\n this.value = state;\n }\n }\n\n public formResetCallback(): void {\n this.value = this.#defaultValue;\n }\n\n public get form(): HTMLFormElement | null {\n return this.#internals.form;\n }\n\n public get validity(): ValidityState {\n return this.#internals.validity;\n }\n\n public get validationMessage(): string {\n return this.#internals.validationMessage;\n }\n\n public get willValidate(): boolean {\n return this.#internals.willValidate;\n }\n\n public checkValidity(): boolean {\n return this.#internals.checkValidity();\n }\n\n public reportValidity(): boolean {\n return this.#internals.reportValidity();\n }\n\n public valueChanged(): void {\n this.#syncFormState();\n }\n\n public disabledChanged(): void {\n this.#syncFormState();\n }\n\n public invalidChanged(): void {\n this.#syncFormState();\n }\n\n public readonlyChanged(): void {\n this.#syncFormState();\n }\n\n public requiredChanged(): void {\n this.#syncFormState();\n }\n\n #syncFormState(): void {\n if (!this.$fastController.isConnected) {\n return;\n }\n\n const control = this.shadowRoot?.querySelector(\"textarea\") as HTMLTextAreaElement | null;\n\n this.#internals.ariaInvalid = this.invalid ? \"true\" : \"false\";\n this.#internals.setFormValue(this.effectiveDisabled ? null : this.value);\n\n if (this.effectiveDisabled || this.readonly) {\n this.#internals.setValidity({});\n return;\n }\n\n if (this.invalid) {\n this.#internals.setValidity({ customError: true }, \"Please correct this field.\", control ?? undefined);\n return;\n }\n\n if (this.required && !this.value.trim()) {\n this.#internals.setValidity({ valueMissing: true }, \"Please fill out this field.\", control ?? undefined);\n return;\n }\n\n this.#internals.setValidity({});\n }\n}\n\nattr(VioletTextArea.prototype, \"label\");\nattr(VioletTextArea.prototype, \"placeholder\");\n// fromView: typed text must not be reflected back into the DOM `value` attribute.\nattr({ mode: \"fromView\" })(VioletTextArea.prototype, \"value\");\nattr({ attribute: \"supporting-text\" })(VioletTextArea.prototype, \"supportingText\");\nattr({ attribute: \"maxlength\", converter: maxlengthConverter })(VioletTextArea.prototype, \"maxLength\");\nattr({ converter: rowConverter })(VioletTextArea.prototype, \"rows\");\nattr({ mode: \"boolean\" })(VioletTextArea.prototype, \"disabled\");\ninstallFormDisabled(VioletTextArea.prototype);\nattr({ mode: \"boolean\" })(VioletTextArea.prototype, \"readonly\");\nattr({ mode: \"boolean\" })(VioletTextArea.prototype, \"invalid\");\nattr(VioletTextArea.prototype, \"name\");\nattr({ mode: \"boolean\" })(VioletTextArea.prototype, \"required\");\n\nif (!customElements.get(\"violet-text-area\")) {\n await FASTElement.define(VioletTextArea, {\n name: \"violet-text-area\",\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true,\n },\n });\n}\n"]}
|
|
@@ -6,10 +6,14 @@ const styles = css `
|
|
|
6
6
|
|
|
7
7
|
:host {
|
|
8
8
|
display: grid;
|
|
9
|
+
grid-template-columns: minmax(0, 1fr);
|
|
10
|
+
min-inline-size: 0;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
.field {
|
|
12
14
|
display: grid;
|
|
15
|
+
grid-template-columns: minmax(0, 1fr);
|
|
16
|
+
min-inline-size: 0;
|
|
13
17
|
gap: 0;
|
|
14
18
|
}
|
|
15
19
|
|
|
@@ -26,6 +30,7 @@ const styles = css `
|
|
|
26
30
|
display: flex;
|
|
27
31
|
align-items: center;
|
|
28
32
|
inline-size: 100%;
|
|
33
|
+
min-inline-size: 0;
|
|
29
34
|
block-size: var(--_target-size);
|
|
30
35
|
padding-inline: max(var(--_space-inline-md), calc(var(--_target-size) * 0.375));
|
|
31
36
|
padding-block: 0;
|
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,UAAU,CAAC,CAAC;AAEjE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,CAAC;IAC3C,MAAM,WAAW,CAAC,MAAM,CAAC,eAAe,EAAE;QACtC,IAAI,EAAE,mBAAmB;QACzB,QAAQ;QACR,MAAM;QACN,aAAa,EAAE;YACX,cAAc,EAAE,IAAI;SACvB;KACJ,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { FASTElement, Updates, attr, css, html, nullableNumberConverter, when } from \"@lushly-dev/fast-element\";\n\nimport { violetFieldTokenDefaults } from \"../theme/violet-token-defaults\";\nimport { installFormDisabled } from \"../foundations/violet-form-disabled\";\n\nexport type VioletTextFieldType = \"text\" | \"search\" | \"email\" | \"url\" | \"password\" | \"tel\" | \"number\" | \"date\";\n\nconst styles = css`\n ${violetFieldTokenDefaults}\n\n :host {\n display: grid;\n }\n\n .field {\n display: grid;\n gap: 0;\n }\n\n .label {\n color: var(--_text-secondary);\n font-size: var(--_control-label-size);\n font-weight: var(--_type-label-weight);\n line-height: var(--_type-label-line);\n margin-block-end: var(--_space-field-gap);\n }\n\n .control-frame {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n inline-size: 100%;\n block-size: var(--_target-size);\n padding-inline: max(var(--_space-inline-md), calc(var(--_target-size) * 0.375));\n padding-block: 0;\n border: 1px solid var(--_border-subtle);\n border-radius: var(--_radius-md);\n background: var(--_field-background);\n color: var(--_field-text);\n box-shadow: var(--_field-shadow);\n font-family: inherit;\n transition:\n border-color var(--_duration-fast) var(--_easing-standard),\n box-shadow var(--_duration-base) var(--_easing-standard);\n }\n\n .control {\n flex: 1 1 auto;\n min-inline-size: 0;\n border: 0;\n background: transparent;\n color: var(--_field-text);\n box-shadow: none;\n font-family: inherit;\n font-size: var(--_control-body-size);\n line-height: 1;\n }\n\n .control::placeholder {\n color: var(--_field-placeholder);\n }\n\n .control:focus {\n outline: none;\n }\n\n .control-frame:hover {\n box-shadow: var(--_field-shadow-hover);\n }\n\n .control-frame:focus-within {\n border-color: var(--_field-border-focus);\n box-shadow: var(--_field-shadow-focus);\n }\n\n /*\n * A read-only field's fill is a wash of the text colour, too light behind the resting border\n * and the placeholder: its top line takes the strong border and its placeholder the secondary\n * text, so both keep their contrast on every surface (Loam's D159).\n */\n :host([readonly]) {\n --_field-border: var(--_field-border-readonly);\n --_field-placeholder: var(--_text-secondary);\n }\n\n :host([readonly]) .control-frame {\n background: var(--_field-background-readonly);\n }\n\n :host([disabled]) .control-frame,\n :host(:disabled) .control-frame {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n :host([disabled]) .control,\n :host(:disabled) .control {\n cursor: not-allowed;\n }\n\n :host([invalid]) .control-frame {\n border-color: var(--_danger-border);\n }\n\n slot[name=\"before\"] {\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n color: var(--_text-muted);\n }\n\n ::slotted([slot=\"before\"]) {\n margin-inline-end: var(--_space-inline-sm);\n }\n\n .supporting {\n color: var(--_text-muted);\n font-size: var(--_control-caption-size);\n line-height: var(--_type-caption-line);\n margin-block-start: var(--_space-field-gap);\n }\n\n /* There is no error line here, so under an invalid value the supporting text is the reason. */\n :host([invalid]) .supporting {\n color: var(--color-state-danger-text, var(--_text-muted));\n }\n\n @media (forced-colors: active) {\n .control-frame {\n border-color: ButtonText;\n }\n\n .control-frame:focus-within {\n outline: 2px solid Highlight;\n outline-offset: 1px;\n }\n\n :host([disabled]) .control-frame,\n :host(:disabled) .control-frame {\n border-color: GrayText;\n }\n }\n`;\n\nconst template = html<VioletTextField>`\n <div class=\"field\" part=\"field\">\n ${when(\n x => Boolean(x.label),\n html<VioletTextField>`\n <label class=\"label\" part=\"label\" for=\"${x => x.inputId}\">${x => x.label}</label>\n `,\n )}\n <div class=\"control-frame\" part=\"control-frame\">\n <slot name=\"before\" part=\"before\"></slot>\n <input\n id=\"${x => x.inputId}\"\n class=\"control\"\n part=\"control\"\n name=\"${x => x.name}\"\n type=\"${x => x.type}\"\n min=\"${x => x.min}\"\n max=\"${x => x.max}\"\n step=\"${x => x.step}\"\n minlength=\"${x => x.minLength}\"\n maxlength=\"${x => x.maxLength}\"\n pattern=\"${x => x.pattern || null}\"\n autocomplete=\"${x => x.autocomplete}\"\n inputmode=\"${x => x.inputMode || null}\"\n placeholder=\"${x => x.placeholder}\"\n ?disabled=\"${x => x.effectiveDisabled}\"\n ?readonly=\"${x => x.readonly}\"\n ?required=\"${x => x.required}\"\n aria-label=\"${x => x.label || x.getAttribute(\"aria-label\") || \"\"}\"\n aria-invalid=\"${x => x.invalid ? \"true\" : \"false\"}\"\n @input=\"${(x, c) => x.handleInput(c.event)}\"\n @change=\"${(x, c) => x.handleCommit(c.event)}\"\n />\n </div>\n ${when(\n x => Boolean(x.supportingText),\n html<VioletTextField>`\n <p class=\"supporting\" part=\"supporting-text\" id=\"${x => x.supportingId}\">${x => x.supportingText}</p>\n `,\n )}\n </div>\n`;\n\nlet violetTextFieldCount = 0;\n\n/**\n * Violet reusable text field primitive.\n *\n * @summary Token-driven single-line text input with built-in label and supporting text.\n * @slot before - Leading inline content such as a search or password icon.\n * @fires input - Emitted when the value changes while typing.\n * @fires change - Emitted when the value is committed.\n * @csspart field - Field wrapper.\n * @csspart label - Label text element.\n * @csspart control-frame - Framed wrapper around the input and leading slot.\n * @csspart before - Leading slot for inline affordances.\n * @csspart control - Native input control.\n * @csspart supporting-text - Supporting text element.\n */\nexport class VioletTextField extends FASTElement {\n public static readonly formAssociated = true;\n\n readonly #internals: ElementInternals;\n readonly #describedByObserver = new MutationObserver(() => this.#scheduleSync());\n readonly #handleFocusIn = (): void => this.#syncDescribedBy();\n #syncScheduled = false;\n #defaultValue: string;\n\n public readonly inputId: string;\n\n /**\n * Id of the supporting text element inside the shadow root.\n */\n public readonly supportingId: string;\n\n /**\n * Optional field label.\n */\n declare public label: string;\n\n /**\n * Optional placeholder text.\n */\n declare public placeholder: string;\n\n /**\n * Current input value.\n */\n declare public value: string;\n\n /**\n * Native input type.\n */\n declare public type: VioletTextFieldType;\n\n /**\n * Optional supporting text shown below the field.\n */\n declare public supportingText: string;\n\n /**\n * Disables the field.\n */\n declare public disabled: boolean;\n\n /**\n * True while an ancestor `<fieldset disabled>` disables the control.\n */\n declare public fieldsetDisabled: boolean;\n\n /**\n * Author `disabled` or fieldset-disabled.\n */\n declare public readonly effectiveDisabled: boolean;\n\n /**\n * Marks the field readonly.\n */\n declare public readonly: boolean;\n\n /**\n * Marks the field invalid.\n */\n declare public invalid: boolean;\n\n /**\n * Native form name used during submission.\n */\n declare public name: string;\n\n /**\n * Marks the field as required.\n */\n declare public required: boolean;\n\n /**\n * Native `min` constraint (numbers, dates) forwarded to the input.\n */\n declare public min?: string | null;\n\n /**\n * Native `max` constraint (numbers, dates) forwarded to the input.\n */\n declare public max?: string | null;\n\n /**\n * Native `step` constraint forwarded to the input.\n */\n declare public step?: string | null;\n\n /**\n * Native `minlength` constraint forwarded to the input.\n */\n declare public minLength?: number | null;\n\n /**\n * Native `maxlength` constraint forwarded to the input.\n */\n declare public maxLength?: number | null;\n\n /**\n * Native `pattern` constraint forwarded to the input.\n */\n declare public pattern?: string | null;\n\n /**\n * Native `autocomplete` hint forwarded to the input.\n */\n declare public autocomplete?: string | null;\n\n /**\n * Native `inputmode` virtual-keyboard hint forwarded to the input\n * (`none`, `text`, `decimal`, `numeric`, `tel`, `search`, `email` or `url`).\n */\n declare public inputMode: string;\n\n public constructor() {\n super();\n this.#internals = this.attachInternals();\n violetTextFieldCount += 1;\n this.inputId = `violet-text-field-${violetTextFieldCount}`;\n this.supportingId = `${this.inputId}-supporting`;\n this.label = \"\";\n this.placeholder = \"\";\n this.value = \"\";\n this.type = \"text\";\n this.supportingText = \"\";\n this.disabled = false;\n this.readonly = false;\n this.invalid = false;\n this.name = \"\";\n this.required = false;\n this.#defaultValue = \"\";\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n this.#writeControl();\n this.#defaultValue = this.getAttribute(\"value\") ?? this.value;\n this.#syncFormState();\n this.#syncDescribedBy();\n this.#describedByObserver.observe(this, { attributes: true, attributeFilter: [\"aria-describedby\"] });\n this.addEventListener(\"focusin\", this.#handleFocusIn);\n this.#scheduleSync();\n }\n\n public disconnectedCallback(): void {\n super.disconnectedCallback();\n this.#describedByObserver.disconnect();\n this.removeEventListener(\"focusin\", this.#handleFocusIn);\n }\n\n public handleInput(event: Event): void {\n // The native `input` is composed and would reach the host as a second event; this element emits its own.\n event.stopPropagation();\n const control = event.currentTarget as HTMLInputElement | null;\n this.value = control?.value ?? \"\";\n this.$emit(\"input\", { value: this.value });\n }\n\n public handleCommit(event: Event): void {\n const control = event.currentTarget as HTMLInputElement | null;\n this.value = control?.value ?? \"\";\n this.$emit(\"change\", { value: this.value });\n }\n\n public formStateRestoreCallback(state: File | string | FormData | null): void {\n if (typeof state === \"string\") {\n this.value = state;\n }\n }\n\n public formResetCallback(): void {\n this.value = this.#defaultValue;\n // Also when the value is unchanged: a partial entry, such as \"-\", reads as \"\" and must go too.\n this.#writeControl(true);\n }\n\n public get form(): HTMLFormElement | null {\n return this.#internals.form;\n }\n\n public get validity(): ValidityState {\n return this.#internals.validity;\n }\n\n public get validationMessage(): string {\n return this.#internals.validationMessage;\n }\n\n public get willValidate(): boolean {\n return this.#internals.willValidate;\n }\n\n public checkValidity(): boolean {\n return this.#internals.checkValidity();\n }\n\n public reportValidity(): boolean {\n return this.#internals.reportValidity();\n }\n\n public valueChanged(): void {\n this.#writeControl();\n this.#syncFormState();\n this.#scheduleSync();\n }\n\n // Writes `value` to the native input only when it differs. A number input reads `\"\"` while it holds a\n // partial entry such as `-`, so writing that `\"\"` back, as a binding would, erased the `-` (#712).\n #writeControl(force = false): void {\n const control = this.shadowRoot?.querySelector<HTMLInputElement>(\"input.control\");\n if (control && (force || control.value !== this.value)) {\n control.value = this.value;\n }\n }\n\n public typeChanged(): void {\n this.#scheduleSync();\n }\n\n public minChanged(): void {\n this.#scheduleSync();\n }\n\n public maxChanged(): void {\n this.#scheduleSync();\n }\n\n public stepChanged(): void {\n this.#scheduleSync();\n }\n\n public minLengthChanged(): void {\n this.#scheduleSync();\n }\n\n public maxLengthChanged(): void {\n this.#scheduleSync();\n }\n\n public patternChanged(): void {\n this.#scheduleSync();\n }\n\n public supportingTextChanged(): void {\n this.#scheduleSync();\n }\n\n public disabledChanged(): void {\n this.#syncFormState();\n }\n\n public invalidChanged(): void {\n this.#syncFormState();\n }\n\n public readonlyChanged(): void {\n this.#syncFormState();\n }\n\n public requiredChanged(): void {\n this.#syncFormState();\n this.#scheduleSync();\n }\n\n /**\n * Template bindings flush on the next update batch, so validity derived from the inner\n * input and the describedby targets are re-synced once that batch has landed.\n */\n #scheduleSync(): void {\n if (this.#syncScheduled || !this.$fastController.isConnected) {\n return;\n }\n\n this.#syncScheduled = true;\n Updates.enqueue(() => {\n Updates.enqueue(() => {\n this.#syncScheduled = false;\n this.#syncFormState();\n this.#syncDescribedBy();\n });\n });\n }\n\n /**\n * IDREFs in a host `aria-describedby` cannot cross the shadow boundary, so the ids are\n * resolved in the host's root node and assigned to the input through element reflection\n * (`ariaDescribedByElements`), together with the supporting text. Without element\n * reflection only the supporting text is linked, by an IDREF inside the shadow root;\n * light-DOM targets cannot be referenced in that case.\n */\n #syncDescribedBy(): void {\n const control = this.shadowRoot?.querySelector(\"input\") as HTMLInputElement | null;\n\n if (!control) {\n return;\n }\n\n const targets: Element[] = [];\n const root = this.getRootNode() as Document | ShadowRoot;\n const hostIds = (this.getAttribute(\"aria-describedby\") ?? \"\").split(/\\s+/).filter(Boolean);\n\n for (const id of hostIds) {\n const target = root.getElementById?.(id) ?? null;\n if (target && !targets.includes(target)) {\n targets.push(target);\n }\n }\n\n const supporting = this.shadowRoot?.getElementById(this.supportingId) ?? null;\n if (supporting) {\n targets.push(supporting);\n }\n\n const hasElementReflection: boolean = \"ariaDescribedByElements\" in control;\n if (hasElementReflection) {\n control.removeAttribute(\"aria-describedby\");\n control.ariaDescribedByElements = targets.length ? targets : null;\n return;\n }\n\n if (supporting) {\n control.setAttribute(\"aria-describedby\", this.supportingId);\n } else {\n control.removeAttribute(\"aria-describedby\");\n }\n }\n\n #syncFormState(): void {\n if (!this.$fastController.isConnected) {\n return;\n }\n\n const control = this.shadowRoot?.querySelector(\"input\") as HTMLInputElement | null;\n\n this.#internals.ariaInvalid = this.invalid ? \"true\" : \"false\";\n this.#internals.setFormValue(this.effectiveDisabled ? null : this.value);\n\n if (this.effectiveDisabled || this.readonly) {\n this.#internals.setValidity({});\n return;\n }\n\n if (this.invalid) {\n this.#internals.setValidity({ customError: true }, \"Please correct this field.\", control ?? undefined);\n return;\n }\n\n if (this.required && !this.value.trim()) {\n this.#internals.setValidity({ valueMissing: true }, \"Please fill out this field.\", control ?? undefined);\n return;\n }\n\n if (!control) {\n this.#internals.setValidity({});\n return;\n }\n\n // Native length validity only fires for user edits, and the `:value` binding resets that\n // flag, so length limits are evaluated here against the current value instead.\n const native = control.validity;\n const length = this.value.length;\n const tooShort = native.tooShort || (this.minLength != null && length > 0 && length < this.minLength);\n const tooLong = native.tooLong || (this.maxLength != null && length > this.maxLength);\n\n if (native.valid && !tooShort && !tooLong) {\n this.#internals.setValidity({});\n return;\n }\n\n let message = control.validationMessage;\n if (!message && tooShort) {\n message = `Please lengthen this text to ${this.minLength} characters or more.`;\n } else if (!message && tooLong) {\n message = `Please shorten this text to ${this.maxLength} characters or less.`;\n }\n\n this.#internals.setValidity(\n {\n valueMissing: native.valueMissing,\n typeMismatch: native.typeMismatch,\n patternMismatch: native.patternMismatch,\n tooLong,\n tooShort,\n rangeUnderflow: native.rangeUnderflow,\n rangeOverflow: native.rangeOverflow,\n stepMismatch: native.stepMismatch,\n badInput: native.badInput,\n customError: native.customError,\n },\n message,\n control,\n );\n }\n}\n\nattr(VioletTextField.prototype, \"label\");\nattr(VioletTextField.prototype, \"placeholder\");\n// fromView: typed text must not be reflected back into the DOM `value` attribute.\nattr({ mode: \"fromView\" })(VioletTextField.prototype, \"value\");\nattr(VioletTextField.prototype, \"type\");\nattr(VioletTextField.prototype, \"min\");\nattr(VioletTextField.prototype, \"max\");\nattr(VioletTextField.prototype, \"step\");\nattr({ attribute: \"minlength\", converter: nullableNumberConverter })(VioletTextField.prototype, \"minLength\");\nattr({ attribute: \"maxlength\", converter: nullableNumberConverter })(VioletTextField.prototype, \"maxLength\");\nattr(VioletTextField.prototype, \"pattern\");\nattr(VioletTextField.prototype, \"autocomplete\");\nattr({ attribute: \"inputmode\" })(VioletTextField.prototype, \"inputMode\");\nattr({ attribute: \"supporting-text\" })(VioletTextField.prototype, \"supportingText\");\nattr({ mode: \"boolean\" })(VioletTextField.prototype, \"disabled\");\ninstallFormDisabled(VioletTextField.prototype);\nattr({ mode: \"boolean\" })(VioletTextField.prototype, \"readonly\");\nattr({ mode: \"boolean\" })(VioletTextField.prototype, \"invalid\");\nattr(VioletTextField.prototype, \"name\");\nattr({ mode: \"boolean\" })(VioletTextField.prototype, \"required\");\n\nif (!customElements.get(\"violet-text-field\")) {\n await FASTElement.define(VioletTextField, {\n name: \"violet-text-field\",\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true,\n },\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"violet-text-field.js","sourceRoot":"","sources":["../../src/text-field/violet-text-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,uBAAuB,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEhH,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAI1E,MAAM,MAAM,GAAG,GAAG,CAAA;MACZ,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2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E,WAAW,EAAE,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AACzE,IAAI,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;AACpF,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AACjE,mBAAmB,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;AAC/C,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AACjE,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAChE,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AACxC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AAEjE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,CAAC;IAC3C,MAAM,WAAW,CAAC,MAAM,CAAC,eAAe,EAAE;QACtC,IAAI,EAAE,mBAAmB;QACzB,QAAQ;QACR,MAAM;QACN,aAAa,EAAE;YACX,cAAc,EAAE,IAAI;SACvB;KACJ,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { FASTElement, Updates, attr, css, html, nullableNumberConverter, when } from \"@lushly-dev/fast-element\";\n\nimport { violetFieldTokenDefaults } from \"../theme/violet-token-defaults\";\nimport { installFormDisabled } from \"../foundations/violet-form-disabled\";\n\nexport type VioletTextFieldType = \"text\" | \"search\" | \"email\" | \"url\" | \"password\" | \"tel\" | \"number\" | \"date\";\n\nconst styles = css`\n ${violetFieldTokenDefaults}\n\n :host {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n min-inline-size: 0;\n }\n\n .field {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n min-inline-size: 0;\n gap: 0;\n }\n\n .label {\n color: var(--_text-secondary);\n font-size: var(--_control-label-size);\n font-weight: var(--_type-label-weight);\n line-height: var(--_type-label-line);\n margin-block-end: var(--_space-field-gap);\n }\n\n .control-frame {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n inline-size: 100%;\n min-inline-size: 0;\n block-size: var(--_target-size);\n padding-inline: max(var(--_space-inline-md), calc(var(--_target-size) * 0.375));\n padding-block: 0;\n border: 1px solid var(--_border-subtle);\n border-radius: var(--_radius-md);\n background: var(--_field-background);\n color: var(--_field-text);\n box-shadow: var(--_field-shadow);\n font-family: inherit;\n transition:\n border-color var(--_duration-fast) var(--_easing-standard),\n box-shadow var(--_duration-base) var(--_easing-standard);\n }\n\n .control {\n flex: 1 1 auto;\n min-inline-size: 0;\n border: 0;\n background: transparent;\n color: var(--_field-text);\n box-shadow: none;\n font-family: inherit;\n font-size: var(--_control-body-size);\n line-height: 1;\n }\n\n .control::placeholder {\n color: var(--_field-placeholder);\n }\n\n .control:focus {\n outline: none;\n }\n\n .control-frame:hover {\n box-shadow: var(--_field-shadow-hover);\n }\n\n .control-frame:focus-within {\n border-color: var(--_field-border-focus);\n box-shadow: var(--_field-shadow-focus);\n }\n\n /*\n * A read-only field's fill is a wash of the text colour, too light behind the resting border\n * and the placeholder: its top line takes the strong border and its placeholder the secondary\n * text, so both keep their contrast on every surface (Loam's D159).\n */\n :host([readonly]) {\n --_field-border: var(--_field-border-readonly);\n --_field-placeholder: var(--_text-secondary);\n }\n\n :host([readonly]) .control-frame {\n background: var(--_field-background-readonly);\n }\n\n :host([disabled]) .control-frame,\n :host(:disabled) .control-frame {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n :host([disabled]) .control,\n :host(:disabled) .control {\n cursor: not-allowed;\n }\n\n :host([invalid]) .control-frame {\n border-color: var(--_danger-border);\n }\n\n slot[name=\"before\"] {\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n color: var(--_text-muted);\n }\n\n ::slotted([slot=\"before\"]) {\n margin-inline-end: var(--_space-inline-sm);\n }\n\n .supporting {\n color: var(--_text-muted);\n font-size: var(--_control-caption-size);\n line-height: var(--_type-caption-line);\n margin-block-start: var(--_space-field-gap);\n }\n\n /* There is no error line here, so under an invalid value the supporting text is the reason. */\n :host([invalid]) .supporting {\n color: var(--color-state-danger-text, var(--_text-muted));\n }\n\n @media (forced-colors: active) {\n .control-frame {\n border-color: ButtonText;\n }\n\n .control-frame:focus-within {\n outline: 2px solid Highlight;\n outline-offset: 1px;\n }\n\n :host([disabled]) .control-frame,\n :host(:disabled) .control-frame {\n border-color: GrayText;\n }\n }\n`;\n\nconst template = html<VioletTextField>`\n <div class=\"field\" part=\"field\">\n ${when(\n x => Boolean(x.label),\n html<VioletTextField>`\n <label class=\"label\" part=\"label\" for=\"${x => x.inputId}\">${x => x.label}</label>\n `,\n )}\n <div class=\"control-frame\" part=\"control-frame\">\n <slot name=\"before\" part=\"before\"></slot>\n <input\n id=\"${x => x.inputId}\"\n class=\"control\"\n part=\"control\"\n name=\"${x => x.name}\"\n type=\"${x => x.type}\"\n min=\"${x => x.min}\"\n max=\"${x => x.max}\"\n step=\"${x => x.step}\"\n minlength=\"${x => x.minLength}\"\n maxlength=\"${x => x.maxLength}\"\n pattern=\"${x => x.pattern || null}\"\n autocomplete=\"${x => x.autocomplete}\"\n inputmode=\"${x => x.inputMode || null}\"\n placeholder=\"${x => x.placeholder}\"\n ?disabled=\"${x => x.effectiveDisabled}\"\n ?readonly=\"${x => x.readonly}\"\n ?required=\"${x => x.required}\"\n aria-label=\"${x => x.label || x.getAttribute(\"aria-label\") || \"\"}\"\n aria-invalid=\"${x => x.invalid ? \"true\" : \"false\"}\"\n @input=\"${(x, c) => x.handleInput(c.event)}\"\n @change=\"${(x, c) => x.handleCommit(c.event)}\"\n />\n </div>\n ${when(\n x => Boolean(x.supportingText),\n html<VioletTextField>`\n <p class=\"supporting\" part=\"supporting-text\" id=\"${x => x.supportingId}\">${x => x.supportingText}</p>\n `,\n )}\n </div>\n`;\n\nlet violetTextFieldCount = 0;\n\n/**\n * Violet reusable text field primitive.\n *\n * @summary Token-driven single-line text input with built-in label and supporting text.\n * @slot before - Leading inline content such as a search or password icon.\n * @fires input - Emitted when the value changes while typing.\n * @fires change - Emitted when the value is committed.\n * @csspart field - Field wrapper.\n * @csspart label - Label text element.\n * @csspart control-frame - Framed wrapper around the input and leading slot.\n * @csspart before - Leading slot for inline affordances.\n * @csspart control - Native input control.\n * @csspart supporting-text - Supporting text element.\n */\nexport class VioletTextField extends FASTElement {\n public static readonly formAssociated = true;\n\n readonly #internals: ElementInternals;\n readonly #describedByObserver = new MutationObserver(() => this.#scheduleSync());\n readonly #handleFocusIn = (): void => this.#syncDescribedBy();\n #syncScheduled = false;\n #defaultValue: string;\n\n public readonly inputId: string;\n\n /**\n * Id of the supporting text element inside the shadow root.\n */\n public readonly supportingId: string;\n\n /**\n * Optional field label.\n */\n declare public label: string;\n\n /**\n * Optional placeholder text.\n */\n declare public placeholder: string;\n\n /**\n * Current input value.\n */\n declare public value: string;\n\n /**\n * Native input type.\n */\n declare public type: VioletTextFieldType;\n\n /**\n * Optional supporting text shown below the field.\n */\n declare public supportingText: string;\n\n /**\n * Disables the field.\n */\n declare public disabled: boolean;\n\n /**\n * True while an ancestor `<fieldset disabled>` disables the control.\n */\n declare public fieldsetDisabled: boolean;\n\n /**\n * Author `disabled` or fieldset-disabled.\n */\n declare public readonly effectiveDisabled: boolean;\n\n /**\n * Marks the field readonly.\n */\n declare public readonly: boolean;\n\n /**\n * Marks the field invalid.\n */\n declare public invalid: boolean;\n\n /**\n * Native form name used during submission.\n */\n declare public name: string;\n\n /**\n * Marks the field as required.\n */\n declare public required: boolean;\n\n /**\n * Native `min` constraint (numbers, dates) forwarded to the input.\n */\n declare public min?: string | null;\n\n /**\n * Native `max` constraint (numbers, dates) forwarded to the input.\n */\n declare public max?: string | null;\n\n /**\n * Native `step` constraint forwarded to the input.\n */\n declare public step?: string | null;\n\n /**\n * Native `minlength` constraint forwarded to the input.\n */\n declare public minLength?: number | null;\n\n /**\n * Native `maxlength` constraint forwarded to the input.\n */\n declare public maxLength?: number | null;\n\n /**\n * Native `pattern` constraint forwarded to the input.\n */\n declare public pattern?: string | null;\n\n /**\n * Native `autocomplete` hint forwarded to the input.\n */\n declare public autocomplete?: string | null;\n\n /**\n * Native `inputmode` virtual-keyboard hint forwarded to the input\n * (`none`, `text`, `decimal`, `numeric`, `tel`, `search`, `email` or `url`).\n */\n declare public inputMode: string;\n\n public constructor() {\n super();\n this.#internals = this.attachInternals();\n violetTextFieldCount += 1;\n this.inputId = `violet-text-field-${violetTextFieldCount}`;\n this.supportingId = `${this.inputId}-supporting`;\n this.label = \"\";\n this.placeholder = \"\";\n this.value = \"\";\n this.type = \"text\";\n this.supportingText = \"\";\n this.disabled = false;\n this.readonly = false;\n this.invalid = false;\n this.name = \"\";\n this.required = false;\n this.#defaultValue = \"\";\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n this.#writeControl();\n this.#defaultValue = this.getAttribute(\"value\") ?? this.value;\n this.#syncFormState();\n this.#syncDescribedBy();\n this.#describedByObserver.observe(this, { attributes: true, attributeFilter: [\"aria-describedby\"] });\n this.addEventListener(\"focusin\", this.#handleFocusIn);\n this.#scheduleSync();\n }\n\n public disconnectedCallback(): void {\n super.disconnectedCallback();\n this.#describedByObserver.disconnect();\n this.removeEventListener(\"focusin\", this.#handleFocusIn);\n }\n\n public handleInput(event: Event): void {\n // The native `input` is composed and would reach the host as a second event; this element emits its own.\n event.stopPropagation();\n const control = event.currentTarget as HTMLInputElement | null;\n this.value = control?.value ?? \"\";\n this.$emit(\"input\", { value: this.value });\n }\n\n public handleCommit(event: Event): void {\n const control = event.currentTarget as HTMLInputElement | null;\n this.value = control?.value ?? \"\";\n this.$emit(\"change\", { value: this.value });\n }\n\n public formStateRestoreCallback(state: File | string | FormData | null): void {\n if (typeof state === \"string\") {\n this.value = state;\n }\n }\n\n public formResetCallback(): void {\n this.value = this.#defaultValue;\n // Also when the value is unchanged: a partial entry, such as \"-\", reads as \"\" and must go too.\n this.#writeControl(true);\n }\n\n public get form(): HTMLFormElement | null {\n return this.#internals.form;\n }\n\n public get validity(): ValidityState {\n return this.#internals.validity;\n }\n\n public get validationMessage(): string {\n return this.#internals.validationMessage;\n }\n\n public get willValidate(): boolean {\n return this.#internals.willValidate;\n }\n\n public checkValidity(): boolean {\n return this.#internals.checkValidity();\n }\n\n public reportValidity(): boolean {\n return this.#internals.reportValidity();\n }\n\n public valueChanged(): void {\n this.#writeControl();\n this.#syncFormState();\n this.#scheduleSync();\n }\n\n // Writes `value` to the native input only when it differs. A number input reads `\"\"` while it holds a\n // partial entry such as `-`, so writing that `\"\"` back, as a binding would, erased the `-` (#712).\n #writeControl(force = false): void {\n const control = this.shadowRoot?.querySelector<HTMLInputElement>(\"input.control\");\n if (control && (force || control.value !== this.value)) {\n control.value = this.value;\n }\n }\n\n public typeChanged(): void {\n this.#scheduleSync();\n }\n\n public minChanged(): void {\n this.#scheduleSync();\n }\n\n public maxChanged(): void {\n this.#scheduleSync();\n }\n\n public stepChanged(): void {\n this.#scheduleSync();\n }\n\n public minLengthChanged(): void {\n this.#scheduleSync();\n }\n\n public maxLengthChanged(): void {\n this.#scheduleSync();\n }\n\n public patternChanged(): void {\n this.#scheduleSync();\n }\n\n public supportingTextChanged(): void {\n this.#scheduleSync();\n }\n\n public disabledChanged(): void {\n this.#syncFormState();\n }\n\n public invalidChanged(): void {\n this.#syncFormState();\n }\n\n public readonlyChanged(): void {\n this.#syncFormState();\n }\n\n public requiredChanged(): void {\n this.#syncFormState();\n this.#scheduleSync();\n }\n\n /**\n * Template bindings flush on the next update batch, so validity derived from the inner\n * input and the describedby targets are re-synced once that batch has landed.\n */\n #scheduleSync(): void {\n if (this.#syncScheduled || !this.$fastController.isConnected) {\n return;\n }\n\n this.#syncScheduled = true;\n Updates.enqueue(() => {\n Updates.enqueue(() => {\n this.#syncScheduled = false;\n this.#syncFormState();\n this.#syncDescribedBy();\n });\n });\n }\n\n /**\n * IDREFs in a host `aria-describedby` cannot cross the shadow boundary, so the ids are\n * resolved in the host's root node and assigned to the input through element reflection\n * (`ariaDescribedByElements`), together with the supporting text. Without element\n * reflection only the supporting text is linked, by an IDREF inside the shadow root;\n * light-DOM targets cannot be referenced in that case.\n */\n #syncDescribedBy(): void {\n const control = this.shadowRoot?.querySelector(\"input\") as HTMLInputElement | null;\n\n if (!control) {\n return;\n }\n\n const targets: Element[] = [];\n const root = this.getRootNode() as Document | ShadowRoot;\n const hostIds = (this.getAttribute(\"aria-describedby\") ?? \"\").split(/\\s+/).filter(Boolean);\n\n for (const id of hostIds) {\n const target = root.getElementById?.(id) ?? null;\n if (target && !targets.includes(target)) {\n targets.push(target);\n }\n }\n\n const supporting = this.shadowRoot?.getElementById(this.supportingId) ?? null;\n if (supporting) {\n targets.push(supporting);\n }\n\n const hasElementReflection: boolean = \"ariaDescribedByElements\" in control;\n if (hasElementReflection) {\n control.removeAttribute(\"aria-describedby\");\n control.ariaDescribedByElements = targets.length ? targets : null;\n return;\n }\n\n if (supporting) {\n control.setAttribute(\"aria-describedby\", this.supportingId);\n } else {\n control.removeAttribute(\"aria-describedby\");\n }\n }\n\n #syncFormState(): void {\n if (!this.$fastController.isConnected) {\n return;\n }\n\n const control = this.shadowRoot?.querySelector(\"input\") as HTMLInputElement | null;\n\n this.#internals.ariaInvalid = this.invalid ? \"true\" : \"false\";\n this.#internals.setFormValue(this.effectiveDisabled ? null : this.value);\n\n if (this.effectiveDisabled || this.readonly) {\n this.#internals.setValidity({});\n return;\n }\n\n if (this.invalid) {\n this.#internals.setValidity({ customError: true }, \"Please correct this field.\", control ?? undefined);\n return;\n }\n\n if (this.required && !this.value.trim()) {\n this.#internals.setValidity({ valueMissing: true }, \"Please fill out this field.\", control ?? undefined);\n return;\n }\n\n if (!control) {\n this.#internals.setValidity({});\n return;\n }\n\n // Native length validity only fires for user edits, and the `:value` binding resets that\n // flag, so length limits are evaluated here against the current value instead.\n const native = control.validity;\n const length = this.value.length;\n const tooShort = native.tooShort || (this.minLength != null && length > 0 && length < this.minLength);\n const tooLong = native.tooLong || (this.maxLength != null && length > this.maxLength);\n\n if (native.valid && !tooShort && !tooLong) {\n this.#internals.setValidity({});\n return;\n }\n\n let message = control.validationMessage;\n if (!message && tooShort) {\n message = `Please lengthen this text to ${this.minLength} characters or more.`;\n } else if (!message && tooLong) {\n message = `Please shorten this text to ${this.maxLength} characters or less.`;\n }\n\n this.#internals.setValidity(\n {\n valueMissing: native.valueMissing,\n typeMismatch: native.typeMismatch,\n patternMismatch: native.patternMismatch,\n tooLong,\n tooShort,\n rangeUnderflow: native.rangeUnderflow,\n rangeOverflow: native.rangeOverflow,\n stepMismatch: native.stepMismatch,\n badInput: native.badInput,\n customError: native.customError,\n },\n message,\n control,\n );\n }\n}\n\nattr(VioletTextField.prototype, \"label\");\nattr(VioletTextField.prototype, \"placeholder\");\n// fromView: typed text must not be reflected back into the DOM `value` attribute.\nattr({ mode: \"fromView\" })(VioletTextField.prototype, \"value\");\nattr(VioletTextField.prototype, \"type\");\nattr(VioletTextField.prototype, \"min\");\nattr(VioletTextField.prototype, \"max\");\nattr(VioletTextField.prototype, \"step\");\nattr({ attribute: \"minlength\", converter: nullableNumberConverter })(VioletTextField.prototype, \"minLength\");\nattr({ attribute: \"maxlength\", converter: nullableNumberConverter })(VioletTextField.prototype, \"maxLength\");\nattr(VioletTextField.prototype, \"pattern\");\nattr(VioletTextField.prototype, \"autocomplete\");\nattr({ attribute: \"inputmode\" })(VioletTextField.prototype, \"inputMode\");\nattr({ attribute: \"supporting-text\" })(VioletTextField.prototype, \"supportingText\");\nattr({ mode: \"boolean\" })(VioletTextField.prototype, \"disabled\");\ninstallFormDisabled(VioletTextField.prototype);\nattr({ mode: \"boolean\" })(VioletTextField.prototype, \"readonly\");\nattr({ mode: \"boolean\" })(VioletTextField.prototype, \"invalid\");\nattr(VioletTextField.prototype, \"name\");\nattr({ mode: \"boolean\" })(VioletTextField.prototype, \"required\");\n\nif (!customElements.get(\"violet-text-field\")) {\n await FASTElement.define(VioletTextField, {\n name: \"violet-text-field\",\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true,\n },\n });\n}\n"]}
|
|
@@ -381,7 +381,7 @@ export declare const violetThemeBuiltInSet: {
|
|
|
381
381
|
readonly value: "#bec6bd";
|
|
382
382
|
}, {
|
|
383
383
|
readonly id: "color.action.primary.text";
|
|
384
|
-
readonly value: "#
|
|
384
|
+
readonly value: "#141515";
|
|
385
385
|
}, {
|
|
386
386
|
readonly id: "color.action.secondary.background";
|
|
387
387
|
readonly value: "rgba(244, 240, 234, 0.09)";
|
|
@@ -399,13 +399,13 @@ export declare const violetThemeBuiltInSet: {
|
|
|
399
399
|
readonly value: "#f4f0ea";
|
|
400
400
|
}, {
|
|
401
401
|
readonly id: "color.border.strong";
|
|
402
|
-
readonly value: "#
|
|
402
|
+
readonly value: "#999e9b";
|
|
403
403
|
}, {
|
|
404
404
|
readonly id: "color.border.subtle";
|
|
405
405
|
readonly value: "rgba(244, 240, 234, 0.10)";
|
|
406
406
|
}, {
|
|
407
407
|
readonly id: "color.control.selected.background";
|
|
408
|
-
readonly value: "#
|
|
408
|
+
readonly value: "#1b2823";
|
|
409
409
|
}, {
|
|
410
410
|
readonly id: "color.control.selected.border";
|
|
411
411
|
readonly value: "rgba(163, 235, 205, 0.45)";
|
|
@@ -420,19 +420,19 @@ export declare const violetThemeBuiltInSet: {
|
|
|
420
420
|
readonly value: "rgba(244, 240, 234, 0.06)";
|
|
421
421
|
}, {
|
|
422
422
|
readonly id: "color.field.border";
|
|
423
|
-
readonly value: "#
|
|
423
|
+
readonly value: "#767b78";
|
|
424
424
|
}, {
|
|
425
425
|
readonly id: "color.field.border.focus";
|
|
426
426
|
readonly value: "#a3ebcd";
|
|
427
427
|
}, {
|
|
428
428
|
readonly id: "color.field.border.hover";
|
|
429
|
-
readonly value: "#
|
|
429
|
+
readonly value: "#999e9b";
|
|
430
430
|
}, {
|
|
431
431
|
readonly id: "color.field.border.invalid";
|
|
432
432
|
readonly value: "#ff897a";
|
|
433
433
|
}, {
|
|
434
434
|
readonly id: "color.field.placeholder";
|
|
435
|
-
readonly value: "#
|
|
435
|
+
readonly value: "#999e9b";
|
|
436
436
|
}, {
|
|
437
437
|
readonly id: "color.field.text";
|
|
438
438
|
readonly value: "#f4f0ea";
|
|
@@ -453,7 +453,7 @@ export declare const violetThemeBuiltInSet: {
|
|
|
453
453
|
readonly value: "#ffab99";
|
|
454
454
|
}, {
|
|
455
455
|
readonly id: "color.state.success.background";
|
|
456
|
-
readonly value: "#
|
|
456
|
+
readonly value: "#1b2823";
|
|
457
457
|
}, {
|
|
458
458
|
readonly id: "color.state.success.border";
|
|
459
459
|
readonly value: "transparent";
|
|
@@ -474,34 +474,34 @@ export declare const violetThemeBuiltInSet: {
|
|
|
474
474
|
readonly value: "#f3d6a3";
|
|
475
475
|
}, {
|
|
476
476
|
readonly id: "color.surface.card";
|
|
477
|
-
readonly value: "#
|
|
477
|
+
readonly value: "#1b1c1c";
|
|
478
478
|
}, {
|
|
479
479
|
readonly id: "color.surface.floating";
|
|
480
|
-
readonly value: "#
|
|
480
|
+
readonly value: "#252727";
|
|
481
481
|
}, {
|
|
482
482
|
readonly id: "color.surface.highlight";
|
|
483
|
-
readonly value: "#
|
|
483
|
+
readonly value: "#333333";
|
|
484
484
|
}, {
|
|
485
485
|
readonly id: "color.surface.page";
|
|
486
|
-
readonly value: "#
|
|
486
|
+
readonly value: "#141515";
|
|
487
487
|
}, {
|
|
488
488
|
readonly id: "color.surface.pressed";
|
|
489
489
|
readonly value: "rgba(244, 240, 234, 0.14)";
|
|
490
490
|
}, {
|
|
491
491
|
readonly id: "color.surface.selected";
|
|
492
|
-
readonly value: "#
|
|
492
|
+
readonly value: "#1b2823";
|
|
493
493
|
}, {
|
|
494
494
|
readonly id: "color.surface.subtle";
|
|
495
|
-
readonly value: "#
|
|
495
|
+
readonly value: "#202222";
|
|
496
496
|
}, {
|
|
497
497
|
readonly id: "color.text.muted";
|
|
498
|
-
readonly value: "#
|
|
498
|
+
readonly value: "#999e9b";
|
|
499
499
|
}, {
|
|
500
500
|
readonly id: "color.text.primary";
|
|
501
501
|
readonly value: "#f4f0ea";
|
|
502
502
|
}, {
|
|
503
503
|
readonly id: "color.text.secondary";
|
|
504
|
-
readonly value: "#
|
|
504
|
+
readonly value: "#CCCCCC";
|
|
505
505
|
}, {
|
|
506
506
|
readonly id: "duration.base";
|
|
507
507
|
readonly value: "180ms";
|
|
@@ -133,47 +133,47 @@ export const violetThemeBuiltInSet = {
|
|
|
133
133
|
{ id: "color.action.primary.background", value: "#f4f0ea" },
|
|
134
134
|
{ id: "color.action.primary.hover", value: "#d8dcd6" },
|
|
135
135
|
{ id: "color.action.primary.pressed", value: "#bec6bd" },
|
|
136
|
-
{ id: "color.action.primary.text", value: "#
|
|
136
|
+
{ id: "color.action.primary.text", value: "#141515" },
|
|
137
137
|
{ id: "color.action.secondary.background", value: "rgba(244, 240, 234, 0.09)" },
|
|
138
138
|
{ id: "color.action.secondary.border", value: "transparent" },
|
|
139
139
|
{ id: "color.action.secondary.hover", value: "rgba(244, 240, 234, 0.13)" },
|
|
140
140
|
{ id: "color.action.secondary.pressed", value: "rgba(244, 240, 234, 0.17)" },
|
|
141
141
|
{ id: "color.action.secondary.text", value: "#f4f0ea" },
|
|
142
|
-
{ id: "color.border.strong", value: "#
|
|
142
|
+
{ id: "color.border.strong", value: "#999e9b" },
|
|
143
143
|
{ id: "color.border.subtle", value: "rgba(244, 240, 234, 0.10)" },
|
|
144
|
-
{ id: "color.control.selected.background", value: "#
|
|
144
|
+
{ id: "color.control.selected.background", value: "#1b2823" },
|
|
145
145
|
{ id: "color.control.selected.border", value: "rgba(163, 235, 205, 0.45)" },
|
|
146
146
|
{ id: "color.control.selected.foreground", value: "#a3ebcd" },
|
|
147
147
|
{ id: "color.field.background", value: "rgba(0, 0, 0, 0.26)" },
|
|
148
148
|
{ id: "color.field.background.readonly", value: "rgba(244, 240, 234, 0.06)" },
|
|
149
|
-
{ id: "color.field.border", value: "#
|
|
149
|
+
{ id: "color.field.border", value: "#767b78" },
|
|
150
150
|
{ id: "color.field.border.focus", value: "#a3ebcd" },
|
|
151
|
-
{ id: "color.field.border.hover", value: "#
|
|
151
|
+
{ id: "color.field.border.hover", value: "#999e9b" },
|
|
152
152
|
{ id: "color.field.border.invalid", value: "#ff897a" },
|
|
153
|
-
{ id: "color.field.placeholder", value: "#
|
|
153
|
+
{ id: "color.field.placeholder", value: "#999e9b" },
|
|
154
154
|
{ id: "color.field.text", value: "#f4f0ea" },
|
|
155
155
|
{ id: "color.focus.ring", value: "#a3ebcd" },
|
|
156
156
|
{ id: "color.state.danger.background", value: "#3d211d" },
|
|
157
157
|
{ id: "color.state.danger.border", value: "transparent" },
|
|
158
158
|
{ id: "color.state.danger.foreground", value: "#ff897a" },
|
|
159
159
|
{ id: "color.state.danger.text", value: "#ffab99" },
|
|
160
|
-
{ id: "color.state.success.background", value: "#
|
|
160
|
+
{ id: "color.state.success.background", value: "#1b2823" },
|
|
161
161
|
{ id: "color.state.success.border", value: "transparent" },
|
|
162
162
|
{ id: "color.state.success.foreground", value: "#a3ebcd" },
|
|
163
163
|
{ id: "color.state.success.text", value: "#a3ebcd" },
|
|
164
164
|
{ id: "color.state.warning.background", value: "#3a2b18" },
|
|
165
165
|
{ id: "color.state.warning.border", value: "transparent" },
|
|
166
166
|
{ id: "color.state.warning.text", value: "#f3d6a3" },
|
|
167
|
-
{ id: "color.surface.card", value: "#
|
|
168
|
-
{ id: "color.surface.floating", value: "#
|
|
169
|
-
{ id: "color.surface.highlight", value: "#
|
|
170
|
-
{ id: "color.surface.page", value: "#
|
|
167
|
+
{ id: "color.surface.card", value: "#1b1c1c" },
|
|
168
|
+
{ id: "color.surface.floating", value: "#252727" },
|
|
169
|
+
{ id: "color.surface.highlight", value: "#333333" },
|
|
170
|
+
{ id: "color.surface.page", value: "#141515" },
|
|
171
171
|
{ id: "color.surface.pressed", value: "rgba(244, 240, 234, 0.14)" },
|
|
172
|
-
{ id: "color.surface.selected", value: "#
|
|
173
|
-
{ id: "color.surface.subtle", value: "#
|
|
174
|
-
{ id: "color.text.muted", value: "#
|
|
172
|
+
{ id: "color.surface.selected", value: "#1b2823" },
|
|
173
|
+
{ id: "color.surface.subtle", value: "#202222" },
|
|
174
|
+
{ id: "color.text.muted", value: "#999e9b" },
|
|
175
175
|
{ id: "color.text.primary", value: "#f4f0ea" },
|
|
176
|
-
{ id: "color.text.secondary", value: "#
|
|
176
|
+
{ id: "color.text.secondary", value: "#CCCCCC" },
|
|
177
177
|
{ id: "duration.base", value: "180ms" },
|
|
178
178
|
{ id: "duration.fast", value: "120ms" },
|
|
179
179
|
{ id: "duration.slow", value: "280ms" },
|