@newlogic-digital/ui 3.0.4 → 3.1.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 (109) hide show
  1. package/README.md +6 -10
  2. package/gulpfile.js +17 -168
  3. package/package.json +13 -8
  4. package/src/emails/email.css +3 -3
  5. package/src/emails/email.twig +1 -1
  6. package/src/icons.svg +32 -0
  7. package/src/main.json +12 -10
  8. package/src/scripts/Components/+.js +2 -2
  9. package/src/scripts/Components/CookieConsent.js +66 -64
  10. package/src/scripts/Components/Form.js +28 -21
  11. package/src/scripts/Layout/+.js +2 -1
  12. package/src/scripts/Layout/Header.js +18 -0
  13. package/src/scripts/Layout/Main.js +49 -45
  14. package/src/scripts/Libraries/+.js +12 -10
  15. package/src/scripts/Libraries/Anchor.js +18 -43
  16. package/src/scripts/Libraries/CookieConsent.js +37 -58
  17. package/src/scripts/Libraries/Dialog.js +56 -55
  18. package/src/scripts/Libraries/Drawer.js +23 -23
  19. package/src/scripts/Libraries/NativeSlider.js +86 -86
  20. package/src/scripts/Libraries/ReCaptcha.js +20 -18
  21. package/src/scripts/Libraries/Ripple.js +16 -32
  22. package/src/scripts/Libraries/Stimulus.js +30 -34
  23. package/src/scripts/Libraries/Swup.js +47 -50
  24. package/src/scripts/Libraries/Tabs.js +12 -18
  25. package/src/scripts/Libraries/Tippy.js +118 -0
  26. package/src/scripts/Ui/+.js +5 -3
  27. package/src/scripts/Ui/Checkbox.js +19 -0
  28. package/src/scripts/Ui/Input.js +188 -161
  29. package/src/scripts/Ui/Radio.js +23 -0
  30. package/src/scripts/Ui/Select.js +64 -37
  31. package/src/scripts/Ui/Text.js +25 -0
  32. package/src/scripts/Utils/Functions/+.js +6 -6
  33. package/src/scripts/Utils/Functions/dataValue.js +28 -25
  34. package/src/scripts/Utils/Functions/importScript.js +9 -11
  35. package/src/scripts/Utils/Functions/importStyle.js +18 -5
  36. package/src/scripts/Utils/Functions/inView.js +19 -21
  37. package/src/scripts/Utils/Functions/loadStimulus.js +22 -20
  38. package/src/scripts/Utils/cdn.js +6 -4
  39. package/src/scripts/Utils/global.js +10 -33
  40. package/src/scripts/main.js +6 -6
  41. package/src/styles/Components/CookieConsent.css +40 -179
  42. package/src/styles/Components/Dialog/Default.css +12 -15
  43. package/src/styles/Components/Form/CookieConsent.css +7 -12
  44. package/src/styles/Layout/+.css +2 -0
  45. package/src/{templates/Sections/.gitkeep → styles/Layout/Header.css} +0 -0
  46. package/src/styles/Layout/Main.css +28 -63
  47. package/src/styles/Layout/Nav.css +43 -0
  48. package/src/styles/Libraries/+.css +1 -1
  49. package/src/styles/Libraries/Datepicker.css +85 -39
  50. package/src/styles/Libraries/Dialog.css +6 -5
  51. package/src/styles/Libraries/Drawer.css +15 -14
  52. package/src/styles/Libraries/Hint.css +29 -23
  53. package/src/styles/Libraries/Lazysizes.css +2 -1
  54. package/src/styles/Libraries/NativeSlider.css +18 -17
  55. package/src/styles/Libraries/Ripple.css +8 -5
  56. package/src/styles/Libraries/Tabs.css +4 -4
  57. package/src/styles/Libraries/Tippy.css +87 -0
  58. package/src/styles/Ui/+.css +5 -1
  59. package/src/styles/Ui/Badge.css +33 -19
  60. package/src/styles/Ui/Btn.css +80 -53
  61. package/src/styles/Ui/Checkbox.css +80 -41
  62. package/src/styles/Ui/Dropdown.css +5 -0
  63. package/src/styles/Ui/Heading.css +12 -12
  64. package/src/styles/Ui/Icon.css +27 -8
  65. package/src/styles/Ui/Image.css +23 -0
  66. package/src/styles/Ui/Input.css +295 -220
  67. package/src/styles/Ui/Label.css +14 -0
  68. package/src/styles/Ui/Link.css +3 -3
  69. package/src/styles/Ui/Notice.css +14 -16
  70. package/src/styles/Ui/Progress.css +10 -21
  71. package/src/styles/Ui/Radio.css +3 -8
  72. package/src/styles/Ui/Select.css +63 -112
  73. package/src/styles/Ui/Switch.css +70 -0
  74. package/src/styles/Ui/{Wsw.css → Text.css} +61 -80
  75. package/src/styles/Ui/Title.css +8 -4
  76. package/src/styles/Utils/default.css +75 -67
  77. package/src/styles/Utils/icons.css +9 -0
  78. package/src/styles/Utils/keyframes.css +182 -0
  79. package/src/styles/Utils/normalize.css +223 -0
  80. package/src/styles/Utils/print.css +1 -1
  81. package/src/styles/Utils/tailwind/base.css +15 -0
  82. package/src/styles/Utils/tailwind/gutters.css +264 -263
  83. package/src/styles/Utils/theme/main.css +24 -21
  84. package/src/styles/Utils/vars.css +58 -35
  85. package/src/styles/Utils/vendor.css +1 -2
  86. package/src/styles/main.css +6 -3
  87. package/src/styles/tailwind.css +1 -4
  88. package/src/templates/Components/CookieConsent.twig +30 -0
  89. package/src/templates/Components/Dialogs/Basic.twig +7 -3
  90. package/src/templates/Layout/Header.twig +42 -0
  91. package/src/templates/Layout/Main.twig +52 -67
  92. package/src/templates/Sections/Gdpr.twig +64 -0
  93. package/src/templates/Sections/Ui.twig +2104 -0
  94. package/src/templates/dialog-basic.twig +2 -2
  95. package/src/templates/gdpr.json +11 -0
  96. package/src/templates/index.json +8 -2
  97. package/src/templates/json-tippy.twig +16 -0
  98. package/src/templates/ui.json +11 -0
  99. package/CHANGELOG +0 -231
  100. package/src/icons/iconfont.css +0 -171
  101. package/src/icons/selection.json +0 -1
  102. package/src/icons/variables.css +0 -31
  103. package/src/scripts/Ui/Wsw.js +0 -25
  104. package/src/scripts/Utils/Functions/bodyLoaded.js +0 -12
  105. package/src/styles/Libraries/Animate.css +0 -184
  106. package/src/styles/Utils/reference.css +0 -2
  107. package/src/styles/Utils/tailwind/content.css +0 -24
  108. package/src/styles/Utils/theme/vars.css +0 -19
  109. package/src/styles/preload.css +0 -29
