@redvars/peacock 3.8.5 → 3.8.6

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.
Files changed (44) hide show
  1. package/dist/button.js +4 -0
  2. package/dist/button.js.map +1 -1
  3. package/dist/custom-elements-jsdocs.json +185 -15
  4. package/dist/custom-elements.json +886 -177
  5. package/dist/floating-controller-CZYwnRVu.js +185 -0
  6. package/dist/floating-controller-CZYwnRVu.js.map +1 -0
  7. package/dist/{floating-controller-CnUZnOhK.js → floating-ui.dom-oQieRCpS.js} +2 -183
  8. package/dist/floating-ui.dom-oQieRCpS.js.map +1 -0
  9. package/dist/html-editor.js +3 -21091
  10. package/dist/html-editor.js.map +1 -1
  11. package/dist/index-DcbiqHpf.js +21091 -0
  12. package/dist/index-DcbiqHpf.js.map +1 -0
  13. package/dist/index.js +5 -2
  14. package/dist/index.js.map +1 -1
  15. package/dist/loader.js +7 -2
  16. package/dist/loader.js.map +1 -1
  17. package/dist/markdown-editor.js +4439 -0
  18. package/dist/markdown-editor.js.map +1 -0
  19. package/dist/menu.js +2 -1
  20. package/dist/menu.js.map +1 -1
  21. package/dist/popover.js +2 -1
  22. package/dist/popover.js.map +1 -1
  23. package/dist/{select-D85kpjUt.js → select-CnnPbvpQ.js} +68 -71
  24. package/dist/select-CnnPbvpQ.js.map +1 -0
  25. package/dist/src/index.d.ts +1 -0
  26. package/dist/src/input/input.d.ts +5 -5
  27. package/dist/src/markdown-editor/index.d.ts +2 -0
  28. package/dist/src/markdown-editor/markdown-editor.d.ts +116 -0
  29. package/dist/sub-menu.js +2 -1
  30. package/dist/sub-menu.js.map +1 -1
  31. package/dist/tooltip.js +2 -1
  32. package/dist/tooltip.js.map +1 -1
  33. package/dist/tsconfig.tsbuildinfo +1 -1
  34. package/package.json +5 -1
  35. package/readme.md +2 -2
  36. package/src/button/button/button-sizes.scss +4 -0
  37. package/src/index.ts +1 -0
  38. package/src/input/input.ts +85 -82
  39. package/src/loader.ts +4 -0
  40. package/src/markdown-editor/index.ts +3 -0
  41. package/src/markdown-editor/markdown-editor.scss +378 -0
  42. package/src/markdown-editor/markdown-editor.ts +994 -0
  43. package/dist/floating-controller-CnUZnOhK.js.map +0 -1
  44. package/dist/select-D85kpjUt.js.map +0 -1
