@massimo-cassandro/minimo 1.18.4 → 1.19.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 (171) hide show
  1. package/README.md +5 -1
  2. package/design-tokens/{utilities/readme.md → README.md} +26 -16
  3. package/design-tokens/tokens/src/components/unsplash-page/unsplash-page.minimo.tokens.jsonc +69 -31
  4. package/design-tokens/{utilities/tokens-config-sample.mjs → tokens-config-sample.mjs} +18 -10
  5. package/design-tokens/utilities/build-tokens-src/config.mjs +5 -0
  6. package/design-tokens/utilities/build-tokens-src/formats/css.mjs +18 -2
  7. package/design-tokens/utilities/build-tokens-src/merge-css.mjs +60 -0
  8. package/design-tokens/utilities/build-tokens.mjs +12 -0
  9. package/dev-tools/README.md +8 -0
  10. package/dev-tools/starter-kit/starter-install.sh +46 -26
  11. package/package.json +6 -2
  12. package/snippets/error-pages/error-pages.js +3 -2
  13. package/src/components/unsplash-page/unsplash-page.minimo.tokens.mjs +78 -39
  14. package/src/components/unsplash-page/unsplash-page.module.css +25 -6
  15. package/src/custom-properties.css +8 -1
  16. package/src/minimo.css +1 -1
  17. package/src/web-components/s-datatable-component/s-datatable-component.js +4 -1
  18. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/index.js +0 -92
  19. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/hbars.js +0 -356
  20. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/pie.js +0 -245
  21. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/radial-bars.js +0 -177
  22. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/rating-display.js +0 -835
  23. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/costruzione-assi.js +0 -212
  24. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/costruzione-linee.js +0 -101
  25. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/defaults.js +0 -185
  26. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/display-current.js +0 -27
  27. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/grid-areas.js +0 -129
  28. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/parse-opts.js +0 -64
  29. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/paths-setup.js +0 -73
  30. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile.js +0 -126
  31. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/signal-bars.js +0 -290
  32. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/week-utils.js +0 -122
  33. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/hbars-test.js +0 -52
  34. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/mcn-test.js +0 -74
  35. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/pie-test.js +0 -16
  36. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/radial-bars-test.js +0 -48
  37. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/settimanale-mensile-dati-settimanale.js +0 -426
  38. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/settimanale-mensile-test.js +0 -260
  39. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/signal-bars-test.js +0 -64
  40. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/node-test.mjs +0 -86
  41. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/hBars-node-test.mjs +0 -40
  42. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/lines-node-test.mjs +0 -73
  43. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/mcn-node-test.mjs +0 -64
  44. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/pie-node-test.mjs +0 -12
  45. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/radialsBar-node-test.mjs +0 -44
  46. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/settimanale-mensile-node-test.mjs +0 -258
  47. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/signalBars-node-test.mjs +0 -36
  48. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/test-readme.md +0 -24
  49. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/textToPath-test.mjs +0 -14
  50. package/charts/TODO charts/???/InfoBox.js +0 -456
  51. package/charts/TODO charts/???/README-upg OLD/342/206/222NEW.md" +0 -53
  52. package/charts/TODO charts/???/README.md +0 -1
  53. package/charts/TODO charts/???/TODO.md +0 -39
  54. package/charts/TODO charts/???/base-cfg.js +0 -66
  55. package/charts/TODO charts/???/rating-displayOLD.js +0 -837
  56. package/charts/TODO charts/docs/TODO.md +0 -1
  57. package/charts/TODO charts/docs/costruzione display rating.md +0 -145
  58. package/charts/TODO charts/test/node-test.mjs +0 -92
  59. package/charts/TODO charts/test/test-readme.md +0 -23
  60. package/charts/TODO charts/test/test-src/rating-display-extra-test.js +0 -132
  61. package/charts/TODO charts/test/test-src/rating-display-test.js +0 -155
  62. package/charts/TODO charts/test/textToPath-test.mjs +0 -14
  63. package/charts/TODO.md +0 -7
  64. package/charts/src/node-helpers/TODO.md +0 -2
  65. package/dev-tools/starter-kit/TODO.md +0 -135
  66. package/src/components/TODO form-multiselect/form-multiselect.css +0 -40
  67. package/src/components/TODO form-multiselect/form-multiselect.js +0 -83
  68. package/src/components/TODO vanilla-cookie-consent/cookie-consent.css +0 -20
  69. package/src/components/TODO vanilla-cookie-consent/cookie-consent.js +0 -76
  70. package/src/components/TODO vanilla-cookie-consent/render-cookie-list.js +0 -32
  71. package/src/components/TODO vanilla-cookie-consent/src/cookie-list.js +0 -85
  72. package/src/components/TODO vanilla-cookie-consent/src/it-translation.js +0 -38
  73. package/src/components/TODO vanilla-cookie-consent/src/run-analytics.js +0 -54
  74. package/src/components/TODO vanilla-cookie-consent/src/run-recaptcha.js +0 -71
  75. package/src/components/autocomplete/TODO.md +0 -4
  76. package/src/web-components/TODO json-table/README.md +0 -67
  77. package/src/web-components/TODO json-table/TODO.md +0 -12
  78. package/src/web-components/TODO json-table/_work/OLD/docs/custom-props-list.md +0 -69
  79. package/src/web-components/TODO json-table/_work/OLD/script/create-css-custom-props-doc.mjs +0 -113
  80. package/src/web-components/TODO json-table/_work/OLD/script/src/custom-props-end.md +0 -4
  81. package/src/web-components/TODO json-table/_work/OLD/script/src/custom-props-start.md +0 -30
  82. package/src/web-components/TODO json-table/_work/OLD/src/css/icons.module.css +0 -22
  83. package/src/web-components/TODO json-table/_work/OLD/src/css/info.module.css +0 -42
  84. package/src/web-components/TODO json-table/_work/OLD/src/css/main-wrapper.module.css +0 -4
  85. package/src/web-components/TODO json-table/_work/OLD/src/css/table.module.css +0 -154
  86. package/src/web-components/TODO json-table/_work/OLD/src/css/utility.module.css +0 -9
  87. package/src/web-components/TODO json-table/_work/OLD/src/icons/false.svg +0 -1
  88. package/src/web-components/TODO json-table/_work/OLD/src/icons/search-arrows.svg +0 -1
  89. package/src/web-components/TODO json-table/_work/OLD/src/icons/true.svg +0 -1
  90. package/src/web-components/TODO json-table/_work/OLD/src/index.js +0 -56
  91. package/src/web-components/TODO json-table/_work/OLD/src/js/default-columns-data-types.js +0 -172
  92. package/src/web-components/TODO json-table/_work/OLD/src/js/defaults.js +0 -156
  93. package/src/web-components/TODO json-table/_work/OLD/src/js/info-section.js +0 -31
  94. package/src/web-components/TODO json-table/_work/OLD/src/js/listeners.js +0 -17
  95. package/src/web-components/TODO json-table/_work/OLD/src/js/main-builder.js +0 -26
  96. package/src/web-components/TODO json-table/_work/OLD/src/js/parse-params.js +0 -121
  97. package/src/web-components/TODO json-table/_work/OLD/src/js/set-column-classname.js +0 -22
  98. package/src/web-components/TODO json-table/_work/OLD/src/js/table-builder.js +0 -64
  99. package/src/web-components/TODO json-table/_work/OLD/src/js/table-foot.js +0 -8
  100. package/src/web-components/TODO json-table/_work/OLD/src/js/table-head.js +0 -47
  101. package/src/web-components/TODO json-table/_work/OLD/src/js/table-row.js +0 -83
  102. package/src/web-components/TODO json-table/_work/OLD/src/js/utilities.js +0 -5
  103. package/src/web-components/TODO json-table/_work/__json-table-react/index.js +0 -4
  104. package/src/web-components/TODO json-table/_work/__json-table-react/src/build-page-array.js +0 -73
  105. package/src/web-components/TODO json-table/_work/__json-table-react/src/columns-data-types.js +0 -73
  106. package/src/web-components/TODO json-table/_work/__json-table-react/src/defaults.js +0 -50
  107. package/src/web-components/TODO json-table/_work/__json-table-react/src/download-excel.js +0 -156
  108. package/src/web-components/TODO json-table/_work/__json-table-react/src/set-className.js +0 -19
  109. package/src/web-components/TODO json-table/_work/__json-table-react/src/set-download-filename.js +0 -17
  110. package/src/web-components/TODO json-table/_work/__json-table-react/src/table-to-csv.js +0 -48
  111. package/src/web-components/TODO json-table/_work/archived/table-to-csv.js +0 -48
  112. package/src/web-components/TODO json-table/_work/arrow.svg +0 -3
  113. package/src/web-components/TODO json-table/_work/da decidere/get-cell-data.js +0 -18
  114. package/src/web-components/TODO json-table/_work/download-button.js +0 -29
  115. package/src/web-components/TODO json-table/_work/download-excel.js +0 -155
  116. package/src/web-components/TODO json-table/_work/pagination-array-builder.js +0 -73
  117. package/src/web-components/TODO json-table/_work/pagination.js +0 -37
  118. package/src/web-components/TODO json-table/_work/set-download-filename.js +0 -19
  119. package/src/web-components/TODO json-table/_work/table-info.js +0 -24
  120. package/src/web-components/TODO json-table/demo/README.md +0 -66
  121. package/src/web-components/TODO json-table/demo/assets/link-simple.svg +0 -1
  122. package/src/web-components/TODO json-table/demo/demo-data/json-static-table-demo-data.js +0 -512
  123. package/src/web-components/TODO json-table/demo/demo.css +0 -32
  124. package/src/web-components/TODO json-table/demo/demo.js +0 -24
  125. package/src/web-components/TODO json-table/demo/js/demo-ajax-table.js +0 -165
  126. package/src/web-components/TODO json-table/demo/js/demo-static-table.js +0 -180
  127. package/src/web-components/TODO json-table/demo/webpack-modules/css-rules.mjs +0 -122
  128. package/src/web-components/TODO json-table/demo/webpack-modules/get-jsConfig-aliases.mjs +0 -33
  129. package/src/web-components/TODO json-table/demo/webpack-modules/svg-rules.mjs +0 -108
  130. package/src/web-components/TODO json-table/demo/webpack-modules/svgo.config.mjs +0 -26
  131. package/src/web-components/TODO json-table/demo/webpack.config.mjs +0 -333
  132. package/src/web-components/TODO json-table/docs/custom-props-list.md +0 -74
  133. package/src/web-components/TODO json-table/docs-builder/create-css-custom-props-doc.mjs +0 -157
  134. package/src/web-components/TODO json-table/docs-builder/src/custom-props-end.md +0 -6
  135. package/src/web-components/TODO json-table/docs-builder/src/custom-props-start.md +0 -29
  136. package/src/web-components/TODO json-table/src/TODO.md +0 -1
  137. package/src/web-components/TODO json-table/src/__json-table-react/build-page-array.js +0 -73
  138. package/src/web-components/TODO json-table/src/__json-table-react/columns-data-types.js +0 -73
  139. package/src/web-components/TODO json-table/src/__json-table-react/defaults.js +0 -50
  140. package/src/web-components/TODO json-table/src/__json-table-react/download-excel.js +0 -156
  141. package/src/web-components/TODO json-table/src/__json-table-react/set-className.js +0 -19
  142. package/src/web-components/TODO json-table/src/__json-table-react/set-download-filename.js +0 -17
  143. package/src/web-components/TODO json-table/src/__json-table-react/table-to-csv.js +0 -48
  144. package/src/web-components/TODO json-table/src/css/custom-media.css +0 -16
  145. package/src/web-components/TODO json-table/src/css/icons.module.css +0 -22
  146. package/src/web-components/TODO json-table/src/css/info-section.module.css +0 -78
  147. package/src/web-components/TODO json-table/src/css/main-builder.module.css +0 -6
  148. package/src/web-components/TODO json-table/src/css/table.module.css +0 -172
  149. package/src/web-components/TODO json-table/src/css/utility.module.css +0 -9
  150. package/src/web-components/TODO json-table/src/icons/arrow-down-bold.svg +0 -1
  151. package/src/web-components/TODO json-table/src/icons/false.svg +0 -1
  152. package/src/web-components/TODO json-table/src/icons/true.svg +0 -1
  153. package/src/web-components/TODO json-table/src/index.js +0 -125
  154. package/src/web-components/TODO json-table/src/js/default-columns-data-types.js +0 -172
  155. package/src/web-components/TODO json-table/src/js/defaults.js +0 -510
  156. package/src/web-components/TODO json-table/src/js/get-ajax-data.js +0 -72
  157. package/src/web-components/TODO json-table/src/js/info-section.js +0 -39
  158. package/src/web-components/TODO json-table/src/js/init-ajax-table.js +0 -30
  159. package/src/web-components/TODO json-table/src/js/init-static-table.js +0 -18
  160. package/src/web-components/TODO json-table/src/js/main-builder.js +0 -87
  161. package/src/web-components/TODO json-table/src/js/parse-data-row.js +0 -123
  162. package/src/web-components/TODO json-table/src/js/parse-params.js +0 -118
  163. package/src/web-components/TODO json-table/src/js/set-search-listener.js +0 -62
  164. package/src/web-components/TODO json-table/src/js/set-sort-listeners.js +0 -115
  165. package/src/web-components/TODO json-table/src/js/static-data-sorting.js +0 -23
  166. package/src/web-components/TODO json-table/src/js/table-builder.js +0 -45
  167. package/src/web-components/TODO json-table/src/js/table-row.js +0 -43
  168. package/src/web-components/TODO json-table/src/js/table-tfoot.js +0 -9
  169. package/src/web-components/TODO json-table/src/js/table-thead.js +0 -91
  170. package/src/web-components/TODO json-table/src/js/update-info.js +0 -42
  171. package/src/web-components/TODO json-table/src/js/utilities.js +0 -5
