@newlogic-digital/ui 4.0.0 → 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 (71) hide show
  1. package/package.json +14 -16
  2. package/src/pages/example/popover-autocomplete.json +8 -0
  3. package/src/scripts/components/(ui)/+.js +1 -0
  4. package/src/scripts/components/(ui)/Carousel.js +4 -0
  5. package/src/scripts/components/(ui)/Control.js +4 -4
  6. package/src/scripts/components/(ui)/Dialog.js +9 -9
  7. package/src/scripts/components/(ui)/Form.js +7 -7
  8. package/src/scripts/components/(ui)/Popover.js +1 -1
  9. package/src/scripts/components/App.js +1 -1
  10. package/src/scripts/composables/naja.js +7 -7
  11. package/src/scripts/composables/stimulus.js +12 -12
  12. package/src/scripts/composables/swup.js +9 -9
  13. package/src/scripts/main.js +1 -0
  14. package/src/scripts/utils/initAfter.js +4 -4
  15. package/src/styles/base/+.css +1 -0
  16. package/src/styles/base/defaults.css +8 -2
  17. package/src/styles/base/transitions.css +1 -1
  18. package/src/styles/base/variants.css +11 -0
  19. package/src/styles/components/(layout)/Header.css +8 -6
  20. package/src/styles/components/(layout)/Main.css +18 -14
  21. package/src/styles/components/(ui)/+.css +2 -0
  22. package/src/styles/components/(ui)/Badge.css +8 -8
  23. package/src/styles/components/(ui)/Button.css +12 -12
  24. package/src/styles/components/(ui)/Carousel.css +2 -0
  25. package/src/styles/components/(ui)/Check.css +4 -1
  26. package/src/styles/components/(ui)/Compare.css +1 -1
  27. package/src/styles/components/(ui)/Control.css +25 -23
  28. package/src/styles/components/(ui)/ControlSelect.css +1 -1
  29. package/src/styles/components/(ui)/Drawer.css +13 -11
  30. package/src/styles/components/(ui)/Field.css +1 -1
  31. package/src/styles/components/(ui)/Group.css +2 -1
  32. package/src/styles/components/(ui)/Heading.css +14 -4
  33. package/src/styles/components/(ui)/Image.css +2 -1
  34. package/src/styles/components/(ui)/Info.css +2 -1
  35. package/src/styles/components/(ui)/Label.css +2 -1
  36. package/src/styles/components/(ui)/Link.css +2 -2
  37. package/src/styles/components/(ui)/Notice.css +2 -1
  38. package/src/styles/components/(ui)/Popover.css +13 -1
  39. package/src/styles/components/(ui)/Progress.css +6 -1
  40. package/src/styles/components/(ui)/Range.css +4 -1
  41. package/src/styles/components/(ui)/Switch.css +4 -1
  42. package/src/styles/components/(ui)/Text.css +2 -1
  43. package/src/styles/components/(ui)/Title.css +14 -4
  44. package/src/styles/components/(ui)/Toast.css +4 -0
  45. package/src/styles/components/(ui)/Toaster.css +2 -2
  46. package/src/styles/components/(ui)/dialog/Dialog.css +2 -2
  47. package/src/styles/components/(ui)/dialog/DialogContent.css +2 -2
  48. package/src/styles/components/cookieconsent/CookieConsentDialog.css +13 -11
  49. package/src/styles/emails/base/defaults.css +2 -1
  50. package/src/styles/emails/components/Button.css +2 -1
  51. package/src/styles/emails/components/Heading.css +1 -1
  52. package/src/styles/emails/components/Main.css +1 -1
  53. package/src/styles/emails/components/Text.css +2 -1
  54. package/src/styles/emails/main.css +3 -4
  55. package/src/styles/emails/theme/config.css +12 -1
  56. package/src/styles/emails/theme/default.css +1 -1
  57. package/src/styles/emails/utils/common.css +6 -6
  58. package/src/styles/main.css +17 -10
  59. package/src/styles/theme/dark.css +2 -1
  60. package/src/styles/theme/main.css +2 -7
  61. package/src/styles/utils/+.css +0 -1
  62. package/src/styles/utils/index.css +5 -8
  63. package/src/styles/utils/reveal.css +9 -10
  64. package/src/styles/utils/scrollbar.css +2 -2
  65. package/src/templates/components/(example)/PopoverAutocomplete.latte +27 -0
  66. package/src/templates/components/Example.latte +4 -4
  67. package/src/templates/emails/layouts/default.latte +12 -3
  68. package/src/templates/layouts/default.latte +2 -2
  69. package/vite.config.js +5 -1
  70. package/src/styles/emails/+.css +0 -5
  71. package/src/styles/utils/container.css +0 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newlogic-digital/ui",
3
- "version": "4.0.0",
3
+ "version": "4.2.0",
4
4
  "type": "module",
5
5
  "main": "vite.config.js",
6
6
  "author": "New Logic Studio s.r.o.",
@@ -23,29 +23,27 @@
23
23
  "npm-sort": "npm r -S example && npm r -D example"
24
24
  },
25
25
  "dependencies": {
26
- "@floating-ui/dom": "^1.6.13",
26
+ "@floating-ui/dom": "^1.7.0",
27
27
  "@hotwired/stimulus": "^3.2.2",
28
28
  "@newlogic-digital/cookieconsent-js": "^1.0.0",
29
- "@newlogic-digital/naja-extensions": "^1.0.0",
30
- "@newlogic-digital/stimulus-components": "^1.0.0",
29
+ "@newlogic-digital/naja-extensions": "^1.0.3",
30
+ "@newlogic-digital/stimulus-components": "^1.1.0",
31
31
  "@newlogic-digital/swup-plugins": "^1.0.0",
32
- "@newlogic-digital/utils-js": "^1.1.1",
32
+ "@newlogic-digital/utils-js": "^1.1.4",
33
33
  "naja": "^3.2.1",
34
34
  "slide-element": "^2.3.1",
35
- "swup": "^4.8.1",
36
- "winduum": "^2.1.0",
37
- "winduum-stimulus": "^2.0.9"
35
+ "swup": "^4.8.2",
36
+ "winduum": "^2.2.1",
37
+ "winduum-stimulus": "^2.0.11"
38
38
  },