package/README.md CHANGED
@@ -10,9 +10,7 @@
10
10
 
11
11
  # 🎨 Newlogic UI
12
12
 
13
- > v3 is still in early development
14
-
15
- Modern and modular CSS framework with the best principles.
13
+ Lightweight, modern and modular CSS framework with the best principles
16
14
 
17
15
  - 💡 Modern
18
16
  - 📦 Modular
@@ -20,7 +18,9 @@ Modern and modular CSS framework with the best principles.
20
18
  - ✨️ Progressive
21
19
  - ⚡️ Fast
22
20
 
23
- Newlogic UI is component framework with simple syntax. Inspired by popular frameworks like Bootstrap and Bulma. It uses Tailwind CSS for utility classes. The modern approach comes first.
21
+ Newlogic UI is component framework with easy syntax. Modern approach of CSS properties, enriched with utility classes from Tailwind. Inspired by favourite frameworks like Boostrap and Bulma
22
+
23
+ Javascript implementation is mainly intended for use on backend rendered websites and applications such as with PHP
24
24
 
25
25
  ## ⚙️ Under the hood
26
26
  * **[Newlogic Core](https://core.newlogic.cz/)** - set of tools that can be used to create modern web applications
@@ -32,7 +32,7 @@ Newlogic UI is component framework with simple syntax. Inspired by popular frame
32
32
  * **Easy syntax** - .ui-btn (ui elements), .c-component (components), .c-section (sections) etc.
33
33
 
34
34
 
35
- The core of the Newlogic UI is Newlogic Core, which compiles modern JS and CSS code and contains other tools for web development. The source code is written in way that it can be used with other tools or a completely different environment than NodeJS, such as Deno. In general the rule is that the source code should be executable in current or future browsers, so it's written with W3C standards in mind. The framework is modular and you can really use only what is needed for your project.
35
+ The core of the Newlogic UI is Newlogic Core, which compiles modern JS and CSS syntax and contains other tools for web development. Source code can be used with any other tools or even different environment than NodeJS, eg. Deno and is written in W3C standards and should be runnable in current or future version of browsers. The framework is modular, and you can really use only what is needed for your project.
36
36
 
37
37
  ## 🪄 Instalation
38
38
 
@@ -56,7 +56,6 @@ $ npm i @newlogic-newlogic/ui
56
56
 
57
57
  ```css
58
58
  /* main.css or individual modules */
59
- @import "node_modules/@newlogic/ui/src/icons/style.css"
60
59
  @import "node_modules/@newlogic/ui/src/styles/main.css"
61
60
  ```
62
61
 
@@ -75,10 +74,7 @@ import "node_modules/@newlogic/ui/src/scripts/main.js"
75
74
  Each Newlogic Core project has to have config via `gulpfile.js`, docs - [core.newlogic.cz](https://core.newlogic.cz/)
76
75
 
77
76
  ## 📌 Future plans
78
- - finishing docs and translating it to english
79
- - lighthouse optimization
80
- - upgrading form elements
81
- - new elements - dropdown, notificaton, snack and more
77
+ - performance optimization
82
78
 
83
79
  ## Licence
84
80
  GNU GPLv3
package/gulpfile.js CHANGED
@@ -1,192 +1,41 @@
1
- import {defineConfig} from "@newlogic-digital/core";
2
- import postcssMixins from "postcss-mixins";
1
+ import { defineConfig } from '@newlogic-digital/core'
2
+ import cms from "./src/module.cms.js"
3
3
 
4
4
  export default defineConfig({
5
+ config: true,
6
+ modules: {cms},
7
+ serve: {
8
+ https: true
9
+ },
5
10
  scripts: {
6
11
  importResolution: {
7
- directories: ["Components", "Sections", "Layout", "Libraries", "Utils/Functions"]
12
+ directories: ['Components', 'Sections', 'Layout', 'Libraries', 'Utils/Functions', 'Ui']
8
13
  },
9
14
  importMap: {
10
- build: true,
15
+ build: false,
11
16
  trailingSlashes: /(vanillajs-datepicker)/
12
17
  }
13
18
  },
14
19
  styles: {
15
20
  purge: {
16
- content: ['src/scripts/**/*.js', 'src/templates/**/*.twig', 'temp/cdn/*.js'],
21
+ enabled: true,
22
+ content: ['src/scripts/**/*.js', 'src/templates/**/*.twig', 'www/templates/**/*.tpl', 'temp/cdn/*.js', 'admin_ex/js/templates/*.html', 'index.html'],
17
23
  options: {
18
24
  safelist: {
19
25
  standard: [/(class|is-|to-|grecaptcha)/],
20
- deep: [/(ui-wsw|wsw|datepicker)/]
26
+ deep: [/(ui-text|wsw|datepicker)/]
21
27
  }
22
28
  }
23
29
  },
24
30
  vendor: {
25
- path: "Utils/vendor.css"
31
+ path: 'Utils/vendor.css'
26
32
  },
27
33
  importResolution: {
28
- directories: ["Components", "Sections", "Layout", "Libraries", "Ui"]
34
+ directories: ['Components', 'Sections', 'Layout', 'Libraries', 'Ui']
29
35
  },
30
- themePath: "Utils/theme/{THEME}.{FORMAT}",
36
+ themePath: 'Utils/theme/{THEME}.{FORMAT}',
31
37
  postcss: {
32
- extend: [postcssMixins]
38
+ extend: []
33
39
  }
34
- },
35
- tailwind: {
36
- darkMode: "class", // or "media" or "class"
37
- corePlugins: {
38
- preflight: false,
39
- container: false,
40
- ringWidth: false,
41
- ringColor: false,
42
- ringOpacity: false,
43
- ringOffsetWidth: false,
44
- ringOffsetColor: false,
45
- gradientColorStops: false,
46
- backgroundImage: false,
47
- boxShadow: false
48
- },
49
- theme: {
50
- extend: {
51
- colors: {
52
- background: ({ opacityVariable, opacityValue }) => {
53
- if (opacityValue !== undefined) {
54
- return `rgba(var(--color-background), ${opacityValue})`
55
- }
56
- if (opacityVariable !== undefined) {
57
- return `rgba(var(--color-background), var(${opacityVariable}, 1))`
58
- }
59
- return `rgb(var(--color-background))`
60
- },
61
- default: ({ opacityVariable, opacityValue }) => {
62
- if (opacityValue !== undefined) {
63
- return `rgba(var(--color-default), ${opacityValue})`
64
- }
65
- if (opacityVariable !== undefined) {
66
- return `rgba(var(--color-default), var(${opacityVariable}, 1))`
67
- }
68
- return `rgb(var(--color-default))`
69
- },
70
- invert: ({ opacityVariable, opacityValue }) => {
71
- if (opacityValue !== undefined) {
72
- return `rgba(var(--color-invert), ${opacityValue})`
73
- }
74
- if (opacityVariable !== undefined) {
75
- return `rgba(var(--color-invert), var(${opacityVariable}, 1))`
76
- }
77
- return `rgb(var(--color-invert))`
78
- },
79
- light: ({ opacityVariable, opacityValue }) => {
80
- if (opacityValue !== undefined) {
81
- return `rgba(var(--color-light), ${opacityValue})`
82
- }
83
- if (opacityVariable !== undefined) {
84
- return `rgba(var(--color-light), var(${opacityVariable}, 1))`
85
- }
86
- return `rgb(var(--color-light))`
87
- },
88
- dark: ({ opacityVariable, opacityValue }) => {
89
- if (opacityValue !== undefined) {
90
- return `rgba(var(--color-dark), ${opacityValue})`
91
- }
92
- if (opacityVariable !== undefined) {
93
- return `rgba(var(--color-dark), var(${opacityVariable}, 1))`
94
- }
95
- return `rgb(var(--color-dark))`
96
- },
97
- primary: ({ opacityVariable, opacityValue }) => {
98
- if (opacityValue !== undefined) {
99
- return `rgba(var(--color-primary), ${opacityValue})`
100
- }
101
- if (opacityVariable !== undefined) {
102
- return `rgba(var(--color-primary), var(${opacityVariable}, 1))`
103
- }
104
- return `rgb(var(--color-primary))`
105
- },
106
- secondary: ({ opacityVariable, opacityValue }) => {
107
- if (opacityValue !== undefined) {
108
- return `rgba(var(--color-secondary), ${opacityValue})`
109
- }
110
- if (opacityVariable !== undefined) {
111
- return `rgba(var(--color-secondary), var(${opacityVariable}, 1))`
112
- }
113
- return `rgb(var(--color-secondary))`
114
- },
115
- warning: ({ opacityVariable, opacityValue }) => {
116
- if (opacityValue !== undefined) {
117
- return `rgba(var(--color-warning), ${opacityValue})`
118
- }
119
- if (opacityVariable !== undefined) {
120
- return `rgba(var(--color-warning), var(${opacityVariable}, 1))`
121
- }
122
- return `rgb(var(--color-warning))`
123
- },
124
- error: ({ opacityVariable, opacityValue }) => {
125
- if (opacityValue !== undefined) {
126
- return `rgba(var(--color-error), ${opacityValue})`
127
- }
128
- if (opacityVariable !== undefined) {
129
- return `rgba(var(--color-error), var(${opacityVariable}, 1))`
130
- }
131
- return `rgb(var(--color-error))`
132
- },
133
- info: ({ opacityVariable, opacityValue }) => {
134
- if (opacityValue !== undefined) {
135
- return `rgba(var(--color-info), ${opacityValue})`
136
- }
137
- if (opacityVariable !== undefined) {
138
- return `rgba(var(--color-info), var(${opacityVariable}, 1))`
139
- }
140
- return `rgb(var(--color-info))`
141
- },
142
- success: ({ opacityVariable, opacityValue }) => {
143
- if (opacityValue !== undefined) {
144
- return `rgba(var(--color-success), ${opacityValue})`
145
- }
146
- if (opacityVariable !== undefined) {
147
- return `rgba(var(--color-success), var(${opacityVariable}, 1))`
148
- }
149
- return `rgb(var(--color-success))`
150
- }
151
- }
152
- },
153
- fontFamily: {
154
- primary: "var(--font-primary)",
155
- secondary: "var(--font-secondary)"
156
- },
157
- fontWeight: {
158
- light: "var(--weight-light)",
159
- normal: "var(--weight-normal)",
160
- medium: "var(--weight-medium)",
161
- semibold: "var(--weight-semibold)",
162
- bold: "var(--weight-bold)",
163
- extrabold: "var(--weight-extrabold)"
164
- },
165
- zIndex: {
166
- "0": 0,
167
- "10": "var(--z-10)",
168
- "20": "var(--z-20)",
169
- "30": "var(--z-30)",
170
- "40": "var(--z-40)",
171
- "50": "var(--z-50)",
172
- "auto": "auto"
173
- },
174
- screens: {
175
- "m": {"max": "47.9375em"},
176
- "t": "48em",
177
- "d": "60em",
178
- "w": "76em",
179
- "hd": "88em",
180
- "touch": {"max": "59.9375em"},
181
- }
182
- },
183
- variants: {
184
- extend: {
185
- backgroundColor: ['checked'],
186
- borderColor: ['checked'],
187
- textColor: ['checked'],
188
- }
189
- },
190
- plugins: [],
191
40
  }
192
- })
41
+ })
package/package.json CHANGED
@@ -1,22 +1,27 @@
1
1
  {
2
2
  "name": "@newlogic-digital/ui",
3
- "version": "3.0.4",
3
+ "version": "3.1.0",
4
4
  "type": "module",
5
5
  "main": "gulpfile.js",
6
6
  "author": "New Logic Studio s.r.o.",
7
- "description": "Modern and modular CSS framework with the best principles",
7
+ "description": "Lightweight, modern and modular CSS framework with the best principles",
8
8
  "license": "GNU GPLv3",
9
+ "scripts": {
10
+ "utils:eslint": "eslint 'src/scripts/**/*.js' --fix",
11
+ "utils:stylelint": "stylelint 'src/styles/**/*.css' --fix"
12
+ },
9
13
  "imports": {},
10
14
  "dependencies": {
11
- "@simonwep/pickr": "^1.8.0",
12
- "cleave.js": "^1.6.0",
13
- "stimulus": "2.0.0",
15
+ "@simonwep/pickr": "^1.8.2",
16
+ "@hotwired/stimulus": "3.0.1",
14
17
  "swup": "2.0.14",
15
- "vanillajs-datepicker": "^1.1.4"
18
+ "tippy.js": "^6.3.7",
19
+ "vanillajs-datepicker": "^1.2.0"
16
20
  },
17
21
  "devDependencies": {
18
- "@newlogic-digital/core": "~0.5.11",
19
- "postcss-mixins": "^7.0.3"
22
+ "@newlogic-digital/core": "~0.9.5",
23
+ "eslint-config-standard": "^16.0.3",
24
+ "stylelint-config-standard": "^24.0.0"
20
25
  },
21
26
  "files": [
22
27
  "src",
@@ -1,7 +1,7 @@
1
1
  @import "../styles/Utils/theme/main.css";
2
2
 
3
3
  :root {
4
- --width : 660px;
4
+ --width: 660px;
5
5
  --container: 30px;
6
6
  }
7
7
 
@@ -72,6 +72,6 @@ p {
72
72
 
73
73
  @media print {
74
74
  * {
75
- -webkit-print-color-adjust:exact;
75
+ -webkit-print-color-adjust: exact;
76
76
  }
77
- }
77
+ }
@@ -6,7 +6,7 @@
6
6
  <!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]-->
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
8
  <style type="text/css" n:syntax="off">
9
- {{ fetch ("/temp/emails/email.css") }}
9
+ {{ fetch ('/temp/emails/email.css') }}
10
10
  </style>
11
11
  </head>
12
12
  <body>
package/src/icons.svg ADDED
@@ -0,0 +1,32 @@
1
+ <svg hidden="">
2
+ <symbol id="icon-chevron-left" fill="none" viewBox="0 0 24 24" stroke="currentColor">
3
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
4
+ </symbol>
5
+ <symbol id="icon-chevron-right" fill="none" viewBox="0 0 24 24" stroke="currentColor">
6
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
7
+ </symbol>
8
+ <symbol id="icon-angle-down" fill="currentColor" viewBox="0 0 24 24" stroke="currentColor">
9
+ <path d="M10.998 15.467c.491.71 1.513.71 2.004 0l3.767-5.453c.581-.843 0-2.013-1.002-2.014H8.234C7.232 8 6.65 9.17 7.231 10.014z" />
10
+ </symbol>
11
+ <symbol id="icon-angle-up" fill="currentColor" viewBox="0 0 24 24" stroke="currentColor">
12
+ <path d="M10.998 15.467c.491.71 1.513.71 2.004 0l3.767-5.453c.581-.843 0-2.013-1.002-2.014H8.234C7.232 8 6.65 9.17 7.231 10.014z" style="transform: scaleY(-1) translateY(1px); transform-origin: 50% 50%;" />
13
+ </symbol>
14
+ <symbol id="icon-exclamation-circle" fill="none" viewBox="0 0 24 24" stroke="currentColor">
15
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
16
+ </symbol>
17
+ <symbol id="icon-x" fill="none" viewBox="0 0 24 24" stroke="currentColor">
18
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.75" d="M6 18L18 6M6 6l12 12" />
19
+ </symbol>
20
+ <symbol id="icon-menu" fill="none" viewBox="0 0 24 24" stroke="currentColor">
21
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
22
+ </symbol>
23
+ <symbol id="icon-moon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
24
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" />
25
+ </symbol>
26
+ <symbol id="icon-sun" fill="none" viewBox="0 0 24 24" stroke="currentColor">
27
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z" />
28
+ </symbol>
29
+ <symbol id="icon-at-symbol" fill="none" viewBox="0 0 24 24" stroke="currentColor">
30
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9m4.5-1.206a8.959 8.959 0 01-4.5 1.207" />
31
+ </symbol>
32
+ </svg>
package/src/main.json CHANGED
@@ -8,27 +8,29 @@
8
8
  "css": {
9
9
  "all": [
10
10
  "/src/styles/main.css",
11
- "https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=block",
12
- "/src/icons/iconfont.css"
11
+ "https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=block"
13
12
  ],
14
- "preload": "/src/styles/preload.css",
15
13
  "tailwind": "/temp/tailwind.css",
16
- "tailwind.src": "/src/styles/tailwind.css"
14
+ "tailwind.src": "/src/styles/tailwind.css",
15
+ "ratio": "/temp/ratio.css"
17
16
  },
18
17
  "js": {
19
18
  "importmap": "/public/importmap.json",
20
- "core": "/src/scripts/main.js",
21
- "es-module-shims": "https://cdn.jsdelivr.net/npm/es-module-shims@0.10.4/dist/es-module-shims.js",
22
- "lazysizes": "https://cdn.jsdelivr.net/npm/lazysizes@5.2.2/lazysizes.min.js"
19
+ "main": "/src/scripts/main.js",
20
+ "lazysizes": "https://cdn.jsdelivr.net/npm/lazysizes@5.3.2/lazysizes.min.js"
23
21
  }
24
22
  },
