@quartzds/core 1.0.0-beta.32 → 1.0.0-beta.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/components/icon.js +15 -12
  2. package/components/icon.js.map +1 -1
  3. package/components/qds-button.js +4 -3
  4. package/components/qds-button.js.map +1 -1
  5. package/components/qds-list-item.js +1 -1
  6. package/components/qds-list-item.js.map +1 -1
  7. package/components/qds-standalone-link.js +2 -2
  8. package/components/qds-standalone-link.js.map +1 -1
  9. package/dist/cjs/index.cjs.js +1 -1
  10. package/dist/cjs/{library-20e64083.js → library-3260efce.js} +16 -13
  11. package/dist/cjs/library-3260efce.js.map +1 -0
  12. package/dist/cjs/qds-button.cjs.entry.js +4 -3
  13. package/dist/cjs/qds-button.cjs.entry.js.map +1 -1
  14. package/dist/cjs/qds-icon.cjs.entry.js +1 -1
  15. package/dist/cjs/qds-list-item.cjs.entry.js +1 -1
  16. package/dist/cjs/qds-list-item.cjs.entry.js.map +1 -1
  17. package/dist/cjs/qds-standalone-link.cjs.entry.js +2 -2
  18. package/dist/cjs/qds-standalone-link.cjs.entry.js.map +1 -1
  19. package/dist/docs.json +8 -4
  20. package/dist/esm/index.js +1 -1
  21. package/dist/esm/{library-1dbf5ce7.js → library-fbe2886c.js} +16 -13
  22. package/dist/esm/library-fbe2886c.js.map +1 -0
  23. package/dist/esm/qds-button.entry.js +4 -3
  24. package/dist/esm/qds-button.entry.js.map +1 -1
  25. package/dist/esm/qds-icon.entry.js +1 -1
  26. package/dist/esm/qds-list-item.entry.js +1 -1
  27. package/dist/esm/qds-list-item.entry.js.map +1 -1
  28. package/dist/esm/qds-standalone-link.entry.js +2 -2
  29. package/dist/esm/qds-standalone-link.entry.js.map +1 -1
  30. package/dist/types/components/button/button.d.ts +1 -1
  31. package/dist/vscode.html-custom-data.json +3 -0
  32. package/hydrate/index.js +22 -18
  33. package/package.json +2 -2
  34. package/dist/cjs/library-20e64083.js.map +0 -1
  35. package/dist/esm/library-1dbf5ce7.js.map +0 -1