39
39
  "devDependencies": {
40
- "@newlogic-digital/core": "^3.0.0",
40
+ "@eslint/js": "^9.26.0",
41
+ "@newlogic-digital/core": "^3.1.0",
42
+ "@stylistic/eslint-plugin": "^4.2.0",
41
43
  "@stylistic/stylelint-config": "^2.0.0",
42
- "@tailwindcss/container-queries": "^0.1.1",
43
- "@vituum/vite-plugin-tailwindcss": "^1.2.0",
44
- "eslint": "^9.19.0",
45
- "neostandard": "^0.12.0",
46
- "npm-check-updates": "^17.1.14",
47
- "stylelint-config-standard": "^37.0.0",
48
- "tailwindcss": "^3.4.17"
44
+ "eslint": "^9.26.0",
45
+ "npm-check-updates": "^18.0.1",
46
+ "stylelint-config-standard": "^38.0.0"
49
47
  },
50
48
  "browserslist": [
51
49
  "> 1%",
@@ -0,0 +1,8 @@
1
+ {
2
+ "title": "Example Popover Autocomplete",
3
+ "body": [
4
+ {
5
+ "src": "components/(example)/PopoverAutocomplete.latte"
6
+ }
7
+ ]
8
+ }
@@ -1,4 +1,5 @@
1
1
  import './Button.js'
2
+ import './Carousel.js'
2
3
  import './Compare.js'
3
4
  import './Control.js'
4
5
  import './ControlSelect.js'
@@ -0,0 +1,4 @@
1
+ import { useStimulus } from '../../composables/stimulus.js'
2
+ import { Carousel } from 'winduum-stimulus/components/carousel/index.js'
3
+
4
+ useStimulus.register('x-carousel', Carousel)
@@ -3,9 +3,9 @@ import { Control } from 'winduum-stimulus/components/control/index.js'
3
3
  import { validateField } from 'winduum/src/components/form/index.js'
4
4
 
5
5
  useStimulus.register('x-control', class extends Control {
6
- connect() {
7
- validateField(this.element, { validate: false })
6
+ connect() {
7
+ validateField(this.element, { validate: false })
8
8
 
9
- this.element.addEventListener('change', () => validateField(this.element))
10
- }
9
+ this.element.addEventListener('change', () => validateField(this.element))
10
+ }
11
11
  })
@@ -2,16 +2,16 @@ import { useStimulus } from '../../composables/stimulus.js'
2
2
  import { Dialog } from 'winduum-stimulus/components/dialog/index.js'
3
3
 
4
4
  useStimulus.register('x-dialog', class extends Dialog {
5
- connect() {
6
- super.connect()
5
+ connect() {
6
+ super.connect()
7
7
 
8
- this.element.addEventListener('x-dialog:show', () => this.appendToaster(this.element))
9
- this.element.addEventListener('close', () => this.appendToaster(document.body))
10
- }
8
+ this.element.addEventListener('x-dialog:show', () => this.appendToaster(this.element))
9
+ this.element.addEventListener('close', () => this.appendToaster(document.body))
10
+ }
11
11
 
12
- appendToaster(parentElement) {
13
- const toasterElement = document.querySelector('.x-toaster')
12
+ appendToaster(parentElement) {
13
+ const toasterElement = document.querySelector('.x-toaster')
14
14
 
15
- if (toasterElement) parentElement.appendChild(toasterElement)
16
- }
15
+ if (toasterElement) parentElement.appendChild(toasterElement)
16
+ }
17
17
  })
@@ -3,13 +3,13 @@ import { Form } from 'winduum-stimulus/components/form/index.js'
3
3
  import { validateForm } from 'winduum/src/components/form/index.js'
4
4
 
5
5
  useStimulus.register('x-form', class extends Form {
6
- requestSubmit() {
7
- this.element.requestSubmit()
8
- }
6
+ requestSubmit() {
7
+ this.element.requestSubmit()
8
+ }
9
9
 
10
- reset(event) {
11
- this.element.reset()
10
+ reset(event) {
11
+ this.element.reset()
12
12
 
13
- validateForm(event, { validateOptions: { validate: false } })
14
- }
13
+ validateForm(event, { validateOptions: { validate: false } })
14
+ }
15
15
  })
@@ -1,4 +1,4 @@
1
1
  import { useStimulus } from '../../composables/stimulus.js'
2
- import { Popover } from 'winduum-stimulus/components/popover/index.js'
2
+ import { Popover } from '@newlogic-digital/stimulus-components'
3
3
 
4
4
  useStimulus.register('x-popover', Popover)
@@ -1,5 +1,5 @@
1
1
  import { Controller, useStimulus } from '../composables/stimulus.js'
2
2
 
3
3
  useStimulus.register('x-app', class extends Controller {
4
- // YOUR GLOBAL METHODS
4
+ // YOUR GLOBAL METHODS
5
5
  })
@@ -1,8 +1,8 @@
1
1
  import naja from 'naja'
2
2
  import {
3
- NajaCoreExtension,
4
- NajaInvokeExtension,
5
- NajaCheckValidityExtension
3
+ NajaCoreExtension,
4
+ NajaInvokeExtension,
5
+ NajaCheckValidityExtension,
6
6
  } from '@newlogic-digital/naja-extensions'
7
7
  import { initCookieConsent } from '@newlogic-digital/cookieconsent-js'
8
8
  import { initStimulus } from './stimulus.js'
@@ -13,12 +13,12 @@ naja.registerExtension(NajaInvokeExtension())
13
13
  naja.registerExtension(NajaCheckValidityExtension())
14
14
 
15
15
  naja.snippetHandler.addEventListener('afterUpdate', ({ detail }) => {
16
- initStimulus(detail.snippet)
17
- initCookieConsent(detail.snippet)
16
+ initStimulus(detail.snippet)
17
+ initCookieConsent(detail.snippet)
18
18
 
19
- useSwup.cache.clear()
19
+ useSwup.cache.clear()
20
20
  })
21
21
 
22
22
  naja.initialize({
23
- history: 'replace'
23
+ history: 'replace',
24
24
  })
@@ -4,28 +4,28 @@ import stimulus from 'winduum-stimulus'
4
4
  import { initAfter } from '../utils/+.js'
5
5
 
6
6
  const initConfig = {
7
- controllers: ['x-button', 'x-control', 'x-text', 'x-check', 'x-dialog'],
8
- actions: [
9
- ['.x-button', 'click->x-button#ripple'],
10
- ['.x-check', 'change->x-form#validateField'],
11
- ['.x-switch', 'change->x-form#validateField'],
12
- ['[data-invoke-action]:not([data-naja], [data-action*="invoke#action"])', 'invoke#action']
13
- ]
7
+ controllers: ['x-button', 'x-control', 'x-text', 'x-check', 'x-dialog'],
8
+ actions: [
9
+ ['.x-button', 'click->x-button#ripple'],
10
+ ['.x-check', 'change->x-form#validateField'],
11
+ ['.x-switch', 'change->x-form#validateField'],
12
+ ['[data-invoke-action]:not([data-naja], [data-action*="invoke#action"])', 'invoke#action'],
13
+ ],
14
14
  }
15
15
 
16
16
  const useStimulus = new Application(document.documentElement)
17
17
 
18
18
  const useController = (controller, target, application = useStimulus) =>
19
- stimulus.useController(controller, target, application)
19
+ stimulus.useController(controller, target, application)
20
20
 
21
21
  const initStimulus = (element, { controllers, actions } = initConfig) =>
22
- stimulus.initStimulus(element, { controllers, actions })
22
+ stimulus.initStimulus(element, { controllers, actions })
23
23
 
24
24
  useStimulus.start().then(() => initStimulus(document.body))
25
25
  useStimulus.register('invoke', class extends InvokeFetch {
26
- onFetchComplete(element) {
27
- initAfter(element)
28
- }
26
+ onFetchComplete(element) {
27
+ initAfter(element)
28
+ }
29
29
  })
30
30
 
31
31
  export { useStimulus, useController, Controller, initStimulus, initConfig }
@@ -1,23 +1,23 @@
1
1
  import Swup from 'swup'
2
2
  import { SwupCorePlugin } from '@newlogic-digital/swup-plugins'
3
3
  import initAfter from '../utils/initAfter.js'
4
- import { useController } from 'winduum-stimulus'
4
+ import { useController } from './stimulus.js'
5
5
 
6
6
  const useSwup = new Swup({
7
- containers: ['.x-main', '.x-header', '.x-toaster'],
8
- plugins: [new SwupCorePlugin()]
7
+ containers: ['.x-main', '.x-header', '.x-toaster'],
8
+ plugins: [new SwupCorePlugin()],
9
9
  })
10
10
 
11
11
  useSwup.hooks.on('animation:out:start', async () => {
12
- useController('x-drawer', '.x-drawer').invoke('close')
13
- useController('x-dialog', '.x-dialog').invoke('close')
14
- useController('x-popover', '.x-popover:has([data-open])').invoke('hide')
12
+ useController('x-drawer', '.x-drawer').invoke('close')
13
+ useController('x-dialog', '.x-dialog').invoke('close')
14
+ useController('x-popover', '.x-popover:has([data-open])').invoke('hide')
15
15
  })
16
16
 
17
17
  useSwup.hooks.on('content:replace', () => {
18
- useSwup.options.containers.forEach((selector) => {
19
- initAfter(document.querySelector(selector))
20
- })
18
+ useSwup.options.containers.forEach((selector) => {
19
+ initAfter(document.querySelector(selector))
20
+ })
21
21
  })
22
22
 
23
23
  export { useSwup }
@@ -1,3 +1,4 @@
1
+ import './composables/naja.js'
1
2
  import './composables/stimulus.js'
2
3
  import './composables/swup.js'
3
4
  import './components/+.js'
@@ -4,8 +4,8 @@ import { initStimulus } from '../composables/stimulus.js'
4
4
  import { initNaja } from '@newlogic-digital/naja-extensions'
5
5
 
6
6
  export default function initAfter(element) {
7
- initStimulus(element)
8
- initNaja(element)
9
- replaceScripts(element)
10
- initCookieConsent(element)
7
+ initStimulus(element)
8
+ initNaja(element)
9
+ replaceScripts(element)
10
+ initCookieConsent(element)
11
11
  }
@@ -2,3 +2,4 @@
2
2
  @import "./defaults.css";
3
3
  @import "./keyframes.css";
4
4
  @import "./transitions.css";
5
+ @import "./variants.css";
@@ -27,10 +27,16 @@
27
27
  }