25
23
  "layout": {
26
24
  "template": "Layout/Main.twig",
27
- "cookies": true,
25
+ "cookies": false,
28
26
  "nav": [
29
27
  {
30
- "name": "Domů",
28
+ "name": "Home",
31
29
  "url": "/"
30
+ },
31
+ {
32
+ "name": "Documentation",
33
+ "url": "/ui"
32
34
  }
33
35
  ]
34
36
  },
@@ -47,4 +49,4 @@
47
49
  "8x5": "data:image/gif;base64,R0lGODlhCAAFAIAAAP///wAAACwAAAAACAAFAAACBYSPqctYADs=",
48
50
  "3x2": "data:image/gif;base64,R0lGODlhAwACAIAAAP///wAAACwAAAAAAwACAAACAoRfADs="
49
51
  }
50
- }
52
+ }
@@ -1,2 +1,2 @@
1
- import './CookieConsent.js';
2
- import './Form.js';
1
+ import './CookieConsent.js'
2
+ import './Form.js'
@@ -1,80 +1,82 @@
1
- import {LibStimulus, Controller} from "../Libraries/Stimulus.js";
2
- import LibCookieConsent from "../Libraries/CookieConsent.js";
1
+ import { LibStimulus, Controller } from '../Libraries/Stimulus.js'
2
+ import LibCookieConsent from '../Libraries/CookieConsent.js'
3
3
 
