@newlogic-digital/ui 3.1.0 → 3.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 (34) hide show
  1. package/README.md +15 -13
  2. package/package.json +19 -13
  3. package/src/{main.json → data/main.json} +1 -1
  4. package/src/emails/email.twig +1 -1
  5. package/src/scripts/Components/+.js +0 -1
  6. package/src/scripts/Components/CookieConsent.js +16 -14
  7. package/src/scripts/Libraries/+.js +2 -1
  8. package/src/scripts/Libraries/CookieConsent.js +10 -4
  9. package/src/scripts/{Components → Libraries}/Form.js +9 -5
  10. package/src/scripts/Libraries/Script.js +19 -0
  11. package/src/scripts/Libraries/Swup.js +2 -9
  12. package/src/scripts/Ui/Input.js +5 -5
  13. package/src/scripts/Utils/+.js +3 -0
  14. package/src/scripts/Utils/Functions/+.js +1 -1
  15. package/src/scripts/Utils/Functions/replaceTag.js +12 -0
  16. package/src/styles/Layout/Header.css +54 -0
  17. package/src/styles/Libraries/NativeSlider.css +1 -1
  18. package/src/styles/Utils/+.css +9 -0
  19. package/src/styles/Utils/keyframes.css +4 -4
  20. package/src/styles/Utils/tailwind/+.css +2 -0
  21. package/src/styles/Utils/theme/+.css +1 -0
  22. package/src/styles/main.css +2 -0
  23. package/src/templates/Components/CookieConsent.twig +2 -2
  24. package/src/templates/Layout/Main.twig +1 -1
  25. package/src/templates/Sections/Ui.twig +16 -27
  26. package/src/views/dialog-basic.json.twig +3 -0
  27. package/src/{templates → views}/gdpr.json +0 -0
  28. package/src/{templates → views}/index.json +0 -0
  29. package/src/{templates/json-tippy.twig → views/json-tippy.json.twig} +0 -0
  30. package/src/{templates → views}/ui.json +0 -0
  31. package/vite.config.js +6 -0
  32. package/gulpfile.js +0 -41
  33. package/src/styles/tailwind.css +0 -2
  34. package/src/templates/dialog-basic.twig +0 -3
