@newlogic-digital/ui 3.7.5 → 4.2.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 (224) hide show
  1. package/README.md +17 -31
  2. package/package.json +22 -15
  3. package/src/data/main.json +2 -32
  4. package/src/data/nav.json +12 -0
  5. package/src/icons.svg +0 -30
  6. package/src/pages/dialog/basic.json.latte +5 -0
  7. package/src/pages/email/index.json +12 -0
  8. package/src/pages/example/popover-autocomplete.json +8 -0
  9. package/src/pages/gdpr.json +11 -0
  10. package/src/pages/index.json +8 -0
  11. package/src/scripts/components/(ui)/+.js +13 -0
  12. package/src/scripts/components/(ui)/Button.js +4 -0
  13. package/src/scripts/components/(ui)/Carousel.js +4 -0
  14. package/src/scripts/components/(ui)/Compare.js +4 -0
  15. package/src/scripts/components/(ui)/Control.js +11 -0
  16. package/src/scripts/components/(ui)/ControlSelect.js +4 -0
  17. package/src/scripts/components/(ui)/Details.js +4 -0
  18. package/src/scripts/components/(ui)/Dialog.js +17 -0
  19. package/src/scripts/components/(ui)/Drawer.js +4 -0
  20. package/src/scripts/components/(ui)/Form.js +15 -0
  21. package/src/scripts/components/(ui)/Popover.js +4 -0
  22. package/src/scripts/components/(ui)/Range.js +4 -0
  23. package/src/scripts/components/(ui)/Tabs.js +4 -0
  24. package/src/scripts/components/(ui)/Toast.js +4 -0
  25. package/src/scripts/components/+.js +5 -0
  26. package/src/scripts/components/App.js +5 -0
  27. package/src/scripts/components/ReCaptcha.js +4 -0
  28. package/src/scripts/components/Reveal.js +4 -0
  29. package/src/scripts/components/cookieconsent/+.js +2 -0
  30. package/src/scripts/components/cookieconsent/CookieConsentDialog.js +4 -0
  31. package/src/scripts/components/cookieconsent/CookieConsentForm.js +4 -0
  32. package/src/scripts/composables/+.js +3 -0
  33. package/src/scripts/composables/naja.js +24 -0
  34. package/src/scripts/composables/stimulus.js +31 -0
  35. package/src/scripts/composables/swup.js +23 -0
  36. package/src/scripts/main.js +4 -6
  37. package/src/scripts/utils/+.js +1 -0
  38. package/src/scripts/utils/initAfter.js +11 -0
  39. package/src/styles/base/+.css +5 -0
  40. package/src/styles/{Utils/default.css → base/defaults.css} +17 -1
  41. package/src/styles/base/transitions.css +12 -0
  42. package/src/styles/base/variants.css +11 -0
  43. package/src/styles/components/(layout)/+.css +2 -0
  44. package/src/styles/components/(layout)/Header.css +13 -0
  45. package/src/styles/components/(layout)/Main.css +24 -0
  46. package/src/styles/components/(ui)/+.css +25 -0
  47. package/src/styles/components/(ui)/Badge.css +8 -0
  48. package/src/styles/components/(ui)/Button.css +12 -0
  49. package/src/styles/components/(ui)/Carousel.css +2 -0
  50. package/src/styles/components/(ui)/Check.css +4 -0
  51. package/src/styles/components/(ui)/Compare.css +1 -0
  52. package/src/styles/components/(ui)/Control.css +31 -0
  53. package/src/styles/components/(ui)/ControlSelect.css +1 -0
  54. package/src/styles/components/(ui)/Drawer.css +16 -0
  55. package/src/styles/components/(ui)/Field.css +1 -0
  56. package/src/styles/components/(ui)/Group.css +2 -0
  57. package/src/styles/components/(ui)/Heading.css +14 -0
  58. package/src/styles/components/(ui)/Image.css +2 -0
  59. package/src/styles/components/(ui)/Info.css +2 -0
  60. package/src/styles/components/(ui)/Label.css +2 -0
  61. package/src/styles/components/(ui)/Link.css +2 -0
  62. package/src/styles/components/(ui)/Notice.css +2 -0
  63. package/src/styles/components/(ui)/Popover.css +13 -0
  64. package/src/styles/components/(ui)/Progress.css +6 -0
  65. package/src/styles/components/(ui)/Range.css +4 -0
  66. package/src/styles/components/(ui)/Switch.css +4 -0
  67. package/src/styles/components/(ui)/Text.css +2 -0
  68. package/src/styles/components/(ui)/Title.css +14 -0
  69. package/src/styles/components/(ui)/Toast.css +4 -0
  70. package/src/styles/components/(ui)/Toaster.css +2 -0
  71. package/src/styles/components/(ui)/dialog/+.css +2 -0
  72. package/src/styles/components/(ui)/dialog/Dialog.css +2 -0
  73. package/src/styles/components/(ui)/dialog/DialogContent.css +2 -0
  74. package/src/styles/components/+.css +3 -0
  75. package/src/styles/components/cookieconsent/+.css +1 -0
  76. package/src/styles/components/cookieconsent/CookieConsentDialog.css +19 -0
  77. package/src/styles/emails/base/+.css +2 -0
  78. package/src/styles/emails/base/defaults.css +23 -0
  79. package/src/styles/emails/components/+.css +4 -0
  80. package/src/styles/emails/components/Button.css +32 -0
  81. package/src/styles/emails/components/Heading.css +7 -0
  82. package/src/styles/emails/components/Main.css +13 -0
  83. package/src/{emails/styles/main/Ui → styles/emails/components}/Text.css +8 -5
  84. package/src/styles/emails/main.css +8 -0
  85. package/src/styles/emails/theme/+.css +2 -0
  86. package/src/styles/emails/theme/config.css +16 -0
  87. package/src/styles/emails/theme/default.css +13 -0
  88. package/src/styles/emails/utils/+.css +1 -0
  89. package/src/styles/emails/utils/common.css +29 -0
  90. package/src/styles/main.css +17 -16
  91. package/src/styles/theme/+.css +2 -0
  92. package/src/styles/theme/dark.css +6 -0
  93. package/src/styles/{Utils/theme → theme}/main.css +11 -14
  94. package/src/styles/tinymce.css +2 -34
  95. package/src/styles/utils/+.css +3 -0
  96. package/src/styles/utils/index.css +5 -0
  97. package/src/styles/utils/reveal.css +21 -0
  98. package/src/styles/utils/scrollbar.css +23 -0
  99. package/src/templates/components/(example)/PopoverAutocomplete.latte +27 -0
  100. package/src/templates/components/(layout)/Footer.latte +1 -0
  101. package/src/templates/components/(layout)/Header.latte +7 -0
  102. package/src/templates/components/(ui)/Toast.latte +9 -0
  103. package/src/templates/{Sections/Text.latte → components/Content.latte} +3 -3
  104. package/src/templates/components/Example.latte +17 -0
  105. package/src/templates/{Sections/CookieConsent.latte → components/cookieconsent/CookieConsentContent.latte} +4 -4
  106. package/src/templates/components/cookieconsent/CookieConsentDialog.latte +27 -0
  107. package/src/templates/{Components/Form/CookieConsent.latte → components/cookieconsent/CookieConsentForm.latte} +9 -9
  108. package/src/templates/components/dialog/DialogBasic.latte +18 -0
  109. package/src/templates/emails/components/Content.latte +29 -0
  110. package/src/templates/emails/components/Footer.latte +13 -0
  111. package/src/templates/emails/components/Header.latte +8 -0
  112. package/src/templates/emails/layouts/default.latte +44 -0
  113. package/src/templates/{Layout/Main.latte → layouts/default.latte} +26 -28
  114. package/vite.config.js +3 -18
  115. package/src/emails/styles/main/+.css +0 -3
  116. package/src/emails/styles/main/Base/+.css +0 -2
  117. package/src/emails/styles/main/Base/config.css +0 -22
  118. package/src/emails/styles/main/Components/+.css +0 -1
  119. package/src/emails/styles/main/Components/Card.css +0 -12
  120. package/src/emails/styles/main/Ui/+.css +0 -3
  121. package/src/emails/styles/main/Ui/Btn.css +0 -78
  122. package/src/emails/styles/main/Ui/Heading.css +0 -8
  123. package/src/emails/styles/main.css +0 -92
  124. package/src/emails/templates/.gitkeep +0 -0
  125. package/src/emails/templates.test/Layout.latte +0 -35
  126. package/src/emails/templates.test/Sections/Footer.latte +0 -22
  127. package/src/emails/templates.test/Sections/Header.latte +0 -37
  128. package/src/emails/templates.test/Sections/Text.latte +0 -24
  129. package/src/scripts/Components/+.js +0 -2
  130. package/src/scripts/Components/Drawer.js +0 -60
  131. package/src/scripts/Components/Popover.js +0 -65
  132. package/src/scripts/Layout/+.js +0 -1
  133. package/src/scripts/Layout/Header.js +0 -20
  134. package/src/scripts/Libraries/+.js +0 -10
  135. package/src/scripts/Libraries/CookieConsent.js +0 -80
  136. package/src/scripts/Libraries/Dialog.js +0 -28
  137. package/src/scripts/Libraries/Form.js +0 -13
  138. package/src/scripts/Libraries/Naja.js +0 -37
  139. package/src/scripts/Libraries/ReCaptcha.js +0 -25
  140. package/src/scripts/Libraries/Reveal.js +0 -32
  141. package/src/scripts/Libraries/Ripple.js +0 -8
  142. package/src/scripts/Libraries/Stimulus.js +0 -56
  143. package/src/scripts/Libraries/Swup.js +0 -77
  144. package/src/scripts/Libraries/Toaster.js +0 -55
  145. package/src/scripts/Sections/+.js +0 -0
  146. package/src/scripts/Ui/+.js +0 -4
  147. package/src/scripts/Ui/Check.js +0 -8
  148. package/src/scripts/Ui/Control.js +0 -194
  149. package/src/scripts/Ui/ControlSelect.js +0 -25
  150. package/src/scripts/Ui/Text.js +0 -21
  151. package/src/scripts/Utils/+.js +0 -3
  152. package/src/scripts/Utils/cdn.js +0 -5
  153. package/src/scripts/Utils/initAfter.js +0 -11
  154. package/src/scripts/Utils/naja.js +0 -41
  155. package/src/scripts/Utils/utilities.js +0 -8
  156. package/src/styles/Components/+.css +0 -5
  157. package/src/styles/Components/Dialog/+.css +0 -3
  158. package/src/styles/Components/Dialog/Content.css +0 -2
  159. package/src/styles/Components/Dialog/CookieConsent.css +0 -17
  160. package/src/styles/Components/Dialog/Default.css +0 -2
  161. package/src/styles/Components/Drawer.css +0 -18
  162. package/src/styles/Components/Field.css +0 -1
  163. package/src/styles/Components/Popover.css +0 -1
  164. package/src/styles/Components/Toaster.css +0 -2
  165. package/src/styles/Layout/+.css +0 -3
  166. package/src/styles/Layout/Header.css +0 -18
  167. package/src/styles/Layout/Main.css +0 -31
  168. package/src/styles/Layout/Nav.css +0 -23
  169. package/src/styles/Libraries/+.css +0 -2
  170. package/src/styles/Libraries/Datepicker.css +0 -54
  171. package/src/styles/Libraries/Pickr.css +0 -13
  172. package/src/styles/Sections/+.css +0 -1
  173. package/src/styles/Ui/+.css +0 -16
  174. package/src/styles/Ui/Badge.css +0 -8
  175. package/src/styles/Ui/Btn.css +0 -14
  176. package/src/styles/Ui/Check.css +0 -1
  177. package/src/styles/Ui/Control.css +0 -57
  178. package/src/styles/Ui/ControlSelect.css +0 -57
  179. package/src/styles/Ui/Group.css +0 -1
  180. package/src/styles/Ui/Heading.css +0 -4
  181. package/src/styles/Ui/Image.css +0 -1
  182. package/src/styles/Ui/Info.css +0 -1
  183. package/src/styles/Ui/Label.css +0 -1
  184. package/src/styles/Ui/Link.css +0 -8
  185. package/src/styles/Ui/Notice.css +0 -9
  186. package/src/styles/Ui/Progress.css +0 -1
  187. package/src/styles/Ui/Switch.css +0 -1
  188. package/src/styles/Ui/Text.css +0 -1
  189. package/src/styles/Ui/Title.css +0 -4
  190. package/src/styles/Utils/+.css +0 -6
  191. package/src/styles/Utils/config.css +0 -16
  192. package/src/styles/Utils/theme/+.css +0 -1
  193. package/src/styles/Utils/utilities.css +0 -42
  194. package/src/templates/Components/Dialog/Basic.latte +0 -24
  195. package/src/templates/Components/Dialog/CookieConsent.latte +0 -27
  196. package/src/templates/Layout/Footer.latte +0 -0
  197. package/src/templates/Layout/Header.latte +0 -38
  198. package/src/templates/Sections/Site.latte +0 -213
  199. package/src/templates/Sections/Ui/Docs/@intro.html +0 -48
  200. package/src/templates/Sections/Ui/Docs/@nav.html +0 -134
  201. package/src/templates/Sections/Ui/Docs/@styles.html +0 -96
  202. package/src/templates/Sections/Ui/Docs/Default.latte +0 -979
  203. package/src/templates/Sections/Ui/Icons.html +0 -30
  204. package/src/templates/Sections/Ui/Intro.html +0 -119
  205. package/src/templates/Sections/Ui.latte +0 -8
  206. package/src/templates/Ui/+.latte +0 -5
  207. package/src/templates/Ui/Check.latte +0 -7
  208. package/src/templates/Ui/Control.latte +0 -9
  209. package/src/templates/Ui/ControlDate.latte +0 -14
  210. package/src/templates/Ui/ControlSelect.latte +0 -9
  211. package/src/templates/Ui/ControlTime.latte +0 -14
  212. package/src/views/dialog/basic.json.latte +0 -5
  213. package/src/views/email/email.latte +0 -6
  214. package/src/views/email/email.test.latte +0 -6
  215. package/src/views/gdpr.json +0 -14
  216. package/src/views/index.json +0 -12
  217. package/src/views/popover/info.json.latte +0 -15
  218. package/src/views/site.json +0 -11
  219. package/src/views/ui-icons.json +0 -12
  220. package/src/views/ui.json +0 -11
  221. /package/src/styles/{Utils → base}/breakpoints.css +0 -0
  222. /package/src/styles/{Utils → base}/keyframes.css +0 -0
  223. /package/src/{emails/styles/main/Base/font.css → styles/emails/base/fonts.css} +0 -0
  224. /package/src/templates/{Utils → utils}/sections.latte +0 -0