4
- LibCookieConsent.init();
5
-
6
- LibStimulus.register("c-cookieconsent", class extends Controller {
4
+ LibStimulus.register('c-cookieconsent', class extends Controller {
7
5
  connect() {
8
- const selector = this.element;
6
+ const selector = this.element
7
+
8
+ if (document.querySelector('.c-form-cookieconsent') !== null) {
9
+ return
10
+ }
9
11
 
10
- if (localStorage.getItem('cookieconsent') === null) {
12
+ if (localStorage.getItem('lib-cookieconsent') === null || parseInt(localStorage.getItem('lib-cookieconsent-expire')) < Date.now()) {
11
13
  setTimeout(() => {
12
- selector._addDataValue("state", "active");
13
- selector.classList.add("is-animate");
14
- },1500);
14
+ selector._addDataValue('state', 'active')
15
+ selector.classList.add('is-animate')
16
+ }, 1500)
15
17
  }
16
18
 
17
- selector.addEventListener("click", () => {
18
- selector.classList.add("is-mobile-show");
19
- });
20
-
21
- selector.querySelector("[data-lib-cookieconsent-approve]").addEventListener("click", () => {
22
- LibCookieConsent.set("approve");
23
- selector.classList.remove("is-animate");
24
-
25
- setTimeout(function(){
26
- selector._removeDataValue("state", "active");
27
- selector.remove();
28
- },500);
29
- });
30
-
31
- selector.querySelector("[data-lib-cookieconsent-decline]").addEventListener("click", () => {
32
- LibCookieConsent.set("performance");
33
- selector.classList.remove("is-animate");
34
-
35
- setTimeout(function(){
36
- selector._removeDataValue("state", "active");
37
- selector.remove();
38
- },500);
39
- });
19
+ selector._hasDataValue('type', 'closable') &&
20
+ selector.addEventListener('click', e => {
21
+ if (e.target.closest('.c-cookieconsent > .wrp') === null) {
22
+ this.hide([])
23
+ }
24
+ })
25
+
26
+ selector.querySelector('[data-lib-cookieconsent-approve]').addEventListener('click', () => {
27
+ this.hide(['performance', 'marketing'])
28
+ })
29
+ }
30
+
31
+ hide(type) {
32
+ LibCookieConsent.set(type)
33
+ this.element.classList.remove('is-animate')
34
+
35
+ setTimeout(() => {
36
+ this.element._removeDataValue('state', 'active')
37
+ this.element.remove()
38
+ }, 500)
40
39
  }
41
- });
40
+ })
42
41
 