@@ -6,34 +6,37 @@
6
6
  import { getAssetPath, proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
7
7
  import { i as inheritAriaAttributes } from './helpers.js';
8
8
 
9
- const checkedSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Im04LjEzIDEyLjk3IDQuNzYtNy4yNC44NC41NC01Ljc5IDguOC0uMzUtLjg4di0uMDFsLS4wMS0uMDJhNy4wOCA3LjA4IDAgMCAwLS4xNi0uMzYgOS4zNSA5LjM1IDAgMCAwLTEuMDYtMS44N2MtLjIzLS4zLS40My0uNDgtLjU5LS41N2wuNDYtLjg4Yy4zNi4xOC42Ny41LjkyLjg0YTguNjIgOC42MiAwIDAgMSAuOTggMS42NVoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==';
9
+ const checkedSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Im04LjEzIDEyLjk3IDQuNzYtNy4yNC44NC41NC01Ljc5IDguOC0uMzUtLjg4di0uMDFsLS4wMS0uMDJhNyA3IDAgMCAwLS4xNi0uMzYgOS40IDkuNCAwIDAgMC0xLjA2LTEuODdjLS4yMy0uMy0uNDMtLjQ4LS41OS0uNTdsLjQ2LS44OGMuMzYuMTguNjcuNS45Mi44NGE4LjYgOC42IDAgMCAxIC45OCAxLjY1IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=';
10
10
 
11
- const draggableSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBkPSJNNiA2YTIgMiAwIDEgMCAuMDAxLTMuOTk5QTIgMiAwIDAgMCA2IDZ6bTggMGEyIDIgMCAxIDAgLjAwMS0zLjk5OUEyIDIgMCAwIDAgMTQgNnpNNiAxOGEyIDIgMCAxIDAgLjAwMS0zLjk5OUEyIDIgMCAwIDAgNiAxOHptMC02YTIgMiAwIDEgMCAuMDAxLTMuOTk5QTIgMiAwIDAgMCA2IDEyem04IDBhMiAyIDAgMSAwIC4wMDEtMy45OTlBMiAyIDAgMCAwIDE0IDEyem0wIDZhMiAyIDAgMSAwIC4wMDEtMy45OTlBMiAyIDAgMCAwIDE0IDE4eiIvPjwvc3ZnPg==';
11
+ const draggableSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBkPSJNNiA2YTIgMiAwIDEgMCAuMDAxLTMuOTk5QTIgMiAwIDAgMCA2IDZtOCAwYTIgMiAwIDEgMCAuMDAxLTMuOTk5QTIgMiAwIDAgMCAxNCA2TTYgMThhMiAyIDAgMSAwIC4wMDEtMy45OTlBMiAyIDAgMCAwIDYgMThtMC02YTIgMiAwIDEgMCAuMDAxLTMuOTk5QTIgMiAwIDAgMCA2IDEybTggMGEyIDIgMCAxIDAgLjAwMS0zLjk5OUEyIDIgMCAwIDAgMTQgMTJtMCA2YTIgMiAwIDEgMCAuMDAxLTMuOTk5QTIgMiAwIDAgMCAxNCAxOCIvPjwvc3ZnPg==';
12
12
 
13
- const dropdownSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Im0uODUgNSA4LjY3IDguNjdjLjI3LjI2LjcuMjYuOTcgMEwxOS4xNSA1bC43LjctOC42NiA4LjY2Yy0uNjUuNjYtMS43Mi42Ni0yLjM3IDBMLjE1IDUuN2wuNy0uN1oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==';
13
+ const dropdownSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Im0uODUgNSA4LjY3IDguNjdjLjI3LjI2LjcuMjYuOTcgMEwxOS4xNSA1bC43LjctOC42NiA4LjY2Yy0uNjUuNjYtMS43Mi42Ni0yLjM3IDBMLjE1IDUuN3oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==';
14
14
 
15
- const externalLinkSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMy4xNiAwSDIwdjYuNzJoLTEuMDNWMS43NmwtNi40NiA2LjQ2LS43My0uNzMgNi40Ni02LjQ2aC01LjA4VjBaTTAgM2gxMS4wNXYxLjAySDEuMDN2MTQuOTVoMTVWOC41M2gxLjAyVjIwSDBWM1oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==';
15
+ const dropdownCloseSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Im0uODUgMTQuODU1IDguNjctOC42N2EuNy43IDAgMCAxIC45NyAwbDguNjYgOC42Ny43LS43LTguNjYtOC42NmMtLjY1LS42Ni0xLjcyLS42Ni0yLjM3IDBsLTguNjcgOC42NnoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==';
16
16
 
17
- const indeterminateSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNCAxMEg2VjloOHYxWiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+';
17
+ const externalLinkSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMy4xNiAwSDIwdjYuNzJoLTEuMDNWMS43NmwtNi40NiA2LjQ2LS43My0uNzMgNi40Ni02LjQ2aC01LjA4ek0wIDNoMTEuMDV2MS4wMkgxLjAzdjE0Ljk1aDE1VjguNTNoMS4wMlYyMEgweiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+';
18
18
 
19
- const navigationSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMy42NiA5LjUxIDUgLjg1bC43LS43IDguNjYgOC42NmMuNjYuNjUuNjYgMS43MiAwIDIuMzdMNS43IDE5Ljg1bC0uNy0uNyA4LjY2LTguNjdhLjY4LjY4IDAgMCAwIDAtLjk3WiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+';
19
+ const indeterminateSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNCAxMEg2VjloOHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==';
20
20
 
21
- const nextSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMy42NiA5LjUxIDUgLjg1bC43LS43IDguNjYgOC42NmMuNjYuNjUuNjYgMS43MiAwIDIuMzdMNS43IDE5Ljg1bC0uNy0uNyA4LjY2LTguNjdhLjY4LjY4IDAgMCAwIDAtLjk3WiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+';
21
+ const navigationSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMy42NiA5LjUxIDUgLjg1bC43LS43IDguNjYgOC42NmMuNjYuNjUuNjYgMS43MiAwIDIuMzdMNS43IDE5Ljg1bC0uNy0uNyA4LjY2LTguNjdhLjY4LjY4IDAgMCAwIDAtLjk3IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=';
22
22
 
23
- const statusErrorSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Im05Ljg3IDkuMiAzLjItMy4yLjcxLjctMy4yIDMuMjEgMy4yIDMuMi0uNzEuNy0zLjItMy4yLTMuMTYgMy4xNi0uNy0uN0w5LjE2IDkuOSA2IDYuNzRsLjctLjdMOS44NyA5LjJaIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=';
23
+ const nextSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMy42NiA5LjUxIDUgLjg1bC43LS43IDguNjYgOC42NmMuNjYuNjUuNjYgMS43MiAwIDIuMzdMNS43IDE5Ljg1bC0uNy0uNyA4LjY2LTguNjdhLjY4LjY4IDAgMCAwIDAtLjk3IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=';
24
24
 
25
- const statusInfoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBkPSJNOSA0aDIuNDF2Mi4xNUg5VjRabS4xMyAxMi41MVY3Ljk3aDIuMTh2OC41NEg5LjEzWiIvPjwvc3ZnPg==';
25
+ const statusErrorSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Im05Ljg3IDkuMiAzLjItMy4yLjcxLjctMy4yIDMuMjEgMy4yIDMuMi0uNzEuNy0zLjItMy4yLTMuMTYgMy4xNi0uNy0uN0w5LjE2IDkuOSA2IDYuNzRsLjctLjd6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=';
26
26
 
27
- const statusWarningSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBkPSJtOS4zMiAxMi41NC0uNy04Ljg5IDIuNzcuMDItLjcgOC44N0g5LjMyWm0tLjU4IDEuMzRoMi41MnYyLjQ4SDguNzR2LTIuNDhaIi8+PC9zdmc+';
27
+ const statusInfoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBkPSJNOSA0aDIuNDF2Mi4xNUg5em0uMTMgMTIuNTFWNy45N2gyLjE4djguNTR6Ii8+PC9zdmc+';
28
+
29
+ const statusWarningSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iY3VycmVudENvbG9yIiBkPSJtOS4zMiAxMi41NC0uNy04Ljg5IDIuNzcuMDItLjcgOC44N3ptLS41OCAxLjM0aDIuNTJ2Mi40OEg4Ljc0eiIvPjwvc3ZnPg==';
28
30
 
29
31
  // SPDX-FileCopyrightText: © 2024 Schneider Electric
30
32
  const icons = {
31
33
  /* eslint-disable @typescript-eslint/naming-convention */
34
+ checked: checkedSvg,
32
35
  draggable: draggableSvg,
36
+ dropdown: dropdownSvg,
37
+ 'dropdown-close': dropdownCloseSvg,
33
38
  'external-link': externalLinkSvg,
34
- checked: checkedSvg,
35
39
  indeterminate: indeterminateSvg,
36
- dropdown: dropdownSvg,
37
40
  navigation: navigationSvg,
38
41
  next: nextSvg,
39
42
  'status-error': statusErrorSvg,
@@ -1 +1 @@
1
- {"file":"icon.js","mappings":";;;;;;;;AAAA,MAAM,UAAU,GAAG,4cAA4c;;ACA/d,MAAM,YAAY,GAAG,4eAA4e;;ACAjgB,MAAM,WAAW,GAAG,oVAAoV;;ACAxW,MAAM,eAAe,GAAG,4WAA4W;;ACApY,MAAM,gBAAgB,GAAG,wOAAwO;;ACAjQ,MAAM,aAAa,GAAG,4VAA4V;;ACAlX,MAAM,OAAO,GAAG,4VAA4V;;ACA5W,MAAM,cAAc,GAAG,4VAA4V;;ACAnX,MAAM,aAAa,GAAG,oOAAoO;;ACA1P,MAAM,gBAAgB,GAAG,gQAAgQ;;ACAzR;AAsBA,MAAM,KAAK,GAAuC;;eAEhDA,YAAS;IACT,eAAe,EAAEC,eAAY;aAC7BC,UAAO;mBACPC,gBAAa;cACbC,WAAQ;gBACRC,aAAU;UACVC,OAAI;IACJ,cAAc,EAAEC,cAAW;IAC3B,aAAa,EAAEC,aAAU;IACzB,gBAAgB,EAAEN,UAAO;IACzB,gBAAgB,EAAEO,gBAAa;;CAEhC,CAAA;AAED,MAAM,WAAW,GAAgB;IAC/B,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE;CACtC;;ACzCD;AAQA,MAAM,OAAO,GAAgB;IAC3B,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,CAAC,IAAI,KAAK,YAAY,CAAC,SAAS,IAAI,MAAM,CAAC;CACtD;;ACXD;AAeA,IAAI,QAAQ,GAAkB,CAACC,OAAc,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AAQ,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;YACrD,IAAI,UAAU,KAAK,IAAI,EAAE;gBACvB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAA;gBACb,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;aACzB;iBAAM;gBACL,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC;oBACjE,IAAI,KAAK,KAAK,SAAS;wBAAE,UAAU,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;gBAC9D,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,SAAS,CAAA;gBAC/B,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAA;aACxB;SACF;QAAC,MAAM;YACN,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;SACzB;KACF;IAEM,MAAM,iBAAiB;QAC5B,IAAI,CAAC,mBAAmB,GAAG,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC9D,MAAM,IAAI,CAAC,OAAO,EAAE,CAAA;KACrB;IAEM,MAAM;QACX,OAAO,6DAAM,KAAK,EAAC,aAAa,EAAC,SAAS,EAAE,IAAI,CAAC,GAAG,GAAI,CAAA;KACzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["draggable","externalLink","checked","indeterminate","dropdown","navigation","next","statusError","statusInfo","statusWarning","defaultLibrary"],"sources":["../../node_modules/@quartzds/generic-icons-core/dist/checked.svg","../../node_modules/@quartzds/generic-icons-core/dist/draggable.svg","../../node_modules/@quartzds/generic-icons-core/dist/dropdown.svg","../../node_modules/@quartzds/generic-icons-core/dist/external-link.svg","../../node_modules/@quartzds/generic-icons-core/dist/indeterminate.svg","../../node_modules/@quartzds/generic-icons-core/dist/navigation.svg","../../node_modules/@quartzds/generic-icons-core/dist/next.svg","../../node_modules/@quartzds/generic-icons-core/dist/status-error.svg","../../node_modules/@quartzds/generic-icons-core/dist/status-info.svg","../../node_modules/@quartzds/generic-icons-core/dist/status-warning.svg","src/components/icon/core-library.ts","src/components/icon/default-library.ts","src/components/icon/library.ts","src/components/icon/request.ts","src/components/icon/icon.css?tag=qds-icon&encapsulation=shadow","src/components/icon/icon.tsx"],"sourcesContent":["<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"m8.13 12.97 4.76-7.24.84.54-5.79 8.8-.35-.88v-.01l-.01-.02a7.08 7.08 0 0 0-.16-.36 9.35 9.35 0 0 0-1.06-1.87c-.23-.3-.43-.48-.59-.57l.46-.88c.36.18.67.5.92.84a8.62 8.62 0 0 1 .98 1.65Z\" clip-rule=\"evenodd\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" d=\"M6 6a2 2 0 1 0 .001-3.999A2 2 0 0 0 6 6zm8 0a2 2 0 1 0 .001-3.999A2 2 0 0 0 14 6zM6 18a2 2 0 1 0 .001-3.999A2 2 0 0 0 6 18zm0-6a2 2 0 1 0 .001-3.999A2 2 0 0 0 6 12zm8 0a2 2 0 1 0 .001-3.999A2 2 0 0 0 14 12zm0 6a2 2 0 1 0 .001-3.999A2 2 0 0 0 14 18z\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"m.85 5 8.67 8.67c.27.26.7.26.97 0L19.15 5l.7.7-8.66 8.66c-.65.66-1.72.66-2.37 0L.15 5.7l.7-.7Z\" clip-rule=\"evenodd\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M13.16 0H20v6.72h-1.03V1.76l-6.46 6.46-.73-.73 6.46-6.46h-5.08V0ZM0 3h11.05v1.02H1.03v14.95h15V8.53h1.02V20H0V3Z\" clip-rule=\"evenodd\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M14 10H6V9h8v1Z\" clip-rule=\"evenodd\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M13.66 9.51 5 .85l.7-.7 8.66 8.66c.66.65.66 1.72 0 2.37L5.7 19.85l-.7-.7 8.66-8.67a.68.68 0 0 0 0-.97Z\" clip-rule=\"evenodd\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M13.66 9.51 5 .85l.7-.7 8.66 8.66c.66.65.66 1.72 0 2.37L5.7 19.85l-.7-.7 8.66-8.67a.68.68 0 0 0 0-.97Z\" clip-rule=\"evenodd\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"m9.87 9.2 3.2-3.2.71.7-3.2 3.21 3.2 3.2-.71.7-3.2-3.2-3.16 3.16-.7-.7L9.16 9.9 6 6.74l.7-.7L9.87 9.2Z\" clip-rule=\"evenodd\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" d=\"M9 4h2.41v2.15H9V4Zm.13 12.51V7.97h2.18v8.54H9.13Z\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" d=\"m9.32 12.54-.7-8.89 2.77.02-.7 8.87H9.32Zm-.58 1.34h2.52v2.48H8.74v-2.48Z\"/></svg>","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\n// FIXME: TypeScript and Webpack can resolve exports from the package.json\n// `exports` field but Rollup can't. `@quartzds/generic-icons-core/*.svg`\n// _should_ work but it doesn't.\n/* eslint-disable import/no-unresolved */\nimport checked from '@quartzds/generic-icons-core/dist/checked.svg'\nimport draggable from '@quartzds/generic-icons-core/dist/draggable.svg'\nimport dropdown from '@quartzds/generic-icons-core/dist/dropdown.svg'\nimport externalLink from '@quartzds/generic-icons-core/dist/external-link.svg'\nimport indeterminate from '@quartzds/generic-icons-core/dist/indeterminate.svg'\nimport navigation from '@quartzds/generic-icons-core/dist/navigation.svg'\nimport next from '@quartzds/generic-icons-core/dist/next.svg'\nimport statusError from '@quartzds/generic-icons-core/dist/status-error.svg'\nimport statusInfo from '@quartzds/generic-icons-core/dist/status-info.svg'\nimport statusWarning from '@quartzds/generic-icons-core/dist/status-warning.svg'\n\n/* eslint-enable import/no-unresolved */\nimport type { IconLibrary } from './library'\n\nconst icons: Record<string, string | undefined> = {\n /* eslint-disable @typescript-eslint/naming-convention */\n draggable,\n 'external-link': externalLink,\n checked,\n indeterminate,\n dropdown,\n navigation,\n next,\n 'status-error': statusError,\n 'status-info': statusInfo,\n 'status-success': checked,\n 'status-warning': statusWarning,\n /* eslint-enable @typescript-eslint/naming-convention */\n}\n\nconst coreLibrary: IconLibrary = {\n name: 'core',\n resolver: (name) => icons[name] ?? '',\n}\n\nexport default coreLibrary\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getAssetPath } from '@stencil/core'\n\nimport type { IconLibrary } from './library'\n\nconst library: IconLibrary = {\n name: 'default',\n resolver: (name) => getAssetPath(`icons/${name}.svg`),\n}\n\nexport default library\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Except } from 'type-fest'\n\nimport coreLibrary from './core-library'\nimport defaultLibrary from './default-library'\n\nexport type IconLibraryResolver = (name: string) => string\nexport interface IconLibrary {\n name: string\n resolver: IconLibraryResolver\n}\n\nlet registry: IconLibrary[] = [defaultLibrary, coreLibrary]\n\n/**\n * Returns a library from the registry.\n */\nexport const getIconLibrary = (name: string): IconLibrary | undefined =>\n registry.find((library) => library.name === name)\n\n/**\n * Removes an icon library from the registry.\n */\nexport const unregisterIconLibrary = (name: string): void => {\n registry = registry.filter((library) => library.name !== name)\n}\n\n/**\n * Adds an icon library to the registry or overrides an existing one.\n */\nexport const registerIconLibrary = (\n name: string,\n options: Except<IconLibrary, 'name'>,\n): void => {\n unregisterIconLibrary(name)\n registry.push({\n name,\n ...options,\n })\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\ninterface Request {\n ok: boolean\n data: string\n}\n\ninterface IconRequestOk {\n ok: true\n data: string\n}\n\ninterface IconRequestError {\n ok: false\n data: undefined\n}\n\ntype IconRequest = IconRequestError | IconRequestOk\n\ninterface IconRequestUnknown {\n ok: boolean\n data?: string\n}\n\nconst request = async (source: string): Promise<Request> => {\n const response = await fetch(source, { mode: 'cors' })\n return {\n ok: response.ok,\n data: await response.text(),\n }\n}\n\nconst cachedIconRequests = new Map<string, IconRequest>()\n\nconst requestIcon = async (url: string): Promise<IconRequest> => {\n const cachedIconRequest = cachedIconRequests.get(url)\n if (cachedIconRequest) return cachedIconRequest\n\n const fileData = await request(url)\n const iconFileData: IconRequestUnknown = {\n ok: fileData.ok,\n }\n if (fileData.ok) {\n const div = document.createElement('div')\n div.innerHTML = fileData.data\n const child = div.firstElementChild\n iconFileData.data =\n child?.tagName.toLowerCase() === 'svg' ? child.outerHTML : ''\n }\n\n cachedIconRequests.set(url, iconFileData as IconRequest)\n return iconFileData as IconRequest\n}\n\nexport default requestIcon\n","/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n contain: strict;\n display: inline-block;\n height: 1em;\n width: 1em;\n}\n\n.qds-wrapper {\n display: contents;\n}\n\nsvg {\n display: block;\n fill: currentcolor;\n height: 100%;\n width: 100%;\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport { Component, Element, Event, h, Prop, State, Watch } from '@stencil/core'\n\nimport type { Attributes } from '../../helpers'\nimport { inheritAriaAttributes } from '../../helpers'\nimport { getIconLibrary } from './library'\nimport requestIcon from './request'\n\nlet parser: DOMParser | undefined\n\n/**\n * @experimental\n */\n@Component({\n tag: 'qds-icon',\n shadow: true,\n styleUrl: 'icon.css',\n})\nexport class Icon implements ComponentInterface {\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly name!: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly library: string = 'default'\n\n /**\n * Emitted when the icon has loaded.\n */\n @Event({ eventName: 'qdsLoad', cancelable: false })\n private readonly loadEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the icon fails to load due to an error.\n */\n @Event({ eventName: 'qdsError', cancelable: false })\n private readonly errorEmitter!: EventEmitter<void>\n\n @Element() private readonly element!: HTMLQdsIconElement\n\n @State() private svg = ''\n\n private inheritedAttributes: Attributes = {}\n\n @Watch('name')\n @Watch('library')\n private async setIcon(): Promise<void> {\n if (!this.name) return\n\n const library = getIconLibrary(this.library)\n if (!library) return\n\n const url = library.resolver(this.name)\n if (!url) {\n this.svg = ''\n return\n }\n\n try {\n const request = await requestIcon(url)\n if (!request.ok) {\n this.svg = ''\n this.errorEmitter.emit()\n return\n }\n\n // Create an instance of the DOM parser. We do it here instead of at the\n // top-level to support SSR while maintaining a single parser instance\n // for optimal performance.\n parser ||= new DOMParser()\n const document = parser.parseFromString(request.data, 'text/html')\n const svgElement = document.body.querySelector('svg')\n if (svgElement === null) {\n this.svg = ''\n this.errorEmitter.emit()\n } else {\n for (const [key, value] of Object.entries(this.inheritedAttributes))\n if (value !== undefined) svgElement.setAttribute(key, value)\n this.svg = svgElement.outerHTML\n this.loadEmitter.emit()\n }\n } catch {\n this.errorEmitter.emit()\n }\n }\n\n public async componentWillLoad(): Promise<void> {\n this.inheritedAttributes = inheritAriaAttributes(this.element)\n await this.setIcon()\n }\n\n public render() {\n return <span class=\"qds-wrapper\" innerHTML={this.svg} />\n }\n}\n"],"version":3}
1
+ {"file":"icon.js","mappings":";;;;;;;;AAAA,MAAM,UAAU,GAAG,4bAA4b;;ACA/c,MAAM,YAAY,GAAG,oeAAoe;;ACAzf,MAAM,WAAW,GAAG,4UAA4U;;ACAhW,MAAM,gBAAgB,GAAG,4VAA4V;;ACArX,MAAM,eAAe,GAAG,oWAAoW;;ACA5X,MAAM,gBAAgB,GAAG,wOAAwO;;ACAjQ,MAAM,aAAa,GAAG,4VAA4V;;ACAlX,MAAM,OAAO,GAAG,4VAA4V;;ACA5W,MAAM,cAAc,GAAG,gVAAgV;;ACAvW,MAAM,aAAa,GAAG,wNAAwN;;ACA9O,MAAM,gBAAgB,GAAG,oPAAoP;;ACA7Q;AAuBA,MAAM,KAAK,GAAuC;;aAEhDA,UAAO;eACPC,YAAS;cACTC,WAAQ;IACR,gBAAgB,EAAEC,gBAAa;IAC/B,eAAe,EAAEC,eAAY;mBAC7BC,gBAAa;gBACbC,aAAU;UACVC,OAAI;IACJ,cAAc,EAAEC,cAAW;IAC3B,aAAa,EAAEC,aAAU;IACzB,gBAAgB,EAAET,UAAO;IACzB,gBAAgB,EAAEU,gBAAa;;CAEhC,CAAA;AAED,MAAM,WAAW,GAAgB;IAC/B,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE;CACtC;;AC3CD;AAQA,MAAM,OAAO,GAAgB;IAC3B,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,CAAC,IAAI,KAAK,YAAY,CAAC,SAAS,IAAI,MAAM,CAAC;CACtD;;ACXD;AAeA,IAAI,QAAQ,GAAkB,CAACC,OAAc,EAAE,WAAW,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IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;YACrD,IAAI,UAAU,KAAK,IAAI,EAAE;gBACvB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAA;gBACb,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;aACzB;iBAAM;gBACL,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC;oBACjE,IAAI,KAAK,KAAK,SAAS;wBAAE,UAAU,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;gBAC9D,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,SAAS,CAAA;gBAC/B,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAA;aACxB;SACF;QAAC,MAAM;YACN,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;SACzB;KACF;IAEM,MAAM,iBAAiB;QAC5B,IAAI,CAAC,mBAAmB,GAAG,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC9D,MAAM,IAAI,CAAC,OAAO,EAAE,CAAA;KACrB;IAEM,MAAM;QACX,OAAO,6DAAM,KAAK,EAAC,aAAa,EAAC,SAAS,EAAE,IAAI,CAAC,GAAG,GAAI,CAAA;KACzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["checked","draggable","dropdown","dropdownClose","externalLink","indeterminate","navigation","next","statusError","statusInfo","statusWarning","defaultLibrary"],"sources":["../../node_modules/@quartzds/generic-icons-core/dist/checked.svg","../../node_modules/@quartzds/generic-icons-core/dist/draggable.svg","../../node_modules/@quartzds/generic-icons-core/dist/dropdown.svg","../../node_modules/@quartzds/generic-icons-core/dist/dropdown-close.svg","../../node_modules/@quartzds/generic-icons-core/dist/external-link.svg","../../node_modules/@quartzds/generic-icons-core/dist/indeterminate.svg","../../node_modules/@quartzds/generic-icons-core/dist/navigation.svg","../../node_modules/@quartzds/generic-icons-core/dist/next.svg","../../node_modules/@quartzds/generic-icons-core/dist/status-error.svg","../../node_modules/@quartzds/generic-icons-core/dist/status-info.svg","../../node_modules/@quartzds/generic-icons-core/dist/status-warning.svg","src/components/icon/core-library.ts","src/components/icon/default-library.ts","src/components/icon/library.ts","src/components/icon/request.ts","src/components/icon/icon.css?tag=qds-icon&encapsulation=shadow","src/components/icon/icon.tsx"],"sourcesContent":["<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"m8.13 12.97 4.76-7.24.84.54-5.79 8.8-.35-.88v-.01l-.01-.02a7 7 0 0 0-.16-.36 9.4 9.4 0 0 0-1.06-1.87c-.23-.3-.43-.48-.59-.57l.46-.88c.36.18.67.5.92.84a8.6 8.6 0 0 1 .98 1.65\" clip-rule=\"evenodd\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" d=\"M6 6a2 2 0 1 0 .001-3.999A2 2 0 0 0 6 6m8 0a2 2 0 1 0 .001-3.999A2 2 0 0 0 14 6M6 18a2 2 0 1 0 .001-3.999A2 2 0 0 0 6 18m0-6a2 2 0 1 0 .001-3.999A2 2 0 0 0 6 12m8 0a2 2 0 1 0 .001-3.999A2 2 0 0 0 14 12m0 6a2 2 0 1 0 .001-3.999A2 2 0 0 0 14 18\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"m.85 5 8.67 8.67c.27.26.7.26.97 0L19.15 5l.7.7-8.66 8.66c-.65.66-1.72.66-2.37 0L.15 5.7z\" clip-rule=\"evenodd\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"m.85 14.855 8.67-8.67a.7.7 0 0 1 .97 0l8.66 8.67.7-.7-8.66-8.66c-.65-.66-1.72-.66-2.37 0l-8.67 8.66z\" clip-rule=\"evenodd\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M13.16 0H20v6.72h-1.03V1.76l-6.46 6.46-.73-.73 6.46-6.46h-5.08zM0 3h11.05v1.02H1.03v14.95h15V8.53h1.02V20H0z\" clip-rule=\"evenodd\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M14 10H6V9h8z\" clip-rule=\"evenodd\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M13.66 9.51 5 .85l.7-.7 8.66 8.66c.66.65.66 1.72 0 2.37L5.7 19.85l-.7-.7 8.66-8.67a.68.68 0 0 0 0-.97\" clip-rule=\"evenodd\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M13.66 9.51 5 .85l.7-.7 8.66 8.66c.66.65.66 1.72 0 2.37L5.7 19.85l-.7-.7 8.66-8.67a.68.68 0 0 0 0-.97\" clip-rule=\"evenodd\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"m9.87 9.2 3.2-3.2.71.7-3.2 3.21 3.2 3.2-.71.7-3.2-3.2-3.16 3.16-.7-.7L9.16 9.9 6 6.74l.7-.7z\" clip-rule=\"evenodd\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" d=\"M9 4h2.41v2.15H9zm.13 12.51V7.97h2.18v8.54z\"/></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" d=\"m9.32 12.54-.7-8.89 2.77.02-.7 8.87zm-.58 1.34h2.52v2.48H8.74z\"/></svg>","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\n// FIXME: TypeScript and Webpack can resolve exports from the package.json\n// `exports` field but Rollup can't. `@quartzds/generic-icons-core/*.svg`\n// _should_ work but it doesn't.\n/* eslint-disable import/no-unresolved */\nimport checked from '@quartzds/generic-icons-core/dist/checked.svg'\nimport draggable from '@quartzds/generic-icons-core/dist/draggable.svg'\nimport dropdown from '@quartzds/generic-icons-core/dist/dropdown.svg'\nimport dropdownClose from '@quartzds/generic-icons-core/dist/dropdown-close.svg'\nimport externalLink from '@quartzds/generic-icons-core/dist/external-link.svg'\nimport indeterminate from '@quartzds/generic-icons-core/dist/indeterminate.svg'\nimport navigation from '@quartzds/generic-icons-core/dist/navigation.svg'\nimport next from '@quartzds/generic-icons-core/dist/next.svg'\nimport statusError from '@quartzds/generic-icons-core/dist/status-error.svg'\nimport statusInfo from '@quartzds/generic-icons-core/dist/status-info.svg'\nimport statusWarning from '@quartzds/generic-icons-core/dist/status-warning.svg'\n\n/* eslint-enable import/no-unresolved */\nimport type { IconLibrary } from './library'\n\nconst icons: Record<string, string | undefined> = {\n /* eslint-disable @typescript-eslint/naming-convention */\n checked,\n draggable,\n dropdown,\n 'dropdown-close': dropdownClose,\n 'external-link': externalLink,\n indeterminate,\n navigation,\n next,\n 'status-error': statusError,\n 'status-info': statusInfo,\n 'status-success': checked,\n 'status-warning': statusWarning,\n /* eslint-enable @typescript-eslint/naming-convention */\n}\n\nconst coreLibrary: IconLibrary = {\n name: 'core',\n resolver: (name) => icons[name] ?? '',\n}\n\nexport default coreLibrary\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getAssetPath } from '@stencil/core'\n\nimport type { IconLibrary } from './library'\n\nconst library: IconLibrary = {\n name: 'default',\n resolver: (name) => getAssetPath(`icons/${name}.svg`),\n}\n\nexport default library\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Except } from 'type-fest'\n\nimport coreLibrary from './core-library'\nimport defaultLibrary from './default-library'\n\nexport type IconLibraryResolver = (name: string) => string\nexport interface IconLibrary {\n name: string\n resolver: IconLibraryResolver\n}\n\nlet registry: IconLibrary[] = [defaultLibrary, coreLibrary]\n\n/**\n * Returns a library from the registry.\n */\nexport const getIconLibrary = (name: string): IconLibrary | undefined =>\n registry.find((library) => library.name === name)\n\n/**\n * Removes an icon library from the registry.\n */\nexport const unregisterIconLibrary = (name: string): void => {\n registry = registry.filter((library) => library.name !== name)\n}\n\n/**\n * Adds an icon library to the registry or overrides an existing one.\n */\nexport const registerIconLibrary = (\n name: string,\n options: Except<IconLibrary, 'name'>,\n): void => {\n unregisterIconLibrary(name)\n registry.push({\n name,\n ...options,\n })\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\ninterface Request {\n ok: boolean\n data: string\n}\n\ninterface IconRequestOk {\n ok: true\n data: string\n}\n\ninterface IconRequestError {\n ok: false\n data: undefined\n}\n\ntype IconRequest = IconRequestError | IconRequestOk\n\ninterface IconRequestUnknown {\n ok: boolean\n data?: string\n}\n\nconst request = async (source: string): Promise<Request> => {\n const response = await fetch(source, { mode: 'cors' })\n return {\n ok: response.ok,\n data: await response.text(),\n }\n}\n\nconst cachedIconRequests = new Map<string, IconRequest>()\n\nconst requestIcon = async (url: string): Promise<IconRequest> => {\n const cachedIconRequest = cachedIconRequests.get(url)\n if (cachedIconRequest) return cachedIconRequest\n\n const fileData = await request(url)\n const iconFileData: IconRequestUnknown = {\n ok: fileData.ok,\n }\n if (fileData.ok) {\n const div = document.createElement('div')\n div.innerHTML = fileData.data\n const child = div.firstElementChild\n iconFileData.data =\n child?.tagName.toLowerCase() === 'svg' ? child.outerHTML : ''\n }\n\n cachedIconRequests.set(url, iconFileData as IconRequest)\n return iconFileData as IconRequest\n}\n\nexport default requestIcon\n","/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n contain: strict;\n display: inline-block;\n height: 1em;\n width: 1em;\n}\n\n.qds-wrapper {\n display: contents;\n}\n\nsvg {\n display: block;\n fill: currentcolor;\n height: 100%;\n width: 100%;\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport { Component, Element, Event, h, Prop, State, Watch } from '@stencil/core'\n\nimport type { Attributes } from '../../helpers'\nimport { inheritAriaAttributes } from '../../helpers'\nimport { getIconLibrary } from './library'\nimport requestIcon from './request'\n\nlet parser: DOMParser | undefined\n\n/**\n * @experimental\n */\n@Component({\n tag: 'qds-icon',\n shadow: true,\n styleUrl: 'icon.css',\n})\nexport class Icon implements ComponentInterface {\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly name!: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly library: string = 'default'\n\n /**\n * Emitted when the icon has loaded.\n */\n @Event({ eventName: 'qdsLoad', cancelable: false })\n private readonly loadEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the icon fails to load due to an error.\n */\n @Event({ eventName: 'qdsError', cancelable: false })\n private readonly errorEmitter!: EventEmitter<void>\n\n @Element() private readonly element!: HTMLQdsIconElement\n\n @State() private svg = ''\n\n private inheritedAttributes: Attributes = {}\n\n @Watch('name')\n @Watch('library')\n private async setIcon(): Promise<void> {\n if (!this.name) return\n\n const library = getIconLibrary(this.library)\n if (!library) return\n\n const url = library.resolver(this.name)\n if (!url) {\n this.svg = ''\n return\n }\n\n try {\n const request = await requestIcon(url)\n if (!request.ok) {\n this.svg = ''\n this.errorEmitter.emit()\n return\n }\n\n // Create an instance of the DOM parser. We do it here instead of at the\n // top-level to support SSR while maintaining a single parser instance\n // for optimal performance.\n parser ||= new DOMParser()\n const document = parser.parseFromString(request.data, 'text/html')\n const svgElement = document.body.querySelector('svg')\n if (svgElement === null) {\n this.svg = ''\n this.errorEmitter.emit()\n } else {\n for (const [key, value] of Object.entries(this.inheritedAttributes))\n if (value !== undefined) svgElement.setAttribute(key, value)\n this.svg = svgElement.outerHTML\n this.loadEmitter.emit()\n }\n } catch {\n this.errorEmitter.emit()\n }\n }\n\n public async componentWillLoad(): Promise<void> {\n this.inheritedAttributes = inheritAriaAttributes(this.element)\n await this.setIcon()\n }\n\n public render() {\n return <span class=\"qds-wrapper\" innerHTML={this.svg} />\n }\n}\n"],"version":3}
@@ -7,7 +7,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/i
7
7
  import { p as pickFocusEventAttributes, i as inheritAriaAttributes } from './helpers.js';
