@rededor/cura 1.0.0-alpha.1 → 1.0.0-alpha.2

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 (177) hide show
  1. package/dist/cjs/cura-accordion_9.cjs.entry.js +6 -6
  2. package/dist/cjs/cura-accordion_9.cjs.entry.js.map +1 -1
  3. package/dist/cjs/cura-button-outline.cjs.entry.js +2 -2
  4. package/dist/cjs/cura-button-outline.cjs.entry.js.map +1 -1
  5. package/dist/cjs/cura-button-select.cjs.entry.js +2 -2
  6. package/dist/cjs/cura-button-select.cjs.entry.js.map +1 -1
  7. package/dist/cjs/cura-button-transparent_2.cjs.entry.js +2 -2
  8. package/dist/cjs/cura-button-transparent_2.cjs.entry.js.map +1 -1
  9. package/dist/cjs/cura-checkbox.cjs.entry.js +1 -1
  10. package/dist/cjs/cura-display.cjs.entry.js +1 -1
  11. package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +1 -1
  12. package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +16 -8
  13. package/dist/cjs/cura-dropdown-search-option.cjs.entry.js.map +1 -1
  14. package/dist/cjs/cura-dropdown-search.cjs.entry.js +19 -11
  15. package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -1
  16. package/dist/cjs/cura-loader-bar.cjs.entry.js +46 -0
  17. package/dist/cjs/cura-loader-bar.cjs.entry.js.map +1 -0
  18. package/dist/cjs/cura-radio.cjs.entry.js +1 -1
  19. package/dist/cjs/cura-select_2.cjs.entry.js +4 -4
  20. package/dist/cjs/cura-switch.cjs.entry.js +1 -1
  21. package/dist/cjs/cura-toast.cjs.entry.js +106 -0
  22. package/dist/cjs/cura-toast.cjs.entry.js.map +1 -0
  23. package/dist/cjs/cura.cjs.js +1 -1
  24. package/dist/cjs/loader.cjs.js +1 -1
  25. package/dist/collection/collection-manifest.json +2 -0
  26. package/dist/collection/components/buttons/cura-button/cura-button.js +6 -6
  27. package/dist/collection/components/buttons/cura-button/cura-button.js.map +1 -1
  28. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +6 -6
  29. package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js.map +1 -1
  30. package/dist/collection/components/buttons/cura-button-select/cura-button-select.js +6 -6
  31. package/dist/collection/components/buttons/cura-button-select/cura-button-select.js.map +1 -1
  32. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +6 -6
  33. package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js.map +1 -1
  34. package/dist/collection/components/cura-toast/cura-toast.css +161 -0
  35. package/dist/collection/components/cura-toast/cura-toast.js +261 -0
  36. package/dist/collection/components/cura-toast/cura-toast.js.map +1 -0
  37. package/dist/collection/components/cura-toast/cura-toast.stories.js +149 -0
  38. package/dist/collection/components/cura-toast/cura-toast.stories.js.map +1 -0
  39. package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +1 -1
  40. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.css +4 -1
  41. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +33 -7
  42. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js.map +1 -1
  43. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js +10 -1
  44. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js.map +1 -1
  45. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js +1 -1
  46. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.css +2 -2
  47. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +36 -10
  48. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
  49. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js +15 -3
  50. package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js.map +1 -1
  51. package/dist/collection/components/forms/cura-label/cura-label.js +1 -1
  52. package/dist/collection/components/forms/cura-radio/cura-radio.js +1 -1
  53. package/dist/collection/components/forms/cura-select/cura-select.js +3 -3
  54. package/dist/collection/components/forms/cura-select-options/cura-select-option.js +1 -1
  55. package/dist/collection/components/forms/cura-switch/cura-switch.js +1 -1
  56. package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.css +21 -0
  57. package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.js +95 -0
  58. package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.js.map +1 -0
  59. package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.stories.js +54 -0
  60. package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.stories.js.map +1 -0
  61. package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +1 -1
  62. package/dist/collection/components/text/cura-display/cura-display.js +1 -1
  63. package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
  64. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
  65. package/dist/components/cura-button-outline.js +3 -3
  66. package/dist/components/cura-button-outline.js.map +1 -1
  67. package/dist/components/cura-button-select.js +3 -3
  68. package/dist/components/cura-button-select.js.map +1 -1
  69. package/dist/components/cura-button-transparent2.js +3 -3
  70. package/dist/components/cura-button-transparent2.js.map +1 -1
  71. package/dist/components/cura-button.js +3 -3
  72. package/dist/components/cura-button.js.map +1 -1
  73. package/dist/components/cura-checkbox.js +1 -1
  74. package/dist/components/cura-display.js +1 -1
  75. package/dist/components/cura-dropdown-search-option-title.js +1 -1
  76. package/dist/components/cura-dropdown-search-option.js +17 -8
  77. package/dist/components/cura-dropdown-search-option.js.map +1 -1
  78. package/dist/components/cura-dropdown-search.js +20 -11
  79. package/dist/components/cura-dropdown-search.js.map +1 -1
  80. package/dist/components/cura-heading2.js +1 -1
  81. package/dist/components/cura-label2.js +1 -1
  82. package/dist/components/cura-loader-bar.d.ts +11 -0
  83. package/dist/components/cura-loader-bar.js +8 -0
  84. package/dist/components/cura-loader-bar.js.map +1 -0
  85. package/dist/components/cura-loader-bar2.js +64 -0
  86. package/dist/components/cura-loader-bar2.js.map +1 -0
  87. package/dist/components/cura-loader-circle2.js +1 -1
  88. package/dist/components/cura-paragraph2.js +1 -1
  89. package/dist/components/cura-radio.js +1 -1
  90. package/dist/components/cura-select-option2.js +1 -1
  91. package/dist/components/cura-select2.js +3 -3
  92. package/dist/components/cura-switch.js +1 -1
  93. package/dist/components/cura-toast.d.ts +11 -0
  94. package/dist/components/cura-toast.js +157 -0
  95. package/dist/components/cura-toast.js.map +1 -0
  96. package/dist/components/index.js +4 -0
  97. package/dist/components/index.js.map +1 -1
  98. package/dist/cura/cura.esm.js +1 -1
  99. package/dist/cura/cura.esm.js.map +1 -1
  100. package/dist/cura/p-039b3701.entry.js +2 -0
  101. package/dist/cura/p-039b3701.entry.js.map +1 -0
  102. package/dist/cura/p-29790bb5.entry.js +2 -0
  103. package/dist/cura/p-29790bb5.entry.js.map +1 -0
  104. package/dist/cura/p-4eaeb590.entry.js +2 -0
  105. package/dist/cura/p-4eaeb590.entry.js.map +1 -0
  106. package/dist/cura/p-5e5f37c7.entry.js +2 -0
  107. package/dist/cura/p-5e5f37c7.entry.js.map +1 -0
  108. package/dist/cura/{p-ba2e7222.entry.js → p-5fcfbf32.entry.js} +2 -2
  109. package/dist/cura/{p-3c39a9d8.entry.js → p-67e34464.entry.js} +2 -2
  110. package/dist/cura/{p-5466758a.entry.js → p-8433fec9.entry.js} +2 -2
  111. package/dist/cura/{p-3b4bf71e.entry.js → p-86b6e638.entry.js} +2 -2
  112. package/dist/cura/p-86b6e638.entry.js.map +1 -0
  113. package/dist/cura/p-a5e53dd4.entry.js +2 -0
  114. package/dist/cura/{p-ced36448.entry.js.map → p-a5e53dd4.entry.js.map} +1 -1
  115. package/dist/cura/{p-578c74a4.entry.js → p-a9dad622.entry.js} +2 -2
  116. package/dist/cura/p-af2036a7.entry.js +2 -0
  117. package/dist/cura/p-b1148bb2.entry.js +2 -0
  118. package/dist/cura/p-b1148bb2.entry.js.map +1 -0
  119. package/dist/cura/p-e1253a09.entry.js +2 -0
  120. package/dist/cura/p-e1253a09.entry.js.map +1 -0
  121. package/dist/cura/{p-17a878d4.entry.js → p-e622006c.entry.js} +2 -2
  122. package/dist/cura/p-e622006c.entry.js.map +1 -0
  123. package/dist/esm/cura-accordion_9.entry.js +6 -6
  124. package/dist/esm/cura-accordion_9.entry.js.map +1 -1
  125. package/dist/esm/cura-button-outline.entry.js +2 -2
  126. package/dist/esm/cura-button-outline.entry.js.map +1 -1
  127. package/dist/esm/cura-button-select.entry.js +2 -2
  128. package/dist/esm/cura-button-select.entry.js.map +1 -1
  129. package/dist/esm/cura-button-transparent_2.entry.js +2 -2
  130. package/dist/esm/cura-button-transparent_2.entry.js.map +1 -1
  131. package/dist/esm/cura-checkbox.entry.js +1 -1
  132. package/dist/esm/cura-display.entry.js +1 -1
  133. package/dist/esm/cura-dropdown-search-option-title.entry.js +1 -1
  134. package/dist/esm/cura-dropdown-search-option.entry.js +16 -8
  135. package/dist/esm/cura-dropdown-search-option.entry.js.map +1 -1
  136. package/dist/esm/cura-dropdown-search.entry.js +19 -11
  137. package/dist/esm/cura-dropdown-search.entry.js.map +1 -1
  138. package/dist/esm/cura-loader-bar.entry.js +42 -0
  139. package/dist/esm/cura-loader-bar.entry.js.map +1 -0
  140. package/dist/esm/cura-radio.entry.js +1 -1
  141. package/dist/esm/cura-select_2.entry.js +4 -4
  142. package/dist/esm/cura-switch.entry.js +1 -1
  143. package/dist/esm/cura-toast.entry.js +102 -0
  144. package/dist/esm/cura-toast.entry.js.map +1 -0
  145. package/dist/esm/cura.js +1 -1
  146. package/dist/esm/loader.js +1 -1
  147. package/dist/types/components/buttons/cura-button/cura-button.d.ts +1 -1
  148. package/dist/types/components/buttons/cura-button-outline/cura-button-outline.d.ts +1 -1
  149. package/dist/types/components/buttons/cura-button-select/cura-button-select.d.ts +1 -1
  150. package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.d.ts +1 -1
  151. package/dist/types/components/cura-toast/cura-toast.d.ts +26 -0
  152. package/dist/types/components/cura-toast/cura-toast.stories.d.ts +119 -0
  153. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.d.ts +4 -0
  154. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.d.ts +11 -0
  155. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +8 -0
  156. package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.stories.d.ts +21 -2
  157. package/dist/types/components/loaders/cura-loader-bar/cura-loader-bar.d.ts +12 -0
  158. package/dist/types/components/loaders/cura-loader-bar/cura-loader-bar.stories.d.ts +39 -0
  159. package/dist/types/components.d.ts +84 -8
  160. package/package.json +2 -2
  161. package/dist/cura/p-17a878d4.entry.js.map +0 -1
  162. package/dist/cura/p-251bd980.entry.js +0 -2
  163. package/dist/cura/p-251bd980.entry.js.map +0 -1
  164. package/dist/cura/p-31ae34e3.entry.js +0 -2
  165. package/dist/cura/p-31ae34e3.entry.js.map +0 -1
  166. package/dist/cura/p-3b4bf71e.entry.js.map +0 -1
  167. package/dist/cura/p-61d20270.entry.js +0 -2
  168. package/dist/cura/p-93389727.entry.js +0 -2
  169. package/dist/cura/p-93389727.entry.js.map +0 -1
  170. package/dist/cura/p-b3a50bcf.entry.js +0 -2
  171. package/dist/cura/p-b3a50bcf.entry.js.map +0 -1
  172. package/dist/cura/p-ced36448.entry.js +0 -2
  173. /package/dist/cura/{p-ba2e7222.entry.js.map → p-5fcfbf32.entry.js.map} +0 -0
  174. /package/dist/cura/{p-3c39a9d8.entry.js.map → p-67e34464.entry.js.map} +0 -0
  175. /package/dist/cura/{p-5466758a.entry.js.map → p-8433fec9.entry.js.map} +0 -0
  176. /package/dist/cura/{p-578c74a4.entry.js.map → p-a9dad622.entry.js.map} +0 -0
  177. /package/dist/cura/{p-61d20270.entry.js.map → p-af2036a7.entry.js.map} +0 -0
