@quartzds/core 1.0.0-beta.90 → 1.0.0-beta.92

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 (187) hide show
  1. package/components/index.js +2 -2
  2. package/components/{p-2806fee1.js → p-50f85f75.js} +6 -30
  3. package/components/p-50f85f75.js.map +1 -0
  4. package/components/{p-fed0d11f.js → p-5570cc30.js} +2 -2
  5. package/components/{p-fed0d11f.js.map → p-5570cc30.js.map} +1 -1
  6. package/components/{p-c80f112a.js → p-70d12c72.js} +7 -24
  7. package/components/p-70d12c72.js.map +1 -0
  8. package/components/{p-ba880369.js → p-72c09714.js} +9 -3
  9. package/components/p-72c09714.js.map +1 -0
  10. package/components/{p-688c90f6.js → p-9ffb4b49.js} +17 -12
  11. package/components/p-9ffb4b49.js.map +1 -0
  12. package/components/{p-fac26e20.js → p-a529eb5c.js} +4 -4
  13. package/components/{p-fac26e20.js.map → p-a529eb5c.js.map} +1 -1
  14. package/components/{p-a020ece3.js → p-b5608061.js} +10 -7
  15. package/components/p-b5608061.js.map +1 -0
  16. package/components/{p-adefd438.js → p-b6c04008.js} +22 -14
  17. package/components/p-b6c04008.js.map +1 -0
  18. package/components/{p-a6310886.js → p-ba860c62.js} +10 -7
  19. package/components/p-ba860c62.js.map +1 -0
  20. package/components/{p-3c48ff53.js → p-e22dd76d.js} +2 -2
  21. package/components/{p-3c48ff53.js.map → p-e22dd76d.js.map} +1 -1
  22. package/components/{p-b4c302d4.js → p-e2a9e441.js} +3 -3
  23. package/components/{p-b4c302d4.js.map → p-e2a9e441.js.map} +1 -1
  24. package/components/qds-badge-counter.js +1 -1
  25. package/components/qds-badge-indicator.js +1 -1
  26. package/components/qds-breadcrumb-item.js +7 -4
  27. package/components/qds-breadcrumb-item.js.map +1 -1
  28. package/components/qds-button.js +1 -1
  29. package/components/qds-checkbox.js +1 -1
  30. package/components/qds-chip.js +12 -9
  31. package/components/qds-chip.js.map +1 -1
  32. package/components/qds-dialog.js +3 -3
  33. package/components/qds-dialog.js.map +1 -1
  34. package/components/qds-divider.js +1 -1
  35. package/components/qds-dropdown.js +3 -3
  36. package/components/qds-form-message.js +4 -4
  37. package/components/qds-icon.js +1 -1
  38. package/components/qds-inline-link.js +4 -4
  39. package/components/qds-input.js +43 -17
  40. package/components/qds-input.js.map +1 -1
  41. package/components/qds-label.js +1 -1
  42. package/components/qds-list-item.js +7 -7
  43. package/components/qds-list-item.js.map +1 -1
  44. package/components/qds-loader.js +3 -3
  45. package/components/qds-nav-list-item.js +6 -6
  46. package/components/qds-progress-bar.js +3 -3
  47. package/components/qds-radio.js +7 -7
  48. package/components/qds-radio.js.map +1 -1
  49. package/components/qds-select.js +3 -3
  50. package/components/qds-standalone-link.js +4 -4
  51. package/components/qds-switch.js +5 -5
  52. package/components/qds-switch.js.map +1 -1
  53. package/components/qds-tab.js +7 -7
  54. package/components/qds-tabbar.js +7 -7
  55. package/components/qds-table-body.js +2 -2
  56. package/components/qds-table-cell.js +2 -2
  57. package/components/qds-table-head-cell.js +1 -1
  58. package/components/qds-table-head.js +2 -2
  59. package/components/qds-table-row.js +2 -2
  60. package/components/qds-table.js +2 -2
  61. package/components/qds-tag.js +1 -1
  62. package/components/qds-textarea.js +1 -1
  63. package/components/qds-title.js +1 -1
  64. package/components/qds-tooltip.js +1 -1
  65. package/dist/cjs/{index-523dd2e0.js → index-dbcccf98.js} +6 -29
  66. package/dist/cjs/index-dbcccf98.js.map +1 -0
  67. package/dist/cjs/index.cjs.js +2 -2
  68. package/dist/cjs/{library-41b19b9e.js → library-23467d99.js} +8 -2
  69. package/dist/cjs/library-23467d99.js.map +1 -0
  70. package/dist/cjs/loader.cjs.js +2 -2
  71. package/dist/cjs/qds-badge-counter_2.cjs.entry.js +1 -1
  72. package/dist/cjs/qds-breadcrumb-item.cjs.entry.js +6 -3
  73. package/dist/cjs/qds-breadcrumb-item.cjs.entry.js.map +1 -1
  74. package/dist/cjs/qds-button.cjs.entry.js +17 -9
  75. package/dist/cjs/qds-button.cjs.entry.js.map +1 -1
  76. package/dist/cjs/qds-checkbox.cjs.entry.js +12 -8
  77. package/dist/cjs/qds-checkbox.cjs.entry.js.map +1 -1
  78. package/dist/cjs/qds-chip.cjs.entry.js +10 -7
  79. package/dist/cjs/qds-chip.cjs.entry.js.map +1 -1
  80. package/dist/cjs/qds-dialog.cjs.entry.js +3 -3
  81. package/dist/cjs/qds-dialog.cjs.entry.js.map +1 -1
  82. package/dist/cjs/qds-divider.cjs.entry.js +2 -2
  83. package/dist/cjs/qds-dropdown.cjs.entry.js +3 -3
  84. package/dist/cjs/qds-form-message.cjs.entry.js +3 -3
  85. package/dist/cjs/qds-icon.cjs.entry.js +3 -3
  86. package/dist/cjs/qds-inline-link.cjs.entry.js +3 -3
  87. package/dist/cjs/qds-input.cjs.entry.js +36 -11
  88. package/dist/cjs/qds-input.cjs.entry.js.map +1 -1
  89. package/dist/cjs/qds-label.cjs.entry.js +8 -5
  90. package/dist/cjs/qds-label.cjs.entry.js.map +1 -1
  91. package/dist/cjs/qds-list-item.cjs.entry.js +3 -3
  92. package/dist/cjs/qds-list-item.cjs.entry.js.map +1 -1
  93. package/dist/cjs/qds-loader.cjs.entry.js +2 -2
  94. package/dist/cjs/qds-nav-list-item.cjs.entry.js +4 -4
  95. package/dist/cjs/qds-progress-bar.cjs.entry.js +3 -3
  96. package/dist/cjs/qds-radio.cjs.entry.js +4 -4
  97. package/dist/cjs/qds-radio.cjs.entry.js.map +1 -1
  98. package/dist/cjs/qds-select.cjs.entry.js +2 -2
  99. package/dist/cjs/qds-standalone-link.cjs.entry.js +3 -3
  100. package/dist/cjs/qds-switch.cjs.entry.js +5 -5
  101. package/dist/cjs/qds-switch.cjs.entry.js.map +1 -1
  102. package/dist/cjs/qds-tab.cjs.entry.js +1 -1
  103. package/dist/cjs/qds-tabbar.cjs.entry.js +1 -1
  104. package/dist/cjs/qds-table-body.cjs.entry.js +2 -2
  105. package/dist/cjs/qds-table-cell.cjs.entry.js +2 -2
  106. package/dist/cjs/qds-table-head-cell.cjs.entry.js +1 -1
  107. package/dist/cjs/qds-table-head.cjs.entry.js +2 -2
  108. package/dist/cjs/qds-table-row.cjs.entry.js +2 -2
  109. package/dist/cjs/qds-table.cjs.entry.js +2 -2
  110. package/dist/cjs/qds-tag_2.cjs.entry.js +8 -5
  111. package/dist/cjs/qds-tag_2.cjs.entry.js.map +1 -1
  112. package/dist/cjs/qds-textarea.cjs.entry.js +1 -1
  113. package/dist/cjs/qds-tooltip.cjs.entry.js +6 -21
  114. package/dist/cjs/qds-tooltip.cjs.entry.js.map +1 -1
  115. package/dist/cjs/qds.cjs.js +2 -2
  116. package/dist/custom-elements.json +70 -22
  117. package/dist/docs.json +30 -9
  118. package/dist/esm/{index-b1d6acd2.js → index-bc9462c1.js} +6 -30
  119. package/dist/esm/index-bc9462c1.js.map +1 -0
  120. package/dist/esm/index.js +2 -2
  121. package/dist/esm/{library-2e5458af.js → library-52ae166a.js} +8 -2
  122. package/dist/esm/library-52ae166a.js.map +1 -0
  123. package/dist/esm/loader.js +3 -3
  124. package/dist/esm/qds-badge-counter_2.entry.js +1 -1
  125. package/dist/esm/qds-breadcrumb-item.entry.js +6 -3
  126. package/dist/esm/qds-breadcrumb-item.entry.js.map +1 -1
  127. package/dist/esm/qds-button.entry.js +17 -9
  128. package/dist/esm/qds-button.entry.js.map +1 -1
  129. package/dist/esm/qds-checkbox.entry.js +12 -8
  130. package/dist/esm/qds-checkbox.entry.js.map +1 -1
  131. package/dist/esm/qds-chip.entry.js +10 -7
  132. package/dist/esm/qds-chip.entry.js.map +1 -1
  133. package/dist/esm/qds-dialog.entry.js +3 -3
  134. package/dist/esm/qds-dialog.entry.js.map +1 -1
  135. package/dist/esm/qds-divider.entry.js +2 -2
  136. package/dist/esm/qds-dropdown.entry.js +3 -3
  137. package/dist/esm/qds-form-message.entry.js +3 -3
  138. package/dist/esm/qds-icon.entry.js +3 -3
  139. package/dist/esm/qds-inline-link.entry.js +3 -3
  140. package/dist/esm/qds-input.entry.js +36 -11
  141. package/dist/esm/qds-input.entry.js.map +1 -1
  142. package/dist/esm/qds-label.entry.js +8 -5
  143. package/dist/esm/qds-label.entry.js.map +1 -1
  144. package/dist/esm/qds-list-item.entry.js +3 -3
  145. package/dist/esm/qds-list-item.entry.js.map +1 -1
  146. package/dist/esm/qds-loader.entry.js +2 -2
  147. package/dist/esm/qds-nav-list-item.entry.js +4 -4
  148. package/dist/esm/qds-progress-bar.entry.js +3 -3
  149. package/dist/esm/qds-radio.entry.js +4 -4
  150. package/dist/esm/qds-radio.entry.js.map +1 -1
  151. package/dist/esm/qds-select.entry.js +2 -2
  152. package/dist/esm/qds-standalone-link.entry.js +3 -3
  153. package/dist/esm/qds-switch.entry.js +5 -5
  154. package/dist/esm/qds-switch.entry.js.map +1 -1
  155. package/dist/esm/qds-tab.entry.js +1 -1
  156. package/dist/esm/qds-tabbar.entry.js +1 -1
  157. package/dist/esm/qds-table-body.entry.js +2 -2
  158. package/dist/esm/qds-table-cell.entry.js +2 -2
  159. package/dist/esm/qds-table-head-cell.entry.js +1 -1
  160. package/dist/esm/qds-table-head.entry.js +2 -2
  161. package/dist/esm/qds-table-row.entry.js +2 -2
  162. package/dist/esm/qds-table.entry.js +2 -2
  163. package/dist/esm/qds-tag_2.entry.js +8 -5
  164. package/dist/esm/qds-tag_2.entry.js.map +1 -1
  165. package/dist/esm/qds-textarea.entry.js +1 -1
  166. package/dist/esm/qds-tooltip.entry.js +6 -21
  167. package/dist/esm/qds-tooltip.entry.js.map +1 -1
  168. package/dist/esm/qds.js +3 -3
  169. package/dist/types/components/checkbox/checkbox.d.ts +8 -1
  170. package/dist/types/components/input/input.d.ts +1 -0
  171. package/dist/types/components/tooltip/tooltip.d.ts +0 -2
  172. package/dist/types/components.d.ts +20 -4
  173. package/dist/vscode.html-custom-data.json +5 -1
  174. package/hydrate/index.js +149 -125
  175. package/hydrate/index.mjs +149 -125
  176. package/package.json +1 -1
  177. package/components/p-2806fee1.js.map +0 -1
  178. package/components/p-688c90f6.js.map +0 -1
  179. package/components/p-a020ece3.js.map +0 -1
  180. package/components/p-a6310886.js.map +0 -1
  181. package/components/p-adefd438.js.map +0 -1
  182. package/components/p-ba880369.js.map +0 -1
  183. package/components/p-c80f112a.js.map +0 -1
  184. package/dist/cjs/index-523dd2e0.js.map +0 -1
  185. package/dist/cjs/library-41b19b9e.js.map +0 -1
  186. package/dist/esm/index-b1d6acd2.js.map +0 -1
  187. package/dist/esm/library-2e5458af.js.map +0 -1
