@nova-design-system/nova-webcomponents 3.8.0 → 3.9.1

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 (137) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/native.cjs.js +1 -1
  3. package/dist/cjs/nv-calendar.cjs.entry.js +9 -3
  4. package/dist/cjs/nv-calendar.cjs.entry.js.map +1 -1
  5. package/dist/cjs/nv-dialog.cjs.entry.js +19 -32
  6. package/dist/cjs/nv-dialog.cjs.entry.js.map +1 -1
  7. package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +1 -1
  8. package/dist/cjs/nv-dialogfooter_2.cjs.entry.js.map +1 -1
  9. package/dist/cjs/nv-fielddate.cjs.entry.js +62 -94
  10. package/dist/cjs/nv-fielddate.cjs.entry.js.map +1 -1
  11. package/dist/cjs/nv-fielddaterange.cjs.entry.js +52 -33
  12. package/dist/cjs/nv-fielddaterange.cjs.entry.js.map +1 -1
  13. package/dist/cjs/nv-fieldselect.cjs.entry.js +14 -26
  14. package/dist/cjs/nv-fieldselect.cjs.entry.js.map +1 -1
  15. package/dist/cjs/nv-icon.cjs.entry.js +2 -2
  16. package/dist/cjs/nv-icon.cjs.entry.js.map +1 -1
  17. package/dist/collection/components/nv-calendar/nv-calendar.js +9 -3
  18. package/dist/collection/components/nv-calendar/nv-calendar.js.map +1 -1
  19. package/dist/collection/components/nv-dialog/nv-dialog.js +21 -40
  20. package/dist/collection/components/nv-dialog/nv-dialog.js.map +1 -1
  21. package/dist/collection/components/nv-dialogheader/nv-dialogheader.css +1 -0
  22. package/dist/collection/components/nv-fielddate/nv-fielddate.js +63 -94
  23. package/dist/collection/components/nv-fielddate/nv-fielddate.js.map +1 -1
  24. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +52 -33
  25. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js.map +1 -1
  26. package/dist/collection/components/nv-fieldselect/nv-fieldselect.css +2 -0
  27. package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js +8 -8
  28. package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js.map +1 -1
  29. package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +25 -35
  30. package/dist/collection/components/nv-fieldselect/nv-fieldselect.js.map +1 -1
  31. package/dist/collection/components/nv-icon/nv-icon.js +1 -1
  32. package/dist/collection/components/nv-icon/nv-icon.js.map +1 -1
  33. package/dist/components/nv-accordion-item.js +1 -1
  34. package/dist/components/nv-accordion.js +3 -3
  35. package/dist/components/nv-alert.js +1 -1
  36. package/dist/components/nv-avatar.js +1 -1
  37. package/dist/components/nv-badge.js +1 -1
  38. package/dist/components/nv-calendar.js +1 -1
  39. package/dist/components/nv-datagrid.js +2 -2
  40. package/dist/components/nv-dialog.js +23 -36
  41. package/dist/components/nv-dialog.js.map +1 -1
  42. package/dist/components/nv-dialogfooter.js +1 -1
  43. package/dist/components/nv-dialogheader.js +1 -1
  44. package/dist/components/nv-fielddate.js +68 -100
  45. package/dist/components/nv-fielddate.js.map +1 -1
  46. package/dist/components/nv-fielddaterange.js +56 -37
  47. package/dist/components/nv-fielddaterange.js.map +1 -1
  48. package/dist/components/nv-fielddropdown.js +3 -3
  49. package/dist/components/nv-fielddropdownitem.js +1 -1
  50. package/dist/components/nv-fieldmultiselect.js +3 -3
  51. package/dist/components/nv-fieldnumber.js +1 -1
  52. package/dist/components/nv-fieldpassword.js +2 -2
  53. package/dist/components/nv-fieldselect.js +18 -31
  54. package/dist/components/nv-fieldselect.js.map +1 -1
  55. package/dist/components/nv-fieldslider.js +3 -3
  56. package/dist/components/nv-fieldtext.js +1 -1
  57. package/dist/components/nv-fieldtime.js +2 -2
  58. package/dist/components/nv-icon.js +1 -1
  59. package/dist/components/nv-iconbutton.js +1 -1
  60. package/dist/components/nv-menu.js +2 -2
  61. package/dist/components/nv-menuitem.js +1 -1
  62. package/dist/components/{p-6e2f91ae.js → p-025b8a78.js} +2 -2
  63. package/dist/components/{p-6e2f91ae.js.map → p-025b8a78.js.map} +1 -1
  64. package/dist/components/{p-865725bf.js → p-30f970c3.js} +2 -2
  65. package/dist/components/{p-865725bf.js.map → p-30f970c3.js.map} +1 -1
  66. package/dist/components/{p-f0371d98.js → p-60064345.js} +2 -2
  67. package/dist/components/{p-f0371d98.js.map → p-60064345.js.map} +1 -1
  68. package/dist/components/p-6460318d.js +88 -0
  69. package/dist/components/p-6460318d.js.map +1 -0
  70. package/dist/components/{p-9a209ac7.js → p-68ff562f.js} +2 -2
  71. package/dist/components/{p-9a209ac7.js.map → p-68ff562f.js.map} +1 -1
  72. package/dist/components/{p-abb8f5ae.js → p-6de6866c.js} +2 -2
  73. package/dist/components/{p-abb8f5ae.js.map → p-6de6866c.js.map} +1 -1
  74. package/dist/components/{p-f927f771.js → p-79e6b6a2.js} +3 -3
  75. package/dist/components/{p-f927f771.js.map → p-79e6b6a2.js.map} +1 -1
  76. package/dist/components/{p-d32b75ac.js → p-82e5674c.js} +10 -4
  77. package/dist/components/p-82e5674c.js.map +1 -0
  78. package/dist/components/{p-7bc65e46.js → p-db4ba1d9.js} +3 -3
  79. package/dist/components/{p-7bc65e46.js.map → p-db4ba1d9.js.map} +1 -1
  80. package/dist/components/{p-fa1988d9.js → p-e4e1a926.js} +2 -2
  81. package/dist/components/{p-fa1988d9.js.map → p-e4e1a926.js.map} +1 -1
  82. package/dist/components/{p-ca130ad2.js → p-ed6686a1.js} +2 -2
  83. package/dist/components/p-ed6686a1.js.map +1 -0
  84. package/dist/components/{p-91a558eb.js → p-f1df2634.js} +2 -2
  85. package/dist/components/{p-91a558eb.js.map → p-f1df2634.js.map} +1 -1
  86. package/dist/esm/loader.js +1 -1
  87. package/dist/esm/native.js +1 -1
  88. package/dist/esm/nv-calendar.entry.js +9 -3
  89. package/dist/esm/nv-calendar.entry.js.map +1 -1
  90. package/dist/esm/nv-dialog.entry.js +19 -32
  91. package/dist/esm/nv-dialog.entry.js.map +1 -1
  92. package/dist/esm/nv-dialogfooter_2.entry.js +1 -1
  93. package/dist/esm/nv-dialogfooter_2.entry.js.map +1 -1
  94. package/dist/esm/nv-fielddate.entry.js +62 -94
  95. package/dist/esm/nv-fielddate.entry.js.map +1 -1
  96. package/dist/esm/nv-fielddaterange.entry.js +52 -33
  97. package/dist/esm/nv-fielddaterange.entry.js.map +1 -1
  98. package/dist/esm/nv-fieldselect.entry.js +14 -26
  99. package/dist/esm/nv-fieldselect.entry.js.map +1 -1
  100. package/dist/esm/nv-icon.entry.js +2 -2
  101. package/dist/esm/nv-icon.entry.js.map +1 -1
  102. package/dist/native/native.esm.js +1 -1
  103. package/dist/native/native.esm.js.map +1 -1
  104. package/dist/native/{p-baddee4c.entry.js → p-11012998.entry.js} +2 -2
  105. package/dist/native/p-11012998.entry.js.map +1 -0
  106. package/dist/native/{p-dc34da69.entry.js → p-4a533dd8.entry.js} +2 -2
  107. package/dist/native/p-4a533dd8.entry.js.map +1 -0
  108. package/dist/native/{p-f687e05c.entry.js → p-55cd3d62.entry.js} +2 -2
  109. package/dist/native/p-55cd3d62.entry.js.map +1 -0
  110. package/dist/native/{p-516da423.entry.js → p-9ea3d30d.entry.js} +2 -2
  111. package/dist/native/p-9ea3d30d.entry.js.map +1 -0
  112. package/dist/native/{p-12039da4.entry.js → p-b7ec9a1b.entry.js} +2 -2
  113. package/dist/native/p-b7ec9a1b.entry.js.map +1 -0
  114. package/dist/native/p-bc77cac1.entry.js +2 -0
  115. package/dist/native/p-bc77cac1.entry.js.map +1 -0
  116. package/dist/native/{p-9dc1c3e7.entry.js → p-ff248eb8.entry.js} +2 -2
  117. package/dist/native/{p-9dc1c3e7.entry.js.map → p-ff248eb8.entry.js.map} +1 -1
  118. package/dist/types/components/nv-dialog/nv-dialog.d.ts +6 -17
  119. package/dist/types/components/nv-fielddate/nv-fielddate.d.ts +4 -19
  120. package/dist/types/components/nv-fielddaterange/nv-fielddaterange.d.ts +1 -0
  121. package/dist/types/components/nv-fieldselect/nv-fieldselect.d.ts +22 -9
  122. package/dist/types/components.d.ts +38 -4
  123. package/dist/vscode-data.json +2 -6
  124. package/hydrate/index.js +163 -197
  125. package/hydrate/index.mjs +163 -197
  126. package/package.json +1 -1
  127. package/dist/components/p-9232d306.js +0 -88
  128. package/dist/components/p-9232d306.js.map +0 -1
  129. package/dist/components/p-ca130ad2.js.map +0 -1
  130. package/dist/components/p-d32b75ac.js.map +0 -1
  131. package/dist/native/p-12039da4.entry.js.map +0 -1
  132. package/dist/native/p-516da423.entry.js.map +0 -1
  133. package/dist/native/p-baddee4c.entry.js.map +0 -1
  134. package/dist/native/p-c65a79a9.entry.js +0 -2
  135. package/dist/native/p-c65a79a9.entry.js.map +0 -1
  136. package/dist/native/p-dc34da69.entry.js.map +0 -1
  137. package/dist/native/p-f687e05c.entry.js.map +0 -1
@@ -1,10 +1,10 @@
1
1
  import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-aff3ed68.js';
2
- import { d as defineCustomElement$4 } from './p-9232d306.js';
3
- import { d as defineCustomElement$3 } from './p-6e2f91ae.js';
2
+ import { d as defineCustomElement$4 } from './p-6460318d.js';
3
+ import { d as defineCustomElement$3 } from './p-025b8a78.js';
4
4
  import { d as defineCustomElement$2 } from './p-dfd2d4f0.js';
5
5
  import { v as v4 } from './p-f5ff676c.js';
6
6
 
7
- const nvFieldselectCss = "nv-fieldslider .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .track-range{background:var(--components-slider-track-filled-focus)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .thumb{border-color:var(--components-slider-track-filled-focus)}nv-fieldslider[error] .slider-container .track-container .track .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb{border-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:hover{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-handler-background-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:focus{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-error)}nv-fieldselect{--nv-field-border-default:var(--components-form-field-border-default);--nv-field-border-hover:var(--components-form-field-border-hover);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--components-form-field-border-default);--nv-field-border-readonly:var(--components-form-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-brand);--nv-field-background:var(--components-form-field-background-default);display:flex;flex-direction:column;align-items:flex-start;gap:var(--form-gap-y);box-sizing:border-box;max-width:480px}nv-fieldselect[fluid]:not([fluid=false]){max-width:unset}nv-fieldselect[readonly]:not([readonly=false]){--nv-field-border-default:var(--components-form-field-border-readonly);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-background:var(--components-form-field-background-readonly)}nv-fieldselect[display-value]:not([display-value=false]){--nv-field-border-default:var(--components-form-field-border-readonly);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-background:var(--components-form-field-background-readonly)}nv-fieldselect[error]:not([error=false]){--nv-field-border-default:var(--components-form-field-border-error);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-destructive-in-field)}nv-fieldselect[success]:not([success=false]){--nv-field-border-default:var(--components-form-field-border-success);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-success)}nv-fieldselect[required]:not([required=false]) label::after{content:\"*\";color:var(--components-form-text-required);font-weight:700}nv-fieldselect[multiple]:not([multiple=false]) .select-wrapper>.select-container>.select-icons{top:var(--form-field-padding-y);right:var(--form-field-padding-x)}nv-fieldselect[multiple]:not([multiple=false]) .select-wrapper>.select-container>select{height:100%;box-sizing:border-box}nv-fieldselect label{display:flex;align-items:center;gap:var(--form-label-gap);align-self:stretch;color:var(--components-form-text-label-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:500;line-height:var(--form-label-line-height)}nv-fieldselect .select-wrapper{display:flex;flex-wrap:wrap;align-items:stretch;align-self:stretch}nv-fieldselect .select-wrapper .select-container{position:relative;display:flex;flex-grow:1;justify-content:center;align-items:center;align-self:stretch;border-radius:var(--form-field-radius);border-width:1px;border-style:solid;border-color:var(--nv-field-border-default);opacity:var(--components-form-opacity-default);background:var(--nv-field-background);transition:all 150ms ease-out}nv-fieldselect .select-wrapper .select-container:hover{border-color:var(--nv-field-border-hover)}nv-fieldselect .select-wrapper .select-container:focus-within{border-color:var(--nv-field-border-focus);box-shadow:0 0 0 var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fieldselect .select-wrapper .select-container:has(select:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fieldselect .select-wrapper .select-container>.select-icons{position:absolute;right:0;top:0;pointer-events:none}nv-fieldselect .select-wrapper .select-container>.select-icons>nv-iconbutton{border:0px;border-radius:0px}nv-fieldselect .select-wrapper .select-container>.select-icons>nv-iconbutton:focus-visible{border-radius:var(--button-md-border-radius);outline-offset:-3px}nv-fieldselect .select-wrapper .select-container input{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);padding:var(--form-field-padding-y) var(--form-field-padding-x);font-size:var(--form-field-font-size);font-style:normal;font-weight:500;line-height:var(--form-field-line-height);width:100%;}nv-fieldselect .select-wrapper .select-container input:focus{outline:none}nv-fieldselect .select-wrapper .select-container input::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:400;line-height:var(--form-field-line-height)}nv-fieldselect .select-wrapper .select-container input[type=password]::-ms-clear,nv-fieldselect .select-wrapper .select-container input[type=password]::-ms-reveal{display:none;width:0;height:0}nv-fieldselect .select-wrapper .select-container input:read-only{opacity:0.5;background-color:var(--components-form-field-background-readonly, rgba(0, 0, 0, 0.1));border-color:var(--nv-field-border-readonly)}nv-fieldselect .select-wrapper .select-container select{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);text-overflow:ellipsis;font-size:var(--form-field-font-size);font-style:normal;font-weight:500;height:var(--form-field-line-height);padding:var(--form-field-padding-y) var(--form-field-padding-x);box-sizing:content-box;-webkit-appearance:none;-moz-appearance:none;cursor:pointer}nv-fieldselect .select-wrapper .select-container select:focus{outline:none}nv-fieldselect .select-wrapper .select-container select::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:400;line-height:var(--form-field-line-height)}nv-fieldselect .select-wrapper .select-container select option{font-size:var(--form-field-font-size, 16px);font-style:normal;font-weight:500;line-height:var(--form-field-line-height, 24px)}nv-fieldselect .select-wrapper .select-container select.hidden{display:none}nv-fieldselect .select-wrapper .select-container nv-icon.readonly-icon{color:var(--nv-field-border-default)}nv-fieldselect .select-wrapper .select-container nv-icon.validation{color:var(--nv-field-border-default)}nv-fieldselect .description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height)}nv-fieldselect .error-description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}";
7
+ const nvFieldselectCss = "nv-fieldslider .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .track-range{background:var(--components-slider-track-filled-focus)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .thumb{border-color:var(--components-slider-track-filled-focus)}nv-fieldslider[error] .slider-container .track-container .track .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb{border-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:hover{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-handler-background-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:focus{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-error)}nv-fieldselect{--nv-field-border-default:var(--components-form-field-border-default);--nv-field-border-hover:var(--components-form-field-border-hover);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--components-form-field-border-default);--nv-field-border-readonly:var(--components-form-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-brand);--nv-field-background:var(--components-form-field-background-default);display:flex;flex-direction:column;align-items:flex-start;gap:var(--form-gap-y);box-sizing:border-box;max-width:480px}nv-fieldselect[fluid]:not([fluid=false]){max-width:unset}nv-fieldselect[readonly]:not([readonly=false]){--nv-field-border-default:var(--components-form-field-border-readonly);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-background:var(--components-form-field-background-readonly)}nv-fieldselect[display-value]:not([display-value=false]){--nv-field-border-default:var(--components-form-field-border-readonly);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-background:var(--components-form-field-background-readonly)}nv-fieldselect[error]:not([error=false]){--nv-field-border-default:var(--components-form-field-border-error);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-destructive-in-field)}nv-fieldselect[success]:not([success=false]){--nv-field-border-default:var(--components-form-field-border-success);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-success)}nv-fieldselect[required]:not([required=false]) label::after{content:\"*\";color:var(--components-form-text-required);font-weight:700}nv-fieldselect[multiple]:not([multiple=false]) .select-wrapper>.select-container>.select-icons{top:var(--form-field-padding-y);right:var(--form-field-padding-x)}nv-fieldselect[multiple]:not([multiple=false]) .select-wrapper>.select-container>select{height:100%;box-sizing:border-box}nv-fieldselect label{display:flex;align-items:center;gap:var(--form-label-gap);align-self:stretch;color:var(--components-form-text-label-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:500;line-height:var(--form-label-line-height)}nv-fieldselect .select-wrapper{display:flex;flex-wrap:wrap;align-items:stretch;align-self:stretch}nv-fieldselect .select-wrapper .select-container{position:relative;display:flex;flex-grow:1;justify-content:center;align-items:center;align-self:stretch;border-radius:var(--form-field-radius);border-width:1px;border-style:solid;border-color:var(--nv-field-border-default);opacity:var(--components-form-opacity-default);background:var(--nv-field-background);transition:all 150ms ease-out}nv-fieldselect .select-wrapper .select-container:hover{border-color:var(--nv-field-border-hover)}nv-fieldselect .select-wrapper .select-container:focus-within{border-color:var(--nv-field-border-focus);box-shadow:0 0 0 var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fieldselect .select-wrapper .select-container:has(select:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fieldselect .select-wrapper .select-container>.select-icons{position:absolute;right:0;top:0;pointer-events:none}nv-fieldselect .select-wrapper .select-container>.select-icons>nv-iconbutton{border:0px;border-radius:0px}nv-fieldselect .select-wrapper .select-container>.select-icons>nv-iconbutton:focus-visible{border-radius:var(--button-md-border-radius);outline-offset:-3px}nv-fieldselect .select-wrapper .select-container input{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);padding:var(--form-field-padding-y) var(--form-field-padding-x);font-size:var(--form-field-font-size);font-style:normal;font-weight:500;line-height:var(--form-field-line-height);width:100%;}nv-fieldselect .select-wrapper .select-container input:focus{outline:none}nv-fieldselect .select-wrapper .select-container input::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:400;line-height:var(--form-field-line-height)}nv-fieldselect .select-wrapper .select-container input[type=password]::-ms-clear,nv-fieldselect .select-wrapper .select-container input[type=password]::-ms-reveal{display:none;width:0;height:0}nv-fieldselect .select-wrapper .select-container input:read-only{opacity:0.5;background-color:var(--components-form-field-background-readonly, rgba(0, 0, 0, 0.1));border-color:var(--nv-field-border-readonly)}nv-fieldselect .select-wrapper .select-container select{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);text-overflow:ellipsis;font-size:var(--form-field-font-size);font-style:normal;font-weight:500;height:var(--form-field-line-height);padding:var(--form-field-padding-y) var(--form-field-padding-x);box-sizing:content-box;-webkit-appearance:none;-moz-appearance:none;cursor:pointer}nv-fieldselect .select-wrapper .select-container select:focus{outline:none}nv-fieldselect .select-wrapper .select-container select::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:400;line-height:var(--form-field-line-height)}nv-fieldselect .select-wrapper .select-container select option{font-size:var(--form-field-font-size, 16px);font-style:normal;font-weight:500;line-height:var(--form-field-line-height, 24px);background-color:var(--color-level-05-background);color:var(--components-form-field-content-text)}nv-fieldselect .select-wrapper .select-container select.hidden{display:none}nv-fieldselect .select-wrapper .select-container nv-icon.readonly-icon{color:var(--nv-field-border-default)}nv-fieldselect .select-wrapper .select-container nv-icon.validation{color:var(--nv-field-border-default)}nv-fieldselect .description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height)}nv-fieldselect .error-description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}";
8
8
  const NvFieldselectStyle0 = nvFieldselectCss;
