@newlogic-digital/ui 3.1.0 → 3.3.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 (97) hide show
  1. package/.eslintrc +13 -0
  2. package/.stylelintrc +18 -0
  3. package/README.md +15 -17
  4. package/package.json +29 -15
  5. package/public/sw.js +30 -0
  6. package/src/{main.json → data/main.json} +6 -1
  7. package/src/emails/email.prod.html +6 -0
  8. package/src/emails/email.twig.html +6 -0
  9. package/src/emails/{email.css → styles/email.css} +1 -1
  10. package/src/emails/templates/Content.twig +16 -0
  11. package/src/emails/templates/Header.twig +14 -0
  12. package/src/emails/templates/Layout.twig +23 -0
  13. package/src/emails/templates.prod/.gitkeep +0 -0
  14. package/src/scripts/Components/+.js +0 -1
  15. package/src/scripts/Components/CookieConsent.js +16 -14
  16. package/src/scripts/Layout/Main.js +3 -3
  17. package/src/scripts/Libraries/+.js +2 -1
  18. package/src/scripts/Libraries/CookieConsent.js +10 -4
  19. package/src/scripts/Libraries/Dialog.js +8 -1
  20. package/src/scripts/Libraries/Drawer.js +16 -14
  21. package/src/scripts/Libraries/Form.js +31 -0
  22. package/src/scripts/Libraries/NativeSlider.js +2 -1
  23. package/src/scripts/Libraries/ReCaptcha.js +9 -4
  24. package/src/scripts/Libraries/Script.js +19 -0
  25. package/src/scripts/Libraries/Stimulus.js +1 -31
  26. package/src/scripts/Libraries/Swup.js +7 -10
  27. package/src/scripts/Libraries/Tabs.js +5 -5
  28. package/src/scripts/Libraries/Tippy.js +3 -1
  29. package/src/scripts/Ui/+.js +0 -1
  30. package/src/scripts/Ui/Checkbox.js +4 -13
  31. package/src/scripts/Ui/Input.js +23 -69
  32. package/src/scripts/Ui/Select.js +11 -39
  33. package/src/scripts/Ui/Text.js +2 -4
  34. package/src/scripts/Utils/+.js +3 -0
  35. package/src/scripts/Utils/Functions/+.js +2 -1
  36. package/src/scripts/Utils/Functions/checkValidity.js +44 -0
  37. package/src/scripts/Utils/Functions/inView.js +7 -8
  38. package/src/scripts/Utils/Functions/replaceTag.js +12 -0
  39. package/src/scripts/Utils/cdn.js +1 -1
  40. package/src/scripts/Utils/global.js +6 -8
  41. package/src/styles/Components/+.css +1 -1
  42. package/src/styles/Components/Dropdown/+.css +1 -0
  43. package/src/styles/{Ui/Dropdown.css → Components/Dropdown/Default.css} +1 -1
  44. package/src/styles/Layout/Header.css +54 -0
  45. package/src/styles/Libraries/+.css +0 -1
  46. package/src/styles/Libraries/Drawer.css +1 -1
  47. package/src/styles/Libraries/Hint.css +4 -3
  48. package/src/styles/Libraries/NativeSlider.css +9 -1
  49. package/src/styles/Libraries/Tippy.css +1 -1
  50. package/src/styles/Ui/+.css +0 -1
  51. package/src/styles/Ui/Badge.css +1 -1
  52. package/src/styles/Ui/Btn.css +24 -6
  53. package/src/styles/Ui/Checkbox.css +28 -2
  54. package/src/styles/Ui/Heading.css +2 -1
  55. package/src/styles/Ui/Icon.css +2 -2
  56. package/src/styles/Ui/Image.css +1 -7
  57. package/src/styles/Ui/Input.css +65 -18
  58. package/src/styles/Ui/Label.css +2 -2
  59. package/src/styles/Ui/Link.css +12 -5
  60. package/src/styles/Ui/Notice.css +1 -1
  61. package/src/styles/Ui/Select.css +3 -5
  62. package/src/styles/Ui/Text.css +13 -4
  63. package/src/styles/Ui/Title.css +3 -2
  64. package/src/styles/Utils/+.css +9 -0
  65. package/src/styles/Utils/default.css +0 -7
  66. package/src/styles/Utils/keyframes.css +4 -4
  67. package/src/styles/Utils/tailwind/+.css +2 -0
  68. package/src/styles/Utils/tailwind/base.css +25 -0
  69. package/src/styles/Utils/theme/+.css +1 -0
  70. package/src/styles/Utils/vars.css +32 -8
  71. package/src/styles/main.css +2 -0
  72. package/src/templates/Components/CookieConsent.twig +2 -2
  73. package/src/templates/Layout/Main.twig +1 -7
  74. package/src/templates/Sections/Ui/Docs/@intro.html +97 -0
  75. package/src/templates/Sections/Ui/Docs/@nav.html +195 -0
  76. package/src/templates/Sections/Ui/Docs/@styles.html +100 -0
  77. package/src/templates/Sections/Ui/Docs/Default.twig +1600 -0
  78. package/src/templates/Sections/Ui/Icons.html +28 -0
  79. package/src/templates/Sections/Ui/Intro.html +136 -0
  80. package/src/templates/Sections/Ui.twig +5 -2101
  81. package/src/templates/Utils/sections.twig +2 -2
  82. package/src/views/dialog/basic.json.twig +3 -0
  83. package/src/{templates/json-tippy.twig → views/dropdown/tippy.json.twig} +3 -3
  84. package/src/views/gdpr.json +12 -0
  85. package/src/{templates → views}/index.json +2 -2
  86. package/src/{templates/ui.json → views/ui-icons.json} +3 -2
  87. package/src/{templates/gdpr.json → views/ui.json} +1 -1
  88. package/tailwind.config.cjs +69 -0
  89. package/vite.config.js +10 -0
  90. package/gulpfile.js +0 -41
  91. package/src/emails/email.twig +0 -60
  92. package/src/scripts/Components/Form.js +0 -33
  93. package/src/scripts/Ui/Radio.js +0 -23
  94. package/src/styles/Components/Item/+.css +0 -1
  95. package/src/styles/Libraries/Lazysizes.css +0 -9
  96. package/src/styles/tailwind.css +0 -2
  97. package/src/templates/dialog-basic.twig +0 -3
