@newlogic-digital/ui 3.3.0 → 3.4.2
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.
- package/package.json +19 -20
- package/src/data/main.json +0 -1
- package/src/emails/templates/Layout.twig +1 -1
- package/src/scripts/Components/CookieConsent.js +0 -1
- package/src/scripts/Layout/Header.js +23 -11
- package/src/scripts/Layout/Main.js +3 -36
- package/src/scripts/Libraries/+.js +2 -1
- package/src/scripts/Libraries/Dialog.js +35 -72
- package/src/scripts/Libraries/Drawer.js +5 -1
- package/src/scripts/Libraries/Form.js +2 -0
- package/src/scripts/Libraries/Naja.js +35 -0
- package/src/scripts/Libraries/NativeSlider.js +1 -1
- package/src/scripts/Libraries/ReCaptcha.js +15 -0
- package/src/scripts/Libraries/Swup.js +19 -31
- package/src/scripts/Ui/Input.js +1 -1
- package/src/scripts/Utils/Functions/+.js +0 -1
- package/src/scripts/Utils/Functions/loadStimulus.js +4 -1
- package/src/scripts/Utils/cdn.js +3 -3
- package/src/styles/Components/Dialog/Default.css +17 -52
- package/src/styles/Layout/Main.css +4 -20
- package/src/styles/Libraries/Dialog.css +23 -7
- package/src/styles/Libraries/Drawer.css +2 -8
- package/src/styles/Libraries/Ripple.css +4 -17
- package/src/styles/Ui/Checkbox.css +0 -1
- package/src/styles/Ui/Link.css +1 -1
- package/src/styles/Ui/Text.css +5 -0
- package/src/styles/Utils/+.css +10 -9
- package/src/styles/Utils/breakpoints.css +9 -0
- package/src/styles/Utils/default.css +12 -108
- package/src/styles/Utils/tailwind/+.css +3 -2
- package/src/styles/Utils/tailwind/base.css +0 -37
- package/src/styles/Utils/tailwind/utilities.css +48 -0
- package/src/styles/Utils/theme/+.css +1 -1
- package/src/styles/Utils/vars.css +0 -35
- package/src/styles/Utils/vendor.css +2 -1
- package/src/styles/main.css +2 -3
- package/src/templates/Components/Dialogs/Basic.twig +15 -17
- package/src/templates/Sections/Ui/Docs/Default.twig +15 -15
- package/src/templates/Sections/Ui/Intro.html +1 -1
- package/src/views/dialog/basic.json.twig +1 -1
- package/src/views/email/email.twig +6 -0
- package/vite.config.js +22 -6
- package/.eslintrc +0 -13
- package/.stylelintrc +0 -18
- package/public/sw.js +0 -30
- package/src/emails/email.prod.html +0 -6
- package/src/emails/email.twig.html +0 -6
- package/src/emails/templates.prod/.gitkeep +0 -0
- package/src/scripts/Utils/Functions/inView.js +0 -24
- package/tailwind.config.cjs +0 -69
|
@@ -1147,32 +1147,32 @@
|
|
|
1147
1147
|
<div class="col col-12 items-start" id="dialog">
|
|
1148
1148
|
<h1 class="ui-title uppercase text-primary mb-5">Dialog</h1>
|
|
1149
1149
|
<div class="ui-text mb-5">
|
|
1150
|
-
<p>On any element you can add <code>data-action="click->lib-dialog#show"</code> with attribute <code>data-
|
|
1150
|
+
<p>On any element you can add <code>data-action="click->lib-dialog#show"</code> with attribute <code>data-lib-dialog-url-param</code> which is url to <code>*.json</code> file or url request which contains html. For closing the dialog window, you can add <code>data-action="click->lib-dialog#hide"</code> to any element</p>
|
|
1151
1151
|
<p></p>
|
|
1152
|
-
<p>Adding <code>data-lib-dialog-open</code> attribute on <code>data-controller="lib-dialog"</code> (by default located on body), then the dialog gets open upon page load</p>
|
|
1153
|
-
<p>Url is passed the
|
|
1152
|
+
<p>Adding <code>data-lib-dialog-open-option</code> attribute on <code>data-controller="lib-dialog"</code> (by default located on body), then the dialog gets open upon page load</p>
|
|
1153
|
+
<p>Url is passed the as <code>data-lib-dialog-url-option</code>, you can also add selector to <code>data-lib-dialog-open-option</code> and HTML content of that selector opens as a dialog.</p>
|
|
1154
1154
|
<p></p>
|
|
1155
1155
|
<p></p>
|
|
1156
1156
|
<h3>Methods</h3>
|
|
1157
|
-
<
|
|
1158
|
-
<li>open dialog with dialog with fetch request: <code>LibDialog.action(url)</code></li>
|
|
1159
|
-
<li>open dialog with any content: <code>LibDialog.show(content)</code></li>
|
|
1160
|
-
<li>close dialog: <code>LibDialog.hide()</code></li>
|
|
1161
|
-
</ul>
|
|
1162
|
-
<p>All methods returns promise</p>
|
|
1157
|
+
<p>See docs at <a href="https://legendary-muffin-ebbe68.netlify.app/docs/lib/dialog.html">Winduum</a></p>
|
|
1163
1158
|
<p></p>
|
|
1164
1159
|
<p></p>
|
|
1165
1160
|
<h3>Attributes (c-dialog)</h3>
|
|
1166
1161
|
<ul>
|
|
1167
|
-
<li>data-size
|
|
1168
|
-
<li>data-type
|
|
1169
|
-
|
|
1162
|
+
<li><code>data-size</code> - <code>sm</code>, <code>lg</code></li>
|
|
1163
|
+
<li><code>data-type</code> - <code>scrollable</code> - scroll inside dialog</li>
|
|
1164
|
+
</ul>
|
|
1165
|
+
<h3>Attributes (click->lib-dialog#show)</h3>
|
|
1166
|
+
<ul>
|
|
1167
|
+
<li><code>data-lib-dialog-url-param</code> - url of <code>*.json</code> file</li>
|
|
1168
|
+
<li><code>data-lib-dialog-remove-param</code> - <code>true/false</code> whenever to remove dialog element from dom after closing</li>
|
|
1169
|
+
<li><code>data-lib-dialog-append-param</code> - <code>true/false</code> whenever to append new dialog element after the previous dialog, otherwise the previous is replaced</li>
|
|
1170
1170
|
</ul>
|
|
1171
1171
|
</div>
|
|
1172
1172
|
{% code "html:mirror" %}
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1173
|
+
<button class="ui-btn" data-action="click->lib-dialog#show" data-lib-dialog-url-param="/dialog/basic.json">
|
|
1174
|
+
Open dialog window
|
|
1175
|
+
</button>
|
|
1176
1176
|
{% endcode %}
|
|
1177
1177
|
</div>
|
|
1178
1178
|
<div class="col-12" id="drawer">
|
package/vite.config.js
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
import { defineConfig } from 'vituum'
|
|
2
1
|
import core from '@newlogic-digital/core'
|
|
3
2
|
import postcssHasPseudo from 'css-has-pseudo'
|
|
3
|
+
import postcssCustomSelectors from 'postcss-custom-selectors'
|
|
4
4
|
|
|
5
|
-
export default
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export default {
|
|
6
|
+
plugins: [
|
|
7
|
+
core({
|
|
8
|
+
format: ['twig'],
|
|
9
|
+
twig: {
|
|
10
|
+
globals: {
|
|
11
|
+
template: './src/templates/Layout/Main.twig'
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
tailwindcss: {
|
|
15
|
+
nesting: {
|
|
16
|
+
noIsPseudoSelector: true
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
],
|
|
21
|
+
css: {
|
|
22
|
+
postcss: {
|
|
23
|
+
plugins: [postcssCustomSelectors(), postcssHasPseudo()]
|
|
24
|
+
}
|
|
9
25
|
}
|
|
10
|
-
}
|
|
26
|
+
}
|
package/.eslintrc
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "standard",
|
|
3
|
-
"rules": {
|
|
4
|
-
"indent": ["error", 4],
|
|
5
|
-
"no-new": "off",
|
|
6
|
-
"space-before-function-paren": ["error", "never"],
|
|
7
|
-
"import/extensions": ["error", "ignorePackages"]
|
|
8
|
-
},
|
|
9
|
-
"env": {
|
|
10
|
-
"browser": true
|
|
11
|
-
},
|
|
12
|
-
"ignorePatterns": ["**/+.js"]
|
|
13
|
-
}
|
package/.stylelintrc
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "stylelint-config-standard",
|
|
3
|
-
"rules": {
|
|
4
|
-
"at-rule-no-unknown": [true, {"ignoreAtRules": ["layer", "tailwind"]}],
|
|
5
|
-
"selector-list-comma-newline-after": "always-multi-line",
|
|
6
|
-
"string-quotes": "double",
|
|
7
|
-
"comment-empty-line-before": ["always", {"except": ["first-nested"], "ignore": ["stylelint-commands"], "ignoreComments": ["/^clean-css/"]}],
|
|
8
|
-
"length-zero-no-unit": [true, {"ignore": ["custom-properties"]}],
|
|
9
|
-
"value-keyword-case": ["lower", { "camelCaseSvgKeywords": true }],
|
|
10
|
-
"alpha-value-notation": "number",
|
|
11
|
-
"property-no-vendor-prefix": [true, { "ignoreProperties": "appearance" }],
|
|
12
|
-
"number-max-precision": [4, { "ignoreProperties": "letter-spacing" }],
|
|
13
|
-
"max-line-length": 140,
|
|
14
|
-
"selector-class-pattern": null,
|
|
15
|
-
"import-notation": "string"
|
|
16
|
-
},
|
|
17
|
-
"ignoreFiles": ["**/+.css", "src/styles/Utils/normalize.css"]
|
|
18
|
-
}
|
package/public/sw.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const offlineUrl = '/offline'
|
|
2
|
-
|
|
3
|
-
self.addEventListener('install', function(event) {
|
|
4
|
-
const offlineRequest = new Request(offlineUrl)
|
|
5
|
-
|
|
6
|
-
event.waitUntil(
|
|
7
|
-
fetch(offlineRequest).then(function(response) {
|
|
8
|
-
return caches.open('offline').then(function(cache) {
|
|
9
|
-
console.log('[oninstall] Cached offline page', response.url)
|
|
10
|
-
return cache.put(offlineRequest, response)
|
|
11
|
-
})
|
|
12
|
-
})
|
|
13
|
-
)
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
self.addEventListener('fetch', function(event) {
|
|
17
|
-
const request = event.request
|
|
18
|
-
|
|
19
|
-
if (request.url.match(/\.(css|jpg|jpeg|png|gif|js|woff|woff2|ttf|svg|mp4|webp)$/) || request.url.indexOf(request.referrer) !== 0) {
|
|
20
|
-
} else if (request.method === 'GET') {
|
|
21
|
-
event.respondWith(
|
|
22
|
-
fetch(request).catch(function(error) {
|
|
23
|
-
console.log('[onfetch] Failed. Serving cached offline fallback ' + error)
|
|
24
|
-
return caches.open('offline').then(function(cache) {
|
|
25
|
-
return cache.match(offlineUrl)
|
|
26
|
-
})
|
|
27
|
-
})
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
})
|
|
File without changes
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export default function inView(element, options = {}) {
|
|
2
|
-
let inView = false
|
|
3
|
-
|
|
4
|
-
return new Promise((resolve) => {
|
|
5
|
-
if (typeof IntersectionObserver === 'undefined') {
|
|
6
|
-
resolve()
|
|
7
|
-
return false
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
if (!options.rootMargin) {
|
|
11
|
-
options.rootMargin = '100px'
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const observer = new IntersectionObserver(entries => {
|
|
15
|
-
if (entries[0].isIntersecting && inView === false) {
|
|
16
|
-
inView = entries[0].isIntersecting
|
|
17
|
-
observer.disconnect()
|
|
18
|
-
resolve()
|
|
19
|
-
}
|
|
20
|
-
}, options || {})
|
|
21
|
-
|
|
22
|
-
observer.observe(element)
|
|
23
|
-
})
|
|
24
|
-
}
|
package/tailwind.config.cjs
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
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
|
-
}
|