9
9
 
10
10
  const NvFieldselect$1 = /*@__PURE__*/ proxyCustomElement(class NvFieldselect extends H {
@@ -17,10 +17,6 @@ const NvFieldselect$1 = /*@__PURE__*/ proxyCustomElement(class NvFieldselect ext
17
17
  //#region STATES
18
18
  this.computedDisplayValue = '';
19
19
  this.internalReadonly = false;
20
- /**
21
- * Parsed options stored internally
22
- */
23
- this.parsedOptions = [];
24
20
  //#endregion STATES
25
21
  /****************************************************************************/
26
22
  //#region PROPERTIES
@@ -170,24 +166,16 @@ const NvFieldselect$1 = /*@__PURE__*/ proxyCustomElement(class NvFieldselect ext
170
166
  }
171
167
  }
172
168
  /**
173
- * Parse options and update the internal state
174
- * @param {string} newValue - The new value of options
169
+ * Handle options change and update the internal state
170
+ * @param {typeof this.options} newValue - The new value of options
175
171
  */
176
172
  handleOptionsChange(newValue) {
177
- if (typeof newValue === 'string') {
178
- try {
179
- const parsedOpts = JSON.parse(newValue);
180
- this.parsedOptions = [...parsedOpts];
181
- // Update the value if an option is pre-selected
182
- const selectedOption = parsedOpts.find(opt => opt.selected);
183
- if (selectedOption) {
184
- this.value = selectedOption.value;
185
- }
186
- }
187
- catch (error) {
188
- console.error('Error parsing options:', error);
189
- this.parsedOptions = [];
190
- }
173
+ if (!newValue)
174
+ return;
175
+ // Update the value if an option is pre-selected
176
+ const selectedOption = newValue.find(opt => opt.selected);
177
+ if (selectedOption) {
178
+ this.value = selectedOption.value;
191
179
  }
192
180
  }
193
181
  /**
@@ -348,13 +336,13 @@ const NvFieldselect$1 = /*@__PURE__*/ proxyCustomElement(class NvFieldselect ext
348
336
  * @returns {HTMLStencilElement} The HTML element to render.
349
337
  */
350
338
  render() {
351
- return (h(Host, { key: 'ff869c177289342a39ae292a530359af940a5669' }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: '10815f70059de9b1774ccc26b69d441d250e1833', htmlFor: this.inputId }, h("slot", { key: 'afe78cd3671151060fd1e2a37b77c164767908fa', name: "label" }, this.label))), h("div", { key: '064d8f512bc5f11831096d3a092afb00dcfeb1bc', class: "select-wrapper" }, h("slot", { key: 'c12d375bc5a558d25f1eb34343e2ad5fce784558', name: "before-input" }), h("div", { key: 'ffb39cfc0444edc49a4e2b6318990085009d7598', class: "select-container", onClick: this.handleSelectContainerClick }, h("slot", { key: 'd5fccac0e92fe0553b8478a6f5dc9be4591e8c23', name: "leading-input" }), this.internalReadonly && (h("input", { key: '94dc05d08de8120c78fa140df5eb3adc09ce97da', id: this.inputId + '-readonly', type: "text", value: this.computedDisplayValue, readonly: true, class: "readonly-input", "aria-readonly": "true", "aria-label": this.label, "aria-describedby": this.error
339
+ return (h(Host, { key: '6db1f2e159308d8b1e78932522c62f73e78db893' }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: 'c329b6bb95018b0d9e574516ca8e801ea82828be', htmlFor: this.inputId }, h("slot", { key: '94d57fd7026986a8ef86dacffb70f0e590c8d2d7', name: "label" }, this.label))), h("div", { key: 'fca0df783ac46ebd16aa8b6e8db1450d81d2a0e7', class: "select-wrapper" }, h("slot", { key: 'bd944f336912516b83f32f58bd76a7ff80de2fb6', name: "before-input" }), h("div", { key: '42729a7ba192d85fa76abef9b928c98e514f7ff3', class: "select-container", onClick: this.handleSelectContainerClick }, h("slot", { key: '90ca0a9446a62a756e19b0b71db10fe8147eba25', name: "leading-input" }), this.internalReadonly && (h("input", { key: '55b2cf61b1ad07479a104c8d2ff4f46f41dd1677', id: this.inputId + '-readonly', type: "text", value: this.computedDisplayValue, readonly: true, class: "readonly-input", "aria-readonly": "true", "aria-label": this.label, "aria-describedby": this.error
352
340
  ? `${this.inputId}-error`
353
- : `${this.inputId}-description` })), h("select", { key: '85ffba58429aaa393cc9178e0866a61f85d92103', id: this.inputId, ref: el => (this.selectElement = el), name: this.name, autofocus: this.autofocus, disabled: this.disabled, required: this.required, multiple: this.multiple, onChange: this.handleSelectChange, class: this.internalReadonly ? 'hidden' : '', "aria-label": this.label, "aria-describedby": this.error
341
+ : `${this.inputId}-description` })), h("select", { key: '482be9d241679ad9f77f199c00b4a8d0434ac91e', id: this.inputId, ref: el => (this.selectElement = el), name: this.name, autofocus: this.autofocus, disabled: this.disabled, required: this.required, multiple: this.multiple, onChange: this.handleSelectChange, class: this.internalReadonly ? 'hidden' : '', "aria-label": this.label, "aria-describedby": this.error
354
342
  ? `${this.inputId}-error`
355
- : `${this.inputId}-description` }, this.parsedOptions.length > 0 ? (this.parsedOptions.map(option => (h("option", { value: option.value, selected: option.selected, disabled: option.disabled }, option.label)))) : (h("slot", null))), h("div", { key: '694b0306ddaf671faea9dd863bb7f2917b567ffb', class: "select-icons" }, this.error && (h("nv-icon", { key: '4f86b0916dcbfefb24af5e5e2c0ca009ece6193b', name: "alert-circle", class: "validation", size: "md" })), this.success && (h("nv-icon", { key: 'f99ba37d4a70b7c352b4abb0be0b5eb85b4cc947', name: "circle-check", class: "validation", size: "md" })), !this.multiple && (h("nv-iconbutton", { key: 'b152a3b110b0f780b29adcf1efb4aadf98cf81be', name: "chevron-down", size: "md", emphasis: "lower", tabindex: -1 })))), h("slot", { key: '63c6076165bae5d36732179c4a761d5b381076b5', name: "after-input" })), (this.description ||
356
- this.el.querySelector('[slot="description"]')) && (h("div", { key: 'dd3e41b62290c580e050eb5a4742aabc7395cbda', class: "description", id: `${this.inputId}-description` }, h("slot", { key: '87bedab511a8b3d07d6616e4937342b6d272c5f3', name: "description" }, this.description))), (this.errorDescription ||
357
- this.el.querySelector('[slot="error-description"]')) && (h("div", { key: 'd4cf69f5f2446fbbf8ed36910d89c3aa7ac2c826', class: "error-description", id: `${this.inputId}-error` }, h("slot", { key: '2fc8b58658bd406af834dcad378b3b00aca40b22', name: "error-description" }, this.errorDescription)))));
343
+ : `${this.inputId}-description` }, this.options && this.options.length > 0 ? (this.options.map(option => (h("option", { value: option.value, selected: option.selected, disabled: option.disabled }, option.label)))) : (h("slot", null))), h("div", { key: '17a31f45608536be911f3fca1e28e11caac7a065', class: "select-icons" }, this.error && (h("nv-icon", { key: 'f8f6f1545d87cfdf174755da82780356480de737', name: "alert-circle", class: "validation", size: "md" })), this.success && (h("nv-icon", { key: 'f79e5968a6fc70cf56c07223a8a569648d77c082', name: "circle-check", class: "validation", size: "md" })), !this.multiple && (h("nv-iconbutton", { key: 'd7f2c576a6c6c5d964f692c1f520d0e71af82f35', name: "chevron-down", size: "md", emphasis: "lower", tabindex: -1 })))), h("slot", { key: '852c05430b705347f473899ff884725b511d527d', name: "after-input" })), (this.description ||
344
+ this.el.querySelector('[slot="description"]')) && (h("div", { key: '3f98fb2ee526fae3c74f2e2dd78d5f10b9e13475', class: "description", id: `${this.inputId}-description` }, h("slot", { key: '268191d3ffc3191d7c946d805c6cd58dc1855dda', name: "description" }, this.description))), (this.errorDescription ||
345
+ this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '24b5935d22d7971f6aa5922a1fa8c47b8beb069f', class: "error-description", id: `${this.inputId}-error` }, h("slot", { key: '5492aecb0537f91f8cf38430b4048bb7bd13edf8', name: "error-description" }, this.errorDescription)))));
358
346
  }
359
347
  static get formAssociated() { return true; }
360
348
  get el() { return this; }
