@quartzds/core 1.0.0-beta.121 → 1.0.0-beta.122
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-CURs27Ur.js → p-BalM52S_.js} +3 -3
- package/components/{p-CURs27Ur.js.map → p-BalM52S_.js.map} +1 -1
- package/components/{p-CkyaV9az.js → p-C0VgKX4J.js} +9 -9
- package/components/p-C0VgKX4J.js.map +1 -0
- package/components/{p-DtxwXYGb.js → p-C9R8N06B.js} +5 -31
- package/components/p-C9R8N06B.js.map +1 -0
- package/components/{p-DR79BVX5.js → p-CKp062X8.js} +6 -6
- package/components/p-CKp062X8.js.map +1 -0
- package/components/{p-CjVnGhSO.js → p-CVuTVnQo.js} +3 -3
- package/components/{p-CjVnGhSO.js.map → p-CVuTVnQo.js.map} +1 -1
- package/components/{p-CkUTS1aU.js → p-Ck9w5WIb.js} +6 -6
- package/components/p-Ck9w5WIb.js.map +1 -0
- package/components/p-DCAlWquR.js +200 -0
- package/components/p-DCAlWquR.js.map +1 -0
- package/components/{p-DNHI4C-W.js → p-DRcxeXWE.js} +58 -22
- package/components/p-DRcxeXWE.js.map +1 -0
- package/components/{p-B2ZVUvk9.js → p-DgYrfIr_.js} +5 -5
- package/components/{p-B2ZVUvk9.js.map → p-DgYrfIr_.js.map} +1 -1
- package/components/{p-CDRwHAIT.js → p-XP2CY_fo.js} +3 -3
- package/components/p-XP2CY_fo.js.map +1 -0
- package/components/{p-C1c4JVlg.js → p-io1iVgY1.js} +47 -28
- package/components/p-io1iVgY1.js.map +1 -0
- package/components/{p-D82sb4oJ.js → p-oqmnh-8P.js} +4 -4
- package/components/{p-D82sb4oJ.js.map → p-oqmnh-8P.js.map} +1 -1
- package/components/{p-5dwtV5iH.js → p-yb0Kv4Y6.js} +24 -6
- package/components/p-yb0Kv4Y6.js.map +1 -0
- package/components/qds-action-item.js +4 -4
- package/components/qds-action-item.js.map +1 -1
- package/components/qds-avatar-media.js +1 -1
- package/components/qds-badge-counter.js +1 -1
- package/components/qds-breadcrumb-item.js +5 -5
- package/components/qds-breadcrumb-item.js.map +1 -1
- package/components/qds-button.js +5 -5
- package/components/qds-button.js.map +1 -1
- package/components/qds-checkbox.js +1 -1
- package/components/qds-chip.js +9 -9
- package/components/qds-chip.js.map +1 -1
- package/components/qds-dialog.js +6 -6
- 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-form-message.js.map +1 -1
- package/components/qds-icon-button.js +1 -1
- package/components/qds-icon-tab.js +8 -8
- package/components/qds-icon.js +1 -1
- package/components/qds-inline-link.js +4 -4
- package/components/qds-inline-link.js.map +1 -1
- package/components/qds-input.js +17 -13
- package/components/qds-input.js.map +1 -1
- package/components/qds-label.js +153 -1
- package/components/qds-label.js.map +1 -1
- package/components/qds-list-item.js +25 -29
- package/components/qds-list-item.js.map +1 -1
- package/components/qds-loader.js +2 -2
- package/components/qds-loader.js.map +1 -1
- package/components/qds-menu-item.js +6 -6
- package/components/qds-mini-button.js +1 -1
- package/components/qds-progress-bar.js +1 -1
- package/components/qds-radio.js +1 -1
- package/components/qds-select.js +6 -6
- package/components/qds-select.js.map +1 -1
- package/components/qds-standalone-link.js +5 -5
- package/components/qds-standalone-link.js.map +1 -1
- package/components/qds-switch.js +5 -5
- package/components/qds-tab.js +20 -15
- package/components/qds-tab.js.map +1 -1
- package/components/qds-tabbar.js +95 -34
- package/components/qds-tabbar.js.map +1 -1
- package/components/qds-table-cell.js +32 -4
- package/components/qds-table-cell.js.map +1 -1
- package/components/qds-table-head-cell.js +32 -4
- package/components/qds-table-head-cell.js.map +1 -1
- package/components/qds-table-row.js +2 -2
- package/components/qds-table-row.js.map +1 -1
- package/components/qds-table.js +1 -1
- package/components/qds-tag.js +1 -1
- package/components/qds-textarea.js +4 -4
- package/components/qds-textarea.js.map +1 -1
- package/components/qds-title.js +1 -1
- package/components/qds-tooltip.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/qds-action-item.cjs.entry.js +1 -1
- package/dist/cjs/qds-action-item.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-avatar-media.qds-checkbox.qds-radio.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-avatar-media_3.cjs.entry.js +144 -41
- package/dist/cjs/qds-badge-counter.qds-badge-indicator.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-badge-counter_2.cjs.entry.js +1 -1
- package/dist/cjs/qds-breadcrumb-item.cjs.entry.js +2 -2
- package/dist/cjs/qds-breadcrumb-item.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-button.cjs.entry.js +1 -1
- package/dist/cjs/qds-button.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-chip.cjs.entry.js +5 -5
- package/dist/cjs/qds-chip.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-dialog.cjs.entry.js +1 -1
- package/dist/cjs/qds-divider.qds-icon-button.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-divider_2.cjs.entry.js +4 -4
- package/dist/cjs/qds-dropdown.cjs.entry.js +21 -3
- package/dist/cjs/qds-dropdown.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-form-message.cjs.entry.js +2 -2
- package/dist/cjs/qds-form-message.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-icon-tab.cjs.entry.js +3 -3
- package/dist/cjs/qds-icon.cjs.entry.js +9 -29
- package/dist/cjs/qds-icon.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-inline-link.cjs.entry.js +2 -2
- package/dist/cjs/qds-inline-link.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-input.cjs.entry.js +14 -10
- package/dist/cjs/qds-input.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-label.cjs.entry.js +2 -2
- package/dist/cjs/qds-list-item.cjs.entry.js +6 -4
- package/dist/cjs/qds-list-item.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-loader.cjs.entry.js +1 -1
- package/dist/cjs/qds-loader.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/qds-mini-button.cjs.entry.js +1 -1
- 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-select.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-standalone-link.cjs.entry.js +3 -3
- package/dist/cjs/qds-standalone-link.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-switch.cjs.entry.js +3 -3
- package/dist/cjs/qds-tab.cjs.entry.js +15 -10
- package/dist/cjs/qds-tab.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-tabbar.cjs.entry.js +83 -27
- package/dist/cjs/qds-tabbar.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-table-cell.cjs.entry.js +30 -3
- package/dist/cjs/qds-table-cell.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-table-head-cell.cjs.entry.js +30 -3
- package/dist/cjs/qds-table-head-cell.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-table-row.cjs.entry.js +2 -2
- package/dist/cjs/qds-table-row.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-table.cjs.entry.js +1 -1
- package/dist/cjs/qds-tag.cjs.entry.js +2 -2
- package/dist/cjs/qds-tag.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-textarea.cjs.entry.js +3 -3
- package/dist/cjs/qds-textarea.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-title.cjs.entry.js +3 -3
- package/dist/cjs/qds-title.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/qds.cjs.js +1 -1
- package/dist/custom-elements.json +365 -30
- package/dist/docs.json +319 -63
- package/dist/esm/{helpers-eFD8hV6J.js → helpers-Fe2AA6uo.js} +3 -3
- package/dist/esm/{helpers-eFD8hV6J.js.map → helpers-Fe2AA6uo.js.map} +1 -1
- 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-avatar-media.qds-checkbox.qds-radio.entry.js.map +1 -1
- package/dist/esm/qds-avatar-media_3.entry.js +146 -43
- package/dist/esm/qds-badge-counter.qds-badge-indicator.entry.js.map +1 -1
- package/dist/esm/qds-badge-counter_2.entry.js +1 -1
- package/dist/esm/qds-breadcrumb-item.entry.js +3 -3
- package/dist/esm/qds-breadcrumb-item.entry.js.map +1 -1
- package/dist/esm/qds-button.entry.js +2 -2
- package/dist/esm/qds-button.entry.js.map +1 -1
- package/dist/esm/qds-chip.entry.js +6 -6
- package/dist/esm/qds-chip.entry.js.map +1 -1
- package/dist/esm/qds-dialog.entry.js +2 -2
- package/dist/esm/qds-divider.qds-icon-button.entry.js.map +1 -1
- package/dist/esm/qds-divider_2.entry.js +5 -5
- package/dist/esm/qds-dropdown.entry.js +22 -4
- package/dist/esm/qds-dropdown.entry.js.map +1 -1
- package/dist/esm/qds-form-message.entry.js +3 -3
- package/dist/esm/qds-form-message.entry.js.map +1 -1
- package/dist/esm/qds-icon-tab.entry.js +4 -4
- package/dist/esm/qds-icon.entry.js +10 -30
- package/dist/esm/qds-icon.entry.js.map +1 -1
- package/dist/esm/qds-inline-link.entry.js +3 -3
- package/dist/esm/qds-inline-link.entry.js.map +1 -1
- package/dist/esm/qds-input.entry.js +15 -11
- package/dist/esm/qds-input.entry.js.map +1 -1
- package/dist/esm/qds-label.entry.js +3 -3
- package/dist/esm/qds-list-item.entry.js +7 -5
- package/dist/esm/qds-list-item.entry.js.map +1 -1
- package/dist/esm/qds-loader.entry.js +1 -1
- package/dist/esm/qds-loader.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-progress-bar.entry.js +1 -1
- package/dist/esm/qds-select.entry.js +5 -5
- package/dist/esm/qds-select.entry.js.map +1 -1
- package/dist/esm/qds-standalone-link.entry.js +4 -4
- package/dist/esm/qds-standalone-link.entry.js.map +1 -1
- package/dist/esm/qds-switch.entry.js +4 -4
- package/dist/esm/qds-tab.entry.js +16 -11
- package/dist/esm/qds-tab.entry.js.map +1 -1
- package/dist/esm/qds-tabbar.entry.js +84 -28
- package/dist/esm/qds-tabbar.entry.js.map +1 -1
- package/dist/esm/qds-table-cell.entry.js +30 -3
- package/dist/esm/qds-table-cell.entry.js.map +1 -1
- package/dist/esm/qds-table-head-cell.entry.js +30 -3
- package/dist/esm/qds-table-head-cell.entry.js.map +1 -1
- package/dist/esm/qds-table-row.entry.js +2 -2
- package/dist/esm/qds-table-row.entry.js.map +1 -1
- package/dist/esm/qds-table.entry.js +1 -1
- package/dist/esm/qds-tag.entry.js +3 -3
- package/dist/esm/qds-tag.entry.js.map +1 -1
- package/dist/esm/qds-textarea.entry.js +4 -4
- package/dist/esm/qds-textarea.entry.js.map +1 -1
- package/dist/esm/qds-title.entry.js +3 -3
- package/dist/esm/qds-title.entry.js.map +1 -1
- package/dist/esm/qds-tooltip.entry.js +2 -2
- package/dist/esm/qds.js +1 -1
- package/dist/types/components/avatar-media/avatar-media.d.ts +14 -5
- package/dist/types/components/checkbox/checkbox.d.ts +4 -0
- package/dist/types/components/icon/icon.d.ts +1 -2
- package/dist/types/components/radio/radio.d.ts +4 -0
- package/dist/types/components/tab/tab.d.ts +1 -1
- package/dist/types/components/tabbar/tabbar.d.ts +27 -1
- package/dist/types/components/table-cell/table-cell.d.ts +6 -0
- package/dist/types/components/table-head-cell/table-head-cell.d.ts +6 -0
- package/dist/types/components.d.ts +72 -15
- package/dist/vscode.html-custom-data.json +79 -4
- package/hydrate/index.js +962 -732
- package/hydrate/index.mjs +962 -732
- package/package.json +1 -1
- package/styles/core.css +24 -22
- package/components/p-5dwtV5iH.js.map +0 -1
- package/components/p-C1c4JVlg.js.map +0 -1
- package/components/p-CDRwHAIT.js.map +0 -1
- package/components/p-CkUTS1aU.js.map +0 -1
- package/components/p-CkyaV9az.js.map +0 -1
- package/components/p-D9pW936J.js +0 -164
- package/components/p-D9pW936J.js.map +0 -1
- package/components/p-DNHI4C-W.js.map +0 -1
- package/components/p-DR79BVX5.js.map +0 -1
- package/components/p-DtxwXYGb.js.map +0 -1
- package/components/p-laE-pGH7.js +0 -163
- package/components/p-laE-pGH7.js.map +0 -1
package/package.json
CHANGED
package/styles/core.css
CHANGED
|
@@ -318,8 +318,10 @@
|
|
|
318
318
|
background-color: var(--qds-theme-popup-background);
|
|
319
319
|
border-radius: var(--qds-popup-border-radius);
|
|
320
320
|
box-shadow: var(--qds-popup-elevation);
|
|
321
|
-
padding: var(--qds-popup-padding-top)
|
|
322
|
-
var(--qds-popup-
|
|
321
|
+
padding: var(--qds-popup-subsection-padding-top)
|
|
322
|
+
var(--qds-popup-subsection-padding-end)
|
|
323
|
+
var(--qds-popup-subsection-padding-bottom)
|
|
324
|
+
var(--qds-popup-subsection-padding-start);
|
|
323
325
|
}
|
|
324
326
|
|
|
325
327
|
.qds-popup,
|
|
@@ -464,22 +466,22 @@
|
|
|
464
466
|
}
|
|
465
467
|
|
|
466
468
|
.qds-control-group-inline > :first-child:not(:only-child) {
|
|
467
|
-
--qds-
|
|
468
|
-
--qds-
|
|
469
|
-
--qds-
|
|
469
|
+
--qds-form-input-border-radius-top-right: 0px;
|
|
470
|
+
--qds-form-input-border-radius-bottom-right: 0px;
|
|
471
|
+
--qds-form-input-border-width-inline-end: 0px;
|
|
470
472
|
}
|
|
471
473
|
|
|
472
474
|
.qds-control-group-inline > :not(:first-child, :last-child) {
|
|
473
|
-
--qds-
|
|
474
|
-
--qds-
|
|
475
|
-
--qds-
|
|
476
|
-
--qds-
|
|
477
|
-
--qds-
|
|
475
|
+
--qds-form-input-border-radius-top-left: 0px;
|
|
476
|
+
--qds-form-input-border-radius-top-right: 0px;
|
|
477
|
+
--qds-form-input-border-radius-bottom-right: 0px;
|
|
478
|
+
--qds-form-input-border-radius-bottom-left: 0px;
|
|
479
|
+
--qds-form-input-border-width-inline-end: 0px;
|
|
478
480
|
}
|
|
479
481
|
|
|
480
482
|
.qds-control-group-inline > :last-child:not(:only-child) {
|
|
481
|
-
--qds-
|
|
482
|
-
--qds-
|
|
483
|
+
--qds-form-input-border-radius-top-left: 0px;
|
|
484
|
+
--qds-form-input-border-radius-bottom-left: 0px;
|
|
483
485
|
}
|
|
484
486
|
|
|
485
487
|
.qds-control-group-block {
|
|
@@ -488,20 +490,20 @@
|
|
|
488
490
|
}
|
|
489
491
|
|
|
490
492
|
.qds-control-group-block > :first-child:not(:only-child) {
|
|
491
|
-
--qds-
|
|
492
|
-
--qds-
|
|
493
|
-
--qds-
|
|
493
|
+
--qds-form-input-border-radius-bottom-left: 0px;
|
|
494
|
+
--qds-form-input-border-radius-bottom-right: 0px;
|
|
495
|
+
--qds-form-input-border-width-block-end: 0px;
|
|
494
496
|
}
|
|
495
497
|
|
|
496
498
|
.qds-control-group-block > :not(:first-child, :last-child) {
|
|
497
|
-
--qds-
|
|
498
|
-
--qds-
|
|
499
|
-
--qds-
|
|
500
|
-
--qds-
|
|
501
|
-
--qds-
|
|
499
|
+
--qds-form-input-border-radius-top-left: 0px;
|
|
500
|
+
--qds-form-input-border-radius-top-right: 0px;
|
|
501
|
+
--qds-form-input-border-radius-bottom-right: 0px;
|
|
502
|
+
--qds-form-input-border-radius-bottom-left: 0px;
|
|
503
|
+
--qds-form-input-border-width-block-end: 0px;
|
|
502
504
|
}
|
|
503
505
|
|
|
504
506
|
.qds-control-group-block > :last-child:not(:only-child) {
|
|
505
|
-
--qds-
|
|
506
|
-
--qds-
|
|
507
|
+
--qds-form-input-border-radius-top-left: 0px;
|
|
508
|
+
--qds-form-input-border-radius-top-right: 0px;
|
|
507
509
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-5dwtV5iH.js","mappings":";;;;;;;;;AAAA,MAAM,WAAW,GAAG,4RAA4R;;ACAhT;AACA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CAAC,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC;AAE5C,IAAA,IAAI,EAAE,sBAAA,CAAA,IAAI,kCAAkB,YAAY,UAAU,CAAC,OAAO,CAAC;QAAE;IAE7D,sBAAA,CAAA,IAAI,EAAkB,0BAAA,EAAA,GAAA,CAAA,CAAC,mBAAmB,CACxC,UAAU,EACV,sBAAA,CAAA,IAAI,EAAiB,yBAAA,EAAA,GAAA,CAAA,CACtB;IACD,sBAAA,CAAA,IAAI,EAAkB,0BAAA,EAAA,GAAA,CAAA,CAAC,mBAAmB,CAAC,SAAS,EAAE,sBAAA,CAAA,IAAI,EAAgB,wBAAA,EAAA,GAAA,CAAA,CAAC;AAC3E,IAAA,sBAAA,CAAA,IAAI,EAAkB,0BAAA,EAAA,GAAA,CAAA,CAAC,eAAe,CAAC,eAAe,CAAC;AACvD,IAAA,sBAAA,CAAA,IAAI,EAAkB,0BAAA,EAAA,GAAA,CAAA,CAAC,eAAe,CAAC,eAAe,CAAC;AACzD,CAAC;;;;;;;;;;;;;;;;;","names":["HTMLElement","__stencil_proxyCustomElement"],"sources":["src/components/dropdown/dropdown.css?tag=qds-dropdown&encapsulation=shadow","src/components/dropdown/dropdown.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 background-color: var(--qds-theme-popup-background);\n border-radius: var(--qds-popup-border-radius);\n border: none;\n box-shadow: var(--qds-popup-elevation);\n box-sizing: border-box;\n display: inline-block;\n inset: unset;\n margin: 0;\n overflow: initial;\n padding: 0;\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type {\n AutoUpdateOptions,\n DetectOverflowOptions,\n FlipOptions,\n Middleware,\n Placement,\n ReferenceElement,\n ShiftOptions,\n Strategy,\n} from '@floating-ui/dom'\nimport {\n autoUpdate,\n computePosition,\n flip,\n limitShift,\n offset,\n shift,\n} from '@floating-ui/dom'\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Host,\n Listen,\n Method,\n Prop,\n Watch,\n} from '@stencil/core'\n\nimport type { OffsetOptions } from '../../helpers'\nimport {\n closestElement,\n ignorePromise,\n propertyToPx,\n resolveTarget,\n VERTICAL_MOVE_KEYS,\n} from '../../helpers'\n\nlet autoIncrementingId = 1\n\nconst isQdsButton = (\n element: globalThis.Element,\n): element is HTMLQdsButtonElement =>\n element.tagName.toLowerCase() === 'qds-button'\n\nconst ALLOWED_TAGS: ReadonlySet<string> = new Set([\n 'qds-action-item',\n 'qds-menu-item',\n 'qds-list-item',\n])\n\nconst isEnabledItem = (element: unknown): element is HTMLElement =>\n element instanceof HTMLElement &&\n ALLOWED_TAGS.has(element.tagName.toLowerCase()) &&\n !element.hasAttribute('disabled') &&\n !element.inert\n\n/**\n * @slot Content to display in the dropdown.\n * @see https://quartz.se.com/build/components/dropdown\n */\n@Component({\n tag: 'qds-dropdown',\n shadow: { delegatesFocus: true },\n styleUrl: 'dropdown.css',\n})\nexport class Dropdown implements ComponentInterface {\n /**\n * Options to pass to Floating UI's\n * [`autoUpdate()` function](https://floating-ui.com/docs/autoUpdate).\n *\n * @see https://floating-ui.com/docs/autoupdate#options\n */\n @Prop() public readonly autoUpdateOptions?: AutoUpdateOptions\n\n /**\n * Prevents the dropdown from being shown by user interaction. The dropdown\n * can still be displayed by calling the `show()` method.\n */\n @Prop() public readonly disabled: boolean = false\n\n /**\n * Options to pass to Floating UI's\n * [`flip` middleware](https://floating-ui.com/docs/flip).\n *\n * The [`crossAxis` option](https://floating-ui.com/docs/flip#crossaxis) is\n * set to the value of the `noShift` property by default for interoperability\n * with the [`shift` middleware](https://floating-ui.com/docs/shift).\n *\n * @see https://floating-ui.com/docs/flip#options\n */\n @Prop() public readonly flipOptions?: Partial<\n DetectOverflowOptions & FlipOptions\n >\n\n /**\n * Disable Floating UI's\n * [`flip` middleware](https://floating-ui.com/docs/flip).\n */\n @Prop() public readonly noFlip: boolean = false\n\n /**\n * Disable Floating UI's\n * [`shift` middleware](https://floating-ui.com/docs/shift).\n */\n @Prop() public readonly noShift: boolean = false\n\n /**\n * Options to pass to Floating UI's\n * [`offset` middleware](https://floating-ui.com/docs/offset).\n *\n * The [`mainAxis` option](https://floating-ui.com/docs/offset#mainaxis) is\n * not supported.\n *\n * @see https://floating-ui.com/docs/offset#options\n */\n @Prop() public readonly offsetOptions?: OffsetOptions\n\n /**\n * Where to place the dropdown relative to the `target`.\n *\n * @see https://floating-ui.com/docs/tutorial#placements\n */\n @Prop() public readonly placement: Placement = 'bottom-start'\n\n /**\n * Options to pass to Floating UI's\n * [`shift` middleware](https://floating-ui.com/docs/shift).\n *\n * @see https://floating-ui.com/docs/shift#options\n */\n @Prop() public readonly shiftOptions?: Partial<\n DetectOverflowOptions & ShiftOptions\n >\n\n /**\n * The CSS position strategy to use.\n *\n * @see https://floating-ui.com/docs/computeposition#strategy\n */\n @Prop() public readonly strategy?: Strategy\n\n /**\n * The trigger element that will trigger the dropdown. The target specified\n * can be any of the following:\n *\n * - A CSS selector string\n * - A reference to an [`Element`][] or [Virtual Element][]\n * - A function returning a reference to an [`Element`][],\n * [Virtual Element][], or a CSS selector string\n *\n * [`Element`]: https://developer.mozilla.org/docs/Web/API/Element\n * [Virtual Element]: https://floating-ui.com/docs/virtual-elements\n */\n @Prop() public readonly target!:\n | ReferenceElement\n | string\n | (() => ReferenceElement | string)\n\n /**\n * By default, the dropdown is closed when an item is selected. This attribute will keep it open instead. Useful for\n * dropdowns that allow for multiple interactions.\n */\n @Prop() public readonly keepOpenOnSelect: boolean = false\n\n /**\n * Emitted when the user instructs the browser that they wish to dismiss the\n * current open dropdown by pressing the `Esc` key.\n *\n * When a dropdown is dismissed with the `Esc` key, both the `qdsCancel` and\n * `qdsClose` events are emitted.\n */\n @Event({ eventName: 'qdsCancel', bubbles: false })\n private readonly cancelEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the dropdown is closed.\n */\n @Event({ eventName: 'qdsClose', bubbles: false, cancelable: false })\n private readonly closeEmitter!: EventEmitter<void>\n\n @Element() private readonly host!: HTMLElement\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #cleanup?: () => void\n\n #Items: HTMLElement[] = []\n\n #gap = 0\n\n #middleware?: (Middleware | false)[]\n\n #referenceElement?: ReferenceElement\n\n #open = false\n\n /**\n * Whether the dropdown has been opened at least once.\n * This is used to determine whether the dropdown should update its position, gap\n * and middleware when it is opened.\n */\n #opened = false\n\n /**\n * Updates the gap between the dropdown and its target element.\n */\n @Method()\n public async updateGap(): Promise<void> {\n this.#gap = propertyToPx(this.host, '--qds-accessory-gap-floating') ?? 0\n\n await this.updateMiddleware()\n }\n\n /**\n * Shows the dropdown.\n */\n @Method()\n public async show(): Promise<void> {\n if (this.#open) return\n\n const reference = this.#referenceElement\n const { host } = this\n\n if (reference instanceof globalThis.Element) {\n reference.setAttribute('aria-expanded', 'true')\n reference.setAttribute('aria-controls', host.id)\n host.setAttribute('aria-labelledby', reference.id)\n if (!reference.hasAttribute('aria-haspopup'))\n reference.setAttribute('aria-haspopup', 'true')\n\n if (isQdsButton(reference) && reference.action === 'dropdown')\n reference.action = 'dropdown-close'\n }\n\n if (!this.#opened) {\n await this.updateGap()\n this.#opened = true\n }\n this.startAutoUpdate()\n this.#open = true\n host.hidden = false\n host.showPopover()\n }\n\n /**\n * Closes the dropdown.\n */\n @Method()\n public async close(): Promise<void> {\n if (!this.#open) return\n\n if (this.#referenceElement instanceof globalThis.Element) {\n this.#referenceElement.setAttribute('aria-expanded', 'false')\n this.#referenceElement.removeAttribute('aria-controls')\n\n if (\n isQdsButton(this.#referenceElement) &&\n this.#referenceElement.action === 'dropdown-close'\n )\n this.#referenceElement.action = 'dropdown'\n }\n\n if (this.#cleanup) this.#cleanup()\n this.#open = false\n this.host.hidden = true\n this.host.hidePopover()\n\n this.closeEmitter.emit()\n }\n\n @Listen('click', { target: 'document' })\n protected async handleMouseDown(event: MouseEvent): Promise<void> {\n if (!this.#open) return\n\n const composedPath = event.composedPath()\n const withinBounds =\n composedPath.includes(this.host) ||\n (this.#referenceElement instanceof globalThis.Element &&\n composedPath.includes(this.#referenceElement))\n if (!withinBounds) await this.close()\n }\n\n @Listen('click')\n protected async onItemClick(event: MouseEvent): Promise<void> {\n if (!this.keepOpenOnSelect && isEnabledItem(event.target)) {\n await this.close()\n }\n }\n\n @Watch('target')\n private async updateReferenceElement(): Promise<void> {\n this.#disconnectReferenceElement()\n\n this.#referenceElement = resolveTarget(this.target)\n\n if (!(this.#referenceElement instanceof globalThis.Element)) return\n\n this.#referenceElement.setAttribute('aria-expanded', 'false')\n this.#referenceElement.addEventListener(\n 'click',\n this.#boundOnReferenceClick,\n )\n this.#referenceElement.addEventListener('focusout', this.#boundOnFocusout)\n this.#referenceElement.addEventListener('keydown', this.#boundOnKeydown)\n\n if (this.host.role === 'menu') {\n this.#referenceElement.id ||= `qds-dropdown-trigger-${autoIncrementingId}`\n this.host.setAttribute('aria-labelledby', this.#referenceElement.id)\n }\n }\n\n @Watch('flipOptions')\n @Watch('noFlip')\n @Watch('noShift')\n @Watch('offsetOptions')\n @Watch('shiftOptions')\n private async updateMiddleware(): Promise<void> {\n this.#middleware = [\n offset({\n ...this.offsetOptions,\n mainAxis: this.#gap,\n }),\n !this.noFlip &&\n flip({\n crossAxis: this.noShift,\n ...this.flipOptions,\n }),\n !this.noShift &&\n shift({\n limiter: limitShift(),\n ...this.shiftOptions,\n }),\n ]\n }\n\n @Watch('middleware')\n @Watch('placement')\n @Watch('strategy')\n private async updatePosition(): Promise<void> {\n if (!this.#referenceElement) return\n\n const { x, y, strategy } = await computePosition(\n this.#referenceElement,\n this.host,\n {\n middleware: this.#middleware,\n placement: this.placement,\n strategy: this.strategy,\n },\n )\n Object.assign(this.host.style, {\n position: strategy,\n left: `${x}px`,\n top: `${y}px`,\n })\n }\n\n @Watch('autoUpdateOptions')\n private startAutoUpdate(): void {\n if (!this.#referenceElement) return\n\n if (this.#cleanup) this.#cleanup()\n this.#cleanup = autoUpdate(\n this.#referenceElement,\n this.host,\n () => {\n ignorePromise(this.updatePosition())\n },\n this.autoUpdateOptions,\n )\n }\n\n public async componentWillLoad(): Promise<void> {\n this.host.hidden = true\n this.host.popover = 'manual'\n this.internals.role = 'menu'\n this.host.id ||= `qds-dropdown-${autoIncrementingId}`\n await this.updateReferenceElement()\n autoIncrementingId += 1\n }\n\n public disconnectedCallback(): void {\n this.#disconnectReferenceElement()\n }\n\n public render() {\n return (\n <Host onKeyDown={this.#onKeydown} onFocusout={this.#onFocusout}>\n <slot onSlotchange={this.#onSlotchange} />\n </Host>\n )\n }\n\n readonly #onFocusout = async (event: Event): Promise<void> => {\n if (!(event instanceof FocusEvent)) return\n const { relatedTarget } = event\n\n const dropdownItem = this.#Items.find((item) => item === relatedTarget)\n if (\n relatedTarget instanceof globalThis.Element &&\n !this.host.contains(relatedTarget) &&\n this.#referenceElement !== relatedTarget &&\n !dropdownItem\n )\n await this.close()\n }\n\n #focusOnTrigger(): void {\n if (\n this.#referenceElement instanceof globalThis.HTMLElement ||\n this.#referenceElement instanceof globalThis.SVGElement\n ) {\n this.#referenceElement.focus()\n }\n }\n\n readonly #onKeydown = async (event: Event): Promise<void> => {\n if (!(event instanceof KeyboardEvent)) return\n\n const { key, target } = event\n\n if (key === 'Enter' && !this.keepOpenOnSelect && isEnabledItem(target)) {\n await this.close()\n this.#focusOnTrigger()\n return\n }\n\n if (\n key === 'Escape' &&\n (target === this.#referenceElement ||\n (target instanceof globalThis.Element &&\n closestElement('qds-dropdown', target) === this.host))\n ) {\n const cancelEvent = this.cancelEmitter.emit()\n if (cancelEvent.defaultPrevented) return\n\n await this.close()\n this.#focusOnTrigger()\n\n return\n }\n\n if (\n target === this.#referenceElement &&\n (key === 'ArrowDown' || key === 'ArrowUp')\n ) {\n if (!this.#open) await this.show()\n this.#focusFirstItem()\n event.preventDefault()\n return\n }\n\n if (!VERTICAL_MOVE_KEYS.has(key)) return\n\n const Items = this.#Items.filter(\n (item: HTMLElement) =>\n isEnabledItem(item) &&\n closestElement('qds-dropdown', item) === this.host,\n )\n\n if (Items.length === 0) return\n\n event.preventDefault()\n event.stopPropagation()\n\n const currentIndex = Items.findIndex(\n (item: HTMLElement) => item.getAttribute('tabindex') === '0',\n )\n\n let nextIndex = currentIndex\n\n switch (key) {\n case 'ArrowUp': {\n nextIndex = currentIndex > 0 ? currentIndex - 1 : Items.length - 1\n break\n }\n case 'ArrowDown': {\n nextIndex = currentIndex < Items.length - 1 ? currentIndex + 1 : 0\n break\n }\n case 'Home': {\n nextIndex = 0\n break\n }\n case 'End': {\n nextIndex = Items.length - 1\n break\n }\n default: {\n return\n }\n }\n const nextItem = Items[nextIndex]\n for (const [index, item] of Items.entries()) {\n ;(item as HTMLElement).setAttribute(\n 'tabindex',\n index === nextIndex ? '0' : '-1',\n )\n }\n\n nextItem.focus()\n event.preventDefault()\n }\n\n readonly #onReferenceClick = async (): Promise<void> => {\n if (this.disabled) return\n\n if (this.#open) {\n await this.close()\n return\n }\n\n await this.show()\n this.#focusFirstItem()\n }\n\n #focusFirstItem(): void {\n requestAnimationFrame(() => {\n const firstItem = this.#Items.find(\n (item) =>\n item instanceof HTMLElement &&\n isEnabledItem(item) &&\n closestElement('qds-dropdown', item) === this.host,\n )\n if (!firstItem) return\n for (const item of this.#Items) item.setAttribute('tabindex', '-1')\n firstItem.setAttribute('tabindex', '0')\n firstItem.focus()\n })\n }\n\n #disconnectReferenceElement(): void {\n this.host.removeAttribute('aria-labelledby')\n\n if (!(this.#referenceElement instanceof globalThis.Element)) return\n\n this.#referenceElement.removeEventListener(\n 'focusout',\n this.#boundOnFocusout,\n )\n this.#referenceElement.removeEventListener('keydown', this.#boundOnKeydown)\n this.#referenceElement.removeAttribute('aria-expanded')\n this.#referenceElement.removeAttribute('aria-controls')\n }\n\n readonly #boundOnFocusout = (event: Event): void => {\n ignorePromise(this.#onFocusout(event))\n }\n\n readonly #boundOnKeydown = (event: Event): void => {\n ignorePromise(this.#onKeydown(event))\n }\n\n readonly #boundOnReferenceClick = (): void => {\n ignorePromise(this.#onReferenceClick())\n }\n\n readonly #onSlotchange = (event: Event): void => {\n const slot = event.target as HTMLSlotElement\n const assignedElements = slot.assignedElements({ flatten: true })\n\n this.#Items = assignedElements.filter((element): element is HTMLElement =>\n isEnabledItem(element),\n )\n }\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-C1c4JVlg.js","mappings":";;;;;;;;AAAA,MAAM,cAAc,GAAG,wsBAAwsB;;ACA/tB;AACA;AACA;;;;;;;;;MAaa,WAAW,iBAAAA,kBAAA,CAAA,MAAA,WAAA,SAAAC,CAAA,CAAA;AALxB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;AAYE;;;AAGG;AACqB,QAAA,IAAG,CAAA,GAAA,GAAW,EAAE;AAOxC;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAY,SAAS;AAevC,QAAA,IAAa,CAAA,aAAA,GAAG,KAAK;AAuB7B,QAAA,0BAAA,CAAA,GAAA,CAAA,IAAA,EAAiB,MAA8B;AACtD,YAAA,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS,IAAI,IAAI,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;AACpE,gBAAA,QACE,CACE,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,aAAa,EACnB,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,OAAO,EAAE,sBAAA,CAAA,IAAI,EAAA,6BAAA,EAAA,GAAA,CAAkB,EAC/B,MAAM,EAAE,MAAK;AACX,wBAAA,IAAI,CAAC,aAAa,GAAG,KAAK;qBAC3B,EAAA,CACD;;AAGN,YAAA,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,I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IAAI,CAAC,gBAAgB,EAAE;;IAGlB,MAAM,GAAA;AACX,QAAA,OAAO,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,eAAe,EAAE,EAAA,sBAAA,CAAA,IAAI,EAAA,0BAAA,EAAA,GAAA,CAAe,CAAnB,IAAA,CAAA,IAAI,CAAiB,CAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/avatar-media/avatar-media.css?tag=qds-avatar-media&encapsulation=shadow","src/components/avatar-media/avatar-media.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2025 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: block;\n}\n\n.qds-container {\n display: flex;\n justify-content: center;\n align-self: stretch;\n border-radius: var(--qds-display-rounded-border-radius);\n border: var(--qds-display-border-width) solid\n var(--qds-theme-display-background-contrast);\n background: var(--qds-theme-display-background);\n width: inherit;\n height: inherit;\n align-items: center;\n\n .qds-picture {\n height: 100%;\n width: 100%;\n object-fit: cover;\n border-radius: inherit;\n flex-shrink: 0;\n }\n\n .qds-icon,\n .qds-text {\n color: var(--qds-theme-display-background-contrast);\n }\n\n .qds-icon {\n width: 60%;\n height: 60%;\n flex-shrink: 0;\n }\n\n .qds-text {\n text-align: center;\n font: var(--qds-display-standard);\n }\n}\n","// SPDX-FileCopyrightText: © 2025 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport { Component, Event, h, Prop, State, Watch } from '@stencil/core'\n\n/**\n * @experimental\n */\n@Component({\n tag: 'qds-avatar-media',\n shadow: true,\n styleUrl: 'avatar-media.css',\n})\nexport class AvatarMedia implements ComponentInterface {\n /**\n * The avatar-media's image source.\n * @webnative\n */\n @Prop() public readonly src?: string\n\n /**\n * The alt text for the avatar-media's image.\n * @webnative\n */\n @Prop() public readonly alt: string = ''\n\n /**\n * The avatar-media's icon name.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The avatar-media's icon library.\n */\n @Prop() public readonly iconLibrary?: string = 'default'\n\n /**\n * The avatar-media's text content.\n */\n @Prop() public readonly text?: string\n\n /**\n * Emitted when the avatar-media's image fails to load due to an error.\n */\n @Event({ eventName: 'qdsError', cancelable: false })\n private readonly errorEmitter!: EventEmitter<void>\n\n @State() private initials: string | undefined\n\n @State() private hasImageError = false\n\n @Watch('text')\n private handleTextChange(): void {\n if (this.text === undefined || this.text === '') {\n this.initials = undefined\n return\n }\n const words = this.text.trim().split(' ')\n const [first = '', second = ''] = words.filter(Boolean)\n this.initials = (\n first.charAt(0) + (second.charAt(0) || '')\n ).toLocaleUpperCase()\n }\n\n public componentWillLoad(): Promise<void> | void {\n this.handleTextChange()\n }\n\n public render() {\n return <div class=\"qds-container\">{this.#renderContent()}</div>\n }\n\n readonly #renderContent = (): HTMLElement | undefined => {\n if (this.src !== undefined && this.src !== '' && !this.hasImageError) {\n return (\n <img\n class=\"qds-picture\"\n src={this.src}\n alt={this.alt}\n onError={this.#handleImageError}\n onLoad={() => {\n this.hasImageError = false\n }}\n />\n )\n }\n if (this.text !== undefined && this.text !== '') {\n return <span class=\"qds-text\">{this.initials}</span>\n }\n if (this.iconName !== undefined && this.iconName !== '') {\n return (\n <qds-icon\n class=\"qds-icon\"\n name={this.iconName}\n library={this.iconLibrary}\n />\n )\n }\n\n return <qds-icon class=\"qds-icon\" name=\"user\" library=\"core\" />\n }\n\n readonly #handleImageError = (): void => {\n this.hasImageError = true\n this.errorEmitter.emit()\n }\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-CDRwHAIT.js","mappings":";;;;;;;AAAA,MAAM,eAAe,GAAG,i1EAAi1E;;ACAz2E;AACA;AACA;;;;;;;;;MAwBa,YAAY,iBAAAA,kBAAA,CAAA,MAAA,YAAA,SAAAC,C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,QAAA,KAAK,SAAS;AACd,QAAA,KAAK,aAAa;AAClB,QAAA,KAAK,qBAAqB;QAC1B,KAAK,YAAY,EAAE;YACjB,OAAO,IAAI,CAAC,UAAU;;QAExB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,8BAAA,GAAA,SAAA,8BAAA,GAAA;AAGC,IAAA,QAAQ,IAAI,CAAC,IAAI;AACf,QAAA,KAAK,MAAM;AACX,QAAA,KAAK,OAAO;QACZ,KAAK,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC,IAAI;;QAElB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/badge-counter/badge-counter.css?tag=qds-badge-counter&encapsulation=shadow","src/components/badge-counter/badge-counter.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-badge-counter {\n align-items: center;\n background-color: var(--qds-theme-feedback-message-neutral);\n border-radius: var(--qds-feedback-rounded-border-radius);\n color: var(--qds-theme-feedback-message-neutral-contrast);\n display: flex;\n font: var(--qds-feedback-badge-counter-standard-text);\n height: var(--qds-feedback-badge-counter-standard-height);\n justify-content: center;\n margin: 0;\n padding-inline: var(--qds-feedback-badge-counter-standard-padding-horizontal);\n text-align: center;\n}\n\n.qds-stroke-ring {\n border: var(--qds-feedback-badge-border-width) solid\n var(--qds-theme-feedback-message-neutral-contrast);\n}\n\n.qds-sr-only {\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n}\n\n[data-importance='emphasized'] {\n background-color: var(--qds-theme-signature-color-contrast);\n color: var(--qds-theme-signature-color-default);\n\n &.qds-stroke-ring {\n border-color: var(--qds-theme-signature-color-default);\n }\n}\n\n[data-importance='subdued'] {\n background-color: var(--qds-theme-feedback-message-informational);\n color: var(--qds-theme-feedback-message-informational-contrast);\n\n &.qds-stroke-ring {\n border-color: var(--qds-theme-feedback-message-informational-contrast);\n }\n}\n\n[data-importance='destructive'] {\n background-color: var(--qds-theme-feedback-message-critical-contrast);\n color: var(--qds-theme-feedback-message-critical);\n\n &.qds-stroke-ring {\n border-color: var(--qds-theme-feedback-message-critical);\n }\n}\n\n[data-importance='subdued-destructive'] {\n color: var(--qds-theme-feedback-message-critical-contrast);\n background-color: var(--qds-theme-feedback-message-critical);\n\n &.qds-stroke-ring {\n border-color: var(--qds-theme-feedback-message-critical-contrast);\n }\n}\n\n[data-size='small'] {\n font: var(--qds-feedback-badge-counter-small-text);\n height: var(--qds-feedback-badge-counter-small-height);\n padding-inline: var(--qds-feedback-badge-counter-small-padding-horizontal);\n}\n\n[data-size='large'] {\n font: var(--qds-feedback-badge-counter-large-text);\n height: var(--qds-feedback-badge-counter-large-height);\n padding-inline: var(--qds-feedback-badge-counter-large-padding-horizontal);\n}\n\n[data-size='hero'] {\n font: var(--qds-feedback-badge-counter-hero-text);\n height: var(--qds-feedback-badge-counter-hero-height);\n padding-inline: var(--qds-feedback-badge-counter-hero-padding-horizontal);\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 } from '@stencil/core'\n\nimport type { Importance, Size } from '../shared'\n\nexport type BadgeCounterImportance =\n | Importance\n | 'destructive'\n | 'subdued-destructive'\nexport type BadgeCounterSize = Size | 'hero'\n\n/**\n * The `<qds-badge-counter>` element is a small, rounded UI element used to\n * display numerical values or counts. It is designed to draw the user's eye to\n * important or dynamic content by providing a visual cue that a countable\n * event or item has occurred or is waiting to be addressed.\n */\n@Component({\n tag: 'qds-badge-counter',\n shadow: true,\n styleUrl: 'badge-counter.css',\n})\nexport class BadgeCounter implements ComponentInterface {\n /**\n * Adds accessible text to the qds-badge-counter that will be used by screen\n * readers.\n *\n * @example\n * <qds-badge-counter value={2} description=\"new notifications\"></qds-badge-counter>\n * // This qds-badge-counter will be read by screen readers as \"two new notifications\"\n */\n @Prop() public readonly description?: string\n\n /**\n * The badge counter's importance.\n */\n @Prop() public readonly importance?: BadgeCounterImportance = 'standard'\n\n /**\n * The badge counter's size.\n */\n @Prop() public readonly size?: BadgeCounterSize = 'standard'\n\n /**\n * Shows a stroke ring around the component for better visibility\n */\n @Prop() public readonly strokeRing: boolean = false\n\n /**\n * The badge-counter's value.\n */\n @Prop() public readonly value!: number | string\n\n get #computedValue(): string {\n const value =\n typeof this.value === 'string'\n ? Number.parseInt(this.value, 10)\n : // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n (this.value ?? Number.NaN)\n if (Number.isNaN(value) || value < 0) return ''\n\n return value < 100 ? value.toString() : '99+'\n }\n\n get #computedImportance(): BadgeCounterImportance {\n switch (this.importance) {\n case 'subdued':\n case 'destructive':\n case 'subdued-destructive':\n case 'emphasized': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedSize(): BadgeCounterSize {\n switch (this.size) {\n case 'hero':\n case 'large':\n case 'small': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n public render() {\n return (\n <span\n class={{\n 'qds-badge-counter': true,\n 'qds-stroke-ring': this.strokeRing,\n }}\n data-importance={this.#computedImportance}\n data-size={this.#computedSize}\n >\n {this.#computedValue}\n <span class=\"qds-sr-only\">{this.description}</span>\n </span>\n )\n }\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-CkUTS1aU.js","mappings":";;;;;;;;AAAA,MAAM,QAAQ,GAAG,02SAA02S;;ACA33S;AACA;AACA;;;;;;;;;MAyBa,KAAK,iBAAAA,kBAAA,CAAA,MAAA,KAAA,SAAAC,CAAA,CAAA;AALlB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;AAME;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,EAAe,cAAA,EAAA,IAAI,CAAC,OAAO,EAAA,EAC/C,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAQ,CACJ,EACL,sBAAA,CAAA,IAAI,EAAW,gBAAA,EAAA,GAAA,EAAA,oBAAA,CAAA,IAAI,CAAG,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,YAAY,EAAE,EAAA,IAAI,CAAC,MAAM,CAAK,EAC1D,sBAAA,CAAA,IAAI,EAAa,gBAAA,EAAA,GAAA,EAAA,sBAAA,CAAA,IAAI,CAAG,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,cAAc,EAAE,EAAA,IAAI,CAAC,QAAQ,CAAK,EAChE,OAAO,KACN,CAAA,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,aAAA,EACc,MAAM,EAClB,KAAK,EAAC,UAAU,EAChB,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,CAAA,CACH,CACM;;;;;;;;;;;;;;;IA5CX,OAAO,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,EAAE;AAC5D,CAAC,EAAA,oBAAA,GAAA,SAAA,oBAAA,GAAA;IAGC,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE;AACxD,CAAC;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/title/title.css?tag=qds-title&encapsulation=shadow","src/components/title/title.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: block;\n}\n\n.qds-titles {\n display: grid;\n grid-template-areas: 'title';\n\n &.qds-has-kicker {\n grid-template-areas:\n 'kicker'\n 'title';\n }\n\n &.qds-has-subtitle {\n grid-template-areas:\n 'title'\n 'subtitle';\n }\n\n &.qds-has-kicker.qds-has-subtitle {\n grid-template-areas:\n 'kicker'\n 'title'\n 'subtitle';\n }\n}\n\n.qds-has-icon {\n grid-template-columns: auto 1fr;\n grid-template-areas: 'icon title';\n\n &.qds-has-kicker {\n grid-template-areas:\n '. kicker'\n 'icon title';\n }\n\n &.qds-has-subtitle {\n grid-template-areas:\n 'icon title'\n '. subtitle';\n }\n\n &.qds-has-kicker.qds-has-subtitle {\n grid-template-areas:\n '. kicker'\n 'icon title'\n '. subtitle';\n }\n}\n\n.qds-titles,\n.qds-title {\n hyphens: inherit;\n}\n\n.qds-subtitle,\n.qds-kicker {\n hyphens: initial;\n}\n\n.qds-title,\n.qds-subtitle,\n.qds-kicker {\n margin-block: 0;\n}\n\n.qds-title {\n grid-area: title;\n color: var(--qds-theme-title);\n}\n\n.qds-subtitle {\n grid-area: subtitle;\n color: var(--qds-theme-subtitle);\n}\n\n.qds-kicker {\n grid-area: kicker;\n color: var(--qds-theme-kicker);\n}\n\n.qds-icon {\n grid-area: icon;\n align-content: center;\n color: var(--qds-theme-text-standard);\n}\n\n.qds-main {\n &.qds-section {\n &.qds-titles {\n gap: var(--qds-main-section-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-main-section-titles-gap)\n var(--qds-main-section-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-main-section-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-main-section-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-main-section-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-main-section-titles-icon-size);\n height: var(--qds-main-section-titles-icon-crop-height);\n }\n }\n\n &.qds-subsection {\n &.qds-titles {\n gap: var(--qds-main-subsection-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-main-subsection-titles-gap)\n var(--qds-main-subsection-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-main-subsection-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-main-subsection-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-main-subsection-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-main-subsection-titles-icon-size);\n height: var(--qds-main-subsection-titles-icon-crop-height);\n }\n }\n}\n\n.qds-panel {\n &.qds-root {\n &.qds-titles {\n gap: var(--qds-panel-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-panel-titles-gap) var(--qds-panel-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-panel-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-panel-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-panel-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-panel-titles-icon-size);\n height: var(--qds-panel-titles-icon-crop-height);\n }\n }\n\n &.qds-section {\n &.qds-titles {\n gap: var(--qds-panel-section-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-panel-section-titles-gap)\n var(--qds-panel-section-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-panel-section-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-panel-section-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-panel-section-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-panel-section-titles-icon-size);\n height: var(--qds-panel-section-titles-icon-crop-height);\n }\n }\n\n &.qds-subsection {\n &.qds-titles {\n gap: var(--qds-panel-subsection-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-panel-subsection-titles-gap)\n var(--qds-panel-subsection-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-panel-subsection-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-panel-subsection-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-panel-subsection-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-panel-subsection-titles-icon-size);\n height: var(--qds-panel-subsection-titles-icon-crop-height);\n }\n }\n}\n\n.qds-navigation {\n &.qds-section {\n &.qds-titles {\n gap: var(--qds-navigation-section-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-navigation-section-titles-gap)\n var(--qds-navigation-section-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-navigation-section-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-navigation-section-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-navigation-section-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-navigation-section-titles-icon-size);\n height: var(--qds-navigation-section-titles-icon-crop-height);\n }\n }\n\n &.qds-subsection {\n &.qds-titles {\n gap: var(--qds-navigation-subsection-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-navigation-subsection-titles-gap)\n var(--qds-navigation-subsection-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-navigation-subsection-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-navigation-subsection-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-navigation-subsection-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-navigation-subsection-titles-icon-size);\n height: var(--qds-navigation-subsection-titles-icon-crop-height);\n }\n }\n}\n\n.qds-popup {\n &.qds-root {\n &.qds-titles {\n gap: var(--qds-popup-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-popup-titles-gap) var(--qds-popup-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-popup-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-popup-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-popup-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-popup-titles-icon-size);\n height: var(--qds-popup-titles-icon-crop-height);\n }\n }\n\n &.qds-section {\n &.qds-titles {\n gap: var(--qds-popup-section-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-popup-section-titles-gap)\n var(--qds-popup-section-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-popup-section-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-popup-section-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-popup-section-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-popup-section-titles-icon-size);\n height: var(--qds-popup-section-titles-icon-crop-height);\n }\n }\n\n &.qds-subsection {\n &.qds-titles {\n gap: var(--qds-popup-subsection-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-popup-subsection-titles-gap)\n var(--qds-popup-subsection-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-popup-subsection-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-popup-subsection-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-popup-subsection-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-popup-subsection-titles-icon-size);\n height: var(--qds-popup-subsection-titles-icon-crop-height);\n }\n }\n}\n\n.qds-accessory {\n &.qds-root {\n &.qds-titles {\n gap: var(--qds-accessory-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-accessory-titles-gap) var(--qds-accessory-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-accessory-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-accessory-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-accessory-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-accessory-titles-icon-size);\n height: var(--qds-accessory-titles-icon-crop-height);\n }\n }\n\n &.qds-section {\n &.qds-titles {\n gap: var(--qds-accessory-section-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-accessory-section-titles-gap)\n var(--qds-accessory-section-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-accessory-section-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-accessory-section-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-accessory-section-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-accessory-section-titles-icon-size);\n height: var(--qds-accessory-section-titles-icon-crop-height);\n }\n }\n}\n\n[data-variant='web-main-section-promo'] {\n &:is(.qds-root, .qds-section, .qds-subsection) {\n &.qds-titles {\n gap: var(--qds-main-section-promo-titles-gap);\n margin: auto;\n }\n\n & .qds-title {\n font: var(--qds-main-section-promo-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-main-section-promo-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-main-section-promo-kicker);\n }\n\n &.qds-has-icon {\n gap: var(--qds-main-section-promo-titles-gap)\n var(--qds-main-section-promo-titles-icon-gap);\n }\n\n & .qds-icon {\n width: var(--qds-main-section-promo-titles-icon-size);\n height: var(--qds-main-section-promo-titles-icon-crop-height);\n }\n }\n}\n\n[data-alignment='start'] {\n text-align: start;\n}\n\n[data-alignment='center'] {\n text-align: center;\n}\n\n[data-alignment='end'] {\n text-align: end;\n}\n\n[data-variant='web-main-section-display'] {\n &:is(.qds-root, .qds-section, .qds-subsection) {\n &.qds-titles {\n gap: var(--qds-main-section-display-titles-gap);\n }\n\n & .qds-title {\n font: var(--qds-main-section-display-title);\n }\n }\n}\n\n[data-variant='web-main-subsection-card'] {\n &:is(.qds-root, .qds-section, .qds-subsection) {\n &.qds-titles {\n gap: var(--qds-main-subsection-card-titles-gap);\n }\n\n & .qds-title {\n font: var(--qds-main-subsection-card-standard-title);\n }\n }\n}\n\n[data-variant='web-main-section-hero'] {\n &:is(.qds-root, .qds-section, .qds-subsection) {\n &.qds-titles {\n gap: var(--qds-main-section-hero-titles-gap);\n }\n\n & .qds-title {\n font: var(--qds-main-section-hero-title);\n }\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface } from '@stencil/core'\nimport { AttachInternals, Component, h, Prop } from '@stencil/core'\n\nexport type Layer = 'accessory' | 'main' | 'navigation' | 'panel' | 'popup'\nexport type Level = 'root' | 'section' | 'subsection'\nexport type Tag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\nexport type TitleVariant =\n | 'web-main-section-display'\n | 'web-main-section-hero'\n | 'web-main-section-promo'\n | 'web-main-subsection-card'\n\nexport type Alignment = 'center' | 'end' | 'start'\n\n/**\n * @slot Content to display for the title.\n * @see https://quartz.se.com/build/components/title\n */\n@Component({\n tag: 'qds-title',\n shadow: true,\n styleUrl: 'title.css',\n})\nexport class Title implements ComponentInterface {\n /**\n * The alignment of the title.\n */\n @Prop() public readonly alignment?: Alignment = 'start'\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 * Text to display for the kicker.\n */\n @Prop() public readonly kicker?: string\n\n @Prop() public readonly layer?: Layer = 'main'\n\n @Prop() public readonly level?: Level = 'section'\n\n /**\n * Text to display for the subtitle.\n */\n @Prop() public readonly subtitle?: string\n\n /**\n * HTML tag to use to render the title.\n */\n @Prop() public readonly tag?: Tag = 'h2'\n\n /**\n * The title's variant.\n */\n @Prop() public readonly variant?: TitleVariant\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n get #hasSubtitle(): boolean {\n return this.subtitle !== undefined && this.subtitle !== ''\n }\n\n get #hasKicker(): boolean {\n return this.kicker !== undefined && this.kicker !== ''\n }\n\n public componentWillLoad(): void {\n this.internals.role = 'group'\n }\n\n public render() {\n const layer = `qds-${this.layer ?? 'main'}`\n const level = `qds-${this.level ?? 'section'}`\n const Tag = this.tag ?? 'h2'\n const hasIcon = this.iconName !== undefined && this.iconName !== ''\n\n return (\n <hgroup\n data-alignment={this.alignment ?? 'start'}\n data-variant={this.variant}\n class={{\n [layer]: true,\n [level]: true,\n 'qds-titles': true,\n 'qds-has-icon': hasIcon,\n 'qds-has-kicker': this.#hasKicker,\n 'qds-has-subtitle': this.#hasSubtitle,\n }}\n role=\"none\"\n >\n <Tag class=\"qds-title\" data-variant={this.variant}>\n <slot />\n </Tag>\n {this.#hasKicker && <p class=\"qds-kicker\">{this.kicker}</p>}\n {this.#hasSubtitle && <p class=\"qds-subtitle\">{this.subtitle}</p>}\n {h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CAAC,gBAAgB,KAAK,SAAS,EAAE;AACnE,QAAA,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,CAAA,EAAG,IAAI,CAAC,IAAI,CAAA,CAAA,EACrC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,KACtC,CAAI,CAAA,EAAA,IAAI,CAAC,gBAAgB,EAAE;QAC3B;;AAGF,IAAA,IACE,IAAI,CAAC,MAAM,KAAK,SAAS;QACzB,IAAI,CAAC,MAAM,KAAK,QAAQ;AACxB,QAAA,IAAI,CAAC,IAAI,KAAK,SAAS,EACvB;QACA,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,GAAG,IAAI,CAAC,IAAI,CAAA,mBAAA,CAAqB;QAC5D;;IAEF,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE;AAC5C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/icon-button/icon-button.css?tag=qds-icon-button&encapsulation=shadow","src/components/icon-button/icon-button.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2025 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n:host {\n display: block;\n outline: none;\n}\n\n.qds-focus-ring {\n /* Support control groups where each corner needs to be individually adjusted depending on where these components are placed in the control group (start, middle, end) */\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: icon-button;\n isolation: isolate;\n\n /* inner ring */\n outline: var(--qds-theme-focus-border-contrast) solid\n var(--qds-focus-light-border-width);\n outline-offset: 0;\n\n /* outer ring */\n box-shadow: 0 0 0 var(--qds-focus-heavy-border-width)\n var(--qds-theme-focus-border);\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) - var(--qds-control-border-width)\n );\n}\n\n:host(:focus-visible) .qds-focus-ring {\n visibility: visible;\n}\n\n.qds-container {\n display: grid;\n grid-template-areas: 'icon-button';\n}\n\n.qds-icon-button {\n display: flex;\n position: relative;\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 align-items: center;\n justify-content: center;\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 grid-area: icon-button;\n outline: none;\n border: none;\n appearance: none;\n user-select: none;\n cursor: pointer;\n box-sizing: border-box;\n background-color: initial;\n color: var(--qds-theme-control-text-standard);\n padding-inline: 0;\n line-height: normal;\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.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\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 min-height: var(--qds-control-small-height);\n width: var(--qds-control-small-height);\n\n &.qds-icon {\n min-height: var(--qds-control-small-icon-size);\n width: var(--qds-control-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n min-height: var(--qds-control-standard-height);\n width: var(--qds-control-standard-height);\n\n &.qds-icon {\n min-height: var(--qds-control-standard-icon-size);\n width: var(--qds-control-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n min-height: var(--qds-control-large-height);\n width: var(--qds-control-large-height);\n\n &.qds-icon {\n min-height: var(--qds-control-large-icon-size);\n width: var(--qds-control-large-icon-size);\n }\n}\n\n[data-size='hero'] {\n min-height: var(--qds-control-hero-height);\n width: var(--qds-control-hero-height);\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\n &.qds-icon {\n min-height: var(--qds-control-hero-icon-size);\n width: var(--qds-control-hero-icon-size);\n }\n}\n\n[data-importance='subdued'] {\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[data-importance='standard'] {\n color: var(--qds-theme-control-text-standard);\n border: var(--qds-control-border-width) solid var(--qds-theme-control-border);\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[data-importance='emphasized'] {\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[data-importance='destructive'] {\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[data-importance='subdued-destructive'] {\n color: var(--qds-theme-feedback-action-destructive-default);\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","// SPDX-FileCopyrightText: © 2025 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 Watch,\n} from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport { pickFocusEventAttributes } from '../../helpers'\nimport type { Importance, Size, Target } from '../shared'\n\nexport type IconButtonSize = Size | 'hero'\nexport type IconButtonImportance =\n | Importance\n | 'destructive'\n | 'subdued-destructive'\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-icon-button>` is an interactive element activated by a user\n * with a mouse, keyboard, finger, voice command, or other assistive technology.\n * Once activated, it 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/icon-button\n */\n@Component({\n tag: 'qds-icon-button',\n formAssociated: true,\n styleUrl: 'icon-button.css',\n shadow: true,\n})\nexport class IconButton implements ComponentInterface {\n /**\n * Prevents the icon button from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop()\n public readonly disabled: boolean = false\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 icon button's size.\n */\n @Prop() public readonly size?: Size | 'hero' = 'standard'\n\n /**\n * The icon button's importance.\n */\n @Prop() public readonly importance?: IconButtonImportance = 'standard'\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 * 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<Target, string>\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 * 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 * 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 icon button's accessible name.\n */\n @Prop() public readonly text?: string\n\n /**\n * Emitted when the icon button loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the icon 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 @AttachInternals() private readonly internals!: ElementInternals\n\n #savedTabIndex = 0\n\n #button?: HTMLAnchorElement | HTMLButtonElement\n\n #tooltip?: HTMLQdsTooltipElement\n\n get #computedSize(): IconButtonSize {\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 get #computedImportance(): IconButtonImportance {\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 #computedDisabled(): boolean {\n return this.disabled\n }\n\n get #hasText(): boolean {\n return this.text !== undefined && this.text !== ''\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\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) event.stopImmediatePropagation()\n }\n\n @Listen('blur')\n protected async onBlur(event: FocusEvent): Promise<void> {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n if (this.#tooltip) {\n await this.#tooltip.close()\n }\n }\n\n @Listen('focus')\n protected async onFocus(event: FocusEvent): Promise<void> {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n if (this.#tooltip) {\n await this.#tooltip.show()\n }\n }\n\n @Listen('keydown')\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Enter') {\n if (this.#button instanceof HTMLAnchorElement) {\n this.#button.click()\n } else this.host.click()\n }\n }\n\n @Listen('keyup')\n protected onKeyup(event: KeyboardEvent): void {\n if (event.key === ' ') this.host.click()\n }\n\n public componentWillLoad(): void {\n this.hrefChanged()\n this.textChanged()\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n this.disabledChanged()\n }\n\n public render() {\n const Tag = this.href === undefined ? 'button' : 'a'\n return (\n <div class=\"qds-container\" aria-hidden=\"true\">\n <Tag\n type={Tag === 'a' ? undefined : 'button'}\n class={{\n 'qds-icon-button': true,\n 'qds-disabled': this.#computedDisabled,\n }}\n href={Tag === 'a' ? this.href : undefined}\n target={Tag === 'a' ? this.target : undefined}\n rel={Tag === 'a' ? this.rel : undefined}\n ref={this.#ref}\n disabled={Tag === 'a' ? undefined : this.#computedDisabled}\n download={Tag === 'a' ? this.download : undefined}\n data-size={this.#computedSize}\n data-importance={this.#computedImportance}\n onKeyDown={preventDefault}\n onKeyUp={preventDefault}\n onKeyPress={preventDefault}\n tabIndex={-1}\n >\n <qds-icon\n class=\"qds-icon\"\n data-size={this.#computedSize}\n library={this.iconLibrary}\n name={this.iconName}\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=\"qds-indicator\"\n description={this.badgeDescription}\n importance={this.#computedImportance}\n size={this.#computedSize}\n strokeRing\n value={this.badge}\n />\n )}\n </Tag>\n <div class=\"qds-focus-ring\" data-size={this.#computedSize} />\n {this.#hasText && (\n <qds-tooltip ref={this.#tooltipRef}>{this.text}</qds-tooltip>\n )}\n </div>\n )\n }\n\n #updateAriaLabel(): void {\n if (this.badge !== undefined && this.badgeDescription !== undefined) {\n this.internals.ariaLabel = `${this.text} ${\n isIndicator(this.badge) ? '' : this.badge\n } ${this.badgeDescription}`\n return\n }\n\n if (\n this.target !== undefined &&\n this.target === '_blank' &&\n this.href !== undefined\n ) {\n this.internals.ariaLabel = `${this.text} Opens in a new tab`\n return\n }\n this.internals.ariaLabel = this.text ?? ''\n }\n\n readonly #ref = (button?: HTMLAnchorElement | HTMLButtonElement): void => {\n this.#button = button\n }\n\n readonly #tooltipRef = (tooltip?: HTMLQdsTooltipElement): void => {\n if (tooltip) {\n // eslint-disable-next-line no-param-reassign\n tooltip.target = this.#button\n this.#tooltip = tooltip\n }\n }\n}\n"],"version":3}
|
package/components/p-D9pW936J.js
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* SPDX-FileCopyrightText: © 2026 Schneider Electric
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { p as proxyCustomElement, H, c as createEvent, h } from './p-D2489VzR.js';
|
|
7
|
-
import { p as pickFocusEventAttributes, i as invariant, c as inheritAriaAttributes } from './p-CURs27Ur.js';
|
|
8
|
-
import { d as defineCustomElement$3 } from './p-DtxwXYGb.js';
|
|
9
|
-
import { d as defineCustomElement$2 } from './p-laE-pGH7.js';
|
|
10
|
-
import { d as defineCustomElement$1 } from './p-D82sb4oJ.js';
|
|
11
|
-
|
|
12
|
-
const radioCss = "[hidden].sc-qds-radio-h{display:none!important}.sc-qds-radio-h{display:inline-block;line-height:0}.qds-icon.sc-qds-radio,.qds-radio.sc-qds-radio{grid-area:i;place-self:center}.qds-icon.sc-qds-radio{display:none;pointer-events:none}.qds-container.sc-qds-radio{display:grid;grid-template-areas:\"i\"}.qds-label.sc-qds-radio{align-items:flex-start;background-color:var(--qds-theme-interactive-background-default);border-radius:var(--qds-control-border-radius);box-sizing:border-box;cursor:pointer;display:inline-flex;justify-content:center;width:inherit}.qds-label.sc-qds-radio:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-label.sc-qds-radio:active{background-color:var(--qds-theme-interactive-background-pressed)}.qds-label.sc-qds-radio:has(.qds-radio:focus-visible){box-shadow:0 0 0 var(--qds-focus-heavy-border-width) var(--qds-theme-focus-border);outline:var(--qds-theme-focus-border-contrast) solid var(--qds-focus-light-border-width);outline-offset:0}.qds-label-inner.sc-qds-radio{flex:1 1 auto;min-width:0;width:100%}.qds-radio.sc-qds-radio{-webkit-appearance:none;appearance:none;background-color:var(--qds-theme-interactive-background-default);border:var(--qds-control-border-width) solid var(--qds-theme-control-border);border-radius:var(--qds-control-rounded-border-radius);cursor:pointer;margin:0;padding:var(--qds-control-toggle-padding);-webkit-print-color-adjust:exact;print-color-adjust:exact}.qds-radio.sc-qds-radio:focus-visible{outline:none}.qds-radio.sc-qds-radio:checked~.qds-icon.sc-qds-radio{color:var(--qds-theme-control-background-contrast);display:block}[aria-disabled=true].sc-qds-radio{opacity:var(--qds-theme-disabled);pointer-events:none}[data-size=small].sc-qds-radio{--qds-form-small-text:var(--qds-control-small-text)}.qds-radio[data-size=small].sc-qds-radio{height:var(--qds-control-toggle-small-box-size);width:var(--qds-control-toggle-small-box-size)}.qds-icon[data-size=small].sc-qds-radio{font-size:var(--qds-control-small-icon-size)}.qds-label[data-size=small].sc-qds-radio{gap:var(--qds-control-small-gap-siblings-related);min-height:var(--qds-control-toggle-small-height);min-width:var(--qds-control-toggle-small-width);padding-block:var(--qds-control-no-inline-small-padding-vertical)}.qds-inline[data-size=small].sc-qds-radio{min-height:var(--qds-control-small-height);padding:var(--qds-control-standard-padding-auto-height) var(--qds-control-toggle-standard-padding-horizontal)}[data-size=standard].sc-qds-radio{--qds-form-standard-text:var(--qds-control-standard-text)}.qds-radio[data-size=standard].sc-qds-radio{height:var(--qds-control-toggle-standard-box-size);width:var(--qds-control-toggle-standard-box-size)}.qds-icon[data-size=standard].sc-qds-radio{height:var(--qds-control-standard-icon-size);width:var(--qds-control-standard-icon-size)}.qds-label[data-size=standard].sc-qds-radio{gap:var(--qds-control-standard-gap-siblings-related);min-height:var(--qds-control-toggle-standard-height);min-width:var(--qds-control-toggle-standard-width);padding-block:var(--qds-control-no-inline-standard-padding-vertical)}.qds-inline[data-size=standard].sc-qds-radio{min-height:var(--qds-control-standard-height);padding:var(--qds-control-standard-padding-auto-height) var(--qds-control-toggle-standard-padding-horizontal)}[data-size=large].sc-qds-radio{--qds-form-large-text:var(--qds-control-large-text)}.qds-radio[data-size=large].sc-qds-radio{height:var(--qds-control-toggle-large-box-size);width:var(--qds-control-toggle-large-box-size)}.qds-icon[data-size=large].sc-qds-radio{height:var(--qds-control-large-icon-size);width:var(--qds-control-large-icon-size)}.qds-label[data-size=large].sc-qds-radio{gap:var(--qds-control-large-gap-siblings-related);min-height:var(--qds-control-toggle-large-height);min-width:var(--qds-control-toggle-large-width);padding-block:var(--qds-control-no-inline-large-padding-vertical)}.qds-inline[data-size=large].sc-qds-radio{min-height:var(--qds-control-large-height);padding:var(--qds-control-standard-padding-auto-height) var(--qds-control-toggle-standard-padding-horizontal)}";
|
|
13
|
-
|
|
14
|
-
// SPDX-FileCopyrightText: © 2024 Schneider Electric
|
|
15
|
-
//
|
|
16
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
17
|
-
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
18
|
-
if (kind === "a" && !f)
|
|
19
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
20
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
21
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
22
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
23
|
-
};
|
|
24
|
-
var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
25
|
-
if (kind === "m")
|
|
26
|
-
throw new TypeError("Private method is not writable");
|
|
27
|
-
if (kind === "a" && !f)
|
|
28
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
29
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
30
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
31
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
32
|
-
};
|
|
33
|
-
var _Radio_instances, _Radio_inheritedAttributes, _Radio_input, _Radio_computedDisabled_get, _Radio_computedSize_get, _Radio_hasText_get, _Radio_ref, _Radio_onBlur, _Radio_onChange, _Radio_onFocus;
|
|
34
|
-
const Radio = /*@__PURE__*/ proxyCustomElement(class Radio extends H {
|
|
35
|
-
constructor(registerHost) {
|
|
36
|
-
super();
|
|
37
|
-
if (registerHost !== false) {
|
|
38
|
-
this.__registerHost();
|
|
39
|
-
}
|
|
40
|
-
this.blurEmitter = createEvent(this, "qdsBlur", 2);
|
|
41
|
-
this.changeEmitter = createEvent(this, "qdsChange", 6);
|
|
42
|
-
this.focusEmitter = createEvent(this, "qdsFocus", 2);
|
|
43
|
-
_Radio_instances.add(this);
|
|
44
|
-
/**
|
|
45
|
-
* Adds vertical margin to the radio for alignment.
|
|
46
|
-
*
|
|
47
|
-
* This is useful when creating inline layouts so that the first lines have
|
|
48
|
-
* the correct vertical centering.
|
|
49
|
-
*/
|
|
50
|
-
this.inline = false;
|
|
51
|
-
/**
|
|
52
|
-
* The radio button's size.
|
|
53
|
-
*/
|
|
54
|
-
this.size = 'standard';
|
|
55
|
-
_Radio_inheritedAttributes.set(this, {});
|
|
56
|
-
_Radio_input.set(this, void 0);
|
|
57
|
-
_Radio_ref.set(this, (input) => {
|
|
58
|
-
__classPrivateFieldSet(this, _Radio_input, input, "f");
|
|
59
|
-
});
|
|
60
|
-
_Radio_onBlur.set(this, (event) => {
|
|
61
|
-
this.blurEmitter.emit(pickFocusEventAttributes(event));
|
|
62
|
-
});
|
|
63
|
-
_Radio_onChange.set(this, () => {
|
|
64
|
-
this.changeEmitter.emit();
|
|
65
|
-
});
|
|
66
|
-
_Radio_onFocus.set(this, (event) => {
|
|
67
|
-
this.focusEmitter.emit(pickFocusEventAttributes(event));
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
onClick(event) {
|
|
71
|
-
if (__classPrivateFieldGet(this, _Radio_instances, "a", _Radio_computedDisabled_get)) {
|
|
72
|
-
event.stopImmediatePropagation();
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
invariant(__classPrivateFieldGet(this, _Radio_input, "f"));
|
|
76
|
-
this.checked = __classPrivateFieldGet(this, _Radio_input, "f").checked;
|
|
77
|
-
}
|
|
78
|
-
tabindexChanged(newValue) {
|
|
79
|
-
const parsedValue = Number.parseInt(newValue, 10);
|
|
80
|
-
this.tabIndex =
|
|
81
|
-
parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue;
|
|
82
|
-
}
|
|
83
|
-
componentWillLoad() {
|
|
84
|
-
__classPrivateFieldSet(this, _Radio_inheritedAttributes, inheritAriaAttributes(this.host), "f");
|
|
85
|
-
this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0');
|
|
86
|
-
}
|
|
87
|
-
render() {
|
|
88
|
-
return (
|
|
89
|
-
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
90
|
-
h("label", { key: 'd0c73be3ff0a081eb00a0857c8d4c44757b6db2b', "aria-disabled": __classPrivateFieldGet(this, _Radio_instances, "a", _Radio_computedDisabled_get) ? 'true' : undefined, class: {
|
|
91
|
-
'qds-inline': this.inline,
|
|
92
|
-
'qds-label': true,
|
|
93
|
-
}, "data-size": __classPrivateFieldGet(this, _Radio_instances, "a", _Radio_computedSize_get) }, h("div", { key: '1018adbd92399c84791fed4bd449220431f8525f', class: "qds-container" }, h("input", { key: 'f7d1a5bdaf8cc9689b7b4d2257cb360377d8a4b6',
|
|
94
|
-
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
95
|
-
autoFocus: this.host.autofocus, checked: this.checked, class: "qds-radio", "data-size": __classPrivateFieldGet(this, _Radio_instances, "a", _Radio_computedSize_get), disabled: this.disabled, form: this.form, name: this.name, onBlur: __classPrivateFieldGet(this, _Radio_onBlur, "f"), onChange: __classPrivateFieldGet(this, _Radio_onChange, "f"), onFocus: __classPrivateFieldGet(this, _Radio_onFocus, "f"), ref: __classPrivateFieldGet(this, _Radio_ref, "f"), required: this.required, tabIndex: __classPrivateFieldGet(this, _Radio_instances, "a", _Radio_computedDisabled_get) ? undefined : this.tabIndex, type: "radio", value: this.value ?? undefined, ...__classPrivateFieldGet(this, _Radio_inheritedAttributes, "f") }), h("qds-icon", { key: '5d216956b9bc9a9d673f79ef81302f8a085a4f01', "aria-hidden": "true", class: "qds-icon", "data-size": __classPrivateFieldGet(this, _Radio_instances, "a", _Radio_computedSize_get), library: "core", name: "checked-radio" })), __classPrivateFieldGet(this, _Radio_instances, "a", _Radio_hasText_get) && (h("qds-label", { key: '023e5f403ff3299ff37153eb7ee96941f485b308', class: "qds-label-inner", size: __classPrivateFieldGet(this, _Radio_instances, "a", _Radio_computedSize_get), text: this.text }))));
|
|
96
|
-
}
|
|
97
|
-
get host() { return this; }
|
|
98
|
-
static get watchers() { return {
|
|
99
|
-
"tabindex": ["tabindexChanged"]
|
|
100
|
-
}; }
|
|
101
|
-
static get style() { return radioCss; }
|
|
102
|
-
}, [258, "qds-radio", {
|
|
103
|
-
"inline": [4],
|
|
104
|
-
"size": [1],
|
|
105
|
-
"text": [1],
|
|
106
|
-
"checked": [1028],
|
|
107
|
-
"disabled": [4],
|
|
108
|
-
"form": [1],
|
|
109
|
-
"name": [1],
|
|
110
|
-
"required": [4],
|
|
111
|
-
"value": [1032],
|
|
112
|
-
"tabIndex": [32]
|
|
113
|
-
}, [[0, "click", "onClick"]], {
|
|
114
|
-
"tabindex": ["tabindexChanged"]
|
|
115
|
-
}]);
|
|
116
|
-
_Radio_inheritedAttributes = new WeakMap(), _Radio_input = new WeakMap(), _Radio_ref = new WeakMap(), _Radio_onBlur = new WeakMap(), _Radio_onChange = new WeakMap(), _Radio_onFocus = new WeakMap(), _Radio_instances = new WeakSet(), _Radio_computedDisabled_get = function _Radio_computedDisabled_get() {
|
|
117
|
-
return this.disabled ?? false;
|
|
118
|
-
}, _Radio_computedSize_get = function _Radio_computedSize_get() {
|
|
119
|
-
switch (this.size) {
|
|
120
|
-
case 'standard':
|
|
121
|
-
case 'small':
|
|
122
|
-
case 'large': {
|
|
123
|
-
return this.size;
|
|
124
|
-
}
|
|
125
|
-
default: {
|
|
126
|
-
return 'standard';
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}, _Radio_hasText_get = function _Radio_hasText_get() {
|
|
130
|
-
return this.text !== undefined && this.text !== '';
|
|
131
|
-
};
|
|
132
|
-
function defineCustomElement() {
|
|
133
|
-
if (typeof customElements === "undefined") {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
const components = ["qds-radio", "qds-icon", "qds-label", "qds-tooltip"];
|
|
137
|
-
components.forEach(tagName => { switch (tagName) {
|
|
138
|
-
case "qds-radio":
|
|
139
|
-
if (!customElements.get(tagName)) {
|
|
140
|
-
customElements.define(tagName, Radio);
|
|
141
|
-
}
|
|
142
|
-
break;
|
|
143
|
-
case "qds-icon":
|
|
144
|
-
if (!customElements.get(tagName)) {
|
|
145
|
-
defineCustomElement$3();
|
|
146
|
-
}
|
|
147
|
-
break;
|
|
148
|
-
case "qds-label":
|
|
149
|
-
if (!customElements.get(tagName)) {
|
|
150
|
-
defineCustomElement$2();
|
|
151
|
-
}
|
|
152
|
-
break;
|
|
153
|
-
case "qds-tooltip":
|
|
154
|
-
if (!customElements.get(tagName)) {
|
|
155
|
-
defineCustomElement$1();
|
|
156
|
-
}
|
|
157
|
-
break;
|
|
158
|
-
} });
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export { Radio as R, defineCustomElement as d };
|
|
162
|
-
//# sourceMappingURL=p-D9pW936J.js.map
|
|
163
|
-
|
|
164
|
-
//# sourceMappingURL=p-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AAA,EAAA,GAAA,EAAA,uBAAA,CAAA,EACxB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,CAAA,CACH,CACK;;;;;;;;;;;;;;;;;;;;;;AA3FV,IAAA,OAAO,IAAI,CAAC,QAAQ,IAAI,KAAK;AAC/B,CAAC,EAAA,uBAAA,GAAA,SAAA,uBAAA,GAAA;AAGC,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,kBAAA,GAAA,SAAA,kBAAA,GAAA;IAGC,OAAO,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE;AACpD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/radio/radio.css?tag=qds-radio&encapsulation=scoped","src/components/radio/radio.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n line-height: 0;\n}\n\n.qds-radio,\n.qds-icon {\n grid-area: radio;\n place-self: center;\n}\n\n.qds-icon {\n display: none;\n pointer-events: none;\n}\n\n.qds-container {\n display: grid;\n grid-template-areas: 'radio';\n}\n\n.qds-label {\n cursor: pointer;\n display: inline-flex;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n width: inherit;\n border-radius: var(--qds-control-border-radius);\n background-color: var(--qds-theme-interactive-background-default);\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 &:has(.qds-radio:focus-visible) {\n /* inner ring */\n outline: var(--qds-theme-focus-border-contrast) solid\n var(--qds-focus-light-border-width);\n outline-offset: 0;\n\n /* outer ring */\n box-shadow: 0 0 0 var(--qds-focus-heavy-border-width)\n var(--qds-theme-focus-border);\n }\n}\n\n.qds-label-inner {\n flex: 1 1 auto;\n min-width: 0;\n width: 100%;\n}\n\n.qds-radio {\n appearance: none;\n background-color: var(--qds-theme-interactive-background-default);\n border-radius: var(--qds-control-rounded-border-radius);\n border: var(--qds-control-border-width) solid var(--qds-theme-control-border);\n cursor: pointer;\n margin: 0;\n padding: var(--qds-control-toggle-padding);\n print-color-adjust: exact;\n\n &:focus-visible {\n outline: none;\n }\n\n &:checked {\n & ~ .qds-icon {\n display: block;\n color: var(--qds-theme-control-background-contrast);\n }\n }\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-size='small'] {\n /* override qds-label font design token */\n --qds-form-small-text: var(--qds-control-small-text);\n\n &.qds-radio {\n width: var(--qds-control-toggle-small-box-size);\n height: var(--qds-control-toggle-small-box-size);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-small-icon-size);\n }\n\n &.qds-label {\n gap: var(--qds-control-small-gap-siblings-related);\n min-height: var(--qds-control-toggle-small-height);\n padding-block: var(--qds-control-no-inline-small-padding-vertical);\n min-width: var(--qds-control-toggle-small-width);\n }\n\n &.qds-inline {\n min-height: var(--qds-control-small-height);\n padding: var(--qds-control-standard-padding-auto-height)\n var(--qds-control-toggle-standard-padding-horizontal);\n }\n}\n\n[data-size='standard'] {\n /* override qds-label font design token */\n --qds-form-standard-text: var(--qds-control-standard-text);\n\n &.qds-radio {\n width: var(--qds-control-toggle-standard-box-size);\n height: var(--qds-control-toggle-standard-box-size);\n }\n\n &.qds-icon {\n width: var(--qds-control-standard-icon-size);\n height: var(--qds-control-standard-icon-size);\n }\n\n &.qds-label {\n gap: var(--qds-control-standard-gap-siblings-related);\n min-height: var(--qds-control-toggle-standard-height);\n padding-block: var(--qds-control-no-inline-standard-padding-vertical);\n min-width: var(--qds-control-toggle-standard-width);\n }\n\n &.qds-inline {\n min-height: var(--qds-control-standard-height);\n padding: var(--qds-control-standard-padding-auto-height)\n var(--qds-control-toggle-standard-padding-horizontal);\n }\n}\n\n[data-size='large'] {\n /* override qds-label font design token */\n --qds-form-large-text: var(--qds-control-large-text);\n\n &.qds-radio {\n width: var(--qds-control-toggle-large-box-size);\n height: var(--qds-control-toggle-large-box-size);\n }\n\n &.qds-icon {\n width: var(--qds-control-large-icon-size);\n height: var(--qds-control-large-icon-size);\n }\n\n &.qds-label {\n gap: var(--qds-control-large-gap-siblings-related);\n min-height: var(--qds-control-toggle-large-height);\n padding-block: var(--qds-control-no-inline-large-padding-vertical);\n min-width: var(--qds-control-toggle-large-width);\n }\n\n &.qds-inline {\n min-height: var(--qds-control-large-height);\n padding: var(--qds-control-standard-padding-auto-height)\n var(--qds-control-toggle-standard-padding-horizontal);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport {\n inheritAriaAttributes,\n invariant,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Value } from '../controls'\nimport type { Size } from '../shared'\n\n/**\n * `<qds-radio>` elements are rendered as circles that are filled when\n * selected. They are generally used in **radio groups** — collections of radio\n * buttons describing a set of related options.\n *\n * Only one radio button in a given radio group can be selected at the same\n * time.\n *\n * @see https://quartz.se.com/build/components/radio\n */\n@Component({\n tag: 'qds-radio',\n scoped: true,\n styleUrl: 'radio.css',\n})\nexport class Radio implements ComponentInterface {\n /**\n * Adds vertical margin to the radio for alignment.\n *\n * This is useful when creating inline layouts so that the first lines have\n * the correct vertical centering.\n */\n @Prop() public readonly inline: boolean = false\n\n /**\n * The radio button's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The radio button's text.\n */\n @Prop() public readonly text?: string\n\n /**\n * Sets the radio button's state.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public checked?: boolean\n\n /**\n * Prevents the radio button from being interacted with: it cannot be pressed\n * or focused.\n *\n * @webnative\n */\n @Prop() public readonly disabled?: boolean\n\n /**\n * The [`<form>`](https://developer.mozilla.org/docs/Web/HTML/Element/form)\n * element to associate the radio button with (its form owner).\n *\n * The value of this property must be the id of a `<form>` in the same\n * document. If this property is not set, the `<qds-radio>` is associated\n * with its ancestor `<form>` element, if any.\n *\n * This property lets you associate `<qds-radio>` 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 * @webnative\n */\n @Prop() public readonly form?: string\n\n /**\n * Specify the radio group this radio button belongs to.\n *\n * Once a radio group is established, selecting any radio button in that\n * group automatically deselects any currently-selected radio button in the\n * same group.\n *\n * @webnative\n */\n @Prop() public readonly name?: string\n\n /**\n * Specify the group the radio button belongs to as required.\n *\n * If any radio button in a same-named group of radio buttons has the\n * `required` attribute, a radio button in that group must be checked,\n * although it doesn't have to be the one with the attribute applied.\n *\n * @webnative\n */\n @Prop() public readonly required?: boolean\n\n /**\n * The value of the radio button, submitted as a name/value pair with form\n * data.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public value?: Value\n\n /**\n * Emitted when the radio button loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the radio button is checked by the user.\n */\n @Event({ eventName: 'qdsChange', cancelable: false })\n private readonly changeEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the radio 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 tabIndex?: number\n\n #inheritedAttributes: Attributes = {}\n\n #input?: HTMLInputElement\n\n get #computedDisabled(): boolean {\n return this.disabled ?? false\n }\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #hasText(): boolean {\n return this.text !== undefined && this.text !== ''\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n invariant(this.#input)\n\n this.checked = this.#input.checked\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n this.tabIndex =\n parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue\n }\n\n public componentWillLoad(): void {\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public render() {\n return (\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n <label\n aria-disabled={this.#computedDisabled ? 'true' : undefined}\n class={{\n 'qds-inline': this.inline,\n 'qds-label': true,\n }}\n data-size={this.#computedSize}\n >\n <div class=\"qds-container\">\n <input\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={this.host.autofocus}\n checked={this.checked}\n class=\"qds-radio\"\n data-size={this.#computedSize}\n disabled={this.disabled}\n form={this.form}\n name={this.name}\n onBlur={this.#onBlur}\n onChange={this.#onChange}\n onFocus={this.#onFocus}\n ref={this.#ref}\n required={this.required}\n tabIndex={this.#computedDisabled ? undefined : this.tabIndex}\n type=\"radio\"\n value={this.value ?? undefined}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n />\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n data-size={this.#computedSize}\n library=\"core\"\n name=\"checked-radio\"\n />\n </div>\n {this.#hasText && (\n <qds-label\n class=\"qds-label-inner\"\n size={this.#computedSize}\n text={this.text}\n />\n )}\n </label>\n )\n }\n\n readonly #ref = (input?: HTMLInputElement): void => {\n this.#input = input\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onChange = (): void => {\n this.changeEmitter.emit()\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-DNHI4C-W.js","mappings":";;;;;;;;;;;;AAAA,MAAM,WAAW,GAAG,2zHAA2zH;;ACA/0H;AACA;AACA;;;;;;;;;;;;;;;;;;MAmCa,QAAQ,iBAAAA,kBAAA,CAAA,MAAA,QAAA,SAAAC,CAAA,CAAA;AANrB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;;;;AAOE;;;;;AAKG;AACqB,QAAA,IAAM,CAAA,MAAA,GAAY,KAAK;AAE/C;;AAEG;AACqB,QAAA,IAAI,CAAA,IAAA,GAAU,UAAU;AAyBhD;;;;;;;;;;;;;;;AAeG;;AAEqB,QAAA,IAAI,CAAA,IAAA,GAAsC,IAAI;AAgCtE;;;;;;AAMG;AAEa,QAAA,IAAiB,CAAA,iBAAA,GAA0C,EAAE;AAE7E;;;;;;;AAOG;AACqB,QAAA,IAAQ,CAAA,QAAA,GAAiC,WAAW;AAE5E;;;;AAIG;AACqB,QAAA,IAAK,CAAA,KAAA,GAAmB,IAAI;AAEpD;;;;;;AAMG;AACqB,QAAA,IAAY,CAAA,YAAA,GAAqC,KAAK;AAE9E;;AAEG;AACqB,QAAA,IAAY,CAAA,YAAA,GAAY,KAAK;AA0BrD,QAAA,6BAAA,CAAA,GAAA,CAAA,IAAA,EAAmC,EAAE,CAAA;AAmK9B,QAAA,IAAa,CAAA,aAAA,GAAsC,MACxD,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE;AAEzB,QAAA,IAAc,CAAA,cAAA,GAAuC,MAC1D,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;AAE1B,QAAA,IAAA,CAAA,iB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,IAAA,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,EAAE,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,YAAY;AAC3E,CAAC,EAAA,sBAAA,GAAA,SAAA,sBAAA,CAiJa,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/checkbox/checkbox.css?tag=qds-checkbox&encapsulation=shadow","src/components/checkbox/checkbox.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n line-height: 0;\n}\n\n.qds-checkbox,\n.qds-icon {\n grid-area: checkbox;\n place-self: center;\n}\n\n.qds-icon {\n display: none;\n pointer-events: none;\n color: var(--qds-theme-signature-color-contrast);\n}\n\n.qds-container {\n display: grid;\n grid-template-areas: 'checkbox';\n}\n\n.qds-label {\n cursor: pointer;\n display: inline-flex;\n width: inherit;\n border-radius: var(--qds-control-border-radius);\n align-items: flex-start;\n box-sizing: border-box;\n justify-content: center;\n background-color: var(--qds-theme-interactive-background-default);\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 &:has(.qds-checkbox:focus-visible) {\n /* inner ring */\n outline: var(--qds-theme-focus-border-contrast) solid\n var(--qds-focus-light-border-width);\n outline-offset: 0;\n\n /* outer ring */\n box-shadow: 0 0 0 var(--qds-focus-heavy-border-width)\n var(--qds-theme-focus-border);\n }\n}\n\n.qds-label-inner {\n flex: 1 1 auto;\n min-width: 0;\n width: 100%;\n}\n\n.qds-checkbox {\n appearance: none;\n background-color: var(--qds-theme-interactive-background-default);\n border: var(--qds-control-border-width) solid var(--qds-theme-control-border);\n cursor: pointer;\n margin: 0;\n print-color-adjust: exact;\n\n &:focus-visible {\n outline: none;\n }\n\n &:checked ~ .qds-checked,\n &:indeterminate ~ .qds-indeterminate {\n display: block;\n }\n\n &:checked,\n &:indeterminate {\n background-color: var(--qds-theme-control-background-contrast);\n border-color: transparent;\n }\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-size='small'] {\n /* override qds-label font design token */\n --qds-form-small-text: var(--qds-control-small-text);\n\n &.qds-checkbox {\n width: var(--qds-control-toggle-small-box-size);\n height: var(--qds-control-toggle-small-box-size);\n border-radius: var(--qds-control-toggle-small-knob-border-radius);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-small-icon-size);\n }\n\n &.qds-label {\n gap: var(--qds-control-small-gap-siblings-related);\n min-height: var(--qds-control-toggle-small-height);\n padding-block: var(--qds-control-no-inline-small-padding-vertical);\n min-width: var(--qds-control-toggle-small-width);\n }\n\n &.qds-inline {\n min-height: var(--qds-control-small-height);\n padding: var(--qds-control-small-padding-auto-height)\n var(--qds-control-toggle-small-padding-horizontal);\n }\n}\n\n[data-size='standard'] {\n /* override qds-label font design token */\n --qds-form-standard-text: var(--qds-control-standard-text);\n\n &.qds-checkbox {\n width: var(--qds-control-toggle-standard-box-size);\n height: var(--qds-control-toggle-standard-box-size);\n border-radius: var(--qds-control-toggle-standard-knob-border-radius);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-standard-icon-size);\n }\n\n &.qds-label {\n gap: var(--qds-control-standard-gap-siblings-related);\n min-height: var(--qds-control-toggle-standard-height);\n padding-block: var(--qds-control-no-inline-standard-padding-vertical);\n min-width: var(--qds-control-toggle-standard-width);\n }\n\n &.qds-inline {\n min-height: var(--qds-control-standard-height);\n padding: var(--qds-control-standard-padding-auto-height)\n var(--qds-control-toggle-standard-padding-horizontal);\n }\n}\n\n[data-size='large'] {\n /* override qds-label font design token */\n --qds-form-large-text: var(--qds-control-large-text);\n\n &.qds-checkbox {\n width: var(--qds-control-toggle-large-box-size);\n height: var(--qds-control-toggle-large-box-size);\n border-radius: var(--qds-control-toggle-large-knob-border-radius);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-large-icon-size);\n }\n\n &.qds-label {\n gap: var(--qds-control-large-gap-siblings-related);\n min-height: var(--qds-control-toggle-large-height);\n padding-block: var(--qds-control-no-inline-large-padding-vertical);\n min-width: var(--qds-control-toggle-large-width);\n }\n\n &.qds-inline {\n min-height: var(--qds-control-large-height);\n padding: var(--qds-control-large-padding-auto-height)\n var(--qds-control-toggle-large-padding-horizontal);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport { inheritAriaAttributes, pickFocusEventAttributes } from '../../helpers'\nimport { CUSTOM_ERROR_FLAGS, NO_ERROR_FLAGS, VALID_STATE } from '../controls'\nimport type { Size } from '../shared'\n\nexport type CheckboxValue = number | string | null\n\n/**\n * `<qds-checkbox>` elements are rendered as boxes that are checked (ticked)\n * when activated, like you might see in an official government paper form. A\n * checkbox allows you to select single values for submission in a form (or not).\n *\n * @see https://quartz.se.com/build/components/checkbox\n */\n@Component({\n tag: 'qds-checkbox',\n formAssociated: true,\n shadow: { delegatesFocus: true },\n styleUrl: 'checkbox.css',\n})\nexport class Checkbox implements ComponentInterface {\n /**\n * Adds vertical margin to the checkbox for alignment.\n *\n * This is useful when creating inline layouts so that the first lines have\n * the correct vertical centering.\n */\n @Prop() public readonly inline: boolean = false\n\n /**\n * The checkbox's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The checkbox's text.\n *\n * Its value will also be used as the `aria-label` value when the\n * `checkbox-only` attribute is specified.\n */\n @Prop() public readonly text!: string\n\n /**\n * Sets the checkbox's state.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public checked?: boolean\n\n /**\n * Prevents the checkbox from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop() public readonly disabled?: boolean\n\n /**\n * The [`<form>`][] element to associate the checkbox with (its form owner).\n *\n * The value of this attribute must be the id of a `<form>` in the same\n * document. If this attribute is not set, the `<qds-checkbox>` is associated\n * with its ancestor `<form>` element, if any.\n *\n * This attribute lets you associate `<qds-checkbox>` elements to `<form>`s\n * anywhere in the document, not just inside a `<form>`. It can also override\n * an ancestor `<form>` element.\n *\n * [`<form>`]: https://developer.mozilla.org/docs/Web/HTML/Element/form\n *\n * @readonly\n * @webnative\n */\n // eslint-disable-next-line unicorn/no-null\n @Prop() public readonly form: ElementInternals['form'] | string = null\n\n /**\n * Sets the checkbox to an indeterminate state. This is usually applied to\n * checkboxes that represent a \"select all/none\" behavior when associated\n * checkboxes have a mix of checked and unchecked states.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public indeterminate?: boolean\n\n /**\n * The name of the checkbox, which is submitted with the form data.\n *\n * @webnative\n */\n @Prop() public readonly name?: string\n\n /**\n * A value must be specified for the checkbox before the owning form can be\n * submitted.\n *\n * See\n * [Client-side validation](https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation)\n * and the\n * [HTML attribute: `required`](https://developer.mozilla.org/docs/Web/HTML/Attributes/required)\n * for more information.\n *\n * @webnative\n */\n @Prop() public readonly required?: boolean\n\n /**\n * The error message that would be shown to the user if the `<qds-checkbox>`\n * was to be checked for validity.\n *\n * @readonly\n * @webnative\n */\n @Prop()\n public readonly validationMessage: ElementInternals['validationMessage'] = ''\n\n /**\n * The [`ValidityState`][] object for this `<qds-checkbox>`.\n *\n * [`ValidityState`]: https://developer.mozilla.org/docs/Web/API/ValidityState\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly validity: ElementInternals['validity'] = VALID_STATE\n\n /**\n * The value of the checkbox, submitted as a name/value pair with form data.\n *\n * @webnative\n */\n @Prop() public readonly value?: CheckboxValue = 'on'\n\n /**\n * True if `<qds-checkbox>` will be validated when the form is submitted;\n * false otherwise.\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly willValidate: ElementInternals['willValidate'] = false\n\n /**\n * Whether or not the text is displayed.\n */\n @Prop() public readonly checkboxOnly: boolean = false\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n /**\n * Emitted when the checkbox loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when a change to the checkbox's state is committed by the user.\n */\n @Event({ eventName: 'qdsChange', cancelable: false })\n private readonly changeEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the checkbox gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly host!: HTMLElement\n\n @State() private tabIndex?: number\n\n #inheritedAttributes: Attributes = {}\n\n get #computedChecked(): boolean {\n return this.checked ?? false\n }\n\n get #computedDisabled(): boolean {\n return (\n (this.host.matches(':disabled') || (this.disabled ?? false)) &&\n this.host.getAttribute('disabled') !== 'false'\n )\n }\n\n get #computedIndeterminate(): boolean {\n return this.indeterminate ?? false\n }\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedValue(): string | null {\n // eslint-disable-next-line unicorn/no-null\n return this.value == null ? null : this.value.toString()\n }\n\n get #hasText(): boolean {\n return (this.text !== '' || this.required === true) && !this.checkboxOnly\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n event.preventDefault()\n\n this.checked = this.#computedIndeterminate ? true : !this.#computedChecked\n this.changeEmitter.emit()\n this.indeterminate = false\n }\n\n @Watch('checked')\n protected checkedChanged(): void {\n this.internals.setFormValue(\n this.#computedChecked && !this.#computedDisabled\n ? this.#computedValue\n : // eslint-disable-next-line unicorn/no-null\n null,\n )\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n if (this.#computedChecked && !this.#computedDisabled)\n this.internals.setFormValue(this.#computedValue)\n // eslint-disable-next-line unicorn/no-null\n else this.internals.setFormValue(null)\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n this.tabIndex =\n parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue\n }\n\n @Watch('value')\n protected valueChanged(): void {\n if (this.#computedChecked && !this.#computedDisabled)\n this.internals.setFormValue(this.#computedValue)\n }\n\n public componentWillLoad(): void {\n this.valueChanged()\n\n this.#defineGetter('form', () => this.internals.form)\n this.#defineGetter('willValidate', () => this.internals.willValidate)\n this.#defineGetter('validity', () => this.internals.validity)\n this.#defineGetter(\n 'validationMessage',\n () => this.internals.validationMessage,\n )\n\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public render() {\n return (\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n <label\n aria-disabled={this.#computedDisabled ? 'true' : undefined}\n class={{\n 'qds-inline': this.inline,\n 'qds-label': true,\n }}\n data-size={this.#computedSize}\n >\n <div class=\"qds-container\">\n <input\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={this.host.autofocus}\n checked={this.#computedIndeterminate ? false : this.checked}\n class=\"qds-checkbox\"\n data-size={this.#computedSize}\n disabled={this.#computedDisabled}\n indeterminate={this.indeterminate}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n required={this.required}\n tabIndex={this.#computedDisabled ? undefined : this.tabIndex}\n type=\"checkbox\"\n aria-label={this.checkboxOnly ? this.text : undefined}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n />\n <qds-icon\n aria-hidden=\"true\"\n class={{\n 'qds-icon': true,\n 'qds-checked': true,\n }}\n data-size={this.#computedSize}\n library=\"core\"\n name=\"checked\"\n />\n <qds-icon\n aria-hidden=\"true\"\n class={{\n 'qds-icon': true,\n 'qds-indeterminate': true,\n }}\n data-size={this.#computedSize}\n library=\"core\"\n name=\"indeterminate\"\n />\n </div>\n {this.#hasText && (\n <qds-label\n class=\"qds-label-inner\"\n required={this.required}\n size={this.size}\n text={this.text}\n tabindex={-1}\n tooltipTarget={this.host}\n />\n )}\n </label>\n )\n }\n\n public checkValidity: ElementInternals['checkValidity'] = () =>\n this.internals.checkValidity()\n\n public reportValidity: ElementInternals['reportValidity'] = () =>\n this.internals.reportValidity()\n\n public setCustomValidity: HTMLInputElement['setCustomValidity'] = (error) => {\n if (error) this.internals.setValidity(CUSTOM_ERROR_FLAGS, error, this.host)\n else this.internals.setValidity(NO_ERROR_FLAGS)\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n #defineGetter(p: PropertyKey, get: () => unknown): void {\n Object.defineProperty(this.host, p, { enumerable: true, get })\n }\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-DR79BVX5.js","mappings":";;;;;;;;;;AAAA,MAAM,MAAM,GAAG,uqHAAuqH;;ACAtrH;AACA;AACA;;;;;;;;;;;;;;;;;;MAsBa,GAAG,iBAAAA,kBAAA,CAAA,MAAA,GAAA,SAAAC,CAAA,CAAA;AALhB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;AAaE;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAW,SAAS;AAEvD;;AAEG;AACqB,QAAA,IAAU,CAAA,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,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 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 display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 5;\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 min-height: var(--qds-feedback-tag-small-height);\n border-radius: var(--qds-feedback-tag-small-border-radius);\n }\n\n &.qds-padding {\n padding: var(--qds-feedback-tag-small-padding-vertical)\n 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 min-height: var(--qds-feedback-tag-standard-height);\n border-radius: var(--qds-feedback-tag-standard-border-radius);\n }\n\n &.qds-padding {\n padding: var(--qds-feedback-tag-large-padding-vertical)\n 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 min-height: var(--qds-feedback-tag-large-height);\n border-radius: var(--qds-feedback-tag-large-border-radius);\n }\n\n &.qds-padding {\n padding: var(--qds-feedback-tag-large-padding-vertical)\n 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}
|