@moreonion/foundist 3.5.1 → 3.6.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.
- package/README.md +3 -3
- package/package.json +16 -18
- package/src/html/includes/form-items/webform-steps.html +8 -8
- package/src/js/example.js +1 -6
- package/src/js/foundist.js +26 -25
- package/src/scss/components/_headline.scss +2 -2
- package/src/scss/components/_settings.scss +1 -1
- package/src/scss/form/_donation-amount-button.scss +3 -3
- package/src/scss/form/_settings.scss +1 -1
- package/src/scss/main.scss +1 -0
package/README.md
CHANGED
|
@@ -22,8 +22,8 @@ the desired result)!
|
|
|
22
22
|
|
|
23
23
|
The setup should give you a quite modern JS/SCSS-environment:
|
|
24
24
|
- Vite (with SCSS, browserlist, PostCSS)
|
|
25
|
-
- Linting (`stylelint`, `
|
|
26
|
-
- Prettifying (`prettify`)
|
|
25
|
+
- Linting (`stylelint`, `oxlint`)
|
|
26
|
+
- Prettifying (`prettify`, `oxfmt`)
|
|
27
27
|
- Pre-commit hooks for `.scss` and `.js` files
|
|
28
28
|
|
|
29
29
|
The entrypoints are at:
|
|
@@ -80,5 +80,5 @@ There is a basic settings file provided.
|
|
|
80
80
|
You might want to install the following VS Code plugins (or re-enable the build in formatters):
|
|
81
81
|
|
|
82
82
|
- Prettier - Code formatter `esbenp.prettier-vscode` <https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode>
|
|
83
|
-
- ESLint `dbaeumer.vscode-eslint` <https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint>
|
|
84
83
|
- stylelint `shinnn.stylelint` <https://marketplace.visualstudio.com/items?itemName=shinnn.stylelint>
|
|
84
|
+
- OXC `oxc.oxc-vscode` <https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moreonion/foundist",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "Foundation based default theme for Impact Stack landing pages.",
|
|
5
5
|
"author": "More Onion <kontakt@more-onion.at>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,36 +18,33 @@
|
|
|
18
18
|
"build": "vite build",
|
|
19
19
|
"preview": "vite preview",
|
|
20
20
|
"lint:css": "stylelint src/scss && prettier --check 'src/scss/**/*.scss'",
|
|
21
|
-
"lint:js": "
|
|
21
|
+
"lint:js": "oxlint src/js && oxfmt --check src/js",
|
|
22
22
|
"lint": "yarn run lint:css && yarn run lint:js",
|
|
23
23
|
"fix:css": "stylelint --fix src/scss && prettier --write 'src/scss/**/*.scss'",
|
|
24
|
-
"fix:js": "
|
|
24
|
+
"fix:js": "oxfmt src/js && oxlint --fix src/js",
|
|
25
25
|
"fix": "yarn run fix:css && yarn run fix:js",
|
|
26
26
|
"prepare": "husky"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@moreonion/foundation-base": "3.
|
|
29
|
+
"@moreonion/foundation-base": "3.6.0",
|
|
30
30
|
"foundation-sites": "6.9.0",
|
|
31
31
|
"jquery": "^4.0.0",
|
|
32
|
-
"sass-embedded": "^1.
|
|
33
|
-
"select2": "^4.1.0
|
|
32
|
+
"sass-embedded": "^1.100.0",
|
|
33
|
+
"select2": "^4.1.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"autoprefixer": "^10.5.0",
|
|
37
|
-
"eslint": "8.57.0",
|
|
38
|
-
"eslint-config-standard": "^17.1.0",
|
|
39
|
-
"eslint-plugin-import": "^2.31.0",
|
|
40
|
-
"eslint-plugin-n": "^16.6.0",
|
|
41
|
-
"eslint-plugin-promise": "^6.6.0",
|
|
42
37
|
"husky": "^9.1.0",
|
|
43
|
-
"lint-staged": "^
|
|
38
|
+
"lint-staged": "^17.0.0",
|
|
39
|
+
"oxfmt": "^0.57.0",
|
|
40
|
+
"oxlint": "^1.72.0",
|
|
44
41
|
"postcss": "^8.5.0",
|
|
45
|
-
"prettier": "^3.
|
|
46
|
-
"stylelint": "^17.
|
|
42
|
+
"prettier": "^3.9.0",
|
|
43
|
+
"stylelint": "^17.14.0",
|
|
47
44
|
"stylelint-config-idiomatic-order": "^10.0.0",
|
|
48
45
|
"stylelint-config-recommended-scss": "^17.0.0",
|
|
49
|
-
"stylelint-scss": "^7.
|
|
50
|
-
"vite": "^
|
|
46
|
+
"stylelint-scss": "^7.2.0",
|
|
47
|
+
"vite": "^8.0.0",
|
|
51
48
|
"vite-plugin-nunjucks": "^0.2.0"
|
|
52
49
|
},
|
|
53
50
|
"lint-staged": {
|
|
@@ -56,8 +53,9 @@
|
|
|
56
53
|
"prettier --check"
|
|
57
54
|
],
|
|
58
55
|
"*.js": [
|
|
59
|
-
"
|
|
56
|
+
"oxlint",
|
|
57
|
+
"oxfmt"
|
|
60
58
|
]
|
|
61
59
|
},
|
|
62
|
-
"packageManager": "yarn@4.
|
|
60
|
+
"packageManager": "yarn@4.16.0"
|
|
63
61
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<div class="form-steps-wrapper">
|
|
2
|
-
<
|
|
3
|
-
<
|
|
2
|
+
<nav class="form-steps" data-form-steps-total="3" data-form-steps-current="2">
|
|
3
|
+
<button class="step previous first clickable" data-form-step-number="1">
|
|
4
4
|
<span class="step-number">1</span>
|
|
5
5
|
<span class="step-label">Data</span>
|
|
6
|
-
</
|
|
7
|
-
<
|
|
6
|
+
</button>
|
|
7
|
+
<button class="step current" data-form-step-number="2">
|
|
8
8
|
<span class="step-number">2</span>
|
|
9
9
|
<span class="step-label">Message</span>
|
|
10
|
-
</
|
|
11
|
-
<
|
|
10
|
+
</button>
|
|
11
|
+
<button class="step last" data-form-step-number="3">
|
|
12
12
|
<span class="step-number">3</span>
|
|
13
13
|
<span class="step-label">Another form step</span>
|
|
14
|
-
</
|
|
15
|
-
</
|
|
14
|
+
</button>
|
|
15
|
+
</nav>
|
|
16
16
|
</div>
|
package/src/js/example.js
CHANGED
package/src/js/foundist.js
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
/* global Drupal */
|
|
2
2
|
|
|
3
|
-
// Ensure $ is available: Foundation and select2 need to bind to it
|
|
4
|
-
import $ from 'jquery'
|
|
5
|
-
import select2 from 'select2'
|
|
6
|
-
|
|
7
|
-
/* eslint-disable no-unused-vars */
|
|
8
|
-
import {
|
|
9
|
-
Accordion,
|
|
10
|
-
Foundation,
|
|
11
|
-
Reveal,
|
|
12
|
-
SmoothScroll,
|
|
13
|
-
Toggler
|
|
14
|
-
} from 'foundation-sites/js/foundation'
|
|
15
|
-
/* eslint-enable no-unused-vars */
|
|
16
|
-
|
|
17
3
|
import {
|
|
18
4
|
AdaptiveSticky,
|
|
19
5
|
CookieBar,
|
|
@@ -26,6 +12,18 @@ import {
|
|
|
26
12
|
UserAgent,
|
|
27
13
|
initEventBridge,
|
|
28
14
|
} from '@moreonion/foundation-base'
|
|
15
|
+
/* eslint-disable no-unused-vars */
|
|
16
|
+
import {
|
|
17
|
+
Accordion,
|
|
18
|
+
Foundation,
|
|
19
|
+
Reveal,
|
|
20
|
+
SmoothScroll,
|
|
21
|
+
Toggler,
|
|
22
|
+
} from 'foundation-sites/js/foundation'
|
|
23
|
+
// Ensure $ is available: Foundation and select2 need to bind to it
|
|
24
|
+
import $ from 'jquery'
|
|
25
|
+
/* eslint-enable no-unused-vars */
|
|
26
|
+
import select2 from 'select2'
|
|
29
27
|
|
|
30
28
|
// Add the select2 to jQuery
|
|
31
29
|
// Needed for SelectTwo plugin
|
|
@@ -49,11 +47,11 @@ Foundation.plugin(UserAgent, 'UserAgent')
|
|
|
49
47
|
* Let foundation initialize the initial markup.
|
|
50
48
|
* This needs to be done for dynamically loaded markup too (e.g. AJAX markup)
|
|
51
49
|
*/
|
|
52
|
-
export function initFoundation
|
|
50
|
+
export function initFoundation() {
|
|
53
51
|
initEventBridge($)
|
|
54
52
|
if (typeof Drupal !== 'undefined') {
|
|
55
53
|
Drupal.behaviors.foundist_initialize = {}
|
|
56
|
-
Drupal.behaviors.foundist_initialize.attach = (context
|
|
54
|
+
Drupal.behaviors.foundist_initialize.attach = (context) => {
|
|
57
55
|
$(context).foundation()
|
|
58
56
|
// Show overlays with `data-open` initially.
|
|
59
57
|
const $overlay = $('[data-reveal][data-open]')
|
|
@@ -71,10 +69,11 @@ export function initFoundation () {
|
|
|
71
69
|
|
|
72
70
|
/**
|
|
73
71
|
* Activate AdaptiveSticky on forms in the sidebar.
|
|
72
|
+
*
|
|
74
73
|
* @param {object} options - Overrides to the AdaptiveSticky plugin settings.
|
|
75
|
-
* @returns {AdaptiveSticky|undefined} The initialized AdaptiveSticky plugin
|
|
74
|
+
* @returns {AdaptiveSticky | undefined} The initialized AdaptiveSticky plugin
|
|
76
75
|
*/
|
|
77
|
-
export function stickyForm
|
|
76
|
+
export function stickyForm(options = {}) {
|
|
78
77
|
const $form = $('#sidebar #form, #sidebar .share-buttons')
|
|
79
78
|
if (!$form.length) {
|
|
80
79
|
return
|
|
@@ -87,22 +86,23 @@ export function stickyForm (options = {}) {
|
|
|
87
86
|
target: '#form-outer #form, #form-outer .share-buttons ul',
|
|
88
87
|
offset: $('#form-outer').css('padding-top'),
|
|
89
88
|
mediaQuery: 'large',
|
|
90
|
-
...options
|
|
89
|
+
...options,
|
|
91
90
|
})
|
|
92
91
|
}
|
|
93
92
|
|
|
94
93
|
/**
|
|
95
94
|
* Activate StickyButton on CTA markup snippet.
|
|
95
|
+
*
|
|
96
96
|
* @param {object} options - Overrides to the StickyButton plugin settings.
|
|
97
|
-
* @returns {StickyButton[]|undefined} Array of initialized StickyButton plugins
|
|
97
|
+
* @returns {StickyButton[] | undefined} Array of initialized StickyButton plugins
|
|
98
98
|
*/
|
|
99
|
-
export function stickyButton
|
|
99
|
+
export function stickyButton(options = {}) {
|
|
100
100
|
let $cta = $('.sticky-cta')
|
|
101
101
|
if (!$cta.length) {
|
|
102
102
|
return
|
|
103
103
|
}
|
|
104
104
|
const defaults = {
|
|
105
|
-
topOverlap: 0.3
|
|
105
|
+
topOverlap: 0.3,
|
|
106
106
|
}
|
|
107
107
|
// Find blocking element
|
|
108
108
|
const target = $cta.find('a').attr('href')
|
|
@@ -128,17 +128,18 @@ export function stickyButton (options = {}) {
|
|
|
128
128
|
return $cta.map((i, el) => {
|
|
129
129
|
return new Foundation.StickyButton($(el), {
|
|
130
130
|
...defaults,
|
|
131
|
-
...options
|
|
131
|
+
...options,
|
|
132
132
|
})
|
|
133
133
|
})
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
137
|
* Activate cookiebar on cookiebar id.
|
|
138
|
+
*
|
|
138
139
|
* @param {object} options - Overrides to the Cookiebar plugin settings.
|
|
139
|
-
* @returns {
|
|
140
|
+
* @returns {CookieBar | undefined} The initialized Cookiebar plugin
|
|
140
141
|
*/
|
|
141
|
-
export function cookiebar
|
|
142
|
+
export function cookiebar(options = {}) {
|
|
142
143
|
const $cookiebar = $('#cookiebar')
|
|
143
144
|
if (!$cookiebar.length) {
|
|
144
145
|
return
|
|
@@ -28,8 +28,8 @@ $headline-color: color-pick-contrast(
|
|
|
28
28
|
if(
|
|
29
29
|
sass($headline-background and $headline-background != none): get-background-color(
|
|
30
30
|
$headline-background
|
|
31
|
-
)
|
|
32
|
-
|
|
31
|
+
);
|
|
32
|
+
else: get-background-color($fallback-background)
|
|
33
33
|
),
|
|
34
34
|
($title-color, $body-font-color-alt, $body-font-color),
|
|
35
35
|
6
|
|
@@ -143,7 +143,7 @@ $accordion-radius: rem-calc(5) !default;
|
|
|
143
143
|
$accordion-separator: true !default;
|
|
144
144
|
$accordion-title-font-size: 1rem !default;
|
|
145
145
|
$accordion-title-line-height: if(
|
|
146
|
-
sass($accordion-title-font-size == 1rem): unitless-calc($base-line-height)
|
|
146
|
+
sass($accordion-title-font-size == 1rem): unitless-calc($base-line-height);
|
|
147
147
|
else: grid-lineheight($accordion-title-font-size)
|
|
148
148
|
) !default;
|
|
149
149
|
$accordion-triangle-color: get-color(primary) !default;
|
|
@@ -31,8 +31,8 @@ $donation-amount-border-color-focus: if(
|
|
|
31
31
|
sass($donation-amount-border-color-hover == transparent): color.scale(
|
|
32
32
|
$donation-amount-background-color-checked,
|
|
33
33
|
$lightness: $button-hollow-hover-lightness
|
|
34
|
-
)
|
|
35
|
-
|
|
34
|
+
);
|
|
35
|
+
else: $donation-amount-border-color-hover
|
|
36
36
|
) !default;
|
|
37
37
|
|
|
38
38
|
// Button text colors
|
|
@@ -62,7 +62,7 @@ $donation-amount-text-color-checked: if(
|
|
|
62
62
|
// Button typography
|
|
63
63
|
$donation-amount-font-size: $large-font-size !default;
|
|
64
64
|
$donation-amount-text-offset: if(
|
|
65
|
-
sass(meta.type-of($button-text-offset) == map): map.get($button-text-offset, default)
|
|
65
|
+
sass(meta.type-of($button-text-offset) == map): map.get($button-text-offset, default);
|
|
66
66
|
else: $button-text-offset
|
|
67
67
|
) !default;
|
|
68
68
|
|
|
@@ -64,7 +64,7 @@ $form-label-line-height: if(
|
|
|
64
64
|
// Borders
|
|
65
65
|
$input-border-width: rem-calc(2) !default;
|
|
66
66
|
$input-border-color: if(
|
|
67
|
-
sass($input-background == $form-background): color.scale($form-background, $lightness: -10%)
|
|
67
|
+
sass($input-background == $form-background): color.scale($form-background, $lightness: -10%);
|
|
68
68
|
else: color.scale(get-background-color($form-background), $lightness: -5%)
|
|
69
69
|
) !default;
|
|
70
70
|
$input-border-color-focus: color.scale($input-border-color, $lightness: -10%) !default;
|