@@ -368,7 +356,7 @@ const NvFieldselect$1 = /*@__PURE__*/ proxyCustomElement(class NvFieldselect ext
368
356
  }, [68, "nv-fieldselect", {
369
357
  "message": [513],
370
358
  "validation": [513],
371
- "options": [513],
359
+ "options": [16],
372
360
  "inputId": [513, "input-id"],
373
361
  "label": [513],
374
362
  "description": [1537],
@@ -385,8 +373,7 @@ const NvFieldselect$1 = /*@__PURE__*/ proxyCustomElement(class NvFieldselect ext
385
373
  "autofocus": [516],
386
374
  "fluid": [516],
387
375
  "computedDisplayValue": [32],
388
- "internalReadonly": [32],
389
- "parsedOptions": [32]
376
+ "internalReadonly": [32]
390
377
  }, undefined, {
391
378
  "value": ["updateDisplayValueWatcher"],
392
379
  "displayValue": ["handleDisplayValueChange"],
@@ -1 +1 @@
1
- {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,CAC7D,EACA,IAAI,CAAC,OAAO,KACX,gEAAS,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,YAAY,EAAC,IAAI,EAAC,IAAI,GAAG,CAC7D,EAEA,CAAC,IAAI,CAAC,QAAQ,KACb,sEACE,IAAI,EAAC,cAAc,EACnB,IAAI,EAAC,IAAI,EACT,QAAQ,EAAC,OAAO,EAChB,QAAQ,EAAE,CAAC,CAAC,GACZ,CACH,CACG,CACF,EAEN,6DAAM,IAAI,EAAC,aAAa,GAAQ,CAC5B,EAEL,CAAC,IAAI,CAAC,WAAW;YAChB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,sBAAsB,CAAC,MAC7C,4DAAK,KAAK,EAAC,aAAa,EAAC,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,cAAc,IACxD,6DAAM,IAAI,EAAC,aAAa,IAAE,IAAI,CAAC,WAAW,CAAQ,CAC9C,CACP,EAEA,CAAC,IAAI,CAAC,gBAAgB;YACrB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,4BAA4B,CAAC,MACnD,4DAAK,KAAK,EAAC,mBAAmB,EAAC,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,QAAQ,IACxD,6DAAM,IAAI,EAAC,mBAAmB,IAAE,IAAI,CAAC,gBAAgB,CAAQ,CACzD,CACP,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["NvFieldselect","uuidv4"],"sources":["src/components/nv-fieldselect/nv-fieldselect.scss?tag=nv-fieldselect","src/components/nv-fieldselect/nv-fieldselect.tsx"],"sourcesContent":["@import '../../styles/form-field';\n\n@mixin form-field-select-wrapper() {\n display: flex;\n flex-wrap: wrap;\n align-items: stretch;\n align-self: stretch;\n}\n\n@mixin form-field-select-container() {\n position: relative;\n display: flex;\n flex-grow: 1;\n justify-content: center;\n align-items: center;\n align-self: stretch;\n border-radius: var(--form-field-radius);\n border-width: 1px;\n border-style: solid;\n border-color: var(--nv-field-border-default);\n opacity: var(--components-form-opacity-default);\n background: var(--nv-field-background);\n transition: all 150ms ease-out;\n\n &:hover {\n border-color: var(--nv-field-border-hover);\n }\n\n &:focus-within {\n border-color: var(--nv-field-border-focus);\n box-shadow: 0 0 0 var(--focus-field-stroke) var(--nv-field-focus-box-shadow);\n }\n\n &:has(select:disabled) {\n // opacity: var(--components-form-opacity-disabled, 0.5); broken token generation, is 50px instead of 0.5\n opacity: 0.5;\n background-color: var(--components-form-field-background-disabled);\n border-color: var(--nv-field-border-disabled);\n }\n}\n\n@mixin form-field-select() {\n display: flex;\n align-items: center;\n flex: 1 0 0;\n overflow: hidden;\n background-color: transparent;\n color: var(--components-form-field-content-text);\n text-overflow: ellipsis;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 500;\n height: var(--form-field-line-height);\n padding: var(--form-field-padding-y) var(--form-field-padding-x);\n box-sizing: content-box;\n -webkit-appearance: none;\n -moz-appearance: none;\n cursor: pointer;\n\n &:focus {\n outline: none;\n }\n\n &::placeholder {\n overflow: hidden;\n color: var(--components-form-field-content-placeholder);\n text-overflow: ellipsis;\n font-family: 'TT Norms Pro', sans-serif;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 400;\n line-height: var(--form-field-line-height);\n }\n}\n\n@mixin form-field-multi-select() {\n height: 100%;\n box-sizing: border-box;\n}\n\n@mixin form-field-select-icons() {\n position: absolute;\n right: 0;\n top: 0;\n pointer-events: none;\n}\n\nnv-fieldselect {\n @include form-field-variables();\n @include form-field-root();\n\n &[fluid]:not([fluid=\"false\"]) {\n @include form-field-fluid();\n }\n\n &[readonly]:not([readonly='false']) {\n @include form-field-readonly-variables();\n }\n\n &[display-value]:not([display-value='false']) {\n @include form-field-readonly-variables();\n }\n\n &[error]:not([error='false']) {\n @include form-field-error-variables();\n }\n\n &[success]:not([success='false']) {\n @include form-field-success-variables();\n }\n\n &[required]:not([required='false']) label {\n @include form-field-label-required();\n }\n\n &[multiple]:not([multiple='false']) {\n .select-wrapper > .select-container {\n > .select-icons {\n top: var(--form-field-padding-y);\n right: var(--form-field-padding-x);\n }\n > select {\n @include form-field-multi-select();\n }\n }\n }\n\n label {\n @include form-field-label();\n }\n\n .select-wrapper {\n @include form-field-select-wrapper();\n\n .select-container {\n @include form-field-select-container();\n\n > .select-icons {\n @include form-field-select-icons();\n > nv-iconbutton {\n @include form-field-action();\n }\n }\n\n input {\n @include form-field-input();\n\n &:read-only {\n // opacity: var(--components-form-opacity-disabled, 0.5); broken token generation, is 50px instead of 0.5\n opacity: 0.5;\n background-color: var(\n --components-form-field-background-readonly,\n rgb(0 0 0 / 10%)\n );\n border-color: var(--nv-field-border-readonly);\n }\n }\n\n select {\n @include form-field-select();\n\n & option {\n font-size: var(--form-field-font-size, 16px);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-field-line-height, 24px);\n }\n\n &.hidden {\n display: none;\n }\n }\n\n nv-icon.readonly-icon {\n @include form-field-icon();\n }\n\n nv-icon.validation {\n @include form-field-icon();\n }\n }\n }\n\n .description {\n @include form-field-description();\n }\n\n .error-description {\n @include form-field-error-description();\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Event,\n EventEmitter,\n Watch,\n Element,\n State,\n} from '@stencil/core';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * @slot default - Content to be placed inside the select element.\n * @slot leading-input - Content to be placed before the select input, within the select container.\n * @slot before-input - Content to be placed before the select input, outside the select container.\n * @slot after-input - Content to be placed after the select input, outside the select container.\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n * @slot error-description - Content to be placed as the error description, will override the errorDescription prop.\n */\n@Component({\n tag: 'nv-fieldselect',\n shadow: false,\n formAssociated: true,\n styleUrl: 'nv-fieldselect.scss',\n})\nexport class NvFieldselect {\n @Element() el: HTMLNvFieldselectElement;\n private selectElement!: HTMLSelectElement;\n private internals: ElementInternals;\n\n /****************************************************************************/\n //#region DEPRECATED\n\n /**\n * Message defines a 'hint ' message for the Select Field.\n * @deprecated Use `description` instead.\n */\n @Prop({ reflect: true })\n readonly message: string;\n\n /**\n * Add the message to the validation state.\n * @deprecated Use `errorDescription` and set the error prop instead.\n */\n @Prop({ reflect: true })\n readonly validation: string;\n\n //#endregion DEPRECATED\n /****************************************************************************/\n //#region STATES\n\n @State()\n private computedDisplayValue: string = '';\n\n @State()\n private internalReadonly: boolean = false;\n\n /**\n * Options to display in the select. Can be passed as a JSON string.\n * Format: [{ label: string, value: string, selected?: boolean, disabled?: boolean }]\n */\n @Prop({ reflect: true })\n readonly options?: string;\n\n /**\n * Parsed options stored internally\n */\n @State()\n private parsedOptions: Array<{\n /**\n * The label of the option\n */\n label: string;\n /**\n * The value of the option\n */\n value: string;\n /**\n * Whether the option is selected\n */\n selected?: boolean;\n /**\n * Whether the option is disabled\n */\n disabled?: boolean;\n }> = [];\n\n //#endregion STATES\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the select element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated\n * to ensure unique identification, facilitating proper label association and\n * accessibility.\n */\n @Prop({ reflect: true })\n readonly inputId: string = uuidv4();\n\n /**\n * Lets you define the text that explains what users should choose in the\n * select field. It’s a crucial element for making forms clear and\n * user-friendly.\n */\n @Prop({ reflect: true })\n readonly label?: string;\n\n /**\n * Add helpful hints or extra information under the select field. This is\n * where you can clarify what users should choose or provide additional\n * instructions, making the form easier to fill out correctly.\n */\n @Prop({ reflect: true, mutable: true })\n description?: string;\n\n /**\n * Defines the name attribute of the select field, which is crucial for form\n * submission. This value is used as the key in the key-value pair sent to\n * the server, representing the selected data in form submissions. It should be\n * unique within the form to avoid conflicts\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n /**\n * The disabled prop lets you turn off the select field so that users can’t\n * choose something. When disabled, the field is grayed out and won’t respond to\n * clicks or touches.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Display the select field’s content without allowing users to change it.\n * Users can still click on it, select, and copy the text, but they won’t be\n * able to change or delete anything.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * Marks the select field as required, ensuring that the user must fill it out\n * before submitting the form.\n */\n @Prop({ reflect: true })\n readonly required: boolean = false;\n\n /**\n * Alters the select field’s appearance to indicate an error, helping users\n * identify fields that need correction.\n * @validator error\n */\n @Prop({ reflect: true, mutable: true })\n error: boolean = false;\n\n /**\n * Show a helpful message under the select field when there’s a problem. It\n * explains what’s wrong and how users can fix it, making the error easier to\n * understand and resolve.\n * @validator message\n */\n @Prop({ reflect: true, mutable: true })\n errorDescription: string;\n\n /**\n * Changes the select field’s appearance to indicate successful input or\n * validation.\n */\n @Prop({ reflect: true })\n readonly success: boolean = false;\n\n /**\n * When enabled, allows the select to handle multiple selections.\n */\n @Prop({ reflect: true })\n readonly multiple: boolean = false;\n\n /**\n * The value of the select field.\n * - If `multiple` is `false`, it's a single string.\n * - If `multiple` is `true`, it's a comma-separated string of selected values.\n */\n @Prop({ reflect: true, mutable: true })\n value: string = '';\n\n /**\n * When enabled, displays the value element instead of the label when readonly.\n * By default, the label is displayed in readonly mode. Also it automatically\n * sets the component to readonly.\n */\n @Prop({ reflect: true })\n readonly displayValue: boolean = false;\n\n /**\n * Applies focus to the input field as soon as the component is mounted. This\n * is equivalent to setting the native autofocus attribute on a <select>\n * element.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n /**\n * Allows the field to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the selected value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>; // Emit as a string\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n /**\n * Updates the display value when the value property changes. This watcher is\n * used to update the display value when the selected value changes. This is\n * necessary for readonly select fields to display the selected value.\n * @internal This watcher is not intended to be called outside of the component.\n * @param {string} newValue - The new value of the select field.\n */\n @Watch('value')\n updateDisplayValueWatcher(newValue: string) {\n this.updateDisplayValue();\n\n if (this.selectElement) {\n const selectedValues = newValue.split(',').map(val => val.trim());\n const options = this.selectElement.options;\n\n if (options) {\n Array.from(options).forEach(option => {\n option.selected = this.multiple\n ? selectedValues.includes(option.value)\n : option.value === selectedValues[0];\n });\n\n if (!this.multiple) {\n this.selectElement.value = newValue; // Only set when not multiple\n }\n } else {\n this.selectElement.value = selectedValues[0] || '';\n }\n }\n\n // Update form value\n this.setFormValue();\n }\n\n /**\n * Watcher for the displayValue prop to ensure internalReadonly is true when displayValue is true.\n * @param {boolean} newValue - The new value of displayValue.\n */\n @Watch('displayValue')\n handleDisplayValueChange(newValue: boolean) {\n this.internalReadonly = newValue; // Set internalReadonly to true if displayValue is true\n\n if (this.readonly) {\n this.internalReadonly = true;\n }\n }\n\n /**\n * Watcher for the readonly prop to ensure internalReadonly is true when readonly is true.\n * @param {boolean} newValue - The new value of readonly.\n */\n @Watch('readonly')\n handleReadonlyChange(newValue: boolean) {\n this.internalReadonly = newValue; // Set internalReadonly to true if displayValue is true\n\n if (this.displayValue) {\n this.internalReadonly = true;\n }\n }\n\n /**\n * Parse options and update the internal state\n * @param {string} newValue - The new value of options\n */\n @Watch('options')\n handleOptionsChange(newValue: string) {\n if (typeof newValue === 'string') {\n try {\n const parsedOpts = JSON.parse(newValue);\n this.parsedOptions = [...parsedOpts];\n\n // Update the value if an option is pre-selected\n const selectedOption = parsedOpts.find(opt => opt.selected);\n if (selectedOption) {\n this.value = selectedOption.value;\n }\n } catch (error) {\n console.error('Error parsing options:', error);\n this.parsedOptions = [];\n }\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Handles the change event on the select element. This method is used to\n * update the value property when the selected options change. It is also\n * used to emit the selectChanged event when the selected value changes.\n * @param {Event} event - The change event on the select element.\n * @emits selectChanged\n */\n private readonly handleSelectChange = (event: Event) => {\n const select = event.target as HTMLSelectElement;\n let selectedValues: string[] = Array.from(select.selectedOptions).map(\n option => option.value,\n );\n\n if (!this.multiple) {\n selectedValues = selectedValues.slice(0, 1);\n }\n\n this.value = this.multiple\n ? selectedValues.join(', ')\n : selectedValues[0] || '';\n this.valueChanged.emit(this.value);\n\n // Update form value\n this.setFormValue();\n };\n\n /**\n * Handles focus when the select container is clicked.\n */\n private readonly handleSelectContainerClick = () => {\n if (!this.internalReadonly && this.selectElement) {\n this.selectElement.focus();\n }\n };\n\n /**\n * Updates the display value of the select field. This method is used to\n * update the display value when the selected value changes. This is necessary\n * for readonly select fields to display the selected value. This method is\n * called in the componentDidLoad lifecycle hook and the updateDisplayValueWatcher\n * watcher.\n * @internal This method is not intended to be called outside of the component.\n */\n private updateDisplayValue(): void {\n if (this.internalReadonly && !this.displayValue) {\n if (this.multiple) {\n const selectedLabels = this.value\n .split(',')\n .map(key => key.trim())\n .map(key => this.getLabelFromId(key) || '')\n .filter(label => label !== '');\n this.computedDisplayValue = selectedLabels.join(', ') || '';\n } else {\n this.computedDisplayValue = this.getLabelFromId(this.value) || '';\n }\n } else if (this.internalReadonly && this.displayValue) {\n this.computedDisplayValue = this.value || '';\n }\n }\n\n /**\n * Retrieves the label from the <option> elements based on the provided key (value).\n * This method uses the id or value attribute directly from the <select> options.\n * @param {string} key - The key (value) for which to find the corresponding label.\n * @returns {string} The label if found; otherwise, an empty string.\n */\n private getLabelFromId(key: string): string {\n this.ensureSelectElement();\n if (!this.selectElement) {\n return '';\n }\n\n // Cache the option list\n const options = this.selectElement.options;\n\n if (options) {\n const option = Array.from(options).find(option => option.value === key);\n return option ? option.textContent.trim() || '' : '';\n } else {\n return '';\n }\n }\n\n /**\n * Sets the value of the form element for form submission. This method is\n * called when the selected value changes or when the value property is set.\n * @internal This method is not intended to be called outside of the component.\n */\n private setFormValue(): void {\n this.internals.setFormValue(this.value);\n }\n\n /**\n * Ensures the select element is available. This method is used to ensure\n * the select element is available before attempting to access it.\n * @internal This method is not intended to be called outside of the component.\n */\n private ensureSelectElement(): void {\n if (!this.selectElement) {\n this.selectElement = this.el.querySelector('select') as HTMLSelectElement;\n }\n }\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillRender() {\n this.updateDisplayValue(); // Ensure display value is updated before render\n\n if (this.message) {\n this.description = this.message;\n }\n\n if (this.validation) {\n this.errorDescription = this.validation;\n this.error = true;\n }\n }\n\n /**\n * Lifecycle method that is called before the component is rendered. This is\n * where the internal state is set up before rendering occurs.\n */\n componentWillLoad() {\n // Set internalReadonly based on the readonly prop\n this.internalReadonly = this.readonly;\n\n // Ensure internalReadonly is true if displayValue is true during loading\n if (this.displayValue) {\n this.internalReadonly = true;\n }\n\n if ('attachInternals' in this.el) {\n this.internals = (\n this.el as HTMLElement & {\n /**\n * Attach the element to the form internals.\n * @returns {ElementInternals} - The element internals object.\n */\n attachInternals: () => ElementInternals;\n }\n ).attachInternals();\n } else {\n // Fallback logic for browsers without attachInternals support\n this.internals = {\n setFormValue: (value: string) => {\n const formElement = this.el.closest('form');\n if (formElement) {\n const input = document.createElement('input');\n input.type = 'hidden';\n input.name = this.name;\n input.value = value;\n formElement.appendChild(input);\n }\n },\n } as ElementInternals;\n }\n\n // Initialize value as an empty string if multiple is true\n if (this.multiple && typeof this.value !== 'string') {\n this.value = '';\n }\n\n // Parse initial options if present\n if (this.options) {\n this.handleOptionsChange(this.options);\n }\n }\n\n /**\n * Lifecycle method that is called after the component has been rendered.\n * This is where the display value is updated and the initial select element's\n * state is set.\n */\n componentDidLoad() {\n this.updateDisplayValue();\n\n if (this.selectElement) {\n // Only set the value for single selection, skip for multiple\n if (!this.multiple) {\n this.selectElement.value = this.value;\n }\n\n const selectedValues = this.multiple\n ? this.value.split(',').map(v => v.trim())\n : [this.value];\n\n const options = this.selectElement.options;\n\n if (options) {\n Array.from(options).forEach(option => {\n option.selected = this.multiple\n ? selectedValues.includes(option.value)\n : option.value === selectedValues[0];\n });\n } else {\n // Handle case where there are no options\n this.selectElement.value = selectedValues[0] || '';\n }\n }\n\n // Set the initial form value\n this.setFormValue();\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDERING\n\n /**\n * The render method creates the HTML structure for the component, including\n * the label, select element, and any error or description messages. It also\n * applies the appropriate CSS classes based on the readonly state and\n * displayValue prop. This method is called when the component is rendered.\n * @returns {HTMLStencilElement} The HTML element to render.\n */\n render() {\n return (\n <Host>\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.inputId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n\n <div class=\"select-wrapper\">\n <slot name=\"before-input\"></slot>\n\n <div\n class=\"select-container\"\n onClick={this.handleSelectContainerClick}\n >\n <slot name=\"leading-input\"></slot>\n\n {this.internalReadonly && (\n <input\n id={this.inputId + '-readonly'}\n type=\"text\"\n value={this.computedDisplayValue}\n readonly\n class=\"readonly-input\"\n aria-readonly=\"true\"\n aria-label={this.label}\n aria-describedby={\n this.error\n ? `${this.inputId}-error`\n : `${this.inputId}-description`\n }\n />\n )}\n\n <select\n id={this.inputId}\n ref={el => (this.selectElement = el)}\n name={this.name}\n autofocus={this.autofocus}\n disabled={this.disabled}\n required={this.required}\n multiple={this.multiple}\n onChange={this.handleSelectChange}\n class={this.internalReadonly ? 'hidden' : ''}\n aria-label={this.label}\n aria-describedby={\n this.error\n ? `${this.inputId}-error`\n : `${this.inputId}-description`\n }\n >\n {this.parsedOptions.length > 0 ? (\n this.parsedOptions.map(option => (\n <option\n value={option.value}\n selected={option.selected}\n disabled={option.disabled}\n >\n {option.label}\n </option>\n ))\n ) : (\n <slot />\n )}\n </select>\n <div class=\"select-icons\">\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"md\" />\n )}\n {this.success && (\n <nv-icon name=\"circle-check\" class=\"validation\" size=\"md\" />\n )}\n\n {!this.multiple && (\n <nv-iconbutton\n name=\"chevron-down\"\n size=\"md\"\n emphasis=\"lower\"\n tabindex={-1}\n />\n )}\n </div>\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n {(this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\" id={`${this.inputId}-description`}>\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div class=\"error-description\" id={`${this.inputId}-error`}>\n <slot name=\"error-description\">{this.errorDescription}</slot>\n </div>\n )}\n </Host>\n );\n }\n\n //#endregion RENDERING\n}\n"],"version":3}
1
+ {"file":"nv-fieldselect.js","mappings":";;;;;;AAAA,MAAM,gBAAgB,GAAG,8sSAA8sS,CAAC;AACxuS,4BAAe,gBAAgB;;MC2BlBA,eAAa;IAN1B;;;;;;;QAiCU,yBAAoB,GAAW,EAAE,CAAC;QAGlC,qBAAgB,GAAY,KAAK,CAAC;;;;;;;;;;QAqCjC,YAAO,GAAWC,EAAM,EAAE,CAAC;;;;;;QAiC3B,aAAQ,GAAY,KAAK,CAAC;;;;;;QAQ1B,aAAQ,GAAY,KAAK,CAAC;;;;;QAO1B,aAAQ,GAAY,KAAK,CAAC;;;;;;QAQnC,UAAK,GAAY,KAAK,CAAC;;;;;QAgBd,YAAO,GAAY,KAAK,CAAC;;;;QAMzB,aAAQ,GAAY,KAAK,CAAC;;;;;;QAQnC,UAAK,GAAW,EAAE,CAAC;;;;;;QAQV,iBAAY,GAAY,KAAK,CAAC;;;;;;QAS9B,cAAS,GAAY,KAAK,CAAC;;;;QAM3B,UAAK,GAAY,KAAK,CAAC;;;;;;;;;;;QAuGf,uBAAkB,GAAG,CAAC,KAAY;YACjD,MAAM,MAAM,GAAG,KAAK,CAAC,MAA2B,CAAC;YACjD,IAAI,cAAc,GAAa,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,GAAG,CACnE,MAAM,IAAI,MAAM,CAAC,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AC,KAAK,KACT,gEAAS,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,YAAY,EAAC,IAAI,EAAC,IAAI,GAAG,CAC7D,EACA,IAAI,CAAC,OAAO,KACX,gEAAS,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,YAAY,EAAC,IAAI,EAAC,IAAI,GAAG,CAC7D,EAEA,CAAC,IAAI,CAAC,QAAQ,KACb,sEACE,IAAI,EAAC,cAAc,EACnB,IAAI,EAAC,IAAI,EACT,QAAQ,EAAC,OAAO,EAChB,QAAQ,EAAE,CAAC,CAAC,GACZ,CACH,CACG,CACF,EAEN,6DAAM,IAAI,EAAC,aAAa,GAAQ,CAC5B,EAEL,CAAC,IAAI,CAAC,WAAW;YAChB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,sBAAsB,CAAC,MAC7C,4DAAK,KAAK,EAAC,aAAa,EAAC,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,cAAc,IACxD,6DAAM,IAAI,EAAC,aAAa,IAAE,IAAI,CAAC,WAAW,CAAQ,CAC9C,CACP,EAEA,CAAC,IAAI,CAAC,gBAAgB;YACrB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,4BAA4B,CAAC,MACnD,4DAAK,KAAK,EAAC,mBAAmB,EAAC,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,QAAQ,IACxD,6DAAM,IAAI,EAAC,mBAAmB,IAAE,IAAI,CAAC,gBAAgB,CAAQ,CACzD,CACP,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["NvFieldselect","uuidv4"],"sources":["src/components/nv-fieldselect/nv-fieldselect.scss?tag=nv-fieldselect","src/components/nv-fieldselect/nv-fieldselect.tsx"],"sourcesContent":["@import '../../styles/form-field';\n\n@mixin form-field-select-wrapper() {\n display: flex;\n flex-wrap: wrap;\n align-items: stretch;\n align-self: stretch;\n}\n\n@mixin form-field-select-container() {\n position: relative;\n display: flex;\n flex-grow: 1;\n justify-content: center;\n align-items: center;\n align-self: stretch;\n border-radius: var(--form-field-radius);\n border-width: 1px;\n border-style: solid;\n border-color: var(--nv-field-border-default);\n opacity: var(--components-form-opacity-default);\n background: var(--nv-field-background);\n transition: all 150ms ease-out;\n\n &:hover {\n border-color: var(--nv-field-border-hover);\n }\n\n &:focus-within {\n border-color: var(--nv-field-border-focus);\n box-shadow: 0 0 0 var(--focus-field-stroke) var(--nv-field-focus-box-shadow);\n }\n\n &:has(select:disabled) {\n // opacity: var(--components-form-opacity-disabled, 0.5); broken token generation, is 50px instead of 0.5\n opacity: 0.5;\n background-color: var(--components-form-field-background-disabled);\n border-color: var(--nv-field-border-disabled);\n }\n}\n\n@mixin form-field-select() {\n display: flex;\n align-items: center;\n flex: 1 0 0;\n overflow: hidden;\n background-color: transparent;\n color: var(--components-form-field-content-text);\n text-overflow: ellipsis;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 500;\n height: var(--form-field-line-height);\n padding: var(--form-field-padding-y) var(--form-field-padding-x);\n box-sizing: content-box;\n -webkit-appearance: none;\n -moz-appearance: none;\n cursor: pointer;\n\n &:focus {\n outline: none;\n }\n\n &::placeholder {\n overflow: hidden;\n color: var(--components-form-field-content-placeholder);\n text-overflow: ellipsis;\n font-family: 'TT Norms Pro', sans-serif;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 400;\n line-height: var(--form-field-line-height);\n }\n}\n\n@mixin form-field-multi-select() {\n height: 100%;\n box-sizing: border-box;\n}\n\n@mixin form-field-select-icons() {\n position: absolute;\n right: 0;\n top: 0;\n pointer-events: none;\n}\n\nnv-fieldselect {\n @include form-field-variables();\n @include form-field-root();\n\n &[fluid]:not([fluid=\"false\"]) {\n @include form-field-fluid();\n }\n\n &[readonly]:not([readonly='false']) {\n @include form-field-readonly-variables();\n }\n\n &[display-value]:not([display-value='false']) {\n @include form-field-readonly-variables();\n }\n\n &[error]:not([error='false']) {\n @include form-field-error-variables();\n }\n\n &[success]:not([success='false']) {\n @include form-field-success-variables();\n }\n\n &[required]:not([required='false']) label {\n @include form-field-label-required();\n }\n\n &[multiple]:not([multiple='false']) {\n .select-wrapper > .select-container {\n > .select-icons {\n top: var(--form-field-padding-y);\n right: var(--form-field-padding-x);\n }\n > select {\n @include form-field-multi-select();\n }\n }\n }\n\n label {\n @include form-field-label();\n }\n\n .select-wrapper {\n @include form-field-select-wrapper();\n\n .select-container {\n @include form-field-select-container();\n\n > .select-icons {\n @include form-field-select-icons();\n > nv-iconbutton {\n @include form-field-action();\n }\n }\n\n input {\n @include form-field-input();\n\n &:read-only {\n // opacity: var(--components-form-opacity-disabled, 0.5); broken token generation, is 50px instead of 0.5\n opacity: 0.5;\n background-color: var(\n --components-form-field-background-readonly,\n rgb(0 0 0 / 10%)\n );\n border-color: var(--nv-field-border-readonly);\n }\n }\n\n select {\n @include form-field-select();\n\n & option {\n font-size: var(--form-field-font-size, 16px);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-field-line-height, 24px);\n background-color: var(--color-level-05-background);\n color: var(--components-form-field-content-text);\n }\n\n &.hidden {\n display: none;\n }\n }\n\n nv-icon.readonly-icon {\n @include form-field-icon();\n }\n\n nv-icon.validation {\n @include form-field-icon();\n }\n }\n }\n\n .description {\n @include form-field-description();\n }\n\n .error-description {\n @include form-field-error-description();\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Event,\n EventEmitter,\n Watch,\n Element,\n State,\n} from '@stencil/core';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * @slot default - Content to be placed inside the select element.\n * @slot leading-input - Content to be placed before the select input, within the select container.\n * @slot before-input - Content to be placed before the select input, outside the select container.\n * @slot after-input - Content to be placed after the select input, outside the select container.\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n * @slot error-description - Content to be placed as the error description, will override the errorDescription prop.\n */\n@Component({\n tag: 'nv-fieldselect',\n shadow: false,\n formAssociated: true,\n styleUrl: 'nv-fieldselect.scss',\n})\nexport class NvFieldselect {\n @Element() el: HTMLNvFieldselectElement;\n private selectElement!: HTMLSelectElement;\n private internals: ElementInternals;\n\n /****************************************************************************/\n //#region DEPRECATED\n\n /**\n * Message defines a 'hint ' message for the Select Field.\n * @deprecated Use `description` instead.\n */\n @Prop({ reflect: true })\n readonly message: string;\n\n /**\n * Add the message to the validation state.\n * @deprecated Use `errorDescription` and set the error prop instead.\n */\n @Prop({ reflect: true })\n readonly validation: string;\n\n //#endregion DEPRECATED\n /****************************************************************************/\n //#region STATES\n\n @State()\n private computedDisplayValue: string = '';\n\n @State()\n private internalReadonly: boolean = false;\n\n /**\n * Options to display in the select.\n * Format: [{ label: string, value: string, selected?: boolean, disabled?: boolean }]\n */\n @Prop({ reflect: false })\n readonly options?: Array<{\n /**\n * The label of the option\n */\n label: string;\n /**\n * The value of the option\n */\n value: string;\n /**\n * Whether the option is selected\n */\n selected?: boolean;\n /**\n * Whether the option is disabled\n */\n disabled?: boolean;\n }>;\n\n //#endregion STATES\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the select element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated\n * to ensure unique identification, facilitating proper label association and\n * accessibility.\n */\n @Prop({ reflect: true })\n readonly inputId: string = uuidv4();\n\n /**\n * Lets you define the text that explains what users should choose in the\n * select field. It’s a crucial element for making forms clear and\n * user-friendly.\n */\n @Prop({ reflect: true })\n readonly label?: string;\n\n /**\n * Add helpful hints or extra information under the select field. This is\n * where you can clarify what users should choose or provide additional\n * instructions, making the form easier to fill out correctly.\n */\n @Prop({ reflect: true, mutable: true })\n description?: string;\n\n /**\n * Defines the name attribute of the select field, which is crucial for form\n * submission. This value is used as the key in the key-value pair sent to\n * the server, representing the selected data in form submissions. It should be\n * unique within the form to avoid conflicts\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n /**\n * The disabled prop lets you turn off the select field so that users can’t\n * choose something. When disabled, the field is grayed out and won’t respond to\n * clicks or touches.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Display the select field’s content without allowing users to change it.\n * Users can still click on it, select, and copy the text, but they won’t be\n * able to change or delete anything.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * Marks the select field as required, ensuring that the user must fill it out\n * before submitting the form.\n */\n @Prop({ reflect: true })\n readonly required: boolean = false;\n\n /**\n * Alters the select field’s appearance to indicate an error, helping users\n * identify fields that need correction.\n * @validator error\n */\n @Prop({ reflect: true, mutable: true })\n error: boolean = false;\n\n /**\n * Show a helpful message under the select field when there’s a problem. It\n * explains what’s wrong and how users can fix it, making the error easier to\n * understand and resolve.\n * @validator message\n */\n @Prop({ reflect: true, mutable: true })\n errorDescription: string;\n\n /**\n * Changes the select field’s appearance to indicate successful input or\n * validation.\n */\n @Prop({ reflect: true })\n readonly success: boolean = false;\n\n /**\n * When enabled, allows the select to handle multiple selections.\n */\n @Prop({ reflect: true })\n readonly multiple: boolean = false;\n\n /**\n * The value of the select field.\n * - If `multiple` is `false`, it's a single string.\n * - If `multiple` is `true`, it's a comma-separated string of selected values.\n */\n @Prop({ reflect: true, mutable: true })\n value: string = '';\n\n /**\n * When enabled, displays the value element instead of the label when readonly.\n * By default, the label is displayed in readonly mode. Also it automatically\n * sets the component to readonly.\n */\n @Prop({ reflect: true })\n readonly displayValue: boolean = false;\n\n /**\n * Applies focus to the input field as soon as the component is mounted. This\n * is equivalent to setting the native autofocus attribute on a <select>\n * element.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n /**\n * Allows the field to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the selected value changes.\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>; // Emit as a string\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n /**\n * Updates the display value when the value property changes. This watcher is\n * used to update the display value when the selected value changes. This is\n * necessary for readonly select fields to display the selected value.\n * @internal This watcher is not intended to be called outside of the component.\n * @param {string} newValue - The new value of the select field.\n */\n @Watch('value')\n updateDisplayValueWatcher(newValue: string) {\n this.updateDisplayValue();\n\n if (this.selectElement) {\n const selectedValues = newValue.split(',').map(val => val.trim());\n const options = this.selectElement.options;\n\n if (options) {\n Array.from(options).forEach(option => {\n option.selected = this.multiple\n ? selectedValues.includes(option.value)\n : option.value === selectedValues[0];\n });\n\n if (!this.multiple) {\n this.selectElement.value = newValue; // Only set when not multiple\n }\n } else {\n this.selectElement.value = selectedValues[0] || '';\n }\n }\n\n // Update form value\n this.setFormValue();\n }\n\n /**\n * Watcher for the displayValue prop to ensure internalReadonly is true when displayValue is true.\n * @param {boolean} newValue - The new value of displayValue.\n */\n @Watch('displayValue')\n handleDisplayValueChange(newValue: boolean) {\n this.internalReadonly = newValue; // Set internalReadonly to true if displayValue is true\n\n if (this.readonly) {\n this.internalReadonly = true;\n }\n }\n\n /**\n * Watcher for the readonly prop to ensure internalReadonly is true when readonly is true.\n * @param {boolean} newValue - The new value of readonly.\n */\n @Watch('readonly')\n handleReadonlyChange(newValue: boolean) {\n this.internalReadonly = newValue; // Set internalReadonly to true if displayValue is true\n\n if (this.displayValue) {\n this.internalReadonly = true;\n }\n }\n\n /**\n * Handle options change and update the internal state\n * @param {typeof this.options} newValue - The new value of options\n */\n @Watch('options')\n handleOptionsChange(newValue: typeof this.options) {\n if (!newValue) return;\n\n // Update the value if an option is pre-selected\n const selectedOption = newValue.find(opt => opt.selected);\n if (selectedOption) {\n this.value = selectedOption.value;\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Handles the change event on the select element. This method is used to\n * update the value property when the selected options change. It is also\n * used to emit the selectChanged event when the selected value changes.\n * @param {Event} event - The change event on the select element.\n * @emits selectChanged\n */\n private readonly handleSelectChange = (event: Event) => {\n const select = event.target as HTMLSelectElement;\n let selectedValues: string[] = Array.from(select.selectedOptions).map(\n option => option.value,\n );\n\n if (!this.multiple) {\n selectedValues = selectedValues.slice(0, 1);\n }\n\n this.value = this.multiple\n ? selectedValues.join(', ')\n : selectedValues[0] || '';\n this.valueChanged.emit(this.value);\n\n // Update form value\n this.setFormValue();\n };\n\n /**\n * Handles focus when the select container is clicked.\n */\n private readonly handleSelectContainerClick = () => {\n if (!this.internalReadonly && this.selectElement) {\n this.selectElement.focus();\n }\n };\n\n /**\n * Updates the display value of the select field. This method is used to\n * update the display value when the selected value changes. This is necessary\n * for readonly select fields to display the selected value. This method is\n * called in the componentDidLoad lifecycle hook and the updateDisplayValueWatcher\n * watcher.\n * @internal This method is not intended to be called outside of the component.\n */\n private updateDisplayValue(): void {\n if (this.internalReadonly && !this.displayValue) {\n if (this.multiple) {\n const selectedLabels = this.value\n .split(',')\n .map(key => key.trim())\n .map(key => this.getLabelFromId(key) || '')\n .filter(label => label !== '');\n this.computedDisplayValue = selectedLabels.join(', ') || '';\n } else {\n this.computedDisplayValue = this.getLabelFromId(this.value) || '';\n }\n } else if (this.internalReadonly && this.displayValue) {\n this.computedDisplayValue = this.value || '';\n }\n }\n\n /**\n * Retrieves the label from the <option> elements based on the provided key (value).\n * This method uses the id or value attribute directly from the <select> options.\n * @param {string} key - The key (value) for which to find the corresponding label.\n * @returns {string} The label if found; otherwise, an empty string.\n */\n private getLabelFromId(key: string): string {\n this.ensureSelectElement();\n if (!this.selectElement) {\n return '';\n }\n\n // Cache the option list\n const options = this.selectElement.options;\n\n if (options) {\n const option = Array.from(options).find(option => option.value === key);\n return option ? option.textContent.trim() || '' : '';\n } else {\n return '';\n }\n }\n\n /**\n * Sets the value of the form element for form submission. This method is\n * called when the selected value changes or when the value property is set.\n * @internal This method is not intended to be called outside of the component.\n */\n private setFormValue(): void {\n this.internals.setFormValue(this.value);\n }\n\n /**\n * Ensures the select element is available. This method is used to ensure\n * the select element is available before attempting to access it.\n * @internal This method is not intended to be called outside of the component.\n */\n private ensureSelectElement(): void {\n if (!this.selectElement) {\n this.selectElement = this.el.querySelector('select') as HTMLSelectElement;\n }\n }\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillRender() {\n this.updateDisplayValue(); // Ensure display value is updated before render\n\n if (this.message) {\n this.description = this.message;\n }\n\n if (this.validation) {\n this.errorDescription = this.validation;\n this.error = true;\n }\n }\n\n /**\n * Lifecycle method that is called before the component is rendered. This is\n * where the internal state is set up before rendering occurs.\n */\n componentWillLoad() {\n // Set internalReadonly based on the readonly prop\n this.internalReadonly = this.readonly;\n\n // Ensure internalReadonly is true if displayValue is true during loading\n if (this.displayValue) {\n this.internalReadonly = true;\n }\n\n if ('attachInternals' in this.el) {\n this.internals = (\n this.el as HTMLElement & {\n /**\n * Attach the element to the form internals.\n * @returns {ElementInternals} - The element internals object.\n */\n attachInternals: () => ElementInternals;\n }\n ).attachInternals();\n } else {\n // Fallback logic for browsers without attachInternals support\n this.internals = {\n setFormValue: (value: string) => {\n const formElement = this.el.closest('form');\n if (formElement) {\n const input = document.createElement('input');\n input.type = 'hidden';\n input.name = this.name;\n input.value = value;\n formElement.appendChild(input);\n }\n },\n } as ElementInternals;\n }\n\n // Initialize value as an empty string if multiple is true\n if (this.multiple && typeof this.value !== 'string') {\n this.value = '';\n }\n\n // Parse initial options if present\n if (this.options) {\n this.handleOptionsChange(this.options);\n }\n }\n\n /**\n * Lifecycle method that is called after the component has been rendered.\n * This is where the display value is updated and the initial select element's\n * state is set.\n */\n componentDidLoad() {\n this.updateDisplayValue();\n\n if (this.selectElement) {\n // Only set the value for single selection, skip for multiple\n if (!this.multiple) {\n this.selectElement.value = this.value;\n }\n\n const selectedValues = this.multiple\n ? this.value.split(',').map(v => v.trim())\n : [this.value];\n\n const options = this.selectElement.options;\n\n if (options) {\n Array.from(options).forEach(option => {\n option.selected = this.multiple\n ? selectedValues.includes(option.value)\n : option.value === selectedValues[0];\n });\n } else {\n // Handle case where there are no options\n this.selectElement.value = selectedValues[0] || '';\n }\n }\n\n // Set the initial form value\n this.setFormValue();\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDERING\n\n /**\n * The render method creates the HTML structure for the component, including\n * the label, select element, and any error or description messages. It also\n * applies the appropriate CSS classes based on the readonly state and\n * displayValue prop. This method is called when the component is rendered.\n * @returns {HTMLStencilElement} The HTML element to render.\n */\n render() {\n return (\n <Host>\n {(this.label || this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.inputId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n\n <div class=\"select-wrapper\">\n <slot name=\"before-input\"></slot>\n\n <div\n class=\"select-container\"\n onClick={this.handleSelectContainerClick}\n >\n <slot name=\"leading-input\"></slot>\n\n {this.internalReadonly && (\n <input\n id={this.inputId + '-readonly'}\n type=\"text\"\n value={this.computedDisplayValue}\n readonly\n class=\"readonly-input\"\n aria-readonly=\"true\"\n aria-label={this.label}\n aria-describedby={\n this.error\n ? `${this.inputId}-error`\n : `${this.inputId}-description`\n }\n />\n )}\n\n <select\n id={this.inputId}\n ref={el => (this.selectElement = el)}\n name={this.name}\n autofocus={this.autofocus}\n disabled={this.disabled}\n required={this.required}\n multiple={this.multiple}\n onChange={this.handleSelectChange}\n class={this.internalReadonly ? 'hidden' : ''}\n aria-label={this.label}\n aria-describedby={\n this.error\n ? `${this.inputId}-error`\n : `${this.inputId}-description`\n }\n >\n {this.options && this.options.length > 0 ? (\n this.options.map(option => (\n <option\n value={option.value}\n selected={option.selected}\n disabled={option.disabled}\n >\n {option.label}\n </option>\n ))\n ) : (\n <slot />\n )}\n </select>\n <div class=\"select-icons\">\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"md\" />\n )}\n {this.success && (\n <nv-icon name=\"circle-check\" class=\"validation\" size=\"md\" />\n )}\n\n {!this.multiple && (\n <nv-iconbutton\n name=\"chevron-down\"\n size=\"md\"\n emphasis=\"lower\"\n tabindex={-1}\n />\n )}\n </div>\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n {(this.description ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\" id={`${this.inputId}-description`}>\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div class=\"error-description\" id={`${this.inputId}-error`}>\n <slot name=\"error-description\">{this.errorDescription}</slot>\n </div>\n )}\n </Host>\n );\n }\n\n //#endregion RENDERING\n}\n"],"version":3}
@@ -1,7 +1,7 @@
1
1
  import { h, p as proxyCustomElement, H, c as createEvent, d as Host } from './p-aff3ed68.js';
2
- import { d as defineCustomElement$5 } from './p-7bc65e46.js';
3
- import { d as defineCustomElement$4 } from './p-9232d306.js';
4
- import { d as defineCustomElement$3 } from './p-6e2f91ae.js';
2
+ import { d as defineCustomElement$5 } from './p-db4ba1d9.js';
3
+ import { d as defineCustomElement$4 } from './p-6460318d.js';
4
+ import { d as defineCustomElement$3 } from './p-025b8a78.js';
5
5
  import { d as defineCustomElement$2 } from './p-dfd2d4f0.js';
6
6
  import { v as v4 } from './p-f5ff676c.js';
7
7
 
@@ -1,4 +1,4 @@
1
- import { N as NvFieldtext$1, d as defineCustomElement$1 } from './p-9a209ac7.js';
1
+ import { N as NvFieldtext$1, d as defineCustomElement$1 } from './p-68ff562f.js';
2
2
 
3
3
  const NvFieldtext = NvFieldtext$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,8 +1,8 @@
1
1
  import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-aff3ed68.js';
2
2
  import { a as startsWithIgnoreCase } from './p-a5c8eee9.js';
3
3
  import { T as TimeType } from './p-1f505531.js';
4
- import { d as defineCustomElement$5 } from './p-9232d306.js';
5
- import { d as defineCustomElement$4 } from './p-6e2f91ae.js';
4
+ import { d as defineCustomElement$5 } from './p-6460318d.js';
5
+ import { d as defineCustomElement$4 } from './p-025b8a78.js';
6
6
  import { d as defineCustomElement$3 } from './p-dfd2d4f0.js';
7
7
  import { d as defineCustomElement$2 } from './p-8067d283.js';
8
8
  import { v as v4 } from './p-f5ff676c.js';
@@ -1,4 +1,4 @@
1
- import { N as NvIcon$1, d as defineCustomElement$1 } from './p-9232d306.js';
1
+ import { N as NvIcon$1, d as defineCustomElement$1 } from './p-6460318d.js';
2
2
 
3
3
  const NvIcon = NvIcon$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { N as NvIconbutton$1, d as defineCustomElement$1 } from './p-6e2f91ae.js';
1
+ import { N as NvIconbutton$1, d as defineCustomElement$1 } from './p-025b8a78.js';
2
2
 
3
3
  const NvIconbutton = NvIconbutton$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,6 +1,6 @@
1
1
  import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-aff3ed68.js';
2
- import { d as defineCustomElement$4 } from './p-9232d306.js';
3
- import { d as defineCustomElement$3 } from './p-865725bf.js';
2
+ import { d as defineCustomElement$4 } from './p-6460318d.js';
3
+ import { d as defineCustomElement$3 } from './p-30f970c3.js';
4
4
  import { d as defineCustomElement$2 } from './p-8067d283.js';
5
5
 
6
6
  const nvMenuCss = "nv-menuitem{display:flex;align-items:center;max-width:300px;width:100vw;font-size:var(--menu-contextual-item-font-size);font-weight:var(--menu-contextual-item-font-weight);color:var(--components-menu-contextual-item-content);border-radius:var(--menu-contextual-item-radius);gap:var(--menu-contextual-item-gap-x);padding:var(--menu-contextual-item-padding-y) var(--menu-contextual-item-padding-x);transition:background-color 150ms ease-out;cursor:pointer}nv-menuitem:hover,nv-menuitem:focus,nv-menuitem:focus-within{background-color:var(--components-menu-contextual-item-background-hover);color:var(--components-menu-contextual-item-content-hover)}nv-menuitem *{pointer-events:none}nv-menuitem kbd{color:var(--components-menu-contextual-item-shortcut)}nv-menuitem [data-scope=text]{margin-right:auto}nv-menuitem[disabled]:not([disabled=false]){cursor:unset;background-color:unset;color:var(--components-menu-contextual-item-content-disabled)}nv-menu{display:inline-block;position:relative}nv-menu:has([fluid]:not([fluid=false])){display:block}nv-menu nv-popover{display:unset}nv-menu nv-popover [data-scope=popover]{background-color:transparent !important;padding:0 !important}nv-menu [slot=content]{padding:var(--menu-contextual-padding-y) var(--menu-contextual-padding-x);border-radius:var(--menu-contextual-radius);gap:var(--menu-contextual-gap-y);background-color:var(--components-menu-contextual-background);border-color:var(--components-menu-contextual-border);display:flex;flex-direction:column}nv-menu nv-menu[open]:not([open=false])>nv-menuitem{background-color:var(--components-menu-contextual-item-background-hover);color:var(--components-menu-contextual-item-content-hover)}nv-menu hr{display:block;margin:var(--menu-contextual-divider-padding-top) var(--menu-contextual-divider-padding-x) var(--menu-contextual-divider-padding-bottom) var(--menu-contextual-divider-padding-x)}";
@@ -1,4 +1,4 @@
1
- import { N as NvMenuitem$1, d as defineCustomElement$1 } from './p-865725bf.js';
1
+ import { N as NvMenuitem$1, d as defineCustomElement$1 } from './p-30f970c3.js';
2
2
 
3
3
  const NvMenuitem = NvMenuitem$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,6 +1,6 @@
1
1
  import { p as proxyCustomElement, H, h, d as Host } from './p-aff3ed68.js';
2
2
  import { c as clsx } from './p-8a1a6e56.js';
3
- import { d as defineCustomElement$2 } from './p-9232d306.js';
3
+ import { d as defineCustomElement$2 } from './p-6460318d.js';
4
4
  import { d as defineCustomElement$1 } from './p-dfd2d4f0.js';
5
5
 
6
6
  const nvIconbuttonCss = "nv-iconbutton.root{display:inline-flex;justify-content:center;align-items:center;font-style:normal;font-weight:500;font-family:\"TT Norms Pro\", sans-serif;transition:background-color 150ms ease-out;height:fit-content;width:fit-content}nv-iconbutton.size-xs{padding:var(--button-xs-icon-button-padding);gap:var(--button-xs-gap);border-radius:var(--button-xs-border-radius);line-height:var(--button-xs-line-height);font-size:var(--button-xs-font-size)}nv-iconbutton.size-sm{padding:var(--button-sm-icon-button-padding);gap:var(--button-sm-gap);border-radius:var(--button-sm-border-radius);line-height:var(--button-sm-line-height);font-size:var(--button-sm-font-size)}nv-iconbutton.size-md{padding:var(--button-md-icon-button-padding);gap:var(--button-md-gap);border-radius:var(--button-md-border-radius);line-height:var(--button-md-line-height);font-size:var(--button-md-font-size)}nv-iconbutton.size-lg{padding:var(--button-lg-icon-button-padding);gap:var(--button-lg-gap);border-radius:var(--button-lg-border-radius);line-height:var(--button-lg-line-height);font-size:var(--button-lg-font-size)}nv-iconbutton.emphasis-high{background:var(--components-button-high-background);border:1px solid var(--components-button-high-border);color:var(--components-button-high-text)}nv-iconbutton.emphasis-high:hover{background:var(--components-button-high-background-hover);color:var(--components-button-high-text-hover)}nv-iconbutton.emphasis-high:focus,nv-iconbutton.emphasis-high:focus-within{outline:none}nv-iconbutton.emphasis-high:focus-visible,nv-iconbutton.emphasis-high:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-high:disabled{background:var(--components-button-high-background);color:var(--components-button-high-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-high nv-icon>svg{color:var(--components-button-high-icon)}nv-iconbutton.emphasis-medium{background:var(--components-button-medium-background);border:1px solid var(--components-button-medium-border);color:var(--components-button-medium-text)}nv-iconbutton.emphasis-medium:hover{background:var(--components-button-medium-background-hover);color:var(--components-button-medium-text-hover)}nv-iconbutton.emphasis-medium:focus,nv-iconbutton.emphasis-medium:focus-within{outline:none}nv-iconbutton.emphasis-medium:focus-visible,nv-iconbutton.emphasis-medium:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-medium:disabled{background:var(--components-button-medium-background);color:var(--components-button-medium-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-medium nv-icon>svg{color:var(--components-button-medium-icon)}nv-iconbutton.emphasis-low{background:var(--components-button-low-background);border:1px solid var(--components-button-low-border);color:var(--components-button-low-text)}nv-iconbutton.emphasis-low:hover{background:var(--components-button-low-background-hover);color:var(--components-button-low-text-hover)}nv-iconbutton.emphasis-low:focus,nv-iconbutton.emphasis-low:focus-within{outline:none}nv-iconbutton.emphasis-low:focus-visible,nv-iconbutton.emphasis-low:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-low:disabled{background:var(--components-button-low-background);color:var(--components-button-low-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-low nv-icon>svg{color:var(--components-button-low-icon)}nv-iconbutton.emphasis-lower{background:var(--components-button-lower-background);border:1px solid var(--components-button-lower-border);color:var(--components-button-lower-text)}nv-iconbutton.emphasis-lower:hover{background:var(--components-button-lower-background-hover);color:var(--components-button-lower-text-hover)}nv-iconbutton.emphasis-lower:focus,nv-iconbutton.emphasis-lower:focus-within{outline:none}nv-iconbutton.emphasis-lower:focus-visible,nv-iconbutton.emphasis-lower:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-iconbutton.emphasis-lower:disabled{background:var(--components-button-lower-background);color:var(--components-button-lower-text);opacity:0.5;cursor:not-allowed;box-shadow:none}nv-iconbutton.emphasis-lower nv-icon>svg{color:var(--components-button-lower-icon)}nv-iconbutton.loading [slot=leading-icon]{display:none}nv-iconbutton.shape-rounded{border-radius:var(--radius-rounded-full)}";
@@ -166,4 +166,4 @@ defineCustomElement();
166
166
 
167
167
  export { NvIconbutton as N, defineCustomElement as d };
168
168
 
169
- //# sourceMappingURL=p-6e2f91ae.js.map
169
+ //# sourceMappingURL=p-025b8a78.js.map
@@ -1 +1 @@
1
- {"file":"p-6e2f91ae.js","mappings":";;;;;AAAA,MAAM,eAAe,GAAG,sqJAAsqJ,CA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,KAAK,EAAE,CAAC;SACjB;KACF;IAGD,gBAAgB,CAAC,KAAiB;QAChC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO;QACrC,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;KACjB;;;;IAMD,iBAAiB;QACf,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC;SAC9B;KACF;;;;IAMD,MAAM;QACJ,QACE,EAAC,IAAI,qDACH,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,QAAQ,EAAC,GAAG,EACZ,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,SAAS,EAC1C,KAAK,EAAE,IAAI,CACT,MAAM,EACN,QAAQ,IAAI,CAAC,IAAI,EAAE,EACnB,YAAY,IAAI,CAAC,QAAQ,EAAE,EAC3B,IAAI,CAAC,OAAO,IAAI,SAAS,EACzB,SAAS,IAAI,CAAC,KAAK,EAAE,CACtB,EACD,OAAO,EAAE,IAAI,CAAC,WAAW,IAExB,IAAI,CAAC,OAAO,IAAI,kEAAW,IAAI,EAAE,IAAI,CAAC,IAAI,GAAc,EAExD,CAAC,IAAI,CAAC,OAAO,IAAI,gEAAS,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI,EAE/D,8DAAa,CACR,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/nv-iconbutton/nv-iconbutton.scss?tag=nv-iconbutton","src/components/nv-iconbutton/nv-iconbutton.tsx"],"sourcesContent":["@use \"sass:map\";\n@import \"../../styles/focus-ring\";\n\n/* Variants */\n$button-sizes: (\"xs\", \"sm\", \"md\", \"lg\");\n$button-emphasis: (\"high\", \"medium\", \"low\", \"lower\");\n\n/* Define maps for size-related variables */\n$button-icon-button-padding: (\n \"xs\": var(--button-xs-icon-button-padding),\n \"sm\": var(--button-sm-icon-button-padding),\n \"md\": var(--button-md-icon-button-padding),\n \"lg\": var(--button-lg-icon-button-padding)\n);\n\n$button-gap: (\n \"xs\": var(--button-xs-gap),\n \"sm\": var(--button-sm-gap),\n \"md\": var(--button-md-gap),\n \"lg\": var(--button-lg-gap)\n);\n\n$button-border-radius: (\n \"xs\": var(--button-xs-border-radius),\n \"sm\": var(--button-sm-border-radius),\n \"md\": var(--button-md-border-radius),\n \"lg\": var(--button-lg-border-radius)\n);\n\n$button-line-height: (\n \"xs\": var(--button-xs-line-height),\n \"sm\": var(--button-sm-line-height),\n \"md\": var(--button-md-line-height),\n \"lg\": var(--button-lg-line-height)\n);\n\n$button-font-size: (\n \"xs\": var(--button-xs-font-size),\n \"sm\": var(--button-sm-font-size),\n \"md\": var(--button-md-font-size),\n \"lg\": var(--button-lg-font-size)\n);\n\n/* Define maps for emphasis-related variables */\n$components-button-background: (\n \"high\": var(--components-button-high-background),\n \"medium\": var(--components-button-medium-background),\n \"low\": var(--components-button-low-background),\n \"lower\": var(--components-button-lower-background)\n);\n\n$components-button-border: (\n \"high\": var(--components-button-high-border),\n \"medium\": var(--components-button-medium-border),\n \"low\": var(--components-button-low-border),\n \"lower\": var(--components-button-lower-border)\n);\n\n$components-button-text: (\n \"high\": var(--components-button-high-text),\n \"medium\": var(--components-button-medium-text),\n \"low\": var(--components-button-low-text),\n \"lower\": var(--components-button-lower-text)\n);\n\n$components-button-background-hover: (\n \"high\": var(--components-button-high-background-hover),\n \"medium\": var(--components-button-medium-background-hover),\n \"low\": var(--components-button-low-background-hover),\n \"lower\": var(--components-button-lower-background-hover)\n);\n\n$components-button-text-hover: (\n \"high\": var(--components-button-high-text-hover),\n \"medium\": var(--components-button-medium-text-hover),\n \"low\": var(--components-button-low-text-hover),\n \"lower\": var(--components-button-lower-text-hover)\n);\n\n$components-button-icon: (\n \"high\": var(--components-button-high-icon),\n \"medium\": var(--components-button-medium-icon),\n \"low\": var(--components-button-low-icon),\n \"lower\": var(--components-button-lower-icon)\n);\n\n@mixin root-styles() {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n font-style: normal;\n font-weight: 500;\n font-family: \"TT Norms Pro\", sans-serif;\n transition: background-color 150ms ease-out;\n height: fit-content;\n width: fit-content;\n}\n\n@mixin size-styles($size) {\n padding: map.get($button-icon-button-padding, $size);\n gap: map.get($button-gap, $size);\n border-radius: map.get($button-border-radius, $size);\n line-height: map.get($button-line-height, $size);\n font-size: map.get($button-font-size, $size);\n}\n\n@mixin emphasis-styles($emphasis) {\n background: map.get($components-button-background, $emphasis);\n border: 1px solid map.get($components-button-border, $emphasis);\n color: map.get($components-button-text, $emphasis);\n\n &:hover {\n background: map.get($components-button-background-hover, $emphasis);\n color: map.get($components-button-text-hover, $emphasis);\n }\n\n @include focus-ring();\n\n &:disabled {\n background: map.get($components-button-background, $emphasis);\n color: map.get($components-button-text, $emphasis);\n opacity: 0.5;\n cursor: not-allowed;\n box-shadow: none;\n }\n\n & nv-icon > svg {\n color: map.get($components-button-icon, $emphasis);\n }\n}\n\nnv-iconbutton {\n &.root {\n @include root-styles();\n }\n\n @each $size in $button-sizes {\n &.size-#{$size} {\n @include size-styles($size);\n }\n }\n\n @each $emphasis in $button-emphasis {\n &.emphasis-#{$emphasis} {\n @include emphasis-styles($emphasis);\n }\n }\n\n &.loading {\n [slot=\"leading-icon\"] {\n display: none;\n }\n }\n\n &.shape-rounded {\n border-radius: var(--radius-rounded-full);\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n AttachInternals,\n Element,\n Watch,\n Listen,\n} from '@stencil/core';\nimport clsx from 'clsx';\n\nimport {\n ButtonSize,\n ButtonEmphasis,\n ButtonType,\n IconButtonShape,\n} from '../../utils/constants';\nimport { IconName } from '../nv-icon/nv-icons';\n\n/**\n * @slot default - Content of the button.\n */\n@Component({\n tag: 'nv-iconbutton',\n shadow: false,\n formAssociated: true,\n styleUrl: 'nv-iconbutton.scss',\n scoped: false,\n})\nexport class NvIconbutton {\n @AttachInternals() internals: ElementInternals;\n @Element() el: HTMLNvIconbuttonElement;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Determines how large or small the button appears, allowing for\n * customization of the button's dimensions to fit different design\n * specifications and user needs.\n */\n @Prop({ reflect: true })\n readonly size: `${ButtonSize}` = 'md';\n\n /**\n * Adjusts the button’s emphasis to make it more or less visually prominent\n * to users. Use this to draw attention to important actions or reduce focus\n * on less critical ones.\n */\n @Prop({ reflect: true })\n readonly emphasis: `${ButtonEmphasis}` = 'high';\n\n /**\n * Set this to true to show a spinner on the button, letting users know that\n * their action is being processed. It helps improve user experience by\n * indicating ongoing activities. The icon is not displayed when the button\n * is loading. Also, the button is disabled. If you want to disable the\n * button, it is not possible. It is automatically disabled when loading.\n */\n @Prop({ reflect: true, mutable: true })\n loading: boolean = false;\n\n /**\n * Disables the button, preventing user interaction.\n */\n @Prop({ mutable: true, reflect: true })\n disabled: boolean = false;\n\n /**\n * Makes the button look active when it’s within a compatible component\n * like a button group.\n */\n @Prop({ reflect: true })\n readonly active: boolean = false;\n\n /**\n * Choose the icon you want to display. This also sets the aria-label for\n * improved accessibility, helping users who rely on screen readers.\n * The icon is not displayed when the button is loading.\n */\n @Prop({ reflect: true })\n readonly name: `${IconName}` | string;\n\n /**\n * Sets the button type to control its function in forms. Use 'submit' to send\n * form data, 'reset' to clear the form, or 'button' for a standard button\n * that doesn’t interact with form submission by default.\n */\n @Prop({ reflect: true })\n readonly type: `${ButtonType}` = 'button';\n\n /**\n * Sets the shape of the button. Choose between square and rounded.\n */\n @Prop({ reflect: true })\n readonly shape: `${IconButtonShape}` = 'square';\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Handles form-related actions when the button is clicked.\n * - Submits the form if the button type is 'submit'.\n * - Resets the form if the button type is 'reset'.\n * @param {Event} event - The click event.\n */\n private handleClick = (event: Event) => {\n if (this.disabled) {\n event.preventDefault();\n return;\n }\n\n if (this.type === 'submit') {\n this.internals?.form?.requestSubmit();\n }\n if (this.type === 'reset') {\n this.internals?.form?.reset();\n }\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region WATCHERS\n\n @Watch('loading')\n handleLoadingChange(loading: boolean) {\n this.loading = loading;\n this.disabled = loading;\n }\n\n @Watch('disabled')\n handleDisabledChange(disabled: boolean) {\n if (this.loading) {\n this.disabled = this.loading;\n } else {\n this.disabled = disabled;\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region EVENTS\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.el.click();\n }\n }\n\n @Listen('touchstart', { passive: false })\n handleTouchStart(event: TouchEvent) {\n if (event.touches.length > 1) return;\n event.preventDefault();\n this.el.click();\n }\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillLoad() {\n if (this.loading) {\n this.disabled = this.loading;\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host\n role=\"button\"\n type={this.type}\n tabindex=\"0\"\n disabled={this.disabled ? true : undefined}\n class={clsx(\n 'root',\n `size-${this.size}`,\n `emphasis-${this.emphasis}`,\n this.loading && 'loading',\n `shape-${this.shape}`,\n )}\n onClick={this.handleClick}\n >\n {this.loading && <nv-loader size={this.size}></nv-loader>}\n\n {!this.loading && <nv-icon name={this.name} size={this.size} />}\n\n <slot></slot>\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"version":3}
1
+ {"file":"p-025b8a78.js","mappings":";;;;;AAAA,MAAM,eAAe,GAAG,sqJAAsqJ,CAAC;AAC/rJ,2BAAe,eAAe;;MC6BjB,YAAY;IAPzB;;;;;;;;;;;QAoBW,SAAI,GAAoB,IAAI,CAAC;;;;;;QAQ7B,aAAQ,GAAwB,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;QACrC,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;KACjB;;;;IAMD,iBAAiB;QACf,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC;SAC9B;KACF;;;;IAMD,MAAM;QACJ,QACE,EAAC,IAAI,qDACH,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,QAAQ,EAAC,GAAG,EACZ,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,SAAS,EAC1C,KAAK,EAAE,IAAI,CACT,MAAM,EACN,QAAQ,IAAI,CAAC,IAAI,EAAE,EACnB,YAAY,IAAI,CAAC,QAAQ,EAAE,EAC3B,IAAI,CAAC,OAAO,IAAI,SAAS,EACzB,SAAS,IAAI,CAAC,KAAK,EAAE,CACtB,EACD,OAAO,EAAE,IAAI,CAAC,WAAW,IAExB,IAAI,CAAC,OAAO,IAAI,kEAAW,IAAI,EAAE,IAAI,CAAC,IAAI,GAAc,EAExD,CAAC,IAAI,CAAC,OAAO,IAAI,gEAAS,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI,EAE/D,8DAAa,CACR,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/nv-iconbutton/nv-iconbutton.scss?tag=nv-iconbutton","src/components/nv-iconbutton/nv-iconbutton.tsx"],"sourcesContent":["@use \"sass:map\";\n@import \"../../styles/focus-ring\";\n\n/* Variants */\n$button-sizes: (\"xs\", \"sm\", \"md\", \"lg\");\n$button-emphasis: (\"high\", \"medium\", \"low\", \"lower\");\n\n/* Define maps for size-related variables */\n$button-icon-button-padding: (\n \"xs\": var(--button-xs-icon-button-padding),\n \"sm\": var(--button-sm-icon-button-padding),\n \"md\": var(--button-md-icon-button-padding),\n \"lg\": var(--button-lg-icon-button-padding)\n);\n\n$button-gap: (\n \"xs\": var(--button-xs-gap),\n \"sm\": var(--button-sm-gap),\n \"md\": var(--button-md-gap),\n \"lg\": var(--button-lg-gap)\n);\n\n$button-border-radius: (\n \"xs\": var(--button-xs-border-radius),\n \"sm\": var(--button-sm-border-radius),\n \"md\": var(--button-md-border-radius),\n \"lg\": var(--button-lg-border-radius)\n);\n\n$button-line-height: (\n \"xs\": var(--button-xs-line-height),\n \"sm\": var(--button-sm-line-height),\n \"md\": var(--button-md-line-height),\n \"lg\": var(--button-lg-line-height)\n);\n\n$button-font-size: (\n \"xs\": var(--button-xs-font-size),\n \"sm\": var(--button-sm-font-size),\n \"md\": var(--button-md-font-size),\n \"lg\": var(--button-lg-font-size)\n);\n\n/* Define maps for emphasis-related variables */\n$components-button-background: (\n \"high\": var(--components-button-high-background),\n \"medium\": var(--components-button-medium-background),\n \"low\": var(--components-button-low-background),\n \"lower\": var(--components-button-lower-background)\n);\n\n$components-button-border: (\n \"high\": var(--components-button-high-border),\n \"medium\": var(--components-button-medium-border),\n \"low\": var(--components-button-low-border),\n \"lower\": var(--components-button-lower-border)\n);\n\n$components-button-text: (\n \"high\": var(--components-button-high-text),\n \"medium\": var(--components-button-medium-text),\n \"low\": var(--components-button-low-text),\n \"lower\": var(--components-button-lower-text)\n);\n\n$components-button-background-hover: (\n \"high\": var(--components-button-high-background-hover),\n \"medium\": var(--components-button-medium-background-hover),\n \"low\": var(--components-button-low-background-hover),\n \"lower\": var(--components-button-lower-background-hover)\n);\n\n$components-button-text-hover: (\n \"high\": var(--components-button-high-text-hover),\n \"medium\": var(--components-button-medium-text-hover),\n \"low\": var(--components-button-low-text-hover),\n \"lower\": var(--components-button-lower-text-hover)\n);\n\n$components-button-icon: (\n \"high\": var(--components-button-high-icon),\n \"medium\": var(--components-button-medium-icon),\n \"low\": var(--components-button-low-icon),\n \"lower\": var(--components-button-lower-icon)\n);\n\n@mixin root-styles() {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n font-style: normal;\n font-weight: 500;\n font-family: \"TT Norms Pro\", sans-serif;\n transition: background-color 150ms ease-out;\n height: fit-content;\n width: fit-content;\n}\n\n@mixin size-styles($size) {\n padding: map.get($button-icon-button-padding, $size);\n gap: map.get($button-gap, $size);\n border-radius: map.get($button-border-radius, $size);\n line-height: map.get($button-line-height, $size);\n font-size: map.get($button-font-size, $size);\n}\n\n@mixin emphasis-styles($emphasis) {\n background: map.get($components-button-background, $emphasis);\n border: 1px solid map.get($components-button-border, $emphasis);\n color: map.get($components-button-text, $emphasis);\n\n &:hover {\n background: map.get($components-button-background-hover, $emphasis);\n color: map.get($components-button-text-hover, $emphasis);\n }\n\n @include focus-ring();\n\n &:disabled {\n background: map.get($components-button-background, $emphasis);\n color: map.get($components-button-text, $emphasis);\n opacity: 0.5;\n cursor: not-allowed;\n box-shadow: none;\n }\n\n & nv-icon > svg {\n color: map.get($components-button-icon, $emphasis);\n }\n}\n\nnv-iconbutton {\n &.root {\n @include root-styles();\n }\n\n @each $size in $button-sizes {\n &.size-#{$size} {\n @include size-styles($size);\n }\n }\n\n @each $emphasis in $button-emphasis {\n &.emphasis-#{$emphasis} {\n @include emphasis-styles($emphasis);\n }\n }\n\n &.loading {\n [slot=\"leading-icon\"] {\n display: none;\n }\n }\n\n &.shape-rounded {\n border-radius: var(--radius-rounded-full);\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n AttachInternals,\n Element,\n Watch,\n Listen,\n} from '@stencil/core';\nimport clsx from 'clsx';\n\nimport {\n ButtonSize,\n ButtonEmphasis,\n ButtonType,\n IconButtonShape,\n} from '../../utils/constants';\nimport { IconName } from '../nv-icon/nv-icons';\n\n/**\n * @slot default - Content of the button.\n */\n@Component({\n tag: 'nv-iconbutton',\n shadow: false,\n formAssociated: true,\n styleUrl: 'nv-iconbutton.scss',\n scoped: false,\n})\nexport class NvIconbutton {\n @AttachInternals() internals: ElementInternals;\n @Element() el: HTMLNvIconbuttonElement;\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Determines how large or small the button appears, allowing for\n * customization of the button's dimensions to fit different design\n * specifications and user needs.\n */\n @Prop({ reflect: true })\n readonly size: `${ButtonSize}` = 'md';\n\n /**\n * Adjusts the button’s emphasis to make it more or less visually prominent\n * to users. Use this to draw attention to important actions or reduce focus\n * on less critical ones.\n */\n @Prop({ reflect: true })\n readonly emphasis: `${ButtonEmphasis}` = 'high';\n\n /**\n * Set this to true to show a spinner on the button, letting users know that\n * their action is being processed. It helps improve user experience by\n * indicating ongoing activities. The icon is not displayed when the button\n * is loading. Also, the button is disabled. If you want to disable the\n * button, it is not possible. It is automatically disabled when loading.\n */\n @Prop({ reflect: true, mutable: true })\n loading: boolean = false;\n\n /**\n * Disables the button, preventing user interaction.\n */\n @Prop({ mutable: true, reflect: true })\n disabled: boolean = false;\n\n /**\n * Makes the button look active when it’s within a compatible component\n * like a button group.\n */\n @Prop({ reflect: true })\n readonly active: boolean = false;\n\n /**\n * Choose the icon you want to display. This also sets the aria-label for\n * improved accessibility, helping users who rely on screen readers.\n * The icon is not displayed when the button is loading.\n */\n @Prop({ reflect: true })\n readonly name: `${IconName}` | string;\n\n /**\n * Sets the button type to control its function in forms. Use 'submit' to send\n * form data, 'reset' to clear the form, or 'button' for a standard button\n * that doesn’t interact with form submission by default.\n */\n @Prop({ reflect: true })\n readonly type: `${ButtonType}` = 'button';\n\n /**\n * Sets the shape of the button. Choose between square and rounded.\n */\n @Prop({ reflect: true })\n readonly shape: `${IconButtonShape}` = 'square';\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Handles form-related actions when the button is clicked.\n * - Submits the form if the button type is 'submit'.\n * - Resets the form if the button type is 'reset'.\n * @param {Event} event - The click event.\n */\n private handleClick = (event: Event) => {\n if (this.disabled) {\n event.preventDefault();\n return;\n }\n\n if (this.type === 'submit') {\n this.internals?.form?.requestSubmit();\n }\n if (this.type === 'reset') {\n this.internals?.form?.reset();\n }\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region WATCHERS\n\n @Watch('loading')\n handleLoadingChange(loading: boolean) {\n this.loading = loading;\n this.disabled = loading;\n }\n\n @Watch('disabled')\n handleDisabledChange(disabled: boolean) {\n if (this.loading) {\n this.disabled = this.loading;\n } else {\n this.disabled = disabled;\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region EVENTS\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.el.click();\n }\n }\n\n @Listen('touchstart', { passive: false })\n handleTouchStart(event: TouchEvent) {\n if (event.touches.length > 1) return;\n event.preventDefault();\n this.el.click();\n }\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillLoad() {\n if (this.loading) {\n this.disabled = this.loading;\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host\n role=\"button\"\n type={this.type}\n tabindex=\"0\"\n disabled={this.disabled ? true : undefined}\n class={clsx(\n 'root',\n `size-${this.size}`,\n `emphasis-${this.emphasis}`,\n this.loading && 'loading',\n `shape-${this.shape}`,\n )}\n onClick={this.handleClick}\n >\n {this.loading && <nv-loader size={this.size}></nv-loader>}\n\n {!this.loading && <nv-icon name={this.name} size={this.size} />}\n\n <slot></slot>\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"version":3}
@@ -1,5 +1,5 @@
1
1
  import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-aff3ed68.js';
2
- import { d as defineCustomElement$1 } from './p-9232d306.js';
2
+ import { d as defineCustomElement$1 } from './p-6460318d.js';
3
3
 
4
4
  const nvMenuitemCss = "nv-menuitem{display:flex;align-items:center;max-width:300px;width:100vw;font-size:var(--menu-contextual-item-font-size);font-weight:var(--menu-contextual-item-font-weight);color:var(--components-menu-contextual-item-content);border-radius:var(--menu-contextual-item-radius);gap:var(--menu-contextual-item-gap-x);padding:var(--menu-contextual-item-padding-y) var(--menu-contextual-item-padding-x);transition:background-color 150ms ease-out;cursor:pointer}nv-menuitem:hover,nv-menuitem:focus,nv-menuitem:focus-within{background-color:var(--components-menu-contextual-item-background-hover);color:var(--components-menu-contextual-item-content-hover)}nv-menuitem *{pointer-events:none}nv-menuitem kbd{color:var(--components-menu-contextual-item-shortcut)}nv-menuitem [data-scope=text]{margin-right:auto}nv-menuitem[disabled]:not([disabled=false]){cursor:unset;background-color:unset;color:var(--components-menu-contextual-item-content-disabled)}";
5
5
  const NvMenuitemStyle0 = nvMenuitemCss;
@@ -82,4 +82,4 @@ defineCustomElement();
82
82
 
83
83
  export { NvMenuitem as N, defineCustomElement as d };
84
84
 
85
- //# sourceMappingURL=p-865725bf.js.map
85
+ //# sourceMappingURL=p-30f970c3.js.map
@@ -1 +1 @@
1
- {"file":"p-865725bf.js","mappings":";;;AAAA,MAAM,aAAa,GAAG,+6BAA+6B,CAAC;AACt8B,yBAAe,aAAa;;MCoBf,UAAU;IALvB;;;;;;;QA6BW,aAAQ,GAAY,KAAK,CAAC;;;;QAY1B,eAAU,GAAY,KAAK,CAAC;KAuFtC;IArDS,oBAAoB,CAAC,KAAY;;QAEvC,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,KAAK,CAAC,eAAe,EAAE,CAAC;YACxB,OAAO;SACR;QAED,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;YACzB,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE;YACd,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC,CAAC;KACJ;IAGD,WAAW,CAAC,KAAiB;QAC3B,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;KAClC;IAGD,aAAa,CAAC,KAAoB;QAChC,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,EAAE;YAC9C,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAsC,CAAC;YACtE,IACE,aAAa;gBACb,aAAa,CAAC,OAAO,KAAK,aAAa;gBACvC,CAAC,aAAa,CAAC,YAAY,CAAC,aAAa,CAAC,EAC1C;gBACA,KAAK,CAAC,cAAc,EAAE,CAAC;gBACvB,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;aACjB;SACF;KACF;;;;IAMD,MAAM;QACJ,QACE,EAAC,IAAI,qDAAC,IAAI,EAAC,UAAU,EAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,GAAG,IACvD,IAAI,CAAC,IAAI,IAAI,gEAAS,IAAI,EAAE,IAAI,CAAC,IAAI,GAAY,EAElD,8DAAa,EAEZ,IAAI,CAAC,KAAK,IAAI,2EAAiB,MAAM,IAAE,IAAI,CAAC,KAAK,CAAQ,EACzD,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,8DAAM,IAAI,CAAC,QAAQ,CAAO,EAC/D,IAAI,CAAC,UAAU,IAAI,gEAAS,IAAI,EAAC,eAAe,GAAW,CACvD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/nv-menuitem/nv-menuitem.scss?tag=nv-menuitem","src/components/nv-menuitem/nv-menuitem.tsx"],"sourcesContent":["@mixin root-styles() {\n display: flex;\n align-items: center;\n max-width: 300px;\n width: 100vw;\n font-size: var(--menu-contextual-item-font-size);\n font-weight: var(--menu-contextual-item-font-weight);\n color: var(--components-menu-contextual-item-content);\n border-radius: var(--menu-contextual-item-radius);\n gap: var(--menu-contextual-item-gap-x);\n padding: var(--menu-contextual-item-padding-y) var(--menu-contextual-item-padding-x);\n transition: background-color 150ms ease-out;\n cursor: pointer;\n &:hover, &:focus, &:focus-within {\n @include focused-styles();\n }\n * {\n pointer-events: none;\n }\n}\n\n@mixin focused-styles() {\n background-color: var(--components-menu-contextual-item-background-hover);\n color: var(--components-menu-contextual-item-content-hover);\n}\n\n@mixin disabled-styles() {\n cursor: unset;\n background-color: unset;\n color: var(--components-menu-contextual-item-content-disabled);\n}\n\n@mixin text-styles() {\n margin-right: auto;\n}\n\n@mixin shortcut-styles() {\n color: var(--components-menu-contextual-item-shortcut);\n}\n\nnv-menuitem {\n @include root-styles();\n\n kbd {\n @include shortcut-styles();\n }\n\n [data-scope=\"text\"] {\n @include text-styles();\n }\n\n &[disabled]:not([disabled=\"false\"]) {\n @include disabled-styles();\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n Listen,\n} from '@stencil/core';\n\nimport { IconName } from '../nv-icon/nv-icons';\n\n/**\n * @slot default - Use this slot to render custom content for the menu item.\n */\n@Component({\n tag: 'nv-menuitem',\n styleUrl: 'nv-menuitem.scss',\n shadow: false,\n})\nexport class NvMenuitem {\n @Element() el: HTMLNvMenuitemElement;\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Text content for the menu item. If a more custom approach is needed, use\n * the default slot instead.\n */\n @Prop({ reflect: true })\n readonly label: string;\n\n /**\n * Choose the icon you want to display. This also sets the aria-label for\n * improved accessibility, helping users who rely on screen readers.\n * The icon is not displayed when the button is loading.\n */\n @Prop({ reflect: true })\n readonly icon: `${IconName}`;\n\n /**\n * Disables the item, preventing user interaction.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Show a shortcut key for the action represented in the menu item.\n */\n @Prop({ reflect: true })\n readonly shortcut: string;\n\n /**\n * If the menu item has a submenu, the a caret icon will be displayed.\n */\n @Prop({ reflect: true })\n readonly hasSubmenu: boolean = false;\n\n /**\n * Represents the identifier or name associated with the menu item. This value\n * will be emitted as part of the event data when the menu item is selected,\n * enabling event handlers to identify the chosen item.\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Fires when the menu item is selected (click or keypress). Will include the\n * id and name of the menu item.\n */\n @Event()\n menuitemSelected: EventEmitter<{\n /**\n * The id of the menu item that was selected.\n */\n id?: HTMLElement['id'];\n /**\n * The name of the menu item that was selected.\n */\n name?: string;\n /**\n * Indicates if the menu item has a nested submenu.\n */\n hasSubmenu?: boolean;\n }>;\n\n private handleMenuItemSelect(event: Event) {\n // If the element is disabled, stop propagation\n if (this.disabled) {\n event.stopPropagation();\n return;\n }\n\n this.menuitemSelected.emit({\n id: this.el.id,\n name: this.name,\n hasSubmenu: this.hasSubmenu,\n });\n }\n\n @Listen('click', { capture: true })\n handleClick(event: MouseEvent) {\n this.handleMenuItemSelect(event);\n }\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n const activeElement = document.activeElement as HTMLNvMenuitemElement;\n if (\n activeElement &&\n activeElement.tagName === 'NV-MENUITEM' &&\n !activeElement.hasAttribute('has-submenu')\n ) {\n event.preventDefault();\n this.el.click();\n }\n }\n }\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host role=\"menuitem\" tabindex={this.disabled ? '-1' : '0'}>\n {this.icon && <nv-icon name={this.icon}></nv-icon>}\n\n <slot></slot>\n\n {this.label && <span data-scope=\"text\">{this.label}</span>}\n {this.shortcut && !this.hasSubmenu && <kbd>{this.shortcut}</kbd>}\n {this.hasSubmenu && <nv-icon name=\"chevron-right\"></nv-icon>}\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"version":3}
1
+ {"file":"p-30f970c3.js","mappings":";;;AAAA,MAAM,aAAa,GAAG,+6BAA+6B,CAAC;AACt8B,yBAAe,aAAa;;MCoBf,UAAU;IALvB;;;;;;;QA6BW,aAAQ,GAAY,KAAK,CAAC;;;;QAY1B,eAAU,GAAY,KAAK,CAAC;KAuFtC;IArDS,oBAAoB,CAAC,KAAY;;QAEvC,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,KAAK,CAAC,eAAe,EAAE,C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v-menuitem.tsx"],"sourcesContent":["@mixin root-styles() {\n display: flex;\n align-items: center;\n max-width: 300px;\n width: 100vw;\n font-size: var(--menu-contextual-item-font-size);\n font-weight: var(--menu-contextual-item-font-weight);\n color: var(--components-menu-contextual-item-content);\n border-radius: var(--menu-contextual-item-radius);\n gap: var(--menu-contextual-item-gap-x);\n padding: var(--menu-contextual-item-padding-y) var(--menu-contextual-item-padding-x);\n transition: background-color 150ms ease-out;\n cursor: pointer;\n &:hover, &:focus, &:focus-within {\n @include focused-styles();\n }\n * {\n pointer-events: none;\n }\n}\n\n@mixin focused-styles() {\n background-color: var(--components-menu-contextual-item-background-hover);\n color: var(--components-menu-contextual-item-content-hover);\n}\n\n@mixin disabled-styles() {\n cursor: unset;\n background-color: unset;\n color: var(--components-menu-contextual-item-content-disabled);\n}\n\n@mixin text-styles() {\n margin-right: auto;\n}\n\n@mixin shortcut-styles() {\n color: var(--components-menu-contextual-item-shortcut);\n}\n\nnv-menuitem {\n @include root-styles();\n\n kbd {\n @include shortcut-styles();\n }\n\n [data-scope=\"text\"] {\n @include text-styles();\n }\n\n &[disabled]:not([disabled=\"false\"]) {\n @include disabled-styles();\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n Listen,\n} from '@stencil/core';\n\nimport { IconName } from '../nv-icon/nv-icons';\n\n/**\n * @slot default - Use this slot to render custom content for the menu item.\n */\n@Component({\n tag: 'nv-menuitem',\n styleUrl: 'nv-menuitem.scss',\n shadow: false,\n})\nexport class NvMenuitem {\n @Element() el: HTMLNvMenuitemElement;\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Text content for the menu item. If a more custom approach is needed, use\n * the default slot instead.\n */\n @Prop({ reflect: true })\n readonly label: string;\n\n /**\n * Choose the icon you want to display. This also sets the aria-label for\n * improved accessibility, helping users who rely on screen readers.\n * The icon is not displayed when the button is loading.\n */\n @Prop({ reflect: true })\n readonly icon: `${IconName}`;\n\n /**\n * Disables the item, preventing user interaction.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Show a shortcut key for the action represented in the menu item.\n */\n @Prop({ reflect: true })\n readonly shortcut: string;\n\n /**\n * If the menu item has a submenu, the a caret icon will be displayed.\n */\n @Prop({ reflect: true })\n readonly hasSubmenu: boolean = false;\n\n /**\n * Represents the identifier or name associated with the menu item. This value\n * will be emitted as part of the event data when the menu item is selected,\n * enabling event handlers to identify the chosen item.\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Fires when the menu item is selected (click or keypress). Will include the\n * id and name of the menu item.\n */\n @Event()\n menuitemSelected: EventEmitter<{\n /**\n * The id of the menu item that was selected.\n */\n id?: HTMLElement['id'];\n /**\n * The name of the menu item that was selected.\n */\n name?: string;\n /**\n * Indicates if the menu item has a nested submenu.\n */\n hasSubmenu?: boolean;\n }>;\n\n private handleMenuItemSelect(event: Event) {\n // If the element is disabled, stop propagation\n if (this.disabled) {\n event.stopPropagation();\n return;\n }\n\n this.menuitemSelected.emit({\n id: this.el.id,\n name: this.name,\n hasSubmenu: this.hasSubmenu,\n });\n }\n\n @Listen('click', { capture: true })\n handleClick(event: MouseEvent) {\n this.handleMenuItemSelect(event);\n }\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n const activeElement = document.activeElement as HTMLNvMenuitemElement;\n if (\n activeElement &&\n activeElement.tagName === 'NV-MENUITEM' &&\n !activeElement.hasAttribute('has-submenu')\n ) {\n event.preventDefault();\n this.el.click();\n }\n }\n }\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host role=\"menuitem\" tabindex={this.disabled ? '-1' : '0'}>\n {this.icon && <nv-icon name={this.icon}></nv-icon>}\n\n <slot></slot>\n\n {this.label && <span data-scope=\"text\">{this.label}</span>}\n {this.shortcut && !this.hasSubmenu && <kbd>{this.shortcut}</kbd>}\n {this.hasSubmenu && <nv-icon name=\"chevron-right\"></nv-icon>}\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"],"version":3}
@@ -4,7 +4,7 @@ import { u as useCollapse } from './p-9a263d0e.js';
4
4
  import { u as useFade } from './p-1cbacdba.js';
5
5
  import './p-09cdd71f.js';
6
6
  import { t as timeline } from './p-15aeab4d.js';
7
- import { d as defineCustomElement$1 } from './p-9232d306.js';
7
+ import { d as defineCustomElement$1 } from './p-6460318d.js';
8
8
 
9
9
  const nvBadgeCss = "nv-badge{padding:var(--badge-padding-y) var(--badge-padding-x);display:inline-flex !important;gap:var(--badge-gap-x);vertical-align:middle;align-items:center;border-radius:var(--radius-rounded-full);border-style:solid;border-width:0.5px;height:fit-content;width:fit-content}nv-badge.is-icon-only{padding:var(--badge-padding-y) var(--badge-padding-icon-only-x);gap:var(--badge-gap-icon-only-x)}nv-badge.with-gap{padding:var(--badge-padding-y) var(--badge-padding-x);display:inline-flex !important;gap:var(--badge-gap-x);vertical-align:middle;align-items:center;border-radius:var(--radius-rounded-full);border-style:solid;border-width:0.5px;height:fit-content;width:fit-content}nv-badge.with-gap.is-icon-only{padding:var(--badge-padding-y) var(--badge-padding-icon-only-x);gap:var(--badge-gap-icon-only-x)}nv-badge.visually-hidden{position:absolute;padding:0;border:0;overflow:hidden;white-space:nowrap;width:1px;height:1px;margin:-1px;clip:rect(0, 0, 0, 0)}nv-badge:not(.with-gap){padding:var(--badge-padding-y) var(--badge-padding-x);display:inline-flex !important;gap:var(--badge-gap-x);vertical-align:middle;align-items:center;border-radius:var(--radius-rounded-full);border-style:solid;border-width:0.5px;height:fit-content;width:fit-content}nv-badge:not(.with-gap).is-icon-only{padding:var(--badge-padding-y) var(--badge-padding-icon-only-x);gap:var(--badge-gap-icon-only-x)}nv-badge.badge-1{color:var(--color-rainbow-1-text);background-color:var(--color-rainbow-1-background);border-color:var(--color-rainbow-1-border)}nv-badge.badge-1 .close:focus,nv-badge.badge-1 .close:focus-within{outline:none}nv-badge.badge-1 .close:focus-visible,nv-badge.badge-1 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-1-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-1 nv-icon{color:var(--color-rainbow-1-icon)}nv-badge.badge-2{color:var(--color-rainbow-2-text);background-color:var(--color-rainbow-2-background);border-color:var(--color-rainbow-2-border)}nv-badge.badge-2 .close:focus,nv-badge.badge-2 .close:focus-within{outline:none}nv-badge.badge-2 .close:focus-visible,nv-badge.badge-2 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-2-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-2 nv-icon{color:var(--color-rainbow-2-icon)}nv-badge.badge-3{color:var(--color-rainbow-3-text);background-color:var(--color-rainbow-3-background);border-color:var(--color-rainbow-3-border)}nv-badge.badge-3 .close:focus,nv-badge.badge-3 .close:focus-within{outline:none}nv-badge.badge-3 .close:focus-visible,nv-badge.badge-3 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-3-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-3 nv-icon{color:var(--color-rainbow-3-icon)}nv-badge.badge-4{color:var(--color-rainbow-4-text);background-color:var(--color-rainbow-4-background);border-color:var(--color-rainbow-4-border)}nv-badge.badge-4 .close:focus,nv-badge.badge-4 .close:focus-within{outline:none}nv-badge.badge-4 .close:focus-visible,nv-badge.badge-4 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-4-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-4 nv-icon{color:var(--color-rainbow-4-icon)}nv-badge.badge-5{color:var(--color-rainbow-5-text);background-color:var(--color-rainbow-5-background);border-color:var(--color-rainbow-5-border)}nv-badge.badge-5 .close:focus,nv-badge.badge-5 .close:focus-within{outline:none}nv-badge.badge-5 .close:focus-visible,nv-badge.badge-5 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-5-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-5 nv-icon{color:var(--color-rainbow-5-icon)}nv-badge.badge-6{color:var(--color-rainbow-6-text);background-color:var(--color-rainbow-6-background);border-color:var(--color-rainbow-6-border)}nv-badge.badge-6 .close:focus,nv-badge.badge-6 .close:focus-within{outline:none}nv-badge.badge-6 .close:focus-visible,nv-badge.badge-6 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-6-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-6 nv-icon{color:var(--color-rainbow-6-icon)}nv-badge.badge-7{color:var(--color-rainbow-7-text);background-color:var(--color-rainbow-7-background);border-color:var(--color-rainbow-7-border)}nv-badge.badge-7 .close:focus,nv-badge.badge-7 .close:focus-within{outline:none}nv-badge.badge-7 .close:focus-visible,nv-badge.badge-7 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-7-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-7 nv-icon{color:var(--color-rainbow-7-icon)}nv-badge.badge-8{color:var(--color-rainbow-8-text);background-color:var(--color-rainbow-8-background);border-color:var(--color-rainbow-8-border)}nv-badge.badge-8 .close:focus,nv-badge.badge-8 .close:focus-within{outline:none}nv-badge.badge-8 .close:focus-visible,nv-badge.badge-8 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-8-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-8 nv-icon{color:var(--color-rainbow-8-icon)}nv-badge.badge-9{color:var(--color-rainbow-9-text);background-color:var(--color-rainbow-9-background);border-color:var(--color-rainbow-9-border)}nv-badge.badge-9 .close:focus,nv-badge.badge-9 .close:focus-within{outline:none}nv-badge.badge-9 .close:focus-visible,nv-badge.badge-9 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-9-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-9 nv-icon{color:var(--color-rainbow-9-icon)}nv-badge.badge-10{color:var(--color-rainbow-10-text);background-color:var(--color-rainbow-10-background);border-color:var(--color-rainbow-10-border)}nv-badge.badge-10 .close:focus,nv-badge.badge-10 .close:focus-within{outline:none}nv-badge.badge-10 .close:focus-visible,nv-badge.badge-10 .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-rainbow-10-content);outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-10 nv-icon{color:var(--color-rainbow-10-icon)}nv-badge.badge-error{color:var(--color-feedback-error-low-text);background-color:var(--color-feedback-error-low-background);border-color:var(--color-feedback-error-low-border)}nv-badge.badge-error .close:focus,nv-badge.badge-error .close:focus-within{outline:none}nv-badge.badge-error .close:focus-visible,nv-badge.badge-error .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-feedback-error-low-content, var(--color-feedback-error-low-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-error nv-icon{color:var(--color-feedback-error-low-icon)}nv-badge.badge-information{color:var(--color-feedback-information-low-text);background-color:var(--color-feedback-information-low-background);border-color:var(--color-feedback-information-low-border)}nv-badge.badge-information .close:focus,nv-badge.badge-information .close:focus-within{outline:none}nv-badge.badge-information .close:focus-visible,nv-badge.badge-information .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-feedback-information-low-content, var(--color-feedback-information-low-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-information nv-icon{color:var(--color-feedback-information-low-icon)}nv-badge.badge-neutral{color:var(--color-feedback-neutral-low-text);background-color:var(--color-feedback-neutral-low-background);border-color:var(--color-feedback-neutral-low-border)}nv-badge.badge-neutral .close:focus,nv-badge.badge-neutral .close:focus-within{outline:none}nv-badge.badge-neutral .close:focus-visible,nv-badge.badge-neutral .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-feedback-neutral-low-content, var(--color-feedback-neutral-low-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-neutral nv-icon{color:var(--color-feedback-neutral-low-icon)}nv-badge.badge-success{color:var(--color-feedback-success-low-text);background-color:var(--color-feedback-success-low-background);border-color:var(--color-feedback-success-low-border)}nv-badge.badge-success .close:focus,nv-badge.badge-success .close:focus-within{outline:none}nv-badge.badge-success .close:focus-visible,nv-badge.badge-success .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-feedback-success-low-content, var(--color-feedback-success-low-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-success nv-icon{color:var(--color-feedback-success-low-icon)}nv-badge.badge-warning{color:var(--color-feedback-warning-low-text);background-color:var(--color-feedback-warning-low-background);border-color:var(--color-feedback-warning-low-border)}nv-badge.badge-warning .close:focus,nv-badge.badge-warning .close:focus-within{outline:none}nv-badge.badge-warning .close:focus-visible,nv-badge.badge-warning .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-feedback-warning-low-content, var(--color-feedback-warning-low-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-warning nv-icon{color:var(--color-feedback-warning-low-icon)}nv-badge.badge-amber{color:var(--color-rainbow-1-text);background-color:var(--color-rainbow-1-background);border-color:var(--color-rainbow-1-border)}nv-badge.badge-amber .close:focus,nv-badge.badge-amber .close:focus-within{outline:none}nv-badge.badge-amber .close:focus-visible,nv-badge.badge-amber .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-amber-content, var(--color-rainbow-1-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-amber nv-icon{color:var(--color-rainbow-1-icon)}nv-badge.badge-orange{color:var(--color-rainbow-2-text);background-color:var(--color-rainbow-2-background);border-color:var(--color-rainbow-2-border)}nv-badge.badge-orange .close:focus,nv-badge.badge-orange .close:focus-within{outline:none}nv-badge.badge-orange .close:focus-visible,nv-badge.badge-orange .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-orange-content, var(--color-rainbow-2-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-orange nv-icon{color:var(--color-rainbow-2-icon)}nv-badge.badge-turquoise{color:var(--color-rainbow-5-text);background-color:var(--color-rainbow-5-background);border-color:var(--color-rainbow-5-border)}nv-badge.badge-turquoise .close:focus,nv-badge.badge-turquoise .close:focus-within{outline:none}nv-badge.badge-turquoise .close:focus-visible,nv-badge.badge-turquoise .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-turquoise-content, var(--color-rainbow-5-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-turquoise nv-icon{color:var(--color-rainbow-5-icon)}nv-badge.badge-crimson{color:var(--color-rainbow-6-text);background-color:var(--color-rainbow-6-background);border-color:var(--color-rainbow-6-border)}nv-badge.badge-crimson .close:focus,nv-badge.badge-crimson .close:focus-within{outline:none}nv-badge.badge-crimson .close:focus-visible,nv-badge.badge-crimson .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-crimson-content, var(--color-rainbow-6-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-crimson nv-icon{color:var(--color-rainbow-6-icon)}nv-badge.badge-lime{color:var(--color-rainbow-9-text);background-color:var(--color-rainbow-9-background);border-color:var(--color-rainbow-9-border)}nv-badge.badge-lime .close:focus,nv-badge.badge-lime .close:focus-within{outline:none}nv-badge.badge-lime .close:focus-visible,nv-badge.badge-lime .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-lime-content, var(--color-rainbow-9-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-lime nv-icon{color:var(--color-rainbow-9-icon)}nv-badge.badge-petrol{color:var(--color-rainbow-8-text);background-color:var(--color-rainbow-8-background);border-color:var(--color-rainbow-8-border)}nv-badge.badge-petrol .close:focus,nv-badge.badge-petrol .close:focus-within{outline:none}nv-badge.badge-petrol .close:focus-visible,nv-badge.badge-petrol .close:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-petrol-content, var(--color-rainbow-8-text));outline-offset:calc(var(--focus-outline-offset) * 0.2)}nv-badge.badge-petrol nv-icon{color:var(--color-rainbow-8-icon)}nv-badge span{font-size:var(--font-size-xs);line-height:var(--line-height-xs) !important;text-align:center}nv-badge nv-icon>svg.icon-xs{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-badge nv-icon>svg.icon-sm{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-badge nv-icon>svg.icon-md{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-badge nv-icon>svg.icon-lg{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-badge nv-icon>svg.icon-xl{width:var(--spacing-3);height:var(--spacing-3);stroke-width:1.2px}nv-badge .close{padding:0;line-height:0;border:none;background:none;cursor:pointer;color:inherit;display:inline-flex;align-items:center;aspect-ratio:1/1;border-radius:var(--radius-rounded-full)}";
10
10
  const NvBadgeStyle0 = nvBadgeCss;
@@ -186,4 +186,4 @@ defineCustomElement();
186
186
 
187
187
  export { NvBadge as N, defineCustomElement as d };
188
188
 
189
- //# sourceMappingURL=p-f0371d98.js.map
189
+ //# sourceMappingURL=p-60064345.js.map