@@ -0,0 +1,161 @@
1
+ /* Breakpoints variables */
2
+ /**
3
+ * Responsive media for mobile (small) only.
4
+ * Use: @include mobile-only() { ... }
5
+ */
6
+ /**
7
+ * Responsive media for medium only.
8
+ * Use: @include medium-only() { ... }
9
+ */
10
+ /**
11
+ * Responsive media for large only.
12
+ * Use: @include large-only() { ... }
13
+ */
14
+ /**
15
+ * Responsive media for xlarge only.
16
+ * Use: @include xlarge-only() { ... }
17
+ */
18
+ /**
19
+ * Responsive media for medium to large.
20
+ * Use: @include medium-large() { ... }
21
+ */
22
+ /**
23
+ * Responsive media for large and up.
24
+ * Use: @include large-up() { ... }
25
+ */
26
+ /**
27
+ * Global Shadow Level Definitions.
28
+ * Required CSS Properties with respective opacities:
29
+ * --neutral-black,
30
+ * --neutral-purewhite,
31
+ * --accent-base
32
+ * --primary-base
33
+ */
34
+ /**
35
+ * Shadow Level base definitions.
36
+ * Required CSS Properties: --neutral-purewhite opacity: 0.2
37
+ * Use: @include shadow-level1(){ ... }
38
+ */
39
+ /**
40
+ * Shadow Level base definitions.
41
+ * Required CSS Properties: --neutral-black opacity: 0.16
42
+ * Use: @include shadow-level2(--neutral-black-shadow){ ... }
43
+ */
44
+ /**
45
+ * Shadow Level base definitions.
46
+ * Required CSS Properties: --neutral-black opacity: 0.16
47
+ * Use: @include shadow-level3(--neutral-black-shadow){ ... }
48
+ */
49
+ /**
50
+ * Shadow Level base definitions.
51
+ * Required CSS Properties: --neutral-black opacity: 0.12
52
+ * Use: @include shadow-level4(){ ... }
53
+ */
54
+ /**
55
+ * Shadow Level base definitions.
56
+ * Required CSS Properties: --neutral-black opacity: 0.8
57
+ * Use: @include shadow-level5(){ ... }
58
+ */
59
+ /**
60
+ * Shadow Level base definitions.
61
+ * Required CSS Properties: --accent-base opacity: 0.2
62
+ * Use: @include shadow-level5-accent(){ ... }
63
+ */
64
+ /**
65
+ * Shadow Level base definitions.
66
+ * Required CSS Properties: --primary-base opacity: 0.16
67
+ * Use: @include shadow-level3-primary(){ ... }
68
+ */
69
+ :host {
70
+ display: block;
71
+ box-sizing: border-box;
72
+ }
73
+ :host .container {
74
+ position: fixed;
75
+ display: flex;
76
+ box-sizing: border-box;
77
+ min-width: 328px;
78
+ height: fit-content;
79
+ padding: 16px;
80
+ border: 1px solid var(--color-base);
81
+ border-radius: 12px;
82
+ background-color: var(--neutral-purewhite);
83
+ overflow: hidden;
84
+ box-shadow: 0px 8px 16px 0px var(--neutral-black-shadow-4, rgba(38, 38, 38, 0.12));
85
+ }
86
+ :host .container.loader {
87
+ padding: 16px 16px 20px;
88
+ }
89
+ :host .container.top {
90
+ top: 24px;
91
+ }
92
+ :host .container.top.center {
93
+ top: -100%;
94
+ left: 50%;
95
+ transform: translateX(-50%);
96
+ opacity: 0;
97
+ transition: opacity 0.5s ease-in-out, top 0.5s ease-in-out;
98
+ }
99
+ :host .container.top.center.active {
100
+ top: 24px;
101
+ opacity: 1;
102
+ }
103
+ :host .container.bottom {
104
+ bottom: 24px;
105
+ }
106
+ :host .container.bottom.center {
107
+ bottom: -100%;
108
+ left: 50%;
109
+ transform: translateX(-50%);
110
+ opacity: 0;
111
+ transition: opacity 0.5s ease-in-out, bottom 0.5s ease-in-out;
112
+ }
113
+ :host .container.bottom.center.active {
114
+ bottom: 24px;
115
+ opacity: 1;
116
+ }
117
+ :host .container.left {
118
+ left: -100%;
119
+ opacity: 0;
120
+ transition: opacity 0.5s ease-in-out, left 0.5s ease-in-out;
121
+ }
122
+ @media (max-width: 768px) {
123
+ :host .container.left {
124
+ right: unset;
125
+ left: 50%;
126
+ transform: translateX(-50%);
127
+ }
128
+ }
129
+ :host .container.left.active {
130
+ left: 24px;
131
+ opacity: 1;
132
+ }
133
+ :host .container.right {
134
+ right: -100%;
135
+ opacity: 0;
136
+ transition: opacity 0.5s ease-in-out, right 0.5s ease-in-out;
137
+ }
138
+ @media (max-width: 768px) {
139
+ :host .container.right {
140
+ right: unset;
141
+ left: 50%;
142
+ transform: translateX(-50%);
143
+ }
144
+ }
145
+ :host .container.right.active {
146
+ right: 24px;
147
+ opacity: 1;
148
+ }
149
+ :host .container .content {
150
+ flex: 1 1 0;
151
+ display: flex;
152
+ flex-direction: column;
153
+ gap: 4px;
154
+ }
155
+ :host .container .default-icon {
156
+ margin-right: 12px;
157
+ }
158
+ :host .container .close-icon {
159
+ margin-left: 12px;
160
+ cursor: pointer;
161
+ }
@@ -0,0 +1,261 @@
1
+ import { Host, h } from "@stencil/core";
2
+ export class CuraToast {
3
+ constructor() {
4
+ this.handleClose = () => {
5
+ this.close.emit();
6
+ this.closeContainer();
7
+ };
8
+ this.type = 'info';
9
+ this.position = 'top-right';
10
+ this.icon = undefined;
11
+ this.label = undefined;
12
+ this.closeButton = true;
13
+ this.loader = true;
14
+ this.autoCloseDelay = 10000;
15
+ this.styles = {};
16
+ this.progress = 0;
17
+ }
18
+ handleChangeType() {
19
+ this.setStyle();
20
+ }
21
+ connectedCallback() {
22
+ this.setStyle();
23
+ }
24
+ render() {
25
+ return (h(Host, { key: '8a49bdd99528c7b50b1b8a0de6ee0d985ffd5a11' }, h("div", { key: '6e560327e729ecb9fc9e6c081cc4d3b1131f892c', class: this.getClasses(), style: this.styles }, h("cura-icon", { key: '25efc30bc808e9f04be780ddf5bdc7edc3e56725', class: "default-icon", name: this.getNameIcon(), size: 16, color: `${this.type}-dark` }), h("div", { key: 'b1cbab08ae6845f8f544d4497b786fdfae645b72', class: "content" }, h("cura-heading", { key: '6d64c4fc8c43862f8fc5dba886b34a904a81208d', level: 4, size: "xsmall", color: `${this.type}-dark`, weight: "bold", "margin-block": "0" }, this.label), h("cura-paragraph", { key: 'fa990a332ca8caf8b110b643b39c44a17bb8de67', color: `${this.type}-darker`, size: "xsmall", marginBlock: "0", lineHeight: "133.33%" }, h("slot", { key: 'ec9ab2abe06b0d67ea71725abe3a02aca1a736c6' })), h("slot", { key: 'dc08874d1145bb7e62cac9081014d17ad0095f53', name: "actions" })), this.closeButton && h("cura-icon", { key: '3f22011909ed7074962a2ccec8ffe05bb9b01feb', class: "close-icon", name: "close", size: 16, color: "error-dark", onClick: this.handleClose }), this.loader && !!this.autoCloseDelay && h("cura-loader-bar", { key: '2e4168859d19170702a690bed3a20d28029cf7dc', color: `${this.type}-base`, progress: this.progress }))));
26
+ }
27
+ componentDidLoad() {
28
+ this.openContainer();
29
+ this.startAnimation();
30
+ }
31
+ setStyle() {
32
+ this.styles = Object.assign(Object.assign({}, this.styles), { '--neutral-purewhite': window.CuraAPI.theme.colors.getColor(`neutral-purewhite`), '--neutral-base': window.CuraAPI.theme.colors.getColor(`neutral-base`, 0.2), '--primary-base': window.CuraAPI.theme.colors.getColor(`primary-base`), '--color-base': window.CuraAPI.theme.colors.getColor(`${this.type}-base`) });
33
+ }
34
+ getClasses() {
35
+ const [firstPosition, secondPosition] = this.position.split('-');
36
+ const classes = {};
37
+ classes['container'] = true;
38
+ classes[firstPosition] = true;
39
+ classes[secondPosition] = true;
40
+ if (this.loader) {
41
+ classes['loader'] = true;
42
+ }
43
+ return classes;
44
+ }
45
+ getNameIcon() {
46
+ const iconMapping = {
47
+ info: 'infoCircle',
48
+ success: 'checkCircle',
49
+ warning: 'alertCircle',
50
+ error: 'alertTriangle',
51
+ };
52
+ return this.icon ? this.icon : iconMapping[this.type];
53
+ }
54
+ openContainer() {
55
+ this.container = this.host.shadowRoot.querySelector('.container');
56
+ this.container.classList.add('active');
57
+ }
58
+ closeContainer() {
59
+ this.container.classList.remove('active');
60
+ setTimeout(() => {
61
+ this.host.remove();
62
+ }, 500);
63
+ }
64
+ startAnimation() {
65
+ if (!!this.autoCloseDelay) {
66
+ if (this.loader) {
67
+ this.progress = 0;
68
+ let intervalId = setInterval(() => {
69
+ if (this.progress >= 100) {
70
+ clearInterval(intervalId);
71
+ this.closeContainer();
72
+ }
73
+ else {
74
+ this.progress++;
75
+ }
76
+ }, this.autoCloseDelay / 100);
77
+ }
78
+ else {
79
+ let intervalId = setInterval(() => {
80
+ clearInterval(intervalId);
81
+ this.closeContainer();
82
+ }, this.autoCloseDelay);
83
+ }
84
+ }
85
+ }
86
+ static get is() { return "cura-toast"; }
87
+ static get encapsulation() { return "shadow"; }
88
+ static get originalStyleUrls() {
89
+ return {
90
+ "$": ["cura-toast.scss"]
91
+ };
92
+ }
93
+ static get styleUrls() {
94
+ return {
95
+ "$": ["cura-toast.css"]
96
+ };
97
+ }
98
+ static get properties() {
99
+ return {
100
+ "type": {
101
+ "type": "string",
102
+ "mutable": false,
103
+ "complexType": {
104
+ "original": "'info' | 'success' | 'warning' | 'error'",
105
+ "resolved": "\"error\" | \"info\" | \"success\" | \"warning\"",
106
+ "references": {}
107
+ },
108
+ "required": false,
109
+ "optional": false,
110
+ "docs": {
111
+ "tags": [],
112
+ "text": ""
113
+ },
114
+ "attribute": "type",
115
+ "reflect": false,
116
+ "defaultValue": "'info'"
117
+ },
118
+ "position": {
119
+ "type": "string",
120
+ "mutable": false,
121
+ "complexType": {
122
+ "original": "'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'",
123
+ "resolved": "\"bottom-center\" | \"bottom-left\" | \"bottom-right\" | \"top-center\" | \"top-left\" | \"top-right\"",
124
+ "references": {}
125
+ },
126
+ "required": false,
127
+ "optional": false,
128
+ "docs": {
129
+ "tags": [],
130
+ "text": ""
131
+ },
132
+ "attribute": "position",
133
+ "reflect": false,
134
+ "defaultValue": "'top-right'"
135
+ },
136
+ "icon": {
137
+ "type": "string",
138
+ "mutable": false,
139
+ "complexType": {
140
+ "original": "string",
141
+ "resolved": "string",
142
+ "references": {}
143
+ },
144
+ "required": false,
145
+ "optional": false,
146
+ "docs": {
147
+ "tags": [],
148
+ "text": ""
149
+ },
150
+ "attribute": "icon",
151
+ "reflect": true
152
+ },
153
+ "label": {
154
+ "type": "string",
155
+ "mutable": false,
156
+ "complexType": {
157
+ "original": "string",
158
+ "resolved": "string",
159
+ "references": {}
160
+ },
161
+ "required": false,
162
+ "optional": false,
163
+ "docs": {
164
+ "tags": [],
165
+ "text": ""
166
+ },
167
+ "attribute": "label",
168
+ "reflect": true
169
+ },
170
+ "closeButton": {
171
+ "type": "boolean",
172
+ "mutable": false,
173
+ "complexType": {
174
+ "original": "boolean",
175
+ "resolved": "boolean",
176
+ "references": {}
177
+ },
178
+ "required": false,
179
+ "optional": false,
180
+ "docs": {
181
+ "tags": [],
182
+ "text": ""
183
+ },
184
+ "attribute": "close-button",
185
+ "reflect": true,
186
+ "defaultValue": "true"
187
+ },
188
+ "loader": {
189
+ "type": "boolean",
190
+ "mutable": false,
191
+ "complexType": {
192
+ "original": "boolean",
193
+ "resolved": "boolean",
194
+ "references": {}
195
+ },
196
+ "required": false,
197
+ "optional": false,
198
+ "docs": {
199
+ "tags": [],
200
+ "text": ""
201
+ },
202
+ "attribute": "loader",
203
+ "reflect": true,
204
+ "defaultValue": "true"
205
+ },
206
+ "autoCloseDelay": {
207
+ "type": "number",
208
+ "mutable": false,
209
+ "complexType": {
210
+ "original": "number",
211
+ "resolved": "number",
212
+ "references": {}
213
+ },
214
+ "required": false,
215
+ "optional": false,
216
+ "docs": {
217
+ "tags": [],
218
+ "text": ""
219
+ },
220
+ "attribute": "auto-close-delay",
221
+ "reflect": true,
222
+ "defaultValue": "10000"
223
+ }
224
+ };
225
+ }
226
+ static get states() {
227
+ return {
228
+ "styles": {},
229
+ "progress": {}
230
+ };
231
+ }
232
+ static get events() {
233
+ return [{
234
+ "method": "close",
235
+ "name": "close",
236
+ "bubbles": true,
237
+ "cancelable": true,
238
+ "composed": true,
239
+ "docs": {
240
+ "tags": [],
241
+ "text": ""
242
+ },
243
+ "complexType": {
244
+ "original": "void",
245
+ "resolved": "void",
246
+ "references": {}
247
+ }
248
+ }];
249
+ }
250
+ static get elementRef() { return "host"; }
251
+ static get watchers() {
252
+ return [{
253
+ "propName": "type",
254
+ "methodName": "handleChangeType"
255
+ }, {
256
+ "propName": "position",
257
+ "methodName": "handleChangeType"
258
+ }];
259
+ }
260
+ }
261
+ //# sourceMappingURL=cura-toast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cura-toast.js","sourceRoot":"","sources":["../../../src/components/cura-toast/cura-toast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAOrG,MAAM,OAAO,SAAS;;QAqGpB,gBAAW,GAAG,GAAG,EAAE;YACjB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAClB,IAAI,CAAC,cAAc,EAAE,CAAC;QACxB,CAAC,CAAC;oBArGuD,MAAM;wBACgD,WAAW;;;2BAGnF,IAAI;sBACT,IAAI;8BACI,KAAK;sBAE7B,EAAE;wBACA,CAAC;;IAMrB,gBAAgB;QACd,IAAI,CAAC,QAAQ,EAAE,CAAC;IAClB,CAAC;IAID,iBAAiB;QACf,IAAI,CAAC,QAAQ,EAAE,CAAC;IAClB,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,4DAAK,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM;gBAC/C,kEAAW,KAAK,EAAC,cAAc,EAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,IAAI,OAAO,GAAc;gBAC5G,4DAAK,KAAK,EAAC,SAAS;oBAClB,qEAAc,KAAK,EAAE,CAAC,EAAE,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,GAAG,IAAI,CAAC,IAAI,OAAO,EAAE,MAAM,EAAC,MAAM,kBAAc,GAAG,IAC7F,IAAI,CAAC,KAAK,CACE;oBACf,uEAAgB,KAAK,EAAE,GAAG,IAAI,CAAC,IAAI,SA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AAG,EAAE,CAAC;wBACzB,aAAa,CAAC,UAAU,CAAC,CAAC;wBAC1B,IAAI,CAAC,cAAc,EAAE,CAAC;oBACxB,CAAC;yBAAM,CAAC;wBACN,IAAI,CAAC,QAAQ,EAAE,CAAC;oBAClB,CAAC;gBACH,CAAC,EAAE,IAAI,CAAC,cAAc,GAAC,GAAG,CAAC,CAAC;YAC9B,CAAC;iBAAM,CAAC;gBACN,IAAI,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE;oBAChC,aAAa,CAAC,UAAU,CAAC,CAAC;oBAC1B,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Prop, Host, h, State, Watch, Event, EventEmitter } from '@stencil/core';\n\n@Component({\n tag: 'cura-toast',\n styleUrl: 'cura-toast.scss',\n shadow: true,\n})\nexport class CuraToast {\n @Element() host: HTMLElement;\n\n @Prop() type: 'info' | 'success' | 'warning' | 'error' = 'info';\n @Prop() position: 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' = 'top-right';\n @Prop({ reflect: true }) icon: string;\n @Prop({ reflect: true }) label: string;\n @Prop({ reflect: true }) closeButton = true;\n @Prop({ reflect: true }) loader = true;\n @Prop({ reflect: true }) autoCloseDelay = 10000;\n \n @State() styles = {};\n @State() progress = 0;\n\n @Event({ eventName: 'close' }) close: EventEmitter<void>;\n\n @Watch('type')\n @Watch('position')\n handleChangeType() {\n this.setStyle();\n }\n\n container: HTMLElement;\n\n connectedCallback() {\n this.setStyle();\n }\n\n render() {\n return (\n <Host>\n <div class={this.getClasses()} style={this.styles}>\n <cura-icon class=\"default-icon\" name={this.getNameIcon()} size={16} color={`${this.type}-dark`}></cura-icon>\n <div class=\"content\">\n <cura-heading level={4} size=\"xsmall\" color={`${this.type}-dark`} weight=\"bold\" margin-block=\"0\">\n {this.label}\n </cura-heading>\n <cura-paragraph color={`${this.type}-darker`} size=\"xsmall\" marginBlock=\"0\" lineHeight=\"133.33%\">\n <slot></slot>\n </cura-paragraph>\n <slot name=\"actions\"></slot>\n </div>\n {this.closeButton && <cura-icon class=\"close-icon\" name=\"close\" size={16} color=\"error-dark\" onClick={this.handleClose}></cura-icon>}\n {this.loader && !!this.autoCloseDelay && <cura-loader-bar color={`${this.type}-base`} progress={this.progress}></cura-loader-bar>}\n </div>\n </Host>\n );\n }\n\n componentDidLoad() {\n this.openContainer();\n this.startAnimation();\n }\n\n setStyle() {\n this.styles = {\n ...this.styles,\n '--neutral-purewhite': window.CuraAPI.theme.colors.getColor(`neutral-purewhite`),\n '--neutral-base': window.CuraAPI.theme.colors.getColor(`neutral-base`, 0.2),\n '--primary-base': window.CuraAPI.theme.colors.getColor(`primary-base`),\n '--color-base': window.CuraAPI.theme.colors.getColor(`${this.type}-base`)\n }\n }\n\n getClasses() {\n const [firstPosition, secondPosition] = this.position.split('-');\n const classes = {};\n\n classes['container'] = true;\n classes[firstPosition] = true;\n classes[secondPosition] = true;\n\n if (this.loader) {\n classes['loader'] = true;\n }\n\n return classes;\n }\n\n getNameIcon() {\n const iconMapping = {\n info: 'infoCircle',\n success: 'checkCircle',\n warning: 'alertCircle',\n error: 'alertTriangle',\n };\n return this.icon ? this.icon : iconMapping[this.type];\n }\n\n openContainer() {\n this.container = this.host.shadowRoot.querySelector('.container') as HTMLElement;\n this.container.classList.add('active');\n }\n\n closeContainer() {\n this.container.classList.remove('active');\n setTimeout(() => {\n this.host.remove();\n }, 500);\n }\n\n handleClose = () => {\n this.close.emit();\n this.closeContainer();\n };\n\n startAnimation() {\n if (!!this.autoCloseDelay) {\n if (this.loader) {\n this.progress = 0;\n let intervalId = setInterval(() => {\n if (this.progress >= 100) {\n clearInterval(intervalId);\n this.closeContainer();\n } else {\n this.progress++;\n }\n }, this.autoCloseDelay/100);\n } else {\n let intervalId = setInterval(() => {\n clearInterval(intervalId);\n this.closeContainer();\n }, this.autoCloseDelay);\n }\n }\n }\n}\n"]}
@@ -0,0 +1,149 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s)
4
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import iconNames from "../../assets/icons/iconset-default-list";
14
+ const renderCuraToast = (args) => {
15
+ return `<div style="width: 100%; height: 250px;">
16
+ <cura-toast
17
+ ${args.label ? `label="${args.label}"` : ''}
18
+ ${args.type && args.type !== 'info' ? `type="${args.type}"` : ''}
19
+ ${args.position && args.position !== 'top-right' ? `position="${args.position}"` : ''}
20
+ ${args.closeButton !== true ? `close-button="${args.closeButton}"` : ''}
21
+ ${args.loader !== true ? `loader="${args.loader}"` : ''}
22
+ ${args.icon ? `icon="${args.icon}"` : ''}
23
+ ${args.autoCloseDelay !== 10000 ? `auto-close-delay="${args.autoCloseDelay}"` : ''}>
24
+ ${args.content}
25
+ ${args.actions}
26
+ </cura-toast>
27
+ </div>`;
28
+ };
29
+ export default {
30
+ title: 'Componentes/Feedback/Toast',
31
+ tags: ['autodocs'],
32
+ render: (_a) => {
33
+ var args = __rest(_a, []);
34
+ return renderCuraToast(args);
35
+ },
36
+ argTypes: {
37
+ label: {
38
+ control: 'text',
39
+ description: 'Título do toast.',
40
+ table: {
41
+ category: 'Properties',
42
+ },
43
+ name: 'label',
44
+ },
45
+ type: {
46
+ control: { type: 'select' },
47
+ options: ['', 'info', 'success', 'warning', 'error'],
48
+ description: 'Tipos de alertas disponíveis: <b>info</b>, <b>success</b>, <b>warning</b>, <b>error</b>.',
49
+ table: {
50
+ category: 'Properties',
51
+ defaultValue: { summary: 'info' },
52
+ },
53
+ name: 'type',
54
+ },
55
+ position: {
56
+ control: { type: 'select' },
57
+ options: ['', 'top-left', 'top-center', 'top-right', 'bottom-left', 'bottom-center', 'bottom-right'],
58
+ description: 'Posição do Toast na tela',
59
+ table: {
60
+ category: 'Properties',
61
+ defaultValue: { summary: 'top-right' },
62
+ },
63
+ name: 'position',
64
+ },
65
+ closeButton: {
66
+ control: 'boolean',
67
+ description: 'Define se o alerta pode ser fechado.',
68
+ table: {
69
+ category: 'Properties',
70
+ defaultValue: { summary: true },
71
+ },
72
+ },
73
+ loader: {
74
+ control: 'boolean',
75
+ description: 'Define se mostra ou não a barra de progresso',
76
+ table: {
77
+ category: 'Properties',
78
+ defaultValue: { summary: true },
79
+ },
80
+ },
81
+ icon: {
82
+ control: { type: 'select' },
83
+ options: ['', ...iconNames],
84
+ description: 'Nome do ícone personalizado.',
85
+ table: {
86
+ category: 'Icons',
87
+ defaultValue: { summary: 'De acordo com o tipo de alert.' },
88
+ },
89
+ name: 'icon'
90
+ },
91
+ autoCloseDelay: {
92
+ control: 'number',
93
+ description: 'Define a quantidade de tempo, em milisegundos, que o toast ficará aberto.',
94
+ table: {
95
+ category: 'Properties',
96
+ defaultValue: { summary: 10000 },
97
+ },
98
+ },
99
+ content: {
100
+ control: 'text',
101
+ description: 'Conteúdo do texto principal do toast. É projetado automaticamente dentro do slot padrão.',
102
+ defaultValue: '',
103
+ table: {
104
+ category: 'Slot',
105
+ },
106
+ },
107
+ actions: {
108
+ control: 'text',
109
+ description: 'Conteúdo da ações de links e botões',
110
+ defaultValue: '',
111
+ table: {
112
+ category: 'Slot',
113
+ },
114
+ }
115
+ },
116
+ };
117
+ export const Toast = {
118
+ args: {
119
+ label: 'Título do toast',
120
+ type: 'info',
121
+ position: 'top-right',
122
+ closeButton: true,
123
+ loader: true,
124
+ icon: '',
125
+ autoCloseDelay: 10000,
126
+ content: 'Texto explicativo para o toast.',
127
+ actions: `<div slot="actions">
128
+ <cura-paragraph spot-color="primary" size="xsmall" margin-block="8px 0">
129
+ <a href="http://www.google.com" target="_blank" rel="noopener noreferrer">Link</a>
130
+ <a href="http://www.google.com" target="_blank" rel="noopener noreferrer" style="margin-left: 8px">Link</a>
131
+ </cura-paragraph>
132
+ <div style="display: flex; justify-content: space-between; gap: 8px; margin-top: 12px;">
133
+ <cura-button-outline
134
+ size="small"
135
+ color="primary"
136
+ style="width: 100%;">
137
+ Button
138
+ </cura-button-outline>
139
+ <cura-button
140
+ size="small"
141
+ color="accent"
142
+ style="width: 100%;">
143
+ Button
144
+ </cura-button>
145
+ </div>
146
+ </div>`
147
+ },
148
+ };
149
+ //# sourceMappingURL=cura-toast.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cura-toast.stories.js","sourceRoot":"","sources":["../../../src/components/cura-toast/cura-toast.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,SAAS,MAAM,yCAAyC,CAAC;AAEhE,MAAM,eAAe,GAAG,CAAC,IAAS,EAAE,EAAE;IACpC,OAAO;;MAEH,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE;MACzC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE;MAC9D,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE;MACnF,IAA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M;YACf,WAAW,EAAE,qCAAqC;YAClD,YAAY,EAAE,EAAE;YAChB,KAAK,EAAE;gBACL,QAAQ,EAAE,MAAM;aACjB;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,IAAI,EAAE;QACJ,KAAK,EAAE,iBAAiB;QACxB,IAAI,EAAE,MAAM;QACd,QAAQ,EAAE,WAAW;QACnB,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,IAAI;QACZ,IAAI,EAAE,EAAE;QACV,cAAc,EAAE,KAAK;QACnB,OAAO,EAAE,iCAAiC;QAC1C,OAAO,EAAE;;;;;;;;;;;;;;;;;;;qBAmBQ;KAClB;CACF,CAAC","sourcesContent":["import iconNames from '../../assets/icons/iconset-default-list';\n\nconst renderCuraToast = (args: any) => {\n return `<div style=\"width: 100%; height: 250px;\">\n <cura-toast\n ${args.label ? `label=\"${args.label}\"` : ''}\n ${args.type && args.type !== 'info' ? `type=\"${args.type}\"` : ''}\n ${args.position && args.position !== 'top-right' ? `position=\"${args.position}\"` : ''}\n ${args.closeButton !== true ? `close-button=\"${args.closeButton}\"` : ''}\n ${args.loader !== true ? `loader=\"${args.loader}\"` : ''}\n ${args.icon ? `icon=\"${args.icon}\"` : ''}\n ${args.autoCloseDelay !== 10000 ? `auto-close-delay=\"${args.autoCloseDelay}\"` : ''}>\n\t\t${args.content}\n\t\t${args.actions}\n </cura-toast>\n </div>`;\n}\n\nexport default {\n title: 'Componentes/Feedback/Toast',\n tags: ['autodocs'],\n render: ({ ...args }) => {\n return renderCuraToast(args);\n },\n argTypes: {\n label: {\n\t\t\tcontrol: 'text',\n\t\t\tdescription: 'Título do toast.',\n\t\t\ttable: {\n\t\t\t\t\tcategory: 'Properties',\n\t\t\t},\n\t\t\tname: 'label',\n },\n type: {\n\t\t\tcontrol: { type: 'select' },\n\t\t\toptions: ['', 'info', 'success', 'warning', 'error'],\n\t\t\tdescription: 'Tipos de alertas disponíveis: <b>info</b>, <b>success</b>, <b>warning</b>, <b>error</b>.',\n\t\t\ttable: {\n\t\t\t\t\tcategory: 'Properties',\n\t\t\t\t\tdefaultValue: { summary: 'info' },\n\t\t\t},\n\t\t\tname: 'type',\n },\n\t\tposition: {\n\t\t\tcontrol: { type: 'select' },\n\t\t\toptions: ['', 'top-left', 'top-center', 'top-right', 'bottom-left', 'bottom-center', 'bottom-right'],\n\t\t\tdescription: 'Posição do Toast na tela',\n\t\t\ttable: {\n\t\t\t\tcategory: 'Properties',\n\t\t\t\tdefaultValue: { summary: 'top-right' },\n\t\t\t},\n\t\t\tname: 'position',\n\t\t},\n closeButton: {\n control: 'boolean',\n description: 'Define se o alerta pode ser fechado.',\n table: {\n category: 'Properties',\n defaultValue: { summary: true },\n },\n },\n\t\tloader: {\n control: 'boolean',\n description: 'Define se mostra ou não a barra de progresso',\n table: {\n category: 'Properties',\n defaultValue: { summary: true },\n },\n },\n icon: {\n control: {type: 'select' },\n options: ['', ...iconNames],\n description: 'Nome do ícone personalizado.',\n table: {\n category: 'Icons',\n defaultValue: { summary: 'De acordo com o tipo de alert.' },\n },\n name: 'icon'\n },\n\t\tautoCloseDelay: {\n control: 'number',\n description: 'Define a quantidade de tempo, em milisegundos, que o toast ficará aberto.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 10000 },\n },\n },\n\t\tcontent: {\n control: 'text',\n description: 'Conteúdo do texto principal do toast. É projetado automaticamente dentro do slot padrão.',\n defaultValue: '',\n table: {\n category: 'Slot',\n },\n },\n actions: {\n control: 'text',\n description: 'Conteúdo da ações de links e botões',\n defaultValue: '',\n table: {\n category: 'Slot',\n },\n }\n },\n};\n\nexport const Toast = {\n args: {\n label: 'Título do toast',\n type: 'info',\n\t\tposition: 'top-right',\n closeButton: true,\n loader: true,\n icon: '',\n\t\tautoCloseDelay: 10000,\n content: 'Texto explicativo para o toast.',\n actions: `<div slot=\"actions\">\n <cura-paragraph spot-color=\"primary\" size=\"xsmall\" margin-block=\"8px 0\">\n <a href=\"http://www.google.com\" target=\"_blank\" rel=\"noopener noreferrer\">Link</a>\n <a href=\"http://www.google.com\" target=\"_blank\" rel=\"noopener noreferrer\" style=\"margin-left: 8px\">Link</a>\n </cura-paragraph>\n <div style=\"display: flex; justify-content: space-between; gap: 8px; margin-top: 12px;\">\n <cura-button-outline\n size=\"small\"\n color=\"primary\"\n style=\"width: 100%;\">\n Button\n </cura-button-outline>\n <cura-button\n size=\"small\"\n color=\"accent\"\n style=\"width: 100%;\">\n Button\n </cura-button>\n </div>\n </div>`\n },\n};\n"]}
@@ -147,7 +147,7 @@ export class CuraCheckbox {
147
147
  return h("cura-icon", { class: "icon", name: iconName, size: iconSize, color: iconColor });
148
148
  }