@@ -1,3 +1,3 @@
1
1
  {% for section in sections %}
2
- {% include '../' ~ section.src ~ '.twig' %}
3
- {% endfor %}
2
+ {% include '../' ~ section.src %}
3
+ {% endfor %}
@@ -0,0 +1,3 @@
1
+ {% json 'dialog' %}
2
+ {% include '@templates/Components/Dialogs/Basic.twig' %}
3
+ {% endjson %}
@@ -1,6 +1,6 @@
1
1
  {% json 'content' %}
2
- <div class="ui-dropdown">
3
- <ul class="wrp_ui_list flex-col row-y gy-4">
2
+ <div class="c-dropdown">
3
+ <ul class="wrp_c_list flex-col row-y gy-4">
4
4
  <li class="col">
5
5
  <button class="ui-link">
6
6
  <span>{edit}</span>
@@ -13,4 +13,4 @@
13
13
  </li>
14
14
  </ul>
15
15
  </div>
16
- {% endjson %}
16
+ {% endjson %}
@@ -0,0 +1,12 @@
1
+ {
2
+ "headerNormal": true,
3
+ "page": {
4
+ "title": "Newlogic UI",
5
+ "body": [
6
+ {
7
+ "src": "Sections/Gdpr.twig",
8
+ "intro": true
9
+ }
10
+ ]
11
+ }
12
+ }
@@ -4,9 +4,9 @@
4
4
  "title": "Newlogic UI",
5
5
  "body": [
6
6
  {
7
- "src": "Sections/Ui",
7
+ "src": "Sections/Ui.twig",
8
8
  "intro": true
9
9
  }
10
10
  ]
11
11
  }
12
- }
12
+ }
@@ -4,8 +4,9 @@
4
4
  "title": "Newlogic UI",
5
5
  "body": [
6
6
  {
7
- "src": "Sections/Ui"
7
+ "src": "Sections/Ui.twig",
8
+ "icons": true
8
9
  }
9
10
  ]
10
11
  }
11
- }
12
+ }
@@ -4,7 +4,7 @@
4
4
  "title": "Newlogic UI",
5
5
  "body": [
6
6
  {
7
- "src": "Sections/Gdpr"
7
+ "src": "Sections/Ui.twig"
8
8
  }
9
9
  ]
10
10
  }
