@quartzds/core 1.0.0-beta.105 → 1.0.0-beta.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/components/index.js +1 -1
- package/components/{p-tSnbFa3i.js → p-BLasS6lS.js} +6 -6
- package/components/{p-tSnbFa3i.js.map → p-BLasS6lS.js.map} +1 -1
- package/components/{p-DKlaRUVi.js → p-BcKIeevq.js} +30 -15
- package/components/p-BcKIeevq.js.map +1 -0
- package/components/{p-DwifNmZO.js → p-BymjThOJ.js} +16 -15
- package/components/p-BymjThOJ.js.map +1 -0
- package/components/{p-Bwq_sxXt.js → p-CLO9W_LH.js} +7 -17
- package/components/p-CLO9W_LH.js.map +1 -0
- package/components/{p-BGc-gR4A.js → p-D85ZJwsC.js} +6 -6
- package/components/{p-BGc-gR4A.js.map → p-D85ZJwsC.js.map} +1 -1
- package/components/{p-D2SSRGaJ.js → p-DF7MqUXJ.js} +3 -3
- package/components/{p-D2SSRGaJ.js.map → p-DF7MqUXJ.js.map} +1 -1
- package/{dist/esm/qds-radio.entry.js → components/p-DY4dB1OA.js} +59 -14
- package/components/p-DY4dB1OA.js.map +1 -0
- package/components/{p-DrDLb3-d.js → p-DcmmW8Nm.js} +4 -4
- package/components/{p-DrDLb3-d.js.map → p-DcmmW8Nm.js.map} +1 -1
- package/components/{p-CeaOQ6Iu.js → p-DneNTUyc.js} +6 -6
- package/components/{p-CeaOQ6Iu.js.map → p-DneNTUyc.js.map} +1 -1
- package/components/p-ENtH93ZP.js +160 -0
- package/components/p-ENtH93ZP.js.map +1 -0
- package/components/{p-DwZ3kS7-.js → p-FYggIAJV.js} +12 -20
- package/components/p-FYggIAJV.js.map +1 -0
- package/components/{p-DqRdhtqX.js → p-KHrERHCb.js} +7 -7
- package/components/{p-DqRdhtqX.js.map → p-KHrERHCb.js.map} +1 -1
- package/components/qds-action-item.js +4 -4
- package/components/qds-action-item.js.map +1 -1
- package/components/qds-breadcrumb-item.js +3 -3
- package/components/qds-button.js +1 -1
- package/components/qds-checkbox.js +1 -1
- package/components/qds-chip.js +18 -13
- package/components/qds-chip.js.map +1 -1
- package/components/qds-dialog.js +5 -5
- package/components/qds-divider.js +1 -1
- package/components/qds-dropdown.js +1 -1
- package/components/qds-form-message.js +4 -4
- package/components/qds-icon.js +1 -1
- package/components/qds-inline-link.js +7 -7
- package/components/qds-inline-link.js.map +1 -1
- package/components/qds-input.js +8 -8
- package/components/qds-label.js +1 -1
- package/components/qds-list-item.js +179 -47
- package/components/qds-list-item.js.map +1 -1
- package/components/qds-loader.js +1 -1
- package/components/qds-menu-item.js +6 -6
- package/components/qds-mini-button.js +1 -150
- package/components/qds-mini-button.js.map +1 -1
- package/components/qds-nav-list-item.js +6 -6
- package/components/qds-progress-bar.js +1 -1
- package/components/qds-radio.js +1 -150
- package/components/qds-radio.js.map +1 -1
- package/components/qds-select.js +5 -5
- package/components/qds-standalone-link.js +7 -7
- package/components/qds-standalone-link.js.map +1 -1
- package/components/qds-switch.js +5 -5
- package/components/qds-switch.js.map +1 -1
- package/components/qds-tab.js +10 -10
- package/components/qds-tabbar.js +9 -9
- package/components/qds-table-cell.js +2 -2
- package/components/qds-table-head-cell.js +2 -2
- package/components/qds-table-row.js +1 -1
- package/components/qds-table.js +1 -1
- package/components/qds-tag.js +1 -1
- package/components/qds-textarea.js +3 -3
- package/components/qds-title.js +1 -1
- package/components/qds-tooltip.js +1 -1
- package/dist/cjs/{helpers-Bq_nrM83.js → helpers-TIQOuLiq.js} +7 -17
- package/dist/cjs/helpers-TIQOuLiq.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/qds-action-item.cjs.entry.js +2 -2
- package/dist/cjs/qds-action-item.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-action-item.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-badge-counter.qds-badge-indicator.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-badge-counter_2.cjs.entry.js +27 -325
- package/dist/cjs/qds-badge-counter_2.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-breadcrumb-item.cjs.entry.js +1 -1
- package/dist/cjs/qds-button.cjs.entry.js +375 -0
- package/dist/cjs/qds-button.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-button.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-checkbox.qds-radio.entry.cjs.js.map +1 -0
- package/dist/cjs/qds-checkbox_2.cjs.entry.js +330 -0
- package/dist/cjs/qds-checkbox_2.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-chip.cjs.entry.js +9 -10
- package/dist/cjs/qds-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-chip.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-dialog.cjs.entry.js +2 -2
- package/dist/cjs/qds-divider.cjs.entry.js +1 -1
- package/dist/cjs/qds-dropdown.cjs.entry.js +10 -14
- package/dist/cjs/qds-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-dropdown.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-form-message.cjs.entry.js +3 -3
- package/dist/cjs/qds-icon.cjs.entry.js +2 -2
- package/dist/cjs/qds-inline-link.cjs.entry.js +5 -5
- package/dist/cjs/qds-inline-link.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-inline-link.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-input.cjs.entry.js +5 -5
- package/dist/cjs/qds-label.cjs.entry.js +25 -11
- package/dist/cjs/qds-label.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-label.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-list-item.cjs.entry.js +143 -33
- package/dist/cjs/qds-list-item.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-list-item.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-menu-item.cjs.entry.js +3 -3
- package/dist/cjs/qds-mini-button.cjs.entry.js +2 -2
- package/dist/cjs/qds-nav-list-item.cjs.entry.js +4 -4
- package/dist/cjs/qds-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/qds-select.cjs.entry.js +4 -4
- package/dist/cjs/qds-standalone-link.cjs.entry.js +5 -5
- package/dist/cjs/qds-standalone-link.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-standalone-link.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-switch.cjs.entry.js +5 -5
- package/dist/cjs/qds-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-switch.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-tab.cjs.entry.js +6 -6
- package/dist/cjs/qds-tabbar.cjs.entry.js +5 -5
- package/dist/cjs/qds-table-cell.cjs.entry.js +2 -2
- package/dist/cjs/qds-table-head-cell.cjs.entry.js +2 -2
- package/dist/cjs/qds-table-row.cjs.entry.js +1 -1
- package/dist/cjs/qds-table.cjs.entry.js +1 -1
- package/dist/cjs/qds-tag_2.cjs.entry.js +6 -6
- package/dist/cjs/qds-textarea.cjs.entry.js +3 -3
- package/dist/cjs/qds-tooltip.cjs.entry.js +4 -4
- package/dist/cjs/qds-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-tooltip.entry.cjs.js.map +1 -1
- package/dist/cjs/qds.cjs.js +1 -1
- package/dist/custom-elements.json +292 -78
- package/dist/docs.json +231 -58
- package/dist/esm/{helpers-WkFzY2Zz.js → helpers-FX-UypLF.js} +7 -17
- package/dist/esm/helpers-FX-UypLF.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/qds-action-item.entry.js +2 -2
- package/dist/esm/qds-action-item.entry.js.map +1 -1
- package/dist/esm/qds-badge-counter.qds-badge-indicator.entry.js.map +1 -0
- package/dist/esm/qds-badge-counter_2.entry.js +28 -326
- package/dist/esm/qds-badge-counter_2.entry.js.map +1 -1
- package/dist/esm/qds-breadcrumb-item.entry.js +1 -1
- package/dist/esm/qds-button.entry.js +373 -0
- package/dist/esm/qds-button.entry.js.map +1 -0
- package/dist/esm/qds-checkbox.qds-radio.entry.js.map +1 -0
- package/dist/esm/qds-checkbox_2.entry.js +327 -0
- package/dist/esm/qds-checkbox_2.entry.js.map +1 -0
- package/dist/esm/qds-chip.entry.js +9 -10
- package/dist/esm/qds-chip.entry.js.map +1 -1
- package/dist/esm/qds-dialog.entry.js +2 -2
- package/dist/esm/qds-divider.entry.js +1 -1
- package/dist/esm/qds-dropdown.entry.js +10 -14
- package/dist/esm/qds-dropdown.entry.js.map +1 -1
- package/dist/esm/qds-form-message.entry.js +3 -3
- package/dist/esm/qds-icon.entry.js +2 -2
- package/dist/esm/qds-inline-link.entry.js +5 -5
- package/dist/esm/qds-inline-link.entry.js.map +1 -1
- package/dist/esm/qds-input.entry.js +5 -5
- package/dist/esm/qds-label.entry.js +25 -11
- package/dist/esm/qds-label.entry.js.map +1 -1
- package/dist/esm/qds-list-item.entry.js +144 -34
- package/dist/esm/qds-list-item.entry.js.map +1 -1
- package/dist/esm/qds-menu-item.entry.js +3 -3
- package/dist/esm/qds-mini-button.entry.js +2 -2
- package/dist/esm/qds-nav-list-item.entry.js +4 -4
- package/dist/esm/qds-progress-bar.entry.js +1 -1
- package/dist/esm/qds-select.entry.js +4 -4
- package/dist/esm/qds-standalone-link.entry.js +5 -5
- package/dist/esm/qds-standalone-link.entry.js.map +1 -1
- package/dist/esm/qds-switch.entry.js +5 -5
- package/dist/esm/qds-switch.entry.js.map +1 -1
- package/dist/esm/qds-tab.entry.js +6 -6
- package/dist/esm/qds-tabbar.entry.js +5 -5
- package/dist/esm/qds-table-cell.entry.js +2 -2
- package/dist/esm/qds-table-head-cell.entry.js +2 -2
- package/dist/esm/qds-table-row.entry.js +1 -1
- package/dist/esm/qds-table.entry.js +1 -1
- package/dist/esm/qds-tag_2.entry.js +6 -6
- package/dist/esm/qds-textarea.entry.js +3 -3
- package/dist/esm/qds-tooltip.entry.js +4 -4
- package/dist/esm/qds-tooltip.entry.js.map +1 -1
- package/dist/esm/qds.js +1 -1
- package/dist/types/components/dropdown/dropdown.d.ts +0 -4
- package/dist/types/components/label/label.d.ts +7 -2
- package/dist/types/components/list-item/list-item.d.ts +36 -15
- package/dist/types/components.d.ts +54 -14
- package/dist/types/helpers.d.ts +1 -1
- package/dist/vscode.html-custom-data.json +33 -14
- package/hydrate/index.js +309 -197
- package/hydrate/index.mjs +309 -197
- package/package.json +1 -1
- package/styles/core.css +7 -3
- package/components/p-Bwq_sxXt.js.map +0 -1
- package/components/p-DKlaRUVi.js.map +0 -1
- package/components/p-DwZ3kS7-.js.map +0 -1
- package/components/p-DwifNmZO.js.map +0 -1
- package/dist/cjs/helpers-Bq_nrM83.js.map +0 -1
- package/dist/cjs/qds-badge-counter.qds-button.entry.cjs.js.map +0 -1
- package/dist/cjs/qds-badge-indicator.cjs.entry.js +0 -76
- package/dist/cjs/qds-badge-indicator.cjs.entry.js.map +0 -1
- package/dist/cjs/qds-badge-indicator.entry.cjs.js.map +0 -1
- package/dist/cjs/qds-checkbox.cjs.entry.js +0 -226
- package/dist/cjs/qds-checkbox.cjs.entry.js.map +0 -1
- package/dist/cjs/qds-checkbox.entry.cjs.js.map +0 -1
- package/dist/cjs/qds-radio.cjs.entry.js +0 -117
- package/dist/cjs/qds-radio.cjs.entry.js.map +0 -1
- package/dist/cjs/qds-radio.entry.cjs.js.map +0 -1
- package/dist/esm/helpers-WkFzY2Zz.js.map +0 -1
- package/dist/esm/qds-badge-counter.qds-button.entry.js.map +0 -1
- package/dist/esm/qds-badge-indicator.entry.js +0 -74
- package/dist/esm/qds-badge-indicator.entry.js.map +0 -1
- package/dist/esm/qds-checkbox.entry.js +0 -224
- package/dist/esm/qds-checkbox.entry.js.map +0 -1
- package/dist/esm/qds-radio.entry.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,50 @@ SPDX-License-Identifier: Apache-2.0
|
|
|
11
11
|
|
|
12
12
|
> All notable changes to this project will be documented in this file
|
|
13
13
|
|
|
14
|
+
## @quartzds/core 1.0.0-beta.107 (2025-09-12)
|
|
15
|
+
|
|
16
|
+
* fix(qds-standalone-link, qds-inline-link): add rel="external" check to display external icon ([a7e957e](https://github.com/quartzds/core-foundations/commit/a7e957e))
|
|
17
|
+
* Merge pull request #1277 from quartzds/label-update ([f480d1f](https://github.com/quartzds/core-foundations/commit/f480d1f)), closes [#1277](https://github.com/quartzds/core-foundations/issues/1277)
|
|
18
|
+
* Merge pull request #1294 from quartzds/renovate/npm-run-all2-6.x ([561c289](https://github.com/quartzds/core-foundations/commit/561c289)), closes [#1294](https://github.com/quartzds/core-foundations/issues/1294)
|
|
19
|
+
* Merge pull request #1295 from quartzds/renovate/postcss-import-16.x ([d56e8a4](https://github.com/quartzds/core-foundations/commit/d56e8a4)), closes [#1295](https://github.com/quartzds/core-foundations/issues/1295)
|
|
20
|
+
* Merge pull request #1298 from quartzds/chip-update ([8b463d7](https://github.com/quartzds/core-foundations/commit/8b463d7)), closes [#1298](https://github.com/quartzds/core-foundations/issues/1298)
|
|
21
|
+
* Merge pull request #1359 from quartzds/aria-hidden ([5ed6448](https://github.com/quartzds/core-foundations/commit/5ed6448)), closes [#1359](https://github.com/quartzds/core-foundations/issues/1359)
|
|
22
|
+
* Merge pull request #1360 from quartzds/action-item-fix ([3d2dfe8](https://github.com/quartzds/core-foundations/commit/3d2dfe8)), closes [#1360](https://github.com/quartzds/core-foundations/issues/1360)
|
|
23
|
+
* Merge pull request #1381 from quartzds/798-qds-dropdown-flicker ([7dc5539](https://github.com/quartzds/core-foundations/commit/7dc5539)), closes [#1381](https://github.com/quartzds/core-foundations/issues/1381)
|
|
24
|
+
* Merge pull request #1382 from quartzds/fix---qds-platform-accessory-elevation-token ([2ed23c8](https://github.com/quartzds/core-foundations/commit/2ed23c8)), closes [#1382](https://github.com/quartzds/core-foundations/issues/1382)
|
|
25
|
+
* Merge pull request #1391 from quartzds/button-a11y ([2f25e48](https://github.com/quartzds/core-foundations/commit/2f25e48)), closes [#1391](https://github.com/quartzds/core-foundations/issues/1391)
|
|
26
|
+
* Merge pull request #1400 from quartzds/1000-design-ready-link---fix ([6fbed33](https://github.com/quartzds/core-foundations/commit/6fbed33)), closes [#1400](https://github.com/quartzds/core-foundations/issues/1400)
|
|
27
|
+
* fix(qds-label): add importance property ([f5f3ac2](https://github.com/quartzds/core-foundations/commit/f5f3ac2))
|
|
28
|
+
* fix(a11y): improve `qds-*-link` accessibility ([a0aeffb](https://github.com/quartzds/core-foundations/commit/a0aeffb))
|
|
29
|
+
* fix(a11y): improve `qds-button` accessibility with `badge` ([6657824](https://github.com/quartzds/core-foundations/commit/6657824))
|
|
30
|
+
* fix(qds-chip): improve interaction behavior & prepares qds-chip to be used on different devices ([b2752f2](https://github.com/quartzds/core-foundations/commit/b2752f2))
|
|
31
|
+
* fix(qds-dropdown): move style application to host context instead of template ([ea703c6](https://github.com/quartzds/core-foundations/commit/ea703c6))
|
|
32
|
+
* fix(qds-action-item): replace `vertical padding` by `min-height` ([f380610](https://github.com/quartzds/core-foundations/commit/f380610))
|
|
33
|
+
* fix: replace deprecated `--qds-platform-accessory-elevation` token ([a328405](https://github.com/quartzds/core-foundations/commit/a328405))
|
|
34
|
+
* chore(deps): update dependency cssnano-preset-advanced to v7.0.9 ([6acadfe](https://github.com/quartzds/core-foundations/commit/6acadfe))
|
|
35
|
+
* chore(deps): update dependency npm-run-all2 to v6.2.6 ([cf64083](https://github.com/quartzds/core-foundations/commit/cf64083))
|
|
36
|
+
* chore(deps): update dependency postcss-import to v16.1.1 ([f4ef3fd](https://github.com/quartzds/core-foundations/commit/f4ef3fd))
|
|
37
|
+
* chore(types): use `HtmlElement` instead of `HtmlQdsButtonElement` ([4f9e8a1](https://github.com/quartzds/core-foundations/commit/4f9e8a1))
|
|
38
|
+
|
|
39
|
+
## @quartzds/core 1.0.0-beta.106 (2025-09-02)
|
|
40
|
+
|
|
41
|
+
* Merge pull request #1270 from quartzds/907-design-ready-list-item---enhancements-fixes ([6c0082e](https://github.com/quartzds/core-foundations/commit/6c0082e)), closes [#1270](https://github.com/quartzds/core-foundations/issues/1270)
|
|
42
|
+
* Merge pull request #1354 from quartzds/add-max-width-to-tooltip ([d70442e](https://github.com/quartzds/core-foundations/commit/d70442e)), closes [#1354](https://github.com/quartzds/core-foundations/issues/1354)
|
|
43
|
+
* Merge pull request #1362 from quartzds/fix-qds-main-subsection-padding-tokens ([d0a72dd](https://github.com/quartzds/core-foundations/commit/d0a72dd)), closes [#1362](https://github.com/quartzds/core-foundations/issues/1362)
|
|
44
|
+
* fix(qds-tooltip): add max-width to tooltip ([32eac41](https://github.com/quartzds/core-foundations/commit/32eac41))
|
|
45
|
+
* fix(qds-list-item): fix a11y issues ([e545f3c](https://github.com/quartzds/core-foundations/commit/e545f3c))
|
|
46
|
+
* fix: globally replace `--qds-theme-accessory-elevation` by `--qds-platform-accessory-elevation` ([5467303](https://github.com/quartzds/core-foundations/commit/5467303))
|
|
47
|
+
* fix: globally replace deprecated `--qds-accessory-padding` token ([fb6c734](https://github.com/quartzds/core-foundations/commit/fb6c734))
|
|
48
|
+
* fix(qds-list-item): move focus ring to host element ([cd3abac](https://github.com/quartzds/core-foundations/commit/cd3abac))
|
|
49
|
+
* fix(qds-list-item): refine CSS for size variants and add line-clamp for text sections ([9ba0f3c](https://github.com/quartzds/core-foundations/commit/9ba0f3c))
|
|
50
|
+
* fix: replace deprecated `--qds-main-subsection-padding` token ([86d1bef](https://github.com/quartzds/core-foundations/commit/86d1bef))
|
|
51
|
+
* feat(qds-list-item): add avatar support ([7466fbb](https://github.com/quartzds/core-foundations/commit/7466fbb))
|
|
52
|
+
* feat(qds-list-item): add badge counter ([8788608](https://github.com/quartzds/core-foundations/commit/8788608))
|
|
53
|
+
* feat(qds-list-item): add item image support ([eaa197b](https://github.com/quartzds/core-foundations/commit/eaa197b))
|
|
54
|
+
* feat(qds-list-item): replace CSS divider with `qds-divider` ([25873ff](https://github.com/quartzds/core-foundations/commit/25873ff))
|
|
55
|
+
* feat(qds-list-item): support `radio` in `list-action` and enhance `reorder` behavior ([7d623fa](https://github.com/quartzds/core-foundations/commit/7d623fa))
|
|
56
|
+
* feat(qds-list-item): support tooltip for truncated text ([c8e06f0](https://github.com/quartzds/core-foundations/commit/c8e06f0))
|
|
57
|
+
|
|
14
58
|
## @quartzds/core 1.0.0-beta.105 (2025-08-29)
|
|
15
59
|
|
|
16
60
|
* feat!: update react bindings ([6c3c6b9](https://github.com/quartzds/core-foundations/commit/6c3c6b9))
|
package/components/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
export { g as getAssetPath, r as render, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-DdPT87mZ.js';
|
|
7
|
-
export { r as registerIconLibrary, u as unregisterIconLibrary } from './p-
|
|
7
|
+
export { r as registerIconLibrary, u as unregisterIconLibrary } from './p-DcmmW8Nm.js';
|
|
8
8
|
export { QdsActionItem, defineCustomElement as defineCustomElementQdsActionItem } from './qds-action-item.js';
|
|
9
9
|
export { QdsBadgeCounter, defineCustomElement as defineCustomElementQdsBadgeCounter } from './qds-badge-counter.js';
|
|
10
10
|
export { QdsBadgeIndicator, defineCustomElement as defineCustomElementQdsBadgeIndicator } from './qds-badge-indicator.js';
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { p as proxyCustomElement, H, h, F as Fragment } from './p-DdPT87mZ.js';
|
|
7
|
-
import { b as inheritAriaAttributes } from './p-
|
|
7
|
+
import { b as inheritAriaAttributes } from './p-CLO9W_LH.js';
|
|
8
8
|
import { d as defineCustomElement$2 } from './p-C89mbc4M.js';
|
|
9
|
-
import { d as defineCustomElement$1 } from './p-
|
|
9
|
+
import { d as defineCustomElement$1 } from './p-DcmmW8Nm.js';
|
|
10
10
|
|
|
11
11
|
const tagCss = ":host([hidden]){display:none!important}:host{display:inline-block}.qds-tag{align-items:center;border-radius:var(--qds-feedback-rounded-border-radius);box-sizing:border-box;display:inline-flex;justify-content:center;max-width:inherit;min-width:inherit;width:inherit}.qds-text{text-overflow:ellipsis}.qds-sr-only,.qds-text{overflow:hidden;white-space:nowrap}.qds-sr-only{clip:rect(0 0 0 0);height:1px;margin:-1px;padding:0;position:absolute;width:1px}.qds-icon{flex-shrink:0}[data-status=error]{color:var(--qds-theme-feedback-message-critical)}[data-status=success]{color:var(--qds-theme-feedback-message-success)}[data-status=warning]{color:var(--qds-theme-feedback-message-important)}[data-status=info]{color:var(--qds-theme-feedback-message-informational)}[data-status=neutral]{color:var(--qds-theme-feedback-message-neutral)}[data-importance=subdued] .qds-text{color:var(--qds-theme-text-standard)}[data-importance=standard][data-status=error]{background-color:var(--qds-theme-feedback-message-critical-dimmed)}[data-importance=standard][data-status=success]{background-color:var(--qds-theme-feedback-message-success-dimmed)}[data-importance=standard][data-status=warning]{background-color:var(--qds-theme-feedback-message-important-dimmed)}[data-importance=standard][data-status=info]{background-color:var(--qds-theme-feedback-message-informational-dimmed)}[data-importance=standard][data-status=neutral]{background-color:var(--qds-theme-feedback-message-neutral-dimmed)}[data-importance=emphasized][data-status=error]{background-color:var(--qds-theme-feedback-message-critical);color:var(--qds-theme-feedback-message-critical-contrast)}[data-importance=emphasized][data-status=success]{background-color:var(--qds-theme-feedback-message-success);color:var(--qds-theme-feedback-message-success-contrast)}[data-importance=emphasized][data-status=warning]{background-color:var(--qds-theme-feedback-message-important);color:var(--qds-theme-feedback-message-important-contrast)}[data-importance=emphasized][data-status=info]{background-color:var(--qds-theme-feedback-message-informational);color:var(--qds-theme-feedback-message-informational-contrast)}[data-importance=emphasized][data-status=neutral]{background-color:var(--qds-theme-feedback-message-neutral);color:var(--qds-theme-feedback-message-neutral-contrast)}.qds-tag[data-size=small]{font:var(--qds-feedback-tag-small-text);gap:var(--qds-feedback-tag-small-gap-internal);height:var(--qds-feedback-tag-small-height)}.qds-padding[data-size=small]{padding-inline:var(--qds-feedback-tag-small-padding-horizontal)}.qds-icon[data-size=small]{height:var(--qds-feedback-tag-small-icon-size);width:var(--qds-feedback-tag-small-icon-size)}.qds-tag[data-size=standard]{font:var(--qds-feedback-tag-standard-text);gap:var(--qds-feedback-tag-standard-gap-internal);height:var(--qds-feedback-tag-standard-height)}.qds-padding[data-size=standard]{padding-inline:var(--qds-feedback-tag-standard-padding-horizontal)}.qds-icon[data-size=standard]{height:var(--qds-feedback-tag-standard-icon-size);width:var(--qds-feedback-tag-standard-icon-size)}.qds-tag[data-size=large]{font:var(--qds-feedback-tag-large-text);gap:var(--qds-feedback-tag-large-gap-internal);height:var(--qds-feedback-tag-large-height)}.qds-padding[data-size=large]{padding-inline:var(--qds-feedback-tag-large-padding-horizontal)}.qds-icon[data-size=large]{height:var(--qds-feedback-tag-large-icon-size);width:var(--qds-feedback-tag-large-icon-size)}";
|
|
12
12
|
|
|
@@ -62,11 +62,11 @@ const Tag = /*@__PURE__*/ proxyCustomElement(class Tag extends H {
|
|
|
62
62
|
__classPrivateFieldSet(this, _Tag_inheritedAttributes, inheritAriaAttributes(this.host), "f");
|
|
63
63
|
}
|
|
64
64
|
render() {
|
|
65
|
-
return (h("span", { key: '
|
|
65
|
+
return (h("span", { key: '87edb6c65e00ab1ba7eb4b6874065674c164d5ce', class: {
|
|
66
66
|
'qds-tag': true,
|
|
67
67
|
'qds-padding': this.importance !== 'subdued',
|
|
68
68
|
}, "data-importance": __classPrivateFieldGet(this, _Tag_instances, "a", _Tag_computedImportance_get), "data-size": __classPrivateFieldGet(this, _Tag_instances, "a", _Tag_computedSize_get), "data-status": __classPrivateFieldGet(this, _Tag_instances, "a", _Tag_computedStatus_get), ...__classPrivateFieldGet(this, _Tag_inheritedAttributes, "f") }, this.iconName !== undefined && this.iconName !== '' ? (h(Fragment, null, this.iconDescription !== undefined &&
|
|
69
|
-
this.iconDescription !== '' && (h("span", { class: "qds-sr-only" }, this.iconDescription)), h("qds-icon", { "aria-hidden": "true", class: "qds-icon", "data-size": __classPrivateFieldGet(this, _Tag_instances, "a", _Tag_computedSize_get), library: this.iconLibrary, name: this.iconName }))) : (__classPrivateFieldGet(this, _Tag_instances, "a", _Tag_hasBadge_get) && (h("qds-badge-indicator", { status: __classPrivateFieldGet(this, _Tag_instances, "a", _Tag_computedStatus_get), description: this.badgeDescription, size: __classPrivateFieldGet(this, _Tag_instances, "a", _Tag_computedSize_get), strokeRing: true }))), h("span", { key: '
|
|
69
|
+
this.iconDescription !== '' && (h("span", { class: "qds-sr-only" }, this.iconDescription)), h("qds-icon", { "aria-hidden": "true", class: "qds-icon", "data-size": __classPrivateFieldGet(this, _Tag_instances, "a", _Tag_computedSize_get), library: this.iconLibrary, name: this.iconName }))) : (__classPrivateFieldGet(this, _Tag_instances, "a", _Tag_hasBadge_get) && (h("qds-badge-indicator", { status: __classPrivateFieldGet(this, _Tag_instances, "a", _Tag_computedStatus_get), description: this.badgeDescription, size: __classPrivateFieldGet(this, _Tag_instances, "a", _Tag_computedSize_get), strokeRing: true }))), h("span", { key: 'b45611a51b0169cebffa404092d004098618bce2', class: "qds-text" }, this.text)));
|
|
70
70
|
}
|
|
71
71
|
get host() { return this; }
|
|
72
72
|
static get style() { return tagCss; }
|
|
@@ -142,6 +142,6 @@ function defineCustomElement() {
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
export { Tag as T, defineCustomElement as d };
|
|
145
|
-
//# sourceMappingURL=p-
|
|
145
|
+
//# sourceMappingURL=p-BLasS6lS.js.map
|
|
146
146
|
|
|
147
|
-
//# sourceMappingURL=p-
|
|
147
|
+
//# sourceMappingURL=p-BLasS6lS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-tSnbFa3i.js","mappings":";;;;;;;;;;AAAA,MAAM,MAAM,GAAG,m4GAAm4G;;ACAl5G;AACA;AACA;;;;;;;;;;;;;;;;;;MAsBa,GAAG,iBAAAA,kBAAA,CAAA,MAAA,GAAA,SAAAC,CAAA,CAAA;AALhB,IAAA,WAAA,GAAA;;;;;AAaE;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA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,QAAA,KAAK,SAAS;QACd,KAAK,SAAS,EAAE;YACd,OAAO,IAAI,CAAC,MAAM;;QAEpB,SAAS;AACP,YAAA,OAAO,SAAS;;;AAGtB,CAAC,EAAA,iBAAA,GAAA,SAAA,iBAAA,GAAA;AAGC,IAAA,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,IAAI,CAAC,UAAU,KAAK,YAAY;AAClE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"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-feedback-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-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-feedback-tag-small-text);\n gap: var(--qds-feedback-tag-small-gap-internal);\n height: var(--qds-feedback-tag-small-height);\n }\n\n &.qds-padding {\n padding-inline: var(--qds-feedback-tag-small-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-feedback-tag-small-icon-size);\n height: var(--qds-feedback-tag-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n &.qds-tag {\n font: var(--qds-feedback-tag-standard-text);\n gap: var(--qds-feedback-tag-standard-gap-internal);\n height: var(--qds-feedback-tag-standard-height);\n }\n\n &.qds-padding {\n padding-inline: var(--qds-feedback-tag-standard-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-feedback-tag-standard-icon-size);\n height: var(--qds-feedback-tag-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n &.qds-tag {\n font: var(--qds-feedback-tag-large-text);\n gap: var(--qds-feedback-tag-large-gap-internal);\n height: var(--qds-feedback-tag-large-height);\n }\n\n &.qds-padding {\n padding-inline: var(--qds-feedback-tag-large-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-feedback-tag-large-icon-size);\n height: var(--qds-feedback-tag-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={{\n 'qds-tag': true,\n 'qds-padding': this.importance !== 'subdued',\n }}\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
|
+
{"file":"p-BLasS6lS.js","mappings":";;;;;;;;;;AAAA,MAAM,MAAM,GAAG,m4GAAm4G;;ACAl5G;AACA;AACA;;;;;;;;;;;;;;;;;;MAsBa,GAAG,iBAAAA,kBAAA,CAAA,MAAA,GAAA,SAAAC,CAAA,CAAA;AALhB,IAAA,WAAA,GAAA;;;;;AAaE;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAW,SAAS;AAEvD;;AAEG;AACqB,QAAA,IAAU,CAAA,UAAA,GAAgB,UAAU;AAE5D;;AAEG;AACqB,QAAA,IAAM,CAAA,MAAA,GAAe,SAAS;AAEtD;;AAEG;AACqB,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,iBAAA,GAAA;AAGC,IAAA,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,IAAI,CAAC,UAAU,KAAK,YAAY;AAClE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"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-feedback-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-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-feedback-tag-small-text);\n gap: var(--qds-feedback-tag-small-gap-internal);\n height: var(--qds-feedback-tag-small-height);\n }\n\n &.qds-padding {\n padding-inline: var(--qds-feedback-tag-small-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-feedback-tag-small-icon-size);\n height: var(--qds-feedback-tag-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n &.qds-tag {\n font: var(--qds-feedback-tag-standard-text);\n gap: var(--qds-feedback-tag-standard-gap-internal);\n height: var(--qds-feedback-tag-standard-height);\n }\n\n &.qds-padding {\n padding-inline: var(--qds-feedback-tag-standard-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-feedback-tag-standard-icon-size);\n height: var(--qds-feedback-tag-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n &.qds-tag {\n font: var(--qds-feedback-tag-large-text);\n gap: var(--qds-feedback-tag-large-gap-internal);\n height: var(--qds-feedback-tag-large-height);\n }\n\n &.qds-padding {\n padding-inline: var(--qds-feedback-tag-large-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-feedback-tag-large-icon-size);\n height: var(--qds-feedback-tag-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={{\n 'qds-tag': true,\n 'qds-padding': this.importance !== 'subdued',\n }}\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}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { p as proxyCustomElement, H, d as readTask, h } from './p-DdPT87mZ.js';
|
|
7
|
-
import { a as isOverflowing } from './p-
|
|
8
|
-
import { d as defineCustomElement$1 } from './p-
|
|
7
|
+
import { a as isOverflowing } from './p-CLO9W_LH.js';
|
|
8
|
+
import { d as defineCustomElement$1 } from './p-D85ZJwsC.js';
|
|
9
9
|
|
|
10
|
-
const labelCss = ":host([hidden]){display:none!important}:host{display:inline-block}.qds-label{box-sizing:border-box;color:var(--qds-theme-control-text-standard);display:inline-flex;gap:var(--qds-text-icon-gap);width:100%}.qds-label:focus-visible{border-radius:var(--qds-focus-border-radius);outline:var(--qds-focus-border-width) solid var(--qds-theme-focus-border);outline-offset:var(--qds-focus-border-offset)}.qds-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.qds-required{color:var(--qds-theme-feedback-field-required);-webkit-user-select:none;user-select:none}[data-size=small]{font:var(--qds-
|
|
10
|
+
const labelCss = ":host([hidden]){display:none!important}:host{display:inline-block}.qds-label{align-items:center;box-sizing:border-box;color:var(--qds-theme-control-text-standard);display:inline-flex;gap:var(--qds-text-icon-gap);width:100%}.qds-label:focus-visible{border-radius:var(--qds-focus-border-radius);outline:var(--qds-focus-border-width) solid var(--qds-theme-focus-border);outline-offset:var(--qds-focus-border-offset)}.qds-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis}.qds-required{color:var(--qds-theme-feedback-field-required);-webkit-user-select:none;user-select:none}[data-size=small][data-importance=standard]{font:var(--qds-form-small-text)}[data-size=small][data-importance=emphasized] .qds-text{font:var(--qds-form-small-text-emphasized)}.qds-inline[data-size=small]{margin-block:var(--qds-control-small-padding-auto-height)}.qds-icon[data-size=small]{height:var(--qds-form-small-icon-size);min-width:var(--qds-form-small-icon-size);width:var(--qds-form-small-icon-size)}[data-size=standard][data-importance=standard]{font:var(--qds-form-standard-text)}[data-size=standard][data-importance=emphasized] .qds-text{font:var(--qds-form-standard-text-emphasized)}.qds-inline[data-size=standard]{margin-block:var(--qds-control-standard-padding-auto-height)}.qds-icon[data-size=standard]{height:var(--qds-form-standard-icon-size);min-width:var(--qds-form-standard-icon-size);width:var(--qds-form-standard-icon-size)}[data-size=large][data-importance=standard]{font:var(--qds-form-large-text)}[data-size=large][data-importance=emphasized] .qds-text{font:var(--qds-form-large-text-emphasized)}.qds-inline[data-size=large]{margin-block:var(--qds-control-large-padding-auto-height)}.qds-icon[data-size=large]{height:var(--qds-form-large-icon-size);min-width:var(--qds-form-large-icon-size);width:var(--qds-form-large-icon-size)}";
|
|
11
11
|
|
|
12
12
|
// SPDX-FileCopyrightText: © 2024 Schneider Electric
|
|
13
13
|
//
|
|
@@ -28,7 +28,7 @@ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) ||
|
|
|
28
28
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
29
29
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
30
30
|
};
|
|
31
|
-
var _Label_instances, _Label_label, _Label_ro, _Label_span, _Label_computedSize_get, _Label_labelRef, _Label_spanRef,
|
|
31
|
+
var _Label_instances, _Label_label, _Label_ro, _Label_span, _Label_computedSize_get, _Label_computedImportance_get, _Label_labelRef, _Label_spanRef, _Label_truncatedTooltipRef;
|
|
32
32
|
const Label = /*@__PURE__*/ proxyCustomElement(class Label extends H {
|
|
33
33
|
constructor() {
|
|
34
34
|
super();
|
|
@@ -50,7 +50,11 @@ const Label = /*@__PURE__*/ proxyCustomElement(class Label extends H {
|
|
|
50
50
|
* The label's size.
|
|
51
51
|
*/
|
|
52
52
|
this.size = 'standard';
|
|
53
|
-
|
|
53
|
+
/**
|
|
54
|
+
* The label's importance.
|
|
55
|
+
*/
|
|
56
|
+
this.importance = 'standard';
|
|
57
|
+
this.truncatedTooltip = false;
|
|
54
58
|
_Label_label.set(this, void 0);
|
|
55
59
|
_Label_ro.set(this, void 0);
|
|
56
60
|
_Label_span.set(this, void 0);
|
|
@@ -60,7 +64,7 @@ const Label = /*@__PURE__*/ proxyCustomElement(class Label extends H {
|
|
|
60
64
|
_Label_spanRef.set(this, (span) => {
|
|
61
65
|
__classPrivateFieldSet(this, _Label_span, span, "f");
|
|
62
66
|
});
|
|
63
|
-
|
|
67
|
+
_Label_truncatedTooltipRef.set(this, (tooltip) => {
|
|
64
68
|
if (tooltip)
|
|
65
69
|
// eslint-disable-next-line no-param-reassign
|
|
66
70
|
tooltip.target = __classPrivateFieldGet(this, _Label_label, "f");
|
|
@@ -73,10 +77,10 @@ const Label = /*@__PURE__*/ proxyCustomElement(class Label extends H {
|
|
|
73
77
|
return;
|
|
74
78
|
const span = __classPrivateFieldGet(this, _Label_span, "f");
|
|
75
79
|
readTask(() => {
|
|
76
|
-
this.
|
|
80
|
+
this.truncatedTooltip = isOverflowing(span);
|
|
77
81
|
});
|
|
78
82
|
__classPrivateFieldSet(this, _Label_ro, new ResizeObserver(([spanEntry]) => {
|
|
79
|
-
this.
|
|
83
|
+
this.truncatedTooltip = isOverflowing(spanEntry.target);
|
|
80
84
|
}), "f");
|
|
81
85
|
__classPrivateFieldGet(this, _Label_ro, "f").observe(__classPrivateFieldGet(this, _Label_span, "f"));
|
|
82
86
|
}
|
|
@@ -88,12 +92,12 @@ const Label = /*@__PURE__*/ proxyCustomElement(class Label extends H {
|
|
|
88
92
|
__classPrivateFieldGet(this, _Label_ro, "f").disconnect();
|
|
89
93
|
}
|
|
90
94
|
render() {
|
|
91
|
-
return (h("span", { key: '
|
|
95
|
+
return (h("span", { key: 'c84160324b09603a0b99de70e796522377177d0b', class: {
|
|
92
96
|
'qds-inline': this.inline,
|
|
93
97
|
'qds-label': true,
|
|
94
|
-
}, "data-size": __classPrivateFieldGet(this, _Label_instances, "a", _Label_computedSize_get), ref: __classPrivateFieldGet(this, _Label_labelRef, "f"),
|
|
98
|
+
}, "data-size": __classPrivateFieldGet(this, _Label_instances, "a", _Label_computedSize_get), "data-importance": __classPrivateFieldGet(this, _Label_instances, "a", _Label_computedImportance_get), ref: __classPrivateFieldGet(this, _Label_labelRef, "f"),
|
|
95
99
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
96
|
-
tabIndex: this.
|
|
100
|
+
tabIndex: this.truncatedTooltip ? 0 : undefined }, this.required && h("span", { key: 'e5a02767d1ff2f4453a15724d387e97573cf78e4', class: "qds-required" }, "*"), h("span", { key: 'e21a838374ad242ac68dae359c72dbfe45779e06', class: "qds-text", ref: __classPrivateFieldGet(this, _Label_spanRef, "f") }, this.text), this.truncatedTooltip && (h("qds-tooltip", { key: '3ea758f7d5c608fa69e6a95a96199c0b8b144703', "aria-hidden": "true", ref: __classPrivateFieldGet(this, _Label_truncatedTooltipRef, "f") }, this.text))));
|
|
97
101
|
}
|
|
98
102
|
static get watchers() { return {
|
|
99
103
|
"text": ["textChanged"]
|
|
@@ -103,12 +107,13 @@ const Label = /*@__PURE__*/ proxyCustomElement(class Label extends H {
|
|
|
103
107
|
"inline": [4],
|
|
104
108
|
"required": [4],
|
|
105
109
|
"size": [1],
|
|
110
|
+
"importance": [1],
|
|
106
111
|
"text": [1],
|
|
107
|
-
"
|
|
112
|
+
"truncatedTooltip": [32]
|
|
108
113
|
}, undefined, {
|
|
109
114
|
"text": ["textChanged"]
|
|
110
115
|
}]);
|
|
111
|
-
_Label_label = new WeakMap(), _Label_ro = new WeakMap(), _Label_span = new WeakMap(), _Label_labelRef = new WeakMap(), _Label_spanRef = new WeakMap(),
|
|
116
|
+
_Label_label = new WeakMap(), _Label_ro = new WeakMap(), _Label_span = new WeakMap(), _Label_labelRef = new WeakMap(), _Label_spanRef = new WeakMap(), _Label_truncatedTooltipRef = new WeakMap(), _Label_instances = new WeakSet(), _Label_computedSize_get = function _Label_computedSize_get() {
|
|
112
117
|
switch (this.size) {
|
|
113
118
|
case 'standard':
|
|
114
119
|
case 'small':
|
|
@@ -119,6 +124,16 @@ _Label_label = new WeakMap(), _Label_ro = new WeakMap(), _Label_span = new WeakM
|
|
|
119
124
|
return 'standard';
|
|
120
125
|
}
|
|
121
126
|
}
|
|
127
|
+
}, _Label_computedImportance_get = function _Label_computedImportance_get() {
|
|
128
|
+
switch (this.importance) {
|
|
129
|
+
case 'emphasized':
|
|
130
|
+
case 'standard': {
|
|
131
|
+
return this.importance;
|
|
132
|
+
}
|
|
133
|
+
default: {
|
|
134
|
+
return 'standard';
|
|
135
|
+
}
|
|
136
|
+
}
|
|
122
137
|
};
|
|
123
138
|
function defineCustomElement() {
|
|
124
139
|
if (typeof customElements === "undefined") {
|
|
@@ -140,6 +155,6 @@ function defineCustomElement() {
|
|
|
140
155
|
}
|
|
141
156
|
|
|
142
157
|
export { Label as L, defineCustomElement as d };
|
|
143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AA,EAAA,iBAAA,EACZ,sBAAA,CAAA,IAAI,EAAoB,gBAAA,EAAA,GAAA,EAAA,6BAAA,CAAA,EACzC,GAAG,EAAE,sBAAA,CAAA,IAAI,EAAU,eAAA,EAAA,GAAA,CAAA;;YAEnB,QAAQ,EAAE,IAAI,CAAC,gBAAgB,GAAG,CAAC,GAAG,SAAS,EAAA,EAE9C,IAAI,CAAC,QAAQ,IAAI,6DAAM,KAAK,EAAC,cAAc,EAAS,EAAA,GAAA,CAAA,EACrD,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,UAAU,EAAC,GAAG,EAAE,sBAAA,CAAA,IAAI,EAAS,cAAA,EAAA,GAAA,CAAA,EAAA,EACtC,IAAI,CAAC,IAAI,CACL,EACN,IAAI,CAAC,gBAAgB,KACpB,mFAAyB,MAAM,EAAC,GAAG,EAAE,sBAAA,CAAA,IAAI,EAAqB,0BAAA,EAAA,GAAA,CAAA,EAAA,EAC3D,IAAI,CAAC,IAAI,CACE,CACf,CACI;;;;;;;;;;;;;;;;;AAtET,IAAA,QAAQ,IAAI,CAAC,IAAI;AACf,QAAA,KAAK,UAAU;AACf,QAAA,KAAK,OAAO;QACZ,KAAK,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC,IAAI;;QAElB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,6BAAA,GAAA,SAAA,6BAAA,GAAA;AAGC,IAAA,QAAQ,IAAI,CAAC,UAAU;AACrB,QAAA,KAAK,YAAY;QACjB,KAAK,UAAU,EAAE;YACf,OAAO,IAAI,CAAC,UAAU;;QAExB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"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 align-items: center;\n gap: var(--qds-text-icon-gap);\n width: 100%;\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 text-overflow: ellipsis;\n}\n\n.qds-required {\n color: var(--qds-theme-feedback-field-required);\n user-select: none;\n}\n\n[data-size='small'] {\n &[data-importance='standard'] {\n font: var(--qds-form-small-text);\n }\n\n &[data-importance='emphasized'] .qds-text {\n font: var(--qds-form-small-text-emphasized);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-small-padding-auto-height);\n }\n\n &.qds-icon {\n height: var(--qds-form-small-icon-size);\n width: var(--qds-form-small-icon-size);\n min-width: var(--qds-form-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n &[data-importance='standard'] {\n font: var(--qds-form-standard-text);\n }\n\n &[data-importance='emphasized'] .qds-text {\n font: var(--qds-form-standard-text-emphasized);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-standard-padding-auto-height);\n }\n\n &.qds-icon {\n height: var(--qds-form-standard-icon-size);\n width: var(--qds-form-standard-icon-size);\n min-width: var(--qds-form-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n &[data-importance='standard'] {\n font: var(--qds-form-large-text);\n }\n\n &[data-importance='emphasized'] .qds-text {\n font: var(--qds-form-large-text-emphasized);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-large-padding-auto-height);\n }\n\n &.qds-icon {\n height: var(--qds-form-large-icon-size);\n width: var(--qds-form-large-icon-size);\n min-width: var(--qds-form-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, h, Prop, readTask, State, Watch } from '@stencil/core'\n\nimport { isOverflowing } from '../../helpers'\nimport type { Importance, Size } from '../shared'\n\nexport type LabelImportance = Exclude<Importance, 'subdued'>\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 importance.\n */\n @Prop() public readonly importance?: LabelImportance = 'standard'\n\n /**\n * The label's text.\n */\n @Prop() public readonly text?: string\n\n @State() private truncatedTooltip = 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 get #computedImportance(): LabelImportance {\n switch (this.importance) {\n case 'emphasized':\n case 'standard': {\n return this.importance\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 const span = this.#span\n readTask(() => {\n this.truncatedTooltip = isOverflowing(span)\n })\n this.#ro = new ResizeObserver(([spanEntry]) => {\n this.truncatedTooltip = 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 data-importance={this.#computedImportance}\n ref={this.#labelRef}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={this.truncatedTooltip ? 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.truncatedTooltip && (\n <qds-tooltip aria-hidden=\"true\" ref={this.#truncatedTooltipRef}>\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 #truncatedTooltipRef = (tooltip?: HTMLQdsTooltipElement): void => {\n if (tooltip)\n // eslint-disable-next-line no-param-reassign\n tooltip.target = this.#label\n }\n}\n"],"version":3}
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { p as proxyCustomElement, H, c as createEvent, d as readTask, h } from './p-DdPT87mZ.js';
|
|
7
|
-
import { p as pickFocusEventAttributes, a as isOverflowing } from './p-
|
|
7
|
+
import { p as pickFocusEventAttributes, a as isOverflowing } from './p-CLO9W_LH.js';
|
|
8
8
|
import { V as VALID_STATE, C as CUSTOM_ERROR_FLAGS, N as NO_ERROR_FLAGS } from './p-DQLjJn7-.js';
|
|
9
9
|
import { d as defineCustomElement$4 } from './p-CdeGV981.js';
|
|
10
10
|
import { d as defineCustomElement$3 } from './p-C89mbc4M.js';
|
|
11
|
-
import { d as defineCustomElement$2 } from './p-
|
|
12
|
-
import { d as defineCustomElement$1 } from './p-
|
|
11
|
+
import { d as defineCustomElement$2 } from './p-DcmmW8Nm.js';
|
|
12
|
+
import { d as defineCustomElement$1 } from './p-D85ZJwsC.js';
|
|
13
13
|
|
|
14
14
|
const buttonCss = ":host([hidden]){display:none!important}:host{display:inline-block;outline:none}.qds-button:disabled,.qds-disabled{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-overflow{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.qds-overflow[data-size=hero]{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal}.qds-action{transform:scaleX(var(--qds-direction-factor,1))}.qds-container{display:grid;grid-template-areas:\"a\"}.qds-focus-ring{border-radius:max(1px,var(\n --qds-control-border-radius-top-left,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-top-right,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-right,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-left,var(--qds-control-border-radius)\n ));grid-area:a;height:calc(100% + var(--qds-control-border-width) - var(--qds-control-border-width-block-end, var(--qds-control-border-width)));isolation:isolate;outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset);pointer-events:none;visibility:hidden;width:calc(100% + var(--qds-control-border-width) - var(\n --qds-control-border-width-inline-end,\n var(--qds-control-border-width)\n ))}:host(:focus-visible) .qds-focus-ring{visibility:visible}.qds-button{align-items:center;-webkit-appearance:none;appearance:none;background-color:initial;border:none;border-radius:var(\n --qds-control-border-radius-top-left,var(--qds-control-border-radius)\n ) var(--qds-control-border-radius-top-right,var(--qds-control-border-radius)) var(\n --qds-control-border-radius-bottom-right,var(--qds-control-border-radius)\n ) var(\n --qds-control-border-radius-bottom-left,var(--qds-control-border-radius)\n );box-sizing:border-box;cursor:pointer;display:inline-flex;grid-area:a;justify-content:center;min-width:0;outline:none;padding-block:0;position:relative;-webkit-print-color-adjust:exact;print-color-adjust:exact;text-align:center;-webkit-user-select:none;user-select:none}.qds-button:any-link{-webkit-text-decoration:none;text-decoration:none}.qds-icon{flex-shrink:0}.qds-indicator{inset-block-start:0;inset-inline-end:0;position:absolute;transform:translate(50%,-50%)}[data-size=small]{font:var(--qds-control-small-text)}.qds-button[data-size=small]{gap:var(--qds-control-small-gap-internal);height:var(--qds-control-small-height);padding-inline:var(--qds-control-button-small-padding-horizontal)}.qds-button.qds-icon-only[data-size=small]{width:var(--qds-control-small-height)}.qds-icon[data-size=small]{font-size:var(--qds-control-small-icon-size)}[data-size=standard]{font:var(--qds-control-standard-text)}.qds-button[data-size=standard]{gap:var(--qds-control-standard-gap-internal);height:var(--qds-control-standard-height);padding-inline:var(--qds-control-button-standard-padding-horizontal)}.qds-button.qds-icon-only[data-size=standard]{width:var(--qds-control-standard-height)}.qds-icon[data-size=standard]{font-size:var(--qds-control-standard-icon-size)}[data-size=large]{font:var(--qds-control-large-text)}.qds-button[data-size=large]{gap:var(--qds-control-large-gap-internal);height:var(--qds-control-large-height);padding-inline:var(--qds-control-button-large-padding-horizontal)}.qds-button.qds-icon-only[data-size=large]{width:var(--qds-control-large-height)}.qds-icon[data-size=large]{font-size:var(--qds-control-large-icon-size)}[data-size=large],[data-size=small],[data-size=standard]{line-height:normal}.qds-button.qds-icon-only[data-size=large],.qds-button.qds-icon-only[data-size=small],.qds-button.qds-icon-only[data-size=standard]{padding-inline:0}[data-size=hero]{font:var(--qds-control-hero-text)}.qds-button[data-size=hero]{border-radius:var(\n --qds-control-border-radius-top-left,var(--qds-control-hero-border-radius)\n ) var(\n --qds-control-border-radius-top-right,var(--qds-control-hero-border-radius)\n ) var(\n --qds-control-border-radius-bottom-right,var(--qds-control-hero-border-radius)\n ) var(\n --qds-control-border-radius-bottom-left,var(--qds-control-hero-border-radius)\n );gap:var(--qds-control-hero-gap-internal);padding-block:var(--qds-control-hero-padding-auto-height);padding-inline:var(--qds-control-button-hero-padding-horizontal)}.qds-button.qds-icon-only[data-size=hero]{height:var(--qds-control-hero-height);padding-inline:0;width:var(--qds-control-hero-height)}.qds-focus-ring[data-size=hero]{border-radius:max(1px,var(\n --qds-control-border-radius-top-left,var(--qds-control-hero-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-top-right,var(--qds-control-hero-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-right,var(--qds-control-hero-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-left,var(--qds-control-hero-border-radius)\n ))}.qds-icon[data-size=hero]{font-size:var(--qds-control-hero-icon-size)}[data-importance=subdued]{color:var(--qds-theme-link-standard-default)}.qds-button[data-importance=subdued]{border-block-end:var(--qds-control-border-width) solid #0000;padding-inline:0}.qds-button[data-importance=subdued]:hover{border-block-end:var(--qds-control-border-width) solid var(--qds-theme-link-standard-hover);color:var(--qds-theme-link-standard-hover)}.qds-button[data-importance=subdued]:active{border-block-end:var(--qds-control-border-width) solid var(--qds-theme-link-standard-pressed);color:var(--qds-theme-link-standard-pressed)}.qds-button[data-importance=subdued]:not(.qds-icon-only){border-radius:0}.qds-button.qds-icon-only[data-importance=subdued]{border:none;color:var(--qds-theme-control-text-standard)}.qds-button.qds-icon-only[data-importance=subdued]:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-button.qds-icon-only[data-importance=subdued]:active{background-color:var(--qds-theme-interactive-background-pressed)}[data-importance=standard]{color:var(--qds-theme-control-text-standard)}.qds-button[data-importance=standard]{border-color:var(--qds-theme-control-border);border-style:solid;border-width:var(--qds-control-border-width) var(\n --qds-control-border-width-inline-end,var(--qds-control-border-width)\n ) var(--qds-control-border-width-block-end,var(--qds-control-border-width)) var(--qds-control-border-width)}.qds-button[data-importance=standard]:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-button[data-importance=standard]:active{background-color:var(--qds-theme-interactive-background-pressed)}.qds-button[data-importance=emphasized]{background-color:var(--qds-theme-signature-color-default);color:var(--qds-theme-signature-color-contrast)}.qds-button[data-importance=emphasized]:hover{background-color:var(--qds-theme-signature-color-hover)}.qds-button[data-importance=emphasized]:active{background-color:var(--qds-theme-signature-color-pressed)}.qds-button[data-importance=destructive]{background-color:var(--qds-theme-feedback-action-destructive-default);color:var(--qds-theme-feedback-action-destructive-contrast)}.qds-button[data-importance=destructive]:hover{background-color:var(--qds-theme-feedback-action-destructive-hover)}.qds-button[data-importance=destructive]:active{background-color:var(--qds-theme-feedback-action-destructive-pressed)}[data-importance=subdued-destructive]{color:var(--qds-theme-feedback-action-destructive-default)}.qds-button[data-importance=subdued-destructive]{border-block-end:var(--qds-control-border-width) solid #0000;padding-inline:0}.qds-button[data-importance=subdued-destructive]:hover{border-block-end:var(--qds-control-border-width) solid var(--qds-theme-feedback-action-destructive-hover);color:var(--qds-theme-feedback-action-destructive-hover)}.qds-button[data-importance=subdued-destructive]:active{border-block-end:var(--qds-control-border-width) solid var(--qds-theme-feedback-action-destructive-pressed);color:var(--qds-theme-feedback-action-destructive-pressed)}.qds-button[data-importance=subdued-destructive]:not(.qds-icon-only){border-radius:0}.qds-button.qds-icon-only[data-importance=subdued-destructive]{border:none}.qds-button.qds-icon-only[data-importance=subdued-destructive]:hover{background-color:var(--qds-theme-interactive-background-hover);color:var(--qds-theme-feedback-action-destructive-default)}.qds-button.qds-icon-only[data-importance=subdued-destructive]:active{background-color:var(--qds-theme-interactive-background-pressed);color:var(--qds-theme-feedback-action-destructive-default)}:is([data-action=dropdown],[data-action=dropdown-close]) .qds-action{margin-inline-start:auto;transition-duration:.3s;transition-property:transform}[data-importance=standard]:is([data-action=dropdown],[data-action=dropdown-close]){background-color:var(--qds-theme-control-input-background)}:is([data-action=dropdown],[data-action=dropdown-close]):not([data-importance=subdued]):not([data-importance=subdued-destructive]){padding-inline:var(--qds-control-input-padding-horizontal)}[data-action=dropdown-close] .qds-action{transform:rotate(-180deg)}";
|
|
15
15
|
|
|
@@ -32,7 +32,7 @@ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) ||
|
|
|
32
32
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
33
33
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
34
34
|
};
|
|
35
|
-
var _Button_instances, _Button_savedTabIndex, _Button_button, _Button_span, _Button_ro, _Button_buttonType_get, _Button_iconOnly_get, _Button_computedAction_get, _Button_computedActionIcon_get, _Button_computedDisabled_get, _Button_computedImportance_get, _Button_computedSize_get, _Button_buttonRef, _Button_spanRef, _Button_tooltipRef, _Button_onClick, _Button_defineGetter;
|
|
35
|
+
var _Button_instances, _Button_savedTabIndex, _Button_button, _Button_span, _Button_ro, _Button_buttonType_get, _Button_iconOnly_get, _Button_computedAction_get, _Button_computedActionIcon_get, _Button_computedDisabled_get, _Button_computedImportance_get, _Button_computedSize_get, _Button_buttonRef, _Button_spanRef, _Button_tooltipRef, _Button_onClick, _Button_updateAriaLabel, _Button_defineGetter;
|
|
36
36
|
const isCounter = (value) => typeof value === 'string'
|
|
37
37
|
? !Number.isNaN(Number.parseFloat(value))
|
|
38
38
|
: typeof value === 'number';
|
|
@@ -248,7 +248,7 @@ const Button = /*@__PURE__*/ proxyCustomElement(class Button extends H {
|
|
|
248
248
|
this.host.tabIndex = __classPrivateFieldGet(this, _Button_savedTabIndex, "f");
|
|
249
249
|
}
|
|
250
250
|
textChanged() {
|
|
251
|
-
this
|
|
251
|
+
__classPrivateFieldGet(this, _Button_instances, "m", _Button_updateAriaLabel).call(this);
|
|
252
252
|
if (__classPrivateFieldGet(this, _Button_ro, "f"))
|
|
253
253
|
__classPrivateFieldGet(this, _Button_ro, "f").disconnect();
|
|
254
254
|
if (!__classPrivateFieldGet(this, _Button_span, "f"))
|
|
@@ -281,20 +281,16 @@ const Button = /*@__PURE__*/ proxyCustomElement(class Button extends H {
|
|
|
281
281
|
}
|
|
282
282
|
render() {
|
|
283
283
|
const Tag = this.href === undefined ? 'button' : 'a';
|
|
284
|
-
|
|
285
|
-
const ariaLabel = hasBadgeProperties
|
|
286
|
-
? `${this.text} ${this.badge === true ? '' : this.badge} ${this.badgeDescription}`
|
|
287
|
-
: this.text;
|
|
288
|
-
return (h("div", { key: '84bab3c405ab04b8442bec1be60fdc543d80bba7', class: "qds-container", onClick: __classPrivateFieldGet(this, _Button_onClick, "f"), onKeyDown: preventDefault, onKeyUp: preventDefault, onKeyPress: preventDefault, "aria-hidden": "true" }, h(Tag, { key: 'd60d2a1c636b63fc681dd2f2c30ef3013a2ba3be', class: {
|
|
284
|
+
return (h("div", { key: 'b9180266b07d847e504f8987f9d832d7bb6cf5b8', class: "qds-container", onClick: __classPrivateFieldGet(this, _Button_onClick, "f"), onKeyDown: preventDefault, onKeyUp: preventDefault, onKeyPress: preventDefault, "aria-hidden": "true" }, h(Tag, { key: '1a7ccbbb06f497f5e00845b9d9f6063805e6ead2', class: {
|
|
289
285
|
'qds-button': true,
|
|
290
286
|
'qds-disabled': Tag === 'a' ? __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedDisabled_get) : false,
|
|
291
287
|
'qds-icon-only': __classPrivateFieldGet(this, _Button_instances, "a", _Button_iconOnly_get),
|
|
292
|
-
}, "data-importance": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedImportance_get), "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), "data-action": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedAction_get), disabled: Tag === 'a' ? undefined : this.disabled, download: Tag === 'a' ? this.download : undefined, formAction: this.formAction, formMethod: this.formMethod, formNoValidate: this.formNoValidate, formTarget: this.formTarget, href: Tag === 'a' ? this.href : undefined, name: Tag === 'a' ? undefined : this.name, ref: __classPrivateFieldGet(this, _Button_buttonRef, "f"), rel: Tag === 'a' ? this.rel : undefined, tabIndex: -1, target: Tag === 'a' ? this.target : undefined, type: Tag === 'a' ? undefined : __classPrivateFieldGet(this, _Button_instances, "a", _Button_buttonType_get), value: Tag === 'a' ? undefined : this.value
|
|
288
|
+
}, "data-importance": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedImportance_get), "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), "data-action": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedAction_get), disabled: Tag === 'a' ? undefined : this.disabled, download: Tag === 'a' ? this.download : undefined, formAction: this.formAction, formMethod: this.formMethod, formNoValidate: this.formNoValidate, formTarget: this.formTarget, href: Tag === 'a' ? this.href : undefined, name: Tag === 'a' ? undefined : this.name, ref: __classPrivateFieldGet(this, _Button_buttonRef, "f"), rel: Tag === 'a' ? this.rel : undefined, tabIndex: -1, target: Tag === 'a' ? this.target : undefined, type: Tag === 'a' ? undefined : __classPrivateFieldGet(this, _Button_instances, "a", _Button_buttonType_get), value: Tag === 'a' ? undefined : this.value }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: '6a0284245c64edced6978ef6f8596d87ed1520f7', class: "qds-icon", "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), library: this.iconLibrary, name: this.iconName })), !__classPrivateFieldGet(this, _Button_instances, "a", _Button_iconOnly_get) && (h("span", { key: 'ad6390a7e5aaa80f4557c62c2a15cddc1a5a6831', class: "qds-overflow", "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), ref: __classPrivateFieldGet(this, _Button_spanRef, "f") }, this.text)), isIndicator(this.badge) && (h("qds-badge-indicator", { key: 'd9d6ec7d44da12e76def9133f13ac5df7c9ecf03', class: "qds-indicator", status: this.badgeIndicatorStatus, description: this.badgeDescription, size: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), strokeRing: true })), isCounter(this.badge) && (h("qds-badge-counter", { key: 'a39b114d3c58024ddeb3bd095be6a0ad15c370ca', class: {
|
|
293
289
|
'qds-indicator': __classPrivateFieldGet(this, _Button_instances, "a", _Button_iconOnly_get),
|
|
294
|
-
}, description: this.badgeDescription, importance: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedImportance_get), size: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), strokeRing: true, value: this.badge })), __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedActionIcon_get) !== undefined && (h("qds-icon", { key: '
|
|
290
|
+
}, description: this.badgeDescription, importance: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedImportance_get), size: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), strokeRing: true, value: this.badge })), __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedActionIcon_get) !== undefined && (h("qds-icon", { key: '0d6529b8b3c9b0c2f9a6a193faeccaeece4f1721', class: "qds-icon qds-action", "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), library: "core", name: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedActionIcon_get) }))), h("div", { key: '39a15ade06f8623db7aafe6e726a40d37af0d253', class: {
|
|
295
291
|
'qds-focus-ring': true,
|
|
296
292
|
'qds-icon-only': __classPrivateFieldGet(this, _Button_instances, "a", _Button_iconOnly_get),
|
|
297
|
-
}, "data-importance": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedImportance_get), "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get) }), this.tooltip && (h("qds-tooltip", { key: '
|
|
293
|
+
}, "data-importance": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedImportance_get), "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get) }), this.tooltip && (h("qds-tooltip", { key: 'f0bb82c41cdde61f6e6dd451d0b98265d04b0d2c', ref: __classPrivateFieldGet(this, _Button_tooltipRef, "f") }, this.text))));
|
|
298
294
|
}
|
|
299
295
|
static get formAssociated() { return true; }
|
|
300
296
|
get host() { return this; }
|
|
@@ -396,6 +392,11 @@ _Button_savedTabIndex = new WeakMap(), _Button_button = new WeakMap(), _Button_s
|
|
|
396
392
|
return 'standard';
|
|
397
393
|
}
|
|
398
394
|
}
|
|
395
|
+
}, _Button_updateAriaLabel = function _Button_updateAriaLabel() {
|
|
396
|
+
this.internals.ariaLabel =
|
|
397
|
+
this.badge !== undefined && this.badgeDescription !== undefined
|
|
398
|
+
? `${this.text} ${this.badge === true ? '' : this.badge} ${this.badgeDescription}`
|
|
399
|
+
: this.text;
|
|
399
400
|
}, _Button_defineGetter = function _Button_defineGetter(p, get) {
|
|
400
401
|
Object.defineProperty(this.host, p, { enumerable: true, get });
|
|
401
402
|
};
|
|
@@ -434,6 +435,6 @@ function defineCustomElement() {
|
|
|
434
435
|
}
|
|
435
436
|
|
|
436
437
|
export { Button as B, defineCustomElement as d };
|
|
437
|
-
//# sourceMappingURL=p-
|
|
438
|
+
//# sourceMappingURL=p-BymjThOJ.js.map
|
|
438
439
|
|
|
439
|
-
//# sourceMappingURL=p-
|
|
440
|
+
//# sourceMappingURL=p-BymjThOJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-BymjThOJ.js","mappings":";;;;;;;;;;;;;AAAA,MAAM,SAAS,GAAG,ojSAAojS;;ACAtkS;AACA;AACA;;;;;;;;;;;;;;;;;;AAgCA,MAAM,SAAS,GAAG,CAAC,KAAc,KAC/B,OAAO,KAAK,KAAK;AACf,MAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;AACxC,MAAE,OAAO,KAAK,KAAK,QAAQ;AAE/B,MAAM,WAAW,GAAG,CAAC,KAAc,KACjC,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,IAAI;AAEhC,MAAM,cAAc,GAAG,CAAC,KAAiC,KAAU;IACjE,KAAK,CAAC,cAAc,EAAE;AACxB,CAAC;MAgBY,MAAM,iBAAAA,kBAAA,CAAA,MAAA,MAAA,SAAAC,CAAA,CAAA;AANnB,IAAA,WAAA,GAAA;;;;;;;;AA0BE;;AAEG;AAEa,QAAA,IAAoB,CAAA,oBAAA,GAClC,SAAS;AASX;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAW,SAAS;AAEvD;;AAEG;AACqB,QAAA,IAAU,CAAA,UAAA,GAAsB,UAAU;AAElE;;AAEG;AACqB,QAAA,IAAI,CAAA,IAAA,GAAmB,UAAU;AAOzD;;AAEG;AACqB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAmBjD;;;;;;;;;;;;;;;AAeG;;AAEqB,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,qBAAqB,EAAE;YAC1B,OAAO,IAAI,CAAC,UAAU;;QAExB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,wBAAA,GAAA,SAAA,wBAAA,GAAA;AAGC,IAAA,QAAQ,IAAI,CAAC,IAAI;AACf,QAAA,KAAK,OAAO;AACZ,QAAA,KAAK,OAAO;QACZ,KAAK,MAAM,EAAE;YACX,OAAO,IAAI,CAAC,IAAI;;QAElB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,uBAAA,GAAA,SAAA,uBAAA,GAAA;IA+OC,IAAI,CAAC,SAAS,CAAC,SAAS;QACtB,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,gBAAgB,KAAK;cAClD,CAAG,EAAA,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAI,CAAA,EAAA,IAAI,CAAC,gBAAgB,CAAE;AAClF,cAAE,IAAI,CAAC,IAAI;AACjB,CAAC,EAAA,oBAAA,GAAA,SAAA,oBAAA,CAEa,CAAc,EAAE,GAAkB,EAAA;AAC9C,IAAA,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;AAChE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"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 outline: none;\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:host(:focus-visible) .qds-focus-ring {\n visibility: visible;\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\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 readTask,\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\nconst preventDefault = (event: KeyboardEvent | MouseEvent): void => {\n event.preventDefault()\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: 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!: HTMLElement\n\n @State() private tooltip = false\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #savedTabIndex = 0\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('blur')\n protected onBlur(event: FocusEvent): void {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\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 @Listen('focus')\n protected onFocus(event: FocusEvent): void {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n @Listen('keydown')\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Enter') this.host.click()\n }\n\n @Listen('keyup')\n protected onKeyup(event: KeyboardEvent): void {\n if (event.key === ' ') this.host.click()\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.internals.ariaDisabled = this.#computedDisabled.toString()\n if (this.#computedDisabled) this.host.removeAttribute('tabindex')\n else this.host.tabIndex = this.#savedTabIndex\n }\n\n @Watch('href')\n protected hrefChanged(): void {\n this.internals.role = this.href === undefined ? 'button' : 'link'\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string | null): void {\n if (newValue !== null) {\n const parsedValue = Number.parseInt(newValue, 10)\n this.#savedTabIndex =\n Number.isNaN(parsedValue) || !Number.isFinite(parsedValue)\n ? 0\n : parsedValue\n }\n if (this.#computedDisabled) this.host.removeAttribute('tabindex')\n else this.host.tabIndex = this.#savedTabIndex\n }\n\n @Watch('text')\n protected textChanged(): void {\n this.#updateAriaLabel()\n\n if (this.#ro) this.#ro.disconnect()\n if (!this.#span) return\n\n const span = this.#span\n readTask(() => {\n this.tooltip = isOverflowing(span)\n })\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.#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.hrefChanged()\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n this.disabledChanged()\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\n return (\n <div\n class=\"qds-container\"\n onClick={this.#onClick}\n onKeyDown={preventDefault}\n onKeyUp={preventDefault}\n onKeyPress={preventDefault}\n aria-hidden=\"true\"\n >\n <Tag\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 ref={this.#buttonRef}\n rel={Tag === 'a' ? this.rel : undefined}\n tabIndex={-1}\n target={Tag === 'a' ? this.target : undefined}\n type={Tag === 'a' ? undefined : this.#buttonType}\n value={Tag === 'a' ? undefined : this.value}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\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 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 ref={this.#tooltipRef}>{this.text}</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 #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.host\n }\n\n readonly #onClick = (event: MouseEvent): void => {\n if (this.#computedDisabled) {\n preventDefault(event)\n event.stopImmediatePropagation()\n }\n }\n\n #updateAriaLabel(): void {\n this.internals.ariaLabel =\n this.badge !== undefined && this.badgeDescription !== undefined\n ? `${this.text} ${this.badge === true ? '' : this.badge} ${this.badgeDescription}`\n : this.text\n }\n\n #defineGetter(p: PropertyKey, get: () => unknown): void {\n Object.defineProperty(this.host, p, { enumerable: true, get })\n }\n}\n"],"version":3}
|
|
@@ -166,22 +166,12 @@ const isOverflowing = (element) => {
|
|
|
166
166
|
const { clientHeight, clientWidth, scrollHeight, scrollWidth } = element;
|
|
167
167
|
return scrollHeight > clientHeight + 1 || scrollWidth > clientWidth;
|
|
168
168
|
};
|
|
169
|
-
const determineLinkIcon = (
|
|
170
|
-
|
|
169
|
+
const determineLinkIcon = (target,
|
|
170
|
+
// eslint-disable-next-line unicorn/prevent-abbreviations
|
|
171
|
+
rel) => {
|
|
172
|
+
if (!(rel?.split(' ') ?? []).includes('external'))
|
|
171
173
|
return undefined;
|
|
172
|
-
|
|
173
|
-
try {
|
|
174
|
-
link = new URL(href, globalThis.location.href);
|
|
175
|
-
}
|
|
176
|
-
catch {
|
|
177
|
-
return undefined;
|
|
178
|
-
}
|
|
179
|
-
const isExternalLink = link.origin !== globalThis.location.origin &&
|
|
180
|
-
(link.protocol === 'http:' || link.protocol === 'https:');
|
|
181
|
-
const opensInNewTab = target === '_blank';
|
|
182
|
-
if (isExternalLink)
|
|
183
|
-
return opensInNewTab ? 'external-new-tab-link' : 'external-link';
|
|
184
|
-
return undefined;
|
|
174
|
+
return target === '_blank' ? 'external-new-tab-link' : 'external-link';
|
|
185
175
|
};
|
|
186
176
|
const resolveTarget = (target) => {
|
|
187
177
|
const resolvedTarget = typeof target === 'function' ? target() : target;
|
|
@@ -208,6 +198,6 @@ function resolvePanelElement(tab) {
|
|
|
208
198
|
}
|
|
209
199
|
|
|
210
200
|
export { isOverflowing as a, inheritAriaAttributes as b, pickInputEventAttributes as c, determineLinkIcon as d, ignorePromise as e, propertyToPx as f, roundByDPR as g, resolvePanelElement as h, invariant as i, isTouchDevice as j, pickFocusEventAttributes as p, resolveTarget as r };
|
|
211
|
-
//# sourceMappingURL=p-
|
|
201
|
+
//# sourceMappingURL=p-CLO9W_LH.js.map
|
|
212
202
|
|
|
213
|
-
//# sourceMappingURL=p-
|
|
203
|
+
//# sourceMappingURL=p-CLO9W_LH.js.map
|