@redvars/peacock 4.3.4 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/dist/{BaseField-DPyW5Zm5.js → BaseField-Cj2rNVeC.js} +3 -3
  2. package/dist/{BaseField-DPyW5Zm5.js.map → BaseField-Cj2rNVeC.js.map} +1 -1
  3. package/dist/{BaseInput-FhjvfMjF.js → BaseInput-CSOLv2-i.js} +2 -2
  4. package/dist/{BaseInput-FhjvfMjF.js.map → BaseInput-CSOLv2-i.js.map} +1 -1
  5. package/dist/ai-badge.js +2 -2
  6. package/dist/ai-summary.js +2 -2
  7. package/dist/alert.js +2 -2
  8. package/dist/anchor-nav.js +2 -2
  9. package/dist/app-shell.js +2 -2
  10. package/dist/assistant-panel.js +2 -2
  11. package/dist/assistant-step.js +2 -2
  12. package/dist/assistant-steps.js +2 -2
  13. package/dist/avatar-group.js +2 -2
  14. package/dist/banner.js +2 -2
  15. package/dist/{base-progress-D8-x6XS4.js → base-progress-DduJjUeq.js} +2 -2
  16. package/dist/{base-progress-D8-x6XS4.js.map → base-progress-DduJjUeq.js.map} +1 -1
  17. package/dist/bottom-sheet.js +2 -2
  18. package/dist/breadcrumb.js +2 -2
  19. package/dist/calendar.js +2 -2
  20. package/dist/{canvas-base-CjxNdEsR.js → canvas-base-Bfpv5_HJ.js} +2 -2
  21. package/dist/{canvas-base-CjxNdEsR.js.map → canvas-base-Bfpv5_HJ.js.map} +1 -1
  22. package/dist/carousel.js +2 -2
  23. package/dist/{cartesian-chart-D30aTNVm.js → cartesian-chart-SnqFbbXV.js} +2 -2
  24. package/dist/{cartesian-chart-D30aTNVm.js.map → cartesian-chart-SnqFbbXV.js.map} +1 -1
  25. package/dist/{cb-group-base-BhWC78b0.js → cb-group-base-DZIzMlen.js} +2 -2
  26. package/dist/{cb-group-base-BhWC78b0.js.map → cb-group-base-DZIzMlen.js.map} +1 -1
  27. package/dist/cb-group.js +3 -3
  28. package/dist/cb-rule.js +3 -3
  29. package/dist/chart-area.js +4 -4
  30. package/dist/chart-bar.js +4 -4
  31. package/dist/{chart-base-D2kPte5J.js → chart-base-C2N0WQLI.js} +2 -2
  32. package/dist/{chart-base-D2kPte5J.js.map → chart-base-C2N0WQLI.js.map} +1 -1
  33. package/dist/chart-doughnut.js +3 -3
  34. package/dist/chart-line.js +4 -4
  35. package/dist/chart-pie.js +3 -3
  36. package/dist/chat-event.js +2 -2
  37. package/dist/chat-message.js +2 -2
  38. package/dist/chat-thread.js +2 -2
  39. package/dist/checkbox-group.js +3 -3
  40. package/dist/checkbox.js +3 -3
  41. package/dist/chip-set.js +2 -2
  42. package/dist/chip.js +2 -2
  43. package/dist/circular-progress.js +3 -3
  44. package/dist/citation.js +2 -2
  45. package/dist/code-editor.js +3 -3
  46. package/dist/code-highlighter.js +2 -2
  47. package/dist/color-field.js +4 -4
  48. package/dist/color-picker.js +2 -2
  49. package/dist/command-palette.js +2 -2
  50. package/dist/comment-composer.js +4 -4
  51. package/dist/condition-builder.js +3 -3
  52. package/dist/confirm-dialog.js +2 -2
  53. package/dist/copy-button.js +2 -2
  54. package/dist/currency-field.js +4 -4
  55. package/dist/custom-elements.json +1 -1
  56. package/dist/date-field.js +5 -5
  57. package/dist/date-picker.js +2 -2
  58. package/dist/date-range-field.js +5 -5
  59. package/dist/datetime-field.js +5 -5
  60. package/dist/dependency-map.js +3 -3
  61. package/dist/description-item.js +2 -2
  62. package/dist/description-list.js +2 -2
  63. package/dist/{diagram-BFGq2POp.js → diagram-W_Kddt7I.js} +2 -2
  64. package/dist/{diagram-BFGq2POp.js.map → diagram-W_Kddt7I.js.map} +1 -1
  65. package/dist/diagram-controls.js +2 -2
  66. package/dist/diagram-minimap.js +2 -2
  67. package/dist/diagram.js +4 -4
  68. package/dist/diff-viewer.js +2 -2
  69. package/dist/discussion-activity.js +2 -2
  70. package/dist/discussion-comment.js +2 -2
  71. package/dist/discussion.js +4 -4
  72. package/dist/{document-editor-CC7MTHMO.js → document-editor-dBgmcyUW.js} +2 -2
  73. package/dist/{document-editor-CC7MTHMO.js.map → document-editor-dBgmcyUW.js.map} +1 -1
  74. package/dist/document-editor.js +3 -3
  75. package/dist/draft-card.js +2 -2
  76. package/dist/erd.js +3 -3
  77. package/dist/file-upload.js +3 -3
  78. package/dist/filter-bar.js +2 -2
  79. package/dist/flow.js +4 -4
  80. package/dist/form.js +2 -2
  81. package/dist/{generative-view-DoT9YwHL.js → generative-view-CfW6yMpY.js} +2 -2
  82. package/dist/{generative-view-DoT9YwHL.js.map → generative-view-CfW6yMpY.js.map} +1 -1
  83. package/dist/generative-view.js +3 -3
  84. package/dist/html-editor.js +4 -4
  85. package/dist/{i18n-controller-Co6pasNo.js → i18n-controller-DNAjVSIP.js} +2 -2
  86. package/dist/{i18n-controller-Co6pasNo.js.map → i18n-controller-DNAjVSIP.js.map} +1 -1
  87. package/dist/image.js +2 -2
  88. package/dist/index.js +17 -17
  89. package/dist/inline-edit.js +2 -2
  90. package/dist/input.js +3 -3
  91. package/dist/json-viewer.js +2 -2
  92. package/dist/kanban.js +2 -2
  93. package/dist/kbd.js +2 -2
  94. package/dist/linear-progress.js +3 -3
  95. package/dist/listbox.js +2 -2
  96. package/dist/loader-full.js +10 -10
  97. package/dist/loader.js +10 -10
  98. package/dist/markdown-editor.js +4 -4
  99. package/dist/mention-input.js +4 -4
  100. package/dist/modal.js +2 -2
  101. package/dist/navigation-bar.js +2 -2
  102. package/dist/navigation-drawer.js +2 -2
  103. package/dist/navigation-rail.js +2 -2
  104. package/dist/notification-center.js +2 -2
  105. package/dist/number-field.js +4 -4
  106. package/dist/page-header.js +2 -2
  107. package/dist/pagination.js +2 -2
  108. package/dist/password-field.js +4 -4
  109. package/dist/password-rules.js +2 -2
  110. package/dist/phone-field.js +4 -4
  111. package/dist/{picker-field-BliKNENo.js → picker-field-Mi7_hbo8.js} +3 -3
  112. package/dist/{picker-field-BliKNENo.js.map → picker-field-Mi7_hbo8.js.map} +1 -1
  113. package/dist/pin-input.js +4 -4
  114. package/dist/presence-indicator.js +2 -2
  115. package/dist/prompt-input.js +4 -4
  116. package/dist/radio.js +3 -3
  117. package/dist/rating.js +3 -3
  118. package/dist/redvars-loader.js +2 -2
  119. package/dist/relative-time.js +2 -2
  120. package/dist/resizable-panels.js +2 -2
  121. package/dist/{rich-text-input-YeqK1or-.js → rich-text-input-O1ku1q-J.js} +3 -3
  122. package/dist/{rich-text-input-YeqK1or-.js.map → rich-text-input-O1ku1q-J.js.map} +1 -1
  123. package/dist/{schema-CuHBNpzo.js → schema-BWH1ANdE.js} +2 -2
  124. package/dist/{schema-CuHBNpzo.js.map → schema-BWH1ANdE.js.map} +1 -1
  125. package/dist/search.js +3 -3
  126. package/dist/select.js +4 -4
  127. package/dist/side-sheet.js +2 -2
  128. package/dist/signature-pad.js +3 -3
  129. package/dist/site-header.js +2 -2
  130. package/dist/slider.js +3 -3
  131. package/dist/snackbar.js +2 -2
  132. package/dist/sparkline.js +2 -2
  133. package/dist/split-button.js +2 -2
  134. package/dist/src/__internal/i18n/strings.d.ts +4 -0
  135. package/dist/src/workflow/workflow-model.d.ts +12 -3
  136. package/dist/stat.js +2 -2
  137. package/dist/status-indicator.js +2 -2
  138. package/dist/step.js +2 -2
  139. package/dist/stepper.js +2 -2
  140. package/dist/{strings-DYwXSSu_.js → strings-BpCoUL0V.js} +5 -1
  141. package/dist/{strings-DYwXSSu_.js.map → strings-BpCoUL0V.js.map} +1 -1
  142. package/dist/svg.js +2 -2
  143. package/dist/switch.js +3 -3
  144. package/dist/table.js +2 -2
  145. package/dist/textarea.js +4 -4
  146. package/dist/time-field.js +5 -5
  147. package/dist/time-picker.js +2 -2
  148. package/dist/timeline-item.js +2 -2
  149. package/dist/timeline.js +2 -2
  150. package/dist/{toggle-base-B-HOnUIy.js → toggle-base-BRNNka2o.js} +2 -2
  151. package/dist/{toggle-base-B-HOnUIy.js.map → toggle-base-BRNNka2o.js.map} +1 -1
  152. package/dist/tour.js +2 -2
  153. package/dist/transfer-list.js +3 -3
  154. package/dist/tree-chart.js +3 -3
  155. package/dist/tree-item.js +2 -2
  156. package/dist/tree.js +2 -2
  157. package/dist/tsconfig.tsbuildinfo +1 -1
  158. package/dist/typing-indicator.js +2 -2
  159. package/dist/url-field.js +4 -4
  160. package/dist/user-menu.js +2 -2
  161. package/dist/{video-u-Vs7M9g.js → video-DBdRuyh4.js} +2 -2
  162. package/dist/{video-u-Vs7M9g.js.map → video-DBdRuyh4.js.map} +1 -1
  163. package/dist/video.js +3 -3
  164. package/dist/virtual-list.js +2 -2
  165. package/dist/workflow-model-CauduOG2.js.map +1 -1
  166. package/dist/workflow-timeline.js +2 -2
  167. package/dist/workflow.js +16 -5
  168. package/dist/workflow.js.map +1 -1
  169. package/dist/workspace-switcher.js +2 -2
  170. package/package.json +1 -1
  171. package/src/__internal/i18n/strings.ts +4 -0
  172. package/src/workflow/workflow-model.ts +12 -3
  173. package/src/workflow/workflow.scss +5 -0
  174. package/src/workflow/workflow.ts +10 -2