149
149
  render() {
150
- return (h(Host, { key: '9f96ab8f12502dc777ee00d02d8306ecd3ce9776' }, h("div", { key: '4a782c31e4d97df0c7cc1d60a3c83125d01d31f6', class: this.getClasses(), style: this.styles, onClick: this.handleClick }, h("div", { key: 'c2de03821506646ffbe84cd7106ab91c1cdeba55', class: "info" }, h("div", { key: '9a8985036acf8770541b69e35ff449572a6afb0e', class: "label-wrapper" }, h("cura-label", { key: 'a128e382aa3f25c849fbe488f3820aa9b3cdb775', class: "label", weight: 'bold', size: this.size === 'large' ? 'medium' : 'xsmall', color: this.assignColor('label') }, this.label), this.required && h("cura-paragraph", { key: '84e4817990f7499f047af339ce1ed9efc0ed060c', lineHeight: '0%', marginBlock: '0', color: "error-base" }, "* ")), h("cura-label", { key: '33527a9347eb8971d869b7e5ec492c3a7057b123', color: this.assignColor('message'), size: "xsmall", class: "message" }, h("slot", { key: 'cda5d0d9eca328fd20663f941a41325eb1ad0e29' }))), h("div", { key: '588b04e6c9c74daf8406d0cca1e50bd39d1703c9', class: 'checkbox', tabIndex: this.ontabindex }, h("input", { key: '209fee01eb3051602e5a9633de4fdea59d986a53', type: "checkbox", name: this.name, value: this.value, disabled: this.disabled, required: this.required, checked: this.checked, indeterminate: this.indeterminate }), this.getIcon()))));
150
+ return (h(Host, { key: 'b74eebdbcaed952fa2157c3cbb3a84ce92bb9e6c' }, h("div", { key: 'e18e4e5aa12a3e298db65399ebf002aa991100f2', class: this.getClasses(), style: this.styles, onClick: this.handleClick }, h("div", { key: 'fdbcf3ec4b12bf9c6d80cded5ce9d17c4f5e2a39', class: "info" }, h("div", { key: 'cbe76b43956bed00ab638b953a44d941ffb748d5', class: "label-wrapper" }, h("cura-label", { key: '259c5e5e63a6d36ed15845899eaf8c76b2b50273', class: "label", weight: 'bold', size: this.size === 'large' ? 'medium' : 'xsmall', color: this.assignColor('label') }, this.label), this.required && h("cura-paragraph", { key: '42d8b2777d4790bd8f83a7ddc939c6ab584b5cf0', lineHeight: '0%', marginBlock: '0', color: "error-base" }, "* ")), h("cura-label", { key: 'bcafaacf64c8967f78a3e9b7ecfe6d1412517ea3', color: this.assignColor('message'), size: "xsmall", class: "message" }, h("slot", { key: 'c9cc9e74cc9048ead8375a158253491e1aae4dfe' }))), h("div", { key: 'e63ba7ef796c9d46cf4729facf1be985b8174028', class: 'checkbox', tabIndex: this.ontabindex }, h("input", { key: '2e7e2e302e577f26d8022fe4a0108f0e6727450f', type: "checkbox", name: this.name, value: this.value, disabled: this.disabled, required: this.required, checked: this.checked, indeterminate: this.indeterminate }), this.getIcon()))));
151
151
  }
152
152
  static get is() { return "cura-checkbox"; }
153
153
  static get encapsulation() { return "shadow"; }
@@ -25,6 +25,9 @@ li {
25
25
  box-sizing: border-box;
26
26
  cursor: pointer;
27
27
  }
28
+ li.disabled {
29
+ cursor: default;
30
+ }
28
31
  li.hovered {
29
32
  background-color: var(--neutral-white);
30
33
  }
@@ -45,6 +48,6 @@ li ::slotted(div[slot=action]) {
45
48
  li.selected {
46
49
  background-color: var(--primary-lighter);
47
50
  }
48
- li:hover {
51
+ li:hover:not(.disabled) {
49
52
  background-color: var(--neutral-white);
50
53
  }