8
8
  import { d as defineCustomElement$2 } from './icon.js';
9
9
 
10
- const buttonCss = ":host([hidden]){display:none !important}:host{display:inline-block}.qds-button{align-items:center;-webkit-appearance:none;appearance:none;background-color:initial;border:none;box-sizing:border-box;cursor:pointer;display:inline-flex;justify-content:center;padding-block:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;-webkit-user-select:none;user-select:none;white-space:nowrap;width:100%}.qds-button:any-link{-webkit-text-decoration:none;text-decoration:none}.qds-button:focus-visible{outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset)}.qds-badge{border-radius:var(--qds-control-rounded-border-radius);font:var(--qds-badge-text);height:var(--qds-badge-height);padding-inline:var(--qds-badge-padding-horizontal)}[aria-disabled='true']{opacity:var(--qds-theme-disabled);pointer-events:none}[data-size='small']{font:var(--qds-control-small-text)}.qds-button[data-size='small']{gap:var(--qds-control-small-gap-internal);height:var(--qds-control-small-height);padding-inline:var(--qds-control-button-small-padding-horizontal)}.qds-icon-only[data-size='small']{width:var(--qds-control-small-height)}.qds-icon[data-size='small']{font-size:var(--qds-control-small-icon-size)}[data-size='standard']{font:var(--qds-control-standard-text)}.qds-button[data-size='standard']{gap:var(--qds-control-standard-gap-internal);height:var(--qds-control-standard-height);padding-inline:var(--qds-control-button-standard-padding-horizontal)}.qds-icon-only[data-size='standard']{width:var(--qds-control-standard-height)}.qds-icon[data-size='standard']{font-size:var(--qds-control-standard-icon-size)}[data-size='large']{font:var(--qds-control-large-text)}.qds-button[data-size='large']{gap:var(--qds-control-large-gap-internal);height:var(--qds-control-large-height);padding-inline:var(--qds-control-button-large-padding-horizontal)}.qds-icon-only[data-size='large']{width:var(--qds-control-large-height)}.qds-icon[data-size='large']{font-size:var(--qds-control-large-icon-size)}.qds-button[data-importance='standard'],.qds-button[data-importance='emphasized'],.qds-button[data-variant='destructive']{border-radius:var(--qds-control-border-radius)}[data-importance='subdued']{color:var(--qds-theme-link-standard-default)}.qds-badge[data-importance='subdued']{background-color:var(--qds-theme-feedback-message-informational);color:var(--qds-theme-feedback-message-informational-contrast)}.qds-icon-only[data-importance='subdued']{color:var(--qds-theme-control-text-standard)}.qds-button[data-importance='subdued']{padding-inline:0}.qds-button[data-importance='subdued']:hover{border-block-end:var(--qds-control-border-width) solid\n var(--qds-theme-link-standard-hover);color:var(--qds-theme-link-standard-hover)}.qds-button[data-importance='subdued']:hover .qds-badge{background-color:var(--qds-theme-link-standard-hover)}.qds-button.qds-icon-only[data-importance='subdued']:hover{background-color:var(--qds-theme-interactive-background-hover);border:none;color:var(--qds-theme-control-text-standard)}.qds-button[data-importance='subdued']:active{border-block-end:var(--qds-control-border-width) solid\n var(--qds-theme-link-standard-pressed);color:var(--qds-theme-link-standard-pressed)}.qds-button[data-importance='subdued']:active .qds-badge{background-color:var(--qds-theme-link-standard-pressed)}.qds-button.qds-icon-only[data-importance='subdued']:active{background-color:var(--qds-theme-interactive-background-pressed);border:none;color:var(--qds-theme-control-text-standard)}[data-importance='standard']{color:var(--qds-theme-control-text-standard)}.qds-badge[data-importance='standard']{background-color:var(--qds-theme-feedback-message-neutral);color:var(--qds-theme-feedback-message-neutral-contrast)}.qds-button[data-importance='standard']{border:var(--qds-control-border-width) solid\n var(--qds-theme-control-border)}.qds-button[data-importance='standard']:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-button[data-importance='standard']:hover .qds-badge{color:var(--qds-theme-interactive-background-hover)}.qds-button[data-importance='standard']:active{background-color:var(--qds-theme-interactive-background-pressed)}.qds-button[data-importance='standard']:active .qds-badge{color:var(--qds-theme-interactive-background-pressed)}.qds-badge[data-importance='emphasized']{background-color:var(--qds-theme-signature-color-contrast);color:var(--qds-theme-signature-color-default)}.qds-button[data-importance='emphasized']{background-color:var(--qds-theme-signature-color-default);color:var(--qds-theme-signature-color-contrast)}.qds-button[data-importance='emphasized']:hover{background-color:var(--qds-theme-signature-color-hover)}.qds-button[data-importance='emphasized']:hover .qds-badge{color:var(--qds-theme-signature-color-hover)}.qds-button[data-importance='emphasized']:active{background-color:var(--qds-theme-signature-color-pressed)}.qds-button[data-importance='emphasized']:active .qds-badge{color:var(--qds-theme-signature-color-pressed)}.qds-badge[data-variant='destructive']{background-color:var(--qds-theme-feedback-action-destructive-contrast);color:var(--qds-theme-feedback-action-destructive-default)}.qds-button[data-variant='destructive']{background-color:var(--qds-theme-feedback-action-destructive-default);color:var(--qds-theme-feedback-action-destructive-contrast)}.qds-button[data-variant='destructive']:hover{background-color:var(--qds-theme-feedback-action-destructive-hover)}.qds-button[data-variant='destructive']:hover .qds-badge{color:var(--qds-theme-feedback-action-destructive-hover)}.qds-button[data-variant='destructive']:active{background-color:var(--qds-theme-feedback-action-destructive-pressed)}.qds-button[data-variant='destructive']:active .qds-badge{color:var(--qds-theme-feedback-action-destructive-pressed)}.qds-button[data-variant='hero']{border-radius:var(--qds-control-hero-border-radius);font:var(--qds-control-hero-text);gap:var(--qds-control-hero-gap-internal);height:var(--qds-control-hero-height)}.qds-button[data-variant='hero']:not([data-importance='subdued']){padding-inline:var(--qds-control-button-hero-padding-horizontal)}.qds-icon-only[data-variant='hero']{width:var(--qds-control-hero-height)}.qds-icon[data-variant='hero']{font-size:var(--qds-control-hero-icon-size)}.qds-icon-only[data-size='small'],.qds-icon-only[data-size='standard'],.qds-icon-only[data-size='large'],.qds-icon-only[data-variant='hero']{padding-inline:0}";
10
+ const buttonCss = ":host([hidden]){display:none !important}:host{display:inline-block}.qds-action{transform:scaleX(var(--qds-direction-factor, 1))}.qds-button{align-items:center;-webkit-appearance:none;appearance:none;background-color:initial;border:none;box-sizing:border-box;cursor:pointer;display:inline-flex;justify-content:center;padding-block:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;-webkit-user-select:none;user-select:none;white-space:nowrap;width:100%}.qds-button:any-link{-webkit-text-decoration:none;text-decoration:none}.qds-button:focus-visible{outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset)}.qds-badge{border-radius:var(--qds-control-rounded-border-radius);font:var(--qds-badge-text);height:var(--qds-badge-height);padding-inline:var(--qds-badge-padding-horizontal)}[aria-disabled='true']{opacity:var(--qds-theme-disabled);pointer-events:none}[data-size='small']{font:var(--qds-control-small-text)}.qds-button[data-size='small']{gap:var(--qds-control-small-gap-internal);height:var(--qds-control-small-height);padding-inline:var(--qds-control-button-small-padding-horizontal)}.qds-icon-only[data-size='small']{width:var(--qds-control-small-height)}.qds-icon[data-size='small']{font-size:var(--qds-control-small-icon-size)}[data-size='standard']{font:var(--qds-control-standard-text)}.qds-button[data-size='standard']{gap:var(--qds-control-standard-gap-internal);height:var(--qds-control-standard-height);padding-inline:var(--qds-control-button-standard-padding-horizontal)}.qds-icon-only[data-size='standard']{width:var(--qds-control-standard-height)}.qds-icon[data-size='standard']{font-size:var(--qds-control-standard-icon-size)}[data-size='large']{font:var(--qds-control-large-text)}.qds-button[data-size='large']{gap:var(--qds-control-large-gap-internal);height:var(--qds-control-large-height);padding-inline:var(--qds-control-button-large-padding-horizontal)}.qds-icon-only[data-size='large']{width:var(--qds-control-large-height)}.qds-icon[data-size='large']{font-size:var(--qds-control-large-icon-size)}.qds-button[data-importance='standard'],.qds-button[data-importance='emphasized'],.qds-button[data-variant='destructive']{border-radius:var(--qds-control-border-radius)}[data-importance='subdued']{color:var(--qds-theme-link-standard-default)}.qds-badge[data-importance='subdued']{background-color:var(--qds-theme-feedback-message-informational);color:var(--qds-theme-feedback-message-informational-contrast)}.qds-icon-only[data-importance='subdued']{color:var(--qds-theme-control-text-standard)}.qds-button[data-importance='subdued']{padding-inline:0}.qds-button[data-importance='subdued']:hover{border-block-end:var(--qds-control-border-width) solid\n var(--qds-theme-link-standard-hover);color:var(--qds-theme-link-standard-hover)}.qds-button[data-importance='subdued']:hover .qds-badge{background-color:var(--qds-theme-link-standard-hover)}.qds-button.qds-icon-only[data-importance='subdued']:hover{background-color:var(--qds-theme-interactive-background-hover);border:none;color:var(--qds-theme-control-text-standard)}.qds-button[data-importance='subdued']:active{border-block-end:var(--qds-control-border-width) solid\n var(--qds-theme-link-standard-pressed);color:var(--qds-theme-link-standard-pressed)}.qds-button[data-importance='subdued']:active .qds-badge{background-color:var(--qds-theme-link-standard-pressed)}.qds-button.qds-icon-only[data-importance='subdued']:active{background-color:var(--qds-theme-interactive-background-pressed);border:none;color:var(--qds-theme-control-text-standard)}[data-importance='standard']{color:var(--qds-theme-control-text-standard)}.qds-badge[data-importance='standard']{background-color:var(--qds-theme-feedback-message-neutral);color:var(--qds-theme-feedback-message-neutral-contrast)}.qds-button[data-importance='standard']{border:var(--qds-control-border-width) solid\n var(--qds-theme-control-border)}.qds-button[data-importance='standard']:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-button[data-importance='standard']:hover .qds-badge{color:var(--qds-theme-interactive-background-hover)}.qds-button[data-importance='standard']:active{background-color:var(--qds-theme-interactive-background-pressed)}.qds-button[data-importance='standard']:active .qds-badge{color:var(--qds-theme-interactive-background-pressed)}.qds-badge[data-importance='emphasized']{background-color:var(--qds-theme-signature-color-contrast);color:var(--qds-theme-signature-color-default)}.qds-button[data-importance='emphasized']{background-color:var(--qds-theme-signature-color-default);color:var(--qds-theme-signature-color-contrast)}.qds-button[data-importance='emphasized']:hover{background-color:var(--qds-theme-signature-color-hover)}.qds-button[data-importance='emphasized']:hover .qds-badge{color:var(--qds-theme-signature-color-hover)}.qds-button[data-importance='emphasized']:active{background-color:var(--qds-theme-signature-color-pressed)}.qds-button[data-importance='emphasized']:active .qds-badge{color:var(--qds-theme-signature-color-pressed)}.qds-badge[data-variant='destructive']{background-color:var(--qds-theme-feedback-action-destructive-contrast);color:var(--qds-theme-feedback-action-destructive-default)}.qds-button[data-variant='destructive']{background-color:var(--qds-theme-feedback-action-destructive-default);color:var(--qds-theme-feedback-action-destructive-contrast)}.qds-button[data-variant='destructive']:hover{background-color:var(--qds-theme-feedback-action-destructive-hover)}.qds-button[data-variant='destructive']:hover .qds-badge{color:var(--qds-theme-feedback-action-destructive-hover)}.qds-button[data-variant='destructive']:active{background-color:var(--qds-theme-feedback-action-destructive-pressed)}.qds-button[data-variant='destructive']:active .qds-badge{color:var(--qds-theme-feedback-action-destructive-pressed)}.qds-button[data-variant='hero']{border-radius:var(--qds-control-hero-border-radius);font:var(--qds-control-hero-text);gap:var(--qds-control-hero-gap-internal);height:var(--qds-control-hero-height)}.qds-button[data-variant='hero']:not([data-importance='subdued']){padding-inline:var(--qds-control-button-hero-padding-horizontal)}.qds-icon-only[data-variant='hero']{width:var(--qds-control-hero-height)}.qds-icon[data-variant='hero']{font-size:var(--qds-control-hero-icon-size)}.qds-icon-only[data-size='small'],.qds-icon-only[data-size='standard'],.qds-icon-only[data-size='large'],.qds-icon-only[data-variant='hero']{padding-inline:0}";
11
11
  const QdsButtonStyle0 = buttonCss;