@@ -0,0 +1,69 @@
1
+ const { tailwindColors, tailwindVariables, tailwindColorsAccent, tailwindColorsCurrent, tailwindAnimations, tailwindRadius } = require('@vituum/tailwind/helpers.cjs')
2
+ const plugin = require('tailwindcss/plugin')
3
+
4
+ const colors = [
5
+ 'background', 'default', 'invert', 'light', 'dark', 'primary', 'secondary',
6
+ 'warning', 'error', 'info', 'success', 'accent'
7
+ ]
8
+
9
+ const radius = ['xs', 'sm', 'base', 'md', 'lg', 'xl', '2xl', '3xl', 'full']
10
+
11
+ const animations = [
12
+ 'fade-in', 'fade-out'
13
+ ]
14
+
15
+ module.exports = {
16
+ darkMode: 'class',
17
+ content: [
18
+ './src/**/*.{js,html,twig}'
19
+ ],
20
+ corePlugins: {
21
+ preflight: false,
22
+ container: false,
23
+ ringWidth: false,
24
+ ringColor: false,
25
+ ringOpacity: false,
26
+ ringOffsetWidth: false,
27
+ ringOffsetColor: false,
28
+ gradientColorStops: false,
29
+ backgroundImage: false,
30
+ accentColor: false,
31
+ borderRadius: false
32
+ },
33
+ theme: {
34
+ extend: {
35
+ colors: tailwindColors(colors),
36
+ fontFamily: tailwindVariables('font', ['primary', 'secondary']),
37
+ fontWeight: tailwindVariables('font', ['light', 'normal', 'medium', 'semibold', 'bold', 'extrabold']),
38
+ zIndex: tailwindVariables('z', [10, 20, 30, 40, 50, 60], {
39
+ 0: 0,
40
+ auto: 'auto'
41
+ }),
42
+ spacing: tailwindVariables('spacing', ['xs', 'sm', 'base', 'md', 'lg', 'xl', '2xl', '3xl', 'section']),
43
+ screens: {
44
+ m: { max: '47.9375em' },
45
+ t: '48em',
46
+ d: '60em',
47
+ w: '76em',
48
+ hd: '85em',
49
+ mhd: '88em',
50
+ fhd: '100em',
51
+ touch: { max: '59.9375em' }
52
+ }
53
+ },
54
+ },
55
+ plugins: [
56
+ plugin(({ addUtilities }) => {
57
+ addUtilities(tailwindColorsAccent(colors))
58
+ }),
59
+ plugin(({ addUtilities }) => {
60
+ addUtilities(tailwindColorsCurrent(colors))
61
+ }),
62
+ plugin(({ addUtilities }) => {
63
+ addUtilities(tailwindAnimations(animations))
64
+ }),
65
+ plugin(({ addUtilities }) => {
66
+ addUtilities(tailwindRadius(radius))
67
+ })
68
+ ],
69
+ }
package/vite.config.js ADDED
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from 'vituum'
2
+ import core from '@newlogic-digital/core'
3
+ import postcssHasPseudo from 'css-has-pseudo'
4
+
5
+ export default defineConfig({
6
+ integrations: [core()],
7
+ postcss: {
8
+ plugins: [postcssHasPseudo()]
9
+ }
10
+ })
package/gulpfile.js DELETED
@@ -1,41 +0,0 @@
1
- import { defineConfig } from '@newlogic-digital/core'
2
- import cms from "./src/module.cms.js"
3
-
4
- export default defineConfig({
5
- config: true,
6
- modules: {cms},
7
- serve: {
8
- https: true
9
- },
10
- scripts: {
11
- importResolution: {
12
- directories: ['Components', 'Sections', 'Layout', 'Libraries', 'Utils/Functions', 'Ui']
13
- },
14
- importMap: {
15
- build: false,
16
- trailingSlashes: /(vanillajs-datepicker)/
17
- }
18
- },
19
- styles: {
20
- purge: {
21
- enabled: true,
22
- content: ['src/scripts/**/*.js', 'src/templates/**/*.twig', 'www/templates/**/*.tpl', 'temp/cdn/*.js', 'admin_ex/js/templates/*.html', 'index.html'],
23
- options: {
24
- safelist: {
25
- standard: [/(class|is-|to-|grecaptcha)/],
26
- deep: [/(ui-text|wsw|datepicker)/]
27
- }
28
- }
29
- },
30
- vendor: {
31
- path: 'Utils/vendor.css'
32
- },
33
- importResolution: {
34
- directories: ['Components', 'Sections', 'Layout', 'Libraries', 'Ui']
35
- },
36
- themePath: 'Utils/theme/{THEME}.{FORMAT}',
37
- postcss: {
38
- extend: []
39
- }
40
- }
41
- })
@@ -1,60 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
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
- <style type="text/css" n:syntax="off">
9
- {{ fetch ('/temp/emails/email.css') }}
10
- </style>
11
- </head>
12
- <body>
13
- <table class="elm_container_wrapper">
14
- <tr>
15
- <td>
16
- <table class="elm_container">
17
- <tr class="elm_header">
18
- <td>
19
- <table class="elm_inner_container">
20
- <tr>
21
- <td>
22
- <br />
23
- <a href="#"><img src="https://via.placeholder.com/160x60" width="160" alt="" style="width: 160px" /></a>
24
- <br />
25
- <br />
26
- </td>
27
- </tr>
28
- </table>
29
- </td>
30
- </tr>
31
- <tr class="nlm_content">
32
- <td>
33
- <table class="elm_inner_container">
34
- <tr>
35
- <td>
36
- <br />
37
- <div class="elm_content_heading">Děkujeme za Váš zájem</div>
38
- <br />
39
- Jsme opravdu rádi že jste se nám ozvali! Toto jsou Vaše údaje z formuláře:
40
- <br />
41
- <br />
42
- <p><strong>Jméno</strong>: Pavel Novák</p>
43
- <p><strong>Email</strong>: jmeno.prijmeni@email.cz</p>
44
- <p><strong>Telefon</strong>: +420111222333</p>
45
- <br/>
46
- <p><strong>Zpráva</strong>:</p>
47
- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vitae est dui. Vestibulum vehicula in mi in interdum. Aliquam quis tempor nibh. Duis tincidunt vel purus tincidunt iaculis. In bibendum leo justo, et elementum justo dapibus et. Aliquam eu elementum magna. Fusce egestas urna ac venenatis auctor. Phasellus felis leo, suscipit non est sit amet, lobortis pellentesque urna. Ut enim leo, posuere eget mauris vel, egestas pellentesque metus. Curabitur ut est ut orci blandit suscipit. Morbi lacinia sapien luctus lectus maximus, vitae gravida lectus aliquet. Vestibulum ut placerat diam. Fusce dapibus tincidunt justo, sed venenatis nisl porttitor vitae.</p>
48
- <br />
49
- <div class="elm_content_info"><a href="https://www.nazevwebu.cz"><span>www.nazevwebu.cz</span></a></div>
50
- </td>
51
- </tr>
52
- </table>
53
- </td>
54
- </tr>
55
- </table>
56
- </td>
57
- </tr>
58
- </table>
59
- </body>
60
- </html>
@@ -1,33 +0,0 @@
1
- import { LibStimulus, Controller, getController } from '../Libraries/Stimulus.js'
2
-
3
- LibStimulus.register('c-form', class extends Controller {
4
- validate(element, e) {
5
- if (element.reportValidity() === false) {
6
- e.preventDefault()
7
- e.stopPropagation()
8
- }
9
-
10
- element.querySelectorAll('.ui-input').forEach(element => {
11
- getController(element, 'ui-input').validate(element, true)
12
- })
13
-
14
- element.querySelectorAll('.ui-select:not([data-state*="active"]) select[required]').forEach(select => {
15
- getController(select.parentNode, 'ui-select').validate(select.parentNode, select)
16
- })
17
-
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))
32
- }
33
- })
@@ -1,23 +0,0 @@
1
- import { LibStimulus, Controller } from '../Libraries/Stimulus.js'
2
-
3
- LibStimulus.register('ui-radio', class extends Controller {
4
- validate(element) {
5
- element.parentNode._removeDataValue('state', 'valid invalid')
6
-
7
- if (element.checkValidity()) {
8
- element.parentNode._addDataValue('state', 'valid')
9
-
10
- document.querySelectorAll(`input[name="${element.name}"]`).forEach(element => {
11
- element.parentNode._addDataValue('state', 'valid')
12
- })
13
- } else {
14
- element.parentNode._addDataValue('state', 'invalid')
15
- }
16
- }
17
-
18
- connect() {
19
- const input = this.element.querySelector('input:not([type="hidden"])')
20
-
21
- input.addEventListener('change', () => this.validate(input))
22
- }
23
- })
@@ -1 +0,0 @@
1
- /* empty */
@@ -1,9 +0,0 @@
1
- .lazyload,
2
- .lazyloading {
3
- opacity: 0;
4
- }
5
-
6
- .lazyloaded {
7
- opacity: 1;
8
- transition: var(--transition-opacity);
9
- }
@@ -1,2 +0,0 @@
1
- @import "Utils/tailwind/base.css";
2
- @import "Utils/tailwind/gutters.css";
@@ -1,3 +0,0 @@
1
- {% json 'dialog' %}
2
- {% include 'Components/Dialogs/Basic.twig' %}
3
- {% endjson %}