@massimo-cassandro/minimo 1.18.1 → 1.18.3

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 (63) hide show
  1. package/README.md +2 -1
  2. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/index.js +92 -0
  3. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/hbars.js +356 -0
  4. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/pie.js +245 -0
  5. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/radial-bars.js +177 -0
  6. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/rating-display.js +835 -0
  7. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/costruzione-assi.js +212 -0
  8. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/costruzione-linee.js +101 -0
  9. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/defaults.js +185 -0
  10. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/display-current.js +27 -0
  11. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/grid-areas.js +129 -0
  12. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/parse-opts.js +64 -0
  13. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/paths-setup.js +73 -0
  14. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile.js +126 -0
  15. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/signal-bars.js +290 -0
  16. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/week-utils.js +122 -0
  17. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/hbars-test.js +52 -0
  18. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/mcn-test.js +74 -0
  19. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/pie-test.js +16 -0
  20. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/radial-bars-test.js +48 -0
  21. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/settimanale-mensile-dati-settimanale.js +426 -0
  22. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/settimanale-mensile-test.js +260 -0
  23. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/signal-bars-test.js +64 -0
  24. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/node-test.mjs +86 -0
  25. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/hBars-node-test.mjs +40 -0
  26. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/lines-node-test.mjs +73 -0
  27. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/mcn-node-test.mjs +64 -0
  28. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/pie-node-test.mjs +12 -0
  29. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/radialsBar-node-test.mjs +44 -0
  30. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/settimanale-mensile-node-test.mjs +258 -0
  31. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/signalBars-node-test.mjs +36 -0
  32. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/test-readme.md +24 -0
  33. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/textToPath-test.mjs +14 -0
  34. package/charts/TODO charts/???/InfoBox.js +456 -0
  35. package/charts/TODO charts/???/README-upg OLD/342/206/222NEW.md" +53 -0
  36. package/charts/TODO charts/???/README.md +1 -0
  37. package/charts/TODO charts/???/TODO.md +39 -0
  38. package/charts/TODO charts/???/base-cfg.js +66 -0
  39. package/charts/TODO charts/???/rating-displayOLD.js +837 -0
  40. package/charts/TODO charts/docs/TODO.md +1 -0
  41. package/charts/TODO charts/docs/costruzione display rating.md +145 -0
  42. package/charts/TODO charts/test/node-test.mjs +92 -0
  43. package/charts/TODO charts/test/test-readme.md +23 -0
  44. package/charts/TODO charts/test/test-src/rating-display-extra-test.js +132 -0
  45. package/charts/TODO charts/test/test-src/rating-display-test.js +155 -0
  46. package/charts/TODO charts/test/textToPath-test.mjs +14 -0
  47. package/charts/TODO.md +1 -1
  48. package/design-tokens/tokens/{design-tokens/_src → src/components/modal-popup}/modal-popup.minimo.tokens.jsonc +48 -2
  49. package/design-tokens/utilities/build-tokens-src/config.mjs +5 -2
  50. package/design-tokens/utilities/build-tokens-src/formats/penpot.mjs +1 -1
  51. package/design-tokens/utilities/build-tokens-src/platforms.mjs +4 -1
  52. package/design-tokens/utilities/build-tokens.mjs +5 -3
  53. package/design-tokens/utilities/check-unresolved-custom-props.mjs +5 -2
  54. package/dev-tools/starter-kit/webpack.config.mjs +6 -6
  55. package/package.json +17 -10
  56. package/snippets/flash-messages.html.twig +34 -0
  57. package/src/components/modal-alert/modal-alert.js +3 -1
  58. package/src/components/modal-popup/modal-popup.js +68 -4
  59. package/{design-tokens/_src → src/components/modal-popup}/modal-popup.minimo.tokens.mjs +51 -2
  60. package/src/components/modal-popup/modal-popup.module.css +24 -32
  61. package/src/components/unsplash-page/unsplash-page.js +3 -6
  62. package/src/components/unsplash-page/unsplash-page.module.css +11 -6
  63. package/src/custom-properties.css +21 -12
@@ -6,6 +6,8 @@
6
6
 
7
7
  import { buildPenpotFiles } from './formats/penpot.mjs';
8
8
 
9
+ /** @typedef {import('style-dictionary/types').PlatformConfig} PlatformConfig */
10
+
9
11
  // Transforms applied to the CSS platform