12
12
 
13
13
  const Button = /*@__PURE__*/ proxyCustomElement(class Button extends HTMLElement {
@@ -63,6 +63,7 @@ const Button = /*@__PURE__*/ proxyCustomElement(class Button extends HTMLElement
63
63
  get computedAction() {
64
64
  switch (this.action) {
65
65
  case 'dropdown':
66
+ case 'dropdown-close':
66
67
  case 'next': {
67
68
  return this.action;
68
69
  }
@@ -135,10 +136,10 @@ const Button = /*@__PURE__*/ proxyCustomElement(class Button extends HTMLElement
135
136
  }
136
137
  render() {
137
138
  const Tag = this.href === undefined ? 'button' : 'a';
138
- return (h(Tag, { key: '9dcddb1e442cb2305de879c4c7eef2749617a1c0', "aria-disabled": this.computedDisabled.toString(), class: {
139
+ return (h(Tag, { key: 'aa439b980fbe2f233204bfc272bfe14a83136f4d', "aria-disabled": this.computedDisabled.toString(), class: {
139
140
  'qds-button': true,
140
141
  'qds-icon-only': this.iconOnly,
141
- }, "data-importance": this.computedImportance, "data-size": this.computedSize, "data-variant": this.variant, disabled: Tag === 'a' ? undefined : this.disabled, download: Tag === 'a' ? this.download : undefined, href: Tag === 'a' ? this.href : undefined, name: Tag === 'a' ? undefined : this.name, onBlur: this.onBlur, onFocus: this.onFocus, rel: Tag === 'a' ? 'noreferrer noopener' : undefined, role: Tag === 'a' ? 'button' : undefined, tabIndex: this.computedDisabled ? -1 : this.computedTabIndex, target: Tag === 'a' ? this.target : undefined, type: Tag === 'a' ? undefined : this.buttonType, value: Tag === 'a' ? undefined : this.value, ...this.inheritedAttributes }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { class: "qds-icon", "data-size": this.computedSize, "data-variant": this.variant, library: this.iconLibrary, name: this.iconName })), this.text, this.badge !== undefined && this.badge !== '' && (h("div", { class: "qds-badge", "data-importance": this.computedImportance, "data-variant": this.variant }, this.badge)), this.computedAction !== undefined && (h("qds-icon", { class: "qds-icon", library: "core", name: this.computedAction }))));
142
+ }, "data-importance": this.computedImportance, "data-size": this.computedSize, "data-variant": this.variant, disabled: Tag === 'a' ? undefined : this.disabled, download: Tag === 'a' ? this.download : undefined, href: Tag === 'a' ? this.href : undefined, name: Tag === 'a' ? undefined : this.name, onBlur: this.onBlur, onFocus: this.onFocus, rel: Tag === 'a' ? 'noreferrer noopener' : undefined, role: Tag === 'a' ? 'button' : undefined, tabIndex: this.computedDisabled ? -1 : this.computedTabIndex, target: Tag === 'a' ? this.target : undefined, type: Tag === 'a' ? undefined : this.buttonType, value: Tag === 'a' ? undefined : this.value, ...this.inheritedAttributes }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { class: "qds-icon", "data-size": this.computedSize, "data-variant": this.variant, library: this.iconLibrary, name: this.iconName })), this.text, this.badge !== undefined && this.badge !== '' && (h("div", { class: "qds-badge", "data-importance": this.computedImportance, "data-variant": this.variant }, this.badge)), this.computedAction !== undefined && (h("qds-icon", { class: "qds-icon qds-action", library: "core", name: this.computedAction }))));
142
143
  }
143
144
  static get delegatesFocus() { return true; }
144
145
  get element() { return this; }
@@ -1 +1 @@
1
- {"file":"qds-button.js","mappings":";;;;;;;;;AAAA,MAAM,SAAS,GAAG,y2MAAy2M,CAAC;AAC53M,wBAAe,SAAS;;MC+BX,MAAM;;;;;;;QAiOT,wBAAmB,GAAe,EAAE,CAAA;QAgK3B,WAAM,GAAG,CAAC,KAAiB;YAC1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACvD,CAAA;QAEgB,YAAO,GAAG,CAAC,KAAiB;YAC3C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACxD,CAAA;;;;2BAlX6C,SAAS;0BAKL,UAAU;oBAKtB,UAAU;;;;;;;;8BAyFN,KAAK;0BA4BkB,OAAO;;;;;;;IA+ExE,IAAY,WAAW;QACrB,OAAO,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE;cAC9C,QAAQ,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;cACvC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;KACjC;IAED,IAAY,UAAU;QACpB,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,IAAI,CA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C,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,EAAE,KAClD,gBACE,KAAK,EAAC,UAAU,eACL,IAAI,CAAC,YAAY,kBACd,IAAI,CAAC,OAAO,EAC1B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAE,IAAI,CAAC,QAAQ,GACnB,CACH,EACA,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,EAAE,KAC5C,WACE,KAAK,EAAC,WAAW,qBACA,IAAI,CAAC,kBAAkB,kBAC1B,IAAI,CAAC,OAAO,IAEzB,IAAI,CAAC,KAAK,CACP,CACP,EACA,IAAI,CAAC,cAAc,KAAK,SAAS,KAChC,gBACE,KAAK,EAAC,UAAU,EAChB,OAAO,EAAC,MAAM,EACd,IAAI,EAAE,IAAI,CAAC,cAAc,GACzB,CACH,CACG,EACP;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/button/button.css?tag=qds-button&encapsulation=shadow","src/components/button/button.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n.qds-button {\n align-items: center;\n appearance: none;\n background-color: initial;\n border: none;\n box-sizing: border-box;\n cursor: pointer;\n display: inline-flex;\n justify-content: center;\n padding-block: 0;\n print-color-adjust: exact;\n user-select: none;\n white-space: nowrap;\n width: 100%;\n\n &:any-link {\n text-decoration: none;\n }\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n }\n}\n\n.qds-badge {\n border-radius: var(--qds-control-rounded-border-radius);\n font: var(--qds-badge-text);\n height: var(--qds-badge-height);\n padding-inline: var(--qds-badge-padding-horizontal);\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-size='small'] {\n font: var(--qds-control-small-text);\n\n &.qds-button {\n gap: var(--qds-control-small-gap-internal);\n height: var(--qds-control-small-height);\n padding-inline: var(--qds-control-button-small-padding-horizontal);\n }\n\n &.qds-icon-only {\n width: var(--qds-control-small-height);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n font: var(--qds-control-standard-text);\n\n &.qds-button {\n gap: var(--qds-control-standard-gap-internal);\n height: var(--qds-control-standard-height);\n padding-inline: var(--qds-control-button-standard-padding-horizontal);\n }\n\n &.qds-icon-only {\n width: var(--qds-control-standard-height);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n font: var(--qds-control-large-text);\n\n &.qds-button {\n gap: var(--qds-control-large-gap-internal);\n height: var(--qds-control-large-height);\n padding-inline: var(--qds-control-button-large-padding-horizontal);\n }\n\n &.qds-icon-only {\n width: var(--qds-control-large-height);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-large-icon-size);\n }\n}\n\n[data-importance='standard'],\n[data-importance='emphasized'],\n[data-variant='destructive'] {\n &.qds-button {\n border-radius: var(--qds-control-border-radius);\n }\n}\n\n[data-importance='subdued'] {\n color: var(--qds-theme-link-standard-default);\n\n &.qds-badge {\n background-color: var(--qds-theme-feedback-message-informational);\n color: var(--qds-theme-feedback-message-informational-contrast);\n }\n\n &.qds-icon-only {\n color: var(--qds-theme-control-text-standard);\n }\n\n &.qds-button {\n padding-inline: 0;\n\n &:hover {\n border-block-end: var(--qds-control-border-width) solid\n var(--qds-theme-link-standard-hover);\n color: var(--qds-theme-link-standard-hover);\n\n .qds-badge {\n background-color: var(--qds-theme-link-standard-hover);\n }\n\n &.qds-icon-only {\n background-color: var(--qds-theme-interactive-background-hover);\n border: none;\n color: var(--qds-theme-control-text-standard);\n }\n }\n\n &:active {\n border-block-end: var(--qds-control-border-width) solid\n var(--qds-theme-link-standard-pressed);\n color: var(--qds-theme-link-standard-pressed);\n\n .qds-badge {\n background-color: var(--qds-theme-link-standard-pressed);\n }\n\n &.qds-icon-only {\n background-color: var(--qds-theme-interactive-background-pressed);\n border: none;\n color: var(--qds-theme-control-text-standard);\n }\n }\n }\n}\n\n[data-importance='standard'] {\n color: var(--qds-theme-control-text-standard);\n\n &.qds-badge {\n background-color: var(--qds-theme-feedback-message-neutral);\n color: var(--qds-theme-feedback-message-neutral-contrast);\n }\n\n &.qds-button {\n border: var(--qds-control-border-width) solid\n var(--qds-theme-control-border);\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n\n .qds-badge {\n color: var(--qds-theme-interactive-background-hover);\n }\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n\n .qds-badge {\n color: var(--qds-theme-interactive-background-pressed);\n }\n }\n }\n}\n\n[data-importance='emphasized'] {\n &.qds-badge {\n background-color: var(--qds-theme-signature-color-contrast);\n color: var(--qds-theme-signature-color-default);\n }\n\n &.qds-button {\n background-color: var(--qds-theme-signature-color-default);\n color: var(--qds-theme-signature-color-contrast);\n\n &:hover {\n background-color: var(--qds-theme-signature-color-hover);\n\n .qds-badge {\n color: var(--qds-theme-signature-color-hover);\n }\n }\n\n &:active {\n background-color: var(--qds-theme-signature-color-pressed);\n\n .qds-badge {\n color: var(--qds-theme-signature-color-pressed);\n }\n }\n }\n}\n\n[data-variant='destructive'] {\n &.qds-badge {\n background-color: var(--qds-theme-feedback-action-destructive-contrast);\n color: var(--qds-theme-feedback-action-destructive-default);\n }\n\n &.qds-button {\n background-color: var(--qds-theme-feedback-action-destructive-default);\n color: var(--qds-theme-feedback-action-destructive-contrast);\n\n &:hover {\n background-color: var(--qds-theme-feedback-action-destructive-hover);\n\n .qds-badge {\n color: var(--qds-theme-feedback-action-destructive-hover);\n }\n }\n\n &:active {\n background-color: var(--qds-theme-feedback-action-destructive-pressed);\n\n .qds-badge {\n color: var(--qds-theme-feedback-action-destructive-pressed);\n }\n }\n }\n}\n\n[data-variant='hero'] {\n &.qds-button {\n border-radius: var(--qds-control-hero-border-radius);\n font: var(--qds-control-hero-text);\n gap: var(--qds-control-hero-gap-internal);\n height: var(--qds-control-hero-height);\n }\n\n &.qds-button:not([data-importance='subdued']) {\n padding-inline: var(--qds-control-button-hero-padding-horizontal);\n }\n\n &.qds-icon-only {\n width: var(--qds-control-hero-height);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-hero-icon-size);\n }\n}\n\n[data-size='small'],\n[data-size='standard'],\n[data-size='large'],\n[data-variant='hero'] {\n &.qds-icon-only {\n padding-inline: 0;\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 { Component, Element, Event, h, Listen, Prop } from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport { inheritAriaAttributes, pickFocusEventAttributes } from '../../helpers'\nimport type { Importance, Size } from '../shared'\n\nexport type Action = 'dropdown' | 'next'\nexport type ButtonTarget = '_blank' | '_parent' | '_self' | '_top'\nexport type ButtonType = 'button' | 'reset' | 'submit'\nexport type FormMethod = 'dialog' | 'get' | 'post'\nexport type ButtonVariant = 'destructive' | 'hero'\n\n/**\n * The `<qds-button>` element is an interactive element activated by a user\n * with a mouse, keyboard, finger, voice command, or other assistive technology.\n * Once activated, it then performs a programmable action, such as submitting a\n * [form](https://developer.mozilla.org/docs/Learn/Forms)\n * or opening a dialog.\n *\n * @see https://quartz.se.com/build/components/button\n */\n@Component({\n tag: 'qds-button',\n shadow: { delegatesFocus: true },\n styleUrl: 'button.css',\n})\nexport class Button implements ComponentInterface {\n /**\n * The name of the action icon to render.\n */\n @Prop() public readonly action?: Action\n\n /**\n * The button's badge text.\n */\n @Prop() public readonly badge?: string\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The button's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * The button's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The button's text.\n */\n @Prop() public readonly text?: string\n\n /**\n * The button's variant.\n */\n @Prop() public readonly variant?: ButtonVariant\n\n /**\n * Prevents the button from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop()\n public readonly disabled?: boolean\n\n /**\n * Tells the browser to download the linked file as this filename. Only used\n * when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly download?: string\n\n /**\n * The [`<form>`](https://developer.mozilla.org/docs/Web/HTML/Element/form)\n * element to associate the button with (its form owner).\n *\n * The value of this attribute must be the id of a `<form>` in the same\n * document. If this attribute is not set, the `<button>` is associated with\n * its ancestor `<form>` element, if any.\n *\n * This attribute lets you associate `<button>` elements to `<form>`s\n * anywhere in the document, not just inside a `<form>`. It can also override\n * an ancestor `<form>` element.\n *\n * @webnative\n */\n @Prop() public readonly form?: string\n\n /**\n * The URL that processes the information submitted by the button. Overrides\n * the [`action`](https://developer.mozilla.org/docs/Web/HTML/Element/button#attr-formaction)\n * attribute of the button's form owner. Does nothing if there is no form owner.\n *\n * @webnative\n */\n @Prop({ attribute: 'formaction' }) public readonly formAction?: string\n\n /**\n * If the button is a submit button (it's inside/associated with a `<form>`\n * and doesn't have `type=\"button\"`), this attribute specifies the\n * [HTTP method][] used to submit the form, or `dialog` which won't submit\n * the form. Possible values:\n *\n * - `get`: The form data are appended to the form's action URL, with a ? as\n * a separator, and the resulting URL is sent to the server. Use this method\n * when the form has no side effects, like search forms.\n * - `post`: The data from the form are included in the body of the HTTP\n * request when sent to the server. Use when the form contains information\n * that shouldn't be public, like login credentials.\n * - `dialog`: Close the dialog box in which the button finds itself, if any,\n * and do not submit the button's form owner.\n *\n * If specified, this attribute overrides the `method` attribute of the\n * button's form owner.\n *\n * [HTTP method]: https://developer.mozilla.org/docs/Web/HTTP/Methods\n *\n * @webnative\n */\n @Prop({ attribute: 'formmethod' }) public readonly formMethod?: FormMethod\n\n /**\n * If the button is a submit button, this attribute specifies that the form\n * is not to be\n * [validated](https://developer.mozilla.org/docs/Learn/Forms/Form_validation)\n * when it is submitted. If this attribute is specified, it overrides the\n * [`novalidate`](https://developer.mozilla.org/docs/Web/HTML/Element/form#attr-novalidate)\n * attribute of the button's form owner.\n *\n * @webnative\n */\n @Prop({ attribute: 'formnovalidate' })\n public readonly formNoValidate: boolean = false\n\n /**\n * If the button is a submit button, this attribute is an author-defined name\n * or standardized, underscore-prefixed keyword indicating where to display\n * the response from submitting the form. This is the `name` of, or keyword\n * for, a browsing context (a tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe)).\n * If this attribute is specified, it overrides the\n * [`target`](https://developer.mozilla.org/docs/Web/HTML/Element/form#attr-target)\n * attribute of the button's form owner. The following keywords have special\n * meanings:\n *\n * - `_blank`: Load the response into a new unnamed browsing context — usually\n * a new tab or window, depending on the user's browser settings.\n * - `_parent`: Load the response into the parent browsing context of the\n * current one. If there is no parent, this option behaves the same way as\n * `_self`.\n * - `_self`: Load the response into the same browsing context as the current\n * one.\n * - `_top`: Load the response into the top-level browsing context (that is,\n * the browsing context that is an ancestor of the current one, and has no\n * parent). If there is no parent, this option behaves the same way as\n * `_self`.\n *\n * @webnative\n */\n @Prop({ attribute: 'formtarget' })\n public readonly formTarget: LiteralUnion<ButtonTarget, string> = '_self'\n\n /**\n * When set, the underlying button will be rendered as an `<a>` with this\n * `href` instead of a `<button>`.\n *\n * @webnative\n */\n @Prop() public readonly href?: string\n\n /**\n * The name of the button, submitted as a pair with the button's `value` as\n * part of the form data, when that button is used to submit the form.\n * Ignored when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly name?: string\n\n /**\n * Where to display the linked URL, as the name for a browsing context (a\n * tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe).\n * The following keywords have special meanings for where to load the URL:\n *\n * - `_blank`: usually a new tab, but users can configure browsers to open a new\n * window instead.\n * - `_parent`: the parent browsing context of the current one. If no parent,\n * behaves as `_self`.\n * - `_self`: the current browsing context.\n * - `_top`: the topmost browsing context (the \"highest\" context that's an\n * ancestor of the current one). If no ancestors, behaves as `_self`.\n *\n * @webnative\n */\n @Prop() public readonly target?: LiteralUnion<ButtonTarget, string>\n\n /**\n * The type of button.\n *\n * `button`: The button has no default behavior, and does nothing when\n * pressed by default. It can have client-side scripts listen to the\n * element's events, which are triggered when the events occur.\n *\n * `submit`: The button submits the form data to the server. This is the\n * default if the attribute is not specified for buttons associated with a\n * `<form>`, or if the attribute is an empty or invalid value.\n *\n * `reset`: The button resets all the controls to their initial values.\n *\n * @webnative\n */\n @Prop() public readonly type?: ButtonType\n\n /**\n * Defines the value associated with the button's `name` when it's submitted\n * with the form data. This value is passed to the server in params when the\n * form is submitted using this button. Ignored when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly value?: string\n\n /**\n * Emitted when the button loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the button gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly element!: HTMLQdsButtonElement\n\n private inheritedAttributes: Attributes = {}\n\n private get formElement(): HTMLElement | null {\n return this.form !== undefined && this.form !== ''\n ? document.querySelector(`#${this.form}`)\n : this.element.closest('form')\n }\n\n private get buttonType(): ButtonType {\n if (this.type === undefined) return this.formElement ? 'submit' : 'button'\n return this.type\n }\n\n private get iconOnly(): boolean {\n const hasIcon = this.iconName !== undefined && this.iconName !== ''\n const hasNoLabel = this.text === undefined || this.text === ''\n\n return hasIcon && hasNoLabel\n }\n\n private get computedAction(): Action | undefined {\n switch (this.action) {\n case 'dropdown':\n case 'next': {\n return this.action\n }\n default: {\n return undefined\n }\n }\n }\n\n private get computedDisabled(): boolean {\n return this.disabled ?? false\n }\n\n private get computedImportance(): Importance | undefined {\n if (this.variant === 'destructive') return undefined\n\n switch (this.importance) {\n case 'emphasized':\n case 'subdued': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n private get computedSize(): Size | undefined {\n if (this.variant === 'hero') return undefined\n\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 private get computedTabIndex(): number {\n const parsedValue = Number.parseInt(\n this.inheritedAttributes.tabindex ?? '0',\n 10,\n )\n return Number.isNaN(parsedValue) ? 0 : parsedValue\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n if (this.buttonType === 'button' || !this.formElement) return\n event.preventDefault()\n\n const fakeButton = document.createElement('button')\n fakeButton.type = this.buttonType\n if (this.name !== undefined) fakeButton.name = this.name\n if (this.value !== undefined) fakeButton.value = this.value\n if (this.formAction !== undefined) fakeButton.formAction = this.formAction\n if (this.formMethod !== undefined) fakeButton.formMethod = this.formMethod\n fakeButton.formNoValidate = this.formNoValidate\n fakeButton.formTarget = this.formTarget\n fakeButton.style.display = 'none'\n\n this.formElement.append(fakeButton)\n fakeButton.click()\n fakeButton.remove()\n }\n\n public componentWillLoad(): void {\n this.inheritedAttributes = inheritAriaAttributes(this.element)\n }\n\n public render() {\n const Tag = this.href === undefined ? 'button' : 'a'\n\n return (\n <Tag\n aria-disabled={this.computedDisabled.toString()}\n class={{\n 'qds-button': true,\n 'qds-icon-only': this.iconOnly,\n }}\n data-importance={this.computedImportance}\n data-size={this.computedSize}\n data-variant={this.variant}\n disabled={Tag === 'a' ? undefined : this.disabled}\n download={Tag === 'a' ? this.download : undefined}\n href={Tag === 'a' ? this.href : undefined}\n name={Tag === 'a' ? undefined : this.name}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n rel={Tag === 'a' ? 'noreferrer noopener' : undefined}\n role={Tag === 'a' ? 'button' : undefined}\n tabIndex={this.computedDisabled ? -1 : this.computedTabIndex}\n target={Tag === 'a' ? this.target : undefined}\n type={Tag === 'a' ? undefined : this.buttonType}\n value={Tag === 'a' ? undefined : this.value}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n class=\"qds-icon\"\n data-size={this.computedSize}\n data-variant={this.variant}\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n {this.text}\n {this.badge !== undefined && this.badge !== '' && (\n <div\n class=\"qds-badge\"\n data-importance={this.computedImportance}\n data-variant={this.variant}\n >\n {this.badge}\n </div>\n )}\n {this.computedAction !== undefined && (\n <qds-icon\n class=\"qds-icon\"\n library=\"core\"\n name={this.computedAction}\n />\n )}\n </Tag>\n )\n }\n\n private readonly onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n private readonly onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n}\n"],"version":3}
1
+ {"file":"qds-button.js","mappings":";;;;;;;;;AAAA,MAAM,SAAS,GAAG,s6MAAs6M,CAAC;AACz7M,wBAAe,SAAS;;MC+BX,MAAM;;;;;;;QAiOT,wBAAmB,GAAe,EAAE,CAAA;QAiK3B,WAAM,GAAG,CAAC,KAAiB;YAC1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACvD,CAAA;QAEgB,YAAO,GAAG,CAAC,KAAiB;YAC3C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACxD,CAAA;;;;2BAnX6C,SAAS;0BAKL,UAAU;oBAKtB,UAAU;;;;;;;;8BAyFN,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QAAQ,GAAG,SAAS,EACxC,QAAQ,EAAE,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,gBAAgB,EAC5D,MAAM,EAAE,GAAG,KAAK,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,SAAS,EAC7C,IAAI,EAAE,GAAG,KAAK,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,UAAU,EAC/C,KAAK,EAAE,GAAG,KAAK,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,KAAK,KAEvC,IAAI,CAAC,mBAAmB,IAE3B,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,EAAE,KAClD,gBACE,KAAK,EAAC,UAAU,eACL,IAAI,CAAC,YAAY,kBACd,IAAI,CAAC,OAAO,EAC1B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAE,IAAI,CAAC,QAAQ,GACnB,CACH,EACA,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,EAAE,KAC5C,WACE,KAAK,EAAC,WAAW,qBACA,IAAI,CAAC,kBAAkB,kBAC1B,IAAI,CAAC,OAAO,IAEzB,IAAI,CAAC,KAAK,CACP,CACP,EACA,IAAI,CAAC,cAAc,KAAK,SAAS,KAChC,gBACE,KAAK,EAAC,qBAAqB,EAC3B,OAAO,EAAC,MAAM,EACd,IAAI,EAAE,IAAI,CAAC,cAAc,GACzB,CACH,CACG,EACP;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/button/button.css?tag=qds-button&encapsulation=shadow","src/components/button/button.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n.qds-action {\n transform: scaleX(var(--qds-direction-factor, 1));\n}\n\n.qds-button {\n align-items: center;\n appearance: none;\n background-color: initial;\n border: none;\n box-sizing: border-box;\n cursor: pointer;\n display: inline-flex;\n justify-content: center;\n padding-block: 0;\n print-color-adjust: exact;\n user-select: none;\n white-space: nowrap;\n width: 100%;\n\n &:any-link {\n text-decoration: none;\n }\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n }\n}\n\n.qds-badge {\n border-radius: var(--qds-control-rounded-border-radius);\n font: var(--qds-badge-text);\n height: var(--qds-badge-height);\n padding-inline: var(--qds-badge-padding-horizontal);\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-size='small'] {\n font: var(--qds-control-small-text);\n\n &.qds-button {\n gap: var(--qds-control-small-gap-internal);\n height: var(--qds-control-small-height);\n padding-inline: var(--qds-control-button-small-padding-horizontal);\n }\n\n &.qds-icon-only {\n width: var(--qds-control-small-height);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n font: var(--qds-control-standard-text);\n\n &.qds-button {\n gap: var(--qds-control-standard-gap-internal);\n height: var(--qds-control-standard-height);\n padding-inline: var(--qds-control-button-standard-padding-horizontal);\n }\n\n &.qds-icon-only {\n width: var(--qds-control-standard-height);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n font: var(--qds-control-large-text);\n\n &.qds-button {\n gap: var(--qds-control-large-gap-internal);\n height: var(--qds-control-large-height);\n padding-inline: var(--qds-control-button-large-padding-horizontal);\n }\n\n &.qds-icon-only {\n width: var(--qds-control-large-height);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-large-icon-size);\n }\n}\n\n[data-importance='standard'],\n[data-importance='emphasized'],\n[data-variant='destructive'] {\n &.qds-button {\n border-radius: var(--qds-control-border-radius);\n }\n}\n\n[data-importance='subdued'] {\n color: var(--qds-theme-link-standard-default);\n\n &.qds-badge {\n background-color: var(--qds-theme-feedback-message-informational);\n color: var(--qds-theme-feedback-message-informational-contrast);\n }\n\n &.qds-icon-only {\n color: var(--qds-theme-control-text-standard);\n }\n\n &.qds-button {\n padding-inline: 0;\n\n &:hover {\n border-block-end: var(--qds-control-border-width) solid\n var(--qds-theme-link-standard-hover);\n color: var(--qds-theme-link-standard-hover);\n\n .qds-badge {\n background-color: var(--qds-theme-link-standard-hover);\n }\n\n &.qds-icon-only {\n background-color: var(--qds-theme-interactive-background-hover);\n border: none;\n color: var(--qds-theme-control-text-standard);\n }\n }\n\n &:active {\n border-block-end: var(--qds-control-border-width) solid\n var(--qds-theme-link-standard-pressed);\n color: var(--qds-theme-link-standard-pressed);\n\n .qds-badge {\n background-color: var(--qds-theme-link-standard-pressed);\n }\n\n &.qds-icon-only {\n background-color: var(--qds-theme-interactive-background-pressed);\n border: none;\n color: var(--qds-theme-control-text-standard);\n }\n }\n }\n}\n\n[data-importance='standard'] {\n color: var(--qds-theme-control-text-standard);\n\n &.qds-badge {\n background-color: var(--qds-theme-feedback-message-neutral);\n color: var(--qds-theme-feedback-message-neutral-contrast);\n }\n\n &.qds-button {\n border: var(--qds-control-border-width) solid\n var(--qds-theme-control-border);\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n\n .qds-badge {\n color: var(--qds-theme-interactive-background-hover);\n }\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n\n .qds-badge {\n color: var(--qds-theme-interactive-background-pressed);\n }\n }\n }\n}\n\n[data-importance='emphasized'] {\n &.qds-badge {\n background-color: var(--qds-theme-signature-color-contrast);\n color: var(--qds-theme-signature-color-default);\n }\n\n &.qds-button {\n background-color: var(--qds-theme-signature-color-default);\n color: var(--qds-theme-signature-color-contrast);\n\n &:hover {\n background-color: var(--qds-theme-signature-color-hover);\n\n .qds-badge {\n color: var(--qds-theme-signature-color-hover);\n }\n }\n\n &:active {\n background-color: var(--qds-theme-signature-color-pressed);\n\n .qds-badge {\n color: var(--qds-theme-signature-color-pressed);\n }\n }\n }\n}\n\n[data-variant='destructive'] {\n &.qds-badge {\n background-color: var(--qds-theme-feedback-action-destructive-contrast);\n color: var(--qds-theme-feedback-action-destructive-default);\n }\n\n &.qds-button {\n background-color: var(--qds-theme-feedback-action-destructive-default);\n color: var(--qds-theme-feedback-action-destructive-contrast);\n\n &:hover {\n background-color: var(--qds-theme-feedback-action-destructive-hover);\n\n .qds-badge {\n color: var(--qds-theme-feedback-action-destructive-hover);\n }\n }\n\n &:active {\n background-color: var(--qds-theme-feedback-action-destructive-pressed);\n\n .qds-badge {\n color: var(--qds-theme-feedback-action-destructive-pressed);\n }\n }\n }\n}\n\n[data-variant='hero'] {\n &.qds-button {\n border-radius: var(--qds-control-hero-border-radius);\n font: var(--qds-control-hero-text);\n gap: var(--qds-control-hero-gap-internal);\n height: var(--qds-control-hero-height);\n }\n\n &.qds-button:not([data-importance='subdued']) {\n padding-inline: var(--qds-control-button-hero-padding-horizontal);\n }\n\n &.qds-icon-only {\n width: var(--qds-control-hero-height);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-hero-icon-size);\n }\n}\n\n[data-size='small'],\n[data-size='standard'],\n[data-size='large'],\n[data-variant='hero'] {\n &.qds-icon-only {\n padding-inline: 0;\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 { Component, Element, Event, h, Listen, Prop } from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport { inheritAriaAttributes, pickFocusEventAttributes } from '../../helpers'\nimport type { Importance, Size } from '../shared'\n\nexport type Action = 'dropdown-close' | 'dropdown' | 'next'\nexport type ButtonTarget = '_blank' | '_parent' | '_self' | '_top'\nexport type ButtonType = 'button' | 'reset' | 'submit'\nexport type FormMethod = 'dialog' | 'get' | 'post'\nexport type ButtonVariant = 'destructive' | 'hero'\n\n/**\n * The `<qds-button>` element is an interactive element activated by a user\n * with a mouse, keyboard, finger, voice command, or other assistive technology.\n * Once activated, it then performs a programmable action, such as submitting a\n * [form](https://developer.mozilla.org/docs/Learn/Forms)\n * or opening a dialog.\n *\n * @see https://quartz.se.com/build/components/button\n */\n@Component({\n tag: 'qds-button',\n shadow: { delegatesFocus: true },\n styleUrl: 'button.css',\n})\nexport class Button implements ComponentInterface {\n /**\n * The name of the action icon to render.\n */\n @Prop() public readonly action?: Action\n\n /**\n * The button's badge text.\n */\n @Prop() public readonly badge?: string\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The button's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * The button's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The button's text.\n */\n @Prop() public readonly text?: string\n\n /**\n * The button's variant.\n */\n @Prop() public readonly variant?: ButtonVariant\n\n /**\n * Prevents the button from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop()\n public readonly disabled?: boolean\n\n /**\n * Tells the browser to download the linked file as this filename. Only used\n * when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly download?: string\n\n /**\n * The [`<form>`](https://developer.mozilla.org/docs/Web/HTML/Element/form)\n * element to associate the button with (its form owner).\n *\n * The value of this attribute must be the id of a `<form>` in the same\n * document. If this attribute is not set, the `<button>` is associated with\n * its ancestor `<form>` element, if any.\n *\n * This attribute lets you associate `<button>` elements to `<form>`s\n * anywhere in the document, not just inside a `<form>`. It can also override\n * an ancestor `<form>` element.\n *\n * @webnative\n */\n @Prop() public readonly form?: string\n\n /**\n * The URL that processes the information submitted by the button. Overrides\n * the [`action`](https://developer.mozilla.org/docs/Web/HTML/Element/button#attr-formaction)\n * attribute of the button's form owner. Does nothing if there is no form owner.\n *\n * @webnative\n */\n @Prop({ attribute: 'formaction' }) public readonly formAction?: string\n\n /**\n * If the button is a submit button (it's inside/associated with a `<form>`\n * and doesn't have `type=\"button\"`), this attribute specifies the\n * [HTTP method][] used to submit the form, or `dialog` which won't submit\n * the form. Possible values:\n *\n * - `get`: The form data are appended to the form's action URL, with a ? as\n * a separator, and the resulting URL is sent to the server. Use this method\n * when the form has no side effects, like search forms.\n * - `post`: The data from the form are included in the body of the HTTP\n * request when sent to the server. Use when the form contains information\n * that shouldn't be public, like login credentials.\n * - `dialog`: Close the dialog box in which the button finds itself, if any,\n * and do not submit the button's form owner.\n *\n * If specified, this attribute overrides the `method` attribute of the\n * button's form owner.\n *\n * [HTTP method]: https://developer.mozilla.org/docs/Web/HTTP/Methods\n *\n * @webnative\n */\n @Prop({ attribute: 'formmethod' }) public readonly formMethod?: FormMethod\n\n /**\n * If the button is a submit button, this attribute specifies that the form\n * is not to be\n * [validated](https://developer.mozilla.org/docs/Learn/Forms/Form_validation)\n * when it is submitted. If this attribute is specified, it overrides the\n * [`novalidate`](https://developer.mozilla.org/docs/Web/HTML/Element/form#attr-novalidate)\n * attribute of the button's form owner.\n *\n * @webnative\n */\n @Prop({ attribute: 'formnovalidate' })\n public readonly formNoValidate: boolean = false\n\n /**\n * If the button is a submit button, this attribute is an author-defined name\n * or standardized, underscore-prefixed keyword indicating where to display\n * the response from submitting the form. This is the `name` of, or keyword\n * for, a browsing context (a tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe)).\n * If this attribute is specified, it overrides the\n * [`target`](https://developer.mozilla.org/docs/Web/HTML/Element/form#attr-target)\n * attribute of the button's form owner. The following keywords have special\n * meanings:\n *\n * - `_blank`: Load the response into a new unnamed browsing context — usually\n * a new tab or window, depending on the user's browser settings.\n * - `_parent`: Load the response into the parent browsing context of the\n * current one. If there is no parent, this option behaves the same way as\n * `_self`.\n * - `_self`: Load the response into the same browsing context as the current\n * one.\n * - `_top`: Load the response into the top-level browsing context (that is,\n * the browsing context that is an ancestor of the current one, and has no\n * parent). If there is no parent, this option behaves the same way as\n * `_self`.\n *\n * @webnative\n */\n @Prop({ attribute: 'formtarget' })\n public readonly formTarget: LiteralUnion<ButtonTarget, string> = '_self'\n\n /**\n * When set, the underlying button will be rendered as an `<a>` with this\n * `href` instead of a `<button>`.\n *\n * @webnative\n */\n @Prop() public readonly href?: string\n\n /**\n * The name of the button, submitted as a pair with the button's `value` as\n * part of the form data, when that button is used to submit the form.\n * Ignored when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly name?: string\n\n /**\n * Where to display the linked URL, as the name for a browsing context (a\n * tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe).\n * The following keywords have special meanings for where to load the URL:\n *\n * - `_blank`: usually a new tab, but users can configure browsers to open a new\n * window instead.\n * - `_parent`: the parent browsing context of the current one. If no parent,\n * behaves as `_self`.\n * - `_self`: the current browsing context.\n * - `_top`: the topmost browsing context (the \"highest\" context that's an\n * ancestor of the current one). If no ancestors, behaves as `_self`.\n *\n * @webnative\n */\n @Prop() public readonly target?: LiteralUnion<ButtonTarget, string>\n\n /**\n * The type of button.\n *\n * `button`: The button has no default behavior, and does nothing when\n * pressed by default. It can have client-side scripts listen to the\n * element's events, which are triggered when the events occur.\n *\n * `submit`: The button submits the form data to the server. This is the\n * default if the attribute is not specified for buttons associated with a\n * `<form>`, or if the attribute is an empty or invalid value.\n *\n * `reset`: The button resets all the controls to their initial values.\n *\n * @webnative\n */\n @Prop() public readonly type?: ButtonType\n\n /**\n * Defines the value associated with the button's `name` when it's submitted\n * with the form data. This value is passed to the server in params when the\n * form is submitted using this button. Ignored when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly value?: string\n\n /**\n * Emitted when the button loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the button gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly element!: HTMLQdsButtonElement\n\n private inheritedAttributes: Attributes = {}\n\n private get formElement(): HTMLElement | null {\n return this.form !== undefined && this.form !== ''\n ? document.querySelector(`#${this.form}`)\n : this.element.closest('form')\n }\n\n private get buttonType(): ButtonType {\n if (this.type === undefined) return this.formElement ? 'submit' : 'button'\n return this.type\n }\n\n private get iconOnly(): boolean {\n const hasIcon = this.iconName !== undefined && this.iconName !== ''\n const hasNoLabel = this.text === undefined || this.text === ''\n\n return hasIcon && hasNoLabel\n }\n\n private get computedAction(): Action | undefined {\n switch (this.action) {\n case 'dropdown':\n case 'dropdown-close':\n case 'next': {\n return this.action\n }\n default: {\n return undefined\n }\n }\n }\n\n private get computedDisabled(): boolean {\n return this.disabled ?? false\n }\n\n private get computedImportance(): Importance | undefined {\n if (this.variant === 'destructive') return undefined\n\n switch (this.importance) {\n case 'emphasized':\n case 'subdued': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n private get computedSize(): Size | undefined {\n if (this.variant === 'hero') return undefined\n\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 private get computedTabIndex(): number {\n const parsedValue = Number.parseInt(\n this.inheritedAttributes.tabindex ?? '0',\n 10,\n )\n return Number.isNaN(parsedValue) ? 0 : parsedValue\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n if (this.buttonType === 'button' || !this.formElement) return\n event.preventDefault()\n\n const fakeButton = document.createElement('button')\n fakeButton.type = this.buttonType\n if (this.name !== undefined) fakeButton.name = this.name\n if (this.value !== undefined) fakeButton.value = this.value\n if (this.formAction !== undefined) fakeButton.formAction = this.formAction\n if (this.formMethod !== undefined) fakeButton.formMethod = this.formMethod\n fakeButton.formNoValidate = this.formNoValidate\n fakeButton.formTarget = this.formTarget\n fakeButton.style.display = 'none'\n\n this.formElement.append(fakeButton)\n fakeButton.click()\n fakeButton.remove()\n }\n\n public componentWillLoad(): void {\n this.inheritedAttributes = inheritAriaAttributes(this.element)\n }\n\n public render() {\n const Tag = this.href === undefined ? 'button' : 'a'\n\n return (\n <Tag\n aria-disabled={this.computedDisabled.toString()}\n class={{\n 'qds-button': true,\n 'qds-icon-only': this.iconOnly,\n }}\n data-importance={this.computedImportance}\n data-size={this.computedSize}\n data-variant={this.variant}\n disabled={Tag === 'a' ? undefined : this.disabled}\n download={Tag === 'a' ? this.download : undefined}\n href={Tag === 'a' ? this.href : undefined}\n name={Tag === 'a' ? undefined : this.name}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n rel={Tag === 'a' ? 'noreferrer noopener' : undefined}\n role={Tag === 'a' ? 'button' : undefined}\n tabIndex={this.computedDisabled ? -1 : this.computedTabIndex}\n target={Tag === 'a' ? this.target : undefined}\n type={Tag === 'a' ? undefined : this.buttonType}\n value={Tag === 'a' ? undefined : this.value}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n class=\"qds-icon\"\n data-size={this.computedSize}\n data-variant={this.variant}\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n {this.text}\n {this.badge !== undefined && this.badge !== '' && (\n <div\n class=\"qds-badge\"\n data-importance={this.computedImportance}\n data-variant={this.variant}\n >\n {this.badge}\n </div>\n )}\n {this.computedAction !== undefined && (\n <qds-icon\n class=\"qds-icon qds-action\"\n library=\"core\"\n name={this.computedAction}\n />\n )}\n </Tag>\n )\n }\n\n private readonly onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n private readonly onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n}\n"],"version":3}
@@ -7,7 +7,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/i
7
7
  import { p as pickFocusEventAttributes, i as inheritAriaAttributes } from './helpers.js';