package/dist/button.js CHANGED
@@ -771,6 +771,7 @@ var css_248z = i`.button {
771
771
  --button-height: 2rem;
772
772
  --private-button-icon-size: 1rem;
773
773
  --private-button-container-padding: 0.75rem;
774
+ --private-button-icon-label-spacing: 0.5rem;
774
775
  --private-button-font-size: 0.875rem !important;
775
776
  --private-button-font-weight: var(--font-weight-medium) !important;
776
777
  --private-button-line-height: 1.25rem !important;
@@ -794,6 +795,7 @@ var css_248z = i`.button {
794
795
  --button-height: 3.5rem;
795
796
  --private-button-icon-size: 1.5rem;
796
797
  --private-button-container-padding: 1.5rem;
798
+ --private-button-icon-label-spacing: 0.5rem;
797
799
  --private-button-font-size: 1rem !important;
798
800
  --private-button-font-weight: var(--font-weight-medium) !important;
799
801
  --private-button-line-height: 1.5rem !important;
@@ -805,6 +807,7 @@ var css_248z = i`.button {
805
807
  --button-height: 6rem;
806
808
  --private-button-icon-size: 2rem;
807
809
  --private-button-container-padding: 3rem;
810
+ --private-button-icon-label-spacing: 0.75rem;
808
811
  --private-button-font-size: 1.5rem !important;
809
812
  --private-button-font-weight: var(--font-weight-regular) !important;
810
813
  --private-button-line-height: 2rem !important;
@@ -816,6 +819,7 @@ var css_248z = i`.button {
816
819
  --button-height: 8.5rem;
817
820
  --private-button-icon-size: 2.5rem;
818
821
  --private-button-container-padding: 4rem;
822
+ --private-button-icon-label-spacing: 1rem;
819
823
  --private-button-font-size: 2rem !important;
820
824
  --private-button-font-weight: var(--font-weight-regular) !important;
821
825
  --private-button-line-height: 2.5rem !important;
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sources":["../../src/button/button/button.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { when } from 'lit/directives/when.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport styles from './button.scss';\n\nimport type {\n ButtonSize,\n ButtonLevel,\n ButtonShape,\n ButtonVariant,\n ButtonColor,\n} from '@/button/ButtonTypes.js';\nimport { isLink } from '@/__internal/utils/is-link.js';\nimport { observerSlotChangesWithCallback } from '@/__internal/utils/observe-slot-change.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n} from '@/__internal/utils/dispatch-event-utils.js';\nimport { DISABLED_REASON_ID } from '@/button/ButtonConstants.js';\nimport { mixinDelegatesAria } from '@/__internal/aria/delegate.js';\nimport { ARIAMixinStrict } from '@/__internal/aria/aria.js';\nimport { mixinFormSubmitter } from '@/__internal/mixins/form-submitter.js';\nimport { mixinElementInternals } from '@/__internal/mixins/element-internals.js';\nimport { mixinBaseButton } from '../base-button/base-button.js';\nimport { mixinFormAssociated } from '@/__internal/mixins/form-associated.js';\nimport { mixinHyperlink } from '@/__internal/mixins/hyperlink.js';\nexport type {\n ButtonSize,\n ButtonLevel,\n ButtonShape,\n ButtonVariant,\n ButtonColor,\n} from '@/button/ButtonTypes.js';\n\n/**\n * @label Button\n * @tag wc-button\n * @rawTag button\n *\n * @summary Buttons help people initiate actions, from sending an email, to sharing a document, to liking a post.\n * @overview\n * <p>Buttons are clickable elements that are used to trigger actions. They communicate calls to action to the user and allow users to interact with pages in a variety of ways. Button labels express what action will occur when the user interacts with it.</p>\n *\n * @cssprop --button-container-shape - Defines the border radius of the button container shape.\n *\n * @cssprop --button-container-shape-start-start - Defines the start position of the button container shape.\n * @cssprop --button-container-shape-start-end - Defines the end position of the button container shape.\n * @cssprop --button-container-shape-end-start - Defines the start position of the button container shape.\n * @cssprop --button-container-shape-end-end - Defines the end position of the button container shape.\n *\n *\n * @cssprop --filled-button-container-color - Color of the filled button container.\n * @cssprop --filled-button-label-text-color - Text color of the filled button label.\n *\n * @cssprop --outlined-button-container-color - Color of the outlined button container.\n * @cssprop --outlined-button-label-text-color - Text color of the outlined button label.\n *\n * @cssprop --text-button-label-text-color - Text color of the text button label.\n *\n * @cssprop --tonal-button-container-color - Color of the tonal button container.\n * @cssprop --tonal-button-label-text-color - Text color of the tonal button label.\n *\n * @cssprop --elevated-button-container-color - Color of the elevated button container.\n * @cssprop --elevated-button-label-text-color - Text color of the elevated button label.\n *\n * @cssprop --neo-button-container-color - Color of the neo button container.\n * @cssprop --neo-button-label-text-color - Text color of the neo button label.\n *\n * @fires {MouseEvent} click - Dispatched when the button is clicked.\n *\n * @example\n * ```html\n * <wc-button>Button</wc-button>\n * ```\n * @tags display\n */\n@IndividualComponent\nexport class Button extends mixinBaseButton(\n mixinHyperlink(\n mixinDelegatesAria(\n mixinFormSubmitter(\n mixinFormAssociated(mixinElementInternals(LitElement)),\n ),\n ),\n ),\n) {\n // ── Static ───────────────────────────────────────────────────────────────\n\n /** @nocollapse */ // eslint-disable-next-line\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n static override styles = [styles];\n\n // ── Properties ───────────────────────────────────────────────────────────\n\n /**\n * When `true` (default), the icon is placed after the label (trailing).\n * When `false`, the icon is placed before the label (leading).\n */\n @property({ type: Boolean, reflect: true, attribute: 'trailing-icon' })\n trailingIcon = false;\n\n /**\n * Button size.\n * Possible values are `\"xs\"`, `\"sm\"`, `\"md\"`, `\"lg\"`, `\"xl\"`. Defaults to `\"sm\"`.\n */\n @property({ reflect: true }) size: ButtonSize = 'sm';\n\n /**\n * Level is preset of color and variant. If Level provided it overrides the default color and variant.\n */\n @property({ type: String }) level?: ButtonLevel;\n\n /** Shape of the button container. */\n @property({ type: String, reflect: true }) shape: ButtonShape = 'square';\n\n /**\n * The visual style of the button.\n *\n * Possible variant values:\n * `\"filled\"` is a filled button.\n * `\"outlined\"` is an outlined button.\n * `\"text\"` is a transparent button.\n * `\"tonal\"` is a light color button.\n * `\"elevated\"` is elevated button\n */\n @property({ reflect: true }) variant: ButtonVariant = 'filled';\n\n /**\n * Defines the primary color of the button. This can be set to predefined color names to apply specific color themes.\n */\n @property({ reflect: true }) color: ButtonColor = 'primary';\n\n /** When true, renders the button in a loading skeleton state. */\n @property({ type: Boolean, reflect: true }) skeleton: boolean = false;\n\n /** When true, the button acts as a toggle. Use with `selected`. */\n @property({ type: Boolean, reflect: true }) toggle: boolean = false;\n\n /** When true (and `toggle` is set), the button is in the selected/pressed state. */\n @property({ type: Boolean, reflect: true }) selected: boolean = false;\n\n /** Optional tooltip text displayed on hover. */\n @property() tooltip?: string;\n\n // ── Queries ───────────────────────────────────────────────────────────────\n\n @query('.button') private readonly buttonElement!: HTMLElement | null;\n\n // ── Private fields ────────────────────────────────────────────────────────\n\n /** Cleanup returned by observerSlotChangesWithCallback for the icon slot. */\n private __iconSlotCleanup: (() => void) | null = null;\n\n /** Cleanup returned by observerSlotChangesWithCallback for the label slot. */\n private __labelSlotCleanup: (() => void) | null = null;\n\n // ── Constructor ───────────────────────────────────────────────────────────\n\n constructor() {\n super();\n this.addEventListener('click', this.__dispatchClickWithThrottle);\n }\n\n // ── Lifecycle ─────────────────────────────────────────────────────────────\n\n override disconnectedCallback() {\n // disconnect slot observers first to avoid callbacks during teardown\n try {\n this.__iconSlotCleanup?.();\n } catch (e) {\n /* ignore */\n }\n try {\n this.__labelSlotCleanup?.();\n } catch (e) {\n /* ignore */\n }\n\n super.disconnectedCallback();\n }\n\n override firstUpdated(changedProperties: Map<PropertyKey, unknown>) {\n super.firstUpdated(changedProperties);\n this.__convertTypeToVariantAndColor();\n // Initialize slot presence tracking for smooth transitions when label/icon are added/removed\n const iconSlot = this.renderRoot.querySelector(\n 'slot[name=\"icon\"]',\n ) as HTMLSlotElement | null;\n const labelSlot = this.renderRoot.querySelector(\n 'slot.label',\n ) as HTMLSlotElement | null;\n\n // Use MutationObserver-based helper so we react to content/character changes\n if (iconSlot) {\n this.__iconSlotCleanup = observerSlotChangesWithCallback(\n iconSlot,\n has => {\n this.toggleAttribute('has-icon', has);\n },\n );\n }\n\n if (labelSlot) {\n this.__labelSlotCleanup = observerSlotChangesWithCallback(\n labelSlot,\n has => {\n this.toggleAttribute('has-label', has);\n },\n );\n }\n }\n\n // ── Public methods ────────────────────────────────────────────────────────\n\n override focus() {\n this.buttonElement?.focus();\n }\n\n override blur() {\n this.buttonElement?.blur();\n }\n\n // ── Private methods ───────────────────────────────────────────────────────\n\n __convertTypeToVariantAndColor() {\n if (this.level === 'primary') {\n this.color = 'primary';\n this.variant = 'filled';\n } else if (this.level === 'secondary') {\n this.color = 'surface';\n this.variant = 'tonal';\n } else if (this.level === 'tertiary') {\n this.color = 'primary';\n this.variant = 'text';\n } else if (this.level === 'danger') {\n this.color = 'danger';\n this.variant = 'filled';\n }\n }\n\n __dispatchClick = (event: MouseEvent | KeyboardEvent) => {\n // If the button is soft-disabled or a disabled link, we need to explicitly\n // prevent the click from propagating to other event listeners as well as\n // prevent the default action.\n if (this.softDisabled || (this.disabled && this.href) || this.skeleton) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n\n if (!isActivationClick(event) || !this.buttonElement) {\n return;\n }\n\n this.focus();\n dispatchActivationClick(this.buttonElement);\n };\n\n // ── Render helpers ────────────────────────────────────────────────────────\n\n renderButtonElement() {\n const isElementLink = isLink(this);\n\n const cssClasses: any = {\n button: true,\n 'native-button': !isElementLink,\n 'native-link': isElementLink,\n 'trailing-icon': this.trailingIcon,\n };\n\n // Needed for closure conformance\n const { ariaLabel, ariaHasPopup, ariaExpanded } = this as ARIAMixinStrict;\n\n if (isElementLink) {\n return html`<a\n class=${classMap(cssClasses)}\n id=\"link\"\n href=${this.href}\n target=${this.target}\n tabindex=${this.disabled ? '-1' : '0'}\n aria-label=\"${ariaLabel || nothing}\"\n aria-haspopup=\"${ariaHasPopup || nothing}\"\n aria-expanded=\"${ariaExpanded || nothing}\"\n aria-describedby=${ifDefined(\n this.softDisabled ? DISABLED_REASON_ID : undefined,\n )}\n ?aria-disabled=${this.softDisabled}\n >\n ${this.renderButtonContent()}\n </a>`;\n }\n return html`<button\n class=${classMap(cssClasses)}\n id=\"button\"\n aria-label=\"${ariaLabel || nothing}\"\n aria-haspopup=\"${ariaHasPopup || nothing}\"\n aria-expanded=\"${ariaExpanded || nothing}\"\n aria-describedby=${ifDefined(\n this.softDisabled ? DISABLED_REASON_ID : undefined,\n )}\n ?aria-disabled=${this.softDisabled}\n ?disabled=${this.disabled}\n >\n ${this.renderButtonContent()}\n </button>\n ${this.renderTooltip()}`;\n }\n\n renderButtonContent() {\n return html` <slot class=\"icon-slot\" name=\"icon\"></slot>\n <slot class=\"label\"></slot>\n <div class=\"touch\"></div>\n\n ${this.renderDisabledReason(this.softDisabled)}`;\n }\n\n renderDisabledReason(softDisabled: boolean) {\n if (softDisabled)\n return html`<div\n id=${DISABLED_REASON_ID}\n role=\"tooltip\"\n aria-label=${this.disabledReason}\n class=\"screen-reader-only\"\n >\n ${this.disabledReason}\n </div>`;\n return nothing;\n }\n\n renderTooltip() {\n if (this.tooltip) {\n const buttonId = isLink(this) ? 'link' : 'button';\n return html`<wc-tooltip class=\"tooltip\" for=${buttonId}\n >${this.tooltip}</wc-tooltip\n >`;\n }\n return nothing;\n }\n\n // ── Render ────────────────────────────────────────────────────────────────\n\n override render() {\n const buttonId = isLink(this) ? 'link' : 'button';\n\n return html`\n <wc-focus-ring class=\"focus-ring\" for=${buttonId}></wc-focus-ring>\n <wc-elevation class=\"elevation\"></wc-elevation>\n ${when(\n this.variant === 'neo',\n () => html`<div class=\"neo-background\"></div>`,\n )}\n <div class=\"background\"></div>\n ${when(\n this.variant === 'outlined' || this.variant === 'neo',\n () => html`<div class=\"outline\"></div>`,\n )}\n <wc-ripple class=\"ripple\" for=${buttonId}></wc-ripple>\n <wc-skeleton class=\"skeleton\"></wc-skeleton>\n\n ${this.renderButtonElement()} ${this.renderTooltip()}\n `;\n }\n}\n"],"names":["LitElement","html","classMap","nothing","ifDefined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E,OAAO,EAAE,IAAI,EAAE;AAAiC,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAGhB,UAAA,CAAA;IAA3CA,GAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAA4B,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAG1B,UAAA,CAAA;IAA3CA,GAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAA0B,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAGxB,UAAA,CAAA;IAA3CA,GAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAA4B,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAG1D,UAAA,CAAA;AAAX,IAAAA,GAAQ;AAAoB,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAIM,UAAA,CAAA;IAAlCC,GAAK,CAAC,SAAS;AAAsD,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;AAzE3D,MAAM,GAAA,UAAA,CAAA;IADlB;AACY,CAAA,EAAA,MAAM,CAiSlB;;;;"}
1
+ {"version":3,"file":"button.js","sources":["../../src/button/button/button.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { when } from 'lit/directives/when.js';\nimport IndividualComponent from '@/IndividualComponent.js';\nimport styles from './button.scss';\n\nimport type {\n ButtonSize,\n ButtonLevel,\n ButtonShape,\n ButtonVariant,\n ButtonColor,\n} from '@/button/ButtonTypes.js';\nimport { isLink } from '@/__internal/utils/is-link.js';\nimport { observerSlotChangesWithCallback } from '@/__internal/utils/observe-slot-change.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n} from '@/__internal/utils/dispatch-event-utils.js';\nimport { DISABLED_REASON_ID } from '@/button/ButtonConstants.js';\nimport { mixinDelegatesAria } from '@/__internal/aria/delegate.js';\nimport { ARIAMixinStrict } from '@/__internal/aria/aria.js';\nimport { mixinFormSubmitter } from '@/__internal/mixins/form-submitter.js';\nimport { mixinElementInternals } from '@/__internal/mixins/element-internals.js';\nimport { mixinBaseButton } from '../base-button/base-button.js';\nimport { mixinFormAssociated } from '@/__internal/mixins/form-associated.js';\nimport { mixinHyperlink } from '@/__internal/mixins/hyperlink.js';\nexport type {\n ButtonSize,\n ButtonLevel,\n ButtonShape,\n ButtonVariant,\n ButtonColor,\n} from '@/button/ButtonTypes.js';\n\n/**\n * @label Button\n * @tag wc-button\n * @rawTag button\n *\n * @summary Buttons help people initiate actions, from sending an email, to sharing a document, to liking a post.\n * @overview\n * <p>Buttons are clickable elements that are used to trigger actions. They communicate calls to action to the user and allow users to interact with pages in a variety of ways. Button labels express what action will occur when the user interacts with it.</p>\n *\n * @cssprop --button-container-shape - Defines the border radius of the button container shape.\n *\n * @cssprop --button-container-shape-start-start - Defines the start position of the button container shape.\n * @cssprop --button-container-shape-start-end - Defines the end position of the button container shape.\n * @cssprop --button-container-shape-end-start - Defines the start position of the button container shape.\n * @cssprop --button-container-shape-end-end - Defines the end position of the button container shape.\n *\n *\n * @cssprop --filled-button-container-color - Color of the filled button container.\n * @cssprop --filled-button-label-text-color - Text color of the filled button label.\n *\n * @cssprop --outlined-button-container-color - Color of the outlined button container.\n * @cssprop --outlined-button-label-text-color - Text color of the outlined button label.\n *\n * @cssprop --text-button-label-text-color - Text color of the text button label.\n *\n * @cssprop --tonal-button-container-color - Color of the tonal button container.\n * @cssprop --tonal-button-label-text-color - Text color of the tonal button label.\n *\n * @cssprop --elevated-button-container-color - Color of the elevated button container.\n * @cssprop --elevated-button-label-text-color - Text color of the elevated button label.\n *\n * @cssprop --neo-button-container-color - Color of the neo button container.\n * @cssprop --neo-button-label-text-color - Text color of the neo button label.\n *\n * @fires {MouseEvent} click - Dispatched when the button is clicked.\n *\n * @example\n * ```html\n * <wc-button>Button</wc-button>\n * ```\n * @tags display\n */\n@IndividualComponent\nexport class Button extends mixinBaseButton(\n mixinHyperlink(\n mixinDelegatesAria(\n mixinFormSubmitter(\n mixinFormAssociated(mixinElementInternals(LitElement)),\n ),\n ),\n ),\n) {\n // ── Static ───────────────────────────────────────────────────────────────\n\n /** @nocollapse */ // eslint-disable-next-line\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n static override styles = [styles];\n\n // ── Properties ───────────────────────────────────────────────────────────\n\n /**\n * When `true` (default), the icon is placed after the label (trailing).\n * When `false`, the icon is placed before the label (leading).\n */\n @property({ type: Boolean, reflect: true, attribute: 'trailing-icon' })\n trailingIcon = false;\n\n /**\n * Button size.\n * Possible values are `\"xs\"`, `\"sm\"`, `\"md\"`, `\"lg\"`, `\"xl\"`. Defaults to `\"sm\"`.\n */\n @property({ reflect: true }) size: ButtonSize = 'sm';\n\n /**\n * Level is preset of color and variant. If Level provided it overrides the default color and variant.\n */\n @property({ type: String }) level?: ButtonLevel;\n\n /** Shape of the button container. */\n @property({ type: String, reflect: true }) shape: ButtonShape = 'square';\n\n /**\n * The visual style of the button.\n *\n * Possible variant values:\n * `\"filled\"` is a filled button.\n * `\"outlined\"` is an outlined button.\n * `\"text\"` is a transparent button.\n * `\"tonal\"` is a light color button.\n * `\"elevated\"` is elevated button\n */\n @property({ reflect: true }) variant: ButtonVariant = 'filled';\n\n /**\n * Defines the primary color of the button. This can be set to predefined color names to apply specific color themes.\n */\n @property({ reflect: true }) color: ButtonColor = 'primary';\n\n /** When true, renders the button in a loading skeleton state. */\n @property({ type: Boolean, reflect: true }) skeleton: boolean = false;\n\n /** When true, the button acts as a toggle. Use with `selected`. */\n @property({ type: Boolean, reflect: true }) toggle: boolean = false;\n\n /** When true (and `toggle` is set), the button is in the selected/pressed state. */\n @property({ type: Boolean, reflect: true }) selected: boolean = false;\n\n /** Optional tooltip text displayed on hover. */\n @property() tooltip?: string;\n\n // ── Queries ───────────────────────────────────────────────────────────────\n\n @query('.button') private readonly buttonElement!: HTMLElement | null;\n\n // ── Private fields ────────────────────────────────────────────────────────\n\n /** Cleanup returned by observerSlotChangesWithCallback for the icon slot. */\n private __iconSlotCleanup: (() => void) | null = null;\n\n /** Cleanup returned by observerSlotChangesWithCallback for the label slot. */\n private __labelSlotCleanup: (() => void) | null = null;\n\n // ── Constructor ───────────────────────────────────────────────────────────\n\n constructor() {\n super();\n this.addEventListener('click', this.__dispatchClickWithThrottle);\n }\n\n // ── Lifecycle ─────────────────────────────────────────────────────────────\n\n override disconnectedCallback() {\n // disconnect slot observers first to avoid callbacks during teardown\n try {\n this.__iconSlotCleanup?.();\n } catch (e) {\n /* ignore */\n }\n try {\n this.__labelSlotCleanup?.();\n } catch (e) {\n /* ignore */\n }\n\n super.disconnectedCallback();\n }\n\n override firstUpdated(changedProperties: Map<PropertyKey, unknown>) {\n super.firstUpdated(changedProperties);\n this.__convertTypeToVariantAndColor();\n // Initialize slot presence tracking for smooth transitions when label/icon are added/removed\n const iconSlot = this.renderRoot.querySelector(\n 'slot[name=\"icon\"]',\n ) as HTMLSlotElement | null;\n const labelSlot = this.renderRoot.querySelector(\n 'slot.label',\n ) as HTMLSlotElement | null;\n\n // Use MutationObserver-based helper so we react to content/character changes\n if (iconSlot) {\n this.__iconSlotCleanup = observerSlotChangesWithCallback(\n iconSlot,\n has => {\n this.toggleAttribute('has-icon', has);\n },\n );\n }\n\n if (labelSlot) {\n this.__labelSlotCleanup = observerSlotChangesWithCallback(\n labelSlot,\n has => {\n this.toggleAttribute('has-label', has);\n },\n );\n }\n }\n\n // ── Public methods ────────────────────────────────────────────────────────\n\n override focus() {\n this.buttonElement?.focus();\n }\n\n override blur() {\n this.buttonElement?.blur();\n }\n\n // ── Private methods ───────────────────────────────────────────────────────\n\n __convertTypeToVariantAndColor() {\n if (this.level === 'primary') {\n this.color = 'primary';\n this.variant = 'filled';\n } else if (this.level === 'secondary') {\n this.color = 'surface';\n this.variant = 'tonal';\n } else if (this.level === 'tertiary') {\n this.color = 'primary';\n this.variant = 'text';\n } else if (this.level === 'danger') {\n this.color = 'danger';\n this.variant = 'filled';\n }\n }\n\n __dispatchClick = (event: MouseEvent | KeyboardEvent) => {\n // If the button is soft-disabled or a disabled link, we need to explicitly\n // prevent the click from propagating to other event listeners as well as\n // prevent the default action.\n if (this.softDisabled || (this.disabled && this.href) || this.skeleton) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n\n if (!isActivationClick(event) || !this.buttonElement) {\n return;\n }\n\n this.focus();\n dispatchActivationClick(this.buttonElement);\n };\n\n // ── Render helpers ────────────────────────────────────────────────────────\n\n renderButtonElement() {\n const isElementLink = isLink(this);\n\n const cssClasses: any = {\n button: true,\n 'native-button': !isElementLink,\n 'native-link': isElementLink,\n 'trailing-icon': this.trailingIcon,\n };\n\n // Needed for closure conformance\n const { ariaLabel, ariaHasPopup, ariaExpanded } = this as ARIAMixinStrict;\n\n if (isElementLink) {\n return html`<a\n class=${classMap(cssClasses)}\n id=\"link\"\n href=${this.href}\n target=${this.target}\n tabindex=${this.disabled ? '-1' : '0'}\n aria-label=\"${ariaLabel || nothing}\"\n aria-haspopup=\"${ariaHasPopup || nothing}\"\n aria-expanded=\"${ariaExpanded || nothing}\"\n aria-describedby=${ifDefined(\n this.softDisabled ? DISABLED_REASON_ID : undefined,\n )}\n ?aria-disabled=${this.softDisabled}\n >\n ${this.renderButtonContent()}\n </a>`;\n }\n return html`<button\n class=${classMap(cssClasses)}\n id=\"button\"\n aria-label=\"${ariaLabel || nothing}\"\n aria-haspopup=\"${ariaHasPopup || nothing}\"\n aria-expanded=\"${ariaExpanded || nothing}\"\n aria-describedby=${ifDefined(\n this.softDisabled ? DISABLED_REASON_ID : undefined,\n )}\n ?aria-disabled=${this.softDisabled}\n ?disabled=${this.disabled}\n >\n ${this.renderButtonContent()}\n </button>\n ${this.renderTooltip()}`;\n }\n\n renderButtonContent() {\n return html` <slot class=\"icon-slot\" name=\"icon\"></slot>\n <slot class=\"label\"></slot>\n <div class=\"touch\"></div>\n\n ${this.renderDisabledReason(this.softDisabled)}`;\n }\n\n renderDisabledReason(softDisabled: boolean) {\n if (softDisabled)\n return html`<div\n id=${DISABLED_REASON_ID}\n role=\"tooltip\"\n aria-label=${this.disabledReason}\n class=\"screen-reader-only\"\n >\n ${this.disabledReason}\n </div>`;\n return nothing;\n }\n\n renderTooltip() {\n if (this.tooltip) {\n const buttonId = isLink(this) ? 'link' : 'button';\n return html`<wc-tooltip class=\"tooltip\" for=${buttonId}\n >${this.tooltip}</wc-tooltip\n >`;\n }\n return nothing;\n }\n\n // ── Render ────────────────────────────────────────────────────────────────\n\n override render() {\n const buttonId = isLink(this) ? 'link' : 'button';\n\n return html`\n <wc-focus-ring class=\"focus-ring\" for=${buttonId}></wc-focus-ring>\n <wc-elevation class=\"elevation\"></wc-elevation>\n ${when(\n this.variant === 'neo',\n () => html`<div class=\"neo-background\"></div>`,\n )}\n <div class=\"background\"></div>\n ${when(\n this.variant === 'outlined' || this.variant === 'neo',\n () => html`<div class=\"outline\"></div>`,\n )}\n <wc-ripple class=\"ripple\" for=${buttonId}></wc-ripple>\n <wc-skeleton class=\"skeleton\"></wc-skeleton>\n\n ${this.renderButtonElement()} ${this.renderTooltip()}\n `;\n }\n}\n"],"names":["LitElement","html","classMap","nothing","ifDefined","when","styles","property","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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MAAA,CAAA;AAG1B,UAAA,CAAA;IAA3CA,GAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAA0B,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAGxB,UAAA,CAAA;IAA3CA,GAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAA4B,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAG1D,UAAA,CAAA;AAAX,IAAAA,GAAQ;AAAoB,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAIM,UAAA,CAAA;IAAlCC,GAAK,CAAC,SAAS;AAAsD,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;AAzE3D,MAAM,GAAA,UAAA,CAAA;IADlB;AACY,CAAA,EAAA,MAAM,CAiSlB;;;;"}
@@ -4495,7 +4495,7 @@
4495
4495
  "type": {
4496
4496
  "text": "string"
4497
4497
  },
4498
- "default": "''",
4498
+ "default": "\"\"",
4499
4499
  "fieldName": "value"
4500
4500
  },
4501
4501
  {
@@ -4503,7 +4503,7 @@
4503
4503
  "type": {
4504
4504
  "text": "string"
4505
4505
  },
4506
- "default": "''",
4506
+ "default": "\"\"",
4507
4507
  "fieldName": "name"
4508
4508
  },
4509
4509
  {
@@ -4511,7 +4511,7 @@
4511
4511
  "type": {
4512
4512
  "text": "string"
4513
4513
  },
4514
- "default": "''",
4514
+ "default": "\"\"",
4515
4515
  "fieldName": "placeholder"
4516
4516
  },
4517
4517
  {
@@ -4519,7 +4519,7 @@
4519
4519
  "type": {
4520
4520
  "text": "string"
4521
4521
  },
4522
- "default": "''",
4522
+ "default": "\"\"",
4523
4523
  "fieldName": "label"
4524
4524
  },
4525
4525
  {
@@ -4533,25 +4533,25 @@
4533
4533
  {
4534
4534
  "name": "size",
4535
4535
  "type": {
4536
- "text": "'sm' | 'md' | 'lg'"
4536
+ "text": "\"sm\" | \"md\" | \"lg\""
4537
4537
  },
4538
- "default": "'md'",
4538
+ "default": "\"md\"",
4539
4539
  "fieldName": "size"
4540
4540
  },
4541
4541
  {
4542
4542
  "name": "type",
4543
4543
  "type": {
4544
- "text": "'text' | 'password' | 'email' | 'tel'"
4544
+ "text": "\"text\" | \"password\" | \"email\" | \"tel\""
4545
4545
  },
4546
- "default": "'text'",
4546
+ "default": "\"text\"",
4547
4547
  "fieldName": "type"
4548
4548
  },
4549
4549
  {
4550
4550
  "name": "autocomplete",
4551
4551
  "type": {
4552
- "text": "'on' | 'off'"
4552
+ "text": "\"on\" | \"off\""
4553
4553
  },
4554
- "default": "'off'",
4554
+ "default": "\"off\"",
4555
4555
  "fieldName": "autocomplete"
4556
4556
  },
4557
4557
  {
@@ -4565,9 +4565,9 @@
4565
4565
  {
4566
4566
  "name": "variant",
4567
4567
  "type": {
4568
- "text": "'filled' | 'outlined' | 'default'"
4568
+ "text": "\"filled\" | \"outlined\" | \"default\""
4569
4569
  },
4570
- "default": "'default'",
4570
+ "default": "\"default\"",
4571
4571
  "fieldName": "variant"
4572
4572
  },
4573
4573
  {
@@ -4575,7 +4575,7 @@
4575
4575
  "type": {
4576
4576
  "text": "string"
4577
4577
  },
4578
- "default": "''",
4578
+ "default": "\"\"",
4579
4579
  "description": "Helper text to display below the input.",
4580
4580
  "fieldName": "helperText"
4581
4581
  },
@@ -4592,7 +4592,7 @@
4592
4592
  "type": {
4593
4593
  "text": "string"
4594
4594
  },
4595
- "default": "''",
4595
+ "default": "\"\"",
4596
4596
  "fieldName": "errorText"
4597
4597
  },
4598
4598
  {
@@ -4608,7 +4608,7 @@
4608
4608
  "type": {
4609
4609
  "text": "string"
4610
4610
  },
4611
- "default": "''",
4611
+ "default": "\"\"",
4612
4612
  "fieldName": "warningText"
4613
4613
  },
4614
4614
  {
@@ -5105,6 +5105,176 @@
5105
5105
  }
5106
5106
  }
5107
5107
  },
5108
+ {
5109
+ "label": "Markdown Editor",
5110
+ "tag": "wc-markdown-editor",
5111
+ "rawTag": "markdown-editor",
5112
+ "summary": "A Tiptap-powered Notion-like Markdown editor with a bottom toggle\n between rendered and raw markdown views.",
5113
+ "overview": "<p>The Markdown Editor provides a block-based, Notion-like writing surface\nbuilt on Tiptap. Type <code>/</code> to open a slash menu for inserting\nheadings, lists, quotes, code blocks, and dividers. Select text to reveal\na floating bubble toolbar with inline formatting actions.</p>\n\n<p>The canonical <code>value</code> is Markdown. Use the bottom segmented\nswitch to toggle between the rendered editor and the raw markdown source.\nThe component dispatches a <code>change</code> event whenever content\nchanges.</p>",
5114
+ "cssprop": "--markdown-editor-slash-background - Background color of the slash command menu.",
5115
+ "fires": "change - Fired whenever the markdown content changes.",
5116
+ "example": "```html\n<wc-markdown-editor\n label=\"Notes\"\n value=\"# Hello\\n\\nType a slash on a new line to insert blocks.\"\n></wc-markdown-editor>\n```",
5117
+ "tags": "input editor",
5118
+ "customElement": {
5119
+ "kind": "class",
5120
+ "description": "",
5121
+ "cssProperties": [
5122
+ {
5123
+ "description": "Minimum height of the editable area. Defaults to 12rem.",
5124
+ "name": "--markdown-editor-min-height"
5125
+ },
5126
+ {
5127
+ "description": "Background color of the selection bubble menu.",
5128
+ "name": "--markdown-editor-bubble-background"
5129
+ },
5130
+ {
5131
+ "description": "Background color of the slash command menu.",
5132
+ "name": "--markdown-editor-slash-background"
5133
+ }
5134
+ ],
5135
+ "events": [
5136
+ {
5137
+ "type": {
5138
+ "text": "Event"
5139
+ },
5140
+ "description": "Fired whenever the markdown content changes.",
5141
+ "name": "change"
5142
+ }
5143
+ ],
5144
+ "attributes": [
5145
+ {
5146
+ "name": "value",
5147
+ "type": {
5148
+ "text": "string"
5149
+ },
5150
+ "default": "''",
5151
+ "description": "Current Markdown value of the editor.",
5152
+ "fieldName": "value"
5153
+ },
5154
+ {
5155
+ "name": "label",
5156
+ "type": {
5157
+ "text": "string"
5158
+ },
5159
+ "default": "''",
5160
+ "description": "Label displayed above the editor.",
5161
+ "fieldName": "label"
5162
+ },
5163
+ {
5164
+ "name": "placeholder",
5165
+ "type": {
5166
+ "text": "string"
5167
+ },
5168
+ "default": "\"Type '/' for commands…\"",
5169
+ "description": "Placeholder text shown when the editor is empty.",
5170
+ "fieldName": "placeholder"
5171
+ },
5172
+ {
5173
+ "name": "variant",
5174
+ "type": {
5175
+ "text": "'filled' | 'outlined' | 'default'"
5176
+ },
5177
+ "default": "'default'",
5178
+ "description": "Visual style of the wrapping field.",
5179
+ "fieldName": "variant"
5180
+ },
5181
+ {
5182
+ "name": "helper-text",
5183
+ "type": {
5184
+ "text": "string"
5185
+ },
5186
+ "default": "''",
5187
+ "description": "Helper text displayed below the editor.",
5188
+ "fieldName": "helperText"
5189
+ },
5190
+ {
5191
+ "name": "error",
5192
+ "type": {
5193
+ "text": "boolean"
5194
+ },
5195
+ "default": "false",
5196
+ "description": "Whether to show an error state.",
5197
+ "fieldName": "error"
5198
+ },
5199
+ {
5200
+ "name": "error-text",
5201
+ "type": {
5202
+ "text": "string"
5203
+ },
5204
+ "default": "''",
5205
+ "description": "Error message text.",
5206
+ "fieldName": "errorText"
5207
+ },
5208
+ {
5209
+ "name": "debounce",
5210
+ "type": {
5211
+ "text": "number"
5212
+ },
5213
+ "default": "250",
5214
+ "description": "Debounce in milliseconds for dispatching `change`.",
5215
+ "fieldName": "debounce"
5216
+ },
5217
+ {
5218
+ "name": "disabled",
5219
+ "type": {
5220
+ "text": "boolean"
5221
+ },
5222
+ "default": "false",
5223
+ "fieldName": "disabled",
5224
+ "inheritedFrom": {
5225
+ "name": "BaseInput",
5226
+ "module": "src/input/BaseInput.ts"
5227
+ }
5228
+ },
5229
+ {
5230
+ "name": "readonly",
5231
+ "type": {
5232
+ "text": "boolean"
5233
+ },
5234
+ "default": "false",
5235
+ "fieldName": "readonly",
5236
+ "inheritedFrom": {
5237
+ "name": "BaseInput",
5238
+ "module": "src/input/BaseInput.ts"
5239
+ }
5240
+ },
5241
+ {
5242
+ "name": "required",
5243
+ "type": {
5244
+ "text": "boolean"
5245
+ },
5246
+ "default": "false",
5247
+ "fieldName": "required",
5248
+ "inheritedFrom": {
5249
+ "name": "BaseInput",
5250
+ "module": "src/input/BaseInput.ts"
5251
+ }
5252
+ },
5253
+ {
5254
+ "name": "skeleton",
5255
+ "type": {
5256
+ "text": "boolean"
5257
+ },
5258
+ "default": "false",
5259
+ "fieldName": "skeleton",
5260
+ "inheritedFrom": {
5261
+ "name": "BaseInput",
5262
+ "module": "src/input/BaseInput.ts"
5263
+ }
5264
+ }
5265
+ ],
5266
+ "superclass": {
5267
+ "name": "BaseInput",
5268
+ "module": "/src/input/BaseInput.js"
5269
+ },
5270
+ "tagName": "wc-markdown-editor",
5271
+ "customElement": true,
5272
+ "rawTag": {
5273
+ "name": "markdown-editor",
5274
+ "description": ""
5275
+ }
5276
+ }
5277
+ },
5108
5278
  {
5109
5279
  "label": "Menu",
5110
5280
  "tag": "wc-menu",