43
- LibStimulus.register("c-form-cookieconsent", class extends Controller {
42
+ LibStimulus.register('c-form-cookieconsent', class extends Controller {
44
43
  connect() {
45
- const selector = this.element;
46
-
47
- if (localStorage.getItem('cookieconsent') !== null) {
48
- if (localStorage.getItem('cookieconsent') === "approve") {
49
- let type = localStorage.getItem('cookieconsent_type');
50
- if (type !== null) {
51
- if (type === "performance") {
52
- selector.querySelector(`input[value="performance"]`).checked = true;
53
- } else {
54
- selector.querySelector(`input[value="approve"]`).checked = true;
55
- }
56
- } else {
57
- selector.querySelector(`input[value="approve"]`).checked = true;
44
+ const selector = this.element
45
+ const type = localStorage.getItem('lib-cookieconsent')
46
+
47
+ document.querySelector('.c-cookieconsent').classList.remove('is-animate')
48
+ document.querySelector('.c-cookieconsent')._removeDataValue('state', 'active')
49
+
50
+ if (type !== null) {
51
+ this.element.querySelectorAll('input:not([disabled])').forEach(input => {
52
+ input.checked = false
53
+ })
54
+
55
+ JSON.parse(type).forEach(type => {
56
+ if (selector.querySelector(`input[value="${type}"]`) !== null) {
57
+ selector.querySelector(`input[value="${type}"]`).checked = true
58
58
  }
59
- } else if (localStorage.getItem('cookieconsent') === "decline") {
60
- selector.querySelector(`input[value="decline"]`).checked = true;
61
- }
59
+ })
62
60
  }
63
61
 
64
- selector.addEventListener("submit", (e) => {
65
- e.preventDefault();
62
+ selector.addEventListener('submit', e => {
63
+ e.preventDefault()
66
64
 
67
- let value = (new FormData(e.target)).get("cookies");
65
+ const type = []
68
66
 
69
- if (value === "approve") {
70
- LibCookieConsent.set("marketing");
71
- location.reload();
72
- } else if (value === "performance") {
73
- LibCookieConsent.set("performance");
74
- location.reload();
75
- } else if (value === "decline") {
76
- LibCookieConsent.set("decline", () => location.reload());
77
- }
67
+ this.element.querySelectorAll('input:not([disabled])').forEach(input => {
68
+ input.checked && type.push(input.value)
69
+ })
70
+
71
+ LibCookieConsent.set(type)
72
+ location.reload()
78
73
  })
79
74
  }
80
- });
75
+
76
+ disconnect() {
77
+ if (localStorage.getItem('lib-cookieconsent') === null || parseInt(localStorage.getItem('lib-cookieconsent-expire')) < Date.now()) {
78
+ document.querySelector('.c-cookieconsent')._addDataValue('state', 'active')
79
+ document.querySelector('.c-cookieconsent').classList.add('is-animate')
80
+ }
81
+ }
82
+ })
@@ -1,26 +1,33 @@
1
- import {LibStimulus, Controller} from "../Libraries/Stimulus.js";
1
+ import { LibStimulus, Controller, getController } from '../Libraries/Stimulus.js'
2
2
 
3
- LibStimulus.register("c-form", class extends Controller {
4
- connect() {
5
- let element = this.element;
3
+ LibStimulus.register('c-form', class extends Controller {
4
+ validate(element, e) {
5
+ if (element.reportValidity() === false) {
6
+ e.preventDefault()
7
+ e.stopPropagation()
8
+ }
6
9
 
7
- if (typeof HTMLFormElement.prototype.reportValidity !== "undefined") {
8
- element.setAttribute("novalidate","");
9
- element.addEventListener('submit', (event) => {
10
- if (element.reportValidity() === false) {
11
- event.preventDefault();
12
- event.stopPropagation();
13
- }
10
+ element.querySelectorAll('.ui-input').forEach(element => {
11
+ getController(element, 'ui-input').validate(element, true)
12
+ })
14
13
 
15
- [...element.querySelectorAll(".ui-input")].map((element) => {
16
- console.log(element);
17
- LibStimulus.getController(element, "ui-input").validateInput(element, true)
18
- });
14
+ element.querySelectorAll('.ui-select:not([data-state*="active"]) select[required]').forEach(select => {
15
+ getController(select.parentNode, 'ui-select').validate(select.parentNode, select)
16
+ })
19
17
 
20
- [...element.querySelectorAll(`.ui-select:not([data-state*="active"]) select[required]`)].map((element) => {
21
- element.parentNode._addDataValue("state", "invalid");
22
- });
23
- }, false);
24
- }
18
+ element.querySelectorAll('[data-controller="ui-checkbox"] input:not([type="hidden"])').forEach(input => {
19
+ input.parentNode._removeDataValue('state', 'valid invalid')
20
+
21
+ if (input.checkValidity()) {
22
+ input.parentNode._addDataValue('state', 'valid')
23
+ } else {
24
+ input.parentNode._addDataValue('state', 'invalid')
25
+ }
26
+ })
27
+ }
28
+
29
+ connect() {
30
+ this.element.setAttribute('novalidate', '')
31
+ this.element.addEventListener('submit', e => this.validate(this.element, e))
25
32
  }
26
- });
33
+ })
@@ -1 +1,2 @@
1
- import './Main.js';
1
+ import './Header.js'
2
+ import './Main.js'
@@ -0,0 +1,18 @@
1
+ import { LibStimulus, Controller, getController } from '../Libraries/Stimulus.js'
2
+
3
+ LibStimulus.register('l-header', class extends Controller {
4
+ connect() {
5
+ if (document.querySelector('#l-nav') === null) {
6
+ this.element.insertAdjacentHTML('afterend', '<div id="l-nav" class="lib-drawer" data-lib-drawer-target="nav" data-action="scroll->lib-drawer#scroll"><div class="wrp_nav"><div class="wrp_nav_head"></div><div class="wrp_nav_body"></div></div></div>')
7
+
8
+ getController(document.body, 'lib-drawer').init()
9
+
10
+ const layoutNav = document.querySelector('#l-nav')
11
+ const logo = this.element.querySelector('.elm_header_logo').outerHTML
12
+ const nav = this.element.querySelector('.elm_header_nav').outerHTML
13
+
14
+ layoutNav.querySelector('.wrp_nav_head').insertAdjacentHTML('beforeend', logo)
15
+ layoutNav.querySelector('.wrp_nav_body').insertAdjacentHTML('beforeend', nav)
16
+ }
17
+ }
18
+ })