8
8
  import { d as defineCustomElement$2 } from './icon.js';
9
9
 
10
- const listItemCss = ":host([hidden]){display:none !important}:host{display:block}.qds-draggable,.qds-button,.qds-list-item,.qds-texts{display:flex}.qds-button,.qds-texts{flex:1 0}.qds-draggable,.qds-button{align-items:center}.qds-text,.qds-navigation{color:var(--qds-theme-title)}.qds-button{-webkit-appearance:none;appearance:none;background:none;border-radius:var(--qds-focus-border-radius);border:none;text-align:initial}.qds-button:focus-visible{outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width)}.qds-disabled{opacity:var(--qds-theme-disabled)}.qds-draggable{color:var(--qds-theme-control-text-standard);justify-content:center}.qds-list-item{border-block-end:var(--qds-list-border-width) solid\n var(--qds-theme-divider-standard)}.qds-navigation{justify-self:flex-end}.qds-texts{flex-direction:column}.qds-subtext{color:var(--qds-theme-subtitle)}.qds-kicker{color:var(--qds-theme-kicker);order:-1}.qds-button[data-size='small']{gap:var(--qds-list-item-small-gap-internal);min-height:var(--qds-list-item-small-height);padding-block:var(--qds-list-item-small-padding-vertical);padding-inline:var(--qds-list-item-small-padding-horizontal)}[data-size='small']>.qds-draggable{width:var(--qds-control-small-height);height:var(--qds-control-small-height)}[data-size='small'] .qds-control-icon{font-size:var(--qds-control-small-icon-size)}[data-size='small']>.qds-icon{font-size:var(--qds-list-item-small-icon-size)}[data-size='small']>.qds-texts{gap:var(--qds-list-item-small-titles-gap)}[data-size='small'] .qds-text{font:var(--qds-list-item-small-title)}[data-size='small'] .qds-subtext{font:var(--qds-list-item-small-subtitle)}[data-size='small'] .qds-kicker{font:var(--qds-list-item-small-kicker)}.qds-button[data-size='standard']{gap:var(--qds-list-item-standard-gap-internal);min-height:var(--qds-list-item-standard-height);padding-block:var(--qds-list-item-standard-padding-vertical);padding-inline:var(--qds-list-item-standard-padding-horizontal)}[data-size='standard']>.qds-draggable{width:var(--qds-control-standard-height);height:var(--qds-control-standard-height)}[data-size='standard'] .qds-control-icon{font-size:var(--qds-control-standard-icon-size)}[data-size='standard']>.qds-icon{font-size:var(--qds-list-item-standard-icon-size)}[data-size='standard']>.qds-texts{gap:var(--qds-list-item-standard-titles-gap)}[data-size='standard'] .qds-text{font:var(--qds-list-item-standard-title)}[data-size='standard'] .qds-subtext{font:var(--qds-list-item-standard-subtitle)}[data-size='standard'] .qds-kicker{font:var(--qds-list-item-standard-kicker)}.qds-button[data-size='large']{gap:var(--qds-list-item-large-gap-internal);min-height:var(--qds-list-item-large-height);padding-block:var(--qds-list-item-large-padding-vertical);padding-inline:var(--qds-list-item-large-padding-horizontal)}[data-size='large']>.qds-draggable{width:var(--qds-control-large-height);height:var(--qds-control-large-height)}[data-size='large'] .qds-control-icon{font-size:var(--qds-control-large-icon-size)}[data-size='large']>.qds-icon{font-size:var(--qds-list-item-large-icon-size)}[data-size='large']>.qds-texts{gap:var(--qds-list-item-large-titles-gap)}[data-size='large'] .qds-text{font:var(--qds-list-item-large-title)}[data-size='large'] .qds-subtext{font:var(--qds-list-item-large-subtitle)}[data-size='large'] .qds-kicker{font:var(--qds-list-item-large-kicker)}.qds-selected.qds-list-item{background-color:var(--qds-theme-interactive-background-selected)}.qds-selected[data-size='small'] .qds-text{font:var(--qds-list-item-small-title-emphasized)}.qds-selected[data-size='standard'] .qds-text{font:var(--qds-list-item-standard-title-emphasized)}.qds-selected[data-size='large'] .qds-text{font:var(--qds-list-item-large-title-emphasized)}:is([data-size='small'],[data-size='standard'],[data-size='large']).qds-draggable{padding-inline-start:0}";
10
+ const listItemCss = ":host([hidden]){display:none !important}:host{display:block}.qds-draggable,.qds-button,.qds-list-item,.qds-texts{display:flex}.qds-button,.qds-texts{flex:1 0}.qds-draggable,.qds-button{align-items:center}.qds-text,.qds-navigation{color:var(--qds-theme-title)}.qds-button{-webkit-appearance:none;appearance:none;background:none;border-radius:var(--qds-focus-border-radius);border:none;text-align:initial}.qds-button:focus-visible{outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width)}.qds-disabled{opacity:var(--qds-theme-disabled)}.qds-draggable{color:var(--qds-theme-control-text-standard);justify-content:center}.qds-list-item{border-block-end:var(--qds-list-border-width) solid\n var(--qds-theme-divider-standard)}.qds-navigation{transform:scaleX(var(--qds-direction-factor, 1))}.qds-texts{flex-direction:column}.qds-subtext{color:var(--qds-theme-subtitle)}.qds-kicker{color:var(--qds-theme-kicker);order:-1}.qds-button[data-size='small']{gap:var(--qds-list-item-small-gap-internal);min-height:var(--qds-list-item-small-height);padding-block:var(--qds-list-item-small-padding-vertical);padding-inline:var(--qds-list-item-small-padding-horizontal)}[data-size='small']>.qds-draggable{width:var(--qds-control-small-height);height:var(--qds-control-small-height)}[data-size='small'] .qds-control-icon{font-size:var(--qds-control-small-icon-size)}[data-size='small']>.qds-icon{font-size:var(--qds-list-item-small-icon-size)}[data-size='small']>.qds-texts{gap:var(--qds-list-item-small-titles-gap)}[data-size='small'] .qds-text{font:var(--qds-list-item-small-title)}[data-size='small'] .qds-subtext{font:var(--qds-list-item-small-subtitle)}[data-size='small'] .qds-kicker{font:var(--qds-list-item-small-kicker)}.qds-button[data-size='standard']{gap:var(--qds-list-item-standard-gap-internal);min-height:var(--qds-list-item-standard-height);padding-block:var(--qds-list-item-standard-padding-vertical);padding-inline:var(--qds-list-item-standard-padding-horizontal)}[data-size='standard']>.qds-draggable{width:var(--qds-control-standard-height);height:var(--qds-control-standard-height)}[data-size='standard'] .qds-control-icon{font-size:var(--qds-control-standard-icon-size)}[data-size='standard']>.qds-icon{font-size:var(--qds-list-item-standard-icon-size)}[data-size='standard']>.qds-texts{gap:var(--qds-list-item-standard-titles-gap)}[data-size='standard'] .qds-text{font:var(--qds-list-item-standard-title)}[data-size='standard'] .qds-subtext{font:var(--qds-list-item-standard-subtitle)}[data-size='standard'] .qds-kicker{font:var(--qds-list-item-standard-kicker)}.qds-button[data-size='large']{gap:var(--qds-list-item-large-gap-internal);min-height:var(--qds-list-item-large-height);padding-block:var(--qds-list-item-large-padding-vertical);padding-inline:var(--qds-list-item-large-padding-horizontal)}[data-size='large']>.qds-draggable{width:var(--qds-control-large-height);height:var(--qds-control-large-height)}[data-size='large'] .qds-control-icon{font-size:var(--qds-control-large-icon-size)}[data-size='large']>.qds-icon{font-size:var(--qds-list-item-large-icon-size)}[data-size='large']>.qds-texts{gap:var(--qds-list-item-large-titles-gap)}[data-size='large'] .qds-text{font:var(--qds-list-item-large-title)}[data-size='large'] .qds-subtext{font:var(--qds-list-item-large-subtitle)}[data-size='large'] .qds-kicker{font:var(--qds-list-item-large-kicker)}.qds-selected.qds-list-item{background-color:var(--qds-theme-interactive-background-selected)}.qds-selected[data-size='small'] .qds-text{font:var(--qds-list-item-small-title-emphasized)}.qds-selected[data-size='standard'] .qds-text{font:var(--qds-list-item-standard-title-emphasized)}.qds-selected[data-size='large'] .qds-text{font:var(--qds-list-item-large-title-emphasized)}:is([data-size='small'],[data-size='standard'],[data-size='large']).qds-draggable{padding-inline-start:0}";
11
11
  const QdsListItemStyle0 = listItemCss;