package/README.md CHANGED
@@ -23,8 +23,9 @@ Newlogic UI is component framework with easy syntax. Modern approach of CSS prop
23
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
- * **[Newlogic Core](https://core.newlogic.cz/)** - set of tools that can be used to create modern web applications
27
- * **[ESM](https://tailwindcss.com/)** - completely written in modern JS syntax - ES8+, ES module, etc.
26
+ * **[Vituum](https://vituum.dev/)** - a small wrapper around Vite, adds support of template engines and more
27
+ * **[Newlogic Core](https://github.com/newlogic-digital/core)** - integration for Vituum, adds pre-defined config of integrations and more
28
+ * **[ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules)** - completely written in modern JS syntax - ES8+, ES module, etc.
28
29
  * **[PostCSS](https://postcss.org/)** - completely written in modern CSS syntax - nesting, variables, etc.
29
30
  * **[Tailwind CSS](https://tailwindcss.com/)** - rich utility classes for everything
30
31
  * **[Stimulus](https://stimulus.hotwire.dev/)** - a modest JavaScript framework for the HTML you already have
@@ -32,48 +33,49 @@ Javascript implementation is mainly intended for use on backend rendered website
32
33
  * **Easy syntax** - .ui-btn (ui elements), .c-component (components), .c-section (sections) etc.
33
34
 
34
35
 
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
+ The core of the Newlogic UI is Vituum with 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
37
 
37
- ## 🪄 Instalation
38
+ ## 🪄 Get started
38
39
 
39
- Creating a new project (using Newlogic Core)
40
+ Creating a new project (using Vituum)
40
41
  ```sh
41
42
  $ git clone --depth 1 https://github.com/newlogic-digital/ui.git newlogic-ui-project
42
43
  $ cd newlogic-ui-project && npm i
43
44
  ```
44
45
  ```sh
45
- $ npx gulp serve
46
+ $ vite
46
47
  ```
47
48
  or
48
49
  ```sh
49
- $ npx gulp production
50
+ $ vituum build
50
51
  ```
51
52
  ___
52
53
  Or in any other environment
53
54
  ```sh
54
- $ npm i @newlogic-newlogic/ui
55
+ $ npm i @newlogic-digital/ui
55
56
  ```
56
57
 
57
58
  ```css
58
59
  /* main.css or individual modules */
59
- @import "node_modules/@newlogic/ui/src/styles/main.css"
60
+ @import "node_modules/@newlogic-digital/ui/src/styles/main.css"
60
61
  ```
61
62
 
62
63
  ```js
63
64
  /* main.js or individual modules */
64
- import "node_modules/@newlogic/ui/src/scripts/main.js"
65
+ import "node_modules/@newlogic-digital/ui/src/scripts/main.js"
65
66
  ```
66
67
 
67
68
  ### Requirements
68
69
 
69
- - [Node.js LTS (14.x)](https://nodejs.org/en/download/)
70
- - [NPM (7.x)](https://www.npmjs.com/package/npm) or [Yarn (2.x)](https://yarnpkg.com/)
70
+ - [Node.js LTS (16.x)](https://nodejs.org/en/download/)
71
+ - [NPM (7.x)](https://www.npmjs.com/package/npm) or any other package manager
71
72
 
72
73
  ### Config
73
74
 
74
- Each Newlogic Core project has to have config via `gulpfile.js`, docs - [core.newlogic.cz](https://core.newlogic.cz/)
75
+ Each Vituum project has to have config via `vite.config.js`, docs - [vituum.dev](https://vituum.dev)
75
76
 
76
77
  ## 📌 Future plans
78
+ - support for new modern web features `:has`, `<dialog>`
77
79
  - performance optimization
78
80
 
79
81
  ## Licence
package/package.json CHANGED
@@ -1,36 +1,42 @@
1
1
  {
2
2
  "name": "@newlogic-digital/ui",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "type": "module",
5
- "main": "gulpfile.js",
5
+ "main": "vite.config.js",
6
6
  "author": "New Logic Studio s.r.o.",
7
7
  "description": "Lightweight, modern and modular CSS framework with the best principles",
8
8
  "license": "GNU GPLv3",
9
9
  "scripts": {
10
- "utils:eslint": "eslint 'src/scripts/**/*.js' --fix",
11
- "utils:stylelint": "stylelint 'src/styles/**/*.css' --fix"
10
+ "dev": "vite",
11
+ "preview": "vite preview",
12
+ "build": "vituum build",
13
+ "build:headless": "vituum headless",
14
+ "cleanup": "vituum cleanup",
15
+ "eslint": "eslint 'src/scripts/**/*.js'",
16
+ "eslint:fix": "eslint 'src/scripts/**/*.js' --fix",
17
+ "stylelint": "stylelint 'src/styles/**/*.css'",
18
+ "stylelint:fix": "stylelint 'src/styles/**/*.css' --fix"
12
19
  },
13
- "imports": {},
14
20
  "dependencies": {
15
21
  "@simonwep/pickr": "^1.8.2",
16
- "@hotwired/stimulus": "3.0.1",
17
- "swup": "2.0.14",
22
+ "@hotwired/stimulus": "3.1.0",
23
+ "swup": "2.0.19",
18
24
  "tippy.js": "^6.3.7",
19
25
  "vanillajs-datepicker": "^1.2.0"
20
26
  },
21
27
  "devDependencies": {
22
- "@newlogic-digital/core": "~0.9.5",
23
- "eslint-config-standard": "^16.0.3",
24
- "stylelint-config-standard": "^24.0.0"
28
+ "@newlogic-digital/core": "^1.0.0",
29
+ "vituum": "^0.0.28",
30
+ "eslint-config-standard": "^17.0.0",
31
+ "stylelint-config-standard": "^28.0.0"
25
32
  },
26
33
  "files": [
27
34
  "src",
28
35
  "gulpfile.js"
29
36
  ],
30
37
  "engines": {
31
- "node": ">=14.0.0",
32
- "npm": ">=7.10.0",
33
- "yarn": ">=2.3.0"
38
+ "node": ">=16.0.0",
39
+ "npm": ">=7.10.0"
34
40
  },
35
41
  "repository": {
36
42
  "type": "git",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "template": "templates/Layout/Main.twig",
2
3
  "prefetch": [
3
4
  "https://cdn.jsdelivr.net",
4
5
  "https://fonts.gstatic.com",
@@ -21,7 +22,6 @@
21
22
  }
22
23
  },
23
24
  "layout": {
24
- "template": "Layout/Main.twig",
25
25
  "cookies": false,
26
26
  "nav": [
27
27
  {
@@ -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
+ @import './email.css';
10
10
  </style>
11
11
  </head>
12
12
  <body>
@@ -1,2 +1 @@
1
1
  import './CookieConsent.js'
2
- import './Form.js'
@@ -9,23 +9,20 @@ LibStimulus.register('c-cookieconsent', class extends Controller {
9
9
  return
10
10
  }
11
11
 
12
- if (localStorage.getItem('lib-cookieconsent') === null || parseInt(localStorage.getItem('lib-cookieconsent-expire')) < Date.now()) {
12
+ if (LibCookieConsent.getItem('lib-cookieconsent') === null || parseInt(LibCookieConsent.getItem('lib-cookieconsent-expire')) < Date.now()) {
13
13
  setTimeout(() => {
14
14
  selector._addDataValue('state', 'active')
15
15
  selector.classList.add('is-animate')
16
16
  }, 1500)
17
17
  }
18
18
 
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
19
  selector.querySelector('[data-lib-cookieconsent-approve]').addEventListener('click', () => {
27
20
  this.hide(['performance', 'marketing'])
28
21
  })
22
+
23
+ selector.querySelector('[data-lib-cookieconsent-decline]').addEventListener('click', () => {
24
+ this.hide([])
25
+ })
29
26
  }
30
27
 
31
28
  hide(type) {
@@ -42,10 +39,13 @@ LibStimulus.register('c-cookieconsent', class extends Controller {
42
39
  LibStimulus.register('c-form-cookieconsent', class extends Controller {
43
40
  connect() {
44
41
  const selector = this.element
45
- const type = localStorage.getItem('lib-cookieconsent')
42
+ const type = LibCookieConsent.getItem('lib-cookieconsent')
43
+ const modal = document.querySelector('.c-cookieconsent')
46
44
 
47
- document.querySelector('.c-cookieconsent').classList.remove('is-animate')
48
- document.querySelector('.c-cookieconsent')._removeDataValue('state', 'active')
45
+ if (modal) {
46
+ modal.classList.remove('is-animate')
47
+ modal._removeDataValue('state', 'active')
48
+ }
49
49
 
50
50
  if (type !== null) {
51
51
  this.element.querySelectorAll('input:not([disabled])').forEach(input => {
@@ -74,9 +74,11 @@ LibStimulus.register('c-form-cookieconsent', class extends Controller {
74
74
  }
75
75
 
76
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')
77
+ const modal = document.querySelector('.c-cookieconsent')
78
+
79
+ if (modal && (LibCookieConsent.getItem('lib-cookieconsent') === null || parseInt(LibCookieConsent.getItem('lib-cookieconsent-expire')) < Date.now())) {
80
+ modal._addDataValue('state', 'active')
81
+ modal.classList.add('is-animate')
80
82
  }
81
83
  }
82
84
  })
@@ -2,10 +2,11 @@ export { default as Anchor } from './Anchor.js'
2
2
  export { default as CookieConsent } from './CookieConsent.js'
3
3
  export { default as Dialog } from './Dialog.js'
4
4
  import './Drawer.js'
5
- import './Fetch.js'
5
+ import './Form.js'
6
6
  export { default as NativeSlider } from './NativeSlider.js'
7
7
  import './ReCaptcha.js'
8
8
  export { default as Ripple } from './Ripple.js'
9
+ import './Script.js'
9
10
  import './Stimulus.js'
10
11
  export { default as Swup } from './Swup.js'
11
12
  export { default as Tabs } from './Tabs.js'
@@ -1,19 +1,25 @@
1
1
  const LibCookieConsent = {
2
+ setItem: (key, value) => {
3
+ localStorage.setItem(key, value)
4
+ },
5
+ getItem: (key) => {
6
+ return localStorage.getItem(key)
7
+ },
2
8
  init: () => {
3
- const type = localStorage.getItem('lib-cookieconsent')
9
+ const type = LibCookieConsent.getItem('lib-cookieconsent')
4
10
 
5
11
  if (type !== null) {
6
12
  JSON.parse(type).forEach(type => LibCookieConsent.append(type))
7
13
  }
8
14
  },
9
15
  set: (type) => {
10
- localStorage.setItem('lib-cookieconsent', JSON.stringify(type))
11
- localStorage.setItem('lib-cookieconsent-expire', (Date.now() + 31556926 * 1000).toString())
16
+ LibCookieConsent.setItem('lib-cookieconsent', JSON.stringify(type))
17
+ LibCookieConsent.setItem('lib-cookieconsent-expire', (Date.now() + 31556926 * 1000).toString())
12
18
 
13
19
  if (type.length > 0) {
14
20
  type.forEach(type => LibCookieConsent.append(type))
15
21
  } else {
16
- localStorage.setItem('lib-cookieconsent', JSON.stringify([]))
22
+ LibCookieConsent.setItem('lib-cookieconsent', JSON.stringify([]))
17
23
  LibCookieConsent.remove()
18
24
  }
19
25
  },
@@ -1,6 +1,11 @@
1
- import { LibStimulus, Controller, getController } from '../Libraries/Stimulus.js'
1
+ import { LibStimulus, Controller, getController } from './Stimulus.js'
2
+
3
+ LibStimulus.register('lib-form', class extends Controller {
4
+ connect() {
5
+ this.element.setAttribute('novalidate', '')
6
+ this.element.addEventListener('submit', e => this.validate(this.element, e))
7
+ }
2
8
 
3
- LibStimulus.register('c-form', class extends Controller {
4
9
  validate(element, e) {
5
10
  if (element.reportValidity() === false) {
6
11
  e.preventDefault()
@@ -26,8 +31,7 @@ LibStimulus.register('c-form', class extends Controller {
26
31
  })
27
32
  }
28
33
 
29
- connect() {
30
- this.element.setAttribute('novalidate', '')
31
- this.element.addEventListener('submit', e => this.validate(this.element, e))
34
+ submitForm({ currentTarget }) {
35
+ currentTarget.form.dispatchEvent(new Event('submit', { bubbles: true, cancelable: true }))
32
36
  }
33
37
  })
@@ -0,0 +1,19 @@
1
+ import { LibStimulus, Controller } from './Stimulus.js'
2
+
3
+ LibStimulus.register('lib-script', class extends Controller {
4
+ connect() {
5
+ const element = this.element
6
+ const script = document.createElement('script')
7
+
8
+ ;[...element.attributes].forEach(attribute => {
9
+ if (attribute.specified && !attribute.name.includes('type') && !attribute.name.includes('data-controller')) {
10
+ script.setAttribute(attribute.name, attribute.value)
11
+ }
12
+ })
13
+
14
+ script.innerHTML = element.innerHTML
15
+
16
+ element.parentElement.appendChild(script)
17
+ element.remove()
18
+ }
19
+ })
@@ -3,6 +3,7 @@ import { getController, loadStimulus } from './Stimulus.js'
3
3
  import LibAnchor from './Anchor.js'
4
4
  import LibDialog from './Dialog.js'
5
5
  import LibCookieConsent from './CookieConsent.js'
6
+ import replaceTag from '../Utils/Functions/replaceTag.js'
6
7
 
7
8
  const LibSwup = new Swup({
8
9
  containers: ['#l-main', '#l-header'].filter(element => document.querySelector(element)),
@@ -28,15 +29,7 @@ LibSwup.on('animationOutDone', () => {
28
29
  LibSwup.on('contentReplaced', () => {
29
30
  const content = new DOMParser().parseFromString(LibSwup.cache.getCurrentPage().originalContent, 'text/html')
30
31
 
31
- content.head.querySelectorAll('[data-lib-swup-replace]').forEach(element => {
32
- const tag = document.querySelector(`[data-lib-swup-replace=${element.dataset.libSwupReplace}]`)
33
-
34
- if (tag !== null) {
35
- tag.outerHTML = element.outerHTML
36
- } else {
37
- document.head.insertAdjacentHTML('beforeend', element.outerHTML)
38
- }
39
- })
32
+ replaceTag(content)
40
33
 
41
34
  LibAnchor.init()
42
35
 
@@ -77,9 +77,9 @@ LibStimulus.register('ui-input', class extends Controller {
77
77
 
78
78
  element.querySelector('[data-action="plus"]').addEventListener('click', () => {
79
79
  const input = this.element.querySelector('input')
80
- const num = parseInt(input.value === '' ? 0 : input.value) + parseInt(input.step)
80
+ const num = parseInt(input.value === '' ? 0 : input.value) + parseInt(input.step === '' ? 1 : input.step)
81
81
 
82
- if (num <= input.max) {
82
+ if (num <= input.max || input.max === '') {
83
83
  input.value = num
84
84
  input.dispatchEvent(new Event('change', { bubbles: true }))
85
85
  }
@@ -87,9 +87,9 @@ LibStimulus.register('ui-input', class extends Controller {
87
87
 
88
88
  element.querySelector('[data-action="minus"]').addEventListener('click', () => {
89
89
  const input = this.element.querySelector('input')
90
- const num = parseInt(input.value) - parseInt(input.step)
90
+ const num = parseInt(input.value) - parseInt(input.step === '' ? 1 : input.step)
91
91
 
92
- if (num >= input.min) {
92
+ if (num >= input.min || input.min === '') {
93
93
  input.value = num
94
94
  input.dispatchEvent(new Event('change', { bubbles: true }))
95
95
  }
@@ -101,7 +101,7 @@ LibStimulus.register('ui-input', class extends Controller {
101
101
  const date = element.querySelector('[type^="date"]')
102
102
 
103
103
  if (date !== null && !document.documentElement.classList.contains('mobile')) {
104
- const lang = await import(`/* @vite-ignore */https://cdn.jsdelivr.net/npm/vanillajs-datepicker@1.2.0/js/i18n/locales/${document.documentElement.lang === 'en' ? 'cs' : document.documentElement.lang}.min.js`)
104
+ const lang = await import(`/* @vite-ignore */ https://cdn.jsdelivr.net/npm/vanillajs-datepicker@1.2.0/js/i18n/locales/${document.documentElement.lang === 'en' ? 'cs' : document.documentElement.lang}.min.js`)
105
105
  const { Datepicker } = await import('vanillajs-datepicker')
106
106
 
107
107
  await importStyle(cdn.datepicker)
@@ -0,0 +1,3 @@
1
+ import './Functions/+.js'
2
+ export { default as cdn } from './cdn.js'
3
+ import './global.js'
@@ -1,6 +1,6 @@
1
1
  import './dataValue.js'
2
- export { default as fetchHandler } from './fetchHandler.js'
3
2
  export { default as importScript } from './importScript.js'
4
3
  export { default as importStyle } from './importStyle.js'
5
4
  export { default as inView } from './inView.js'
6
5
  export { default as loadStimulus } from './loadStimulus.js'
6
+ export { default as replaceTag } from './replaceTag.js'
@@ -0,0 +1,12 @@
1
+ export default function replaceTag(documentElement) {
2
+ documentElement.querySelectorAll('[data-lib-replace-tag]').forEach(element => {
3
+ const replaceTag = document.querySelector(`[data-lib-replace-tag=${element.dataset.libReplaceTag}]`)
4
+ const placement = element.closest('head') ? document.head : replaceTag.parentElement
5
+
6
+ replaceTag ? (replaceTag.outerHTML = element.outerHTML) : placement.insertAdjacentHTML('beforeend', element.outerHTML)
7
+
8
+ if (element.tagName === 'SCRIPT') {
9
+ document.querySelector(`[data-lib-replace-tag=${element.dataset.libReplaceTag}]`)._addDataValue('controller', 'lib-script')
10
+ }
11
+ })
12
+ }
@@ -0,0 +1,54 @@
1
+ :root {
2
+ --l-header-height: 4rem;
3
+ --l-scroll-padding-top: calc(var(--l-header-height) + 1rem);
4
+ }
5
+
6
+ #l-header {
7
+ z-index: var(--z-20);
8
+ position: fixed;
9
+ top: 0;
10
+ left: 0;
11
+ right: 0;
12
+ padding: 0 2rem;
13
+ background-color: rgb(var(--color-dark));
14
+ color: rgb(var(--color-light));
15
+
16
+ @nest .dark & {
17
+ background-color: rgb(var(--color-background-100));
18
+ }
19
+
20
+ &.is-l-header-normal {
21
+ & ~ #l-main {
22
+ padding-top: var(--l-header-height);
23
+ }
24
+ }
25
+
26
+ & .wrp_header_body {
27
+ align-items: center;
28
+ height: var(--l-header-height);
29
+ }
30
+
31
+ & .elm_header_logo {
32
+ font-size: 1.5rem;
33
+ margin-right: 3rem;
34
+ }
35
+
36
+ & .elm_header_menu {
37
+ position: relative;
38
+ font-size: 1.75rem;
39
+
40
+ &::after {
41
+ position: absolute;
42
+ inset: -0.5rem;
43
+ content: "";
44
+ }
45
+ }
46
+
47
+ & .elm_header_nav {
48
+ --gx: 2rem;
49
+
50
+ & .ui-link {
51
+ padding: 1.25rem 0;
52
+ }
53
+ }
54
+ }
@@ -24,7 +24,7 @@
24
24
  display: none !important;
25
25
  }
26
26
 
27
- &:not(.is-fade):not(.is-grabbing) {
27
+ &:not(.is-fade, .is-grabbing) {
28
28
  scroll-behavior: smooth;
29
29
  scroll-snap-type: x mandatory;
30
30
  }
@@ -0,0 +1,9 @@
1
+ @import "default.css";
2
+ @import "icons.css";
3
+ @import "keyframes.css";
4
+ @import "normalize.css";
5
+ @import "print.css";
6
+ @import "tailwind/+.css";
7
+ @import "theme/+.css";
8
+ @import "vars.css";
9
+ @import "vendor.css";
@@ -48,7 +48,7 @@
48
48
  transform: translateY(2rem);
49
49
  }
50
50
 
51
- to {
51
+ 100% {
52
52
  opacity: 1;
53
53
  transform: translateY(0);
54
54
  }
@@ -60,7 +60,7 @@
60
60
  transform: translateY(-2rem);
61
61
  }
62
62
 
63
- to {
63
+ 100% {
64
64
  opacity: 1;
65
65
  transform: translateY(0);
66
66
  }
@@ -96,7 +96,7 @@
96
96
  transform: translateY(0);
97
97
  }
98
98
 
99
- to {
99
+ 100% {
100
100
  opacity: 0;
101
101
  transform: translateY(-2rem);
102
102
  }
@@ -108,7 +108,7 @@
108
108
  transform: translateY(0);
109
109
  }
110
110
 
111
- to {
111
+ 100% {
112
112
  opacity: 0;
113
113
  transform: translateY(2rem);
114
114
  }
@@ -0,0 +1,2 @@
1
+ @import "base.css";
2
+ @import "gutters.css";
@@ -0,0 +1 @@
1
+ @import "main.css";
@@ -11,3 +11,5 @@
11
11
  @import "Sections/+.css";
12
12
  @import "Libraries/+.css";
13
13
  @import "Utils/print.css";
14
+ @import "Utils/tailwind/base.css";
15
+ @import "Utils/tailwind/gutters.css";
@@ -20,10 +20,10 @@
20
20
  </div>
21
21
  <div class="wrp_c_foot {% if center %}flex-col space-y-6{% else %}space-x-10{% endif %}">
22
22
  <div class="col w-full">
23
- <button class="ui-btn w-full" data-size="lg" aria-label="Souhlasím s použitím cookies" data-lib-cookieconsent-approve>Yes, I agree</button>
23
+ <button class="ui-btn w-full" data-size="lg" aria-label="Yes, I agree" data-lib-cookieconsent-approve>Yes, I agree</button>
24
24
  </div>
25
25
  <div class="col {% if not center %}pr-6{% endif %}">
26
- <a href="/gdpr" class="ui-link" title="více informací & nastavení"><span>Information and settings</span></a>
26
+ <button class="ui-link" aria-label="I disagree" data-lib-cookieconsent-decline><span>I disagree</span></button>
27
27
  </div>
28
28
  </div>
29
29
  </div>
@@ -31,7 +31,7 @@
31
31
 
32
32
  <script>
33
33
  (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) && document.documentElement.classList.add('dark')
34
- document.documentElement.className = document.documentElement.className.replace('no-js', 'js'); matchMedia('(hover: hover) and (pointer: fine)').matches && document.documentElement.classList.add('no-touch'); /Android|iPhone|iPad|iPod/i.test(navigator.userAgent) && document.documentElement.classList.add('mobile'); document.documentElement.classList.add(navigator.platform.toLowerCase().replace(/ .*/, '')); !function(e) { let t; (t = e.match(/(chrome|safari|firefox)/i)) && document.documentElement.classList.add(t[0]) } (navigator.userAgent.toLowerCase());
34
+ document.documentElement.className = document.documentElement.className.replace('no-js', 'js');matchMedia('(hover: hover) and (pointer: fine)').matches && document.documentElement.classList.add('no-touch');/Android|iPhone|iPad|iPod/i.test(navigator.userAgent) && document.documentElement.classList.add('mobile');(p => document.documentElement.classList.add(p.includes('macintel') && navigator.maxTouchPoints > 2 ? 'ipad' : p))(navigator.platform.toLowerCase().replace(/ .*/, ''));(u => document.documentElement.classList.add(u && u[0]))(navigator.userAgent.toLowerCase().match(/chrome|safari|firefox/i))
35
35
  </script>
36
36
 
37
37
  <script src="{{ assets.js.main|asset }}" type="module"></script>
@@ -368,11 +368,6 @@
368
368
  <span>Drawer</span>
369
369
  </a>
370
370
  </li>
371
- <li class="col col-12">
372
- <a href="#fetch" class="ui-link" title="">
373
- <span>Fetch</span>
374
- </a>
375
- </li>
376
371
  <li class="col col-12">
377
372
  <a href="#hint" class="ui-link" title="">
378
373
  <span>Hint</span>
@@ -421,7 +416,7 @@
421
416
  </ul>
422
417
  </div>
423
418
  <div class="mb-5">
424
- <h2 class="ui-title uppercase text-primary mb-3">Ostatní</h2>
419
+ <h2 class="ui-title uppercase text-primary mb-3">Other</h2>
425
420
  <ul class="row flex-col g-2">
426
421
  <li class="col col-12">
427
422
  <a href="#functions" class="ui-link" title="">
@@ -443,19 +438,19 @@
443
438
  <div class="col-12" style="padding-top: 0">
444
439
  <h1 class="ui-heading">Get started</h1>
445
440
  <div class="ui-text">
446
- <p>Minimal version <b>Node.js 14+</b> and <b>NPM 7+</b></p>
441
+ <p>Minimal version <b>Node.js 16+</b>, <b>NPM 7+</b> or any other package manager.</p>
447
442
  </div>
448
443
  </div>
449
444
  <div class="col-12" id="instalation">
450
- <h1 class="ui-title uppercase text-primary mb-5">Instalation</h1>
445
+ <h1 class="ui-title uppercase text-primary mb-5">Installation</h1>
451
446
  <div class="ui-text">
452
- <p>In existing project (with <b>Newlogic Core</b>)</p>
447
+ <p>In existing project (with <b>Vituum and Newlogic Core</b>)</p>
453
448
  </div>
454
449
  {% code "bash" %}
455
450
  $ npm i
456
451
  {% endcode %}
457
452
  <div class="ui-text">
458
- <p>Creating a new project (with <b>Newlogic Core</b>)</p>
453
+ <p>Creating a new project (with <b>Vituum and Newlogic Core</b>)</p>
459
454
  </div>
460
455
  {% code "bash" %}
461
456
  $ git clone --depth 1 https://github.com/newlogic-digital/ui.git .
@@ -479,7 +474,7 @@
479
474
  <div class="col-12" id="core">
480
475
  <h1 class="ui-title uppercase text-primary mb-5">Core</h1>
481
476
  <div class="ui-text">
482
- <p><b>Newlogic Core</b> is used as the main toolset, the complete documentation is at <a href="https://core.newlogic.cz" target="_blank">core.newlogic.cz</a></p>
477
+ <p><b>Vituum</b> with Newlogic Core is used as the main toolset, the complete documentation is at <a href="https://vituum.dev" target="_blank">vituum.dev</a></p>
483
478
  <p>Framework can also be used with other tools, more information is in the section <a href="#build" title="">Build</a></p>
484
479
  </div>
485
480
  </div>
@@ -941,10 +936,10 @@
941
936
  </div>
942
937
  <div class="col-12">
943
938
  <div class="ui-text mb-5">
944
- <p>Example form, for javascript form validation upon send you can add attribute <code>data-controller="c-form"</code></p>
939
+ <p>Example form, for javascript form validation upon send you can add attribute <code>data-controller="lib-form"</code></p>
945
940
  </div>
946
941
  {% code "html:mirror" %}
947
- <form class="c-form" data-controller="c-form">
942
+ <form class="c-form" data-controller="lib-form">
948
943
  <div class="wrp_form_body grid gap-3">
949
944
  <div class="ui-select">
950
945
  <select required>
@@ -1677,14 +1672,6 @@
1677
1672
  <p>The content is being prepared ...</p>
1678
1673
  </div>
1679
1674
  </div>
1680
- <div class="col-12" id="fetch">
1681
- <h1 class="ui-title uppercase text-primary mb-5">Fetch</h1>
1682
- <div class="ui-text">
1683
- <p>Located in <code>src/scripts/Libraries/Fetch.js</code></p>
1684
- <p></p>
1685
- <p>The content is being prepared ...</p>
1686
- </div>
1687
- </div>
1688
1675
  <div class="col-12" id="hint">
1689
1676
  <h1 class="ui-title uppercase text-primary mb-5">Hint</h1>
1690
1677
  <div class="ui-text">
@@ -1807,7 +1794,7 @@
1807
1794
  <p>It can be evaluated upon submitting the form, with attribute <code>data-action="submit->lib-recaptcha#submit"</code></p>
1808
1795
  </div>
1809
1796
  {% code "html" %}
1810
- <form data-controller="lib-recaptcha" data-lib-recaptcha-api="RECAPTCHA_KEY" data-lib-recaptcha-action="contact" data-action="submit->lib-fetch#form">
1797
+ <form data-controller="lib-recaptcha" data-lib-recaptcha-api="RECAPTCHA_KEY" data-lib-recaptcha-action="contact" data-action="submit->lib-recaptcha#submit">
1811
1798
  <input name="gtoken" type="hidden">
1812
1799
  <button>Send</button>
1813
1800
  </form>
@@ -1817,7 +1804,7 @@
1817
1804
  <h1 class="ui-title uppercase text-primary mb-5">Ripple</h1>
1818
1805
  <div class="ui-text">
1819
1806
  <p>The ripple effect is automatically applied to buttons and other components</p>
1820
- <p>The effect is possible apply anywhere using the attribute <code>data-action="click->lib#ripple"</code>
1807
+ <p>The effect is possible apply anywhere using the attribute <code>data-action="click->lib#ripple"</code></p>
1821
1808
  <p>Background color can be changed with CSS property <code>--lib-ripple-bg</code></p>
1822
1809
  <p></p>
1823
1810
  <h3>Methods</h3>
@@ -1994,7 +1981,9 @@
1994
1981
  </div>
1995
1982
  {% code "html:mirror" %}
1996
1983
  <button class="ui-btn" type="button" data-type="square" data-controller="lib-tippy" data-lib-tippy="dropdown-full, /json-tippy.json" data-lib-tippy-slot='{ "edit": "Upravit položku", "delete": "Smazat položku" }'>
1997
- <span class="icon icon-chevron-down"></span>
1984
+ <svg class="icon">
1985
+ <use href="#icon-angle-down"></use>
1986
+ </svg>
1998
1987
  </button>
1999
1988
  {% endcode %}
2000
1989
  <div class="ui-text mb-5">
@@ -2071,7 +2060,7 @@
2071
2060
  <div class="col-12" id="build">
2072
2061
  <h1 class="ui-title uppercase text-primary mb-5">Build</h1>
2073
2062
  <div class="ui-text">
2074
- <p>Newlogic UI can be used with other tools, without the need to use Newlogic Core or in a completely different environment than NodeJS</p>
2063
+ <p>Newlogic UI can be used with other tools, without the need to use Vituum and Newlogic Core or in a completely different environment than NodeJS</p>
2075
2064
  <p></p>
2076
2065
  <p>Following PostCSS plugins are used:</p>
2077
2066
  {% code "json" %}
@@ -2089,10 +2078,10 @@
2089
2078
  <p></p>
2090
2079
  <p>Tailwind config is located at root in <code>tailwind.config.cjs</code></p>
2091
2080
  <p></p>
2092
- <p>The CSS framework can then be configured for use in modern build tools such as Vite or Snowpack. </p>
2081
+ <p>The CSS framework can then be configured for use in any modern build tools such as Vite, Webpack, Parcel, etc.</p>
2093
2082
  <p>Theoretically it is even possible to build outside the NodeJS environment in <a href="https://deno.land/manual/tools/bundler" target="_blank">Deno</a> with <a href="https://github.com/postcss/postcss-deno" target="_blank">PostCSS</a></p>
2094
2083
  <p></p>
2095
- <p>Without use of Newlogic Core you can't use compilation of twig templates from <code>src/templates</code></p>
2084
+ <p>Without use of Vituum you can't use compilation of twig templates from <code>src/templates</code></p>
2096
2085
  </div>
2097
2086
  <hr/>
2098
2087
  </div>
@@ -0,0 +1,3 @@
1
+ {% json 'dialog' %}
2
+ {% include '@templates/Components/Dialogs/Basic.twig' %}
3
+ {% endjson %}
File without changes
File without changes
File without changes
package/vite.config.js ADDED
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from 'vituum'
2
+ import core from '@newlogic-digital/core'
3
+
4
+ export default defineConfig({
5
+ integrations: [core()]
6
+ })
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,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 %}