@massimo-cassandro/minimo 1.17.1 → 1.18.1

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 (57) hide show
  1. package/design-tokens/tokens/src/components/unsplash-page/unsplash-page.minimo.tokens.jsonc +3 -3
  2. package/dev-tools/starter-kit/templates/__project__.code-workspace +2 -2
  3. package/dev-tools/starter-kit/webpack-modules/css-rules.mjs +1 -0
  4. package/dev-tools/starter-kit/webpack-modules/postcss.config.mjs +7 -0
  5. package/dev-tools/starter-kit/webpack-modules/purgecss-setup.mjs +95 -0
  6. package/dev-tools/starter-kit/webpack.config.mjs +102 -74
  7. package/index.js +1 -2
  8. package/package.json +9 -1
  9. package/snippets/error-pages/bundles/TwigBundle/Exception/error.html.twig +6 -6
  10. package/snippets/error-pages/error-pages.js +2 -2
  11. package/src/components/dismiss-alerts.js +1 -0
  12. package/src/components/form-reset-submit.js +1 -0
  13. package/src/components/inner-nav/inner-nav.css +2 -0
  14. package/src/components/inner-nav/inner-nav.js +1 -0
  15. package/src/components/modal-alert/modal-alert.js +12 -7
  16. package/src/components/modal-alert/modal-alert.module.css +11 -8
  17. package/src/components/modal-popup/modal-popup.js +1 -0
  18. package/src/components/modal-popup/modal-popup.module.css +1 -0
  19. package/src/components/overlay/overlay.css +2 -0
  20. package/src/components/overlay/overlay.js +1 -0
  21. package/src/components/sf-macro/sf-macro.js +1 -0
  22. package/src/components/slide-up-down-toggle/slide-up-down-toggle.js +1 -0
  23. package/src/components/slide-up-down-toggle/slide-up-down-toggle.module.css +1 -0
  24. package/src/components/snackbar/snackbar.js +1 -0
  25. package/src/components/snackbar/snackbar.module.css +2 -0
  26. package/src/components/unsplash-page/README.md +23 -0
  27. package/src/components/unsplash-page/unsplash-page.js +249 -119
  28. package/src/components/unsplash-page/unsplash-page.minimo.tokens.mjs +3 -3
  29. package/src/components/unsplash-page/unsplash-page.module.css +79 -77
  30. package/src/custom-properties.css +23 -23
  31. package/src/utilities/better-text.js +1 -0
  32. package/src/utilities/build-picture-tag.js +1 -0
  33. package/src/utilities/classnames.js +1 -0
  34. package/src/utilities/cookies.js +1 -0
  35. package/src/utilities/create-id.js +1 -0
  36. package/src/utilities/disable-btns-on-submit.js +1 -0
  37. package/src/utilities/dom-builder/dom-builder.js +2 -1
  38. package/src/utilities/enable-submit-btns.js +1 -0
  39. package/src/utilities/escape-html.js +1 -0
  40. package/src/utilities/generate-pwd.js +1 -0
  41. package/src/utilities/linked-dates.js +1 -0
  42. package/src/utilities/parse-file-size.js +1 -0
  43. package/src/utilities/random-id.js +1 -0
  44. package/src/utilities/relative-date.js +1 -0
  45. package/src/utilities/sentence-case.js +1 -0
  46. package/src/utilities/strip-tags.js +1 -0
  47. package/src/utilities/title-case.js +1 -0
  48. package/src/utilities/truncate-string.js +1 -0
  49. package/src/utilities/validation-error-class.js +1 -0
  50. package/src/components/unsplash-page/TODO unsplash-page-demo/README.md +0 -194
  51. package/src/components/unsplash-page/TODO unsplash-page-demo/changelog.md +0 -5
  52. package/src/components/unsplash-page/TODO unsplash-page-demo/unsplash-page/demo.js +0 -15
  53. package/src/components/unsplash-page/TODO unsplash-page-demo/unsplash-page/rollup.config.mjs +0 -26
  54. package/src/components/unsplash-page/TODO unsplash-page-demo/unsplash-page/unsplash-page-demo.min.js +0 -3
  55. package/src/components/unsplash-page/TODO.md +0 -3
  56. package/src/components/unsplash-page/img-breakpoints.js +0 -66
  57. package/src/components/unsplash-page/unsplash-page-body-reset.css +0 -14