12
12
 
13
13
  const ListItem = /*@__PURE__*/ proxyCustomElement(class ListItem extends HTMLElement {
@@ -1 +1 @@
1
- {"file":"qds-list-item.js","mappings":";;;;;;;;;AAAA,MAAM,WAAW,GAAG,iwHAAiwH,CAAC;AACtxH,0BAAe,WAAW;;MCmBb,QAAQ;;;;;;;QAmKF,WAAM,GAAG,CAAC,KAAiB;YAC1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACvD,CAAA;QAEgB,YAAO,GAAG,CAAC,KAAiB;YAC3C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACxD,CAAA;wBApK2C,KAAK;;2BAYH,SAAS;0BAKT,KAAK;;oBAUb,UAAU;wBAKJ,KAAK;;;yBAwBpB,KAAK;mCAIiB,EAAE;wB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,cAAc,EAAE,IAAI,CAAC,QAAQ;aAC9B,eACU,IAAI,CAAC,YAAY,EAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,SAAS,KACb,WAAK,KAAK,EAAC,eAAe,IACxB,gBACE,KAAK,EAAC,kBAAkB,EACxB,OAAO,EAAC,MAAM,EACd,IAAI,EAAC,WAAW,GAChB,CACE,CACP,EACA,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,EAAE,KAClD,gBACE,KAAK,EAAC,UAAU,EAChB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAE,IAAI,CAAC,QAAQ,GACnB,CACH,EACD,4DAAK,KAAK,EAAC,WAAW,IACpB,4DAAK,KAAK,EAAC,UAAU,IAAE,IAAI,CAAC,IAAI,CAAO,EACtC,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO,KAAK,EAAE,KAChD,WAAK,KAAK,EAAC,aAAa,IAAE,IAAI,CAAC,OAAO,CAAO,CAC9C,EACA,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE,KAC9C,WAAK,KAAK,EAAC,YAAY,IAAE,IAAI,CAAC,MAAM,CAAO,CAC5C,CACG,EACL,IAAI,CAAC,UAAU,KACd,gBACE,KAAK,EAAC,iCAAiC,EACvC,OAAO,EAAC,MAAM,EACd,IAAI,EAAC,YAAY,GACjB,CACH,CACM,CACN,EACN;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/list-item/list-item.css?tag=qds-list-item&encapsulation=shadow","src/components/list-item/list-item.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-draggable,\n.qds-button,\n.qds-list-item,\n.qds-texts {\n display: flex;\n}\n\n.qds-button,\n.qds-texts {\n flex: 1 0;\n}\n\n.qds-draggable,\n.qds-button {\n align-items: center;\n}\n\n.qds-text,\n.qds-navigation {\n color: var(--qds-theme-title);\n}\n\n.qds-button {\n appearance: none;\n background: none;\n border-radius: var(--qds-focus-border-radius);\n border: none;\n text-align: initial;\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n }\n}\n\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n}\n\n.qds-draggable {\n color: var(--qds-theme-control-text-standard);\n justify-content: center;\n}\n\n.qds-list-item {\n border-block-end: var(--qds-list-border-width) solid\n var(--qds-theme-divider-standard);\n}\n\n.qds-navigation {\n justify-self: flex-end;\n}\n\n.qds-texts {\n flex-direction: column;\n}\n\n.qds-subtext {\n color: var(--qds-theme-subtitle);\n}\n\n.qds-kicker {\n color: var(--qds-theme-kicker);\n order: -1;\n}\n\n[data-size='small'] {\n &.qds-button {\n gap: var(--qds-list-item-small-gap-internal);\n min-height: var(--qds-list-item-small-height);\n padding-block: var(--qds-list-item-small-padding-vertical);\n padding-inline: var(--qds-list-item-small-padding-horizontal);\n }\n\n & > .qds-draggable {\n width: var(--qds-control-small-height);\n height: var(--qds-control-small-height);\n }\n\n & .qds-control-icon {\n font-size: var(--qds-control-small-icon-size);\n }\n\n & > .qds-icon {\n font-size: var(--qds-list-item-small-icon-size);\n }\n\n & > .qds-texts {\n gap: var(--qds-list-item-small-titles-gap);\n }\n\n & .qds-text {\n font: var(--qds-list-item-small-title);\n }\n\n & .qds-subtext {\n font: var(--qds-list-item-small-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-list-item-small-kicker);\n }\n}\n\n[data-size='standard'] {\n &.qds-button {\n gap: var(--qds-list-item-standard-gap-internal);\n min-height: var(--qds-list-item-standard-height);\n padding-block: var(--qds-list-item-standard-padding-vertical);\n padding-inline: var(--qds-list-item-standard-padding-horizontal);\n }\n\n & > .qds-draggable {\n width: var(--qds-control-standard-height);\n height: var(--qds-control-standard-height);\n }\n\n & .qds-control-icon {\n font-size: var(--qds-control-standard-icon-size);\n }\n\n & > .qds-icon {\n font-size: var(--qds-list-item-standard-icon-size);\n }\n\n & > .qds-texts {\n gap: var(--qds-list-item-standard-titles-gap);\n }\n\n & .qds-text {\n font: var(--qds-list-item-standard-title);\n }\n\n & .qds-subtext {\n font: var(--qds-list-item-standard-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-list-item-standard-kicker);\n }\n}\n\n[data-size='large'] {\n &.qds-button {\n gap: var(--qds-list-item-large-gap-internal);\n min-height: var(--qds-list-item-large-height);\n padding-block: var(--qds-list-item-large-padding-vertical);\n padding-inline: var(--qds-list-item-large-padding-horizontal);\n }\n\n & > .qds-draggable {\n width: var(--qds-control-large-height);\n height: var(--qds-control-large-height);\n }\n\n & .qds-control-icon {\n font-size: var(--qds-control-large-icon-size);\n }\n\n & > .qds-icon {\n font-size: var(--qds-list-item-large-icon-size);\n }\n\n & > .qds-texts {\n gap: var(--qds-list-item-large-titles-gap);\n }\n\n & .qds-text {\n font: var(--qds-list-item-large-title);\n }\n\n & .qds-subtext {\n font: var(--qds-list-item-large-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-list-item-large-kicker);\n }\n}\n\n.qds-selected {\n &.qds-list-item {\n background-color: var(--qds-theme-interactive-background-selected);\n }\n\n &[data-size='small'] .qds-text {\n font: var(--qds-list-item-small-title-emphasized);\n }\n\n &[data-size='standard'] .qds-text {\n font: var(--qds-list-item-standard-title-emphasized);\n }\n\n &[data-size='large'] .qds-text {\n font: var(--qds-list-item-large-title-emphasized);\n }\n}\n\n:is(\n [data-size='small'],\n [data-size='standard'],\n [data-size='large']\n ).qds-draggable {\n padding-inline-start: 0;\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport { Component, Element, Event, h, Prop, State, Watch } from '@stencil/core'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport { inheritAriaAttributes, pickFocusEventAttributes } from '../../helpers'\nimport type { Size } from '../shared'\n\n/**\n * @slot Content to display for the title.\n * @see https://quartz.se.com/build/components/list-item\n */\n@Component({\n tag: 'qds-list-item',\n shadow: { delegatesFocus: true },\n styleUrl: 'list-item.css',\n})\nexport class ListItem implements ComponentInterface {\n /**\n * Prevents the list item from being interacted with: it cannot be selected\n * or focused.\n */\n @Prop() 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 * Whether or not this list item denotes a navigation action.\n */\n @Prop() public readonly navigation: boolean = false\n\n /**\n * Text to display for the kicker.\n */\n @Prop() public readonly kicker?: string\n\n /**\n * The list items's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * Whether or not the list item is selected.\n */\n @Prop() public readonly selected: boolean = false\n\n /**\n * Text to display for the subtext.\n */\n @Prop() public readonly subtext?: string\n\n /**\n * Primary text to display.\n */\n @Prop() public readonly text!: string\n\n /**\n * Emitted when the button loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the button gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @State() private draggable = false\n\n @Element() private readonly element!: HTMLQdsListItemElement\n\n @State() private inheritedAttributes: Attributes = {}\n\n @State() private tabIndex = 0\n\n private get computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n @Watch('draggable')\n protected draggableChanged(): void {\n this.draggable = this.element.draggable\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n this.tabIndex = Number.isNaN(parsedValue) ? 0 : parsedValue\n }\n\n public componentWillLoad(): void {\n this.inheritedAttributes = inheritAriaAttributes(this.element)\n this.draggable = this.element.draggable\n\n const tabindex = this.element.getAttribute('tabindex') ?? '0'\n const parsedValue = Number.parseInt(tabindex, 10)\n this.tabIndex = Number.isNaN(parsedValue) ? 0 : parsedValue\n }\n\n public render() {\n return (\n <li\n class={{\n 'qds-list-item': true,\n 'qds-disabled': this.disabled,\n 'qds-selected': this.selected,\n }}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n >\n <button\n class={{\n 'qds-button': true,\n 'qds-draggable': this.draggable,\n 'qds-selected': this.selected,\n }}\n data-size={this.computedSize}\n disabled={this.disabled}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n tabIndex={this.tabIndex}\n type=\"button\"\n >\n {this.draggable && (\n <div class=\"qds-draggable\">\n <qds-icon\n class=\"qds-control-icon\"\n library=\"core\"\n name=\"draggable\"\n />\n </div>\n )}\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n class=\"qds-icon\"\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n <div class=\"qds-texts\">\n <div class=\"qds-text\">{this.text}</div>\n {this.subtext !== undefined && this.subtext !== '' && (\n <div class=\"qds-subtext\">{this.subtext}</div>\n )}\n {this.kicker !== undefined && this.kicker !== '' && (\n <div class=\"qds-kicker\">{this.kicker}</div>\n )}\n </div>\n {this.navigation && (\n <qds-icon\n class=\"qds-control-icon qds-navigation\"\n library=\"core\"\n name=\"navigation\"\n />\n )}\n </button>\n </li>\n )\n }\n\n private readonly onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n private readonly onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n}\n"],"version":3}
1
+ {"file":"qds-list-item.js","mappings":";;;;;;;;;AAAA,MAAM,WAAW,GAAG,4xHAA4xH,CAAC;AACjzH,0BAAe,WAAW;;MCmBb,QAAQ;;;;;;;QAmKF,WAAM,GAAG,CAAC,KAAiB;YAC1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACvD,CAAA;QAEgB,YAAO,GAAG,CAAC,KAAiB;YAC3C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACxD,CAAA;wBApK2C,KAAK;;2BAYH,SAAS;0BAKT,KAAK;;oBAUb,UAAU;wBAKJ,KAAK;;;yBAwBpB,KAAK;mCAIiB,EAAE;wBAEzB,CAAC;;IAE7B,IAAY,YAAY;QACtB,QAAQ,IAAI,CAAC,IAAI;YACf,KAAK,UAAU,CAAC;YAChB,KAAK,OAAO,CAAC;YACb,KAAK,OAAO,EAAE;gBACZ,OAAO,IAAI,CAAC,IAAI,CAAA;aACjB;YACD,SAAS;gBACP,OAAO,UAAU,CAAA;aAClB;SACF;KACF;IAGS,gBAAgB;QACxB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAA;KACxC;IAGS,eAAe,CAAC,QAAgB;QACxC,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;QACjD,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAA;KAC5D;IAEM,iBAAiB;QACtB,IAAI,CAAC,mBAAmB,GAAG,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC9D,IAAI,CAAC,SAAS,GAA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AI,CAAC,IAAI,CAAO,EACtC,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO,KAAK,EAAE,KAChD,WAAK,KAAK,EAAC,aAAa,IAAE,IAAI,CAAC,OAAO,CAAO,CAC9C,EACA,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE,KAC9C,WAAK,KAAK,EAAC,YAAY,IAAE,IAAI,CAAC,MAAM,CAAO,CAC5C,CACG,EACL,IAAI,CAAC,UAAU,KACd,gBACE,KAAK,EAAC,iCAAiC,EACvC,OAAO,EAAC,MAAM,EACd,IAAI,EAAC,YAAY,GACjB,CACH,CACM,CACN,EACN;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/list-item/list-item.css?tag=qds-list-item&encapsulation=shadow","src/components/list-item/list-item.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-draggable,\n.qds-button,\n.qds-list-item,\n.qds-texts {\n display: flex;\n}\n\n.qds-button,\n.qds-texts {\n flex: 1 0;\n}\n\n.qds-draggable,\n.qds-button {\n align-items: center;\n}\n\n.qds-text,\n.qds-navigation {\n color: var(--qds-theme-title);\n}\n\n.qds-button {\n appearance: none;\n background: none;\n border-radius: var(--qds-focus-border-radius);\n border: none;\n text-align: initial;\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n }\n}\n\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n}\n\n.qds-draggable {\n color: var(--qds-theme-control-text-standard);\n justify-content: center;\n}\n\n.qds-list-item {\n border-block-end: var(--qds-list-border-width) solid\n var(--qds-theme-divider-standard);\n}\n\n.qds-navigation {\n transform: scaleX(var(--qds-direction-factor, 1));\n}\n\n.qds-texts {\n flex-direction: column;\n}\n\n.qds-subtext {\n color: var(--qds-theme-subtitle);\n}\n\n.qds-kicker {\n color: var(--qds-theme-kicker);\n order: -1;\n}\n\n[data-size='small'] {\n &.qds-button {\n gap: var(--qds-list-item-small-gap-internal);\n min-height: var(--qds-list-item-small-height);\n padding-block: var(--qds-list-item-small-padding-vertical);\n padding-inline: var(--qds-list-item-small-padding-horizontal);\n }\n\n & > .qds-draggable {\n width: var(--qds-control-small-height);\n height: var(--qds-control-small-height);\n }\n\n & .qds-control-icon {\n font-size: var(--qds-control-small-icon-size);\n }\n\n & > .qds-icon {\n font-size: var(--qds-list-item-small-icon-size);\n }\n\n & > .qds-texts {\n gap: var(--qds-list-item-small-titles-gap);\n }\n\n & .qds-text {\n font: var(--qds-list-item-small-title);\n }\n\n & .qds-subtext {\n font: var(--qds-list-item-small-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-list-item-small-kicker);\n }\n}\n\n[data-size='standard'] {\n &.qds-button {\n gap: var(--qds-list-item-standard-gap-internal);\n min-height: var(--qds-list-item-standard-height);\n padding-block: var(--qds-list-item-standard-padding-vertical);\n padding-inline: var(--qds-list-item-standard-padding-horizontal);\n }\n\n & > .qds-draggable {\n width: var(--qds-control-standard-height);\n height: var(--qds-control-standard-height);\n }\n\n & .qds-control-icon {\n font-size: var(--qds-control-standard-icon-size);\n }\n\n & > .qds-icon {\n font-size: var(--qds-list-item-standard-icon-size);\n }\n\n & > .qds-texts {\n gap: var(--qds-list-item-standard-titles-gap);\n }\n\n & .qds-text {\n font: var(--qds-list-item-standard-title);\n }\n\n & .qds-subtext {\n font: var(--qds-list-item-standard-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-list-item-standard-kicker);\n }\n}\n\n[data-size='large'] {\n &.qds-button {\n gap: var(--qds-list-item-large-gap-internal);\n min-height: var(--qds-list-item-large-height);\n padding-block: var(--qds-list-item-large-padding-vertical);\n padding-inline: var(--qds-list-item-large-padding-horizontal);\n }\n\n & > .qds-draggable {\n width: var(--qds-control-large-height);\n height: var(--qds-control-large-height);\n }\n\n & .qds-control-icon {\n font-size: var(--qds-control-large-icon-size);\n }\n\n & > .qds-icon {\n font-size: var(--qds-list-item-large-icon-size);\n }\n\n & > .qds-texts {\n gap: var(--qds-list-item-large-titles-gap);\n }\n\n & .qds-text {\n font: var(--qds-list-item-large-title);\n }\n\n & .qds-subtext {\n font: var(--qds-list-item-large-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-list-item-large-kicker);\n }\n}\n\n.qds-selected {\n &.qds-list-item {\n background-color: var(--qds-theme-interactive-background-selected);\n }\n\n &[data-size='small'] .qds-text {\n font: var(--qds-list-item-small-title-emphasized);\n }\n\n &[data-size='standard'] .qds-text {\n font: var(--qds-list-item-standard-title-emphasized);\n }\n\n &[data-size='large'] .qds-text {\n font: var(--qds-list-item-large-title-emphasized);\n }\n}\n\n:is(\n [data-size='small'],\n [data-size='standard'],\n [data-size='large']\n ).qds-draggable {\n padding-inline-start: 0;\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport { Component, Element, Event, h, Prop, State, Watch } from '@stencil/core'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport { inheritAriaAttributes, pickFocusEventAttributes } from '../../helpers'\nimport type { Size } from '../shared'\n\n/**\n * @slot Content to display for the title.\n * @see https://quartz.se.com/build/components/list-item\n */\n@Component({\n tag: 'qds-list-item',\n shadow: { delegatesFocus: true },\n styleUrl: 'list-item.css',\n})\nexport class ListItem implements ComponentInterface {\n /**\n * Prevents the list item from being interacted with: it cannot be selected\n * or focused.\n */\n @Prop() 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 * Whether or not this list item denotes a navigation action.\n */\n @Prop() public readonly navigation: boolean = false\n\n /**\n * Text to display for the kicker.\n */\n @Prop() public readonly kicker?: string\n\n /**\n * The list items's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * Whether or not the list item is selected.\n */\n @Prop() public readonly selected: boolean = false\n\n /**\n * Text to display for the subtext.\n */\n @Prop() public readonly subtext?: string\n\n /**\n * Primary text to display.\n */\n @Prop() public readonly text!: string\n\n /**\n * Emitted when the button loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the button gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @State() private draggable = false\n\n @Element() private readonly element!: HTMLQdsListItemElement\n\n @State() private inheritedAttributes: Attributes = {}\n\n @State() private tabIndex = 0\n\n private get computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n @Watch('draggable')\n protected draggableChanged(): void {\n this.draggable = this.element.draggable\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n this.tabIndex = Number.isNaN(parsedValue) ? 0 : parsedValue\n }\n\n public componentWillLoad(): void {\n this.inheritedAttributes = inheritAriaAttributes(this.element)\n this.draggable = this.element.draggable\n\n const tabindex = this.element.getAttribute('tabindex') ?? '0'\n const parsedValue = Number.parseInt(tabindex, 10)\n this.tabIndex = Number.isNaN(parsedValue) ? 0 : parsedValue\n }\n\n public render() {\n return (\n <li\n class={{\n 'qds-list-item': true,\n 'qds-disabled': this.disabled,\n 'qds-selected': this.selected,\n }}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n >\n <button\n class={{\n 'qds-button': true,\n 'qds-draggable': this.draggable,\n 'qds-selected': this.selected,\n }}\n data-size={this.computedSize}\n disabled={this.disabled}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n tabIndex={this.tabIndex}\n type=\"button\"\n >\n {this.draggable && (\n <div class=\"qds-draggable\">\n <qds-icon\n class=\"qds-control-icon\"\n library=\"core\"\n name=\"draggable\"\n />\n </div>\n )}\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n class=\"qds-icon\"\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n <div class=\"qds-texts\">\n <div class=\"qds-text\">{this.text}</div>\n {this.subtext !== undefined && this.subtext !== '' && (\n <div class=\"qds-subtext\">{this.subtext}</div>\n )}\n {this.kicker !== undefined && this.kicker !== '' && (\n <div class=\"qds-kicker\">{this.kicker}</div>\n )}\n </div>\n {this.navigation && (\n <qds-icon\n class=\"qds-control-icon qds-navigation\"\n library=\"core\"\n name=\"navigation\"\n />\n )}\n </button>\n </li>\n )\n }\n\n private readonly onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n private readonly onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n}\n"],"version":3}
@@ -7,7 +7,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/i
7
7
  import { p as pickFocusEventAttributes, i as inheritAriaAttributes, a as inheritAttributes } from './helpers.js';
