@rededor/cura 1.6.1-alpha.8 → 1.7.0

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 (206) hide show
  1. package/dist/assets/assets/icons/iconset-default-list.ts +1 -1
  2. package/dist/assets/assets/icons/iconset-default-tmp.svg +4 -0
  3. package/dist/assets/assets/icons/iconset-default.svg +1 -1
  4. package/dist/cjs/{app-globals-28c6f5c4.js → app-globals-6d5b51b6.js} +2 -2
  5. package/dist/cjs/{app-globals-28c6f5c4.js.map → app-globals-6d5b51b6.js.map} +1 -1
  6. package/dist/cjs/{cura-accordion_18.cjs.entry.js → cura-accordion_20.cjs.entry.js} +148 -8
  7. package/dist/cjs/cura-accordion_20.cjs.entry.js.map +1 -0
  8. package/dist/cjs/cura-checkbox.cjs.entry.js +4 -3
  9. package/dist/cjs/cura-checkbox.cjs.entry.js.map +1 -1
  10. package/dist/cjs/cura-display.cjs.entry.js +1 -1
  11. package/dist/cjs/cura-icons-view.cjs.entry.js +1 -1
  12. package/dist/cjs/cura-icons-view.cjs.entry.js.map +1 -1
  13. package/dist/cjs/cura-modal.cjs.entry.js +3 -3
  14. package/dist/cjs/cura-modal.cjs.entry.js.map +1 -1
  15. package/dist/cjs/cura-radio.cjs.entry.js +4 -3
  16. package/dist/cjs/cura-radio.cjs.entry.js.map +1 -1
  17. package/dist/cjs/cura-switch.cjs.entry.js +4 -4
  18. package/dist/cjs/cura-switch.cjs.entry.js.map +1 -1
  19. package/dist/cjs/cura-tabs-button.cjs.entry.js +106 -0
  20. package/dist/cjs/cura-tabs-button.cjs.entry.js.map +1 -0
  21. package/dist/cjs/cura-tabs-transparent.cjs.entry.js +105 -0
  22. package/dist/cjs/cura-tabs-transparent.cjs.entry.js.map +1 -0
  23. package/dist/cjs/cura-tabs.definitions-b8955ad4.js +12 -0
  24. package/dist/cjs/cura-tabs.definitions-b8955ad4.js.map +1 -0
  25. package/dist/cjs/{cura-theme-module-f1e4a309.js → cura-theme-module-09bb63a4.js} +32 -1
  26. package/dist/cjs/cura-theme-module-09bb63a4.js.map +1 -0
  27. package/dist/cjs/cura.cjs.js +3 -3
  28. package/dist/cjs/index.cjs.js +1 -1
  29. package/dist/cjs/loader.cjs.js +3 -3
  30. package/dist/collection/api/theme-presets/theme-perinatal-temporary.js +32 -0
  31. package/dist/collection/api/theme-presets/theme-perinatal-temporary.js.map +1 -0
  32. package/dist/collection/api/theme-presets/theme-presets.js +2 -0
  33. package/dist/collection/api/theme-presets/theme-presets.js.map +1 -1
  34. package/dist/collection/assets/icons/iconset-default-list.js +1 -1
  35. package/dist/collection/assets/icons/iconset-default-list.js.map +1 -1
  36. package/dist/collection/assets/icons/iconset-default-tmp.svg +4 -0
  37. package/dist/collection/assets/icons/iconset-default.svg +1 -1
  38. package/dist/collection/assets-raw/icons/default/vaccine.svg +3 -0
  39. package/dist/collection/collection-manifest.json +4 -0
  40. package/dist/collection/components/cura-avatar/cura-avatar.js +34 -16
  41. package/dist/collection/components/cura-avatar/cura-avatar.js.map +1 -1
  42. package/dist/collection/components/cura-modal/cura-modal.css +1 -1
  43. package/dist/collection/components/cura-modal/cura-modal.js +2 -2
  44. package/dist/collection/components/cura-modal/cura-modal.js.map +1 -1
  45. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.css +5 -7
  46. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +31 -6
  47. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js.map +1 -1
  48. package/dist/collection/components/forms/cura-radio/cura-radio.css +8 -11
  49. package/dist/collection/components/forms/cura-radio/cura-radio.js +31 -6
  50. package/dist/collection/components/forms/cura-radio/cura-radio.js.map +1 -1
  51. package/dist/collection/components/forms/cura-select/cura-select.css +1 -1
  52. package/dist/collection/components/forms/cura-select/cura-select.js +22 -3
  53. package/dist/collection/components/forms/cura-select/cura-select.js.map +1 -1
  54. package/dist/collection/components/forms/cura-select/cura-select.stories.js +12 -0
  55. package/dist/collection/components/forms/cura-select/cura-select.stories.js.map +1 -1
  56. package/dist/collection/components/forms/cura-switch/cura-switch.css +1 -4
  57. package/dist/collection/components/forms/cura-switch/cura-switch.js +31 -7
  58. package/dist/collection/components/forms/cura-switch/cura-switch.js.map +1 -1
  59. package/dist/collection/components/tabs/cura-tabs/cura-tabs.css +170 -0
  60. package/dist/collection/components/tabs/cura-tabs/cura-tabs.js +263 -0
  61. package/dist/collection/components/tabs/cura-tabs/cura-tabs.js.map +1 -0
  62. package/dist/collection/components/tabs/cura-tabs/cura-tabs.stories.js +89 -0
  63. package/dist/collection/components/tabs/cura-tabs/cura-tabs.stories.js.map +1 -0
  64. package/dist/collection/components/tabs/cura-tabs-button/cura-tabs-button.css +176 -0
  65. package/dist/collection/components/tabs/cura-tabs-button/cura-tabs-button.js +259 -0
  66. package/dist/collection/components/tabs/cura-tabs-button/cura-tabs-button.js.map +1 -0
  67. package/dist/collection/components/tabs/cura-tabs-button/cura-tabs-button.stories.js +96 -0
  68. package/dist/collection/components/tabs/cura-tabs-button/cura-tabs-button.stories.js.map +1 -0
  69. package/dist/collection/components/tabs/cura-tabs-group/cura-tabs-group.css +25 -0
  70. package/dist/collection/components/tabs/cura-tabs-group/cura-tabs-group.js +133 -0
  71. package/dist/collection/components/tabs/cura-tabs-group/cura-tabs-group.js.map +1 -0
  72. package/dist/collection/components/tabs/cura-tabs-group/cura-tabs-group.stories.js +65 -0
  73. package/dist/collection/components/tabs/cura-tabs-group/cura-tabs-group.stories.js.map +1 -0
  74. package/dist/collection/components/tabs/cura-tabs-transparent/cura-tabs-transparent.css +168 -0
  75. package/dist/collection/components/tabs/cura-tabs-transparent/cura-tabs-transparent.js +258 -0
  76. package/dist/collection/components/tabs/cura-tabs-transparent/cura-tabs-transparent.js.map +1 -0
  77. package/dist/collection/components/tabs/cura-tabs-transparent/cura-tabs-transparent.stories.js +89 -0
  78. package/dist/collection/components/tabs/cura-tabs-transparent/cura-tabs-transparent.stories.js.map +1 -0
  79. package/dist/collection/components/tabs/cura-tabs.definitions.js +7 -0
  80. package/dist/collection/components/tabs/cura-tabs.definitions.js.map +1 -0
  81. package/dist/collection/components/text/cura-display/cura-display.js +1 -1
  82. package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
  83. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
  84. package/dist/components/cura-avatar.js +1 -1
  85. package/dist/components/cura-avatar.js.map +1 -1
  86. package/dist/components/cura-checkbox.js +6 -4
  87. package/dist/components/cura-checkbox.js.map +1 -1
  88. package/dist/components/cura-display.js +1 -1
  89. package/dist/components/cura-heading2.js +1 -1
  90. package/dist/components/cura-icons-view.js +1 -1
  91. package/dist/components/cura-icons-view.js.map +1 -1
  92. package/dist/components/cura-modal.js +3 -3
  93. package/dist/components/cura-modal.js.map +1 -1
  94. package/dist/components/cura-paragraph2.js +1 -1
  95. package/dist/components/cura-radio.js +6 -4
  96. package/dist/components/cura-radio.js.map +1 -1
  97. package/dist/components/cura-select2.js +6 -4
  98. package/dist/components/cura-select2.js.map +1 -1
  99. package/dist/components/cura-switch.js +6 -5
  100. package/dist/components/cura-switch.js.map +1 -1
  101. package/dist/components/cura-tabs-button.d.ts +11 -0
  102. package/dist/components/cura-tabs-button.js +150 -0
  103. package/dist/components/cura-tabs-button.js.map +1 -0
  104. package/dist/components/cura-tabs-group.d.ts +11 -0
  105. package/dist/components/cura-tabs-group.js +64 -0
  106. package/dist/components/cura-tabs-group.js.map +1 -0
  107. package/dist/components/cura-tabs-transparent.d.ts +11 -0
  108. package/dist/components/cura-tabs-transparent.js +143 -0
  109. package/dist/components/cura-tabs-transparent.js.map +1 -0
  110. package/dist/components/cura-tabs.d.ts +11 -0
  111. package/dist/components/cura-tabs.definitions.js +10 -0
  112. package/dist/components/cura-tabs.definitions.js.map +1 -0
  113. package/dist/components/cura-tabs.js +148 -0
  114. package/dist/components/cura-tabs.js.map +1 -0
  115. package/dist/components/index.js +39 -0
  116. package/dist/components/index.js.map +1 -1
  117. package/dist/cura/cura.esm.js +1 -1
  118. package/dist/cura/cura.esm.js.map +1 -1
  119. package/dist/cura/index.esm.js +1 -1
  120. package/dist/cura/p-0ccde0ff.entry.js +2 -0
  121. package/dist/cura/p-0ccde0ff.entry.js.map +1 -0
  122. package/dist/cura/p-1ef21ae9.entry.js +2 -0
  123. package/dist/cura/p-1ef21ae9.entry.js.map +1 -0
  124. package/dist/cura/p-53c18ed4.js +2 -0
  125. package/dist/cura/p-53c18ed4.js.map +1 -0
  126. package/dist/cura/p-5c6f9593.entry.js +2 -0
  127. package/dist/cura/p-5c6f9593.entry.js.map +1 -0
  128. package/dist/cura/{p-0c25333f.js → p-6cbd49dd.js} +2 -2
  129. package/dist/cura/p-7a68835f.entry.js +2 -0
  130. package/dist/cura/p-7a68835f.entry.js.map +1 -0
  131. package/dist/cura/p-7e2d1229.entry.js +2 -0
  132. package/dist/cura/p-7e2d1229.entry.js.map +1 -0
  133. package/dist/cura/{p-ac01bec2.entry.js → p-8aade007.entry.js} +2 -2
  134. package/dist/cura/p-9f460031.js +2 -0
  135. package/dist/cura/p-9f460031.js.map +1 -0
  136. package/dist/cura/p-b4ee956b.entry.js +2 -0
  137. package/dist/cura/p-b4ee956b.entry.js.map +1 -0
  138. package/dist/cura/p-b6ff8ac1.entry.js +2 -0
  139. package/dist/cura/p-b6ff8ac1.entry.js.map +1 -0
  140. package/dist/cura/p-d8e1e182.entry.js +2 -0
  141. package/dist/cura/p-d8e1e182.entry.js.map +1 -0
  142. package/dist/esm/{app-globals-ca1945d1.js → app-globals-c2abb41c.js} +2 -2
  143. package/dist/esm/{app-globals-ca1945d1.js.map → app-globals-c2abb41c.js.map} +1 -1
  144. package/dist/esm/{cura-accordion_18.entry.js → cura-accordion_20.entry.js} +147 -9
  145. package/dist/esm/cura-accordion_20.entry.js.map +1 -0
  146. package/dist/esm/cura-checkbox.entry.js +4 -3
  147. package/dist/esm/cura-checkbox.entry.js.map +1 -1
  148. package/dist/esm/cura-display.entry.js +1 -1
  149. package/dist/esm/cura-icons-view.entry.js +1 -1
  150. package/dist/esm/cura-icons-view.entry.js.map +1 -1
  151. package/dist/esm/cura-modal.entry.js +3 -3
  152. package/dist/esm/cura-modal.entry.js.map +1 -1
  153. package/dist/esm/cura-radio.entry.js +4 -3
  154. package/dist/esm/cura-radio.entry.js.map +1 -1
  155. package/dist/esm/cura-switch.entry.js +4 -4
  156. package/dist/esm/cura-switch.entry.js.map +1 -1
  157. package/dist/esm/cura-tabs-button.entry.js +102 -0
  158. package/dist/esm/cura-tabs-button.entry.js.map +1 -0
  159. package/dist/esm/cura-tabs-transparent.entry.js +101 -0
  160. package/dist/esm/cura-tabs-transparent.entry.js.map +1 -0
  161. package/dist/esm/cura-tabs.definitions-a017126e.js +10 -0
  162. package/dist/esm/cura-tabs.definitions-a017126e.js.map +1 -0
  163. package/dist/esm/{cura-theme-module-0fa5ee0b.js → cura-theme-module-bf286f68.js} +32 -1
  164. package/dist/esm/cura-theme-module-bf286f68.js.map +1 -0
  165. package/dist/esm/cura.js +3 -3
  166. package/dist/esm/index.js +1 -1
  167. package/dist/esm/loader.js +3 -3
  168. package/dist/types/api/theme-presets/theme-perinatal-temporary.d.ts +43 -0
  169. package/dist/types/api/theme-presets/theme-presets.d.ts +43 -0
  170. package/dist/types/components/cura-avatar/cura-avatar.d.ts +37 -0
  171. package/dist/types/components/forms/cura-checkbox/cura-checkbox.d.ts +17 -4
  172. package/dist/types/components/forms/cura-radio/cura-radio.d.ts +17 -4
  173. package/dist/types/components/forms/cura-select/cura-select.d.ts +6 -0
  174. package/dist/types/components/forms/cura-select/cura-select.stories.d.ts +11 -0
  175. package/dist/types/components/forms/cura-switch/cura-switch.d.ts +16 -3
  176. package/dist/types/components/tabs/cura-tabs/cura-tabs.d.ts +30 -0
  177. package/dist/types/components/tabs/cura-tabs/cura-tabs.stories.d.ts +99 -0
  178. package/dist/types/components/tabs/cura-tabs-button/cura-tabs-button.d.ts +29 -0
  179. package/dist/types/components/tabs/cura-tabs-button/cura-tabs-button.stories.d.ts +99 -0
  180. package/dist/types/components/tabs/cura-tabs-group/cura-tabs-group.d.ts +18 -0
  181. package/dist/types/components/tabs/cura-tabs-group/cura-tabs-group.stories.d.ts +57 -0
  182. package/dist/types/components/tabs/cura-tabs-transparent/cura-tabs-transparent.d.ts +29 -0
  183. package/dist/types/components/tabs/cura-tabs-transparent/cura-tabs-transparent.stories.d.ts +99 -0
  184. package/dist/types/components/tabs/cura-tabs.definitions.d.ts +6 -0
  185. package/dist/types/components.d.ts +298 -24
  186. package/package.json +2 -2
  187. package/dist/cjs/cura-accordion_18.cjs.entry.js.map +0 -1
  188. package/dist/cjs/cura-theme-module-f1e4a309.js.map +0 -1
  189. package/dist/cura/p-03feed94.entry.js +0 -2
  190. package/dist/cura/p-03feed94.entry.js.map +0 -1
  191. package/dist/cura/p-07817634.entry.js +0 -2
  192. package/dist/cura/p-07817634.entry.js.map +0 -1
  193. package/dist/cura/p-84c18273.entry.js +0 -2
  194. package/dist/cura/p-84c18273.entry.js.map +0 -1
  195. package/dist/cura/p-9fce5ec5.entry.js +0 -2
  196. package/dist/cura/p-9fce5ec5.entry.js.map +0 -1
  197. package/dist/cura/p-b84924e1.entry.js +0 -2
  198. package/dist/cura/p-b84924e1.entry.js.map +0 -1
  199. package/dist/cura/p-b856b946.entry.js +0 -2
  200. package/dist/cura/p-b856b946.entry.js.map +0 -1
  201. package/dist/cura/p-bf8e2037.js +0 -2
  202. package/dist/cura/p-bf8e2037.js.map +0 -1
  203. package/dist/esm/cura-accordion_18.entry.js.map +0 -1
  204. package/dist/esm/cura-theme-module-0fa5ee0b.js.map +0 -1
  205. /package/dist/cura/{p-0c25333f.js.map → p-6cbd49dd.js.map} +0 -0
  206. /package/dist/cura/{p-ac01bec2.entry.js.map → p-8aade007.entry.js.map} +0 -0