@@ -1 +0,0 @@
1
- {"file":"p-688c90f6.js","mappings":";;;;;;;;;;;;AAAA,MAAM,WAAW,GAAG,ypGAAypG,CAAC;AAC9qG,0BAAe,WAAW;;ACD1B;AACA;AACA;;;;;;;;;;;;;;;;;;MAmCa,QAAQ;IANrB;;;;;;;;;;;;;;;QAa0B,WAAM,GAAY,KAAK,CAAA;;;;QAKvB,SAAI,GAAU,UAAU,CAAA;;;;;;;;;;;;;;;;;;QAuCxB,SAAI,GAAsC,IAAI,CAAA;;;;;;;;QAwCtD,sBAAiB,GAA0C,EAAE,CAAA;;;;;;;;;QAUrD,aAAQ,GAAiC,WAAW,CAAA;;;;;;QAOpD,UAAK,GAAmB,IAAI,CAAA;;;;;;;;QAS5B,iBAAY,GAAqC,KAAK,CAAA;QA0B9E,wCAAmC,EAAE,EAAA;QAkK9B,kBAAa,GAAsC,MACxD,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAA;QAEzB,mBAAc,GAAuC,MAC1D,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAA;QAE1B,sBAAiB,GAA0C,CAAC,KAAK;YACtE,IAAI,KAAK;gBAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,kBAAkB,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;;gBACtE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,cAAc,CAAC,CAAA;SAChD,CAAA;QAEQ,2BAAU,CAAC,KAAiB;Y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AC;IAGC,QAAQ,IAAI,CAAC,IAAI;QACf,KAAK,UAAU,CAAC;QAChB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC,IAAI,CAAA;SACjB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;;IAIC,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAA;AAC1D,CAAC;IAGC,QACE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE,KAAK,IAAI,CAAC,QAAQ,KAAK,IAAI,EACxE;AACH,CAAC,2DA8Ia,CAAc,EAAE,GAAkB;IAC9C,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAA;AAChE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/checkbox/checkbox.css?tag=qds-checkbox&encapsulation=shadow","src/components/checkbox/checkbox.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n line-height: 0;\n}\n\n.qds-checkbox,\n.qds-box,\n.qds-icon {\n grid-area: checkbox;\n place-self: center;\n}\n\n.qds-icon,\n.qds-box {\n display: none;\n pointer-events: none;\n}\n\n.qds-box {\n border-radius: var(--qds-control-toggle-indicator-border-radius);\n}\n\n.qds-container {\n display: grid;\n align-self: flex-start;\n grid-template-areas: 'checkbox';\n}\n\n.qds-icon {\n color: var(--qds-theme-signature-color-contrast);\n}\n\n.qds-label {\n cursor: pointer;\n display: inline-flex;\n}\n\n.qds-checkbox {\n appearance: none;\n background-color: var(--qds-theme-control-input-background);\n border-radius: var(--qds-control-border-radius);\n border: var(--qds-control-border-width) solid var(--qds-theme-control-border);\n cursor: pointer;\n margin: 0;\n print-color-adjust: exact;\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n }\n\n &:hover ~ .qds-box,\n &:active ~ .qds-box {\n display: block;\n }\n\n &:hover ~ .qds-box {\n background-color: var(--qds-theme-signature-color-hover);\n }\n\n &:active ~ .qds-box {\n background-color: var(--qds-theme-signature-color-pressed);\n }\n\n &:checked ~ .qds-checked,\n &:indeterminate ~ .qds-indeterminate {\n display: block;\n }\n\n &:checked,\n &:indeterminate {\n background-color: var(--qds-theme-signature-color-default);\n border-color: transparent;\n\n &:hover {\n background-color: var(--qds-theme-signature-color-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-signature-color-pressed);\n }\n }\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-size='small'] {\n &.qds-checkbox {\n width: var(--qds-control-toggle-box-small-size);\n height: var(--qds-control-toggle-box-small-size);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-small-icon-size);\n }\n\n &.qds-box {\n width: var(--qds-control-toggle-indicator-small-size);\n height: var(--qds-control-toggle-indicator-small-size);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-small-padding-auto-height);\n }\n\n &.qds-label {\n gap: var(--qds-control-small-gap-siblings-related);\n }\n}\n\n[data-size='standard'] {\n &.qds-checkbox {\n width: var(--qds-control-toggle-box-standard-size);\n height: var(--qds-control-toggle-box-standard-size);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-standard-icon-size);\n }\n\n &.qds-box {\n width: var(--qds-control-toggle-indicator-standard-size);\n height: var(--qds-control-toggle-indicator-standard-size);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-standard-padding-auto-height);\n }\n\n &.qds-label {\n gap: var(--qds-control-standard-gap-siblings-related);\n }\n}\n\n[data-size='large'] {\n &.qds-checkbox {\n width: var(--qds-control-toggle-box-large-size);\n height: var(--qds-control-toggle-box-large-size);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-large-icon-size);\n }\n\n &.qds-box {\n width: var(--qds-control-toggle-indicator-large-size);\n height: var(--qds-control-toggle-indicator-large-size);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-large-padding-auto-height);\n }\n\n &.qds-label {\n gap: var(--qds-control-large-gap-siblings-related);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport { inheritAriaAttributes, pickFocusEventAttributes } from '../../helpers'\nimport { CUSTOM_ERROR_FLAGS, NO_ERROR_FLAGS, VALID_STATE } from '../controls'\nimport type { Size } from '../shared'\n\nexport type CheckboxValue = number | string | null\n\n/**\n * `<qds-checkbox>` elements are rendered as boxes that are checked (ticked)\n * when activated, like you might see in an official government paper form. A\n * checkbox allows you to select single values for submission in a form (or not).\n *\n * @see https://quartz.se.com/build/components/checkbox\n */\n@Component({\n tag: 'qds-checkbox',\n formAssociated: true,\n shadow: { delegatesFocus: true },\n styleUrl: 'checkbox.css',\n})\nexport class Checkbox implements ComponentInterface {\n /**\n * Adds vertical margin to the checkbox for alignment.\n *\n * This is useful when creating inline layouts so that the first lines have\n * the correct vertical centering.\n */\n @Prop() public readonly inline: boolean = false\n\n /**\n * The checkbox's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The checkbox's text.\n */\n @Prop() public readonly text?: string\n\n /**\n * Sets the checkbox's state.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public checked?: boolean\n\n /**\n * Prevents the checkbox from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop() public readonly disabled?: boolean\n\n /**\n * The [`<form>`][] element to associate the checkbox with (its form owner).\n *\n * The value of this attribute must be the id of a `<form>` in the same\n * document. If this attribute is not set, the `<qds-checkbox>` is associated\n * with its ancestor `<form>` element, if any.\n *\n * This attribute lets you associate `<qds-checkbox>` elements to `<form>`s\n * anywhere in the document, not just inside a `<form>`. It can also override\n * an ancestor `<form>` element.\n *\n * [`<form>`]: https://developer.mozilla.org/docs/Web/HTML/Element/form\n *\n * @readonly\n * @webnative\n */\n // eslint-disable-next-line unicorn/no-null\n @Prop() public readonly form: ElementInternals['form'] | string = null\n\n /**\n * Sets the checkbox to an indeterminate state. This is usually applied to\n * checkboxes that represent a \"select all/none\" behavior when associated\n * checkboxes have a mix of checked and unchecked states.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public indeterminate?: boolean\n\n /**\n * The name of the checkbox, which is submitted with the form data.\n *\n * @webnative\n */\n @Prop() public readonly name?: string\n\n /**\n * A value must be specified for the checkbox before the owning form can be\n * submitted.\n *\n * See\n * [Client-side validation](https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation)\n * and the\n * [HTML attribute: `required`](https://developer.mozilla.org/docs/Web/HTML/Attributes/required)\n * for more information.\n *\n * @webnative\n */\n @Prop() public readonly required?: boolean\n\n /**\n * The error message that would be shown to the user if the `<qds-checkbox>`\n * was to be checked for validity.\n *\n * @readonly\n * @webnative\n */\n @Prop()\n public readonly validationMessage: ElementInternals['validationMessage'] = ''\n\n /**\n * The [`ValidityState`][] object for this `<qds-checkbox>`.\n *\n * [`ValidityState`]: https://developer.mozilla.org/docs/Web/API/ValidityState\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly validity: ElementInternals['validity'] = VALID_STATE\n\n /**\n * The value of the checkbox, submitted as a name/value pair with form data.\n *\n * @webnative\n */\n @Prop() public readonly value?: CheckboxValue = 'on'\n\n /**\n * True if `<qds-checkbox>` will be validated when the form is submitted;\n * false otherwise.\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly willValidate: ElementInternals['willValidate'] = false\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n /**\n * Emitted when the checkbox loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when a change to the checkbox's state is committed by the user.\n */\n @Event({ eventName: 'qdsChange', cancelable: false })\n private readonly changeEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the checkbox gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly host!: HTMLElement\n\n @State() private tabIndex?: number\n\n #inheritedAttributes: Attributes = {}\n\n get #computedChecked(): boolean {\n return this.checked ?? false\n }\n\n get #computedDisabled(): boolean {\n return (\n (this.host.matches(':disabled') || (this.disabled ?? false)) &&\n this.host.getAttribute('disabled') !== 'false'\n )\n }\n\n get #computedIndeterminate(): boolean {\n return this.indeterminate ?? false\n }\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedValue(): string | null {\n // eslint-disable-next-line unicorn/no-null\n return this.value == null ? null : this.value.toString()\n }\n\n get #hasText(): boolean {\n return (\n (this.text !== undefined && this.text !== '') || this.required === true\n )\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n event.preventDefault()\n\n this.checked = this.#computedIndeterminate ? true : !this.#computedChecked\n this.changeEmitter.emit()\n this.indeterminate = false\n }\n\n @Watch('checked')\n protected checkedChanged(): void {\n this.internals.setFormValue(\n this.#computedChecked && !this.#computedDisabled\n ? this.#computedValue\n : // eslint-disable-next-line unicorn/no-null\n null,\n )\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n if (this.#computedChecked && !this.#computedDisabled)\n this.internals.setFormValue(this.#computedValue)\n // eslint-disable-next-line unicorn/no-null\n else this.internals.setFormValue(null)\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n this.tabIndex =\n parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue\n }\n\n @Watch('value')\n protected valueChanged(): void {\n if (this.#computedChecked && !this.#computedDisabled)\n this.internals.setFormValue(this.#computedValue)\n }\n\n public componentWillLoad(): void {\n this.valueChanged()\n\n this.#defineGetter('form', () => this.internals.form)\n this.#defineGetter('willValidate', () => this.internals.willValidate)\n this.#defineGetter('validity', () => this.internals.validity)\n this.#defineGetter(\n 'validationMessage',\n () => this.internals.validationMessage,\n )\n\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public render() {\n return (\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n <label\n aria-disabled={this.#computedDisabled ? 'true' : undefined}\n class={{\n 'qds-inline': this.inline,\n 'qds-label': true,\n }}\n data-size={this.#computedSize}\n >\n <div class=\"qds-container\">\n <input\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={this.host.autofocus}\n checked={this.#computedIndeterminate ? false : this.checked}\n class=\"qds-checkbox\"\n data-size={this.#computedSize}\n disabled={this.#computedDisabled}\n indeterminate={this.indeterminate}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n required={this.required}\n tabIndex={this.#computedDisabled ? undefined : this.tabIndex}\n type=\"checkbox\"\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n />\n <qds-icon\n aria-hidden=\"true\"\n class={{\n 'qds-icon': true,\n 'qds-checked': true,\n }}\n data-size={this.#computedSize}\n library=\"core\"\n name=\"checked\"\n />\n <div class=\"qds-box\" data-size={this.#computedSize} />\n <qds-icon\n aria-hidden=\"true\"\n class={{\n 'qds-icon': true,\n 'qds-indeterminate': true,\n }}\n data-size={this.#computedSize}\n library=\"core\"\n name=\"indeterminate\"\n />\n </div>\n {this.#hasText && (\n <qds-label\n required={this.required}\n size={this.size}\n text={this.text}\n />\n )}\n </label>\n )\n }\n\n public checkValidity: ElementInternals['checkValidity'] = () =>\n this.internals.checkValidity()\n\n public reportValidity: ElementInternals['reportValidity'] = () =>\n this.internals.reportValidity()\n\n public setCustomValidity: HTMLInputElement['setCustomValidity'] = (error) => {\n if (error) this.internals.setValidity(CUSTOM_ERROR_FLAGS, error, this.host)\n else this.internals.setValidity(NO_ERROR_FLAGS)\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n #defineGetter(p: PropertyKey, get: () => unknown): void {\n Object.defineProperty(this.host, p, { enumerable: true, get })\n }\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"p-a020ece3.js","mappings":";;;;;;;;;AAAA,MAAM,QAAQ,GAAG,u/BAAu/B,CAAC;AACzgC,uBAAe,QAAQ;;ACDvB;AACA;AACA;;;;;;;;;;;;;;;;;;MAkBa,KAAK;IALlB;;;;;;;;;;;QAY0B,WAAM,GAAY,KAAK,CAAA;;;;QAKvB,aAAQ,GAAY,KAAK,CAAA;;;;QAKzB,SAAI,GAAU,UAAU,CAAA;QAO/B,YAAO,GAAG,KAAK,CAAA;QAEhC,+BAAwB;QAExB,4BAAoB;QAEpB,8BAAuB;QA6Dd,0BAAY,CAAC,KAAuB;YAC3C,uBAAA,IAAI,gBAAU,KAAK,MAAA,CAAA;SACpB,EAAA;QAEQ,yBAAW,CAAC,IAAsB;YACzC,uBAAA,IAAI,eAAS,IAAI,MAAA,CAAA;SAClB,EAAA;QAEQ,4BAAc,CAAC,OAA+B;YACrD,IAAI,OAAO;;gBAET,OAAO,CAAC,MAAM,GAAG,uBAAA,IAAI,oBAAO,CAAA;SAC/B,EAAA;KACF;IA1DW,WAAW;QACnB,I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;QACb,KAAK,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC,IAAI,CAAA;SACjB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/label/label.css?tag=qds-label&encapsulation=shadow","src/components/label/label.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n.qds-label {\n box-sizing: border-box;\n color: var(--qds-theme-control-text-standard);\n display: inline-flex;\n gap: var(--qds-text-icon-gap);\n\n &:focus-visible {\n outline: var(--qds-focus-border-width) solid var(--qds-theme-focus-border);\n outline-offset: var(--qds-focus-border-offset);\n border-radius: var(--qds-focus-border-radius);\n }\n}\n\n.qds-text {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n}\n\n.qds-required {\n color: var(--qds-theme-feedback-field-required);\n user-select: none;\n}\n\n[data-size='small'] {\n font: var(--qds-control-small-text);\n\n &.qds-inline {\n margin-block: var(--qds-control-small-padding-auto-height);\n }\n}\n\n[data-size='standard'] {\n font: var(--qds-control-standard-text);\n\n &.qds-inline {\n margin-block: var(--qds-control-standard-padding-auto-height);\n }\n}\n\n[data-size='large'] {\n font: var(--qds-control-large-text);\n\n &.qds-inline {\n margin-block: var(--qds-control-large-padding-auto-height);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface } from '@stencil/core'\nimport { Component, h, Prop, State, Watch } from '@stencil/core'\n\nimport { isOverflowing } from '../../helpers'\nimport type { Size } from '../shared'\n\n/**\n * `<qds-label>` elements represent a caption for an item in a user interface.\n *\n * @see https://quartz.se.com/build/components/label\n */\n@Component({\n tag: 'qds-label',\n shadow: true,\n styleUrl: 'label.css',\n})\nexport class Label implements ComponentInterface {\n /**\n * Adds vertical margin to the label for alignment.\n *\n * This is useful when creating inline layouts so that the first lines have\n * the correct vertical centering.\n */\n @Prop() public readonly inline: boolean = false\n\n /**\n * Specify the labelled item as required by appending a red asterisk (*).\n */\n @Prop() public readonly required: boolean = false\n\n /**\n * The label's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The label's text.\n */\n @Prop() public readonly text?: string\n\n @State() private tooltip = false\n\n #label?: HTMLSpanElement\n\n #ro?: ResizeObserver\n\n #span?: HTMLSpanElement\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n @Watch('text')\n protected textChanged(): void {\n if (this.#ro) this.#ro.disconnect()\n\n if (!this.#span) return\n\n this.tooltip = isOverflowing(this.#span)\n this.#ro = new ResizeObserver(([spanEntry]) => {\n this.tooltip = isOverflowing(spanEntry.target)\n })\n this.#ro.observe(this.#span)\n }\n\n public componentDidLoad(): void {\n this.textChanged()\n }\n\n public disconnectedCallback(): void {\n if (this.#ro) this.#ro.disconnect()\n }\n\n public render() {\n return (\n <span\n class={{\n 'qds-inline': this.inline,\n 'qds-label': true,\n }}\n data-size={this.#computedSize}\n ref={this.#labelRef}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={this.tooltip ? 0 : undefined}\n >\n {this.required && <span class=\"qds-required\">*</span>}\n <span class=\"qds-text\" ref={this.#spanRef}>\n {this.text}\n </span>\n {this.tooltip && (\n <qds-tooltip aria-hidden=\"true\" ref={this.#tooltipRef}>\n {this.text}\n </qds-tooltip>\n )}\n </span>\n )\n }\n\n readonly #labelRef = (label?: HTMLSpanElement): void => {\n this.#label = label\n }\n\n readonly #spanRef = (span?: HTMLSpanElement): void => {\n this.#span = span\n }\n\n readonly #tooltipRef = (tooltip?: HTMLQdsTooltipElement): void => {\n if (tooltip)\n // eslint-disable-next-line no-param-reassign\n tooltip.target = this.#label\n }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AK,EAAC,UAAU,IAAE,IAAI,CAAC,IAAI,CAAQ,CACpC,EACR;KACF;;;;;;;;;;;;;;;IAnFC,QAAQ,IAAI,CAAC,UAAU;QACrB,KAAK,SAAS,CAAC;QACf,KAAK,YAAY,EAAE;YACjB,OAAO,IAAI,CAAC,UAAU,CAAA;SACvB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;IAGC,QAAQ,IAAI,CAAC,IAAI;QACf,KAAK,UAAU,CAAC;QAChB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC,IAAI,CAAA;SACjB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;IAGC,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,OAAO,CAAC;QACb,KAAK,MAAM,CAAC;QACZ,KAAK,SAAS,CAAC;QACf,KAAK,SAAS,EAAE;YACd,OAAO,IAAI,CAAC,MAAM,CAAA;SACnB;QACD,SAAS;YACP,OAAO,SAAS,CAAA;SACjB;KACF;AACH,CAAC;IAGC,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,IAAI,CAAC,UAAU,KAAK,YAAY,CAAA;AAClE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/tag/tag.css?tag=qds-tag&encapsulation=shadow","src/components/tag/tag.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n.qds-tag {\n align-items: center;\n border-radius: var(--qds-control-rounded-border-radius);\n box-sizing: border-box;\n display: inline-flex;\n justify-content: center;\n max-width: inherit;\n min-width: inherit;\n width: inherit;\n}\n\n.qds-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.qds-sr-only {\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n\n.qds-icon {\n flex-shrink: 0;\n}\n\n[data-status='error'] {\n color: var(--qds-theme-feedback-message-critical);\n}\n\n[data-status='success'] {\n color: var(--qds-theme-feedback-message-success);\n}\n\n[data-status='warning'] {\n color: var(--qds-theme-feedback-message-important);\n}\n\n[data-status='info'] {\n color: var(--qds-theme-feedback-message-informational);\n}\n\n[data-status='neutral'] {\n color: var(--qds-theme-feedback-message-neutral);\n}\n\n[data-importance='subdued'] .qds-text {\n color: var(--qds-theme-control-text-standard);\n}\n\n[data-importance='standard'] {\n &[data-status='error'] {\n background-color: var(--qds-theme-feedback-message-critical-dimmed);\n }\n\n &[data-status='success'] {\n background-color: var(--qds-theme-feedback-message-success-dimmed);\n }\n\n &[data-status='warning'] {\n background-color: var(--qds-theme-feedback-message-important-dimmed);\n }\n\n &[data-status='info'] {\n background-color: var(--qds-theme-feedback-message-informational-dimmed);\n }\n\n &[data-status='neutral'] {\n background-color: var(--qds-theme-feedback-message-neutral-dimmed);\n }\n}\n\n[data-importance='emphasized'] {\n &[data-status='error'] {\n background-color: var(--qds-theme-feedback-message-critical);\n color: var(--qds-theme-feedback-message-critical-contrast);\n }\n\n &[data-status='success'] {\n background-color: var(--qds-theme-feedback-message-success);\n color: var(--qds-theme-feedback-message-success-contrast);\n }\n\n &[data-status='warning'] {\n background-color: var(--qds-theme-feedback-message-important);\n color: var(--qds-theme-feedback-message-important-contrast);\n }\n\n &[data-status='info'] {\n background-color: var(--qds-theme-feedback-message-informational);\n color: var(--qds-theme-feedback-message-informational-contrast);\n }\n\n &[data-status='neutral'] {\n background-color: var(--qds-theme-feedback-message-neutral);\n color: var(--qds-theme-feedback-message-neutral-contrast);\n }\n}\n\n[data-size='small'] {\n &.qds-tag {\n font: var(--qds-control-small-text);\n gap: var(--qds-control-small-gap-internal);\n height: var(--qds-control-small-height);\n padding-inline: var(--qds-control-chip-small-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-control-small-icon-size);\n height: var(--qds-control-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n &.qds-tag {\n font: var(--qds-control-standard-text);\n gap: var(--qds-control-standard-gap-internal);\n height: var(--qds-control-standard-height);\n padding-inline: var(--qds-control-chip-standard-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-control-standard-icon-size);\n height: var(--qds-control-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n &.qds-tag {\n font: var(--qds-control-large-text);\n gap: var(--qds-control-large-gap-internal);\n height: var(--qds-control-large-height);\n padding-inline: var(--qds-control-chip-large-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-control-large-icon-size);\n height: var(--qds-control-large-icon-size);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface } from '@stencil/core'\nimport { Component, Element, Fragment, h, Prop } from '@stencil/core'\n\nimport type { Attributes } from '../../helpers'\nimport { inheritAriaAttributes } from '../../helpers'\nimport type { Importance, Size, Status } from '../shared'\n\nexport type TagStatus = Status | 'neutral'\n\n/**\n * The `<qds-tag>` element is a static descriptor used for items that need to\n * be labeled, categorized, or organized using keywords that describe them.\n *\n * @see https://quartz.se.com/build/components/tag\n */\n@Component({\n tag: 'qds-tag',\n shadow: true,\n styleUrl: 'tag.css',\n})\nexport class Tag implements ComponentInterface {\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The tag's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * The tag's status.\n */\n @Prop() public readonly status?: TagStatus = 'neutral'\n\n /**\n * The tag's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The tag's text.\n */\n @Prop() public readonly text?: string\n\n /**\n * Provides a text description of the icon for screen readers.\n */\n @Prop() public readonly iconDescription?: string\n\n /**\n * Displays an indicator if `true`.\n */\n @Prop() public readonly badge?: boolean = false\n\n /**\n * The indicator badge's accessible text that will be used by\n * screen readers.\n */\n @Prop() public readonly badgeDescription?: string\n\n @Element() private readonly host!: HTMLElement\n\n #inheritedAttributes: Attributes = {}\n\n get #computedImportance(): Importance {\n switch (this.importance) {\n case 'subdued':\n case 'emphasized': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedStatus(): TagStatus {\n switch (this.status) {\n case 'error':\n case 'info':\n case 'success':\n case 'warning': {\n return this.status\n }\n default: {\n return 'neutral'\n }\n }\n }\n\n get #hasBadge(): boolean {\n return (this.badge ?? false) && this.importance !== 'emphasized'\n }\n\n public componentWillLoad(): void {\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n }\n\n public render() {\n return (\n <span\n class=\"qds-tag\"\n data-importance={this.#computedImportance}\n data-size={this.#computedSize}\n data-status={this.#computedStatus}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n >\n {this.iconName !== undefined && this.iconName !== '' ? (\n <>\n {this.iconDescription !== undefined &&\n this.iconDescription !== '' && (\n <span class=\"qds-sr-only\">{this.iconDescription}</span>\n )}\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n data-size={this.#computedSize}\n library={this.iconLibrary}\n name={this.iconName}\n />\n </>\n ) : (\n this.#hasBadge && (\n <qds-badge-indicator\n status={this.#computedStatus}\n description={this.badgeDescription}\n size={this.#computedSize}\n strokeRing\n />\n )\n )}\n <span class=\"qds-text\">{this.text}</span>\n </span>\n )\n }\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"p-adefd438.js","mappings":";;;;;;;;;;;;;AAAA,MAAM,SAAS,GAAG,2iSAA2iS,CAAC;AAC9jS,w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,CAAC,CAAA;AAChE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/button/button.css?tag=qds-button&encapsulation=shadow","src/components/button/button.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n.qds-button:disabled,\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-overflow {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n &[data-size='hero'] {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n white-space: normal;\n }\n}\n\n.qds-action {\n transform: scaleX(var(--qds-direction-factor, 1));\n}\n\n.qds-container {\n display: grid;\n grid-template-areas: 'button';\n}\n\n.qds-focus-ring {\n border-radius: max(\n 1px,\n var(\n --qds-control-border-radius-top-left,\n var(--qds-control-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-top-right,\n var(--qds-control-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-bottom-right,\n var(--qds-control-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-bottom-left,\n var(--qds-control-border-radius)\n )\n );\n grid-area: button;\n isolation: isolate;\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n pointer-events: none;\n visibility: hidden;\n width: calc(\n 100% + var(--qds-control-border-width) -\n var(\n --qds-control-border-width-inline-end,\n var(--qds-control-border-width)\n )\n );\n height: calc(\n 100% + var(--qds-control-border-width) -\n var(--qds-control-border-width-block-end, var(--qds-control-border-width))\n );\n}\n\n.qds-button {\n position: relative;\n align-items: center;\n appearance: none;\n\n /* Avoid automatic minimum size on flex element: https://www.w3.org/TR/css-flexbox-1/#min-size-auto */\n min-width: 0;\n background-color: initial;\n border: none;\n border-radius: var(\n --qds-control-border-radius-top-left,\n var(--qds-control-border-radius)\n )\n var(--qds-control-border-radius-top-right, var(--qds-control-border-radius))\n var(\n --qds-control-border-radius-bottom-right,\n var(--qds-control-border-radius)\n )\n var(\n --qds-control-border-radius-bottom-left,\n var(--qds-control-border-radius)\n );\n box-sizing: border-box;\n cursor: pointer;\n display: inline-flex;\n grid-area: button;\n justify-content: center;\n outline: none;\n padding-block: 0;\n print-color-adjust: exact;\n text-align: center;\n user-select: none;\n\n &:any-link {\n text-decoration: none;\n }\n\n &:focus-visible ~ .qds-focus-ring {\n visibility: visible;\n }\n}\n\n.qds-icon {\n flex-shrink: 0;\n}\n\n.qds-indicator {\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n transform: translate(50%, -50%);\n}\n\n[data-size='small'] {\n font: var(--qds-control-small-text);\n\n &.qds-button {\n gap: var(--qds-control-small-gap-internal);\n height: var(--qds-control-small-height);\n padding-inline: var(--qds-control-button-small-padding-horizontal);\n\n &.qds-icon-only {\n width: var(--qds-control-small-height);\n }\n }\n\n &.qds-icon {\n font-size: var(--qds-control-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n font: var(--qds-control-standard-text);\n\n &.qds-button {\n gap: var(--qds-control-standard-gap-internal);\n height: var(--qds-control-standard-height);\n padding-inline: var(--qds-control-button-standard-padding-horizontal);\n\n &.qds-icon-only {\n width: var(--qds-control-standard-height);\n }\n }\n\n &.qds-icon {\n font-size: var(--qds-control-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n font: var(--qds-control-large-text);\n\n &.qds-button {\n gap: var(--qds-control-large-gap-internal);\n height: var(--qds-control-large-height);\n padding-inline: var(--qds-control-button-large-padding-horizontal);\n\n &.qds-icon-only {\n width: var(--qds-control-large-height);\n }\n }\n\n &.qds-icon {\n font-size: var(--qds-control-large-icon-size);\n }\n}\n\n[data-size='small'],\n[data-size='standard'],\n[data-size='large'] {\n line-height: normal;\n\n &.qds-button.qds-icon-only {\n padding-inline: 0;\n }\n}\n\n[data-size='hero'] {\n font: var(--qds-control-hero-text);\n\n &.qds-button {\n border-radius: var(\n --qds-control-border-radius-top-left,\n var(--qds-control-hero-border-radius)\n )\n var(\n --qds-control-border-radius-top-right,\n var(--qds-control-hero-border-radius)\n )\n var(\n --qds-control-border-radius-bottom-right,\n var(--qds-control-hero-border-radius)\n )\n var(\n --qds-control-border-radius-bottom-left,\n var(--qds-control-hero-border-radius)\n );\n gap: var(--qds-control-hero-gap-internal);\n padding-block: var(--qds-control-hero-padding-auto-height);\n padding-inline: var(--qds-control-button-hero-padding-horizontal);\n\n &.qds-icon-only {\n height: var(--qds-control-hero-height);\n padding-inline: 0;\n width: var(--qds-control-hero-height);\n }\n }\n\n &.qds-focus-ring {\n border-radius: max(\n 1px,\n var(\n --qds-control-border-radius-top-left,\n var(--qds-control-hero-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-top-right,\n var(--qds-control-hero-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-bottom-right,\n var(--qds-control-hero-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-bottom-left,\n var(--qds-control-hero-border-radius)\n )\n );\n }\n\n &.qds-icon {\n font-size: var(--qds-control-hero-icon-size);\n }\n}\n\n[data-importance='subdued'] {\n color: var(--qds-theme-link-standard-default);\n\n &.qds-button {\n border-block-end: var(--qds-control-border-width) solid transparent;\n padding-inline: 0;\n\n &:hover {\n border-block-end: var(--qds-control-border-width) solid\n var(--qds-theme-link-standard-hover);\n color: var(--qds-theme-link-standard-hover);\n }\n\n &:active {\n border-block-end: var(--qds-control-border-width) solid\n var(--qds-theme-link-standard-pressed);\n color: var(--qds-theme-link-standard-pressed);\n }\n\n &:not(.qds-icon-only) {\n border-radius: 0;\n }\n\n &.qds-icon-only {\n border: none;\n color: var(--qds-theme-control-text-standard);\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n }\n }\n }\n}\n\n[data-importance='standard'] {\n color: var(--qds-theme-control-text-standard);\n\n &.qds-button {\n border-color: var(--qds-theme-control-border);\n border-style: solid;\n border-width: var(--qds-control-border-width)\n var(\n --qds-control-border-width-inline-end,\n var(--qds-control-border-width)\n )\n var(--qds-control-border-width-block-end, var(--qds-control-border-width))\n var(--qds-control-border-width);\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n }\n }\n}\n\n[data-importance='emphasized'] {\n &.qds-button {\n background-color: var(--qds-theme-signature-color-default);\n color: var(--qds-theme-signature-color-contrast);\n\n &:hover {\n background-color: var(--qds-theme-signature-color-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-signature-color-pressed);\n }\n }\n}\n\n[data-importance='destructive'] {\n &.qds-button {\n background-color: var(--qds-theme-feedback-action-destructive-default);\n color: var(--qds-theme-feedback-action-destructive-contrast);\n\n &:hover {\n background-color: var(--qds-theme-feedback-action-destructive-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-feedback-action-destructive-pressed);\n }\n }\n}\n\n[data-importance='subdued-destructive'] {\n color: var(--qds-theme-feedback-action-destructive-default);\n\n &.qds-button {\n border-block-end: var(--qds-control-border-width) solid transparent;\n padding-inline: 0;\n\n &:hover {\n border-block-end: var(--qds-control-border-width) solid\n var(--qds-theme-feedback-action-destructive-hover);\n color: var(--qds-theme-feedback-action-destructive-hover);\n }\n\n &:active {\n border-block-end: var(--qds-control-border-width) solid\n var(--qds-theme-feedback-action-destructive-pressed);\n color: var(--qds-theme-feedback-action-destructive-pressed);\n }\n\n &:not(.qds-icon-only) {\n border-radius: 0;\n }\n\n &.qds-icon-only {\n border: none;\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n color: var(--qds-theme-feedback-action-destructive-default);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n color: var(--qds-theme-feedback-action-destructive-default);\n }\n }\n }\n}\n\n:is([data-action='dropdown'], [data-action='dropdown-close']) {\n .qds-action {\n margin-inline-start: auto;\n transition-duration: 0.3s;\n transition-property: transform;\n }\n\n &[data-importance='standard'] {\n background-color: var(--qds-theme-control-input-background);\n }\n\n &:not([data-importance='subdued'], [data-importance='subdued-destructive']) {\n padding-inline: var(--qds-control-input-padding-horizontal);\n }\n}\n\n[data-action='dropdown-close'] .qds-action {\n transform: rotate(-180deg);\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport { isOverflowing, pickFocusEventAttributes } from '../../helpers'\nimport { CUSTOM_ERROR_FLAGS, NO_ERROR_FLAGS, VALID_STATE } from '../controls'\nimport type { Importance, Size } from '../shared'\n\nexport type Action = 'dropdown-close' | 'dropdown' | 'next'\nexport type ButtonImportance =\n | Importance\n | 'destructive'\n | 'subdued-destructive'\nexport type ButtonSize = Size | 'hero'\nexport type ButtonTarget = '_blank' | '_parent' | '_self' | '_top'\nexport type ButtonType = 'button' | 'reset' | 'submit'\nexport type FormMethod = 'dialog' | 'get' | 'post'\n\nconst isCounter = (value: unknown): value is number =>\n typeof value === 'string'\n ? !Number.isNaN(Number.parseFloat(value))\n : typeof value === 'number'\n\nconst isIndicator = (value: unknown): value is '' | true =>\n value === '' || value === true\n\n/**\n * The `<qds-button>` element is an interactive element activated by a user\n * with a mouse, keyboard, finger, voice command, or other assistive technology.\n * Once activated, it then performs a programmable action, such as submitting a\n * [form](https://developer.mozilla.org/docs/Learn/Forms)\n * or opening a dialog.\n *\n * @see https://quartz.se.com/build/components/button\n */\n@Component({\n tag: 'qds-button',\n formAssociated: true,\n shadow: { delegatesFocus: true },\n styleUrl: 'button.css',\n})\nexport class Button implements ComponentInterface {\n /**\n * The name of the action icon to render.\n */\n @Prop() public readonly action?: Action\n\n /**\n * Displays an indicator if `true` or the empty string. Otherwise, displays a\n * counter badge if a number or string representing a number is used.\n *\n * @webnative\n */\n @Prop() public readonly badge?: number | string | true\n\n /**\n * The indicator or counter badge's accessible text that will be used by\n * screen readers.\n */\n @Prop() public readonly badgeDescription?: string\n\n /**\n * The indicator's status.\n */\n @Prop()\n public readonly badgeIndicatorStatus?: HTMLQdsBadgeIndicatorElement['status'] =\n 'neutral'\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The button's importance.\n */\n @Prop() public readonly importance?: ButtonImportance = 'standard'\n\n /**\n * The button's size.\n */\n @Prop() public readonly size?: Size | 'hero' = 'standard'\n\n /**\n * The button's text.\n */\n @Prop() public readonly text!: string\n\n /**\n * Sets if button is icon only.\n */\n @Prop() public readonly iconOnly: boolean = false\n\n /**\n * Prevents the button from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop()\n public readonly disabled?: boolean\n\n /**\n * Tells the browser to download the linked file as this filename. Only used\n * when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly download?: string\n\n /**\n * The [`<form>`][] element to associate the button with (its form owner).\n *\n * The value of this attribute must be the id of a `<form>` in the same\n * document. If this attribute is not set, the `<qds-button>` is associated\n * with its ancestor `<form>` element, if any.\n *\n * This attribute lets you associate `<qds-button>` elements to `<form>`s\n * anywhere in the document, not just inside a `<form>`. It can also override\n * an ancestor `<form>` element.\n *\n * [`<form>`]: https://developer.mozilla.org/docs/Web/HTML/Element/form\n *\n * @readonly\n * @webnative\n */\n // eslint-disable-next-line unicorn/no-null\n @Prop() public readonly form: ElementInternals['form'] | string = null\n\n /**\n * The URL that processes the information submitted by the button. Overrides\n * the [`action`](https://developer.mozilla.org/docs/Web/HTML/Element/button#attr-formaction)\n * attribute of the button's form owner. Does nothing if there is no form owner.\n *\n * @webnative\n */\n @Prop({ attribute: 'formaction' }) public readonly formAction?: string\n\n /**\n * If the button is a submit button (it's inside/associated with a `<form>`\n * and doesn't have `type=\"button\"`), this attribute specifies the\n * [HTTP method][] used to submit the form, or `dialog` which won't submit\n * the form. Possible values:\n *\n * - `get`: The form data are appended to the form's action URL, with a ? as\n * a separator, and the resulting URL is sent to the server. Use this method\n * when the form has no side effects, like search forms.\n * - `post`: The data from the form are included in the body of the HTTP\n * request when sent to the server. Use when the form contains information\n * that shouldn't be public, like login credentials.\n * - `dialog`: Close the dialog box in which the button finds itself, if any,\n * and do not submit the button's form owner.\n *\n * If specified, this attribute overrides the `method` attribute of the\n * button's form owner.\n *\n * [HTTP method]: https://developer.mozilla.org/docs/Web/HTTP/Methods\n *\n * @webnative\n */\n @Prop({ attribute: 'formmethod' }) public readonly formMethod?: FormMethod\n\n /**\n * If the button is a submit button, this attribute specifies that the form\n * is not to be\n * [validated](https://developer.mozilla.org/docs/Learn/Forms/Form_validation)\n * when it is submitted. If this attribute is specified, it overrides the\n * [`novalidate`](https://developer.mozilla.org/docs/Web/HTML/Element/form#attr-novalidate)\n * attribute of the button's form owner.\n *\n * @webnative\n */\n @Prop({ attribute: 'formnovalidate' })\n public readonly formNoValidate: boolean = false\n\n /**\n * If the button is a submit button, this attribute is an author-defined name\n * or standardized, underscore-prefixed keyword indicating where to display\n * the response from submitting the form. This is the `name` of, or keyword\n * for, a browsing context (a tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe)).\n * If this attribute is specified, it overrides the\n * [`target`](https://developer.mozilla.org/docs/Web/HTML/Element/form#attr-target)\n * attribute of the button's form owner. The following keywords have special\n * meanings:\n *\n * - `_blank`: Load the response into a new unnamed browsing context — usually\n * a new tab or window, depending on the user's browser settings.\n * - `_parent`: Load the response into the parent browsing context of the\n * current one. If there is no parent, this option behaves the same way as\n * `_self`.\n * - `_self`: Load the response into the same browsing context as the current\n * one.\n * - `_top`: Load the response into the top-level browsing context (that is,\n * the browsing context that is an ancestor of the current one, and has no\n * parent). If there is no parent, this option behaves the same way as\n * `_self`.\n *\n * @webnative\n */\n @Prop({ attribute: 'formtarget' })\n public readonly formTarget: LiteralUnion<ButtonTarget, string> = '_self'\n\n /**\n * When set, the underlying button will be rendered as an `<a>` with this\n * `href` instead of a `<button>`.\n *\n * @webnative\n */\n @Prop() public readonly href?: string\n\n /**\n * Returns a list of the [`<label>`][] elements associated with the\n * `qds-button` element.\n *\n * [`<label>`]: https://developer.mozilla.org/docs/Web/HTML/Element/label\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly labels: ElementInternals['labels'] =\n {} as ElementInternals['labels']\n\n /**\n * When href is define and the button act as a link (`<a>`), the `rel` will be added to the element.\n *\n * @webnative\n */\n @Prop() public readonly rel?: string = 'noopener'\n\n /**\n * The name of the button, submitted as a pair with the button's `value` as\n * part of the form data, when that button is used to submit the form.\n * Ignored when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly name?: string\n\n /**\n * Where to display the linked URL, as the name for a browsing context (a\n * tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe).\n * The following keywords have special meanings for where to load the URL:\n *\n * - `_blank`: usually a new tab, but users can configure browsers to open a new\n * window instead.\n * - `_parent`: the parent browsing context of the current one. If no parent,\n * behaves as `_self`.\n * - `_self`: the current browsing context.\n * - `_top`: the topmost browsing context (the \"highest\" context that's an\n * ancestor of the current one). If no ancestors, behaves as `_self`.\n *\n * @webnative\n */\n @Prop() public readonly target?: LiteralUnion<ButtonTarget, string>\n\n /**\n * The type of button.\n *\n * `button`: The button has no default behavior, and does nothing when\n * pressed by default. It can have client-side scripts listen to the\n * element's events, which are triggered when the events occur.\n *\n * `submit`: The button submits the form data to the server. This is the\n * default if the attribute is not specified for buttons associated with a\n * `<form>`, or if the attribute is an empty or invalid value.\n *\n * `reset`: The button resets all the controls to their initial values.\n *\n * @webnative\n */\n @Prop() public readonly type?: ButtonType\n\n /**\n * The error message that would be shown to the user if the `<qds-button>`\n * was to be checked for validity.\n *\n * @readonly\n * @webnative\n */\n @Prop()\n public readonly validationMessage: ElementInternals['validationMessage'] = ''\n\n /**\n * The [`ValidityState`][] object for this `<qds-button>`.\n *\n * [`ValidityState`]: https://developer.mozilla.org/docs/Web/API/ValidityState\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly validity: ElementInternals['validity'] = VALID_STATE\n\n /**\n * Defines the value associated with the button's `name` when it's submitted\n * with the form data. This value is passed to the server in params when the\n * form is submitted using this button. Ignored when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly value?: string\n\n /**\n * True if `<qds-button>` will be validated when the form is submitted; false\n * otherwise.\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly willValidate: ElementInternals['willValidate'] = false\n\n /**\n * Emitted when the button loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the button gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly host!: HTMLQdsButtonElement\n\n @State() private tabIndex?: number\n\n @State() private tooltip = false\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #button?: HTMLAnchorElement | HTMLButtonElement\n\n #span?: HTMLSpanElement\n\n #ro?: ResizeObserver\n\n get #buttonType(): ButtonType {\n if (this.type === undefined)\n return this.internals.form ? 'submit' : 'button'\n return this.type\n }\n\n get #iconOnly(): boolean {\n const hasIcon = this.iconName !== undefined && this.iconName !== ''\n\n return hasIcon && this.iconOnly\n }\n\n get #computedAction(): Action | undefined {\n switch (this.action) {\n case 'dropdown':\n case 'dropdown-close':\n case 'next': {\n return this.action\n }\n default: {\n return undefined\n }\n }\n }\n\n get #computedActionIcon(): Exclude<Action, 'dropdown-close'> | undefined {\n switch (this.action) {\n case 'dropdown':\n case 'next': {\n return this.action\n }\n case 'dropdown-close': {\n return 'dropdown'\n }\n default: {\n return undefined\n }\n }\n }\n\n get #computedDisabled(): boolean {\n return this.disabled ?? false\n }\n\n get #computedImportance(): ButtonImportance {\n switch (this.importance) {\n case 'emphasized':\n case 'subdued':\n case 'destructive':\n case 'subdued-destructive': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedSize(): ButtonSize {\n switch (this.size) {\n case 'small':\n case 'large':\n case 'hero': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n if (this.#buttonType === 'button' || !this.internals.form) return\n if (this.#buttonType === 'reset') {\n this.internals.form.reset()\n } else {\n this.internals.form.requestSubmit()\n }\n event.preventDefault()\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.internals.ariaDisabled = this.#computedDisabled.toString()\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n this.tabIndex =\n parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue\n }\n\n @Watch('text')\n protected textChanged(): void {\n this.internals.ariaLabel = this.text\n\n if (this.#ro) this.#ro.disconnect()\n if (!this.#span) return\n\n this.tooltip = isOverflowing(this.#span)\n this.#ro = new ResizeObserver(([spanEntry]) => {\n this.tooltip = isOverflowing(spanEntry.target)\n })\n this.#ro.observe(this.#span)\n }\n\n public componentWillLoad(): void {\n this.internals.role = 'button'\n this.#defineGetter('form', () => this.internals.form)\n this.#defineGetter('willValidate', () => this.internals.willValidate)\n this.#defineGetter('validity', () => this.internals.validity)\n this.#defineGetter(\n 'validationMessage',\n () => this.internals.validationMessage,\n )\n this.#defineGetter('labels', () => this.internals.labels)\n\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public componentDidLoad(): void {\n this.textChanged()\n }\n\n public disconnectedCallback(): void {\n if (this.#ro) this.#ro.disconnect()\n }\n\n public render() {\n const Tag = this.href === undefined ? 'button' : 'a'\n const disabledTabIndex = Tag === 'a' ? -1 : undefined\n const hasBadgeProperties =\n this.badgeDescription !== undefined && this.badge !== undefined\n const ariaLabel = hasBadgeProperties\n ? `${this.text} ${this.badge} ${this.badgeDescription}`\n : this.text\n\n return (\n <div class=\"qds-container\">\n <Tag\n aria-hidden=\"true\"\n class={{\n 'qds-button': true,\n 'qds-disabled': Tag === 'a' ? this.#computedDisabled : false,\n 'qds-icon-only': this.#iconOnly,\n }}\n data-importance={this.#computedImportance}\n data-size={this.#computedSize}\n data-action={this.#computedAction}\n disabled={Tag === 'a' ? undefined : this.disabled}\n download={Tag === 'a' ? this.download : undefined}\n formAction={this.formAction}\n formMethod={this.formMethod}\n formNoValidate={this.formNoValidate}\n formTarget={this.formTarget}\n href={Tag === 'a' ? this.href : undefined}\n name={Tag === 'a' ? undefined : this.name}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n ref={this.#buttonRef}\n rel={Tag === 'a' ? this.rel : undefined}\n tabIndex={this.#computedDisabled ? disabledTabIndex : this.tabIndex}\n target={Tag === 'a' ? this.target : undefined}\n type={Tag === 'a' ? undefined : this.#buttonType}\n value={Tag === 'a' ? undefined : this.value}\n aria-label={this.#iconOnly ? ariaLabel : undefined}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n data-size={this.#computedSize}\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n {!this.#iconOnly && (\n <span\n class=\"qds-overflow\"\n data-size={this.#computedSize}\n ref={this.#spanRef}\n >\n {this.text}\n </span>\n )}\n {isIndicator(this.badge) && (\n <qds-badge-indicator\n class=\"qds-indicator\"\n status={this.badgeIndicatorStatus}\n description={this.badgeDescription}\n size={this.#computedSize}\n strokeRing\n />\n )}\n {isCounter(this.badge) && (\n <qds-badge-counter\n class={{\n 'qds-indicator': this.#iconOnly,\n }}\n description={this.badgeDescription}\n importance={this.#computedImportance}\n size={this.#computedSize}\n strokeRing\n value={this.badge}\n />\n )}\n {this.#computedActionIcon !== undefined && (\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon qds-action\"\n data-size={this.#computedSize}\n library=\"core\"\n name={this.#computedActionIcon}\n />\n )}\n </Tag>\n <div\n class={{\n 'qds-focus-ring': true,\n 'qds-icon-only': this.#iconOnly,\n }}\n data-importance={this.#computedImportance}\n data-size={this.#computedSize}\n />\n {this.tooltip && (\n <qds-tooltip aria-hidden=\"true\" ref={this.#tooltipRef}>\n {this.text}\n </qds-tooltip>\n )}\n </div>\n )\n }\n\n public checkValidity: ElementInternals['checkValidity'] = () =>\n this.internals.checkValidity()\n\n public reportValidity: ElementInternals['reportValidity'] = () =>\n this.internals.reportValidity()\n\n public setCustomValidity: HTMLButtonElement['setCustomValidity'] = (\n error,\n ) => {\n if (error)\n this.internals.setValidity(CUSTOM_ERROR_FLAGS, error, this.#button)\n else this.internals.setValidity(NO_ERROR_FLAGS)\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #buttonRef = (\n button?: HTMLAnchorElement | HTMLButtonElement,\n ): void => {\n this.#button = button\n }\n\n readonly #spanRef = (span?: HTMLSpanElement): void => {\n this.#span = span\n }\n\n readonly #tooltipRef = (tooltip?: HTMLQdsTooltipElement): void => {\n if (tooltip)\n // eslint-disable-next-line no-param-reassign\n tooltip.target = this.#button\n }\n\n #defineGetter(p: PropertyKey, get: () => unknown): void {\n Object.defineProperty(this.host, p, { enumerable: true, get })\n }\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"p-ba880369.js","mappings":";;;;;;;;AAAA,MAAM,UAAU,GAAG,4UAA4U;;ACA/V,MAAM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M,KAAK,EAAC,kBAAkB,EAAC,SAAS,EAAE,IAAI,CAAC,GAAG,GAAI,EACtD,4DAAK,KAAK,EAAC,kBAAkB,GAAG,CAC5B,EACP;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["clear","checked","draggable","dropdown","externalLink","indeterminate","inputMonth","inputTel","inputWeek","inputUrl","inputTime","inputDate","inputDatetimeLocal","inputEmail","inputSearch","navigation","next","statusError","statusInfo","statusWarning","defaultLibrary"],"sources":["../../node_modules/@quartzds/generic-icons-core/dist/checked.svg","../../node_modules/@quartzds/generic-icons-core/dist/clear.svg","../../node_modules/@quartzds/generic-icons-core/dist/draggable.svg","../../node_modules/@quartzds/generic-icons-core/dist/dropdown.svg","../../node_modules/@quartzds/generic-icons-core/dist/external-link.svg","../../node_modules/@quartzds/generic-icons-core/dist/indeterminate.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-date.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-datetime-local.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-email.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-month.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-search.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-tel.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-time.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-url.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-week.svg","../../node_modules/@quartzds/generic-icons-core/dist/navigation.svg","../../node_modules/@quartzds/generic-icons-core/dist/next.svg","../../node_modules/@quartzds/generic-icons-core/dist/status-error.svg","../../node_modules/@quartzds/generic-icons-core/dist/status-info.svg","../../node_modules/@quartzds/generic-icons-core/dist/status-warning.svg","src/components/icon/core-library.ts","src/components/icon/default-library.ts","src/components/icon/library.ts","src/components/icon/request.ts","src/components/icon/icon.css?tag=qds-icon&encapsulation=shadow","src/components/icon/icon.tsx"],"sourcesContent":["<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M6.31 11.86 3.08 8.63l.71-.71 2.52 2.52 5.9-5.94.71.7z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 16 16\"><path fill=\"currentColor\" d=\"m11.43 5.26-.71-.7-2.74 2.76-2.73-2.76-.71.7 2.74 2.77-2.74 2.77.71.71 2.73-2.77 2.74 2.77.71-.71-2.74-2.77z\"/><circle cx=\"8\" cy=\"8\" r=\"7.5\" stroke=\"currentColor\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M4.96 0a2.148 2.148 0 1 1 0 4.297A2.148 2.148 0 0 1 4.96 0zM2.812 17.852a2.148 2.148 0 1 0 4.297 0 2.148 2.148 0 0 0-4.297 0zm0-7.852a2.148 2.148 0 1 0 4.297 0 2.148 2.148 0 0 0-4.297 0zm10.079-7.852a2.148 2.148 0 1 0 4.297 0 2.148 2.148 0 0 0-4.297 0zm0 15.704a2.148 2.148 0 1 0 4.297 0 2.148 2.148 0 0 0-4.297 0zm0-7.852a2.148 2.148 0 1 0 4.297 0 2.148 2.148 0 0 0-4.297 0z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M7.95 12.39 2.06 4.76l.79-.61 5.11 6.62 5.23-6.63.78.62z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M13.16 0H20v6.72h-1.03V1.76l-6.46 6.46-.73-.73 6.46-6.46h-5.08zM0 3h11.05v1.02H1.03v14.95h15V8.53h1.02V20H0z\" clip-rule=\"evenodd\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"none\" stroke=\"currentColor\" d=\"M.5 10h19\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"M1.5 8.5h17m-12 0v9m7-9v9m-12-6h17m-17 3h17m-17-10h17v13h-17zm6-1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 2 0Zm7 0v2a1 1 0 1 1-2 0v-2a1 1 0 1 1 2 0Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"M1.5 8.5h17m-12 0v9m7-9v9m-12-6h17m-17 3h17m-17-10h17v13h-17zm6-1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 2 0Zm7 0v2a1 1 0 1 1-2 0v-2a1 1 0 1 1 2 0Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"M.5 2.5h19m-19 0v15h19v-15m-19 0 9.5 8 9.5-8\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"M1.5 8.5h17m-12 0v9m7-9v9m-12-6h17m-17 3h17m-17-10h17v13h-17zm6-1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 2 0Zm7 0v2a1 1 0 1 1-2 0v-2a1 1 0 1 1 2 0Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M3.95 6.96h1c0-1.12.91-2.02 2.02-2.02v-1c-1.67 0-3.02 1.36-3.02 3.02Zm10.08 6.36L9.99 9.28c.63-.79 1.03-1.78 1.03-2.86a4.6 4.6 0 0 0-4.6-4.6c-2.54 0-4.6 2.07-4.6 4.6s2.06 4.6 4.6 4.6c1.09 0 2.08-.4 2.86-1.03l4.04 4.04zm-7.61-3.3c-1.99 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" stroke-linejoin=\"round\" stroke-miterlimit=\"3.864\" d=\"m1 15.502 2.472 2.272c.66-.017 1.468-1.254 2.528-2.272 2.086-2.002 2.376-2.075 2.176-2.235.161.2-2.006-1.481-2.006-1.481s1.492-1.673 3.368-3.036a117 117 0 0 1 3.442-2.403l.994 2.403s.933-.536 2.688-2.058C18.227 5.337 19.5 4.554 19.5 4.554l-2-2.552S12.82 1.79 6.933 6.228C2.574 9.513 1 15.502 1 15.502Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"m13.31 5 .71-.71-2.32-2.32-.71.71.8.8-.64.64c-.86-.71-1.95-1.16-3.16-1.16S5.7 3.4 4.84 4.11l-.63-.63.8-.8-.71-.71-2.32 2.32.71.71.8-.8.63.63a4.97 4.97 0 0 0-1.14 3.14c0 1.68.84 3.16 2.12 4.07l-1.25 1.25.71.71 1.45-1.45c.61.26 1.28.41 1.98.41s1.31-.14 1.89-.38l1.36 1.36.71-.71-1.15-1.15c1.32-.9 2.19-2.41 2.19-4.13 0-1.19-.44-2.27-1.14-3.13l.64-.64zM8 11.97c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4Zm.49-6.59h-1v2.79l2.16 2.16.71-.71-1.87-1.87z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" stroke-linejoin=\"round\" d=\"M10.01.5v19m0-19a9.5 9.5 0 0 1 9.5 9.5M10.01.5C5.387.5.5 4.5.5 10.5m9.51-10s-5.537 3-5.537 10.716c0 5.284 5.537 8.284 5.537 8.284m0-19s5.426 3 5.426 10.716c0 5.284-5.426 8.284-5.426 8.284m0 0c-5.079 0-9.227-3.986-9.487-9.001M10.01 19.5a9.5 9.5 0 0 0 9.5-9.5m0 0c-.795.277-9.01 3.603-19.018.38\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"M1.5 8.5h17m-12 0v9m7-9v9m-12-6h17m-17 3h17m-17-10h17v13h-17zm6-1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 2 0Zm7 0v2a1 1 0 1 1-2 0v-2a1 1 0 1 1 2 0Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"m4.77 13.97-.62-.78 6.62-5.23-6.62-5.11.61-.79 7.63 5.89z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"m5.495.5 8.664 8.664c.462.462.462 1.21 0 1.672L5.495 19.5\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"m11.43 5.26-.71-.7-2.74 2.76-2.73-2.76-.71.7 2.74 2.77-2.74 2.77.71.71 2.73-2.77 2.74 2.77.71-.71-2.74-2.77z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" d=\"M9 4h2.41v2.15H9zm.13 12.51V7.97h2.18v8.54z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" d=\"M9.57 12.48c-.13-.12-.2-.29-.23-.52l-.67-7-.02-.18c0-.37.13-.67.39-.89s.58-.33.98-.33.72.11.98.33.39.52.39.89l-.02.2-.67 6.98c-.02.23-.1.4-.23.52a.65.65 0 0 1-.46.18.65.65 0 0 1-.46-.18zm-.5 3.57a1.34 1.34 0 0 1-.38-.96 1.32 1.32 0 0 1 1.33-1.35c.38 0 .7.13.95.39s.38.58.38.96a1.32 1.32 0 0 1-1.33 1.35c-.38 0-.7-.13-.95-.39Z\"/></svg>","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\n// FIXME: TypeScript and Webpack can resolve exports from the package.json\n// `exports` field but Rollup can't. `@quartzds/generic-icons-core/*.svg`\n// _should_ work but it doesn't.\n/* eslint-disable import/no-unresolved */\nimport checked from '@quartzds/generic-icons-core/dist/checked.svg'\nimport clear from '@quartzds/generic-icons-core/dist/clear.svg'\nimport draggable from '@quartzds/generic-icons-core/dist/draggable.svg'\nimport dropdown from '@quartzds/generic-icons-core/dist/dropdown.svg'\nimport externalLink from '@quartzds/generic-icons-core/dist/external-link.svg'\nimport indeterminate from '@quartzds/generic-icons-core/dist/indeterminate.svg'\nimport inputDate from '@quartzds/generic-icons-core/dist/input-date.svg'\nimport inputDatetimeLocal from '@quartzds/generic-icons-core/dist/input-datetime-local.svg'\nimport inputEmail from '@quartzds/generic-icons-core/dist/input-email.svg'\nimport inputMonth from '@quartzds/generic-icons-core/dist/input-month.svg'\nimport inputSearch from '@quartzds/generic-icons-core/dist/input-search.svg'\nimport inputTel from '@quartzds/generic-icons-core/dist/input-tel.svg'\nimport inputTime from '@quartzds/generic-icons-core/dist/input-time.svg'\nimport inputUrl from '@quartzds/generic-icons-core/dist/input-url.svg'\nimport inputWeek from '@quartzds/generic-icons-core/dist/input-week.svg'\nimport navigation from '@quartzds/generic-icons-core/dist/navigation.svg'\nimport next from '@quartzds/generic-icons-core/dist/next.svg'\nimport statusError from '@quartzds/generic-icons-core/dist/status-error.svg'\nimport statusInfo from '@quartzds/generic-icons-core/dist/status-info.svg'\nimport statusWarning from '@quartzds/generic-icons-core/dist/status-warning.svg'\n\n/* eslint-enable import/no-unresolved */\nimport type { IconLibrary } from './library'\n\nconst icons: Record<string, string | undefined> = {\n /* eslint-disable @typescript-eslint/naming-convention */\n clear,\n checked,\n draggable,\n dropdown,\n 'external-link': externalLink,\n 'external-new-tab-link': externalLink,\n indeterminate,\n 'input-month': inputMonth,\n 'input-tel': inputTel,\n 'input-week': inputWeek,\n 'input-url': inputUrl,\n 'input-time': inputTime,\n 'input-date': inputDate,\n 'input-datetime-local': inputDatetimeLocal,\n 'input-email': inputEmail,\n 'input-search': inputSearch,\n navigation,\n next,\n 'new-tab-link': externalLink,\n close: statusError,\n 'status-error': statusError,\n 'status-info': statusInfo,\n 'status-success': checked,\n 'status-warning': statusWarning,\n /* eslint-enable @typescript-eslint/naming-convention */\n}\n\nconst coreLibrary: IconLibrary = {\n name: 'core',\n resolver: (name) => icons[name] ?? '',\n}\n\nexport default coreLibrary\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getAssetPath } from '@stencil/core'\n\nimport type { IconLibrary } from './library'\n\nconst library: IconLibrary = {\n name: 'default',\n resolver: (name) => getAssetPath(`/icons/${name}.svg`),\n}\n\nexport default library\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Except } from 'type-fest'\n\nimport coreLibrary from './core-library'\nimport defaultLibrary from './default-library'\n\nexport type IconLibraryResolver = (name: string) => string\nexport interface IconLibrary {\n name: string\n resolver: IconLibraryResolver\n}\n\nlet registry: IconLibrary[] = [defaultLibrary, coreLibrary]\n\n/**\n * Returns a library from the registry.\n */\nexport const getIconLibrary = (name: string): IconLibrary | undefined =>\n registry.find((library) => library.name === name)\n\n/**\n * Removes an icon library from the registry.\n */\nexport const unregisterIconLibrary = (name: string): void => {\n registry = registry.filter((library) => library.name !== name)\n}\n\n/**\n * Adds an icon library to the registry or overrides an existing one.\n */\nexport const registerIconLibrary = (\n name: string,\n options: Except<IconLibrary, 'name'>,\n): void => {\n unregisterIconLibrary(name)\n registry.push({\n name,\n ...options,\n })\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\ninterface IconResponse {\n ok: boolean\n status: number\n data: string\n}\n\nconst cachedIconRequests = new Map<\n string,\n IconResponse | Promise<IconResponse>\n>()\n\nconst requestIcon = (url: string): Promise<IconResponse> => {\n const cachedIconRequest = cachedIconRequests.get(url)\n if (cachedIconRequest) return Promise.resolve(cachedIconRequest)\n\n const iconPromise = fetch(url, { mode: 'cors' }).then(async (response) => {\n const iconResponse: IconResponse = {\n ok: response.ok,\n status: response.status,\n data: await response.text(),\n }\n if (response.ok) {\n const div = document.createElement('div')\n div.innerHTML = iconResponse.data\n const child = div.firstElementChild\n iconResponse.data =\n child?.tagName.toLowerCase() === 'svg' ? child.outerHTML : ''\n }\n\n cachedIconRequests.set(url, iconResponse)\n return iconResponse\n })\n cachedIconRequests.set(url, iconPromise)\n return iconPromise\n}\n\nexport default requestIcon\n","/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n height: 1em;\n width: 1em;\n}\n\n.qds-container {\n position: relative;\n}\n\n.qds-icon-wrapper {\n display: contents;\n}\n\nsvg {\n display: block;\n fill: currentcolor;\n height: 100%;\n width: 100%;\n}\n\n.qds-click-target {\n height: var(--qds-experimental-icon-click-target-size);\n left: calc(-1 * (var(--qds-experimental-icon-click-target-size) - 100%) / 2);\n position: absolute;\n top: calc(-1 * (var(--qds-experimental-icon-click-target-size) - 100%) / 2);\n width: var(--qds-experimental-icon-click-target-size);\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport { Component, Element, Event, h, Prop, State, Watch } from '@stencil/core'\n\nimport type { Attributes } from '../../helpers'\nimport { inheritAriaAttributes } from '../../helpers'\nimport { getIconLibrary } from './library'\nimport requestIcon from './request'\n\nlet parser: DOMParser | undefined\n\n/**\n * @experimental\n */\n@Component({\n tag: 'qds-icon',\n shadow: true,\n styleUrl: 'icon.css',\n})\nexport class Icon implements ComponentInterface {\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly name!: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly library: string = 'default'\n\n /**\n * Emitted when the icon has loaded.\n */\n @Event({ eventName: 'qdsLoad', cancelable: false })\n private readonly loadEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the icon fails to load due to an error.\n */\n @Event({ eventName: 'qdsError', cancelable: false })\n private readonly errorEmitter!: EventEmitter<void>\n\n @Element() private readonly host!: HTMLElement\n\n @State() private svg = ''\n\n #inheritedAttributes: Attributes = {}\n\n @Watch('name')\n @Watch('library')\n private async setIcon(): Promise<void> {\n if (!this.name) return\n\n const library = getIconLibrary(this.library)\n if (!library) return\n\n const url = library.resolver(this.name)\n if (!url) {\n this.svg = ''\n return\n }\n\n try {\n const request = await requestIcon(url)\n if (!request.ok) {\n this.svg = ''\n this.errorEmitter.emit()\n return\n }\n\n // Create an instance of the DOM parser. We do it here instead of at the\n // top-level to support SSR while maintaining a single parser instance\n // for optimal performance.\n parser ||= new DOMParser()\n const document = parser.parseFromString(request.data, 'text/html')\n const svgElement = document.body.querySelector('svg')\n if (svgElement === null) {\n this.svg = ''\n this.errorEmitter.emit()\n } else {\n for (const [key, value] of Object.entries(this.#inheritedAttributes))\n if (value !== undefined) svgElement.setAttribute(key, value)\n this.svg = svgElement.outerHTML\n this.loadEmitter.emit()\n }\n } catch {\n this.errorEmitter.emit()\n }\n }\n\n public async componentWillLoad(): Promise<void> {\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n await this.setIcon()\n }\n\n public render() {\n return (\n <div class=\"qds-container\">\n <span class=\"qds-icon-wrapper\" innerHTML={this.svg} />\n <div class=\"qds-click-target\" />\n </div>\n )\n }\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"p-c80f112a.js","mappings":";;;;;;;;;AAAA,MAAM,UAAU,GAAG,k6DAAk6D,CAAC;AACt7D,yBAAe,UAAU;;ACDzB;AACA;AACA;;;;;;;;;;;;;;;;;;AA8CA,I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AAA,IAAI,0BAAW;QACxD,OAAO,CAAC,mBAAmB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAC9C,uBAAA,IAAI,sBAAc,EAAE,MAAA,CAAA;AACtB,CAAC;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/tooltip/tooltip.css?tag=qds-tooltip&encapsulation=shadow","src/components/tooltip/tooltip.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n align-items: flex-start;\n background-color: var(--qds-theme-accessory-background);\n border-radius: var(--qds-accessory-border-radius);\n box-shadow: var(--qds-theme-accessory-elevation);\n box-sizing: border-box;\n color: var(--qds-theme-text-standard);\n display: flex;\n flex-direction: column;\n gap: var(--qds-accessory-gap-children-unrelated);\n left: 0;\n padding: var(--qds-accessory-padding);\n top: 0;\n}\n\n:host::before {\n content: '';\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n}\n\n::slotted(blockquote),\n::slotted(button),\n::slotted(dd),\n::slotted(dl),\n::slotted(fieldset),\n::slotted(figure),\n::slotted(h1),\n::slotted(h2),\n::slotted(h3),\n::slotted(h4),\n::slotted(h5),\n::slotted(h6),\n::slotted(hr),\n::slotted(input),\n::slotted(menu),\n::slotted(ol),\n::slotted(p),\n::slotted(pre),\n::slotted(select),\n::slotted(textarea),\n::slotted(ul) {\n margin: 0;\n}\n\n:host([data-side='top'])::before,\n:host([data-side='bottom'])::before {\n height: calc(\n var(--qds-accessory-gap-floating, 0px) +\n var(--qds-signature-triangle-pointer-size-height, 0px)\n );\n top: 100%;\n}\n\n:host([data-side='bottom'])::before {\n top: calc(\n -1 * (var(--qds-accessory-gap-floating, 0px) +\n var(--qds-signature-triangle-pointer-size-height, 0px))\n );\n}\n\n:host([data-side='left'])::before,\n:host([data-side='right'])::before {\n width: calc(\n var(--qds-accessory-gap-floating, 0px) +\n var(--qds-signature-triangle-pointer-size-height, 0px)\n );\n left: 100%;\n}\n\n:host([data-side='right'])::before {\n left: calc(\n -1 * (var(--qds-accessory-gap-floating, 0px) +\n var(--qds-signature-triangle-pointer-size-height, 0px))\n );\n}\n\n.qds-arrow-container {\n height: var(--qds-signature-triangle-pointer-size-width);\n position: absolute;\n width: var(--qds-signature-triangle-pointer-size-width);\n\n &[data-side='bottom'] {\n bottom: 100%;\n transform: rotate(180deg);\n }\n\n &[data-side='left'] {\n left: 100%;\n transform: rotate(-90deg);\n }\n\n &[data-side='right'] {\n right: 100%;\n transform: rotate(90deg);\n }\n\n &[data-side='top'] {\n top: 100%;\n }\n}\n\n.qds-arrow {\n fill: var(--qds-theme-accessory-background);\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type {\n AutoUpdateOptions,\n DetectOverflowOptions,\n FlipOptions,\n Middleware,\n Placement,\n ReferenceElement,\n ShiftOptions,\n Side,\n Strategy,\n} from '@floating-ui/dom'\nimport {\n arrow,\n autoUpdate,\n computePosition,\n flip,\n limitShift,\n offset,\n shift,\n} from '@floating-ui/dom'\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n Component,\n Element,\n Event,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\nimport type { Split } from 'type-fest'\n\nimport type { OffsetOptions } from '../../helpers'\nimport {\n ignorePromise,\n invariant,\n isTouchDevice,\n propertyToPx,\n resolveTarget,\n roundByDPR,\n} from '../../helpers'\n\nlet autoIncrementingId = 1\n\nexport type TriggerEvent = Extract<\n keyof GlobalEventHandlersEventMap,\n 'click' | 'focus' | 'focusin' | 'pointerenter'\n>\n\n/**\n * @slot Content to display in the dropdown.\n * @see https://quartz.se.com/build/components/tooltip\n */\n@Component({\n tag: 'qds-tooltip',\n shadow: true,\n styleUrl: 'tooltip.css',\n})\nexport class Tooltip implements ComponentInterface {\n /**\n * Options to pass to Floating UI's\n * [`autoUpdate()` function](https://floating-ui.com/docs/autoUpdate).\n *\n * @see https://floating-ui.com/docs/autoupdate#options\n */\n @Prop() public readonly autoUpdateOptions?: AutoUpdateOptions\n\n /**\n * Prevents the tooltip from being shown by user interaction. The tooltip can\n * still be displayed by calling the `show()` method.\n */\n @Prop() public readonly disabled: boolean = false\n\n /**\n * Options to pass to Floating UI's\n * [`flip` middleware](https://floating-ui.com/docs/flip).\n *\n * The [`crossAxis` option](https://floating-ui.com/docs/flip#crossaxis) is\n * set to the value of the `noShift` property by default for interoperability\n * with the [`shift` middleware](https://floating-ui.com/docs/shift).\n *\n * @see https://floating-ui.com/docs/flip#options\n */\n @Prop() public readonly flipOptions?: Partial<\n DetectOverflowOptions & FlipOptions\n >\n\n /**\n * Disable Floating UI's\n * [`flip` middleware](https://floating-ui.com/docs/flip).\n */\n @Prop() public readonly noFlip: boolean = false\n\n /**\n * Disable Floating UI's\n * [`shift` middleware](https://floating-ui.com/docs/shift).\n */\n @Prop() public readonly noShift: boolean = false\n\n /**\n * Options to pass to Floating UI's\n * [`offset` middleware](https://floating-ui.com/docs/offset).\n *\n * The [`mainAxis` option](https://floating-ui.com/docs/offset#mainaxis) is\n * not supported.\n *\n * @see https://floating-ui.com/docs/offset#options\n */\n @Prop() public readonly offsetOptions?: OffsetOptions\n\n /**\n * Where to place the tooltip relative to the `target`.\n *\n * @see https://floating-ui.com/docs/tutorial#placements\n */\n @Prop() public readonly placement: Placement = 'top'\n\n /**\n * Options to pass to Floating UI's\n * [`shift` middleware](https://floating-ui.com/docs/shift).\n *\n * @see https://floating-ui.com/docs/shift#options\n */\n @Prop() public readonly shiftOptions?: Partial<\n DetectOverflowOptions & ShiftOptions\n >\n\n /**\n * The CSS position strategy to use.\n *\n * @see https://floating-ui.com/docs/computeposition#strategy\n */\n @Prop() public readonly strategy?: Strategy\n\n /**\n * The trigger element that will trigger the tooltip. The target specified\n * can be any of the following:\n *\n * - A CSS selector string\n * - A reference to an [`Element`][] or [Virtual Element][]\n * - A function returning a reference to an [`Element`][],\n * [Virtual Element][], or a CSS selector string\n *\n * [`Element`]: https://developer.mozilla.org/docs/Web/API/Element\n * [Virtual Element]: https://floating-ui.com/docs/virtual-elements\n */\n @Prop() public readonly target?:\n | ReferenceElement\n | string\n | (() => ReferenceElement | string)\n\n /**\n * Determines the events that cause the tooltip to show. Multiple event names\n * are separated by spaces.\n */\n @Prop() public readonly trigger?: TriggerEvent[] | string =\n 'pointerenter focus'\n\n /**\n * Emitted when the tooltip is closed.\n */\n @Event({ eventName: 'qdsClose', bubbles: false, cancelable: false })\n private readonly closeEmitter!: EventEmitter<void>\n\n @Element() private readonly host!: HTMLElement\n\n @State() private hostPosition?: string\n\n @State() private hostTransform?: string\n\n @State() private open = false\n\n @State() private middleware?: Middleware[]\n\n @State() private side: Side = 'top'\n\n @State() private aStyles?: Record<string, string | undefined>\n\n @State() private aShape = ''\n\n @State() private aViewbox = '0 0 0 0'\n\n @State() private aHeight = 0\n\n @State() private aGap = 0\n\n #arrowContainerElement?: SVGElement\n\n #cleanup?: () => void\n\n #clickedTooltip = false\n\n #isTouchDevice = false\n\n #listeners: {\n element: Element\n event: keyof GlobalEventHandlersEventMap\n listener: EventListenerOrEventListenerObject\n }[] = []\n\n #referenceElement?: ReferenceElement\n\n /**\n * Show the tooltip.\n */\n @Method()\n public async show(): Promise<void> {\n if (this.open) return\n\n this.open = true\n this.startAutoUpdate()\n }\n\n /**\n * Close the tooltip.\n */\n @Method()\n public async close(): Promise<void> {\n if (!this.open) return\n\n this.closeEmitter.emit()\n\n this.open = false\n this.#clickedTooltip = false\n if (this.#cleanup) this.#cleanup()\n }\n\n /**\n * Update the tooltip's arrow.\n *\n * This method should typically be called when the Quartz platform was\n * changed.\n */\n @Method()\n public async updateArrow(): Promise<void> {\n const aWidth =\n propertyToPx(this.host, `--qds-signature-triangle-pointer-size-width`) ??\n 0\n const aTipRadius =\n propertyToPx(this.host, `--qds-signature-triangle-pointer-tip-radius`) ??\n 0\n const svgX = (aWidth / 2) * (aTipRadius / -8 + 1)\n const svgY = ((this.aHeight / 2) * aTipRadius) / 4\n\n this.aHeight =\n propertyToPx(this.host, `--qds-signature-triangle-pointer-size-height`) ??\n 0\n this.aViewbox = `0 0 ${aWidth} ${Math.max(this.aHeight, aWidth)}`\n this.aGap = propertyToPx(this.host, '--qds-accessory-gap-floating') ?? 0\n this.aShape =\n 'M0,0' +\n ` H${aWidth}` +\n ` L${aWidth - svgX},${this.aHeight - svgY}` +\n ` Q${aWidth / 2},${this.aHeight} ${svgX},${this.aHeight - svgY}` +\n ' Z'\n }\n\n @Watch('aGap')\n @Watch('aHeight')\n @Watch('flipOptions')\n @Watch('noFlip')\n @Watch('noShift')\n @Watch('offsetOptions')\n @Watch('shiftOptions')\n protected async updateMiddleware(): Promise<void> {\n invariant(this.#arrowContainerElement)\n\n this.middleware = [\n offset({\n ...this.offsetOptions,\n mainAxis: this.aGap + this.aHeight,\n }),\n !this.noFlip &&\n flip({\n crossAxis: this.noShift,\n ...this.flipOptions,\n }),\n !this.noShift &&\n shift({\n limiter: limitShift(),\n ...this.shiftOptions,\n }),\n arrow({\n element: this.#arrowContainerElement,\n }),\n ].filter((middleware): middleware is Middleware => middleware !== false)\n }\n\n @Watch('role')\n protected updateAriaHasPopup(): void {\n this.#referenceElement = resolveTarget(this.target)\n\n if (\n this.#referenceElement instanceof globalThis.Element &&\n this.host.role === 'dialog'\n ) {\n this.#referenceElement.ariaHasPopup = 'dialog'\n }\n }\n\n @Watch('open')\n protected setAriaExpanded(): void {\n this.host.hidden = !this.open\n if (\n this.#referenceElement instanceof globalThis.Element &&\n this.host.role === 'dialog'\n ) {\n this.#referenceElement.ariaExpanded = String(this.open)\n }\n }\n\n @Watch('target')\n private async updateReferenceElement(): Promise<void> {\n this.disconnectedCallback()\n\n this.#referenceElement = resolveTarget(this.target)\n\n if (!(this.#referenceElement instanceof globalThis.Element)) return\n\n this.updateEventListeners()\n this.host.id ||= `qds-tooltip-${autoIncrementingId}`\n this.#referenceElement.setAttribute('aria-describedby', this.host.id)\n\n if (this.host.role === 'dialog') {\n this.#referenceElement.ariaHasPopup = 'dialog'\n }\n }\n\n @Watch('trigger')\n private updateEventListeners(): void {\n if (!(this.#referenceElement instanceof globalThis.Element)) return\n\n const triggers = Array.isArray(this.trigger)\n ? this.trigger\n : ((this.trigger?.split(' ') as Split<TriggerEvent, ' '> | undefined) ??\n [])\n\n this.#removeEventListeners()\n\n if (this.#isTouchDevice)\n this.#on(this.#referenceElement, 'click', this.#boundReferenceClick)\n this.#on(document.documentElement, 'pointerdown', this.#boundPointerdown)\n this.#on(this.#referenceElement, 'keydown', this.#boundKeyDown)\n\n for (const trigger of triggers) {\n switch (trigger) {\n case 'click': {\n this.#on(this.#referenceElement, 'click', this.#boundReferenceClick)\n break\n }\n case 'focus':\n case 'focusin': {\n this.#on(this.#referenceElement, trigger, this.#boundFocus)\n this.#on(this.#referenceElement, 'focusout', this.#boundFocusout)\n this.#on(this.host, 'focusout', this.#boundFocusout)\n break\n }\n case 'pointerenter': {\n this.#on(\n this.#referenceElement,\n 'pointerenter',\n this.#boundPointerenter,\n )\n this.#on(\n this.#referenceElement,\n 'pointerleave',\n this.#boundPointerleave,\n )\n this.#on(this.host, 'pointerleave', this.#boundPointerleave)\n break\n }\n default:\n }\n }\n }\n\n @Watch('middleware')\n @Watch('placement')\n @Watch('strategy')\n private async updatePosition(): Promise<void> {\n invariant(this.#referenceElement)\n\n const { x, y, middlewareData, placement, strategy } = await computePosition(\n this.#referenceElement,\n this.host,\n {\n middleware: this.middleware,\n placement: this.placement,\n strategy: this.strategy,\n },\n )\n const [side] = placement.split('-') as Split<Placement, '-'>\n\n this.hostPosition = strategy\n this.hostTransform = `translate(${roundByDPR(x)}px,${roundByDPR(y)}px)`\n this.side = side\n\n if (middlewareData.arrow === undefined) return\n const { x: aX, y: aY, centerOffset } = middlewareData.arrow\n this.aStyles = {\n display: centerOffset === 0 ? undefined : 'none',\n left: aX === undefined ? '' : `${aX}px`,\n top: aY === undefined ? '' : `${aY}px`,\n }\n }\n\n @Watch('autoUpdateOptions')\n private startAutoUpdate(): void {\n invariant(this.#referenceElement)\n\n if (this.#cleanup) this.#cleanup()\n this.#cleanup = autoUpdate(\n this.#referenceElement,\n this.host,\n () => {\n ignorePromise(this.updatePosition())\n },\n this.autoUpdateOptions,\n )\n }\n\n public async componentWillLoad(): Promise<void> {\n this.#isTouchDevice = isTouchDevice()\n this.host.hidden = true\n await this.updateReferenceElement()\n autoIncrementingId += 1\n }\n\n public async componentDidLoad(): Promise<void> {\n await this.updateArrow()\n }\n\n public disconnectedCallback(): void {\n if (!(this.#referenceElement instanceof globalThis.Element)) return\n\n this.#removeEventListeners()\n this.#referenceElement.removeAttribute('aria-describedby')\n }\n\n public render() {\n return (\n <Host\n data-side={this.side}\n role={this.host.role ?? 'tooltip'}\n onKeyDown={this.#boundKeyDown}\n onPointerDown={this.#boundTooltipPointerDown}\n style={{\n position: this.hostPosition,\n transform: this.hostTransform,\n }}\n >\n <slot />\n <svg\n aria-hidden=\"true\"\n data-side={this.side}\n class=\"qds-arrow-container\"\n ref={this.#arrowContainerRef}\n viewBox={this.aViewbox}\n style={this.aStyles}\n >\n <path class=\"qds-arrow\" d={this.aShape} />\n </svg>\n </Host>\n )\n }\n\n readonly #arrowContainerRef = (svg?: SVGElement): void => {\n this.#arrowContainerElement = svg\n }\n\n readonly #boundTooltipPointerDown = (): void => {\n this.#clickedTooltip = true\n }\n\n async #handleFocus(): Promise<void> {\n if (!this.disabled) await this.show()\n }\n\n readonly #boundFocus = (): void => {\n ignorePromise(this.#handleFocus())\n }\n\n async #handleKeyDown(event: Event): Promise<void> {\n if (event instanceof KeyboardEvent && event.key === 'Escape')\n await this.close()\n }\n\n readonly #boundKeyDown = (event: Event): void => {\n ignorePromise(this.#handleKeyDown(event))\n }\n\n async #handlePointerenter(): Promise<void> {\n if (!this.disabled) await this.show()\n }\n\n readonly #boundPointerenter = (): void => {\n ignorePromise(this.#handlePointerenter())\n }\n\n async #handlePointerleave(event: Event): Promise<void> {\n if (\n !this.#clickedTooltip &&\n document.activeElement !== this.#referenceElement &&\n document.activeElement?.closest('qds-tooltip') !== this.host &&\n event instanceof PointerEvent &&\n event.relatedTarget !== this.#referenceElement &&\n event.relatedTarget !== this.host\n )\n await this.close()\n }\n\n readonly #boundPointerleave = (event: Event): void => {\n ignorePromise(this.#handlePointerleave(event))\n }\n\n async #handleFocusOut(event: Event): Promise<void> {\n if (!(event instanceof FocusEvent)) return\n const { relatedTarget } = event\n\n if (\n relatedTarget instanceof globalThis.Element &&\n !this.host.contains(relatedTarget) &&\n this.#referenceElement !== relatedTarget\n )\n await this.close()\n }\n\n readonly #boundFocusout = (event: Event): void => {\n ignorePromise(this.#handleFocusOut(event))\n }\n\n async #handlePointerdown(event: Event): Promise<void> {\n const composedPath = event.composedPath()\n const withinBounds =\n composedPath.includes(this.host) ||\n (this.#referenceElement instanceof globalThis.Element &&\n composedPath.includes(this.#referenceElement))\n if (!withinBounds) await this.close()\n }\n\n readonly #boundPointerdown = (event: Event): void => {\n ignorePromise(this.#handlePointerdown(event))\n }\n\n async #handleReferenceClick(): Promise<void> {\n if (!this.disabled) await (this.open ? this.close() : this.show())\n }\n\n readonly #boundReferenceClick = (): void => {\n ignorePromise(this.#handleReferenceClick())\n }\n\n #on(\n element: Element,\n event: keyof GlobalEventHandlersEventMap,\n listener: EventListenerOrEventListenerObject,\n ): void {\n const hasListener = this.#listeners.some(\n (value) => value.element === element && value.event === event,\n )\n if (hasListener) return\n\n element.addEventListener(event, listener)\n this.#listeners.push({ element, event, listener })\n }\n\n #removeEventListeners(): void {\n for (const { element, event, listener } of this.#listeners)\n element.removeEventListener(event, listener)\n this.#listeners = []\n }\n}\n"],"version":3}