8
8
  import { d as defineCustomElement$2 } from './icon.js';
9
9
 
10
- const standaloneLinkCss = ":host([hidden]){display:none !important}:host{display:inline-block}.qds-chevron,.qds-icon,.qds-external{vertical-align:text-bottom}.qds-external{display:none}.qds-standalone-link{align-items:center;border-radius:var(--qds-focus-border-radius);box-sizing:border-box;display:inline-flex;justify-content:center;-webkit-print-color-adjust:exact;print-color-adjust:exact;-webkit-text-decoration:none;text-decoration:none;white-space:nowrap;width:100%}.qds-standalone-link[rel~='external']>.qds-external{display:inline-block}.qds-standalone-link:focus-visible{outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width)}.qds-standalone-link[data-importance='emphasized'],.qds-standalone-link:hover,.qds-standalone-link:active,.qds-standalone-link:visited{-webkit-text-decoration:underline;text-decoration:underline}.qds-standalone-link[data-importance='subdued']{color:var(--qds-theme-link-subdued-default)}.qds-standalone-link[data-importance='subdued']:hover{color:var(--qds-theme-link-subdued-hover)}.qds-standalone-link[data-importance='subdued']:active{color:var(--qds-theme-link-subdued-pressed)}.qds-standalone-link[data-importance='subdued']:visited{color:var(--qds-theme-link-subdued-visited)}.qds-standalone-link[data-importance='subdued']:visited:hover{color:var(\n --qds-theme-link-subdued-visited-hover,\n var(--qds-theme-link-subdued-visited)\n )}.qds-standalone-link[data-importance='subdued']:visited:active{color:var(\n --qds-theme-link-subdued-visited-pressed,\n var(--qds-theme-link-subdued-visited)\n )}.qds-standalone-link[data-importance='standard']{color:var(--qds-theme-link-standard-default)}.qds-standalone-link[data-importance='standard']:hover{color:var(--qds-theme-link-standard-hover)}.qds-standalone-link[data-importance='standard']:active{color:var(--qds-theme-link-standard-pressed)}.qds-standalone-link[data-importance='standard']:visited{color:var(--qds-theme-link-standard-visited)}.qds-standalone-link[data-importance='standard']:visited:hover{color:var(\n --qds-theme-link-standard-visited-hover,\n var(--qds-theme-link-standard-visited)\n )}.qds-standalone-link[data-importance='standard']:visited:active{color:var(\n --qds-theme-link-standard-visited-pressed,\n var(--qds-theme-link-standard-visited)\n )}.qds-standalone-link[data-importance='emphasized']{color:var(--qds-theme-link-emphasized-default)}.qds-standalone-link[data-importance='emphasized']:hover{color:var(--qds-theme-link-emphasized-hover)}.qds-standalone-link[data-importance='emphasized']:active{color:var(--qds-theme-link-emphasized-pressed)}.qds-standalone-link[data-importance='emphasized']:visited{color:var(--qds-theme-link-emphasized-visited)}.qds-standalone-link[data-importance='emphasized']:visited:hover{color:var(\n --qds-theme-link-emphasized-visited-hover,\n var(--qds-theme-link-emphasized-visited)\n )}.qds-standalone-link[data-importance='emphasized']:visited:active{color:var(\n --qds-theme-link-emphasized-visited-pressed,\n var(--qds-theme-link-emphasized-visited)\n )}[aria-disabled='true']{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-chevron[data-size='small'],.qds-external[data-size='small'],.qds-icon[data-size='small']{height:var(--qds-control-small-icon-size);margin-inline-start:var(--qds-control-small-gap-internal);width:var(--qds-control-small-icon-size)}.qds-standalone-link[data-size='small']{font:var(--qds-control-small-text);gap:var(--qds-control-small-gap-internal);height:var(--qds-control-small-height)}.qds-chevron[data-size='standard'],.qds-external[data-size='standard'],.qds-icon[data-size='standard']{height:var(--qds-control-standard-icon-size);margin-inline-start:var(--qds-control-standard-gap-internal);width:var(--qds-control-standard-icon-size)}.qds-standalone-link[data-size='standard']{font:var(--qds-control-standard-text);gap:var(--qds-control-standard-gap-internal);height:var(--qds-control-standard-height)}.qds-chevron[data-size='large'],.qds-external[data-size='large'],.qds-icon[data-size='large']{height:var(--qds-control-large-icon-size);margin-inline-start:var(--qds-control-large-gap-internal);width:var(--qds-control-large-icon-size)}.qds-standalone-link[data-size='large']{font:var(--qds-control-large-text);gap:var(--qds-control-large-gap-internal);height:var(--qds-control-large-height)}";
10
+ const standaloneLinkCss = ":host([hidden]){display:none !important}:host{display:inline-block}.qds-chevron{transform:scaleX(var(--qds-direction-factor, 1))}.qds-external{display:none}.qds-icon{vertical-align:text-bottom}.qds-standalone-link{align-items:center;border-radius:var(--qds-focus-border-radius);box-sizing:border-box;display:inline-flex;justify-content:center;-webkit-print-color-adjust:exact;print-color-adjust:exact;-webkit-text-decoration:none;text-decoration:none;white-space:nowrap;width:100%}.qds-standalone-link[rel~='external']>.qds-external{display:inline-block}.qds-standalone-link:focus-visible{outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width)}.qds-standalone-link[data-importance='emphasized'],.qds-standalone-link:hover,.qds-standalone-link:active,.qds-standalone-link:visited{-webkit-text-decoration:underline;text-decoration:underline}.qds-standalone-link[data-importance='subdued']{color:var(--qds-theme-link-subdued-default)}.qds-standalone-link[data-importance='subdued']:hover{color:var(--qds-theme-link-subdued-hover)}.qds-standalone-link[data-importance='subdued']:active{color:var(--qds-theme-link-subdued-pressed)}.qds-standalone-link[data-importance='subdued']:visited{color:var(--qds-theme-link-subdued-visited)}.qds-standalone-link[data-importance='subdued']:visited:hover{color:var(\n --qds-theme-link-subdued-visited-hover,\n var(--qds-theme-link-subdued-visited)\n )}.qds-standalone-link[data-importance='subdued']:visited:active{color:var(\n --qds-theme-link-subdued-visited-pressed,\n var(--qds-theme-link-subdued-visited)\n )}.qds-standalone-link[data-importance='standard']{color:var(--qds-theme-link-standard-default)}.qds-standalone-link[data-importance='standard']:hover{color:var(--qds-theme-link-standard-hover)}.qds-standalone-link[data-importance='standard']:active{color:var(--qds-theme-link-standard-pressed)}.qds-standalone-link[data-importance='standard']:visited{color:var(--qds-theme-link-standard-visited)}.qds-standalone-link[data-importance='standard']:visited:hover{color:var(\n --qds-theme-link-standard-visited-hover,\n var(--qds-theme-link-standard-visited)\n )}.qds-standalone-link[data-importance='standard']:visited:active{color:var(\n --qds-theme-link-standard-visited-pressed,\n var(--qds-theme-link-standard-visited)\n )}.qds-standalone-link[data-importance='emphasized']{color:var(--qds-theme-link-emphasized-default)}.qds-standalone-link[data-importance='emphasized']:hover{color:var(--qds-theme-link-emphasized-hover)}.qds-standalone-link[data-importance='emphasized']:active{color:var(--qds-theme-link-emphasized-pressed)}.qds-standalone-link[data-importance='emphasized']:visited{color:var(--qds-theme-link-emphasized-visited)}.qds-standalone-link[data-importance='emphasized']:visited:hover{color:var(\n --qds-theme-link-emphasized-visited-hover,\n var(--qds-theme-link-emphasized-visited)\n )}.qds-standalone-link[data-importance='emphasized']:visited:active{color:var(\n --qds-theme-link-emphasized-visited-pressed,\n var(--qds-theme-link-emphasized-visited)\n )}[aria-disabled='true']{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-icon[data-size='small']{height:var(--qds-control-small-icon-size);margin-inline-start:var(--qds-control-small-gap-internal);width:var(--qds-control-small-icon-size)}.qds-standalone-link[data-size='small']{font:var(--qds-control-small-text);gap:var(--qds-control-small-gap-internal);height:var(--qds-control-small-height)}.qds-icon[data-size='standard']{height:var(--qds-control-standard-icon-size);margin-inline-start:var(--qds-control-standard-gap-internal);width:var(--qds-control-standard-icon-size)}.qds-standalone-link[data-size='standard']{font:var(--qds-control-standard-text);gap:var(--qds-control-standard-gap-internal);height:var(--qds-control-standard-height)}.qds-icon[data-size='large']{height:var(--qds-control-large-icon-size);margin-inline-start:var(--qds-control-large-gap-internal);width:var(--qds-control-large-icon-size)}.qds-standalone-link[data-size='large']{font:var(--qds-control-large-text);gap:var(--qds-control-large-gap-internal);height:var(--qds-control-large-height)}";
11
11
  const QdsStandaloneLinkStyle0 = standaloneLinkCss;