10
12
  const CSS_TRANSFORMS = [
11
13
  'attribute/cti',
@@ -40,7 +42,7 @@ const PENPOT_TRANSFORMS = [
40
42
  * Collected from sd.allTokens after SD initialisation.
41
43
  * Ignored when penpotDestFile is set.
42
44
  * @param {'keep'|'calc'|'resolve'} opts.penpotExpressions How to handle math expressions in dimension tokens.
43
- * @returns {object} platforms object ready for Style Dictionary config
45
+ * @returns {Record<string, PlatformConfig>} platforms object ready for Style Dictionary config
44
46
  */
45
47
  export const buildPlatforms = ({
46
48
  buildPath,
@@ -51,6 +53,7 @@ export const buildPlatforms = ({
51
53
  penpotExpressions = 'keep',
52
54
  concreteFilePaths = [],
53
55
  }) => {
56
+ /** @type {Record<string, PlatformConfig>} */
54
57
  const platforms = {
55
58
  css: {
56
59
  buildPath: buildPath + '/',
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ /// <reference types="node" />
2
3
  /* eslint-disable no-console */
3
4
 
4
5
  // build-tokens.mjs
@@ -15,9 +16,9 @@
15
16
  import StyleDictionary from 'style-dictionary';
16
17
  import * as path from 'node:path';
17
18
  import { styleText } from 'node:util';
18
- import { homedir } from 'os';
19
+ import { homedir } from 'node:os';
19
20
  import stylelint from 'stylelint';
20
- import { pathToFileURL } from 'url';
21
+ import { pathToFileURL } from 'node:url';
21
22
 
22
23
  // ── 1. Configuration (args + resolved paths) ────────────────────────────────
23
24
  import {
@@ -88,7 +89,7 @@ const sd = new StyleDictionary({
88
89
  await sd.buildAllPlatforms();
89
90
 
90
91
  // ── 9. CSS lint ───────────────────────────────────────────────────────────────
91
- const stylelintConfig = await import(pathToFileURL(stylelintConfigPath)).then(m => m.default);
92
+ const stylelintConfig = await import(pathToFileURL(stylelintConfigPath).href).then(m => m.default);
92
93
 
93
94
 
94
95
  await stylelint.lint({
@@ -98,6 +99,7 @@ await stylelint.lint({
98
99
  });
99
100
 
100
101
  // ── 10. Log ────────────────────────────────────────────────────────────────────
102
+ /** @param {string} p */
101
103
  const short = (p) => p.replace(homedir(), '~');
102
104
 
103
105
  console.log(styleText(['yellow'], `[build-tokens] config file : ${short(configAbsPath)}`));
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ /// <reference types="node" />
2
3
 
3
4
  /* eslint-disable no-console */
4
5
 
@@ -13,7 +14,7 @@
13
14
 
14
15
  import * as path from 'node:path';
15
16
  import * as fs from 'node:fs';
16
- import { /* fileURLToPath, */pathToFileURL } from 'url';
17
+ import { /* fileURLToPath, */pathToFileURL } from 'node:url';
17
18
  // import { dirname } from 'path';
18
19
  import { glob } from 'node:fs/promises';
19
20
  import { styleText } from 'node:util';
@@ -52,6 +53,7 @@ async function run() {
52
53
  const checkdir = path.resolve(configDir, config.dir_to_check);
53
54
 
54
55
  // Patterns for custom properties to exclude from the unresolved check
56
+ /** @type {RegExp[]} */
55
57
  const exclude = config.exclude_pattern ?? [];
56
58
 
57
59
  // Collect all .css files in the scan directory, excluding the token file itself
@@ -88,6 +90,7 @@ async function run() {
88
90
  // 4. Scan files for unresolved var() references
89
91
  // ---------------------------------------------------------------------------
90
92
  const usageRegex = /var\(\s*(--[a-z0-9-]+)\s*(,.*?)?\)/g;
93
+ /** @type {{file: string, line: number, prop: string}[]} */
91
94
  const unresolved_props = [];
92
95
 
93
96
  files.forEach(file => {
@@ -137,7 +140,7 @@ async function run() {
137
140
  console.log(styleText(['green'], '**** DONE ****'));
138
141
 
139
142
  } catch (err) {
140
- console.log(styleText(['redBright'], err.stack));
143
+ console.log(styleText(['redBright'], err instanceof Error ? err.stack ?? err.message : String(err)));
141
144
  process.exit(1);
142
145
  }
143
146
  }
@@ -455,14 +455,14 @@ const config = {
455
455
  new webpack.BannerPlugin({
456
456
  banner: () => {
457
457
 
458
- const start_year = 2026,
459
- current_year = new Date().toLocaleString('en-UK', { year: 'numeric' }),
460
- year = [
458
+ const start_year = 2026
459
+ ,current_year = new Date().toLocaleString('en-UK', { year: 'numeric' })
460
+ ,year = [
461
461
  start_year,
462
462
  ...(current_year > start_year? [current_year] : [])
463
- ].join('-'),
464
-
465
- vers = packageJson.version.split('.').slice(0,-1).join('.');
463
+ ].join('-')
464
+ ,vers = packageJson.version.split('.').slice(0,-1).join('.')
465
+ ;
466
466
 
467
467
  return (
468
468
  '/*!\n' +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massimo-cassandro/minimo",
3
- "version": "1.18.1",
3
+ "version": "1.18.3",
4
4
  "description": "Light css framework & utilities",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -19,13 +19,13 @@
19
19
  "access": "public"
20
20
  },
21
21
  "bin": {
22
- "buildTokens": "./design-tokens/utilities/build-tokens.mjs",
23
- "checkUnresolvedProps": "./design-tokens/utilities/check-unresolved-custom-props.mjs",
24
- "update-version": "./dev-tools/update-version/index.mjs",
25
- "upd@m": "./dev-tools/upd@m/index.mjs",
26
- "svgIconsTools": "./dev-tools/svg-icons-tools/index.mjs",
27
- "create-favicons": "./dev-tools/create-favicons/index.mjs",
28
- "starter-kit": "./dev-tools/starter-kit/starter-install.sh"
22
+ "buildTokens": "design-tokens/utilities/build-tokens.mjs",
23
+ "checkUnresolvedProps": "design-tokens/utilities/check-unresolved-custom-props.mjs",
24
+ "update-version": "dev-tools/update-version/index.mjs",
25
+ "upd@m": "dev-tools/upd@m/index.mjs",
26
+ "svgIconsTools": "dev-tools/svg-icons-tools/index.mjs",
27
+ "create-favicons": "dev-tools/create-favicons/index.mjs",
28
+ "starter-kit": "dev-tools/starter-kit/starter-install.sh"
29
29
  },
30
30
  "repository": {
31
31
  "type": "git",
@@ -41,7 +41,8 @@
41
41
  "test": "node --test \"test/**/*.test.mjs\"",
42
42
  "test sideEffects tree-shaking": "node ./test/sideEffects-tree-shaking/run-test.mjs",
43
43
  "checkJS": "npx tsc --noEmit -p jsconfig.json",
44
- "checkJS ./src": "npx tsc --noEmit --allowJs --checkJs --target ES2023 --module ESNext --allowSyntheticDefaultImports --moduleResolution bundler declarations.d.ts src/**/*.js"
44
+ "checkJS ./src": "npx tsc --noEmit --allowJs --checkJs --target ES2023 --module ESNext --allowSyntheticDefaultImports --moduleResolution bundler declarations.d.ts src/**/*.js",
45
+ "check outdated": "echo '*** ROOT ***' && npm outdated --omit=peer && echo '*** DEMO ***' && npm --prefix ./demo outdated && echo '*** END ***'"
45
46
  },
46
47
  "license": "MIT",
47
48
  "author": "Massimo Cassandro",
@@ -80,6 +81,7 @@
80
81
  "devDependencies": {
81
82
  "@massimo-cassandro/eslint-config": "^3.0.11",
82
83
  "@massimo-cassandro/stylelint-config": "^2.3.11",
84
+ "@types/node": "^26.1.1",
83
85
  "jsdom": "^29.1.1",
84
86
  "style-dictionary": "^5.5.0"
85
87
  },
@@ -90,5 +92,10 @@
90
92
  "sharp": "^0.35.3",
91
93
  "sharp-ico": "^0.1.5",
92
94
  "svgo": "^4.0.2"
93
- }
95
+ },
96
+ "directories": {
97
+ "doc": "docs",
98
+ "test": "test"
99
+ },
100
+ "keywords": []
94
101
  }
@@ -0,0 +1,34 @@
1
+ {# TEST: #}
2
+
3
+ {# {%- for state in ['danger', 'success', 'warning', 'info'] -%}
4
+ <div class="bg-{{ state }}">
5
+ <div class="container">
6
+ <div class="alert alert-{{ state }}">
7
+ <button type="button" class="btn-close" data-dismiss="alert" aria-label="Chiudi"></button>
8
+ <h2>{{ state }}</h2>
9
+ <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Asperiores vitae in rerum consequatur iure atque dolores beatae doloremque, debitis dolore optio odit, tempore explicabo? Necessitatibus magnam magni repudiandae velit voluptates? Fuga ab vel delectus voluptatem sequi, consectetur amet, quos placeat cupiditate incidunt nobis in labore. Est, aspernatur? Quo, qui voluptatem!</p>
10
+ </div>
11
+ </div>
12
+ </div>
13
+ {%- endfor -%} #}
14
+
15
+
16
+ {#
17
+
18
+ message labels:
19
+ - success
20
+ - notice
21
+ - error
22
+ - warning
23
+
24
+ #}
25
+
26
+
27
+ {% for label, messages in app.flashes %}
28
+ {% for message in messages %}
29
+ <div class="alert alert-{{ label }}">
30
+ <button type="button" class="btn-close" data-dismiss="alert" aria-label="Chiudi"></button>
31
+ {{ message|raw }}
32
+ </div>
33
+ {% endfor %}
34
+ {% endfor %}
@@ -120,7 +120,9 @@ const defaults = {
120
120
  * @property {string} [cancelBtnText] - text for 'cancel' button
121
121
  * @property {string} [cancelBtnClass] - alternative class for 'cancel' button. It replaces the default one
122
122
  * @property {boolean} [cancelBtnFocus] - true if the cancel button should be focused when the dialog box opens. It has no effect if an extraBtn is set
123
- *
123
+ */
124
+
125
+ /**
124
126
  * Renders and opens a modal alert dialog.
125
127
  *
126
128
  * Backward compatibility: legacy snake_case parameter names (`extra_class`, `heading_class`,
@@ -43,6 +43,12 @@ function closeDialog(el) {
43
43
  * @param {string | null} [params.contentExtraClassName=null] - Extra class added to the content wrapper.
44
44
  * @param {string | null} [params.headerExtraClassName=null] - Extra class added to the header wrapper.
45
45
  * @param {string | null} [params.footerExtraClassName=null] - Extra class added to the footer wrapper.
46
+ * @param {string | number | null} [params.dialogWidth=null] - optional dialog width value - if set, overrides main css custom prop
47
+ * @param {string | number | null} [params.dialogMinWidth=null] - optional dialog min-width value - if set, overrides main css custom prop
48
+ * @param {string | number | null} [params.dialogMaxWidth=null] - optional dialog max-width value - if set, overrides main css custom prop
49
+ * @param {string | number | null} [params.dialogHeight=null] - optional dialog height value - if set, overrides main css custom prop
50
+ * @param {string | number | null} [params.dialogMinHeight=null] - optional dialog min-height value - if set, overrides main css custom prop
51
+ * @param {string | number | null} [params.dialogMaxHeight=null] - optional dialog max-height value - if set, overrides main css custom prop
46
52
  * @param {string | null} [params.iframeUrl=null] - URL to load in an iframe.
47
53
  * @param {string | any[] | null} [params.content=null] - Plain text, HTML, or a domBuilder array.
48
54
  * @param {string | null} [params.ajaxUrl=null] - URL for Ajax content loading.
@@ -51,11 +57,10 @@ function closeDialog(el) {
51
57
  * @param {boolean} [params.addScrollbarPadding=false] - Adds right padding to compensate for the scrollbar.
52
58
  * @param {string | any[] | null} [params.headerContent=null] - Header content: plain text, HTML, or a domBuilder array.
53
59
  * @param {string | any[] | null} [params.footerContent=null] - Footer content: plain text, HTML, or a domBuilder array.
60
+ * @param {HTMLElement | null} [params.triggerElement=null] - Optional element that triggered the popup; when set, `aria-haspopup`, `aria-controls` and `aria-expanded` are managed on it.
54
61
  * @returns {HTMLDialogElement} The dialog element.
55
62
  */
56
63
 
57
- // TODO attributi arua anche sul triggerm vedi ada-frontend/src/modal-dialog/modal-dialog.js
58
-
59
64
  export function modalPopup({
60
65
 
61
66
  /** dialog extra class */
@@ -64,6 +69,14 @@ export function modalPopup({
64
69
  /** extra classname added to dialogInner */
65
70
  contentExtraClassName = null,
66
71
 
72
+ /** optional values for maon custom props overriding */
73
+ dialogWidth = null,
74
+ dialogMinWidth = null,
75
+ dialogMaxWidth = null,
76
+ dialogHeight = null,
77
+ dialogMinHeight = null,
78
+ dialogMaxHeight = null,
79
+
67
80
  /** iframe url */
68
81
  iframeUrl = null,
69
82
 
@@ -96,8 +109,10 @@ export function modalPopup({
96
109
  /** extra classname added to footer */
97
110
  footerExtraClassName = null,
98
111
 
99
- }) {
112
+ /** element that triggered the popup: if set, `aria-haspopup`, `aria-controls` and `aria-expanded` are managed on it */
113
+ triggerElement = null,
100
114
 
115
+ }) {
101
116
 
102
117
 
103
118
  if(content == null && (ajaxUrl == null || ajaxCallback == null) && iframeUrl == null) {
@@ -118,15 +133,53 @@ export function modalPopup({
118
133
  mode = 'iframe';
119
134
  }
120
135
 
136
+
137
+
121
138
  // capture for use in the ajax callback closure (ajaxUrl is non-null when mode === 'ajax')
122
139
  const safeAjaxUrl = /** @type {string} */ (ajaxUrl);
123
140
 
141
+ // fine tuning custom props
142
+ /** @type {Record<string, string | number | null>} */
143
+ const cpropsValues = {
144
+ dialogWidth,
145
+ dialogMinWidth,
146
+ dialogMaxWidth,
147
+ dialogHeight,
148
+ dialogMinHeight,
149
+ dialogMaxHeight,
150
+ };
151
+ /** @type {Record<string, string>} */
152
+ const cpropsMap = {
153
+ dialogWidth : '--mpopup-width',
154
+ dialogMinWidth : '--mpopup-min-width',
155
+ dialogMaxWidth : '--mpopup-max-width',
156
+ dialogHeight : '--mpopup-height',
157
+ dialogMinHeight : '--mpopup-min-height',
158
+ dialogMaxHeight : '--mpopup-max-height'
159
+ };
160
+ /** @type {string[]} */
161
+ let dialogStyle = [];
162
+ Object.keys(cpropsMap).forEach(item => {
163
+ if(cpropsValues[item] != null) {
164
+ const value = typeof cpropsValues[item] === 'number' ? `${cpropsValues[item]}px` : cpropsValues[item];
165
+ dialogStyle.push(`${cpropsMap[item]}: ${value}`);
166
+ }
167
+ });
168
+
169
+ // ids for aria-controls (trigger → dialog) and aria-labelledby (dialog → header), generated only when needed
170
+ const dialogId = triggerElement != null ? `mpopup-${crypto.randomUUID()}` : null;
171
+ const headerId = headerContent != null ? `mpopup-header-${crypto.randomUUID()}` : null;
172
+
124
173
  domBuilder([
125
174
  {
126
175
  tag: 'dialog',
176
+ id: dialogId,
127
177
  className: classnames(styles.dialog, dialogExtraClassName, addScrollbarPadding && styles.scrollBarPadding),
128
178
  attrs: {
129
- 'closedby': 'any'
179
+ closedby: 'any',
180
+ 'aria-modal': 'true',
181
+ 'aria-labelledby': headerId,
182
+ style: dialogStyle.length? dialogStyle.join(';') : null
130
183
  },
131
184
  callback: el => { dialogEl = /** @type {HTMLDialogElement} */ (el); },
132
185
  children: [
@@ -142,6 +195,7 @@ export function modalPopup({
142
195
  className: styles.contentWrapper,
143
196
  children: [
144
197
  {
198
+ id: headerId,
145
199
  className: classnames(styles.header, headerExtraClassName),
146
200
  condition: headerContent != null,
147
201
  content: Array.isArray(headerContent) ? null : headerContent,
@@ -221,6 +275,10 @@ export function modalPopup({
221
275
 
222
276
  document.body.classList.remove('overflow-hidden');
223
277
 
278
+ if(triggerElement != null) {
279
+ triggerElement.setAttribute('aria-expanded', 'false');
280
+ }
281
+
224
282
  if(closeCallback) {
225
283
  closeCallback(thisDialog);
226
284
  }
@@ -229,6 +287,12 @@ export function modalPopup({
229
287
  }, false);
230
288
 
231
289
 
290
+ if(triggerElement != null) {
291
+ triggerElement.setAttribute('aria-haspopup', 'dialog');
292
+ triggerElement.setAttribute('aria-controls', /** @type {string} */ (dialogId));
293
+ triggerElement.setAttribute('aria-expanded', 'true');
294
+ }
295
+
232
296
  document.body.classList.add('overflow-hidden');
233
297
  thisDialog.showModal();
234
298
  thisDialog.focus();
@@ -1,5 +1,38 @@
1
1
  export default {
2
- 'modal-popup': {
2
+ 'mpopup': {
3
+
4
+ width: {
5
+ $type: 'dimension',
6
+ $value: 'max-content',
7
+ },
8
+ 'min-width': {
9
+ $type: 'dimension',
10
+ $value: '400px',
11
+ },
12
+ 'max-width': {
13
+ $type: 'dimension',
14
+ $value: '98dvw',
15
+ },
16
+ height: {
17
+ $type: 'dimension',
18
+ $value: 'max-content',
19
+ },
20
+ 'min-height': {
21
+ $type: 'dimension',
22
+ $value: '300px',
23
+ },
24
+ 'max-height': {
25
+ $type: 'dimension',
26
+ $value: '90dvh',
27
+ },
28
+
29
+ background: {
30
+ color: {
31
+ $type: 'color',
32
+ $value: '{body.background.color}',
33
+ }
34
+ },
35
+
3
36
  'drop-shadow': {
4
37
  $type: 'shadow',
5
38
  $value: [
@@ -8,7 +41,7 @@ export default {
8
41
  offsetY: '0',
9
42
  blur: '12px',
10
43
  spread: '2px',
11
- color: 'rgba(0 0 0 / .25)'
44
+ color: 'rgb(0 0 0 / .25)'
12
45
  }
13
46
  ]
14
47
  },
@@ -30,6 +63,22 @@ export default {
30
63
  }
31
64
 
32
65
  },
66
+ content: {
67
+ padding: {
68
+ $type: 'dimension',
69
+ $value: '{size.base} {size.sm} {size.sm}',
70
+ },
71
+ scrollbar: {
72
+ padding: {
73
+ i: {
74
+ end: {
75
+ $type: 'dimension',
76
+ $value: '{size.md}',
77
+ }
78
+ }
79
+ }
80
+ }
81
+ },
33
82
  header: {
34
83
  padding: {
35
84
  $type: 'dimension',
@@ -1,12 +1,4 @@
1
1
  /*! minimo - Modal Popup */
2
- /*
3
- NB:
4
- `--modal-popup-width` and `--modal-popup-height` are used with a fallback value,
5
- but can be set to the desired value on a case-by-case basis.
6
-
7
- Same for min/max-width and min/max-height
8
-
9
- */
10
2
 
11
3
  .dialog {
12
4
 
@@ -15,25 +7,25 @@ Same for min/max-width and min/max-height
15
7
  display: flex;
16
8
  flex-direction: column;
17
9
 
18
- width: var(--_modal-popup-width, max-content);
19
- min-width: var(--_modal-popup-min-width, 400px);
20
- max-width: var(--_modal-popup-max-width, 98dvw);
21
- height: var(--_modal-popup-height, max-content);
22
- min-height: var(--_modal-popup-min-height, 300px);
23
- max-height: var(--_modal-popup-max-height, 90dvh);
10
+ width: var(--mpopup-width);
11
+ min-width: var(--mpopup-min-width);
12
+ max-width: var(--mpopup-max-width);
13
+ height: var(--mpopup-height);
14
+ min-height: var(--mpopup-min-height);
15
+ max-height: var(--mpopup-max-height);
24
16
  padding: 0;
25
17
  margin: auto;
26
18
  overflow: visible;
27
- background-color: var(--body-background-color);
19
+ background-color: var(--mpopup-background-color);
28
20
  border: none;
29
- border-radius: var(--modal-popup-border-radius);
30
- box-shadow: var(--modal-popup-drop-shadow);
21
+ border-radius: var(--mpopup-border-radius);
22
+ box-shadow: var(--mpopup-drop-shadow);
31
23
  scale: 0;
32
24
  transition: scale .2s ease-out;
33
25
 
34
26
  &::backdrop {
35
27
  overscroll-behavior: contain;
36
- background-color: var(--modal-popup-backdrop-color);
28
+ background-color: var(--mpopup-backdrop-color);
37
29
  }
38
30
 
39
31
  &.on {
@@ -45,8 +37,8 @@ Same for min/max-width and min/max-height
45
37
  .closeButton {
46
38
 
47
39
  position: absolute;
48
- top: calc(-1 * var(--modal-popup-btn-close-size) / 3);
49
- right: calc(-1 * var(--modal-popup-btn-close-size) / 3);
40
+ top: calc(-1 * var(--mpopup-btn-close-size) / 3);
41
+ right: calc(-1 * var(--mpopup-btn-close-size) / 3);
50
42
  }
51
43
 
52
44
  .contentWrapper {
@@ -65,13 +57,13 @@ Same for min/max-width and min/max-height
65
57
  /* width: 100%;
66
58
  height: 100%; */
67
59
  min-height: 0;
68
- padding: var(--size-base) var(--size-sm) var(--size-sm);
60
+ padding: var(--mpopup-content-padding);
69
61
  overflow-x: hidden;
70
62
  overflow-y: auto;
71
63
  scrollbar-gutter: stable;
72
64
 
73
65
  .scrollBarPadding & {
74
- padding-inline-end: var(--size-md);
66
+ padding-inline-end: var(--mpopup-content-scrollbar-padding-i-end);
75
67
  }
76
68
 
77
69
  }
@@ -86,18 +78,18 @@ Same for min/max-width and min/max-height
86
78
  }
87
79
 
88
80
  .header {
89
- padding: var(--modal-popup-header-padding);
90
- font-size: var(--modal-popup-header-font-size);
91
- color: var(--modal-popup-header-color);
92
- background-color: var(--modal-popup-header-background-color);
93
- border-radius: var(--modal-popup-border-radius) var(--modal-popup-border-radius) 0 0;
81
+ padding: var(--mpopup-header-padding);
82
+ font-size: var(--mpopup-header-font-size);
83
+ color: var(--mpopup-header-color);
84
+ background-color: var(--mpopup-header-background-color);
85
+ border-radius: var(--mpopup-border-radius) var(--mpopup-border-radius) 0 0;
94
86
  }
95
87
  .footer {
96
- padding: var(--modal-popup-footer-padding);
97
- font-size: var(--modal-popup-footer-font-size);
98
- color: var(--modal-popup-footer-color);
99
- background-color: var(--modal-popup-footer-background-color);
100
- border-radius: 0 0 var(--modal-popup-border-radius) var(--modal-popup-border-radius);
88
+ padding: var(--mpopup-footer-padding);
89
+ font-size: var(--mpopup-footer-font-size);
90
+ color: var(--mpopup-footer-color);
91
+ background-color: var(--mpopup-footer-background-color);
92
+ border-radius: 0 0 var(--mpopup-border-radius) var(--mpopup-border-radius);
101
93
  }
102
94
 
103
95
  .header, .footer {
@@ -23,6 +23,7 @@ import * as styles from './unsplash-page.module.css';
23
23
  * @returns {Promise<void>}
24
24
  */
25
25
 
26
+ // TODO add icon file customization and more custom props for message box
26
27
 
27
28
  export async function unsplashPage(settings) {
28
29
 
@@ -235,9 +236,7 @@ export async function unsplashPage(settings) {
235
236
  {
236
237
  className: styles.arrowWrapper,
237
238
  attrs: { role: 'button' },
238
- children: [
239
- { tag: 'img', attrs: { src: arrowIcon, alt: 'Icona freccia' } }
240
- ],
239
+ content: arrowIcon,
241
240
  callback: arrowEl => {
242
241
  arrowEl.addEventListener('click', e => {
243
242
  const target = /** @type {HTMLElement} */ (e.target);
@@ -269,9 +268,7 @@ export async function unsplashPage(settings) {
269
268
  target: '_blank',
270
269
  rel: 'noopener noreferrer'
271
270
  },
272
- children: [
273
- { tag: 'img', attrs: { src: imageIcon, alt: 'Icona immagine' } }
274
- ]
271
+ content: imageIcon
275
272
  }
276
273
  ]
277
274
  }
@@ -181,10 +181,12 @@ html, body {
181
181
  }
182
182
  }
183
183
 
184
- img {
184
+ svg {
185
185
  display: block;
186
186
  width: 100%;
187
- height: 100%;
187
+ aspect-ratio: 1;
188
+ background-color: transparent;
189
+ fill: #000;
188
190
  }
189
191
  }
190
192
 
@@ -248,22 +250,25 @@ html, body {
248
250
  color: var(--uspg-icon-fill-color, #333);
249
251
  background-color: var(--uspg-icon-box-bg, var(--uspg-link-color, #fc0));
250
252
 
251
- img {
253
+ svg {
252
254
  opacity: 1;
253
255
  filter: none;
254
256
  }
255
257
  }
256
258
  }
257
- img {
259
+ svg {
258
260
  display: block;
261
+ width: 100%;
262
+ aspect-ratio: 1;
263
+ background-color: transparent;
259
264
  opacity: .6;
260
- filter: brightness(0) invert(1);
265
+ fill: #fff;
261
266
  }
262
267
 
263
268
  @media (hover: hover) {
264
269
 
265
270
  .show &:hover {
266
- img {
271
+ svg {
267
272
  opacity: 1;
268
273
  }
269
274
  }
@@ -215,18 +215,27 @@
215
215
  --malert-text-font-size: var(--font-size-base);
216
216
  --malert-warning-bg: var(--status-warning-background-color);
217
217
  --malert-warning-fg: var(--status-warning-fg);
218
- --modal-popup-backdrop-color: rgb(0 0 0 / .6);
219
- --modal-popup-border-radius: var(--size-base);
220
- --modal-popup-btn-close-size: 1.6rem;
221
- --modal-popup-drop-shadow: 0 0 .75rem .125rem rgb(0 0 0 / .25);
222
- --modal-popup-footer-background-color: #ddd;
223
- --modal-popup-footer-color: var(--text-color);
224
- --modal-popup-footer-font-size: var(--font-size-base);
225
- --modal-popup-footer-padding: var(--size-xs);
226
- --modal-popup-header-background-color: #ddd;
227
- --modal-popup-header-color: var(--text-color);
228
- --modal-popup-header-font-size: var(--font-size-xl);
229
- --modal-popup-header-padding: var(--size-xs);
218
+ --mpopup-backdrop-color: rgb(0 0 0 / .6);
219
+ --mpopup-background-color: var(--body-background-color);
220
+ --mpopup-border-radius: var(--size-base);
221
+ --mpopup-btn-close-size: 1.6rem;
222
+ --mpopup-content-padding: var(--size-base) var(--size-sm) var(--size-sm);
223
+ --mpopup-content-scrollbar-padding-i-end: var(--size-md);
224
+ --mpopup-drop-shadow: 0 0 .75rem .125rem rgb(0 0 0 / .25);
225
+ --mpopup-footer-background-color: #ddd;
226
+ --mpopup-footer-color: var(--text-color);
227
+ --mpopup-footer-font-size: var(--font-size-base);
228
+ --mpopup-footer-padding: var(--size-xs);
229
+ --mpopup-header-background-color: #ddd;
230
+ --mpopup-header-color: var(--text-color);
231
+ --mpopup-header-font-size: var(--font-size-xl);
232
+ --mpopup-header-padding: var(--size-xs);
233
+ --mpopup-height: max-content;
234
+ --mpopup-max-height: 5.625rem;
235
+ --mpopup-max-width: 6.125rem;
236
+ --mpopup-min-height: 18.75rem;
237
+ --mpopup-min-width: 25rem;
238
+ --mpopup-width: max-content;
230
239
  --neutral-100: #666;
231
240
  --neutral-100-fg: #fff;
232
241
  --overlay-color: rgb(0 0 0 / .6);