@@ -1,78 +0,0 @@
1
- .ui-btn-group {
2
- width: auto;
3
-
4
- & td {
5
- padding-top: 10px;
6
- padding-bottom: 10px;
7
- }
8
- }
9
-
10
-
11
- .ui-btn {
12
- padding: 10px 15px;
13
- background-color: rgb(var(--color-primary));
14
- font-size: 12px;
15
- border-radius: var(--rounded);
16
- font-weight: 700;
17
- transition: var(--transition-background), var(--transition-color);
18
-
19
- &.lg {
20
- padding: 20px;
21
- border-radius: 999px;
22
- font-size: 16px;
23
- }
24
-
25
- &, & span {
26
- color: rgb(var(--color-light));
27
- text-decoration: none;
28
- }
29
-
30
- & span {
31
- transition: var(--transition-color);
32
- }
33
-
34
- &.ghosted {
35
- background-color: transparent;
36
-
37
- &, & span {
38
- color: rgb(var(--color-primary));
39
- }
40
- }
41
-
42
- &:hover {
43
- background-color: rgba(var(--color-primary), 0.8) !important;
44
-
45
- &[class*="text-main"] {
46
- background-color: rgba(var(--color-main), 0.15) !important;
47
- }
48
- }
49
- }
50
-
51
- .ui-btn-table {
52
- & table {
53
- background-color: rgb(var(--color-primary));
54
- width: auto;
55
- border-radius: 999px;
56
- font-weight: 700;
57
- transition: var(--transition-background), var(--transition-color);
58
- }
59
-
60
- & td {
61
- padding: 16px 20px;
62
- }
63
-
64
- &, & span {
65
- color: rgb(var(--color-light));
66
- text-decoration: none;
67
- }
68
-
69
- &:hover {
70
- & table {
71
- background-color: rgba(var(--color-primary), 0.8) !important;
72
-
73
- &[class*="text-main"] {
74
- background-color: rgba(var(--color-main), 0.15) !important;
75
- }
76
- }
77
- }
78
- }
@@ -1,8 +0,0 @@
1
- .ui-heading {
2
- font-size: 16px;
3
- font-weight: 700;
4
-
5
- &.lg {
6
- font-size: 28px;
7
- }
8
- }
@@ -1,92 +0,0 @@
1
- @import "tailwindcss/base.css";
2
- @import "tailwindcss/components.css";
3
- @import "tailwindcss/utilities.css";
4
- @import "tailwindcss/variants.css";
5
- @import "main/Base/font.css";
6
- @import "main/Ui/+.css";
7
- @import "main/Components/+.css";
8
-
9
- :where([class*="border-"]) {
10
- border-width: 0;
11
- border-style: solid;
12
- }
13
-
14
- body {
15
- margin: 0;
16
- padding: 0;
17
- }
18
-
19
- table {
20
- width: 100%;
21
- }
22
-
23
- a {
24
- &, img {
25
- text-decoration: none;
26
- color: rgb(var(--color-main));
27
- }
28
-
29
- & img {
30
- font-weight: 700;
31
- }
32
- }
33
-
34
- .l-main {
35
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Roboto, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
36
- width: 600px;
37
- }
38
-
39
- .l-main-body {
40
- background-color: rgb(var(--color-body-secondary));
41
- border-radius: var(--rounded);
42
-
43
- & > tr {
44
- &:first-child > td {
45
- padding-top: var(--spacing-container-inner);
46
- }
47
-
48
- &:last-child > td {
49
- padding-bottom: var(--spacing-container-inner);
50
- }
51
- }
52
- }
53
-
54
- .dark-img {
55
- display: none !important;
56
- }
57
-
58
- @media (prefers-color-scheme: dark) {
59
- body {
60
- background-color: rgb(var(--color-body-primary-dark));
61
- color: rgb(var(--color-light));
62
- border-radius: var(--rounded);
63
- }
64
-
65
- a {
66
- &, img {
67
- color: rgb(var(--color-light)) !important;
68
- }
69
- }
70
-
71
- .l-main-body {
72
- background-color: rgb(var(--color-body-secondary-dark)) !important;
73
- }
74
-
75
- [class*="border-main/10"] {
76
- border-color: rgba(var(--color-light), 0.15) !important;
77
- }
78
-
79
- [class*="text-main"] {
80
- &, & span {
81
- color: rgb(var(--color-light)) !important;
82
- }
83
- }
84
-
85
- .light-img {
86
- display: none !important;
87
- }
88
-
89
- .dark-img {
90
- display: block !important;
91
- }
92
- }
File without changes
@@ -1,35 +0,0 @@
1
- <!DOCTYPE html>
2
- <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
- <title>Email Template</title>
6
- <!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]-->
7
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
-
9
- {var $forceLightMode = false}
10
-
11
- {if $forceLightMode}
12
- <meta name="color-scheme" content="only light">
13
- <meta name="supported-color-schemes" content="only light">
14
- {else}
15
- <meta name="color-scheme" content="light dark">
16
- <meta name="supported-color-schemes" content="light dark">
17
- {/if}
18
-
19
- <style type="text/css" n:syntax="off">
20
- @import '/src/emails/styles/main.css';
21
- </style>
22
- </head>
23
- <body>
24
- <table class="l-main" align="center">
25
- <tr>
26
- <td class="p-container" align="center">
27
- <table class="l-main-body w-full">
28
- <block name="body" with="locals"></block>
29
- </table>
30
- </td>
31
- </tr>
32
- <include src="emails/templates.test/Sections/Footer.latte"></include>
33
- </table>
34
- </body>
35
- </html>
@@ -1,22 +0,0 @@
1
- <tr class="s-footer">
2
- <td class="p-container pt-[16px]">
3
- <table class="s_body" align="center">
4
- <tr>
5
- <td class="px-container-inner">
6
- <table>
7
- <tr>
8
- <td class="ui-text sm pr-[160px]">
9
- Název webu<br>
10
- Adresa
11
- </td>
12
- <td class="ui-text sm">
13
- <a href="mailto:info@example.com"><span>info@example.com</span></a><br>
14
- <a href="tel:+420111222333"><span>(+420) 111 222 333</span></a>
15
- </td>
16
- </tr>
17
- </table>
18
- </td>
19
- </tr>
20
- </table>
21
- </td>
22
- </tr>
@@ -1,37 +0,0 @@
1
- <tr class="s-header">
2
- <td>
3
- <table class="s_body" align="center">
4
- <tr>
5
- <td class="px-container-inner">
6
- <table>
7
- <tr>
8
- <td>
9
- <a href="https://www.bookolosystem.com" target="_blank">
10
- <img src="https://via.placeholder.com/160x60" alt="Logo" class="light-img w-[160px] h-[60px] block">
11
- <!--[if !mso]><! -->
12
- <img src="https://via.placeholder.com/160x60" alt="Logo" class="dark-img w-[160px] h-[60px] block"
13
- style="{if $forceLightMode}background-color: rgb(245,245,245);border-radius: 8px;padding: 6px{/if}">
14
- <!--<![endif]-->
15
- </a>
16
- </td>
17
- <td class="text-right">
18
- <table class="ui-btn-group" align="right">
19
- <tr>
20
- <td>
21
- <a href="#" class="ui-btn"><span>Zobrazit web</span></a>
22
- </td>
23
- </tr>
24
- </table>
25
- </td>
26
- </tr>
27
- </table>
28
- <table>
29
- <tr><td class="border-b border-main/10 pb-[32px]"></td></tr>
30
- <tr><td class="pb-[32px]"></td></tr>
31
- </table>
32
- </td>
33
- </tr>
34
- </table>
35
- </td>
36
- </tr>
37
-
@@ -1,24 +0,0 @@
1
- <tr class="s-text">
2
- <td>
3
- <table class="s_body" align="center">
4
- <tr>
5
- <td class="px-container-inner">
6
- <table>
7
- <tr>
8
- <td class="ui-heading lg pb-[24px]">
9
- Lorem ipsum
10
- </td>
11
- </tr>
12
- <tr>
13
- <td class="ui-text">
14
- Hello David,<br>
15
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
16
- </td>
17
- </tr>
18
- </table>
19
- </td>
20
- </tr>
21
- </table>
22
- </td>
23
- </tr>
24
-
@@ -1,2 +0,0 @@
1
- import './Drawer.js'
2
- import './Popover.js'
@@ -1,60 +0,0 @@
1
- import { LibStimulus, Controller } from '../Libraries/Stimulus.js'
2
- import { showDrawer, closeDrawer, scrollDrawer } from 'winduum/src/components/drawer/index.js'
3
-
4
- LibStimulus.register('c-drawer', class extends Controller {
5
- static values = {
6
- inertMatch: {
7
- type: String,
8
- default: ':where(.c-drawer, .l-header)'
9
- }
10
- }
11
-
12
- connect() {
13
- this.scrollReset()
14
- this.element.addEventListener('click', ({ target }) => {
15
- if (target === this.element) this.close()
16
- })
17
- }
18
-
19
- scrollReset() {
20
- this.element.scroll({ left: this.element.scrollWidth, behavior: 'instant' })
21
- }
22
-
23
- scroll({ target }) {
24
- scrollDrawer(target)
25
- }
26
-
27
- inert(inert) {
28
- [...document.body.children].forEach((element) => {
29
- if (!element.matches(this.inertMatchValue)) (element.inert = inert)
30
- })
31
- }
32
-
33
- show() {
34
- this.scrollReset()
35
- this.element.classList.add('active')
36
- showDrawer(this.element)
37
- this.inert(true)
38
- }
39
-
40
- close() {
41
- closeDrawer(this.element)
42
- }
43
-
44
- toggle({ currentTarget }) {
45
- this.activeButton = currentTarget
46
-
47
- if (!currentTarget.classList.contains('active')) {
48
- currentTarget.classList.add('active')
49
- this.show()
50
- } else {
51
- this.close()
52
- }
53
- }
54
-
55
- dismiss() {
56
- this.element.classList.remove('active')
57
- this.activeButton?.classList?.remove('active')
58
- this.inert(false)
59
- }
60
- })
@@ -1,65 +0,0 @@
1
- import { Controller, LibStimulus } from '../Libraries/Stimulus.js'
2
- import { dataset, fetchJson } from '@newlogic-digital/utils-js'
3
- import initAfter from '../Utils/initAfter.js'
4
-
5
- LibStimulus.register('c-popover', class extends Controller {
6
- static values = {
7
- url: String,
8
- insertTo: String,
9
- manual: Boolean
10
- }
11
-
12
- async toggle({ currentTarget, params }) {
13
- const { togglePopover } = await import('winduum/src/components/popover/index.js')
14
- const hasUrlValue = this.hasUrlValue && !this.popoverTarget
15
-
16
- if (hasUrlValue) await this.fetch()
17
-
18
- this.popoverTarget = document.getElementById(currentTarget.getAttribute('popovertarget'))
19
-
20
- if (hasUrlValue) initAfter(this.popoverTarget)
21
-
22
- await togglePopover(currentTarget, params)
23
- }
24
-
25
- async hide() {
26
- if (this.popoverActionTarget.ariaExpanded !== 'true') return
27
-
28
- const { hidePopover } = await import('winduum/src/components/popover/index.js')
29
-
30
- await hidePopover(this.popoverActionTarget)
31
- }
32
-
33
- async dismiss({ target }) {
34
- if (this.popoverActionTarget.ariaExpanded !== 'true') return
35
-
36
- if (!this.popoverTarget.contains(target) && !this.popoverActionTarget.isEqualNode(target) && this.popoverActionTarget.ariaExpanded === 'true') {
37
- await this.hide()
38
- }
39
- }
40
-
41
- async fetch() {
42
- this.popoverActionTarget.classList.add('loading', 'cursor-wait')
43
-
44
- const { content } = await fetchJson(this.urlValue)
45
-
46
- this.popoverActionTarget.classList.remove('loading', 'cursor-wait')
47
-
48
- const insertElement = !this.hasInsertToValue ? this.popoverActionTarget : document.querySelector(this.insertToValue)
49
- insertElement.insertAdjacentHTML(!this.hasInsertToValue ? 'afterend' : 'beforeend', content)
50
-
51
- return content
52
- }
53
-
54
- connect() {
55
- this.popoverActionTarget = this.element.querySelector('[popovertargetaction]')
56
-
57
- if (!this.popoverActionTarget) return
58
-
59
- ;(!this.hasManualValue || !this.manualValue) && dataset(this.popoverActionTarget, 'action').add(
60
- `click->c-popover#${this.popoverActionTarget.getAttribute('popovertargetaction')}:prevent`,
61
- 'keydown.esc@window->c-popover#hide',
62
- 'click@window->c-popover#dismiss'
63
- )
64
- }
65
- })
@@ -1 +0,0 @@
1
- import './Header.js'
@@ -1,20 +0,0 @@
1
- import { LibStimulus, Controller } from '../Libraries/Stimulus.js'
2
-
3
- LibStimulus.register('l-header', class extends Controller {
4
- static targets = ['logo', 'nav']
5
-
6
- connect() {
7
- if (!document.querySelector('.l-nav')) {
8
- this.element.insertAdjacentHTML('afterend', `
9
- <div class="l-nav c-drawer" data-controller="c-drawer" data-action="scroll->c-drawer#scroll c-drawer:close->c-drawer#dismiss" inert>
10
- <div class="c-drawer-content"></div>
11
- </div>
12
- `)
13
-
14
- const drawerContentElement = document.querySelector('.l-nav .c-drawer-content')
15
-
16
- drawerContentElement.insertAdjacentHTML('beforeend', this.logoTarget.outerHTML)
17
- drawerContentElement.insertAdjacentHTML('beforeend', this.navTarget.outerHTML)
18
- }
19
- }
20
- })
@@ -1,10 +0,0 @@
1
- import './CookieConsent.js'
2
- import './Dialog.js'
3
- import './Form.js'
4
- import './Naja.js'
5
- import './ReCaptcha.js'
6
- import './Reveal.js'
7
- import './Ripple.js'
8
- import './Stimulus.js'
9
- export { default as Swup } from './Swup.js'
10
- import './Toaster.js'
@@ -1,80 +0,0 @@
1
- import { LibStimulus, Controller } from './Stimulus.js'
2
- import { appendCookieConsent, setCookieConsent } from '@newlogic-digital/cookieconsent-js'
3
- import { showDialog, closeDialog } from 'winduum/src/components/dialog/index.js'
4
-
5
- export const getCookieConsentItem = (key = 'cookieconsent-js') => localStorage.getItem(key)
6
-
7
- export const initCookieConsent = (element = document, type = getCookieConsentItem() ?? []) => {
8
- element.querySelectorAll('[data-lib-cookieconsent]').forEach((element) => {
9
- if (type.includes(element.getAttribute('data-lib-cookieconsent'))) {
10
- appendCookieConsent(element, {
11
- ignoreAttributeName: /(type|data-lib-cookieconsent)/
12
- })
13
- }
14
- })
15
- }
16
-
17
- LibStimulus.register('c-dialog-cookieconsent', class extends Controller {
18
- async connect() {
19
- initCookieConsent()
20
-
21
- if (document.querySelector('.c-form-cookieconsent')) {
22
- return
23
- }
24
-
25
- if (!getCookieConsentItem() || parseInt(getCookieConsentItem('cookieconsent-js-expire')) < Date.now()) {
26
- setTimeout(async () => {
27
- await showDialog(this.element, { closable: false })
28
- }, 1500)
29
- } else {
30
- this.element.remove()
31
- }
32
- }
33
-
34
- async approve() {
35
- await this.hide(['performance', 'marketing'])
36
- }
37
-
38
- async decline() {
39
- await this.hide([])
40
- }
41
-
42
- async hide(type) {
43
- await setCookieConsent(type)
44
- initCookieConsent(document, type)
45
- await closeDialog(this.element, { remove: true })
46
- }
47
- })
48
-
49
- LibStimulus.register('c-form-cookieconsent', class extends Controller {
50
- connect() {
51
- document.querySelector('.c-dialog-cookieconsent')?.close()
52
-
53
- this.element.querySelectorAll('input:not([disabled])').forEach((input) => {
54
- input.checked = false
55
- })
56
-
57
- JSON.parse(getCookieConsentItem())?.forEach((type) => {
58
- if (this.element.querySelector(`input[value="${type}"]`) !== null) {
59
- this.element.querySelector(`input[value="${type}"]`).checked = true
60
- }
61
- })
62
- }
63
-
64
- async update() {
65
- const type = []
66
-
67
- this.element.querySelectorAll('input:not([disabled])').forEach((input) => {
68
- input.checked && type.push(input.value)
69
- })
70
-
71
- await setCookieConsent(type)
72
- location.reload()
73
- }
74
-
75
- disconnect() {
76
- if ((!getCookieConsentItem() || parseInt(getCookieConsentItem('cookieconsent-js-expire')) < Date.now())) {
77
- document.querySelector('.c-dialog-cookieconsent')?.showModal()
78
- }
79
- }
80
- })
@@ -1,28 +0,0 @@
1
- import { Controller, LibStimulus } from './../Libraries/Stimulus.js'
2
- import { insertDialog, closeDialog, dialogSelector } from 'winduum/src/components/dialog/index.js'
3
- import initAfter from '../Utils/initAfter.js'
4
- import { fetchJson } from '@newlogic-digital/utils-js'
5
-
6
- LibStimulus.register('lib-dialog', class extends Controller {
7
- async show({ currentTarget, params }) {
8
- const loadingClasses = (params.loadingClass ?? 'loading cursor-wait').split(' ')
9
-
10
- currentTarget.classList.add(...loadingClasses)
11
-
12
- await this.fetch(params.url, params)
13
-
14
- currentTarget.classList.remove(...loadingClasses)
15
- }
16
-
17
- async close({ currentTarget, params }) {
18
- await closeDialog(currentTarget.closest('dialog'), { remove: params.remove ?? true })
19
- }
20
-
21
- async fetch(url, options) {
22
- const { content } = await fetchJson(url)
23
-
24
- await insertDialog(content, options)
25
-
26
- initAfter(dialogSelector('.c-dialog'))
27
- }
28
- })
@@ -1,13 +0,0 @@
1
- import { LibStimulus, Controller } from './Stimulus.js'
2
- import { validateForm } from 'winduum/src/components/form/index.js'
3
-
4
- LibStimulus.register('lib-form', class extends Controller {
5
- connect() {
6
- this.element.noValidate = true
7
- this.element.addEventListener('submit', this.validate)
8
- }
9
-
10
- async validate(event) {
11
- validateForm(event)
12
- }
13
- })
@@ -1,37 +0,0 @@
1
- import { Controller, LibStimulus, initStimulus } from './Stimulus.js'
2
- import { initCookieConsent } from './CookieConsent.js'
3
- import {
4
- initNaja,
5
- NajaRecaptchaExtension,
6
- NajaFormValidityExtension
7
- } from '../Utils/naja.js'
8
- import naja from 'naja'
9
- import LibSwup from './Swup.js'
10
-
11
- LibStimulus.register('lib-naja', class extends Controller {
12
- async initialize() {
13
- naja.uiHandler.selector = '[data-naja]'
14
-
15
- await initNaja(this.element, false)
16
-
17
- if (naja.initialized) return
18
-
19
- naja.uiHandler.addEventListener('interaction', ({ detail }) => {
20
- detail.element.dispatchEvent(new CustomEvent('naja:interaction', { bubbles: true, cancelable: true }))
21
- })
22
-
23
- naja.snippetHandler.addEventListener('afterUpdate', ({ detail }) => {
24
- detail.snippet.dispatchEvent(new CustomEvent('naja:afterUpdate', { bubbles: true, cancelable: true }))
25
-
26
- initStimulus(detail.snippet)
27
- initNaja(detail.snippet)
28
- initCookieConsent(detail.snippet)
29
-
30
- LibSwup.cache.clear()
31
- })
32
-
33
- naja.registerExtension(NajaRecaptchaExtension)
34
- naja.registerExtension(NajaFormValidityExtension)
35
- naja.initialize()
36
- }
37
- })
@@ -1,25 +0,0 @@
1
- import { LibStimulus, Controller } from './Stimulus.js'
2
- import { importScript } from '@newlogic-digital/utils-js'
3
- import cdn from '../Utils/cdn.js'
4
-
5
- LibStimulus.register('lib-recaptcha', class extends Controller {
6
- static values = {
7
- api: String,
8
- action: String
9
- }
10
-
11
- connect() {
12
- importScript(cdn.recaptcha.replace('{apikey}', this.apiValue))
13
- }
14
-
15
- execute(event) {
16
- if (event?.detail?.recaptchaExecuted) return
17
-
18
- window.grecaptcha.enterprise.ready(() => {
19
- window.grecaptcha.enterprise.execute(this.apiValue, { action: this.actionValue ?? 'form' }).then((token) => {
20
- this.element.gtoken.value = token
21
- this.element.dispatchEvent(new CustomEvent('submit', { cancelable: true, detail: { recaptchaExecuted: true } }))
22
- })
23
- })
24
- }
25
- })