12
12
 
13
13
  const StandaloneLink = /*@__PURE__*/ proxyCustomElement(class StandaloneLink extends HTMLElement {
@@ -74,7 +74,7 @@ const StandaloneLink = /*@__PURE__*/ proxyCustomElement(class StandaloneLink ext
74
74
  };
75
75
  }
76
76
  render() {
77
- return (h("a", { key: '564f298325b1c5e4420b370eacc6ff69c71527b0', "aria-disabled": this.disabled.toString(), class: "qds-standalone-link", "data-importance": this.computedImportance, "data-size": this.computedSize, download: this.download, href: this.href, hrefLang: this.hreflang, onBlur: this.onBlur, onFocus: this.onFocus, referrerPolicy: this.referrerPolicy, rel: this.rel, target: this.target, ...this.inheritedAttributes, tabIndex: this.disabled ? -1 : this.computedTabIndex }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { class: "qds-icon", "data-size": this.computedSize, library: this.iconLibrary, name: this.iconName })), h("div", { key: 'd71d2615d8330cc0517f8c39a5880f7441bd2b76' }, h("slot", { key: '502f90d6485298ad793959eeaeb9793d7b005b72' })), h("qds-icon", { key: '9591d17627222e0669bca03fa7b0921ae6ffc4b4', class: "qds-external", library: "core", name: "external-link" }), h("qds-icon", { key: '69ab9fc612c4c7c87a132470e21f689e61b4ea5c', class: "qds-chevron", library: "core", name: "next" })));
77
+ return (h("a", { key: '564f298325b1c5e4420b370eacc6ff69c71527b0', "aria-disabled": this.disabled.toString(), class: "qds-standalone-link", "data-importance": this.computedImportance, "data-size": this.computedSize, download: this.download, href: this.href, hrefLang: this.hreflang, onBlur: this.onBlur, onFocus: this.onFocus, referrerPolicy: this.referrerPolicy, rel: this.rel, target: this.target, ...this.inheritedAttributes, tabIndex: this.disabled ? -1 : this.computedTabIndex }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { class: "qds-icon", "data-size": this.computedSize, library: this.iconLibrary, name: this.iconName })), h("div", { key: 'd71d2615d8330cc0517f8c39a5880f7441bd2b76' }, h("slot", { key: '502f90d6485298ad793959eeaeb9793d7b005b72' })), h("qds-icon", { key: 'f4cb8ad7d06ae5b04033d520336674051078bc2f', class: "qds-icon qds-external", library: "core", name: "external-link" }), h("qds-icon", { key: 'c9c5fa606ebe72e24c0b0b5bd63e818bc830efca', class: "qds-icon qds-chevron", library: "core", name: "next" })));
78
78
  }
79
79
  static get delegatesFocus() { return true; }
80
80
  get element() { return this; }