@@ -0,0 +1,64 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+
3
+ const curaTabsGroupCss = ":host{display:flex;gap:var(--gap)}:host(.border-bottom){position:relative}:host(.border-bottom)::after{content:\"\";position:absolute;bottom:0;left:0;right:0;height:1px;background:var(--border-color);z-index:0}::slotted(cura-tabs),::slotted(cura-tabs-transparent){position:relative;z-index:1}";
4
+ const CuraTabsGroupStyle0 = curaTabsGroupCss;
5
+
6
+ const CuraTabsGroup$1 = /*@__PURE__*/ proxyCustomElement(class CuraTabsGroup extends HTMLElement {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ this.__attachShadow();
11
+ this.tabChange = createEvent(this, "tabChange", 7);
12
+ this.gap = 0;
13
+ this.borderBottom = true;
14
+ this.colorMode = 'light';
15
+ this.styles = {};
16
+ }
17
+ handleTabSelect(ev) {
18
+ this.updateSelectedTab(ev.detail.name);
19
+ }
20
+ updateSelectedTab(value) {
21
+ const tabs = this.host.querySelectorAll('cura-tabs, cura-tabs-transparent, cura-tabs-button');
22
+ tabs.forEach((tab) => {
23
+ tab.selected = tab.name === value;
24
+ });
25
+ }
26
+ getClasses() {
27
+ return {
28
+ 'border-bottom': this.borderBottom,
29
+ };
30
+ }
31
+ connectedCallback() {
32
+ this.styles = Object.assign(Object.assign({}, this.styles), { '--border-color': window.CuraAPI.theme.colors.getColor(this.colorMode === 'light' ? 'neutral-base' : 'primary-base'), '--gap': `${this.gap}px` });
33
+ }
34
+ render() {
35
+ return (h(Host, { key: 'fb6a6ae52fd5bdfb8c3978a75f26be87479ccafa', role: "tablist", style: this.styles, class: this.getClasses() }, h("slot", { key: 'afca97b27c8359f8236331257e4db41f1332e071' })));
36
+ }
37
+ get host() { return this; }
38
+ static get style() { return CuraTabsGroupStyle0; }
39
+ }, [1, "cura-tabs-group", {
40
+ "gap": [514],
41
+ "borderBottom": [1540, "border-bottom"],
42
+ "colorMode": [1537, "color-mode"],
43
+ "styles": [32]
44
+ }, [[0, "tabSelect", "handleTabSelect"]]]);
45
+ function defineCustomElement$1() {
46
+ if (typeof customElements === "undefined") {
47
+ return;
48
+ }
49
+ const components = ["cura-tabs-group"];
50
+ components.forEach(tagName => { switch (tagName) {
51
+ case "cura-tabs-group":
52
+ if (!customElements.get(tagName)) {
53
+ customElements.define(tagName, CuraTabsGroup$1);
54
+ }
55
+ break;
56
+ } });
57
+ }
58
+
59
+ const CuraTabsGroup = CuraTabsGroup$1;
60
+ const defineCustomElement = defineCustomElement$1;
61
+
62
+ export { CuraTabsGroup, defineCustomElement };
63
+
64
+ //# sourceMappingURL=cura-tabs-group.js.map
@@ -0,0 +1 @@
1
+ {"file":"cura-tabs-group.js","mappings":";;AAAA,MAAM,gBAAgB,GAAG,sSAAsS,CAAC;AAChU,4BAAe,gBAAgB;;MCMlBA,eAAa;;;;;;mBACe,CAAC;4BACwB,IAAI;yBACE,OAAO;sBAEnC,EAAE;;IAO5C,eAAe,CAAC,EAAiC;QAC/C,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;KACxC;IAED,iBAAiB,CAAC,KAAa;QAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,oDAAoD,CAAC,CAAC;QAE9F,IAAI,CAAC,OAAO,CAAC,CAAC,GAAwB;YACpC,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC;SACnC,CAAC,CAAC;KACJ;IAED,UAAU;QACR,OAAO;YACL,eAAe,EAAE,IAAI,CAAC,YAAY;SACnC,CAAC;KACH;IAED,iBAAiB;QACf,IAAI,CAAC,MAAM,mCACN,IAAI,CAAC,MAAM,KACd,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,KAAK,OAAO,GAAG,cAAc,GAAG,cAAc,CAAC,EACpH,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,GACzB,CAAC;KACH;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qDAAC,IAAI,EAAC,SAAS,EAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,IAC/D,8DAAa,CACR,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CuraTabsGroup"],"sources":["src/components/tabs/cura-tabs-group/cura-tabs-group.scss?tag=cura-tabs-group&encapsulation=shadow","src/components/tabs/cura-tabs-group/cura-tabs-group.tsx"],"sourcesContent":[":host {\n display: flex;\n gap: var(--gap);\n}\n\n:host(.border-bottom) {\n position: relative;\n}\n\n:host(.border-bottom)::after {\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 1px;\n background: var(--border-color);\n z-index: 0;\n}\n\n::slotted(cura-tabs),\n::slotted(cura-tabs-transparent) {\n position: relative;\n z-index: 1;\n}\n","import { Component, Element, Event, EventEmitter, Host, Listen, Prop, State, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-tabs-group',\n styleUrl: 'cura-tabs-group.scss',\n shadow: true,\n})\nexport class CuraTabsGroup {\n @Prop({ reflect: true }) gap: number = 0;\n @Prop({ reflect: true, mutable: true }) borderBottom: boolean = true;\n @Prop({ reflect: true, mutable: true }) colorMode: 'dark' | 'light' = 'light';\n\n @State() styles: Record<string, string> = {};\n\n @Element() host: HTMLElement;\n\n @Event() tabChange: EventEmitter<string>;\n\n @Listen('tabSelect')\n handleTabSelect(ev: CustomEvent<{ name: string }>) {\n this.updateSelectedTab(ev.detail.name);\n }\n\n updateSelectedTab(value: string) {\n const tabs = this.host.querySelectorAll('cura-tabs, cura-tabs-transparent, cura-tabs-button');\n\n tabs.forEach((tab: HTMLCuraTabsElement) => {\n tab.selected = tab.name === value;\n });\n }\n\n getClasses() {\n return {\n 'border-bottom': this.borderBottom,\n };\n }\n\n connectedCallback() {\n this.styles = {\n ...this.styles,\n '--border-color': window.CuraAPI.theme.colors.getColor(this.colorMode === 'light' ? 'neutral-base' : 'primary-base'),\n '--gap': `${this.gap}px`,\n };\n }\n\n render() {\n return (\n <Host role=\"tablist\" style={this.styles} class={this.getClasses()}>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface CuraTabsTransparent extends Components.CuraTabsTransparent, HTMLElement {}
4
+ export const CuraTabsTransparent: {
5
+ prototype: CuraTabsTransparent;
6
+ new (): CuraTabsTransparent;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,143 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { l as labelSizes } from './cura-tabs.definitions.js';
3
+ import { d as defineCustomElement$3 } from './cura-icon2.js';
4
+ import { d as defineCustomElement$2 } from './cura-label2.js';
5
+
6
+ const curaTabsTransparentCss = ":host button,:host a{outline:none;box-shadow:none;box-sizing:border-box;display:flex;width:100%;align-items:center;justify-content:center;text-decoration:none !important;font-size:var(--font-size);cursor:pointer;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;border-radius:var(--border-radius);position:relative;background-color:transparent;box-sizing:border-box;border:none;min-width:120px;width:fit-content;display:flex;align-items:center;justify-content:center}:host button:focus,:host a:focus{outline:2px solid #6EA8FF}:host button.border-bottom,:host a.border-bottom{border-bottom:1px solid var(--border-bottom-color)}:host button.small,:host a.small{padding:calc(var(--cura-spacing-base) * 2px) calc(var(--cura-spacing-base) * 2px)}:host button.medium,:host a.medium{padding:calc(var(--cura-spacing-base) * 3px) calc(var(--cura-spacing-base) * 3px)}:host button.large,:host a.large{padding:calc(var(--cura-spacing-base) * 3px) calc(var(--cura-spacing-base) * 4px)}:host button:not(.selected),:host a:not(.selected){border-color:var(--border-color)}:host button:focus,:host a:focus{border-color:var(--primary-light)}:host button:not(.disabled,.selected):hover,:host a:not(.disabled,.selected):hover{background-color:var(--background-color-hover)}:host button:not(.disabled,.selected):hover.dark,:host a:not(.disabled,.selected):hover.dark{border-color:var(--neutral-purewhite)}:host button cura-icon,:host a cura-icon{margin-right:calc(var(--cura-spacing-base) * 2px)}:host button.selected,:host a.selected{cursor:pointer}:host button.selected:not(.disabled),:host a.selected:not(.disabled){border-bottom:1px solid var(--border-bottom-color-selected)}:host button.disabled,:host a.disabled{cursor:not-allowed}";
7
+ const CuraTabsTransparentStyle0 = curaTabsTransparentCss;
8
+
9
+ const CuraTabsTransparent$1 = /*@__PURE__*/ proxyCustomElement(class CuraTabsTransparent extends HTMLElement {
10
+ constructor() {
11
+ super();
12
+ this.__registerHost();
13
+ this.__attachShadow();
14
+ this.tabSelect = createEvent(this, "tabSelect", 7);
15
+ this.name = undefined;
16
+ this.iconName = undefined;
17
+ this.selected = false;
18
+ this.disabled = false;
19
+ this.borderBottom = true;
20
+ this.size = 'large';
21
+ this.colorMode = 'light';
22
+ this.hovered = false;
23
+ this.styles = {};
24
+ }
25
+ setColors() {
26
+ const colors = [
27
+ {
28
+ name: '--border-bottom-color',
29
+ theme: this.colorMode === 'light' ? 'neutral-base' : 'primary',
30
+ },
31
+ {
32
+ name: '--border-bottom-color-selected',
33
+ theme: this.colorMode === 'light' ? 'primary-dark' : 'primary-lighter',
34
+ },
35
+ ];
36
+ colors.forEach(c => {
37
+ if (c.theme)
38
+ this.styles[c.name] = window.CuraAPI.theme.colors.getColor(c.theme);
39
+ });
40
+ this.styles = Object.assign({}, this.styles);
41
+ }
42
+ computeContentColor() {
43
+ if (this.disabled)
44
+ return 'neutral-dark';
45
+ if (this.colorMode === 'dark') {
46
+ if (this.hovered && !this.selected) {
47
+ return 'neutral-purewhite';
48
+ }
49
+ return this.selected ? 'primary-lighter' : 'neutral-purewhite';
50
+ }
51
+ if (this.hovered && !this.selected) {
52
+ return 'primary-dark';
53
+ }
54
+ return this.selected ? 'primary-base' : 'neutral-black';
55
+ }
56
+ getIcon() {
57
+ if (!this.iconName)
58
+ return '';
59
+ const iconSize = this.size === 'large' ? 20 : 16;
60
+ const iconColor = this.computeContentColor();
61
+ return h("cura-icon", { name: this.iconName, size: iconSize, color: iconColor });
62
+ }
63
+ getClasses() {
64
+ return {
65
+ [this.size]: true,
66
+ [this.colorMode]: true,
67
+ 'selected': this.selected,
68
+ 'disabled': this.disabled,
69
+ 'border-bottom': this.borderBottom,
70
+ };
71
+ }
72
+ connectedCallback() {
73
+ this.styles = Object.assign(Object.assign({}, this.styles), { '--primary-dark': window.CuraAPI.theme.colors.getColor('primary-dark'), '--neutral-purewhite': window.CuraAPI.theme.colors.getColor('neutral-purewhite'), '--base-spacing': window.CuraAPI.theme.spacing.getSpacing() });
74
+ this.setColors();
75
+ }
76
+ handleMouseEnter() {
77
+ if (this.disabled)
78
+ return;
79
+ this.hovered = true;
80
+ }
81
+ handleMouseLeave() {
82
+ this.hovered = false;
83
+ }
84
+ handleClick(e) {
85
+ if (this.disabled) {
86
+ e.preventDefault();
87
+ return;
88
+ }
89
+ this.selected = !this.selected;
90
+ this.tabSelect.emit({ name: this.name });
91
+ }
92
+ render() {
93
+ const labelSize = labelSizes[this.size] || labelSizes['default'];
94
+ const labelColor = this.computeContentColor();
95
+ return (h(Host, { key: 'd3c9e277a079381def09397dc922d697aa99d70a', role: "button", "aria-pressed": this.selected, "aria-disabled": this.disabled }, h("button", { key: 'ab4cac9782f48c367c4ada4e303f9422971dc38e', class: this.getClasses(), style: this.styles, onClick: e => this.handleClick(e), disabled: this.disabled, onMouseEnter: this.handleMouseEnter.bind(this), onMouseLeave: this.handleMouseLeave.bind(this) }, this.getIcon(), h("cura-label", { key: 'c6567bdf7b80efc3380a8a93bf52de966e1caa7d', size: labelSize, color: labelColor, lineHeight: "0", marginBlock: "0" }, h("slot", { key: '93c392107790a2c0e3499e5b7bd742219203a980' })))));
96
+ }
97
+ static get watchers() { return {
98
+ "colorMode": ["setColors"]
99
+ }; }
100
+ static get style() { return CuraTabsTransparentStyle0; }
101
+ }, [1, "cura-tabs-transparent", {
102
+ "name": [513],
103
+ "iconName": [513, "icon-name"],
104
+ "selected": [1540],
105
+ "disabled": [1540],
106
+ "borderBottom": [1540, "border-bottom"],
107
+ "size": [513],
108
+ "colorMode": [1537, "color-mode"],
109
+ "hovered": [32],
110
+ "styles": [32]
111
+ }, undefined, {
112
+ "colorMode": ["setColors"]
113
+ }]);
114
+ function defineCustomElement$1() {
115
+ if (typeof customElements === "undefined") {
116
+ return;
117
+ }
118
+ const components = ["cura-tabs-transparent", "cura-icon", "cura-label"];
119
+ components.forEach(tagName => { switch (tagName) {
120
+ case "cura-tabs-transparent":
121
+ if (!customElements.get(tagName)) {
122
+ customElements.define(tagName, CuraTabsTransparent$1);
123
+ }
124
+ break;
125
+ case "cura-icon":
126
+ if (!customElements.get(tagName)) {
127
+ defineCustomElement$3();
128
+ }
129
+ break;
130
+ case "cura-label":
131
+ if (!customElements.get(tagName)) {
132
+ defineCustomElement$2();
133
+ }
134
+ break;
135
+ } });
136
+ }
137
+
138
+ const CuraTabsTransparent = CuraTabsTransparent$1;
139
+ const defineCustomElement = defineCustomElement$1;
140
+
141
+ export { CuraTabsTransparent, defineCustomElement };
142
+
143
+ //# sourceMappingURL=cura-tabs-transparent.js.map
@@ -0,0 +1 @@
1
+ {"file":"cura-tabs-transparent.js","mappings":";;;;;AAAA,MAAM,sBAAsB,GAAG,kuDAAkuD,CAAC;AAClwD,kCAAe,sBAAsB;;MCOxBA,qBAAmB;;;;;;;;wBAG8B,KAAK;wBACL,KAAK;4BACD,IAAI;oBACN,OAAO;yBACC,OAAO;uBAE1D,KAAK;sBACkB,EAAE;;IAK5C,SAAS;QACP,MAAM,MAAM,GAAG;YACb;gBACE,IAAI,EAAE,uBAAuB;gBAC7B,KAAK,EAAE,IAAI,CAAC,SAAS,KAAK,OAAO,GAAG,cAAc,GAAG,SAAS;aAC/D;YACD;gBACE,IAAI,EAAE,gCAAgC;gBACtC,KAAK,EAAE,IAAI,CAAC,SAAS,KAAK,OAAO,GAAG,cAAc,GAAG,iBAAiB;aACvE;SACF,CAAC;QAEF,MAAM,CAAC,OAAO,CAAC,CA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CAAC,MAAM,EAClB,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,YAAY,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAC9C,YAAY,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,IAE7C,IAAI,CAAC,OAAO,EAAE,EACf,mEAAY,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAC,GAAG,EAAC,WAAW,EAAC,GAAG,IAC5E,8DAAa,CACF,CACN,CACJ,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CuraTabsTransparent"],"sources":["src/components/tabs/cura-tabs-transparent/cura-tabs-transparent.scss?tag=cura-tabs-transparent&encapsulation=shadow","src/components/tabs/cura-tabs-transparent/cura-tabs-transparent.tsx"],"sourcesContent":["@import '../../../scss/mixins/spacing.scss';\n@import '../../../scss/mixins/buttons.scss';\n\n$button-sizes: (\n small: $spacing-mini $spacing-mini,\n medium: $spacing-xxxs $spacing-xxxs,\n large: $spacing-xxxs $spacing-xxs,\n);\n\n:host {\n button,\n a {\n @include button-element() {\n background-color: transparent;\n box-sizing: border-box;\n border: none;\n\n min-width: 120px;\n width: fit-content;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n &.border-bottom {\n border-bottom: 1px solid var(--border-bottom-color);\n }\n\n @each $size, $padding in $button-sizes {\n &.#{$size} {\n padding: $padding;\n }\n }\n\n &:not(.selected) {\n border-color: var(--border-color);\n }\n\n &:focus {\n border-color: var(--primary-light);\n }\n\n &:not(.disabled, .selected):hover {\n background-color: var(--background-color-hover);\n\n &.dark {\n border-color: var(--neutral-purewhite);\n }\n }\n\n cura-icon {\n margin-right: #{$spacing-mini};\n }\n\n @include button-selected() {\n &:not(.disabled) {\n border-bottom: 1px solid var(--border-bottom-color-selected);\n }\n }\n\n &.disabled {\n cursor: not-allowed;\n }\n }\n }\n}\n","import { Component, Event, EventEmitter, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { labelSizes } from '../cura-tabs.definitions';\n\n@Component({\n tag: 'cura-tabs-transparent',\n styleUrl: 'cura-tabs-transparent.scss',\n shadow: true,\n})\nexport class CuraTabsTransparent {\n @Prop({ reflect: true }) name: string;\n @Prop({ reflect: true }) iconName: string;\n @Prop({ reflect: true, mutable: true }) selected: boolean = false;\n @Prop({ reflect: true, mutable: true }) disabled: boolean = false;\n @Prop({ reflect: true, mutable: true }) borderBottom: boolean = true;\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'large';\n @Prop({ reflect: true, mutable: true }) colorMode: 'dark' | 'light' = 'light';\n\n @State() hovered = false;\n @State() styles: Record<string, string> = {};\n\n @Event() tabSelect: EventEmitter<{ name: string }>;\n\n @Watch('colorMode')\n setColors() {\n const colors = [\n {\n name: '--border-bottom-color',\n theme: this.colorMode === 'light' ? 'neutral-base' : 'primary',\n },\n {\n name: '--border-bottom-color-selected',\n theme: this.colorMode === 'light' ? 'primary-dark' : 'primary-lighter',\n },\n ];\n\n colors.forEach(c => {\n if (c.theme) this.styles[c.name] = window.CuraAPI.theme.colors.getColor(c.theme);\n });\n\n this.styles = { ...this.styles };\n }\n\n computeContentColor(): string {\n if (this.disabled) return 'neutral-dark';\n\n if (this.colorMode === 'dark') {\n if (this.hovered && !this.selected) {\n return 'neutral-purewhite';\n }\n return this.selected ? 'primary-lighter' : 'neutral-purewhite';\n }\n\n if (this.hovered && !this.selected) {\n return 'primary-dark';\n }\n\n return this.selected ? 'primary-base' : 'neutral-black';\n }\n\n getIcon() {\n if (!this.iconName) return '';\n const iconSize = this.size === 'large' ? 20 : 16;\n const iconColor = this.computeContentColor();\n\n return <cura-icon name={this.iconName} size={iconSize} color={iconColor}></cura-icon>;\n }\n\n getClasses() {\n return {\n [this.size]: true,\n [this.colorMode]: true,\n 'selected': this.selected,\n 'disabled': this.disabled,\n 'border-bottom': this.borderBottom,\n };\n }\n\n connectedCallback() {\n this.styles = {\n ...this.styles,\n '--primary-dark': window.CuraAPI.theme.colors.getColor('primary-dark'),\n '--neutral-purewhite': window.CuraAPI.theme.colors.getColor('neutral-purewhite'),\n '--base-spacing': window.CuraAPI.theme.spacing.getSpacing(),\n };\n\n this.setColors();\n }\n\n handleMouseEnter() {\n if (this.disabled) return;\n this.hovered = true;\n }\n\n handleMouseLeave() {\n this.hovered = false;\n }\n\n handleClick(e: Event) {\n if (this.disabled) {\n e.preventDefault();\n return;\n }\n\n this.selected = !this.selected;\n this.tabSelect.emit({ name: this.name });\n }\n\n render() {\n const labelSize = labelSizes[this.size] || labelSizes['default'];\n const labelColor = this.computeContentColor();\n\n return (\n <Host role=\"button\" aria-pressed={this.selected} aria-disabled={this.disabled}>\n <button\n class={this.getClasses()}\n style={this.styles}\n onClick={e => this.handleClick(e)}\n disabled={this.disabled}\n onMouseEnter={this.handleMouseEnter.bind(this)}\n onMouseLeave={this.handleMouseLeave.bind(this)}\n >\n {this.getIcon()}\n <cura-label size={labelSize} color={labelColor} lineHeight=\"0\" marginBlock=\"0\">\n <slot></slot>\n </cura-label>\n </button>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface CuraTabs extends Components.CuraTabs, HTMLElement {}
4
+ export const CuraTabs: {
5
+ prototype: CuraTabs;
6
+ new (): CuraTabs;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,10 @@
1
+ const labelSizes = {
2
+ small: 'xsmall',
3
+ medium: 'small',
4
+ large: 'medium',
5
+ default: 'medium',
6
+ };
7
+
8
+ export { labelSizes as l };
9
+
10
+ //# sourceMappingURL=cura-tabs.definitions.js.map
@@ -0,0 +1 @@
1
+ {"file":"cura-tabs.definitions.js","mappings":"MAAa,UAAU,GAAG;IACxB,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,OAAO;IACf,KAAK,EAAE,QAAQ;IACf,OAAO,EAAE,QAAQ;;;;;","names":[],"sources":["src/components/tabs/cura-tabs.definitions.tsx"],"sourcesContent":["export const labelSizes = {\n small: 'xsmall',\n medium: 'small',\n large: 'medium',\n default: 'medium',\n};\n"],"version":3}
@@ -0,0 +1,148 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { l as labelSizes } from './cura-tabs.definitions.js';
3
+ import { d as defineCustomElement$3 } from './cura-icon2.js';
4
+ import { d as defineCustomElement$2 } from './cura-label2.js';
5
+
6
+ const curaTabsCss = ":host button,:host a{outline:none;box-shadow:none;box-sizing:border-box;display:flex;width:100%;align-items:center;justify-content:center;text-decoration:none !important;font-size:var(--font-size);cursor:pointer;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;border-radius:var(--border-radius);position:relative;background-color:transparent;box-sizing:border-box;border:none;min-width:120px;width:fit-content;display:flex;align-items:center;justify-content:center;border-radius:4px 4px 0 0}:host button:focus,:host a:focus{outline:2px solid #6EA8FF}:host button.border-bottom,:host a.border-bottom{border-bottom:1px solid var(--border-bottom-color)}:host button:not(.disabled,.selected):hover,:host a:not(.disabled,.selected):hover{background-color:var(--background-color-hover)}:host button:not(.disabled,.selected):hover.light,:host a:not(.disabled,.selected):hover.light{border-bottom-color:var(--primary-dark)}:host button:not(.disabled,.selected):hover.dark,:host a:not(.disabled,.selected):hover.dark{border-bottom-color:var(--neutral-purewhite)}:host button.small,:host a.small{padding:calc(var(--cura-spacing-base) * 2px) calc(var(--cura-spacing-base) * 2px)}:host button.medium,:host a.medium{padding:calc(var(--cura-spacing-base) * 3px) calc(var(--cura-spacing-base) * 3px)}:host button.large,:host a.large{padding:calc(var(--cura-spacing-base) * 3px) calc(var(--cura-spacing-base) * 4px)}:host button:focus,:host a:focus{border:2px solid var(--primary-light)}:host button cura-icon,:host a cura-icon{margin-right:calc(var(--cura-spacing-base) * 2px)}:host button.selected,:host a.selected{cursor:pointer;background-color:var(--background-color-selected)}:host button.selected.disabled,:host a.selected.disabled{background-color:var(--background-disabled-selected)}:host button.disabled,:host a.disabled{cursor:not-allowed}";
7
+ const CuraTabsStyle0 = curaTabsCss;
8
+
9
+ const CuraTabs$1 = /*@__PURE__*/ proxyCustomElement(class CuraTabs extends HTMLElement {
10
+ constructor() {
11
+ super();
12
+ this.__registerHost();
13
+ this.__attachShadow();
14
+ this.tabSelect = createEvent(this, "tabSelect", 7);
15
+ this.name = undefined;
16
+ this.iconName = undefined;
17
+ this.selected = false;
18
+ this.disabled = false;
19
+ this.borderBottom = true;
20
+ this.size = 'large';
21
+ this.colorMode = 'light';
22
+ this.hovered = false;
23
+ this.styles = {};
24
+ }
25
+ setColors() {
26
+ const colors = [
27
+ { name: '--background-color-selected', theme: this.colorMode === 'light' ? 'primary-base' : 'primary-lighter' },
28
+ { name: '--background-color-hover', theme: this.colorMode === 'light' ? 'primary-lighter' : null },
29
+ {
30
+ name: '--background-disabled-selected',
31
+ theme: this.colorMode === 'light' ? 'neutral-pale' : 'neutral-black',
32
+ },
33
+ {
34
+ name: '--border-bottom-color',
35
+ theme: this.colorMode === 'light' ? 'neutral-base' : 'primary',
36
+ },
37
+ ];
38
+ colors.forEach(c => {
39
+ if (c.theme)
40
+ this.styles[c.name] = window.CuraAPI.theme.colors.getColor(c.theme);
41
+ });
42
+ this.styles = Object.assign({}, this.styles);
43
+ }
44
+ computeContentColor() {
45
+ if (this.disabled)
46
+ return 'neutral-dark';
47
+ if (this.colorMode === 'dark') {
48
+ if (this.hovered && !this.selected) {
49
+ return 'neutral-purewhite';
50
+ }
51
+ return this.selected ? 'neutral-black' : 'primary-lighter';
52
+ }
53
+ return this.selected ? 'neutral-purewhite' : 'primary-dark';
54
+ }
55
+ updateDynamicStyles() {
56
+ if (this.colorMode === 'dark' && this.hovered && !this.selected) {
57
+ this.styles = Object.assign(Object.assign({}, this.styles), { '--border-bottom-color': window.CuraAPI.theme.colors.getColor('neutral-purewhite') });
58
+ }
59
+ }
60
+ getIcon() {
61
+ if (!this.iconName)
62
+ return '';
63
+ const iconSize = this.size === 'large' ? 20 : 16;
64
+ const iconColor = this.computeContentColor();
65
+ return h("cura-icon", { name: this.iconName, size: iconSize, color: iconColor });
66
+ }
67
+ getClasses() {
68
+ return {
69
+ [this.size]: true,
70
+ [this.colorMode]: true,
71
+ 'selected': this.selected,
72
+ 'disabled': this.disabled,
73
+ 'border-bottom': this.borderBottom,
74
+ };
75
+ }
76
+ connectedCallback() {
77
+ this.styles = Object.assign(Object.assign({}, this.styles), { '--primary-dark': window.CuraAPI.theme.colors.getColor('primary-dark'), '--neutral-purewhite': window.CuraAPI.theme.colors.getColor('neutral-purewhite'), '--base-spacing': window.CuraAPI.theme.spacing.getSpacing() });
78
+ this.setColors();
79
+ }
80
+ handleMouseEnter() {
81
+ if (this.disabled)
82
+ return;
83
+ this.hovered = true;
84
+ }
85
+ handleMouseLeave() {
86
+ this.hovered = false;
87
+ }
88
+ handleClick(e) {
89
+ if (this.disabled) {
90
+ e.preventDefault();
91
+ return;
92
+ }
93
+ this.selected = !this.selected;
94
+ this.tabSelect.emit({ name: this.name });
95
+ }
96
+ render() {
97
+ const labelSize = labelSizes[this.size] || labelSizes['default'];
98
+ const labelColor = this.computeContentColor();
99
+ this.updateDynamicStyles();
100
+ return (h(Host, { key: '3966968b73a9a51ec26f3206cdb09fbfcb3d3daf', role: "button", "aria-pressed": this.selected, "aria-disabled": this.disabled }, h("button", { key: '00cc6382c635a05c52fd74b3e02e968c2d94cacb', class: this.getClasses(), style: this.styles, onClick: e => this.handleClick(e), disabled: this.disabled, onMouseEnter: this.handleMouseEnter.bind(this), onMouseLeave: this.handleMouseLeave.bind(this) }, this.getIcon(), h("cura-label", { key: 'e193500f156c10cf0442e6f504e19d552c19f849', size: labelSize, color: labelColor, lineHeight: "0", marginBlock: "0" }, h("slot", { key: '8a0ac7c4b2ff4990093d13b4110e370616cf39f4' })))));
101
+ }
102
+ static get watchers() { return {
103
+ "colorMode": ["setColors"]
104
+ }; }
105
+ static get style() { return CuraTabsStyle0; }
106
+ }, [1, "cura-tabs", {
107
+ "name": [513],
108
+ "iconName": [513, "icon-name"],
109
+ "selected": [1540],
110
+ "disabled": [1540],
111
+ "borderBottom": [1540, "border-bottom"],
112
+ "size": [513],
113
+ "colorMode": [1537, "color-mode"],
114
+ "hovered": [32],
115
+ "styles": [32]
116
+ }, undefined, {
117
+ "colorMode": ["setColors"]
118
+ }]);
119
+ function defineCustomElement$1() {
120
+ if (typeof customElements === "undefined") {
121
+ return;
122
+ }
123
+ const components = ["cura-tabs", "cura-icon", "cura-label"];
124
+ components.forEach(tagName => { switch (tagName) {
125
+ case "cura-tabs":
126
+ if (!customElements.get(tagName)) {
127
+ customElements.define(tagName, CuraTabs$1);
128
+ }
129
+ break;
130
+ case "cura-icon":
131
+ if (!customElements.get(tagName)) {
132
+ defineCustomElement$3();
133
+ }
134
+ break;
135
+ case "cura-label":
136
+ if (!customElements.get(tagName)) {
137
+ defineCustomElement$2();
138
+ }
139
+ break;
140
+ } });
141
+ }
142
+
143
+ const CuraTabs = CuraTabs$1;
144
+ const defineCustomElement = defineCustomElement$1;
145
+
146
+ export { CuraTabs, defineCustomElement };
147
+
148
+ //# sourceMappingURL=cura-tabs.js.map
@@ -0,0 +1 @@
1
+ {"file":"cura-tabs.js","mappings":";;;;;AAAA,MAAM,WAAW,GAAG,y1DAAy1D,CAAC;AAC92D,uBAAe,WAAW;;MCObA,UAAQ;;;;;;;;wBAGyC,KAAK;wBACL,KAAK;4BACD,IAAI;oBACN,OAAO;yBACC,OAAO;uBAE1D,KAAK;sBACkB,EAAE;;IAK5C,SAAS;QACP,MAAM,MAAM,GAAG;YACb,EAAE,IAAI,EAAE,6BAA6B,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,KAAK,OAAO,GAAG,cAAc,GAAG,iBAAiB,EAAE;YA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Q,EAAE;YACjB,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,OAAO;SACR;QAED,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;KAC1C;IAED,MAAM;QACJ,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC;QACjE,MAAM,UAAU,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC9C,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAE3B,QACE,EAAC,IAAI,qDAAC,IAAI,EAAC,QAAQ,kBAAe,IAAI,CAAC,QAAQ,mBAAiB,IAAI,CAAC,QAAQ,IAC3E,+DACE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,YAAY,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAC9C,YAAY,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,IAE7C,IAAI,CAAC,OAAO,EAAE,EACf,mEAAY,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAC,GAAG,EAAC,WAAW,EAAC,GAAG,IAC5E,8DAAa,CACF,CACN,CACJ,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CuraTabs"],"sources":["src/components/tabs/cura-tabs/cura-tabs.scss?tag=cura-tabs&encapsulation=shadow","src/components/tabs/cura-tabs/cura-tabs.tsx"],"sourcesContent":["@import '../../../scss/mixins/spacing.scss';\n@import '../../../scss/mixins/buttons.scss';\n\n$button-sizes: (\n small: $spacing-mini $spacing-mini,\n medium: $spacing-xxxs $spacing-xxxs,\n large: $spacing-xxxs $spacing-xxs,\n);\n\n:host {\n button,\n a {\n @include button-element() {\n background-color: transparent;\n box-sizing: border-box;\n border: none;\n\n min-width: 120px;\n width: fit-content;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n border-radius: 4px 4px 0 0;\n\n &.border-bottom {\n border-bottom: 1px solid var(--border-bottom-color);\n }\n\n &:not(.disabled, .selected):hover {\n background-color: var(--background-color-hover);\n\n &.light {\n border-bottom-color: var(--primary-dark);\n }\n &.dark {\n border-bottom-color: var(--neutral-purewhite);\n }\n }\n\n @each $size, $padding in $button-sizes {\n &.#{$size} {\n padding: $padding;\n }\n }\n\n &:focus {\n border: 2px solid var(--primary-light);\n }\n\n cura-icon {\n margin-right: #{$spacing-mini};\n }\n\n @include button-selected() {\n background-color: var(--background-color-selected);\n\n &.disabled {\n background-color: var(--background-disabled-selected);\n }\n }\n\n &.disabled {\n cursor: not-allowed;\n }\n }\n }\n}\n","import { Component, Event, EventEmitter, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { labelSizes } from '../cura-tabs.definitions';\n\n@Component({\n tag: 'cura-tabs',\n styleUrl: 'cura-tabs.scss',\n shadow: true,\n})\nexport class CuraTabs {\n @Prop({ reflect: true }) name: string;\n @Prop({ reflect: true }) iconName: string;\n @Prop({ reflect: true, mutable: true }) selected: boolean = false;\n @Prop({ reflect: true, mutable: true }) disabled: boolean = false;\n @Prop({ reflect: true, mutable: true }) borderBottom: boolean = true;\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'large';\n @Prop({ reflect: true, mutable: true }) colorMode: 'dark' | 'light' = 'light';\n\n @State() hovered = false;\n @State() styles: Record<string, string> = {};\n\n @Event() tabSelect: EventEmitter<{ name: string }>;\n\n @Watch('colorMode')\n setColors() {\n const colors = [\n { name: '--background-color-selected', theme: this.colorMode === 'light' ? 'primary-base' : 'primary-lighter' },\n { name: '--background-color-hover', theme: this.colorMode === 'light' ? 'primary-lighter' : null },\n {\n name: '--background-disabled-selected',\n theme: this.colorMode === 'light' ? 'neutral-pale' : 'neutral-black',\n },\n {\n name: '--border-bottom-color',\n theme: this.colorMode === 'light' ? 'neutral-base' : 'primary',\n },\n ];\n\n colors.forEach(c => {\n if (c.theme) this.styles[c.name] = window.CuraAPI.theme.colors.getColor(c.theme);\n });\n\n this.styles = { ...this.styles };\n }\n\n computeContentColor(): string {\n if (this.disabled) return 'neutral-dark';\n\n if (this.colorMode === 'dark') {\n if (this.hovered && !this.selected) {\n return 'neutral-purewhite';\n }\n return this.selected ? 'neutral-black' : 'primary-lighter';\n }\n\n return this.selected ? 'neutral-purewhite' : 'primary-dark';\n }\n\n private updateDynamicStyles() {\n if (this.colorMode === 'dark' && this.hovered && !this.selected) {\n this.styles = {\n ...this.styles,\n '--border-bottom-color': window.CuraAPI.theme.colors.getColor('neutral-purewhite'),\n };\n }\n }\n\n getIcon() {\n if (!this.iconName) return '';\n const iconSize = this.size === 'large' ? 20 : 16;\n const iconColor = this.computeContentColor();\n\n return <cura-icon name={this.iconName} size={iconSize} color={iconColor}></cura-icon>;\n }\n\n getClasses() {\n return {\n [this.size]: true,\n [this.colorMode]: true,\n 'selected': this.selected,\n 'disabled': this.disabled,\n 'border-bottom': this.borderBottom,\n };\n }\n\n connectedCallback() {\n this.styles = {\n ...this.styles,\n '--primary-dark': window.CuraAPI.theme.colors.getColor('primary-dark'),\n '--neutral-purewhite': window.CuraAPI.theme.colors.getColor('neutral-purewhite'),\n '--base-spacing': window.CuraAPI.theme.spacing.getSpacing(),\n };\n\n this.setColors();\n }\n\n handleMouseEnter() {\n if (this.disabled) return;\n this.hovered = true;\n }\n\n handleMouseLeave() {\n this.hovered = false;\n }\n\n handleClick(e: Event) {\n if (this.disabled) {\n e.preventDefault();\n return;\n }\n\n this.selected = !this.selected;\n this.tabSelect.emit({ name: this.name });\n }\n\n render() {\n const labelSize = labelSizes[this.size] || labelSizes['default'];\n const labelColor = this.computeContentColor();\n this.updateDynamicStyles();\n\n return (\n <Host role=\"button\" aria-pressed={this.selected} aria-disabled={this.disabled}>\n <button\n class={this.getClasses()}\n style={this.styles}\n onClick={e => this.handleClick(e)}\n disabled={this.disabled}\n onMouseEnter={this.handleMouseEnter.bind(this)}\n onMouseLeave={this.handleMouseLeave.bind(this)}\n >\n {this.getIcon()}\n <cura-label size={labelSize} color={labelColor} lineHeight=\"0\" marginBlock=\"0\">\n <slot></slot>\n </cura-label>\n </button>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -37,6 +37,10 @@ import { CuraSelectOption } from './cura-select-option.js';
37
37
  import { CuraStepper } from './cura-stepper.js';
38
38
  import { CuraStepperItem } from './cura-stepper-item.js';
39
39
  import { CuraSwitch } from './cura-switch.js';
40
+ import { CuraTabs } from './cura-tabs.js';
41
+ import { CuraTabsButton } from './cura-tabs-button.js';
42
+ import { CuraTabsGroup } from './cura-tabs-group.js';
43
+ import { CuraTabsTransparent } from './cura-tabs-transparent.js';
40
44
  import { CuraToast } from './cura-toast.js';
41
45
  import { CuraTooltip } from './cura-tooltip.js';
42
46
  export { getAssetPath, setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
@@ -216,6 +220,36 @@ const ThemeRichet = Object.assign(Object.assign({}, ThemeDefault), {
216
220
  }
217
221
  } });
218
222
 
223
+ /**
224
+ * Perinatal temporary Theme
225
+ */
226
+ const ThemePerinatalTemporary = Object.assign(Object.assign({}, ThemeDefault), {
227
+ /* Custom */
228
+ /* Colors */
229
+ color: {
230
+ primary: {
231
+ '100': '239,226,228',
232
+ '300': '226,196,200',
233
+ '500': '199,134,141',
234
+ '700': '175,91,109',
235
+ '900': '147,58,77'
236
+ },
237
+ secondary: {
238
+ '100': '233,226,220',
239
+ '300': '211,196,186',
240
+ '500': '189,167,151',
241
+ '700': '95,84,76',
242
+ '900': '38,33,30'
243
+ },
244
+ accent: {
245
+ '100': '219,189,196',
246
+ '300': '183,124,136',
247
+ '500': '147,58,77',
248
+ '700': '74,29,39',
249
+ '900': '29,12,15'
250
+ }
251
+ } });
252
+
219
253
  /**
220
254
  * Legacy Default Theme
221
255
  */
@@ -267,6 +301,7 @@ const ThemePresets = {
267
301
  'maternidade': ThemeMaternity,
268
302
  'oncologia': ThemeOncology,
269
303
  'richet': ThemeRichet,
304
+ 'perinatalTemp': ThemePerinatalTemporary,
270
305
  'legacyDefault': ThemeLegacyDefault
271
306
  };
272
307
 
@@ -605,6 +640,10 @@ const defineCustomElements = (opts) => {
605
640
  CuraStepper,
606
641
  CuraStepperItem,
607
642
  CuraSwitch,
643
+ CuraTabs,
644
+ CuraTabsButton,
645
+ CuraTabsGroup,
646
+ CuraTabsTransparent,
608
647
  CuraToast,
609
648
  CuraTooltip,
610
649
  ].forEach(cmp => {