@@ -1,8 +1,8 @@
1
1
  import { _ as __decorate, A, b } from './IndividualComponent-BK7XZjE2.js';
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { r } from './state-BCeDVCI9.js';
4
- import { p as peacockString } from './strings-DYwXSSu_.js';
5
- import { B as BaseInput } from './BaseInput-FhjvfMjF.js';
4
+ import { p as peacockString } from './strings-BpCoUL0V.js';
5
+ import { B as BaseInput } from './BaseInput-CSOLv2-i.js';
6
6
 
7
7
  /** Below this width, in pixels, a field's Suggested badge shows just the sparkle. */
8
8
  const NARROW_FIELD_WIDTH = 320;
@@ -267,4 +267,4 @@ __decorate([
267
267
  ], BaseField.prototype, "__narrow", void 0);
268
268
 
269
269
  export { BaseField as B };
270
- //# sourceMappingURL=BaseField-DPyW5Zm5.js.map
270
+ //# sourceMappingURL=BaseField-Cj2rNVeC.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseField-DPyW5Zm5.js","sources":["../../src/input/BaseField.ts"],"sourcesContent":["import { html, nothing, type PropertyValues, type TemplateResult } from 'lit';\nimport { property, state } from 'lit/decorators.js';\n\nimport { peacockString } from '@/__internal/i18n/strings.js';\nimport type { Size } from '@/__internal/utils/size.js';\nimport BaseInput from './BaseInput.js';\n\n/** Below this width, in pixels, a field's Suggested badge shows just the sparkle. */\nconst NARROW_FIELD_WIDTH = 320;\n\n/** What a field component passes to `renderField()`. */\nexport interface FieldRenderOptions {\n /** Whether the field has a value; outlined fields float their label when it does. */\n populated: boolean;\n /** Overrides the field's own focus state, for fields whose popup keeps them active. */\n focused?: boolean;\n /** An error the control found itself, such as text that does not parse. */\n controlError?: string;\n /** Extra content before the control (after the `start` slot). */\n start?: unknown;\n /** Extra content after the control (after the `end` slot), such as a picker button. */\n end?: unknown;\n /** Character counter shown in the footer, such as `12/100`; empty or unset for none. */\n textCount?: string;\n}\n\nlet fieldCount = 0;\n\n/**\n * Base class for Peacock's text-like fields (input, textarea, number, URL, select, date/time,\n * color). It adds the props every field shares (label, helper/error/warning text, variant, size,\n * clearable, `start`/`end` slots) and renders the `wc-field` frame.\n *\n * It also makes the inner control accessible across the shadow boundary: `fieldAria()` gives it\n * an accessible name from `label`, `aria-invalid` while an error shows, and `aria-describedby`\n * pointing at a hidden copy of the helper or error text in the same shadow root.\n *\n * Subclasses call `renderField(control, options)` in `render()`, spread `fieldAria()` onto the\n * native control, call `emitValue('input' | 'change')` instead of re-dispatching native events\n * (the field event contract: `CustomEvent<{ value }>`, bubbling and composed), and override\n * `clearValue()` if clearing means more than `value = ''`.\n */\nexport default abstract class BaseField extends BaseInput {\n // ── Properties ───────────────────────────────────────────────────────────\n\n /** Label shown above the field; also the control's accessible name. */\n @property({ type: String }) label = '';\n\n /** Hint shown inside the empty control. */\n @property({ type: String }) placeholder = '';\n\n /** Help text shown below the field. */\n @property({ type: String, attribute: 'helper-text' }) helperText = '';\n\n /** Shows the field in its error state with `error-text`. */\n @property({ type: Boolean }) error = false;\n\n /** Error message shown below the field while `error` is set; replaces the help text. */\n @property({ type: String, attribute: 'error-text' }) errorText = '';\n\n /** Shows the field in its warning state with `warning-text`. */\n @property({ type: Boolean }) warning = false;\n\n /** Warning message shown below the field while `warning` is set; replaces the help text. */\n @property({ type: String, attribute: 'warning-text' }) warningText = '';\n\n /** Visual variant of the field. */\n @property({ type: String }) variant: 'default' | 'filled' | 'outlined' =\n 'default';\n\n /** Height of the field: `sm` (2.5rem, default), `md` (3.5rem) or `lg` (4rem). */\n @property({ type: String, reflect: true }) size: Size = 'sm';\n\n /** Shows a button that clears the value while the field has one. */\n @property({ type: Boolean }) clearable = false;\n\n /** ARIA attributes moved from the host onto the inner control. */\n @property({ type: Object }) configAria: Record<string, string> = {};\n\n // ── State ────────────────────────────────────────────────────────────────\n\n @state() protected focused = false;\n\n /** The field is too narrow for the Suggested badge's label; it shows just the sparkle. */\n @state() private __narrow = false;\n\n // ── Private fields ───────────────────────────────────────────────────────\n\n /** Id of the hidden description the inner control points at. */\n protected readonly fieldDescriptionId = `wc-field-description-${(fieldCount += 1)}`;\n\n /** A `tabindex` set on the host, moved to the inner control. */\n protected controlTabIndex?: string;\n\n /** Watches the field's width while it holds a suggestion, so the badge can shrink. */\n private __widthObserver?: ResizeObserver;\n\n // ── Lifecycle ────────────────────────────────────────────────────────────\n\n override connectedCallback() {\n super.connectedCallback();\n // `aria-*` and `tabindex` set on the host belong to the inner control; move them there.\n for (const attr of Array.from(this.attributes)) {\n if (attr.name.startsWith('aria-')) {\n this.configAria = { ...this.configAria, [attr.name]: attr.value };\n this.removeAttribute(attr.name);\n }\n }\n if (this.hasAttribute('tabindex')) {\n this.controlTabIndex = this.getAttribute('tabindex') ?? undefined;\n this.removeAttribute('tabindex');\n }\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.__widthObserver?.disconnect();\n this.__widthObserver = undefined;\n }\n\n protected override updated(changed: PropertyValues) {\n super.updated(changed);\n // Only a field showing a suggestion pays for an observer.\n if (this.suggestionVisible && !this.__widthObserver) {\n this.__widthObserver = new ResizeObserver(([entry]) => {\n this.__narrow = entry.contentRect.width < NARROW_FIELD_WIDTH;\n });\n this.__widthObserver.observe(this);\n } else if (!this.suggestionVisible && this.__widthObserver) {\n this.__widthObserver.disconnect();\n this.__widthObserver = undefined;\n }\n }\n\n // ── Protected ────────────────────────────────────────────────────────────\n\n /**\n * Whether the Suggested badge always shows just the sparkle, whatever the width. A textarea\n * sets it: a label beside it would narrow every line of the text.\n */\n protected get suggestionBadgeIconOnly(): boolean {\n return false;\n }\n\n /**\n * The error text the field shows: the consumer's `error-text` while `error` is set, else an\n * error the control found itself, else the validation message once it should show.\n */\n protected fieldErrorText(controlError = ''): string {\n if (this.error) return this.errorText;\n return controlError || this.validationText;\n }\n\n /**\n * Attributes for the native control: accessible name, invalid state, description and the\n * host's `tabindex`, plus `configAria`. Spread them onto it with `spread(this.fieldAria())`.\n */\n protected fieldAria(controlError = ''): Record<string, string | undefined> {\n const invalid = this.error || !!this.fieldErrorText(controlError);\n return {\n tabindex: this.controlTabIndex,\n 'aria-label': this.label || undefined,\n 'aria-invalid': invalid ? 'true' : undefined,\n 'aria-describedby': this.fieldDescription(controlError)\n ? this.fieldDescriptionId\n : undefined,\n ...this.configAria,\n };\n }\n\n /** Renders the `wc-field` frame around `control`, plus the hidden description. */\n protected renderField(\n control: unknown,\n options: FieldRenderOptions,\n ): TemplateResult {\n const errorText = this.fieldErrorText(options.controlError);\n const description = this.fieldDescription(options.controlError);\n // While a suggestion shows, its reason takes the helper text's place.\n const helperText = this.suggestionReason || this.helperText;\n return html`\n <wc-field\n label=${this.label}\n size=${this.size}\n variant=${this.variant}\n helper-text=${helperText}\n ?required=${this.required}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?skeleton=${this.skeleton}\n ?error=${this.error || !!errorText}\n error-text=${errorText}\n ?warning=${this.warning}\n warning-text=${this.warningText}\n text-count=${options.textCount ?? ''}\n ?populated=${options.populated}\n ?focused=${options.focused ?? this.focused}\n .host=${this}\n class=\"field\"\n >\n <slot name=\"start\" slot=\"field-start\"></slot>\n ${options.start ?? nothing} ${control}\n <slot name=\"end\" slot=\"field-end\"></slot>\n ${this.suggestionBadge({\n slot: 'field-end',\n iconOnly: this.__narrow || this.suggestionBadgeIconOnly,\n })}\n ${this.renderClearButton(options.populated)} ${options.end ?? nothing}\n </wc-field>\n ${description\n ? html`<span id=${this.fieldDescriptionId} hidden>${description}</span>`\n : nothing}\n `;\n }\n\n /** Dispatches `input` or `change` with the current value: the field event contract. */\n protected emitValue(type: 'input' | 'change') {\n this.dispatchEvent(\n new CustomEvent(type, {\n detail: { value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n protected override emitSuggestionValue() {\n this.emitValue('input');\n this.emitValue('change');\n }\n\n /** Clears the value for the clear button. Fields with another empty value override it. */\n protected clearValue() {\n this.value = '';\n this.emitValue('input');\n this.emitValue('change');\n }\n\n /** The counter text for a field with a `maxlength`: `12/100`, or '' when there is no limit. */\n protected characterCount(maxLength: number | null | undefined): string {\n if (typeof maxLength !== 'number' || !Number.isFinite(maxLength)) return '';\n if (maxLength < 0) return '';\n const count = String(this.value ?? '').length;\n return peacockString('characterCount')(count, maxLength);\n }\n\n /** Tracks focus of the inner control; bind it to the control's `focus` and `blur`. */\n protected handleFieldFocus = (event: FocusEvent) => {\n this.focused = event.type === 'focus';\n };\n\n // ── Private ──────────────────────────────────────────────────────────────\n\n /** The text the description carries: the error, else the warning, else the help. */\n private fieldDescription(controlError = ''): string {\n const errorText = this.fieldErrorText(controlError);\n if (errorText) return errorText;\n if (this.warning && this.warningText) return this.warningText;\n if (this.suggestionVisible) {\n return peacockString('aiSuggestedDescription')(this.suggestionReason);\n }\n return this.helperText;\n }\n\n private renderClearButton(populated: boolean) {\n if (!this.clearable || !populated || this.disabled || this.readonly) {\n return nothing;\n }\n return html`<wc-icon-button\n slot=\"field-end\"\n class=\"clear-button\"\n shape=\"round\"\n variant=\"text\"\n size=\"sm\"\n aria-label=${peacockString('clear')}\n @click=${() => {\n this.clearValue();\n this.focus();\n }}\n >\n <wc-icon name=\"close\"></wc-icon>\n </wc-icon-button>`;\n }\n}\n"],"names":["html","nothing","property","state"],"mappings":";;;;;;AAOA;AACA,MAAM,kBAAkB,GAAG,GAAG;AAkB9B,IAAI,UAAU,GAAG,CAAC;AAElB;;;;;;;;;;;;;AAaG;AACW,MAAgB,SAAU,SAAQ,SAAS,CAAA;AAAzD,IAAA,WAAA,GAAA;;;;QAI8B,IAAA,CAAA,KAAK,GAAG,EAAE;;QAGV,IAAA,CAAA,WAAW,GAAG,EAAE;;QAGU,IAAA,CAAA,UAAU,GAAG,EAAE;;QAGxC,IAAA,CAAA,KAAK,GAAG,KAAK;;QAGW,IAAA,CAAA,SAAS,GAAG,EAAE;;QAGtC,IAAA,CAAA,OAAO,GAAG,KAAK;;QAGW,IAAA,CAAA,WAAW,GAAG,EAAE;;QAG3C,IAAA,CAAA,OAAO,GACjC,SAAS;;QAGgC,IAAA,CAAA,IAAI,GAAS,IAAI;;QAG/B,IAAA,CAAA,SAAS,GAAG,KAAK;;QAGlB,IAAA,CAAA,UAAU,GAA2B,EAAE;;QAIhD,IAAA,CAAA,OAAO,GAAG,KAAK;;QAGjB,IAAA,CAAA,QAAQ,GAAG,KAAK;;;QAKd,IAAA,CAAA,kBAAkB,GAAG,yBAAyB,UAAU,IAAI,CAAC,GAAG;;AA6JzE,QAAA,IAAA,CAAA,gBAAgB,GAAG,CAAC,KAAiB,KAAI;YACjD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,KAAK,OAAO;AACvC,QAAA,CAAC;IAkCH;;IAvLW,iBAAiB,GAAA;QACxB,KAAK,CAAC,iBAAiB,EAAE;;AAEzB,QAAA,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;YAC9C,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;AACjC,gBAAA,I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AA,EAAA,MAAA,EAAA,MAAA,CAAA;AAGhC,UAAA,CAAA;AAA5B,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;AAAoB,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAGnB,UAAA,CAAA;AAA3B,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AAA0C,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AAIjD,UAAA,CAAA;AAAlB,IAAAC,CAAK;AAA6B,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAGlB,UAAA,CAAA;AAAhB,IAAAA,CAAK;AAA4B,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;;;;"}
1
+ {"version":3,"file":"BaseField-Cj2rNVeC.js","sources":["../../src/input/BaseField.ts"],"sourcesContent":["import { html, nothing, type PropertyValues, type TemplateResult } from 'lit';\nimport { property, state } from 'lit/decorators.js';\n\nimport { peacockString } from '@/__internal/i18n/strings.js';\nimport type { Size } from '@/__internal/utils/size.js';\nimport BaseInput from './BaseInput.js';\n\n/** Below this width, in pixels, a field's Suggested badge shows just the sparkle. */\nconst NARROW_FIELD_WIDTH = 320;\n\n/** What a field component passes to `renderField()`. */\nexport interface FieldRenderOptions {\n /** Whether the field has a value; outlined fields float their label when it does. */\n populated: boolean;\n /** Overrides the field's own focus state, for fields whose popup keeps them active. */\n focused?: boolean;\n /** An error the control found itself, such as text that does not parse. */\n controlError?: string;\n /** Extra content before the control (after the `start` slot). */\n start?: unknown;\n /** Extra content after the control (after the `end` slot), such as a picker button. */\n end?: unknown;\n /** Character counter shown in the footer, such as `12/100`; empty or unset for none. */\n textCount?: string;\n}\n\nlet fieldCount = 0;\n\n/**\n * Base class for Peacock's text-like fields (input, textarea, number, URL, select, date/time,\n * color). It adds the props every field shares (label, helper/error/warning text, variant, size,\n * clearable, `start`/`end` slots) and renders the `wc-field` frame.\n *\n * It also makes the inner control accessible across the shadow boundary: `fieldAria()` gives it\n * an accessible name from `label`, `aria-invalid` while an error shows, and `aria-describedby`\n * pointing at a hidden copy of the helper or error text in the same shadow root.\n *\n * Subclasses call `renderField(control, options)` in `render()`, spread `fieldAria()` onto the\n * native control, call `emitValue('input' | 'change')` instead of re-dispatching native events\n * (the field event contract: `CustomEvent<{ value }>`, bubbling and composed), and override\n * `clearValue()` if clearing means more than `value = ''`.\n */\nexport default abstract class BaseField extends BaseInput {\n // ── Properties ───────────────────────────────────────────────────────────\n\n /** Label shown above the field; also the control's accessible name. */\n @property({ type: String }) label = '';\n\n /** Hint shown inside the empty control. */\n @property({ type: String }) placeholder = '';\n\n /** Help text shown below the field. */\n @property({ type: String, attribute: 'helper-text' }) helperText = '';\n\n /** Shows the field in its error state with `error-text`. */\n @property({ type: Boolean }) error = false;\n\n /** Error message shown below the field while `error` is set; replaces the help text. */\n @property({ type: String, attribute: 'error-text' }) errorText = '';\n\n /** Shows the field in its warning state with `warning-text`. */\n @property({ type: Boolean }) warning = false;\n\n /** Warning message shown below the field while `warning` is set; replaces the help text. */\n @property({ type: String, attribute: 'warning-text' }) warningText = '';\n\n /** Visual variant of the field. */\n @property({ type: String }) variant: 'default' | 'filled' | 'outlined' =\n 'default';\n\n /** Height of the field: `sm` (2.5rem, default), `md` (3.5rem) or `lg` (4rem). */\n @property({ type: String, reflect: true }) size: Size = 'sm';\n\n /** Shows a button that clears the value while the field has one. */\n @property({ type: Boolean }) clearable = false;\n\n /** ARIA attributes moved from the host onto the inner control. */\n @property({ type: Object }) configAria: Record<string, string> = {};\n\n // ── State ────────────────────────────────────────────────────────────────\n\n @state() protected focused = false;\n\n /** The field is too narrow for the Suggested badge's label; it shows just the sparkle. */\n @state() private __narrow = false;\n\n // ── Private fields ───────────────────────────────────────────────────────\n\n /** Id of the hidden description the inner control points at. */\n protected readonly fieldDescriptionId = `wc-field-description-${(fieldCount += 1)}`;\n\n /** A `tabindex` set on the host, moved to the inner control. */\n protected controlTabIndex?: string;\n\n /** Watches the field's width while it holds a suggestion, so the badge can shrink. */\n private __widthObserver?: ResizeObserver;\n\n // ── Lifecycle ────────────────────────────────────────────────────────────\n\n override connectedCallback() {\n super.connectedCallback();\n // `aria-*` and `tabindex` set on the host belong to the inner control; move them there.\n for (const attr of Array.from(this.attributes)) {\n if (attr.name.startsWith('aria-')) {\n this.configAria = { ...this.configAria, [attr.name]: attr.value };\n this.removeAttribute(attr.name);\n }\n }\n if (this.hasAttribute('tabindex')) {\n this.controlTabIndex = this.getAttribute('tabindex') ?? undefined;\n this.removeAttribute('tabindex');\n }\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.__widthObserver?.disconnect();\n this.__widthObserver = undefined;\n }\n\n protected override updated(changed: PropertyValues) {\n super.updated(changed);\n // Only a field showing a suggestion pays for an observer.\n if (this.suggestionVisible && !this.__widthObserver) {\n this.__widthObserver = new ResizeObserver(([entry]) => {\n this.__narrow = entry.contentRect.width < NARROW_FIELD_WIDTH;\n });\n this.__widthObserver.observe(this);\n } else if (!this.suggestionVisible && this.__widthObserver) {\n this.__widthObserver.disconnect();\n this.__widthObserver = undefined;\n }\n }\n\n // ── Protected ────────────────────────────────────────────────────────────\n\n /**\n * Whether the Suggested badge always shows just the sparkle, whatever the width. A textarea\n * sets it: a label beside it would narrow every line of the text.\n */\n protected get suggestionBadgeIconOnly(): boolean {\n return false;\n }\n\n /**\n * The error text the field shows: the consumer's `error-text` while `error` is set, else an\n * error the control found itself, else the validation message once it should show.\n */\n protected fieldErrorText(controlError = ''): string {\n if (this.error) return this.errorText;\n return controlError || this.validationText;\n }\n\n /**\n * Attributes for the native control: accessible name, invalid state, description and the\n * host's `tabindex`, plus `configAria`. Spread them onto it with `spread(this.fieldAria())`.\n */\n protected fieldAria(controlError = ''): Record<string, string | undefined> {\n const invalid = this.error || !!this.fieldErrorText(controlError);\n return {\n tabindex: this.controlTabIndex,\n 'aria-label': this.label || undefined,\n 'aria-invalid': invalid ? 'true' : undefined,\n 'aria-describedby': this.fieldDescription(controlError)\n ? this.fieldDescriptionId\n : undefined,\n ...this.configAria,\n };\n }\n\n /** Renders the `wc-field` frame around `control`, plus the hidden description. */\n protected renderField(\n control: unknown,\n options: FieldRenderOptions,\n ): TemplateResult {\n const errorText = this.fieldErrorText(options.controlError);\n const description = this.fieldDescription(options.controlError);\n // While a suggestion shows, its reason takes the helper text's place.\n const helperText = this.suggestionReason || this.helperText;\n return html`\n <wc-field\n label=${this.label}\n size=${this.size}\n variant=${this.variant}\n helper-text=${helperText}\n ?required=${this.required}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?skeleton=${this.skeleton}\n ?error=${this.error || !!errorText}\n error-text=${errorText}\n ?warning=${this.warning}\n warning-text=${this.warningText}\n text-count=${options.textCount ?? ''}\n ?populated=${options.populated}\n ?focused=${options.focused ?? this.focused}\n .host=${this}\n class=\"field\"\n >\n <slot name=\"start\" slot=\"field-start\"></slot>\n ${options.start ?? nothing} ${control}\n <slot name=\"end\" slot=\"field-end\"></slot>\n ${this.suggestionBadge({\n slot: 'field-end',\n iconOnly: this.__narrow || this.suggestionBadgeIconOnly,\n })}\n ${this.renderClearButton(options.populated)} ${options.end ?? nothing}\n </wc-field>\n ${description\n ? html`<span id=${this.fieldDescriptionId} hidden>${description}</span>`\n : nothing}\n `;\n }\n\n /** Dispatches `input` or `change` with the current value: the field event contract. */\n protected emitValue(type: 'input' | 'change') {\n this.dispatchEvent(\n new CustomEvent(type, {\n detail: { value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n protected override emitSuggestionValue() {\n this.emitValue('input');\n this.emitValue('change');\n }\n\n /** Clears the value for the clear button. Fields with another empty value override it. */\n protected clearValue() {\n this.value = '';\n this.emitValue('input');\n this.emitValue('change');\n }\n\n /** The counter text for a field with a `maxlength`: `12/100`, or '' when there is no limit. */\n protected characterCount(maxLength: number | null | undefined): string {\n if (typeof maxLength !== 'number' || !Number.isFinite(maxLength)) return '';\n if (maxLength < 0) return '';\n const count = String(this.value ?? '').length;\n return peacockString('characterCount')(count, maxLength);\n }\n\n /** Tracks focus of the inner control; bind it to the control's `focus` and `blur`. */\n protected handleFieldFocus = (event: FocusEvent) => {\n this.focused = event.type === 'focus';\n };\n\n // ── Private ──────────────────────────────────────────────────────────────\n\n /** The text the description carries: the error, else the warning, else the help. */\n private fieldDescription(controlError = ''): string {\n const errorText = this.fieldErrorText(controlError);\n if (errorText) return errorText;\n if (this.warning && this.warningText) return this.warningText;\n if (this.suggestionVisible) {\n return peacockString('aiSuggestedDescription')(this.suggestionReason);\n }\n return this.helperText;\n }\n\n private renderClearButton(populated: boolean) {\n if (!this.clearable || !populated || this.disabled || this.readonly) {\n return nothing;\n }\n return html`<wc-icon-button\n slot=\"field-end\"\n class=\"clear-button\"\n shape=\"round\"\n variant=\"text\"\n size=\"sm\"\n aria-label=${peacockString('clear')}\n @click=${() => {\n this.clearValue();\n this.focus();\n }}\n >\n <wc-icon name=\"close\"></wc-icon>\n </wc-icon-button>`;\n }\n}\n"],"names":["html","nothing","property","state"],"mappings":";;;;;;AAOA;AACA,MAAM,kBAAkB,GAAG,GAAG;AAkB9B,IAAI,UAAU,GAAG,CAAC;AAElB;;;;;;;;;;;;;AAaG;AACW,MAAgB,SAAU,SAAQ,SAAS,CAAA;AAAzD,IAAA,WAAA,GAAA;;;;QAI8B,IAAA,CAAA,KAAK,GAAG,EAAE;;QAGV,IAAA,CAAA,WAAW,GAAG,EAAE;;QAGU,IAAA,CAAA,UAAU,GAAG,EAAE;;QAGxC,IAAA,CAAA,KAAK,GAAG,KAAK;;QAGW,IAAA,CAAA,SAAS,GAAG,EAAE;;QAGtC,IAAA,CAAA,OAAO,GAAG,KAAK;;QAGW,IAAA,CAAA,WAAW,GAAG,EAAE;;QAG3C,IAAA,CAAA,OAAO,GACjC,SAAS;;QAGgC,IAAA,CAAA,IAAI,GAAS,IAAI;;QA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ternals, i as internals } from './element-internals-QME0yEz4.js';
5
5
  import { m as mixinFormAssociated, g as getFormValue } from './form-associated-BHbg72PG.js';
6
- import { p as peacockString } from './strings-DYwXSSu_.js';
6
+ import { p as peacockString } from './strings-BpCoUL0V.js';
7
7
  import { S as SuggestionController } from './suggestion-controller-7YRQqkaI.js';
8
8
 
9
9
  const VALIDITY_KEYS = [
@@ -298,4 +298,4 @@ __decorate([
298
298
  ], BaseInput.prototype, "showValidity", void 0);
299
299
 
300
300
  export { BaseInput as B, nativeValidity as n };
301
- //# sourceMappingURL=BaseInput-FhjvfMjF.js.map
301
+ //# sourceMappingURL=BaseInput-CSOLv2-i.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseInput-FhjvfMjF.js","sources":["../../src/input/BaseInput.ts"],"sourcesContent":["import { html, LitElement, type PropertyValues } from 'lit';\nimport { property, state } from 'lit/decorators.js';\n\nimport {\n internals,\n mixinElementInternals,\n} from '@/__internal/mixins/element-internals.js';\nimport {\n type FormRestoreState,\n type FormValue,\n getFormValue,\n mixinFormAssociated,\n} from '@/__internal/mixins/form-associated.js';\nimport { peacockString } from '@/__internal/i18n/strings.js';\nimport {\n SuggestionController,\n type SuggestionAcceptCause,\n} from '@/__internal/ai/suggestion-controller.js';\nimport type { AiSuggestion } from '@/__internal/ai/types.js';\n\nconst VALIDITY_KEYS = [\n 'valueMissing',\n 'typeMismatch',\n 'patternMismatch',\n 'tooLong',\n 'tooShort',\n 'rangeUnderflow',\n 'rangeOverflow',\n 'stepMismatch',\n 'badInput',\n] as const;\n\n/** The flags `ElementInternals.setValidity()` takes, as the DOM's `ValidityStateFlags`. */\nexport type ValidityFlags = {\n [Key in (typeof VALIDITY_KEYS)[number] | 'customError']?: boolean;\n};\n\n/** What a control reports to `ElementInternals.setValidity()`. */\nexport interface ControlValidity {\n flags: ValidityFlags;\n message: string;\n /** Element the browser points at when it reports the problem; defaults to the host. */\n anchor?: HTMLElement;\n}\n\n/** The validity of a native control, for controls that wrap one. */\nexport function nativeValidity(\n control: HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement,\n): ControlValidity {\n const flags: ValidityFlags = {};\n for (const key of VALIDITY_KEYS) {\n if (control.validity[key]) flags[key] = true;\n }\n return { flags, message: control.validationMessage, anchor: control };\n}\n\n/** Set while one `invalid` event per form submission moves focus, so only the first one does. */\nlet focusClaimed = false;\n\n/**\n * Base class for Peacock's form controls.\n *\n * It is form-associated: `value` is submitted with the surrounding `<form>`, `form.reset()`\n * restores the value the control started with, and a disabled `<fieldset>` disables it.\n * `name` and `disabled` come from `mixinFormAssociated`; they are backed by attributes, so\n * subclasses must not redeclare them.\n *\n * It takes part in constraint validation like a native control: `required` and the control's own\n * rules (from `computeValidity()`) block form submission, `checkValidity()`, `reportValidity()`,\n * `setCustomValidity()`, `validity` and `validationMessage` work as on `<input>`, and `:invalid`\n * matches. A control shows its message (`validationText`) once the person has committed a value\n * or the form was submitted.\n *\n * It can hold a value the assistant suggested (ADR-030002): `suggestion` fills the control and\n * marks it until the person accepts or clears it. `sensitive` keeps the control out of AI\n * altogether. Subclasses show the marker with `suggestionBadge()` and `suggestionReason`, and\n * override `readSuggestionValue()`, `writeSuggestionValue()` and `emitSuggestionValue()` when\n * their value is not `value` with `input`/`change` events.\n *\n * @fires {CustomEvent<SuggestionAcceptDetail>} accept - Fired when a suggested value is accepted: the person edited it (`cause: 'edit'`), the form was submitted (`'submit'`) or `acceptSuggestion()` was called (`'action'`).\n * @fires {CustomEvent<SuggestionDismissDetail>} dismiss - Fired when the person clears a suggestion, before `input` and `change` with the restored value.\n */\nexport default abstract class BaseInput extends mixinFormAssociated(\n mixinElementInternals(LitElement),\n) {\n // ── Properties ───────────────────────────────────────────────────────────\n\n /** Each control declares its own `value` (a property, or an accessor such as Switch's). */\n abstract value?: any;\n\n /** Shows the value but stops the user changing it; unlike `disabled`, it stays focusable and is submitted. */\n @property({ type: Boolean, reflect: true })\n readonly: boolean = false;\n\n /** Requires a value before the form can submit. */\n @property({ type: Boolean, reflect: true })\n required: boolean = false;\n\n /** Shows a loading placeholder in place of the control. */\n @property({ type: Boolean, reflect: true })\n skeleton = false;\n\n /**\n * Holds data that must never reach a model, such as a salary or a bank account: the control\n * takes no suggestions and offers no AI features.\n */\n @property({ type: Boolean, reflect: true })\n sensitive = false;\n\n /**\n * A value the assistant suggests, with why. The control takes the value and shows a Suggested\n * badge and the reason until the person edits it, the form is submitted, or the badge clears it,\n * which puts the previous value back. `null` drops the marker and keeps the value. Ignored while\n * AI is off and on `sensitive` controls.\n */\n @property({ attribute: false })\n get suggestion(): AiSuggestion | null {\n return this.__suggestions.suggestion;\n }\n\n set suggestion(suggestion: AiSuggestion | null) {\n const old = this.__suggestions.suggestion;\n this.__suggestions.set(suggestion);\n this.requestUpdate('suggestion', old);\n }\n\n // ── State ────────────────────────────────────────────────────────────────\n\n /** Whether to show the validation message: after a commit, or after a failed submit. */\n @state() protected showValidity = false;\n\n // ── Private fields ───────────────────────────────────────────────────────\n\n /** The value the control had when it was first connected; `form.reset()` returns to it. */\n private __defaultValue: unknown = undefined;\n\n private __defaultValueCaptured = false;\n\n private __customValidity = '';\n\n private readonly __suggestions = new SuggestionController(this, {\n read: () => this.readSuggestionValue(),\n write: value => this.writeSuggestionValue(value),\n emit: () => this.emitSuggestionValue(),\n });\n\n // ── Lifecycle ────────────────────────────────────────────────────────────\n\n constructor() {\n super();\n this.addEventListener('invalid', this.__handleInvalid);\n // Every control fires `change` when the person commits a value; from then on, show problems.\n this.addEventListener('change', this.__handleCommit);\n }\n\n override connectedCallback() {\n super.connectedCallback();\n if (!this.__defaultValueCaptured) {\n this.__defaultValue = this.value;\n this.__defaultValueCaptured = true;\n }\n }\n\n protected override updated(changed: PropertyValues) {\n super.updated(changed);\n // After render, so a control's inner native input reflects the new value and attributes.\n this.updateValidity();\n }\n\n // ── Public: constraint validation ────────────────────────────────────────\n\n get validity(): ValidityState {\n this.updateValidity();\n return this[internals].validity;\n }\n\n get validationMessage(): string {\n this.updateValidity();\n return this[internals].validationMessage;\n }\n\n get willValidate(): boolean {\n return this[internals].willValidate;\n }\n\n checkValidity(): boolean {\n this.updateValidity();\n return this[internals].checkValidity();\n }\n\n reportValidity(): boolean {\n this.updateValidity();\n return this[internals].reportValidity();\n }\n\n /** Sets a custom error message, as on `<input>`; an empty string clears it. */\n setCustomValidity(message: string): void {\n this.__customValidity = message;\n this.updateValidity();\n this.requestUpdate();\n }\n\n // ── Public: suggestions ──────────────────────────────────────────────────\n\n /** Whether the control holds a suggestion the person hasn't accepted or cleared. */\n get suggested(): boolean {\n return !!this.__suggestions.suggestion;\n }\n\n /** Accepts the suggestion: the value stays and the marker goes. Fires `accept`. */\n acceptSuggestion(cause: SuggestionAcceptCause = 'action'): void {\n this.__suggestions.accept(cause);\n }\n\n /** Clears the suggestion and puts the previous value back. Fires `dismiss`, `input` and `change`. */\n dismissSuggestion(): void {\n this.__suggestions.dismiss();\n }\n\n // ── Protected ────────────────────────────────────────────────────────────\n\n /**\n * The Suggested badge with its clear button, while a suggestion shows; else nothing. Controls\n * without helper text pass `withReason` so the badge's tooltip carries the reason.\n */\n protected suggestionBadge(\n options: { slot?: string; withReason?: boolean; iconOnly?: boolean } = {},\n ) {\n return this.__suggestions.badge(options);\n }\n\n /**\n * A group's label with the Suggested badge beside it while a suggestion shows. The badge stays\n * outside the label element, so it is not part of the group's accessible name. Style\n * `.label-row` as a row.\n */\n protected labelWithSuggestion(label: unknown) {\n if (!this.suggestionVisible) return label;\n return html`<div class=\"label-row\">${label}${this.suggestionBadge()}</div>`;\n }\n\n /** Why the value was suggested, while the suggestion shows; else `''`. */\n protected get suggestionReason(): string {\n return this.__suggestions.reason;\n }\n\n /** Whether a suggestion shows as one now (AI on, not sensitive). */\n protected get suggestionVisible(): boolean {\n return this.__suggestions.visible;\n }\n\n /** The value a suggestion replaces and a dismissed one restores. */\n protected readSuggestionValue(): unknown {\n return this.value;\n }\n\n /** Puts a suggested or restored value into the control. */\n protected writeSuggestionValue(value: unknown): void {\n this.value = value;\n }\n\n /** Fires `input` and `change` after the person cleared a suggestion. */\n protected emitSuggestionValue(): void {\n for (const type of ['input', 'change']) {\n this.dispatchEvent(\n new CustomEvent(type, {\n detail: { value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n }\n\n /**\n * The control's own validity. The default checks `required` against an empty `value`;\n * controls that wrap a native input return `nativeValidity(input)`, others add their rules.\n */\n protected computeValidity(): ControlValidity {\n const empty =\n this.value === undefined || this.value === null || this.value === '';\n if (this.required && empty && !this.disabled) {\n return {\n flags: { valueMissing: true },\n message: this.valueMissingText(),\n };\n }\n return { flags: {}, message: '' };\n }\n\n /** The message for a missing required value. */\n protected valueMissingText(): string {\n return peacockString('valueMissing');\n }\n\n /** Pushes the current validity to `ElementInternals`. */\n protected updateValidity(): void {\n if (this.__customValidity) {\n this[internals].setValidity(\n { customError: true },\n this.__customValidity,\n this.validityAnchor(),\n );\n return;\n }\n const { flags, message, anchor } = this.computeValidity();\n const invalid = Object.values(flags).some(Boolean);\n if (invalid) {\n this[internals].setValidity(\n flags,\n message || ' ',\n anchor ?? this.validityAnchor(),\n );\n } else {\n this[internals].setValidity({});\n }\n }\n\n /** The element the browser points at when it reports a problem. */\n protected validityAnchor(): HTMLElement | undefined {\n return undefined;\n }\n\n /** The message to show under the control, or '' while there is nothing to show. */\n protected get validationText(): string {\n if (!this.showValidity) return '';\n this.updateValidity();\n return this[internals].validity.valid\n ? ''\n : this[internals].validationMessage;\n }\n\n // ── Form association ─────────────────────────────────────────────────────\n\n override [getFormValue](): FormValue | null {\n if (this.value === undefined || this.value === null) return null;\n return String(this.value);\n }\n\n formResetCallback() {\n this.__suggestions.set(null);\n this.value = this.__defaultValue;\n this.showValidity = false;\n }\n\n formStateRestoreCallback(restored: FormRestoreState | null) {\n this.value =\n restored === null\n ? this.__defaultValue\n : this.parseRestoreState(restored);\n }\n\n /** Turns saved form state back into a value. Strings by default. */\n protected parseRestoreState(restored: FormRestoreState): unknown {\n return typeof restored === 'string' ? restored : this.__defaultValue;\n }\n\n // ── Private ──────────────────────────────────────────────────────────────\n\n private __handleInvalid = (event: Event) => {\n // Show the message under the control instead of the browser bubble, and move focus to the\n // first invalid control of the submission.\n event.preventDefault();\n this.showValidity = true;\n if (!focusClaimed) {\n focusClaimed = true;\n this.focus();\n queueMicrotask(() => {\n focusClaimed = false;\n });\n }\n };\n\n private __handleCommit = (event: Event) => {\n if (event.target === this) this.showValidity = true;\n };\n}\n"],"names":["LitElement","html","property","state"],"mappings":";;;;;;;;AAoBA,MAAM,aAAa,GAAG;IACpB,cAAc;IACd,cAAc;IACd,iBAAiB;IACjB,SAAS;IACT,UAAU;IACV,gBAAgB;IAChB,eAAe;IACf,cAAc;IACd,UAAU;CACF;AAeV;AACM,SAAU,cAAc,CAC5B,OAAmE,EAAA;IAEnE,MAAM,KAAK,GAAkB,EAAE;AAC/B,IAAA,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE;AAC/B,QAAA,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;AAAE,YAAA,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI;IAC9C;AACA,IAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,iBAAiB,EAAE,MAAM,EAAE,OAAO,EAAE;AACvE;AAEA;AACA,IAAI,YAAY,GAAG,KAAK;AAExB;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACW,MAAgB,SAAU,SAAQ,mBAAmB,CACjE,qBAAqB,CAACA,CAAU,CAAC,CAClC,CAAA;AAyBC;;;;;AAKG;AAEH,IAAA,IAAI,UAAU,GAAA;AACZ,QAAA,OAAO,IAAI,CAAC,aAAa,CAAC,UAAU;IACtC;IAEA,IAAI,UAAU,CAAC,UAA+B,EAAA;AAC5C,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU;AACzC,QAAA,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC;AAClC,QAAA,IAAI,CAAC,aA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EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AACzB,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAOjB,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AACxB,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AASlB,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE;AAG7B,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,YAAA,EAAA,IAAA,CAAA;AAWkB,UAAA,CAAA;AAAlB,IAAAC,CAAK;AAAkC,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;;;;"}
1
+ {"version":3,"file":"BaseInput-CSOLv2-i.js","sources":["../../src/input/BaseInput.ts"],"sourcesContent":["import { html, LitElement, type PropertyValues } from 'lit';\nimport { property, state } from 'lit/decorators.js';\n\nimport {\n internals,\n mixinElementInternals,\n} from '@/__internal/mixins/element-internals.js';\nimport {\n type FormRestoreState,\n type FormValue,\n getFormValue,\n mixinFormAssociated,\n} from '@/__internal/mixins/form-associated.js';\nimport { peacockString } from '@/__internal/i18n/strings.js';\nimport {\n SuggestionController,\n type SuggestionAcceptCause,\n} from '@/__internal/ai/suggestion-controller.js';\nimport type { AiSuggestion } from '@/__internal/ai/types.js';\n\nconst VALIDITY_KEYS = [\n 'valueMissing',\n 'typeMismatch',\n 'patternMismatch',\n 'tooLong',\n 'tooShort',\n 'rangeUnderflow',\n 'rangeOverflow',\n 'stepMismatch',\n 'badInput',\n] as const;\n\n/** The flags `ElementInternals.setValidity()` takes, as the DOM's `ValidityStateFlags`. */\nexport type ValidityFlags = {\n [Key in (typeof VALIDITY_KEYS)[number] | 'customError']?: boolean;\n};\n\n/** What a control reports to `ElementInternals.setValidity()`. */\nexport interface ControlValidity {\n flags: ValidityFlags;\n message: string;\n /** Element the browser points at when it reports the problem; defaults to the host. */\n anchor?: HTMLElement;\n}\n\n/** The validity of a native control, for controls that wrap one. */\nexport function nativeValidity(\n control: HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement,\n): ControlValidity {\n const flags: ValidityFlags = {};\n for (const key of VALIDITY_KEYS) {\n if (control.validity[key]) flags[key] = true;\n }\n return { flags, message: control.validationMessage, anchor: control };\n}\n\n/** Set while one `invalid` event per form submission moves focus, so only the first one does. */\nlet focusClaimed = false;\n\n/**\n * Base class for Peacock's form controls.\n *\n * It is form-associated: `value` is submitted with the surrounding `<form>`, `form.reset()`\n * restores the value the control started with, and a disabled `<fieldset>` disables it.\n * `name` and `disabled` come from `mixinFormAssociated`; they are backed by attributes, so\n * subclasses must not redeclare them.\n *\n * It takes part in constraint validation like a native control: `required` and the control's own\n * rules (from `computeValidity()`) block form submission, `checkValidity()`, `reportValidity()`,\n * `setCustomValidity()`, `validity` and `validationMessage` work as on `<input>`, and `:invalid`\n * matches. A control shows its message (`validationText`) once the person has committed a value\n * or the form was submitted.\n *\n * It can hold a value the assistant suggested (ADR-030002): `suggestion` fills the control and\n * marks it until the person accepts or clears it. `sensitive` keeps the control out of AI\n * altogether. Subclasses show the marker with `suggestionBadge()` and `suggestionReason`, and\n * override `readSuggestionValue()`, `writeSuggestionValue()` and `emitSuggestionValue()` when\n * their value is not `value` with `input`/`change` events.\n *\n * @fires {CustomEvent<SuggestionAcceptDetail>} accept - Fired when a suggested value is accepted: the person edited it (`cause: 'edit'`), the form was submitted (`'submit'`) or `acceptSuggestion()` was called (`'action'`).\n * @fires {CustomEvent<SuggestionDismissDetail>} dismiss - Fired when the person clears a suggestion, before `input` and `change` with the restored value.\n */\nexport default abstract class BaseInput extends mixinFormAssociated(\n mixinElementInternals(LitElement),\n) {\n // ── Properties ───────────────────────────────────────────────────────────\n\n /** Each control declares its own `value` (a property, or an accessor such as Switch's). */\n abstract value?: any;\n\n /** Shows the value but stops the user changing it; unlike `disabled`, it stays focusable and is submitted. */\n @property({ type: Boolean, reflect: true })\n readonly: boolean = false;\n\n /** Requires a value before the form can submit. */\n @property({ type: Boolean, reflect: true })\n required: boolean = false;\n\n /** Shows a loading placeholder in place of the control. */\n @property({ type: Boolean, reflect: true })\n skeleton = false;\n\n /**\n * Holds data that must never reach a model, such as a salary or a bank account: the control\n * takes no suggestions and offers no AI features.\n */\n @property({ type: Boolean, reflect: true })\n sensitive = false;\n\n /**\n * A value the assistant suggests, with why. The control takes the value and shows a Suggested\n * badge and the reason until the person edits it, the form is submitted, or the badge clears it,\n * which puts the previous value back. `null` drops the marker and keeps the value. Ignored while\n * AI is off and on `sensitive` controls.\n */\n @property({ attribute: false })\n get suggestion(): AiSuggestion | null {\n return this.__suggestions.suggestion;\n }\n\n set suggestion(suggestion: AiSuggestion | null) {\n const old = this.__suggestions.suggestion;\n this.__suggestions.set(suggestion);\n this.requestUpdate('suggestion', old);\n }\n\n // ── State ────────────────────────────────────────────────────────────────\n\n /** Whether to show the validation message: after a commit, or after a failed submit. */\n @state() protected showValidity = false;\n\n // ── Private fields ───────────────────────────────────────────────────────\n\n /** The value the control had when it was first connected; `form.reset()` returns to it. */\n private __defaultValue: unknown = undefined;\n\n private __defaultValueCaptured = false;\n\n private __customValidity = '';\n\n private readonly __suggestions = new SuggestionController(this, {\n read: () => this.readSuggestionValue(),\n write: value => this.writeSuggestionValue(value),\n emit: () => this.emitSuggestionValue(),\n });\n\n // ── Lifecycle ────────────────────────────────────────────────────────────\n\n constructor() {\n super();\n this.addEventListener('invalid', this.__handleInvalid);\n // Every control fires `change` when the person commits a value; from then on, show problems.\n this.addEventListener('change', this.__handleCommit);\n }\n\n override connectedCallback() {\n super.connectedCallback();\n if (!this.__defaultValueCaptured) {\n this.__defaultValue = this.value;\n this.__defaultValueCaptured = true;\n }\n }\n\n protected override updated(changed: PropertyValues) {\n super.updated(changed);\n // After render, so a control's inner native input reflects the new value and attributes.\n this.updateValidity();\n }\n\n // ── Public: constraint validation ────────────────────────────────────────\n\n get validity(): ValidityState {\n this.updateValidity();\n return this[internals].validity;\n }\n\n get validationMessage(): string {\n this.updateValidity();\n return this[internals].validationMessage;\n }\n\n get willValidate(): boolean {\n return this[internals].willValidate;\n }\n\n checkValidity(): boolean {\n this.updateValidity();\n return this[internals].checkValidity();\n }\n\n reportValidity(): boolean {\n this.updateValidity();\n return this[internals].reportValidity();\n }\n\n /** Sets a custom error message, as on `<input>`; an empty string clears it. */\n setCustomValidity(message: string): void {\n this.__customValidity = message;\n this.updateValidity();\n this.requestUpdate();\n }\n\n // ── Public: suggestions ──────────────────────────────────────────────────\n\n /** Whether the control holds a suggestion the person hasn't accepted or cleared. */\n get suggested(): boolean {\n return !!this.__suggestions.suggestion;\n }\n\n /** Accepts the suggestion: the value stays and the marker goes. Fires `accept`. */\n acceptSuggestion(cause: SuggestionAcceptCause = 'action'): void {\n this.__suggestions.accept(cause);\n }\n\n /** Clears the suggestion and puts the previous value back. Fires `dismiss`, `input` and `change`. */\n dismissSuggestion(): void {\n this.__suggestions.dismiss();\n }\n\n // ── Protected ────────────────────────────────────────────────────────────\n\n /**\n * The Suggested badge with its clear button, while a suggestion shows; else nothing. Controls\n * without helper text pass `withReason` so the badge's tooltip carries the reason.\n */\n protected suggestionBadge(\n options: { slot?: string; withReason?: boolean; iconOnly?: boolean } = {},\n ) {\n return this.__suggestions.badge(options);\n }\n\n /**\n * A group's label with the Suggested badge beside it while a suggestion shows. The badge stays\n * outside the label element, so it is not part of the group's accessible name. Style\n * `.label-row` as a row.\n */\n protected labelWithSuggestion(label: unknown) {\n if (!this.suggestionVisible) return label;\n return html`<div class=\"label-row\">${label}${this.suggestionBadge()}</div>`;\n }\n\n /** Why the value was suggested, while the suggestion shows; else `''`. */\n protected get suggestionReason(): string {\n return this.__suggestions.reason;\n }\n\n /** Whether a suggestion shows as one now (AI on, not sensitive). */\n protected get suggestionVisible(): boolean {\n return this.__suggestions.visible;\n }\n\n /** The value a suggestion replaces and a dismissed one restores. */\n protected readSuggestionValue(): unknown {\n return this.value;\n }\n\n /** Puts a suggested or restored value into the control. */\n protected writeSuggestionValue(value: unknown): void {\n this.value = value;\n }\n\n /** Fires `input` and `change` after the person cleared a suggestion. */\n protected emitSuggestionValue(): void {\n for (const type of ['input', 'change']) {\n this.dispatchEvent(\n new CustomEvent(type, {\n detail: { value: this.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n }\n\n /**\n * The control's own validity. The default checks `required` against an empty `value`;\n * controls that wrap a native input return `nativeValidity(input)`, others add their rules.\n */\n protected computeValidity(): ControlValidity {\n const empty =\n this.value === undefined || this.value === null || this.value === '';\n if (this.required && empty && !this.disabled) {\n return {\n flags: { valueMissing: true },\n message: this.valueMissingText(),\n };\n }\n return { flags: {}, message: '' };\n }\n\n /** The message for a missing required value. */\n protected valueMissingText(): string {\n return peacockString('valueMissing');\n }\n\n /** Pushes the current validity to `ElementInternals`. */\n protected updateValidity(): void {\n if (this.__customValidity) {\n this[internals].setValidity(\n { customError: true },\n this.__customValidity,\n this.validityAnchor(),\n );\n return;\n }\n const { flags, message, anchor } = this.computeValidity();\n const invalid = Object.values(flags).some(Boolean);\n if (invalid) {\n this[internals].setValidity(\n flags,\n message || ' ',\n anchor ?? this.validityAnchor(),\n );\n } else {\n this[internals].setValidity({});\n }\n }\n\n /** The element the browser points at when it reports a problem. */\n protected validityAnchor(): HTMLElement | undefined {\n return undefined;\n }\n\n /** The message to show under the control, or '' while there is nothing to show. */\n protected get validationText(): string {\n if (!this.showValidity) return '';\n this.updateValidity();\n return this[internals].validity.valid\n ? ''\n : this[internals].validationMessage;\n }\n\n // ── Form association ─────────────────────────────────────────────────────\n\n override [getFormValue](): FormValue | null {\n if (this.value === undefined || this.value === null) return null;\n return String(this.value);\n }\n\n formResetCallback() {\n this.__suggestions.set(null);\n this.value = this.__defaultValue;\n this.showValidity = false;\n }\n\n formStateRestoreCallback(restored: FormRestoreState | null) {\n this.value =\n restored === null\n ? this.__defaultValue\n : this.parseRestoreState(restored);\n }\n\n /** Turns saved form state back into a value. Strings by default. */\n protected parseRestoreState(restored: FormRestoreState): unknown {\n return typeof restored === 'string' ? restored : this.__defaultValue;\n }\n\n // ── Private ──────────────────────────────────────────────────────────────\n\n private __handleInvalid = (event: Event) => {\n // Show the message under the control instead of the browser bubble, and move focus to the\n // first invalid control of the submission.\n event.preventDefault();\n this.showValidity = true;\n if (!focusClaimed) {\n focusClaimed = true;\n this.focus();\n queueMicrotask(() => {\n focusClaimed = false;\n });\n }\n };\n\n private __handleCommit = (event: Event) => {\n if (event.target === this) this.showValidity = true;\n };\n}\n"],"names":["LitElement","html","property","state"],"mappings":";;;;;;;;AAoBA,MAAM,aAAa,GAAG;IACpB,cAAc;IACd,cAAc;IACd,iBAAiB;IACjB,SAAS;IACT,UAAU;IACV,gBAAgB;IAChB,eAAe;IACf,cAAc;IACd,UAAU;CACF;AAeV;AACM,SAAU,cAAc,CAC5B,OAAmE,EAAA;IAEnE,MAAM,KAAK,GAAkB,EAAE;AAC/B,IAAA,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE;AAC/B,QAAA,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;AAAE,YAAA,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI;IAC9C;AACA,IAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,iBAAiB,EAAE,MAAM,EAAE,OAAO,EAAE;AACvE;AAEA;AACA,IAAI,YAAY,GAAG,KAAK;AAExB;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACW,MAAgB,SAAU,SAAQ,mBAAmB,CACjE,qBAAqB,CAACA,CAAU,CAAC,CAClC,CAAA;AAyBC;;;;;AAKG;AAEH,IAAA,IAAI,UAAU,GAAA;AACZ,QAAA,OAAO,IAAI,CAAC,aAAa,CAAC,UAAU;IACtC;IAEA,IAAI,UAAU,CAAC,UAA+B,EAAA;AAC5C,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,C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AAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAI1B,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AACzB,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAOjB,UAAA,CAAA;IADCA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AACxB,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AASlB,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE;AAG7B,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,YAAA,EAAA,IAAA,CAAA;AAWkB,UAAA,CAAA;AAAlB,IAAAC,CAAK;AAAkC,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;;;;"}
package/dist/ai-badge.js CHANGED
@@ -2,9 +2,9 @@ import { i, _ as __decorate, I as IndividualComponent, a as i$1, A, b } from './
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { A as AiController } from './ai-controller-DR_Tg0sN.js';
4
4
  import { s as sparkle } from './sparkle-BmtM0vbq.js';
5
- import { I as I18nController } from './i18n-controller-Co6pasNo.js';
5
+ import { I as I18nController } from './i18n-controller-DNAjVSIP.js';
6
6
  import './locale-DEsJZCQG.js';
7
- import './strings-DYwXSSu_.js';
7
+ import './strings-BpCoUL0V.js';
8
8
 
9
9
  var css_248z = i`* {
10
10
  box-sizing: border-box;
@@ -2,9 +2,9 @@ import { i, _ as __decorate, I as IndividualComponent, a as i$1, b, A } from './
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { A as AiController } from './ai-controller-DR_Tg0sN.js';
4
4
  import { s as sparkle } from './sparkle-BmtM0vbq.js';
5
- import { I as I18nController } from './i18n-controller-Co6pasNo.js';
5
+ import { I as I18nController } from './i18n-controller-DNAjVSIP.js';
6
6
  import './locale-DEsJZCQG.js';
7
- import './strings-DYwXSSu_.js';
7
+ import './strings-BpCoUL0V.js';
8
8
 
9
9
  var css_248z = i`* {
10
10
  box-sizing: border-box;
package/dist/alert.js CHANGED
@@ -2,9 +2,9 @@ import { i, _ as __decorate, I as IndividualComponent, a as i$1, A, b } from './
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { r } from './state-BCeDVCI9.js';
4
4
  import { e } from './class-map-NDIkZErE.js';
5
- import { I as I18nController } from './i18n-controller-Co6pasNo.js';
5
+ import { I as I18nController } from './i18n-controller-DNAjVSIP.js';
6
6
  import './directive-ZPhl09Yt.js';
7
- import './strings-DYwXSSu_.js';
7
+ import './strings-BpCoUL0V.js';
8
8
  import './locale-DEsJZCQG.js';
9
9
 
10
10
  var css_248z = i`* {
@@ -2,9 +2,9 @@ import { i, _ as __decorate, I as IndividualComponent, a as i$1, A, b } from './
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { r } from './state-BCeDVCI9.js';
4
4
  import { e } from './class-map-NDIkZErE.js';
5
- import { I as I18nController } from './i18n-controller-Co6pasNo.js';
5
+ import { I as I18nController } from './i18n-controller-DNAjVSIP.js';
6
6
  import './directive-ZPhl09Yt.js';
7
- import './strings-DYwXSSu_.js';
7
+ import './strings-BpCoUL0V.js';
8
8
  import './locale-DEsJZCQG.js';
9
9
 
10
10
  var css_248z = i`* {
package/dist/app-shell.js CHANGED
@@ -3,11 +3,11 @@ import { n } from './property-B2TG3KEE.js';
3
3
  import { r } from './state-BCeDVCI9.js';
4
4
  import { e } from './query-CHb9Ft_d.js';
5
5
  import { e as e$1 } from './class-map-NDIkZErE.js';
6
- import { I as I18nController } from './i18n-controller-Co6pasNo.js';
6
+ import { I as I18nController } from './i18n-controller-DNAjVSIP.js';
7
7
  import { O as OverlayController } from './overlay-controller-BOk-kfil.js';
8
8
  import './base-Cl6v8-BZ.js';
9
9
  import './directive-ZPhl09Yt.js';
10
- import './strings-DYwXSSu_.js';
10
+ import './strings-BpCoUL0V.js';
11
11
  import './locale-DEsJZCQG.js';
12
12
 
13
13
  var css_248z = i`* {
@@ -2,9 +2,9 @@ import { i, _ as __decorate, I as IndividualComponent, a as i$1, A, b } from './
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { A as AiController } from './ai-controller-DR_Tg0sN.js';
4
4
  import { s as sparkle } from './sparkle-BmtM0vbq.js';
5
- import { I as I18nController } from './i18n-controller-Co6pasNo.js';
5
+ import { I as I18nController } from './i18n-controller-DNAjVSIP.js';
6
6
  import './locale-DEsJZCQG.js';
7
- import './strings-DYwXSSu_.js';
7
+ import './strings-BpCoUL0V.js';
8
8
 
9
9
  var css_248z = i`* {
10
10
  box-sizing: border-box;
@@ -1,7 +1,7 @@
1
1
  import { i, _ as __decorate, I as IndividualComponent, a as i$1, A, b } from './IndividualComponent-BK7XZjE2.js';
2
2
  import { n } from './property-B2TG3KEE.js';
3
- import { I as I18nController } from './i18n-controller-Co6pasNo.js';
4
- import './strings-DYwXSSu_.js';
3
+ import { I as I18nController } from './i18n-controller-DNAjVSIP.js';
4
+ import './strings-BpCoUL0V.js';
5
5
  import './locale-DEsJZCQG.js';
6
6
 
7
7
  var css_248z = i`* {
@@ -2,10 +2,10 @@ import { i, _ as __decorate, I as IndividualComponent, a as i$1, A, b } from './
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { r } from './state-BCeDVCI9.js';
4
4
  import { A as AiController } from './ai-controller-DR_Tg0sN.js';
5
- import { I as I18nController } from './i18n-controller-Co6pasNo.js';
5
+ import { I as I18nController } from './i18n-controller-DNAjVSIP.js';
6
6
  import { STEP_STATUS } from './assistant-step.js';
7
7
  import './locale-DEsJZCQG.js';
8
- import './strings-DYwXSSu_.js';
8
+ import './strings-BpCoUL0V.js';
9
9
 
10
10
  var css_248z = i`* {
11
11
  box-sizing: border-box;
@@ -2,9 +2,9 @@ import { i, a as i$1, _ as __decorate, I as IndividualComponent, A, b } from './
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { r } from './state-BCeDVCI9.js';
4
4
  import { e } from './query-CHb9Ft_d.js';
5
- import { I as I18nController } from './i18n-controller-Co6pasNo.js';
5
+ import { I as I18nController } from './i18n-controller-DNAjVSIP.js';
6
6
  import './base-Cl6v8-BZ.js';
7
- import './strings-DYwXSSu_.js';
7
+ import './strings-BpCoUL0V.js';
8
8
  import './locale-DEsJZCQG.js';
9
9
 
10
10
  var css_248z = i`* {
package/dist/banner.js CHANGED
@@ -2,9 +2,9 @@ import { i, _ as __decorate, I as IndividualComponent, a as i$1, A, b } from './
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { r } from './state-BCeDVCI9.js';
4
4
  import { e } from './class-map-NDIkZErE.js';
5
- import { I as I18nController } from './i18n-controller-Co6pasNo.js';
5
+ import { I as I18nController } from './i18n-controller-DNAjVSIP.js';
6
6
  import './directive-ZPhl09Yt.js';
7
- import './strings-DYwXSSu_.js';
7
+ import './strings-BpCoUL0V.js';
8
8
  import './locale-DEsJZCQG.js';
9
9
 
10
10
  var css_248z = i`* {
@@ -1,6 +1,6 @@
1
1
  import { a as i, _ as __decorate } from './IndividualComponent-BK7XZjE2.js';
2
2
  import { n } from './property-B2TG3KEE.js';
3
- import { I as I18nController } from './i18n-controller-Co6pasNo.js';
3
+ import { I as I18nController } from './i18n-controller-DNAjVSIP.js';
4
4
  import { m as mixinDelegatesAria } from './delegate-Bw2wdPFP.js';
5
5
 
6
6
  /**
@@ -59,4 +59,4 @@ __decorate([
59
59
  ], BaseProgress.prototype, "inline", void 0);
60
60
 
61
61
  export { BaseProgress as B };
62
- //# sourceMappingURL=base-progress-D8-x6XS4.js.map
62
+ //# sourceMappingURL=base-progress-DduJjUeq.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-progress-D8-x6XS4.js","sources":["../../src/progress/base-progress.ts"],"sourcesContent":["import { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { I18nController } from '@/__internal/i18n/i18n-controller.js';\nimport { mixinDelegatesAria } from '@/__internal/aria/delegate.js';\nimport type { ARIAMixinStrict } from '@/__internal/aria/aria.js';\n\n/**\n * `aria-label` on the host names the progress bar without a visible label (it moves to the inner\n * `role=\"progressbar\"` element, as on buttons).\n */\nexport class BaseProgress extends mixinDelegatesAria(LitElement) {\n /** The current value, clamped into `0`–`max`. */\n @property({ type: Number }) value?: number;\n\n /** The value at which the task is complete. Defaults to `100`. */\n @property({ type: Number }) max = 100;\n\n /** Shows ongoing activity with no known completion, ignoring `value`. */\n @property({ type: Boolean }) indeterminate = false;\n\n /**\n * A visible label describing the progress, which also names the progress bar\n * (`aria-labelledby`). Without one the bar is named \"Loading\" (string `loading`).\n */\n @property({ type: String }) label?: string;\n\n /** Help text shown below the progress indicator. */\n @property({ type: String, attribute: 'helper-text' }) helperText?: string;\n\n /** Lays out the label and the indicator on one line instead of stacking them. */\n @property({ type: Boolean }) inline = false;\n\n /** Peacock's strings, for the fallback accessible name. */\n protected readonly i18n = new I18nController(this);\n\n /** The bar's name without a visible `label`: the host's `aria-label`, else \"Loading\". */\n protected get __fallbackLabel(): string {\n return (this as ARIAMixinStrict).ariaLabel || this.i18n.t('loading');\n }\n\n /** `max`, or 100 when it is not a positive number. */\n protected get __max(): number {\n return Number.isFinite(this.max) && this.max > 0 ? this.max : 100;\n }\n\n /** `value` clamped into `0`–`max`; 0 when unset. */\n protected get __clampedValue(): number {\n const value = Number(this.value);\n if (!Number.isFinite(value)) return 0;\n return Math.min(this.__max, Math.max(0, value));\n }\n\n /** The clamped value as a percentage of `max`. */\n __getPercentageValue(): number {\n return (this.__clampedValue / this.__max) * 100;\n }\n}\n"],"names":["LitElement","property"],"mappings":";;;;;AAMA;;;AAGG;MACU,YAAa,SAAQ,kBAAkB,CAACA,CAAU,CAAC,CAAA;AAAhE,IAAA,WAAA,GAAA;;;QAK8B,IAAA,CAAA,GAAG,GAAG,GAAG;;QAGR,IAAA,CAAA,aAAa,GAAG,KA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AAA,eAAA,EAAA,MAAA,CAAA;AAMvB,UAAA,CAAA;AAA3B,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AAAiB,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAGW,UAAA,CAAA;IAArDA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE;AAAsB,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AAG7C,UAAA,CAAA;AAA5B,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;AAAiB,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;;;;"}
1
+ {"version":3,"file":"base-progress-DduJjUeq.js","sources":["../../src/progress/base-progress.ts"],"sourcesContent":["import { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { I18nController } from '@/__internal/i18n/i18n-controller.js';\nimport { mixinDelegatesAria } from '@/__internal/aria/delegate.js';\nimport type { ARIAMixinStrict } from '@/__internal/aria/aria.js';\n\n/**\n * `aria-label` on the host names the progress bar without a visible label (it moves to the inner\n * `role=\"progressbar\"` element, as on buttons).\n */\nexport class BaseProgress extends mixinDelegatesAria(LitElement) {\n /** The current value, clamped into `0`–`max`. */\n @property({ type: Number }) value?: number;\n\n /** The value at which the task is complete. Defaults to `100`. */\n @property({ type: Number }) max = 100;\n\n /** Shows ongoing activity with no known completion, ignoring `value`. */\n @property({ type: Boolean }) indeterminate = false;\n\n /**\n * A visible label describing the progress, which also names the progress bar\n * (`aria-labelledby`). Without one the bar is named \"Loading\" (string `loading`).\n */\n @property({ type: String }) label?: string;\n\n /** Help text shown below the progress indicator. */\n @property({ type: String, attribute: 'helper-text' }) helperText?: string;\n\n /** Lays out the label and the indicator on one line instead of stacking them. */\n @property({ type: Boolean }) inline = false;\n\n /** Peacock's strings, for the fallback accessible name. */\n protected readonly i18n = new I18nController(this);\n\n /** The bar's name without a visible `label`: the host's `aria-label`, else \"Loading\". */\n protected get __fallbackLabel(): string {\n return (this as ARIAMixinStrict).ariaLabel || this.i18n.t('loading');\n }\n\n /** `max`, or 100 when it is not a positive number. */\n protected get __max(): number {\n return Number.isFinite(this.max) && this.max > 0 ? this.max : 100;\n }\n\n /** `value` clamped into `0`–`max`; 0 when unset. */\n protected get __clampedValue(): number {\n const value = Number(this.value);\n if (!Number.isFinite(value)) return 0;\n return Math.min(this.__max, Math.max(0, value));\n }\n\n /** The clamped value as a percentage of `max`. */\n __getPercentageValue(): number {\n return (this.__clampedValue / this.__max) * 100;\n }\n}\n"],"names":["LitElement","property"],"mappings":";;;;;AAMA;;;AAGG;MACU,YAAa,SAAQ,kBAAkB,CAACA,CAAU,CAAC,CAAA;AAAhE,IAAA,WAAA,GAAA;;;QAK8B,IAAA,CAAA,GAAG,GAAG,GAAG;;QAGR,IAAA,CAAA,aAAa,GAAG,KAAK;;QAYrB,IAAA,CAAA,MAAM,GAAG,KAAK;;AAGxB,QAAA,IAAA,CAAA,IAAI,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC;IAuBpD;;AApBE,IAAA,IAAc,eAAe,GAAA;AAC3B,QAAA,OAAQ,IAAwB,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACtE;;AAGA,IAAA,IAAc,KAAK,GAAA;QACjB,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,GAAG,GAAG;IACnE;;AAGA,IAAA,IAAc,cAAc,GAAA;QAC1B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;AAChC,QAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;AAAE,YAAA,OAAO,CAAC;AACrC,QAAA,OAAO,IAAI,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R.js';
7
- import { I as I18nController } from './i18n-controller-Co6pasNo.js';
7
+ import { I as I18nController } from './i18n-controller-DNAjVSIP.js';
8
8
  import { O as OverlayController } from './overlay-controller-BOk-kfil.js';
9
9
  import './base-Cl6v8-BZ.js';
10
10
  import './directive-ZPhl09Yt.js';
11
- import './strings-DYwXSSu_.js';
11
+ import './strings-BpCoUL0V.js';
12
12
  import './locale-DEsJZCQG.js';
13
13
 
14
14
  var css_248z = i`* {
@@ -1,12 +1,12 @@
1
1
  import { i, _ as __decorate, I as IndividualComponent, a as i$1, b } from './IndividualComponent-BK7XZjE2.js';
2
2
  import { n } from './property-B2TG3KEE.js';
3
3
  import { BreadcrumbItem } from './breadcrumb-item.js';
4
- import { I as I18nController } from './i18n-controller-Co6pasNo.js';
4
+ import { I as I18nController } from './i18n-controller-DNAjVSIP.js';
5
5
  import './state-BCeDVCI9.js';
6
6
  import './class-map-NDIkZErE.js';
7
7
  import './directive-ZPhl09Yt.js';
8
8
  import './if-defined-D9DEJR_6.js';
9
- import './strings-DYwXSSu_.js';
9
+ import './strings-BpCoUL0V.js';
10
10
  import './locale-DEsJZCQG.js';
11
11
 
12
12
  var css_248z = i`* {
package/dist/calendar.js CHANGED
@@ -3,10 +3,10 @@ import { n } from './property-B2TG3KEE.js';
3
3
  import { r } from './state-BCeDVCI9.js';
4
4
  import { t as toZonedWallClock, a as addDays, b as addMonths, f as formatDate } from './utils-D92ldd1V.js';
5
5
  import { C as CalendarEvent } from './calendar-event-_OYdAT3c.js';
6
- import { I as I18nController } from './i18n-controller-Co6pasNo.js';
6
+ import { I as I18nController } from './i18n-controller-DNAjVSIP.js';
7
7
  import { A as isoToDate, B as dateToIso, w as weekStart } from './date-vFrYT1S9.js';
8
8
  import './locale-DEsJZCQG.js';
9
- import './strings-DYwXSSu_.js';
9
+ import './strings-BpCoUL0V.js';
10
10
 
11
11
  var css_248z = i`* {
12
12
  box-sizing: border-box;
@@ -1,6 +1,6 @@
1
1
  import { _ as __decorate, a as i, A, b } from './IndividualComponent-BK7XZjE2.js';
2
2
  import { n } from './property-B2TG3KEE.js';
3
- import { I as I18nController } from './i18n-controller-Co6pasNo.js';
3
+ import { I as I18nController } from './i18n-controller-DNAjVSIP.js';
4
4
  import { b as boundsOf, i as inflateRect, a as rectsIntersect } from './geometry-INg82Lxq.js';
5
5
  import { D as DiagramListeners } from './host-CZK7xhzh.js';
6
6
 
@@ -785,4 +785,4 @@ __decorate([
785
785
  ], DiagramCanvasElement.prototype, "label", void 0);
786
786
 
787
787
  export { DiagramCanvasElement as D, animateOut as a, easeOutCubic as b, easeInOutCubic as e, prefersReducedMotion as p, tween as t };
788
- //# sourceMappingURL=canvas-base-CjxNdEsR.js.map
788
+ //# sourceMappingURL=canvas-base-Bfpv5_HJ.js.map