@@ -1,47 +1,49 @@
1
+ /*! minimo - Unsplash Page */
1
2
  /*
2
- PERSONALIZZAZIONE
3
- custom properties (valori di default, vedi /design-tokens/_src/components/unsplash-page.minimo.tokens.mjs):
4
-
5
- Basic props:
6
- --up-bg-color: hsl(0deg 0% 0% / .7);
7
- --up-text-color: #fff;
8
- --up-line-height: 1.4;
9
- --up-font-family: sans-serif;
10
- --up-font-size: 1rem;
11
- --up-font-variation-settings: unset;
12
- --up-font-weight: 400;
13
-
14
- Credits box
15
- --up-credits-font-size: .8em;
16
- --up-credits-font-weight: 400;
17
- --up-credits-line-height: 1.3;
18
-
19
- H1
20
- --up-h1-color: var(--up-text-color);
21
- --up-h1-font-size: 2rem;
22
- --up-h1-font-variation-settings: unset;
23
- --up-h1-font-weight: 700;
24
- --up-h1-line-height: 1.25;
25
-
26
- icons:
27
- --up-icon-box-bg: var(--up-link-color);
28
- --up-icon-fill-color: #333;
29
- --up-icon-hover-box-bg: #fff;
30
-
31
- links:
32
- --up-link-color: #fc0;
33
- --up-link-decoration: none;
34
- --up-link-hover-color: #fc0;
35
- --up-link-hover-decoration: underline;
36
-
37
- loader:
38
- --up-loader-color: hsl(0deg 0% 100% / .6);
3
+
4
+ custom propeties:
5
+
6
+ --uspg-bg-color: hsl(0deg 0% 0% / .7);
7
+ --uspg-credits-font-size: var(--font-size-xs);
8
+ --uspg-credits-font-weight: var(--font-weight-regular);
9
+ --uspg-credits-line-height: var(--line-height-xs);
10
+ --uspg-font-family: var(--font-family);
11
+ --uspg-font-size: var(--font-size-base);
12
+ --uspg-font-variation-settings: unset;
13
+ --uspg-font-weight: var(--font-weight-regular);
14
+ --uspg-h1-color: var(--uspg-text-color);
15
+ --uspg-h1-font-size: var(--font-size-xl);
16
+ --uspg-h1-font-variation-settings: unset;
17
+ --uspg-h1-font-weight: var(--font-weight-bold);
18
+ --uspg-h1-line-height: var(--line-height-xs);
19
+ --uspg-icon-box-bg: var(--uspg-link-color);
20
+ --uspg-icon-fill-color: #333;
21
+ --uspg-icon-hover-box-bg: #fff;
22
+ --uspg-line-height: var(--line-height-sm);
23
+ --uspg-link-color: #fc0;
24
+ --uspg-link-decoration: none;
25
+ --uspg-link-hover-color: #fc0;
26
+ --uspg-link-hover-decoration: underline;
27
+ --uspg-loader-color: hsl(0deg 0% 100% / .6);
28
+ --uspg-text-color: #fff;
39
29
 
40
30
  */
41
31
 
42
32
 
43
33
  /* stylelint-disable declaration-no-important */
44
34
 
35
+ html, body {
36
+ height: 100%;
37
+ padding: 0;
38
+ margin: 0;
39
+
40
+ }
41
+
42
+ *, *::before, *::after {
43
+ box-sizing: border-box !important;
44
+ }
45
+
46
+
45
47
  .bodyNoScroll {
46
48
  padding: 0 !important;
47
49
  margin: 0 !important;
@@ -51,35 +53,35 @@
51
53
  }
52
54
  /* stylelint-enable declaration-no-important */
53
55
 