28
28
 
29
29
  :where([type="number"]) {
30
- -moz-appearance: textfield;
30
+ appearance: textfield;
31
31
 
32
32
  &::-webkit-outer-spin-button,
33
33
  &::-webkit-inner-spin-button {
34
- -webkit-appearance: none;
34
+ appearance: none;
35
+ }
36
+ }
37
+
38
+ :where([type="search"]) {
39
+ &::-webkit-search-cancel-button {
40
+ appearance: none;
35
41
  }
36
42
  }
@@ -1,6 +1,6 @@
1
1
  @import "winduum/src/base/transitions.css";
2
2
 
3
- .view-transition-main {
3
+ @utility view-transition-main {
4
4
  html.swup-enabled & {
5
5
  transition: opacity var(--view-transition-main-duration);
6
6
  opacity: 1;
@@ -0,0 +1,11 @@
1
+ @variant hocus {
2
+ @media (hover: hover) {
3
+ &:hover {
4
+ @slot;
5
+ }
6
+ }
7
+
8
+ &:focus-visible {
9
+ @slot;
10
+ }
11
+ }
@@ -1,11 +1,13 @@
1
- :root {
1
+ @theme {
2
2
  --x-header-height: 4rem;
3
3
  --scroll-padding-top: calc(var(--x-header-height) + 1rem);
4
4
  }
5
5
 
6
- .x-header {
7
- position: sticky;
8
- top: 0;
9
- z-index: var(--z-index-20);
10
- height: var(--x-header-height);
6
+ @layer utilities {
7
+ .x-header {
8
+ position: sticky;
9
+ top: 0;
10
+ z-index: var(--z-index-20);
11
+ height: var(--x-header-height);
12
+ }
11
13
  }
@@ -1,20 +1,24 @@
1
- html {
2
- scroll-padding-top: var(--scroll-padding-top);
1
+ @layer base {
2
+ html {
3
+ scroll-padding-top: var(--scroll-padding-top);
3
4
 
4
- @media (min-width: 60em) and (max-width: 75.9375rem) {
5
- font-size: 87.5%;
5
+ @media (min-width: 60em) and (max-width: 75.9375rem) {
6
+ font-size: 87.5%;
7
+ }
6
8
  }
7
- }
8
9
 
9
- body {
10
- background-color: var(--color-body);
11
- display: flex;
12
- flex-direction: column;
13
- overflow-x: clip;
10
+ body {
11
+ background-color: var(--color-body);
12
+ display: flex;
13
+ flex-direction: column;
14
+ overflow-x: clip;
15
+ }
14
16
  }
15
17
 
16
- .x-main {
17
- flex-grow: 1;
18
- display: flex;
19
- flex-direction: column;
18
+ @layer utilities {
19
+ .x-main {
20
+ flex-grow: 1;
21
+ display: flex;
22
+ flex-direction: column;
23
+ }
20
24
  }
@@ -1,5 +1,6 @@
1
1
  @import "./Badge.css";
2
2
  @import "./Button.css";
3
+ @import "./Carousel.css";
3
4
  @import "./Check.css";
4
5
  @import "./Compare.css";
5
6
  @import "./Control.css";
@@ -19,5 +20,6 @@
19
20
  @import "./Switch.css";
20
21
  @import "./Text.css";
21
22
  @import "./Title.css";
23
+ @import "./Toast.css";
22
24
  @import "./Toaster.css";
23
25
  @import "./dialog/+.css";
@@ -1,8 +1,8 @@
1
- @import "winduum/src/components/badge/props/default.css";
2
- @import "winduum/src/components/badge/default.css";
3
- @import "winduum/src/components/badge/sm.css";
4
- @import "winduum/src/components/badge/lg.css";
5
- @import "winduum/src/components/badge/bordered.css";
6
- @import "winduum/src/components/badge/muted.css";
7
- @import "winduum/src/components/badge/square.css";
8
- @import "winduum/src/components/badge/circle.css";
1
+ @import "winduum/src/components/badge/props/default.css" layer(theme);
2
+ @import "winduum/src/components/badge/default.css" layer(utilities);
3
+ @import "winduum/src/components/badge/sm.css" layer(utilities);
4
+ @import "winduum/src/components/badge/lg.css" layer(utilities);
5
+ @import "winduum/src/components/badge/bordered.css" layer(utilities);
6
+ @import "winduum/src/components/badge/muted.css" layer(utilities);
7
+ @import "winduum/src/components/badge/square.css" layer(utilities);
8
+ @import "winduum/src/components/badge/circle.css" layer(utilities);
@@ -1,12 +1,12 @@
1
- @import "winduum/src/components/button/props/default.css";
2
- @import "winduum/src/components/button/props/interactive.css";
3
- @import "winduum/src/components/button/default.css";
4
- @import "winduum/src/components/button/lg.css";
5
- @import "winduum/src/components/button/sm.css";
6
- @import "winduum/src/components/button/interactive.css";
7
- @import "winduum/src/components/button/bordered.css";
8
- @import "winduum/src/components/button/ghosted.css";
9
- @import "winduum/src/components/button/muted.css";
10
- @import "winduum/src/components/button/square.css";
11
- @import "winduum/src/components/button/circle.css";
12
- @import "winduum/src/components/button/spinner.css";
1
+ @import "winduum/src/components/button/props/default.css" layer(theme);
2
+ @import "winduum/src/components/button/props/interactive.css" layer(theme);
3
+ @import "winduum/src/components/button/default.css" layer(utilities);
4
+ @import "winduum/src/components/button/lg.css" layer(utilities);
5
+ @import "winduum/src/components/button/sm.css" layer(utilities);
6
+ @import "winduum/src/components/button/interactive.css" layer(utilities);
7
+ @import "winduum/src/components/button/bordered.css" layer(utilities);
8
+ @import "winduum/src/components/button/ghosted.css" layer(utilities);
9
+ @import "winduum/src/components/button/muted.css" layer(utilities);
10
+ @import "winduum/src/components/button/square.css" layer(utilities);
11
+ @import "winduum/src/components/button/circle.css" layer(utilities);
12
+ @import "winduum/src/components/button/spinner.css" layer(utilities);
@@ -0,0 +1,2 @@
1
+ @import "winduum/src/components/carousel/default.css" layer(utilities);
2
+ @import "winduum/src/components/carousel/content.css" layer(utilities);
@@ -1 +1,4 @@
1
- @import "winduum/src/components/check/index.css";
1
+ @import "winduum/src/components/check/props/default.css" layer(theme);
2
+ @import "winduum/src/components/check/default.css" layer(utilities);
3
+ @import "winduum/src/components/check/interactive.css" layer(utilities);
4
+ @import "winduum/src/components/check/invalid.css" layer(utilities);
@@ -1 +1 @@
1
- @import "winduum/src/components/compare/index.css";
1
+ @import "winduum/src/components/compare/default.css" layer(utilities);
@@ -1,29 +1,31 @@
1
- @import "winduum/src/components/control/props/default.css";
2
- @import "winduum/src/components/control/props/floating.css";
3
- @import "winduum/src/components/control/props/select.css";
4
- @import "winduum/src/components/control/props/icon.css";
5
- @import "winduum/src/components/control/default.css";
6
- @import "winduum/src/components/control/interactive.css";
7
- @import "winduum/src/components/control/file.css";
8
- @import "winduum/src/components/control/select.css";
9
- @import "winduum/src/components/control/icon.css";
10
- @import "winduum/src/components/control/floating.css";
11
- @import "winduum/src/components/control/invalid.css";
1
+ @import "winduum/src/components/control/props/default.css" layer(theme);
2
+ @import "winduum/src/components/control/props/floating.css" layer(theme);
3
+ @import "winduum/src/components/control/props/select.css" layer(theme);
4
+ @import "winduum/src/components/control/props/icon.css" layer(theme);
5
+ @import "winduum/src/components/control/default.css" layer(utilities);
6
+ @import "winduum/src/components/control/interactive.css" layer(utilities);
7
+ @import "winduum/src/components/control/file.css" layer(utilities);
8
+ @import "winduum/src/components/control/select.css" layer(utilities);
9
+ @import "winduum/src/components/control/icon.css" layer(utilities);
10
+ @import "winduum/src/components/control/floating.css" layer(utilities);
11
+ @import "winduum/src/components/control/invalid.css" layer(utilities);
12
12
 
13
- .x-control {
14
- &[data-active] label,
15
- :where(input, textarea):is(:focus, [placeholder]) ~ label,
16
- :where(select):is([data-placeholder]) ~ label {
17
- transform: translateY(calc(var(--x-control-label-translate-y) * -1)) scale(var(--x-control-label-scale));
18
- opacity: var(--x-control-label-focus-opacity, 0.5);
19
- }
13
+ @layer utilities {
14
+ .x-control {
15
+ &[data-active] label,
16
+ :where(input, textarea):is(:focus, [placeholder]) ~ label,
17
+ :where(select):is([data-placeholder]) ~ label {
18
+ transform: translateY(calc(var(--x-control-label-translate-y) * -1)) scale(var(--x-control-label-scale));
19
+ opacity: var(--x-control-label-focus-opacity, 0.5);
20
+ }
20
21
 
21
- &:has(label):not([data-active]) select:not([data-placeholder]) {
22
- font-size: 0;
23
- height: inherit;
22
+ &:has(label):not([data-active]) select:not([data-placeholder]) {
23
+ font-size: 0;
24
+ height: inherit;
24
25
 
25
- & option {
26
- font-size: var(--x-control-font-size);
26
+ & option {
27
+ font-size: var(--x-control-font-size);
28
+ }
27
29
  }
28
30
  }
29
31
  }
@@ -1 +1 @@
1
- @import "@newlogic-digital/stimulus-components/src/control-select/index.css";
1
+ @import "@newlogic-digital/stimulus-components/src/control-select/index.css" layer(utilities);
@@ -1,14 +1,16 @@
1
- @import "winduum/src/components/drawer/props/default.css";
2
- @import "winduum/src/components/drawer/props/content.css";
3
- @import "winduum/src/components/drawer/default.css";
4
- @import "winduum/src/components/drawer/content.css";
1
+ @import "winduum/src/components/drawer/props/default.css" layer(theme);
2
+ @import "winduum/src/components/drawer/props/content.css" layer(theme);
3
+ @import "winduum/src/components/drawer/default.css" layer(utilities);
4
+ @import "winduum/src/components/drawer/content.css" layer(utilities);
5
5
 
6
- .x-drawer {
7
- --x-drawer-content-inline-size: min(calc(100vw - 2rem), 22rem);
8
- --x-drawer-content-block-size: 100dvh;
9
- }
6
+ @layer utilities {
7
+ .x-drawer {
8
+ --x-drawer-content-inline-size: min(calc(100vw - 2rem), 22rem);
9
+ --x-drawer-content-block-size: 100dvh;
10
+ }
10
11
 
11
- .x-drawer-content {
12
- overflow-y: auto;
13
- overscroll-behavior: contain;
12
+ .x-drawer-content {
13
+ overflow-y: auto;
14
+ overscroll-behavior: contain;
15
+ }
14
16
  }
@@ -1 +1 @@
1
- @import "winduum/src/components/field/index.css";
1
+ @import "winduum/src/components/field/default.css" layer(utilities);
@@ -1 +1,2 @@
1
- @import "winduum/src/components/group/index.css";
1
+ @import "winduum/src/components/group/default.css" layer(utilities);
2
+ @import "winduum/src/components/group/vertical.css" layer(utilities);
@@ -1,4 +1,14 @@
1
- @import "winduum/src/components/heading/props/default.css";
2
- @import "winduum/src/components/heading/default.css";
3
- @import "winduum/src/components/heading/sm.css";
4
- @import "winduum/src/components/heading/lg.css";
1
+ @import "winduum/src/components/heading/props/default.css" layer(theme);
2
+ @import "winduum/src/components/heading/default.css" layer(utilities);
3
+
4
+ @utility sm {
5
+ .x-heading:is(&) {
6
+ --x-heading-font-size: var(--text-lg);
7
+ }
8
+ }
9
+
10
+ @utility lg {
11
+ .x-heading:is(&) {
12
+ --x-heading-font-size: var(--text-3xl);
13
+ }
14
+ }
@@ -1 +1,2 @@
1
- @import "winduum/src/components/image/index.css";
1
+ @import "winduum/src/components/image/default.css" layer(utilities);
2
+ @import "winduum/src/components/image/avatar.css" layer(utilities);
@@ -1 +1,2 @@
1
- @import "winduum/src/components/info/index.css";
1
+ @import "winduum/src/components/info/props/default.css" layer(theme);
2
+ @import "winduum/src/components/info/default.css" layer(utilities);
@@ -1 +1,2 @@
1
- @import "winduum/src/components/label/index.css";
1
+ @import "winduum/src/components/label/props/default.css" layer(theme);
2
+ @import "winduum/src/components/label/default.css" layer(utilities);
@@ -1,2 +1,2 @@
1
- @import "winduum/src/components/link/default.css";
2
- @import "winduum/src/components/link/interactive.css";
1
+ @import "winduum/src/components/link/default.css" layer(utilities);
2
+ @import "winduum/src/components/link/interactive.css" layer(utilities);
@@ -1 +1,2 @@
1
- @import "winduum/src/components/notice/index.css";
1
+ @import "winduum/src/components/notice/props/default.css" layer(theme);
2
+ @import "winduum/src/components/notice/default.css" layer(utilities);
@@ -1 +1,13 @@
1
- @import "winduum/src/components/popover/index.css";
1
+ @import "winduum/src/components/popover/props/content.css" layer(theme);
2
+ @import "winduum/src/components/popover/default.css" layer(utilities);
3
+ @import "winduum/src/components/popover/content.css" layer(utilities);
4
+
5
+ @utility closed {
6
+ .x-popover-content:is(&) {
7
+ --tw-scale-x: var(--x-popover-content-scale-x);
8
+ --tw-scale-y: var(--x-popover-content-scale-y);
9
+
10
+ opacity: 0;
11
+ visibility: hidden;
12
+ }
13
+ }
@@ -1 +1,6 @@
1
- @import "winduum/src/components/progress/index.css";
1
+ @import "winduum/src/components/progress/props/default.css" layer(theme);
2
+ @import "winduum/src/components/progress/keyframes/default.css";
3
+ @import "winduum/src/components/progress/default.css" layer(utilities);
4
+ @import "winduum/src/components/progress/meter.css" layer(utilities);
5
+ @import "winduum/src/components/progress/sm.css" layer(utilities);
6
+ @import "winduum/src/components/progress/lg.css" layer(utilities);
@@ -1 +1,4 @@
1
- @import "winduum/src/components/range/index.css";
1
+ @import "winduum/src/components/range/props/default.css" layer(theme);
2
+ @import "winduum/src/components/range/default.css" layer(utilities);
3
+ @import "winduum/src/components/range/multi.css" layer(utilities);
4
+ @import "winduum/src/components/range/vertical.css" layer(utilities);
@@ -1 +1,4 @@
1
- @import "winduum/src/components/switch/index.css";
1
+ @import "winduum/src/components/switch/props/default.css" layer(theme);
2
+ @import "winduum/src/components/switch/default.css" layer(utilities);
3
+ @import "winduum/src/components/switch/interactive.css" layer(utilities);
4
+ @import "winduum/src/components/switch/invalid.css" layer(utilities);
@@ -1 +1,2 @@
1
- @import "winduum/src/components/text/index.css";
1
+ @import "winduum/src/components/text/props/default.css" layer(theme);
2
+ @import "winduum/src/components/text/default.css" layer(utilities);
@@ -1,4 +1,14 @@
1
- @import "winduum/src/components/title/props/default.css";
2
- @import "winduum/src/components/title/default.css";
3
- @import "winduum/src/components/title/sm.css";
4
- @import "winduum/src/components/title/lg.css";
1
+ @import "winduum/src/components/title/props/default.css" layer(theme);
2
+ @import "winduum/src/components/title/default.css" layer(utilities);
3
+
4
+ @utility sm {
5
+ .x-title:is(&) {
6
+ --x-title-font-size: var(--text-xs);
7
+ }
8
+ }
9
+
10
+ @utility lg {
11
+ .x-title:is(&) {
12
+ --x-title-font-size: var(--text-base);
13
+ }
14
+ }
@@ -0,0 +1,4 @@
1
+ @import "winduum/src/components/toast/props/default.css" layer(theme);
2
+ @import "winduum/src/components/toast/props/content.css" layer(theme);
3
+ @import "winduum/src/components/toast/default.css" layer(utilities);
4
+ @import "winduum/src/components/toast/content.css" layer(utilities);
@@ -1,2 +1,2 @@
1
- @import "winduum/src/components/toaster/index.css";
2
- @import "winduum/src/components/toast/index.css";
1
+ @import "winduum/src/components/toaster/props/default.css" layer(theme);
2
+ @import "winduum/src/components/toaster/default.css" layer(utilities);
@@ -1,2 +1,2 @@
1
- @import "winduum/src/components/dialog/props/default.css";
2
- @import "winduum/src/components/dialog/default.css";
1
+ @import "winduum/src/components/dialog/props/default.css" layer(theme);
2
+ @import "winduum/src/components/dialog/default.css" layer(utilities);
@@ -1,2 +1,2 @@
1
- @import "winduum/src/components/dialog/props/content.css";
2
- @import "winduum/src/components/dialog/content.css";
1
+ @import "winduum/src/components/dialog/props/content.css" layer(theme);
2
+ @import "winduum/src/components/dialog/content.css" layer(utilities);
@@ -1,16 +1,18 @@
1
- .x-cookieconsent-dialog {
2
- .x-dialog-content {
3
- max-width: 32rem;
4
- }
5
-
6
- &.center {
1
+ @layer utilities {
2
+ .x-cookieconsent-dialog {
7
3
  .x-dialog-content {
8
- max-width: 26rem;
9
- text-align: center;
4
+ max-width: 32rem;
5
+ }
6
+
7
+ &.center {
8
+ .x-dialog-content {
9
+ max-width: 26rem;
10
+ text-align: center;
10
11
 
11
- & .x-image {
12
- margin-left: auto;
13
- margin-right: auto;
12
+ & .x-image {
13
+ margin-left: auto;
14
+ margin-right: auto;
15
+ }
14
16
  }
15
17
  }
16
18
  }
@@ -11,7 +11,8 @@ img {
11
11
  a {
12
12
  transition: color 0.15s;
13
13
 
14
- &, img {
14
+ &,
15
+ img {
15
16
  text-decoration: none;
16
17
  color: var(--color-main);
17
18
  }
@@ -9,7 +9,8 @@
9
9
  font-size: 14px;
10
10
  font-weight: 700;
11
11
 
12
- &, span {
12
+ &,
13
+ span {
13
14
  text-decoration: none;
14
15
  color: var(--color-primary-foreground);
15
16
  }
@@ -3,5 +3,5 @@
3
3
  line-height: 28px;
4
4
  font-weight: 700;
5
5
  mso-line-height-rule: exactly;
6
- font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
6
+ font-family: var(--default-font-family);
7
7
  }
@@ -1,5 +1,5 @@
1
1
  .x-main {
2
- font-family: Roboto, Tahoma, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
2
+ font-family: var(--default-font-family);
3
3
  background-color: var(--color-body);
4
4
  color: var(--color-main);
5
5
  color-scheme: light;
@@ -3,7 +3,8 @@
3
3
  line-height: 24px;
4
4
  mso-line-height-rule: exactly;
5
5
 
6
- b, strong {
6
+ b,
7
+ strong {
7
8
  font-weight: 700;
8
9
  }
9
10
 
@@ -1,9 +1,8 @@
1
- @import "tailwindcss/base.css";
2
- @import "tailwindcss/components.css";
3
- @import "tailwindcss/utilities.css";
4
- @import "tailwindcss/variants.css";
1
+ @import "tailwindcss/utilities" source(none);
5
2
  @import "./base/+.css";
6
3
  @import "./theme/config.css";
7
4
  @import "./theme/default.css";
8
5
  @import "./components/+.css";
9
6
  @import "./utils/+.css";
7
+
8
+ @source "../../templates/emails";
@@ -1,4 +1,15 @@
1
- :root {
1
+ @theme {
2
+ --default-font-family:
3
+ "Roboto",
4
+ -apple-system,
5
+ "BlinkMacSystemFont",
6
+ "Segoe UI",
7
+ "Helvetica",
8
+ "Arial",
9
+ sans-serif,
10
+ "Apple Color Emoji",
11
+ "Segoe UI Emoji",
12
+ "Segoe UI Symbol";
2
13
  --spacing-container: 24px;
3
14
  --radius: 12px;
4
15
  --container: 600px;
@@ -1,4 +1,4 @@
1
- :root {
1
+ @theme {
2
2
  --color-primary: #83cd4f;
3
3
  --color-primary-hover: #73b346;
4
4
  --color-primary-foreground: #000;
@@ -1,4 +1,4 @@
1
- .container {
1
+ @utility container {
2
2
  min-width: var(--container);
3
3
  width: var(--container);
4
4
 
@@ -8,22 +8,22 @@
8
8
  }
9
9
  }
10
10
 
11
- .underline {
11
+ @utility underline {
12
12
  text-decoration: underline;
13
13
  }
14
14
 
15
- .border-r {
15
+ @utility border-r {
16
16
  border-right: 1px solid;
17
17
  }
18
18
 
19
- .border-l {
19
+ @utility border-l {
20
20
  border-left: 1px solid;
21
21
  }
22
22
 
23
- .border-b {
23
+ @utility border-b {
24
24
  border-bottom: 1px solid;
25
25
  }
26
26
 
27
- .border-t {
27
+ @utility border-t {
28
28
  border-top: 1px solid;
29
29
  }
@@ -1,10 +1,17 @@
1
- @import "winduum/src/base/reset.css";
2
- @import "tailwindcss/base.css";
3
- @import "winduum/tailwindcss/base/defaults.css";
4
- @import "./base/+.css";
5
- @import "./theme/main.css";
6
- @import "./components/+.css" layer(components);
7
- @import "./utils/+.css" layer(components);
8
- @import "tailwindcss/components.css";
9
- @import "tailwindcss/utilities.css";
10
- @import "tailwindcss/variants.css";
1
+ @import "tailwindcss/theme.css" layer(theme);
2
+ @import "winduum/tailwindcss/theme/config/index.css" layer(theme);
3
+ @import "./theme/main.css" layer(theme);
4
+ @import "winduum/src/base/reset.css" layer(base);
5
+ @import "./base/defaults.css" layer(base);
6
+ @import "./components/+.css";
7
+ @import "./utils/+.css";
8
+ @import "tailwindcss/utilities" layer(utilities);
9
+ @import "winduum/tailwindcss/variants/dark.css";
10
+ @import "./base/breakpoints.css";
11
+ @import "./base/keyframes.css";
12
+ @import "./base/transitions.css";
13
+ @import "./base/variants.css";
14
+
15
+ @source "../../node_modules/winduum/src";
16
+ @source not "../templates/emails";
17
+ @source not "../views/emails";
@@ -1,4 +1,5 @@
1
- :root.dark, :host.dark {
1
+ :root.dark,
2
+ :host.dark {
2
3
  --default-color-scheme: dark;
3
4
  --color-main: #c9d1d9;
4
5
  --color-body: #0e1116;
@@ -1,12 +1,6 @@
1
- @import "winduum/src/theme/config/font.css";
2
- @import "winduum/src/theme/config/mask.css";
3
- @import "winduum/src/theme/config/radius.css";
4
- @import "winduum/src/theme/config/spacing.css";
5
- @import "winduum/src/theme/config/transition.css";
6
- @import "winduum/src/theme/config/z.css";
7
1
  @import "./dark.css";
8
2
 
9
- :root, :host {
3
+ @theme {
10
4
  --default-font-family: "Poppins", sans-serif;
11
5
  --default-color-space: srgb;
12
6
  --default-color-scheme: inherit;
@@ -32,4 +26,5 @@
32
26
  --color-error: #dc2626;
33
27
  --color-warning: #eab308;
34
28
  --color-info: #0ea5e9;
29
+ --container-width: 80rem;
35
30
  }
@@ -1,4 +1,3 @@
1
- @import "./container.css";
2
1
  @import "./index.css";
3
2
  @import "./reveal.css";
4
3
  @import "./scrollbar.css";
@@ -1,8 +1,5 @@
1
- @import "winduum/src/utilities/animation.css";
2
- @import "winduum/src/utilities/ripple/index.css";
3
- @import "winduum/src/utilities/skeleton/index.css";
4
- @import "winduum/src/utilities/underline.css";
5
- @import "winduum/src/utilities/swap/index.css";
6
- @import "winduum/src/utilities/spinner/default.css";
7
- @import "winduum/src/utilities/dot.css";
8
- @import "./+.css";
1
+ @import "winduum/src/utilities/container/props/default.css" layer(theme);
2
+ @import "winduum/src/utilities/ripple/keyframes/default.css";
3
+ @import "winduum/src/utilities/skeleton/props/default.css" layer(theme);
4
+ @import "winduum/src/utilities/spinner/keyframes/ring.css";
5
+ @import "winduum/tailwindcss/utilities/index.css";
@@ -1,22 +1,21 @@
1
- .reveal {
1
+ @utility reveal {
2
2
  opacity: 0;
3
3
  transition-property: var(--default-transition-property);
4
4
  transition-timing-function: var(--ease-in-out);
5
5
  transition-duration: 0.75s;
6
6
  will-change: transform;
7
7
 
8
- @media (prefers-reduced-motion) {
8
+ @media (prefers-reduced-motion), (scripting: none), print {
9
9
  opacity: 1;
10
- transform: none;
10
+ scale: none;
11
+ translate: none;
12
+ rotate: none;
11
13
  }
12
14
 
13
- @media print {
15
+ &:is([data-in]) {
14
16
  opacity: 1;
15
- transform: none;
16
- }
17
-
18
- &:is([data-in]), .no-js & {
19
- opacity: 1;
20
- transform: none;
17
+ scale: none;
18
+ translate: none;
19
+ rotate: none;
21
20
  }
22
21
  }
@@ -1,4 +1,4 @@
1
- .no-scrollbar {
1
+ @utility no-scrollbar {
2
2
  scrollbar-width: none;
3
3
 
4
4
  &::-webkit-scrollbar {
@@ -6,7 +6,7 @@
6
6
  }
7
7
  }
8
8
 
9
- .scrollbar {
9
+ @utility scrollbar {
10
10
  scrollbar-width: thin;
11
11
  scrollbar-color: var(--color-primary) var(--color-body-primary);
12
12
  overscroll-behavior: contain;
@@ -0,0 +1,27 @@
1
+ <div class="x-popover trigger-focus group mx-auto w-80" data-controller="x-popover">
2
+ <div class="x-control w-full">
3
+ <input
4
+ data-action="input->x-popover#autocomplete"
5
+ data-x-popover-target="autocomplete"
6
+ type="search"
7
+ placeholder="Vyhledávání ..."
8
+ autocomplete="off"
9
+ role="combobox"
10
+ aria-autocomplete="list"
11
+ aria-controls="popoverContent"
12
+ aria-haspopup="listbox"
13
+ aria-expanded="true"
14
+ value="Volba"
15
+ >
16
+ </div>
17
+ <div
18
+ class="x-popover-content center flex flex-col shadow dark:bg-body-secondary mt-2 p-2 gap-2 w-full empty:closed group-not-has-aria-expanded:closed"
19
+ data-x-popover-target="content"
20
+ role="listbox"
21
+ id="popoverContent"
22
+ >
23
+ <button id="option-1" class="x-button ghosted justify-start" role="option" data-action="click->x-popover#selectDescendant">Volba 1</button>
24
+ <button id="option-2" class="x-button ghosted justify-start" role="option" data-action="click->x-popover#selectDescendant">Volba 2</button>
25
+ <button id="option-3" class="x-button ghosted justify-start" role="option" data-action="click->x-popover#selectDescendant">Volba 3</button>
26
+ </div>
27
+ </div>
@@ -1,15 +1,15 @@
1
1
  <div class="grid grid-cols-container">
2
2
  <div class="p-4 bg-body-secondary rounded w-full max-w-xl mx-auto">
3
- <h1 class="x-heading mb-4">Hello world!</h1>
3
+ <h1 class="x-heading lg mb-4">Hello world!</h1>
4
4
  <div class="x-text mb-4">Want to dig deeper into Newlogic UI?</div>
5
5
 
6
6
  <a href="https://ui.newlogic.cz/" class="x-link underline">Read the docs &rarr;</a>
7
7
  </div>
8
8
  <div class="flex justify-center mt-4">
9
9
  <button
10
- class="x-button"
11
- data-invoke-action="x-dialog#show"
12
- data-invoke-url="/dialog/basic.json"
10
+ class="x-button"
11
+ data-invoke-action="x-dialog#show"
12
+ data-invoke-url="/dialog/basic.json"
13
13
  >
14
14
  Dialog Fetch Example
15
15
  </button>
@@ -16,9 +16,18 @@
16
16
  <meta name="supported-color-schemes" content="light dark">
17
17
  {/if}
18
18
 
19
- <style type="text/css" n:syntax="off">
20
- @import '/src/styles/emails/main.css';
21
- </style>
19
+ <link rel="stylesheet" href="/src/styles/emails/main.css">
20
+
21
+ <script type="module" n:if="VITE_SERVER">
22
+ if (import.meta.hot && window.location.search === '?send') {
23
+ import.meta.hot.send('my:send', {
24
+ filename: window.location.href,
25
+ content:
26
+ new XMLSerializer().serializeToString(document.doctype) +
27
+ document.documentElement.outerHTML.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi, "")
28
+ })
29
+ }
30
+ </script>
22
31
  </head>
23
32
  <body>
24
33
  <table class="x-main w-full" align="center">
@@ -1,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html class="no-js" lang="en">
2
+ <html lang="en">
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <title>{$title}</title>
@@ -40,12 +40,12 @@
40
40
 
41
41
  <script>
42
42
  (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) && document.documentElement.classList.add('dark')
43
- document.documentElement.classList.remove('no-js')
44
43
  </script>
45
44
 
46
45
  <script src="{$assets->js->main|asset}" type="module"></script>
47
46
 
48
47
  <link rel="icon" type="image/svg+xml" href="/favicons/favicon.svg">
48
+ <link rel="icon" type="image/webp" href="/favicons/favicon-512.webp">
49
49
  <link rel="apple-touch-icon" type="image/webp" href="/favicons/favicon-512.webp">
50
50
  <link rel="manifest" href="/favicons/manifest.webmanifest">
51
51
  </head>
package/vite.config.js CHANGED
@@ -3,6 +3,10 @@ import core from '@newlogic-digital/core'
3
3
 
4
4
  export default defineConfig({
5
5
  plugins: [
6
- core()
6
+ core({
7
+ css: {
8
+ transformer: 'lightningcss'
9
+ }
10
+ })
7
11
  ]
8
12
  })
@@ -1,5 +0,0 @@
1
- @import "./base/+.css";
2
- @import "./components/+.css";
3
- @import "./main.css";
4
- @import "./theme/+.css";
5
- @import "./utils/+.css";
@@ -1,5 +0,0 @@
1
- @import "winduum/src/utilities/container/index.css";
2
-
3
- :root, :host {
4
- --container-width: 80rem;
5
- }