package/README.md CHANGED
@@ -31,6 +31,10 @@ rm -rf package
31
31
 
32
32
  ---
33
33
 
34
+ ## Design tokens
35
+
36
+ Minimo comes with a set of design tokens and some utilities to manage them. See [Design Tokens readme](design-tokens/README.md).
37
+
34
38
  ## Dev Tools
35
39
 
36
40
  The [`dev-tools`](./dev-tools/README.md) directory contains a set of standalone Node.js CLI utilities for managing a web project — updating dependencies, bumping the version and changelog, and generating/optimizing SVG icons and favicons. They are published as part of the `minimo` package and exposed via the `bin` entries in `package.json` (`update-version`, `upd@m`, `svgIconsTools`, `create-favicons`); see the [Dev Tools README](./dev-tools/README.md) for the full list and usage.
@@ -38,7 +42,7 @@ The [`dev-tools`](./dev-tools/README.md) directory contains a set of standalone
38
42
 
39
43
  ## Docs & Demo
40
44
 
41
- [Docs](docs)
45
+ [Docs](docs/README.md)
42
46
 
43
47
  [Demo](https://massimo-cassandro.github.io/minimo/) (in progress)
44
48
 
@@ -1,8 +1,18 @@
1
- # Design Token Utilities
1
+ # Design Tokens
2
+
3
+ <!-- TODO intro -->
4
+
5
+ ## Using design tokens
6
+
7
+ <!-- TODO modalità d'uso (da tokens penpots o figma, con o snza merge css ecc...) -->
8
+
9
+ ## Design Token Utilities
10
+
11
+ <!-- TODO rivedere e semplificare -->
2
12
 
3
13
  A set of Node.js scripts for managing CSS design tokens in a project. Built on top of [Style Dictionary v5](https://styledictionary.com/).
4
14
 
5
- ## Scripts
15
+ ### Scripts
6
16
 
7
17
  | Script | Purpose |
8
18
  |---|---|
@@ -11,7 +21,7 @@ A set of Node.js scripts for managing CSS design tokens in a project. Built on t
11
21
 
12
22
  Both scripts share the same config file, passed via `--config`.
13
23
 
14
- ## Setup
24
+ ### Setup
15
25
 
16
26
  The scripts are intended to be used as npm scripts. Add them to your `package.json`:
17
27
 
@@ -35,26 +45,26 @@ The following packages must be present in your project:
35
45
  }
36
46
  ```
37
47
 
38
- ## Configuration file
48
+ ### Configuration file
39
49
 
40
50
  Both scripts read a shared config file passed with `--config`. Use `tokens-config-sample.mjs` as a starting point.
41
51
 
42
52
  Read comments inside the sample file for more info.
43
53
 
44
54
 
45
- ## `build-tokens.mjs`
55
+ ### `build-tokens.mjs`
46
56
 
47
57
  Reads design token source files and generates:
48
58
  - A **CSS file** containing all tokens as custom properties inside `:root { ... }`
49
59
  - Optionally, one or more **W3C DTCG JSON/JSONC** files to import into Penpot/Figma (use in Figma requires a plugin).
50
60
 
51
- ### Usage
61
+ #### Usage
52
62
 
53
63
  ```sh
54
64
  npx buildTokens --config ./path/to/tokens-config.mjs
55
65
  ```
56
66
 
57
- ### Source files
67
+ #### Source files
58
68
 
59
69
  The `source` array accepts any combination of:
60
70
  - Concrete file paths: `'./tokens/colors.jsonc'`
@@ -65,7 +75,7 @@ The `source` array accepts any combination of:
65
75
  - `.mjs` / `.js` — imported as ES modules; must export a W3C DTCG-compliant object as `default`
66
76
 
67
77
 
68
- ### Token file format (JS example)
78
+ #### Token file format (JS example)
69
79
 
70
80
  When using `.mjs` source files, export a default object following the [W3C Design Token Community Group format](https://design-tokens.github.io/community-group/format/):
71
81
 
@@ -96,7 +106,7 @@ The main advantage of `.mjs` over `.json` is the ability to use JavaScript varia
96
106
 
97
107
  Values can be expressions like `"{size.base} * .25"`, see `tokens-config-sample.mjs` for more info.
98
108
 
99
- ### Custom transforms
109
+ #### Custom transforms
100
110
 
101
111
  The following transforms are registered on top of Style Dictionary's built-ins:
102
112
 
@@ -109,7 +119,7 @@ The following transforms are registered on top of Style Dictionary's built-ins:
109
119
  | `composite/css` | value | Converts `border`, `outline`, `transition` and `animation` objects to their CSS shorthand. |
110
120
  | `typography/css` | value | Typography passthrough — the format handles exploding the value into individual properties. |
111
121
 
112
- ### CSS output
122
+ #### CSS output
113
123
 
114
124
  All tokens are output as CSS custom properties inside `:root`, sorted alphabetically.
115
125
 
@@ -119,7 +129,7 @@ Typography tokens are expanded into multiple properties:
119
129
 
120
130
  The generated file is linted and auto-fixed with stylelint using the config specified in `stylelintConfigPath`.
121
131
 
122
- ### Penpot output
132
+ #### Penpot output
123
133
 
124
134
  When `penpotBuildPath` is set, the script also generates W3C DTCG token files for import into Penpot via the [Design Tokens plugin](https://penpot.app/penpot-files/design-tokens).
125
135
 
@@ -148,19 +158,19 @@ Alias references (`{color.brand.primary}`) are preserved in the output so Penpot
148
158
 
149
159
  ---
150
160
 
151
- ## `check-unresolved-custom-props.mjs`
161
+ ### `check-unresolved-custom-props.mjs`
152
162
 
153
163
  Scans all `.css` files in `dir_to_check` (recursively) and reports any `var(--...)` references that are not defined in the generated token CSS file or in any `extra_custom_props_files`.
154
164
 
155
165
  Results are written to `unresolved-props.md` in the same directory as the config file.
156
166
 
157
- ### Usage
167
+ #### Usage
158
168
 
159
169
  ```sh
160
170
  npx checkUnresolvedProps --config ./path/to/tokens-config.mjs
161
171
  ```
162
172
 
163
- ### Output
173
+ #### Output
164
174
 
165
175
  The script creates a `unresolved-props.md` file next to the config file. Each line links to the file and line number where the unresolved property is used:
166
176
 
@@ -172,7 +182,7 @@ The script creates a `unresolved-props.md` file next to the config file. Each li
172
182
  In VS Code, Option/Alt-clicking on the URL opens the file at the required line.
173
183
 
174
184
 
175
- ### Excluding properties
185
+ #### Excluding properties
176
186
 
177
187
  Use `exclude_pattern` to suppress false positives — for example, internal/private custom properties that are defined dynamically or inline:
178
188
 
@@ -182,4 +192,4 @@ exclude_pattern: [
182
192
  /^--_/,
183
193
  /^--js-/,
184
194
  ]
185
- ```
195
+ ```
@@ -40,15 +40,23 @@
40
40
  "$value": "unset"
41
41
  }
42
42
  },
43
- "credits": {
43
+ "h1": {
44
+ "color": {
45
+ "$type": "color",
46
+ "$value": "{uspg.text.color}"
47
+ },
44
48
  "font": {
45
49
  "size": {
46
50
  "$type": "dimension",
47
- "$value": "{font.size.xs}"
51
+ "$value": "{font.size.xl}"
48
52
  },
49
53
  "weight": {
50
54
  "$type": "fontWeight",
51
- "$value": "{font.weight.regular}"
55
+ "$value": "{font.weight.bold}"
56
+ },
57
+ "variation-settings": {
58
+ "$type": "string",
59
+ "$value": "unset"
52
60
  }
53
61
  },
54
62
  "line-height": {
@@ -56,23 +64,73 @@
56
64
  "$value": "{line-height.xs}"
57
65
  }
58
66
  },
59
- "h1": {
67
+ "link": {
60
68
  "color": {
61
69
  "$type": "color",
62
- "$value": "{uspg.text.color}"
70
+ "$value": "#fc0"
71
+ },
72
+ "decoration": {
73
+ "$type": "string",
74
+ "$value": "none"
75
+ },
76
+ "visited": {
77
+ "color": {
78
+ "$type": "color",
79
+ "$value": "#C711FF"
80
+ }
81
+ },
82
+ "hover": {
83
+ "color": {
84
+ "$type": "color",
85
+ "$value": "{uspg.bg.color}"
86
+ },
87
+ "background": {
88
+ "color": {
89
+ "$type": "color",
90
+ "$value": "transparent"
91
+ }
92
+ },
93
+ "decoration": {
94
+ "$type": "string",
95
+ "$value": "underline"
96
+ }
63
97
  },
98
+ "active": {
99
+ "color": {
100
+ "$type": "color",
101
+ "$value": "#F49C29"
102
+ }
103
+ },
104
+ "focus": {
105
+ "outline": {
106
+ "width": {
107
+ "$type": "dimension",
108
+ "$value": "2px"
109
+ },
110
+ "style": {
111
+ "$type": "string",
112
+ "$value": "solid"
113
+ },
114
+ "color": {
115
+ "$type": "color",
116
+ "$value": "{uspg.link.color}"
117
+ },
118
+ "offset": {
119
+ "$type": "dimension",
120
+ "$value": "2px"
121
+ }
122
+ }
123
+ }
124
+ },
125
+ "credits": {
64
126
  "font": {
65
127
  "size": {
66
128
  "$type": "dimension",
67
- "$value": "{font.size.xl}"
129
+ "$value": "{font.size.xs}"
68
130
  },
69
131
  "weight": {
70
132
  "$type": "fontWeight",
71
- "$value": "{font.weight.bold}"
72
- },
73
- "variation-settings": {
74
- "$type": "string",
75
- "$value": "unset"
133
+ "$value": "{font.weight.regular}"
76
134
  }
77
135
  },
78
136
  "line-height": {
@@ -102,26 +160,6 @@
102
160
  }
103
161
  }
104
162
  },
105
- "link": {
106
- "color": {
107
- "$type": "color",
108
- "$value": "#fc0"
109
- },
110
- "decoration": {
111
- "$type": "string",
112
- "$value": "none"
113
- },
114
- "hover": {
115
- "color": {
116
- "$type": "color",
117
- "$value": "#fc0"
118
- },
119
- "decoration": {
120
- "$type": "string",
121
- "$value": "underline"
122
- }
123
- }
124
- },
125
163
  "loader": {
126
164
  "color": {
127
165
  "$type": "color",
@@ -10,14 +10,10 @@
10
10
  // Path to the design token source files.
11
11
  // You can use an absolute path, a relative path, or build it programmatically.
12
12
 
13
- // Example using a local node_modules package (JS source files)
14
- const minimo_path = '../../node_modules/@massimo-cassandro/minimo/design-tokens-src';
15
13
 
16
- // Alternative: pre-built JSONC files from the same package
17
- // const minimo_path = '../../node_modules/@massimo-cassandro/minimo/design-tokens';
18
14
 
19
- // For local testing
20
- // const minimo_path = path.resolve(homedir(), 'Sites/minimo/src');
15
+ // minimo package path in node_modules
16
+ const minimo_path = '../../node_modules/@massimo-cassandro/minimo';
21
17
 
22
18
  const config = {
23
19
 
@@ -42,11 +38,15 @@ const config = {
42
38
  // OK: `${minimo_path}/**/*.{json,mjs}`
43
39
  // NO: path.join(minimo_path, '/**/*.{json,mjs}')
44
40
  source: [
45
- `${minimo_path}/**/*.{jsonc,json,mjs}`,
46
- './project-tokens/*.jsonc',
41
+ `${minimo_path}/design-tokens/_src/**/*.tokens.{mjs,jsonc}`, // main tokens
42
+ `${minimo_path}/src/**/*.tokens.{mjs,jsonc}`, // components tokens
47
43
 
48
44
  // optional extra token source (in this example, openProps, https://open-props.style/)
49
45
  // '../../node_modules/open-props/open-props.style-dictionary-tokens.json',
46
+
47
+ // your project tokens
48
+ './project-tokens/*.{js,mjs,jsonc,json}',
49
+
50
50
  ],
51
51
 
52
52
  // ---------------------------------------------------------------------------
@@ -61,12 +61,12 @@ const config = {
61
61
 
62
62
  // Output directory for the Penpot design token files.
63
63
  // Set to null (or omit) to disable json output entirely.
64
- penpotBuildPath: './path/to/generated/design-tokens-dir',
64
+ penpotBuildPath: null || './path/to/generated/design-tokens-dir',
65
65
 
66
66
  // Base name (without extension) for the aggregated Penpot output file.
67
67
  // The extension is added automatically based on penpotFormat.
68
68
  // Set to null (or omit) to generate one file per .mjs source file instead.
69
- penpotDestFile: 'tokens',
69
+ penpotDestFile: null || 'tokens',
70
70
 
71
71
  // How to handle math expressions in dimension token $values (e.g. "{size.base} * .25"):
72
72
  // 'keep' write the expression unchanged
@@ -75,6 +75,14 @@ const config = {
75
75
  // e.g. {size.base} = 16px, "{size.base} * .25" -> "4px"
76
76
  penpotExpressions: 'resolve',
77
77
 
78
+ // If true, custom properties already present in the CSS destination file
79
+ // (destFile, from a previous build) take priority over the ones generated
80
+ // by this build. Properties found only in the pre-existing file (no longer
81
+ // generated) are kept too. Useful to preserve manual overrides/additions
82
+ // made directly in the compiled CSS across rebuilds. Ignored on the first
83
+ // build, when destFile does not exist yet. Default: false.
84
+ mergeCustomProps: false,
85
+
78
86
 
79
87
 
80
88
  // ---------------------------------------------------------------------------
@@ -75,6 +75,11 @@ export const penpotExpressions = VALID_EXPR_MODES.includes(buildConfig.penpotExp
75
75
  ? buildConfig.penpotExpressions
76
76
  : 'resolve';
77
77
 
78
+ // mergeCustomProps: if true, custom properties already present in the CSS
79
+ // destination file take priority over the ones generated by this build (see
80
+ // build-tokens-src/merge-css.mjs). Default: false.
81
+ export const mergeCustomProps = buildConfig.mergeCustomProps === true;
82
+
78
83
  // ---------------------------------------------------------------------------
79
84
  // Source: resolve patterns relative to the config directory and normalise to
80
85
  // forward-slash absolute paths (fast-glob, used internally by Style Dictionary,
@@ -6,6 +6,7 @@
6
6
  // - individual properties for letterSpacing, textTransform, textDecoration
7
7
 
8
8
  import StyleDictionary from 'style-dictionary';
9
+ import { mergeCustomProps, parseCustomProps } from '../merge-css.mjs';
9
10
 
10
11
  const BASE_FONT_SIZE = 16;
11
12
 
@@ -224,7 +225,22 @@ StyleDictionary.registerFormat({
224
225
  return [` --${token.name}: ${value};`];
225
226
  });
226
227
 
227
- customPropsCount = lines.length;
228
- return `${selector} {\n${lines.join('\n')}\n}\n`;
228
+ // Build a name → declaration-tail map from the declarations generated
229
+ // above, then merge with any pre-existing custom properties loaded via
230
+ // loadExistingCustomProps() (see ../merge-css.mjs). Pre-existing values
231
+ // (including trailing comments) take priority when both exist;
232
+ // pre-existing-only properties are kept.
233
+ const generatedProps = parseCustomProps(lines.join('\n'));
234
+ const finalProps = mergeCustomProps(generatedProps);
235
+
236
+ // Final output is always sorted alphabetically ascending by property
237
+ // name, regardless of merge — this also keeps pre-existing-only
238
+ // properties from merge-css.mjs in order instead of trailing at the end.
239
+ const outLines = Object.entries(finalProps)
240
+ .sort(([a], [b]) => a.localeCompare(b, 'en', { numeric: true, sensitivity: 'base' }))
241
+ .map(([name, tail]) => ` --${name}: ${tail}`);
242
+
243
+ customPropsCount = outLines.length;
244
+ return `${selector} {\n${outLines.join('\n')}\n}\n`;
229
245
  },
230
246
  });
@@ -0,0 +1,60 @@
1
+ // build-tokens-src/merge-css.mjs
2
+ // Supports the `mergeCustomProps` config option: pre-existing custom
3
+ // properties in the CSS destination file take priority over the ones
4
+ // generated by the current build (manual overrides/additions survive rebuilds).
5
+ //
6
+ // Usage:
7
+ // 1. Call loadExistingCustomProps(absDestPath) BEFORE Style Dictionary runs,
8
+ // since it reads the file that is about to be overwritten.
9
+ // 2. The css/variables-sorted format (see formats/css.mjs) calls
10
+ // mergeCustomProps(generatedMap) while building the output, right before
11
+ // serialising the final CSS text.
12
+
13
+ import { existsSync, readFileSync } from 'node:fs';
14
+
15
+ const CUSTOM_PROP_RE = /^\s*--([\w-]+):\s*(.+)$/gm;
16
+
17
+ /**
18
+ * Parses `--name: <tail>` declarations out of a CSS text block. <tail> is
19
+ * captured verbatim (value, terminating `;`, and anything else on the same
20
+ * line, e.g. a trailing comment) so it round-trips unchanged through a merge.
21
+ * Only single-line declarations are supported.
22
+ * @param {string} cssText
23
+ * @returns {Record<string,string>} name → declaration-tail map, in first-seen order
24
+ */
25
+ export const parseCustomProps = (cssText) => {
26
+ /** @type {Record<string,string>} */
27
+ const map = {};
28
+ for (const match of cssText.matchAll(CUSTOM_PROP_RE)) {
29
+ map[match[1]] = match[2].trim();
30
+ }
31
+ return map;
32
+ };
33
+
34
+ // null = merge disabled, or destination file not found yet (first build)
35
+ /** @type {Record<string,string>|null} */
36
+ let existingCustomProps = null;
37
+
38
+ /**
39
+ * Reads the CSS destination file (if it exists) and stores a name → value
40
+ * map of its current custom properties for later merging.
41
+ * @param {string} absDestPath absolute path of the CSS file to read
42
+ * @returns {Record<string,string>|null}
43
+ */
44
+ export const loadExistingCustomProps = (absDestPath) => {
45
+ existingCustomProps = existsSync(absDestPath)
46
+ ? parseCustomProps(readFileSync(absDestPath, 'utf8'))
47
+ : null;
48
+ return existingCustomProps;
49
+ };
50
+
51
+ /**
52
+ * Merges freshly generated custom properties with the ones previously loaded
53
+ * via loadExistingCustomProps(). Pre-existing values take priority; custom
54
+ * properties found only in the pre-existing file (no longer generated) are
55
+ * kept as well.
56
+ * @param {Record<string,string>} generated name → value map produced by this build
57
+ * @returns {Record<string,string>}
58
+ */
59
+ export const mergeCustomProps = (generated) =>
60
+ existingCustomProps ? { ...generated, ...existingCustomProps } : generated;
@@ -31,6 +31,7 @@ import {
31
31
  penpotFormat,
32
32
  penpotExpressions,
33
33
  source,
34
+ mergeCustomProps,
34
35
  } from './build-tokens-src/config.mjs';
35
36
 
36
37
  // ── 2. Custom transforms ─────────────────────────────────────────────────────
@@ -38,7 +39,9 @@ import './build-tokens-src/transforms.mjs';
38
39
 
39
40
  // ── 3. CSS format ─────────────────────────────────────────────────────────────
40
41
  // customPropsCount is updated by the format at render time
42
+ // loadExistingCustomProps supports the mergeCustomProps option (see below)
41
43
  import { customPropsCount } from './build-tokens-src/formats/css.mjs';
44
+ import { loadExistingCustomProps } from './build-tokens-src/merge-css.mjs';
42
45
 
43
46
  // ── 4. Penpot format ──────────────────────────────────────────────────────────
44
47
  import { buildPenpotFiles, collectConcreteFilePaths } from './build-tokens-src/formats/penpot.mjs';
@@ -46,6 +49,15 @@ import { buildPenpotFiles, collectConcreteFilePaths } from './build-tokens-src/f
46
49
  // ── 5. Platforms builder ──────────────────────────────────────────────────────
47
50
  import { buildPlatforms } from './build-tokens-src/platforms.mjs';
48
51
 
52
+ // ── 5b. Pre-existing custom properties (mergeCustomProps option) ────────────
53
+ // Read before Style Dictionary runs, since it overwrites the destination
54
+ // file. The css/variables-sorted format (formats/css.mjs) merges these
55
+ // values in — pre-existing values take priority — right before serialising
56
+ // the final CSS output. See merge-css.mjs.
57
+ if (mergeCustomProps) {
58
+ loadExistingCustomProps(path.join(buildPath, destFile));
59
+ }
60
+
49
61
  // ── 6. Collect concrete source file paths (multi-file Penpot mode only) ──────
50
62
  // Source entries may be glob patterns. SD expands them internally and stores
51
63
  // the concrete path in token.filePath. We need those concrete paths to build
@@ -34,6 +34,14 @@ zsh package/dev-tools/starter-kit/starter-install.sh
34
34
  rm -rf package
35
35
  ```
36
36
 
37
+ To test the installation skipping all `npm install` commands, use the `--no-npm` parameter:
38
+
39
+ ```bash
40
+ curl -sL "$(npm view @massimo-cassandro/minimo dist.tarball)" | tar xz package/dev-tools/starter-kit
41
+ zsh package/dev-tools/starter-kit/starter-install.sh --no-npm
42
+ rm -rf package
43
+ ```
44
+
37
45
  ## SVG adn favicons tools
38
46
 
39
47
  ```bash
@@ -18,6 +18,23 @@ if [ -z "$ZSH_VERSION" ]; then
18
18
  exit 1
19
19
  fi
20
20
 
21
+ # --no-npm: salta le installazioni npm (utile per testare rapidamente lo script)
22
+ SKIP_NPM=0
23
+ for ARG in "$@"; do
24
+ if [ "$ARG" = "--no-npm" ]; then
25
+ SKIP_NPM=1
26
+ fi
27
+ done
28
+
29
+ # Wrapper: esegue "npm i ..." a meno che SKIP_NPM sia attivo
30
+ npm_i() {
31
+ if [ "$SKIP_NPM" = "1" ]; then
32
+ echo "(--no-npm) skip: npm i $*"
33
+ else
34
+ npm i "$@"
35
+ fi
36
+ }
37
+
21
38
  # Configurazione variabili
22
39
  # BASE_URL="https://raw.githubusercontent.com/massimo-cassandro/minimo/refs/heads/main"
23
40
 
@@ -139,28 +156,28 @@ fi
139
156
 
140
157
 
141
158
  echo -e "\n${GREEN}...eslint${NC}"
142
- npm i -D @massimo-cassandro/eslint-config
159
+ npm_i -D @massimo-cassandro/eslint-config
143
160
  safe_cat "${TEMPLATES_DIR}/eslint.config.mjs" eslint.config.mjs new
144
161
 
145
162
  echo -e "\n${GREEN}...stylelint${NC}"
146
- npm i -D @massimo-cassandro/stylelint-config
163
+ npm_i -D @massimo-cassandro/stylelint-config
147
164
  safe_cat "${TEMPLATES_DIR}/stylelint.config.mjs" stylelint.config.mjs new
148
165
 
149
166
  echo -e "\n${GREEN}...webpack${NC}"
150
- npm i -D webpack-cli webpack-dev-server webpack-manifest-plugin webpack
151
- npm i -D @babel/core @babel/preset-env babel-loader terser-webpack-plugin
152
- npm i -D webpack-remove-empty-scripts copy-webpack-plugin html-loader html-webpack-plugin
153
- npm i -D postcss autoprefixer postcss-custom-media @csstools/postcss-global-data postcss-loader postcss-preset-env
167
+ npm_i -D webpack-cli webpack-dev-server webpack-manifest-plugin webpack
168
+ npm_i -D @babel/core @babel/preset-env babel-loader terser-webpack-plugin
169
+ npm_i -D webpack-remove-empty-scripts copy-webpack-plugin html-loader html-webpack-plugin
170
+ npm_i -D postcss autoprefixer postcss-custom-media @csstools/postcss-global-data postcss-loader postcss-preset-env
154
171
  # NB: niente cssnano: la minificazione è di css-minimizer-webpack-plugin e cssnano
155
172
  # nel loader postcss eliminerebbe i commenti `purgecss ignore` prima di PurgeCSS
156
- npm i -D mini-css-extract-plugin style-loader css-loader css-minimizer-webpack-plugin
157
- npm i -D responsive-loader
158
- npm i -D process dotenv-webpack
159
- npm i -D svgo svg-url-loader svgo-loader svgo-add-viewbox mini-svg-data-uri
160
- npm i -D ejs-loader
161
- npm i -D purgecss-webpack-plugin glob
173
+ npm_i -D mini-css-extract-plugin style-loader css-loader css-minimizer-webpack-plugin
174
+ npm_i -D responsive-loader
175
+ npm_i -D process dotenv-webpack
176
+ npm_i -D svgo svg-url-loader svgo-loader svgo-add-viewbox mini-svg-data-uri
177
+ npm_i -D ejs-loader
178
+ npm_i -D purgecss-webpack-plugin glob
162
179
 
163
- npm i -D style-dictionary
180
+ npm_i -D style-dictionary
164
181
 
165
182
  safe_cat "${WEBPACK_SOURCE_DIR}/webpack.config.mjs" "${FRONTEND_INSTALL_PATH}/webpack.config.mjs"
166
183
  safe_cat "${WEBPACK_SOURCE_DIR}/webpack-template.ejs" "${FRONTEND_INSTALL_PATH}/webpack-template.ejs"
@@ -168,15 +185,6 @@ safe_cat "${WEBPACK_SOURCE_DIR}/webpack-template.ejs" "${FRONTEND_INSTALL_PATH}/
168
185
  # cartella webpack
169
186
  WEBPACK_LOCAL_DIR="${FRONTEND_INSTALL_PATH}/webpack-modules"
170
187
  WEBPACK_MODULES_REMOTE_URL="${WEBPACK_SOURCE_DIR}/webpack-modules"
171
- FILES=(
172
- 'css-rules.mjs'
173
- 'get-jsConfig-aliases.mjs'
174
- 'mini-svg-data-uri-loader.cjs'
175
- 'svg-rules.mjs'
176
- 'svgo.config.mjs'
177
- 'postcss.config.mjs'
178
- 'purgecss-variables-safelist.mjs'
179
- )
180
188
 
181
189
  # se la cartella esiste già, i moduli vengono copiati in NEW-webpack-modules
182
190
  # (da integrare manualmente o rimuovere)
@@ -188,18 +196,30 @@ fi
188
196
 
189
197
  mkdir -p "$WEBPACK_LOCAL_DIR"
190
198
 
191
- for FILE in "${FILES[@]}"; do
192
- safe_cat "${WEBPACK_MODULES_REMOTE_URL}/${FILE}" "${WEBPACK_LOCAL_DIR}/${FILE}"
199
+ # copia tutti i file presenti in webpack-modules,
200
+ for FILE in "${WEBPACK_MODULES_REMOTE_URL}"/*; do
201
+ [ -f "$FILE" ] || continue
202
+ safe_cat "$FILE" "${WEBPACK_LOCAL_DIR}/$(basename "$FILE")"
193
203
  done
194
204
 
195
205
  echo -e "\n${GREEN}Creating a template of your frontend application's folder structured${NC}"
196
206
 
197
- TEMPLATE_DIR_NAME="__frontend_app_dir_template__"
207
+ TEMPLATE_DIR_NAME="__frontend_dir__"
198
208
  mkdir -p "$TEMPLATE_DIR_NAME"
199
209
  cd "$TEMPLATE_DIR_NAME"
200
- mkdir -p error-pages imgs icons src src/css favicons design-tokens
210
+ mkdir -p error-pages imgs icons src css favicons design-tokens
201
211
  cd ..
202
212
 
213
+ # copia dei file css presenti nella root di minimo/src
214
+ # (custom-properties.css, custom-media.css, fonts.css, minimo.css, ...):
215
+ MINIMO_ROOT_CSS_DIR="${BASE_URL}/../../src"
216
+ for FILE in "${MINIMO_ROOT_CSS_DIR}"/*.css; do
217
+ safe_cat "$FILE" "${TEMPLATE_DIR_NAME}/css/$(basename "$FILE")"
218
+ done
219
+
220
+ # copia tokens.config.mjs
221
+ safe_cat "${BASE_URL}/../../design-tokens/tokens-config-sample.mjs" "${TEMPLATE_DIR_NAME}/css/tokens-config.mjs"
222
+
203
223
  # template delle entry css (globale/di pagina e critical): ogni entry deve
204
224
  # importare direttamente custom-properties.css (vedi commenti nei file stessi)
205
225
  safe_cat "${TEMPLATES_DIR}/entry-tpl.css" "${TEMPLATE_DIR_NAME}/src/entry-tpl.css"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massimo-cassandro/minimo",
3
- "version": "1.18.4",
3
+ "version": "1.19.1",
4
4
  "description": "Light css framework & utilities",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -56,12 +56,16 @@
56
56
  "files": [
57
57
  "./index.js",
58
58
  "src/**/*.{js,mjs,css,svg,md}",
59
+ "design-tokens/README.md",
60
+ "design-tokens/tokens-config-sample.mjs",
59
61
  "design-tokens/tokens/**/*.{tokens.json,tokens.jsonc}",
60
62
  "design-tokens/_src/**/*.{tokens.json,tokens.jsonc,mjs,js,md}",
61
63
  "design-tokens/utilities/**/*.{mjs,md}",
62
64
  "charts/**/*.{js,mjs,md}",
63
65
  "dev-tools/**/*",
64
- "snippets/**/*"
66
+ "snippets/**/*",
67
+ "!**/TODO*/**",
68
+ "!**/TODO*"
65
69
  ],
66
70
  "peerDependencies": {
67
71
  "@svgdotjs/svg.js": "^3.2.7",
@@ -1,6 +1,7 @@
1
1
 
2
2
 
3
- import { unsplashPage } from '@massimo-cassandro/minimo/index.js';
3
+ import { unsplashPage } from '@massimo-cassandro/minimo';
4
+ // import './error-pages.css';
4
5
 
5
6
  const errCode = document.documentElement.dataset.errCode || '500',
6
7
  errText = document.documentElement.dataset.errText,
@@ -27,7 +28,7 @@ unsplashPage({
27
28
  targetElement : document.getElementById('root'),
28
29
  className : 'error-page',
29
30
  unsplashDataUrl : url,
30
- utmSource : 'ictgovernance.bluvacanze.it',
31
+ utmSource : 'marketing.bluvacanze.it',
31
32
  title : errors[errCode]?.title ?? errText,
32
33
  text : `(${errCode} ${errText})`,
33
34
  backLink : errCode !== '503'? 'Torna alla <a href="/">Home</a>' : '',