54
- .upContainer {
56
+ .container {
55
57
 
56
58
  position: relative;
57
59
  width: 100dvw;
58
60
  height: 100dvh;
59
61
 
60
62
 
61
- font-family: var(--up-font-family, sans-serif);
62
- font-size: var(--up-font-size, 1rem);
63
- font-variation-settings: var(--up-font-variation-settings, unset);
64
- font-weight: var(--up-font-weight, 400);
65
- line-height: var(--up-line-height, 1.4);
63
+ font-family: var(--uspg-font-family, sans-serif);
64
+ font-size: var(--uspg-font-size, 1rem);
65
+ font-variation-settings: var(--uspg-font-variation-settings, unset);
66
+ font-weight: var(--uspg-font-weight, 400);
67
+ line-height: var(--uspg-line-height, 1.4);
66
68
 
67
69
  background-color: #333;
68
70
 
69
71
  a:is(:link, :visited) {
70
- color: var(--up-link-color, #fc0);
71
- text-decoration: var(--up-link-decoration, none);
72
+ color: var(--uspg-link-color, #fc0);
73
+ text-decoration: var(--uspg-link-decoration, none);
72
74
 
73
75
  @media (hover: hover) {
74
76
  &:hover {
75
- color: var(--up-link-hover-color, #fc0);
76
- text-decoration: var(--up-link-hover-decoration, underline);
77
+ color: var(--uspg-link-hover-color, #fc0);
78
+ text-decoration: var(--uspg-link-hover-decoration, underline);
77
79
  }
78
80
  }
79
81
  }
80
82
  }
81
83
 
82
- .upCanvas {
84
+ .canvas {
83
85
  position: absolute;
84
86
  /* z-index: -1; */
85
87
  width: 100%;
@@ -101,7 +103,7 @@
101
103
 
102
104
  }
103
105
 
104
- .unsplashPhoto, .upCredits {
106
+ .unsplashPhoto, .credits {
105
107
  opacity: 0;
106
108
  transition: opacity .3s linear;
107
109
 
@@ -110,7 +112,7 @@
110
112
  }
111
113
  }
112
114
 
113
- .upMessageBox {
115
+ .messageBox {
114
116
  position: absolute;
115
117
  bottom: 0;
116
118
  display: flex;
@@ -122,12 +124,12 @@
122
124
  overflow: hidden;
123
125
  }
124
126
 
125
- .upMessage, .upCredits {
126
- color: var(--up-text-color, #fff);
127
- background-color: var(--up-bg-color, hsl(0deg 0% 0% / .7));
127
+ .message, .credits {
128
+ color: var(--uspg-text-color, #fff);
129
+ background-color: var(--uspg-bg-color, hsl(0deg 0% 0% / .7));
128
130
  }
129
131
 
130
- .upMessage {
132
+ .message {
131
133
  position: relative;
132
134
  width: max-content;
133
135
  max-width: 90dvw;
@@ -137,11 +139,11 @@
137
139
 
138
140
  h1 {
139
141
  margin: 0;
140
- font-size: var(--up-h1-font-size, 2rem);
141
- font-variation-settings: var(--up-h1-font-variation-settings, unset);
142
- font-weight: var(--up-h1-font-weight, 700);
143
- line-height: var(--up-h1-line-height, 1.25);
144
- color: var(--up-h1-color, var(--up-text-color, #fff));
142
+ font-size: var(--uspg-h1-font-size, 2rem);
143
+ font-variation-settings: var(--uspg-h1-font-variation-settings, unset);
144
+ font-weight: var(--uspg-h1-font-weight, 700);
145
+ line-height: var(--uspg-h1-line-height, 1.25);
146
+ color: var(--uspg-h1-color, var(--uspg-text-color, #fff));
145
147
  }
146
148
 
147
149
  p {
@@ -152,11 +154,11 @@
152
154
  max-width: 60dvw;
153
155
  }
154
156
 
155
- .upBackLink {
157
+ .backLink {
156
158
  margin-top: 1rem;
157
159
  }
158
160
 
159
- .upArrowWrapper {
161
+ .arrowWrapper {
160
162
  --_arrow-size: 2rem;
161
163
  --_arrow-position: calc(var(--_arrow-size) * .25 * -1);
162
164
 
@@ -165,9 +167,9 @@
165
167
  left: var(--_arrow-position);
166
168
  width: var(--_arrow-size);
167
169
  height: var(--_arrow-size);
168
- color: var(--up-icon-fill-color, #333);
170
+ color: var(--uspg-icon-fill-color, #333);
169
171
  cursor: w-resize;
170
- background-color: var(--up-icon-box-bg, var(--up-link-color, #fc0));
172
+ background-color: var(--uspg-icon-box-bg, var(--uspg-link-color, #fc0));
171
173
  border-radius: 50%;
172
174
  /* transition: all .2s ease-in-out; */
173
175
  /* duration | easing-function | delay | iteration-count | direction | name */
@@ -175,7 +177,7 @@
175
177
 
176
178
  @media (hover: hover) {
177
179
  &:hover {
178
- background-color: var(--up-icon-hover-box-bg, #fff);
180
+ background-color: var(--uspg-icon-hover-box-bg, #fff);
179
181
  }
180
182
  }
181
183
 
@@ -188,7 +190,7 @@
188
190
 
189
191
  &.hidden {
190
192
  translate: calc(-1 * (50dvw + 50% - 2rem));
191
- .upArrowWrapper {
193
+ .arrowWrapper {
192
194
  right: var(--_arrow-position);
193
195
  left: auto;
194
196
  cursor: e-resize;
@@ -205,7 +207,7 @@
205
207
  100% { transform: translateX(0); }
206
208
  }
207
209
 
208
- .upCredits {
210
+ .credits {
209
211
  display: flex;
210
212
  flex-flow: column wrap;
211
213
  gap: .5rem;
@@ -213,9 +215,9 @@
213
215
  justify-content: center;
214
216
  width: 100%;
215
217
  padding: .2rem 1rem;
216
- font-size: var(--up-credits-font-size, .8em);
217
- font-weight: var(--up-credits-font-weight, 400);
218
- line-height: var(--up-credits-line-height, 1.3);
218
+ font-size: var(--uspg-credits-font-size, .8em);
219
+ font-weight: var(--uspg-credits-font-weight, 400);
220
+ line-height: var(--uspg-credits-line-height, 1.3);
219
221
 
220
222
 
221
223
  @media screen and (min-width: 768px) {
@@ -243,19 +245,19 @@
243
245
  border-radius: 50%;
244
246
 
245
247
  &:active {
246
- color: var(--up-icon-fill-color, #333);
247
- background-color: var(--up-icon-box-bg, var(--up-link-color, #fc0));
248
+ color: var(--uspg-icon-fill-color, #333);
249
+ background-color: var(--uspg-icon-box-bg, var(--uspg-link-color, #fc0));
248
250
 
249
251
  img {
250
- filter: none;
251
252
  opacity: 1;
253
+ filter: none;
252
254
  }
253
255
  }
254
256
  }
255
257
  img {
256
258
  display: block;
257
- filter: brightness(0) invert(1);
258
259
  opacity: .6;
260
+ filter: brightness(0) invert(1);
259
261
  }
260
262
 
261
263
  @media (hover: hover) {
@@ -266,7 +268,7 @@
266
268
  }
267
269
  }
268
270
 
269
- &.upShowOnHover {
271
+ &.showOnHover {
270
272
  opacity: 0;
271
273
  .show &:hover {
272
274
  opacity: 1;
@@ -277,7 +279,7 @@
277
279
 
278
280
 
279
281
  /* https://wweb.dev/resources/loader-generator/ */
280
- .upLoaderWrapper {
282
+ .loaderWrapper {
281
283
 
282
284
  position: absolute;
283
285
  top: 40%;
@@ -285,10 +287,10 @@
285
287
  /* z-index: -1; */
286
288
  transform: translate(-50%, -50%);
287
289
  }
288
- .upLoader {
290
+ .loader {
289
291
  width: 80px;
290
292
  aspect-ratio: 1;
291
- background: conic-gradient(#000, var(--up-loader-color, hsl(0deg 0% 100% / .6))) content-box;
293
+ background: conic-gradient(#000, var(--uspg-loader-color, hsl(0deg 0% 100% / .6))) content-box;
292
294
  border-radius: 50%;
293
295
  /* stylelint-disable-next-line property-no-vendor-prefix */
294
296
  -webkit-mask:
@@ -332,29 +332,29 @@
332
332
  --text-negative: #fff;
333
333
  --text-selected-background-color: #ddd;
334
334
  --text-selected-color: var(--body-text);
335
- --up-bg-color: hsl(0deg 0% 0% / .7);
336
- --up-credits-font-size: var(--font-size-xs);
337
- --up-credits-font-weight: var(--font-weight-regular);
338
- --up-credits-line-height: var(--line-height-xs);
339
- --up-font-family: var(--font-family);
340
- --up-font-size: var(--font-size-base);
341
- --up-font-variation-settings: unset;
342
- --up-font-weight: var(--font-weight-regular);
343
- --up-h1-color: var(--up-text-color);
344
- --up-h1-font-size: var(--font-size-xl);
345
- --up-h1-font-variation-settings: unset;
346
- --up-h1-font-weight: var(--font-weight-bold);
347
- --up-h1-line-height: var(--line-height-xs);
348
- --up-icon-box-bg: var(--up-link-color);
349
- --up-icon-fill-color: #333;
350
- --up-icon-hover-box-bg: #fff;
351
- --up-line-height: var(--line-height-sm);
352
- --up-link-color: #fc0;
353
- --up-link-decoration: none;
354
- --up-link-hover-color: #fc0;
355
- --up-link-hover-decoration: underline;
356
- --up-loader-color: hsl(0deg 0% 100% / .6);
357
- --up-text-color: #fff;
335
+ --uspg-bg-color: hsl(0deg 0% 0% / .7);
336
+ --uspg-credits-font-size: var(--font-size-xs);
337
+ --uspg-credits-font-weight: var(--font-weight-regular);
338
+ --uspg-credits-line-height: var(--line-height-xs);
339
+ --uspg-font-family: var(--font-family);
340
+ --uspg-font-size: var(--font-size-base);
341
+ --uspg-font-variation-settings: unset;
342
+ --uspg-font-weight: var(--font-weight-regular);
343
+ --uspg-h1-color: var(--uspg-text-color);
344
+ --uspg-h1-font-size: var(--font-size-xl);
345
+ --uspg-h1-font-variation-settings: unset;
346
+ --uspg-h1-font-weight: var(--font-weight-bold);
347
+ --uspg-h1-line-height: var(--line-height-xs);
348
+ --uspg-icon-box-bg: var(--uspg-link-color);
349
+ --uspg-icon-fill-color: #333;
350
+ --uspg-icon-hover-box-bg: #fff;
351
+ --uspg-line-height: var(--line-height-sm);
352
+ --uspg-link-color: #fc0;
353
+ --uspg-link-decoration: none;
354
+ --uspg-link-hover-color: #fc0;
355
+ --uspg-link-hover-decoration: underline;
356
+ --uspg-loader-color: hsl(0deg 0% 100% / .6);
357
+ --uspg-text-color: #fff;
358
358
  --z-index-overlay: 99;
359
359
  --z-index-snackbar: 100;
360
360
  }
@@ -1,4 +1,5 @@
1
1
  // @ts-check
2
+ /*! minimo - Better Text */
2
3
 
3
4
  // Italian particles/articles (plus a few English and topographic terms) whose casing is
4
5
  // enforced and after which spaces are turned into non-breaking spaces. Hoisted to module
@@ -1,3 +1,4 @@
1
+ /*! minimo - buildPictureTag */
1
2
  import { classnames } from './classnames.js';
2
3
 
3
4
  /** @typedef {import('./dom-builder/dom-builder.js').DomBuilderItem} DomBuilderItem */
@@ -1,3 +1,4 @@
1
+ /*! minimo - Classnames */
1
2
  /** @typedef {string | null | undefined | false | 0} ClassValue */
2
3
 
3
4
  /**
@@ -1,4 +1,5 @@
1
1
  // @ts-check
2
+ /*! minimo - Cookies */
2
3
 
3
4
  /**
4
5
  * Returns the value of a cookie by name.
@@ -1,3 +1,4 @@
1
+ /*! minimo - Create Id */
1
2
  import { stripTags } from './strip-tags.js';
2
3
 
3
4
  /**
@@ -1,3 +1,4 @@
1
+ /*! minimo - Disable Buttons On Submit */
1
2
  /**
2
3
  * Disables all `[type=submit]` and `[type=button]` buttons on form submit.
3
4
  *
@@ -1,3 +1,4 @@
1
+ /*! minimo - DOM Builder */
1
2
  import { domBuilderBasicSetup } from './domBuilderBasicSetup.js';
2
3
  import { parseDomString } from './parseDomString.js';
3
4
 
@@ -18,7 +19,7 @@ import { parseDomString } from './parseDomString.js';
18
19
  * supported, falling back to raw `innerHTML` on browsers without it.
19
20
  * @property {boolean} [condition=true] - When false, the element is skipped.
20
21
  * @property {function(HTMLElement): void} [callback] - Callback invoked after the element is created.
21
- * @property {DomBuilderItem[]} [children] - Configuration array for child elements.
22
+ * @property {Array<DomBuilderItem|string>} [children] - Configuration array for child elements. Accepts strings (shorthand per `parseDomString`) and/or configuration objects.
22
23
  */
23
24
 
24
25
  /**
@@ -1,3 +1,4 @@
1
+ /*! minimo - Enable Submit Buttons */
1
2
  /**
2
3
  * Re-enables all submit and non-disabled button elements within the given context.
3
4
  * @param {Document | Element} [context=document]
@@ -1,3 +1,4 @@
1
+ /*! minimo - Escape HTML */
1
2
  /** @type {Record<string, string>} */
2
3
  const ESCAPE_MAP = {
3
4
  '&' : '&amp;',
@@ -1,3 +1,4 @@
1
+ /*! minimo - Generate Password */
1
2
  /**
2
3
  * Generates a random password using uppercase letters and digits,
3
4
  * excluding visually ambiguous characters (O, I, 0).
@@ -1,4 +1,5 @@
1
1
  // @ts-check
2
+ /*! minimo - Linked Dates */
2
3
 
3
4
  /**
4
5
  * Links date/datetime-local input fields so that one field constrains
@@ -1,4 +1,5 @@
1
1
  // @ts-check
2
+ /*! minimo - Parse File Size */
2
3
 
3
4
  /**
4
5
  * Converts a file size in bytes to a human readable string,
@@ -1,4 +1,5 @@
1
1
  // @ts-check
2
+ /*! minimo - Random Id */
2
3
 
3
4
  /**
4
5
  * Generates a random ID string.
@@ -1,4 +1,5 @@
1
1
  // @ts-check
2
+ /*! minimo - Relative Date */
2
3
 
3
4
  // Displays a date in relative form to the current date if within the set limits.
4
5
  // Relative dates are automatically updated every minute.
@@ -1,3 +1,4 @@
1
+ /*! minimo - Sentence Case */
1
2
  /**
2
3
  * Converts a string to sentence case (first letter uppercase, rest lowercase).
3
4
  * @param {string | null | undefined} str
@@ -1,3 +1,4 @@
1
+ /*! minimo - Strip Tags */
1
2
  /**
2
3
  * Strips HTML tags from a string.
3
4
  * @param {string | null | undefined} str
@@ -1,3 +1,4 @@
1
+ /*! minimo - Title Case */
1
2
  /**
2
3
  * Converts a string to title case (first letter of each word uppercase, rest lowercase).
3
4
  * @param {string | null | undefined} str
@@ -1,5 +1,6 @@
1
1
 
2
2
  // @ts-check
3
+ /*! minimo - Truncate String */
3
4
 
4
5
  /**
5
6
  * Truncates a string to the desired length adding an option suffix
@@ -1,3 +1,4 @@
1
+ /*! minimo - Validation Error */
1
2
  // usage:
2
3
  // throw new ValidationError('Duplicate values found', errorFields);
3
4