@massimo-cassandro/minimo 1.20.16 → 1.21.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 (58) hide show
  1. package/design-tokens/tokens-config-sample.mjs +5 -0
  2. package/design-tokens/utilities/build-tokens-src/config.mjs +5 -0
  3. package/design-tokens/utilities/build-tokens-src/formats/css.mjs +7 -1
  4. package/design-tokens/utilities/build-tokens-src/platforms.mjs +3 -0
  5. package/design-tokens/utilities/build-tokens.mjs +2 -0
  6. package/package.json +3 -3
  7. package/src/components/autocomplete/autocomplete.css +113 -109
  8. package/src/components/inner-nav/inner-nav.css +13 -9
  9. package/src/components/modal-alert/modal-alert.module.css +157 -153
  10. package/src/components/modal-popup/modal-popup.module.css +89 -85
  11. package/src/components/overlay/overlay.css +14 -10
  12. package/src/components/sf-macro/sf-macro.css +60 -56
  13. package/src/components/slide-up-down-toggle/slide-up-down-toggle.module.css +33 -29
  14. package/src/components/snackbar/snackbar.module.css +93 -89
  15. package/src/components/spinner/spinner-circle-basic.css +18 -14
  16. package/src/components/spinner/spinner.module.css +8 -4
  17. package/src/components/unsplash-page/unsplash-page.module.css +260 -256
  18. package/src/css/alerts.css +55 -53
  19. package/src/css/badge.css +16 -12
  20. package/src/css/buttons/btn-close.css +57 -53
  21. package/src/css/buttons/buttons-primary.css +38 -34
  22. package/src/css/buttons/buttons-secondary.css +38 -34
  23. package/src/css/buttons/buttons.css +84 -80
  24. package/src/css/buttons/status-buttons.css +66 -63
  25. package/src/css/container.css +9 -5
  26. package/src/css/data-formats.css +28 -24
  27. package/src/css/details.css +17 -13
  28. package/src/css/dimensions.css +13 -9
  29. package/src/css/display.css +27 -23
  30. package/src/css/flex.css +39 -35
  31. package/src/css/forms/fieldset.css +47 -43
  32. package/src/css/forms/form-collections.css +16 -12
  33. package/src/css/forms/form-disabled-readonly.css +31 -27
  34. package/src/css/forms/form-group.css +15 -11
  35. package/src/css/forms/form-utilities.css +32 -28
  36. package/src/css/forms/forms.css +136 -134
  37. package/src/css/forms/input-group.css +47 -43
  38. package/src/css/forms/switch.css +50 -46
  39. package/src/css/forms/validation.css +26 -22
  40. package/src/css/grid.css +66 -62
  41. package/src/css/headings.css +32 -28
  42. package/src/css/icons.css +41 -37
  43. package/src/css/layout-base.css +16 -12
  44. package/src/css/links.css +40 -36
  45. package/src/css/margin-padding-bootstrap-media.css +1836 -1832
  46. package/src/css/margin-padding-bootstrap.css +445 -441
  47. package/src/css/margin-padding-media.css +1836 -1832
  48. package/src/css/margin-padding.css +445 -441
  49. package/src/css/overflow.css +7 -3
  50. package/src/css/position.css +5 -1
  51. package/src/css/reset.css +47 -44
  52. package/src/css/svg.css +6 -2
  53. package/src/css/table.css +59 -55
  54. package/src/css/text.css +96 -92
  55. package/src/css/visibility.css +23 -19
  56. package/src/custom-properties.css +442 -439
  57. package/src/minimo.css +2 -0
  58. package/src/web-components/s-datatable-component/s-datatable-component.module.css +175 -171
@@ -63,6 +63,11 @@ const config = {
63
63
  // Comments at the end of custom properties are preserved, while full-line ones will be lost.
64
64
  mergeCustomProps: false,
65
65
 
66
+ // Wraps the generated custom properties inside a CSS `@layer` at-rule,
67
+ // e.g. addLayer: 'project' -> `@layer project { :root { ... } }`.
68
+ // Set to null, undefined or false (default) to emit no layer.
69
+ addLayer: 'project',
70
+
66
71
  // Named groups of custom properties. Properties whose first hyphen-separated
67
72
  // name segment matches one of a group's `prefixes` are pulled out, labelled
68
73
  // with the group's `name` and placed at the beginning of the output CSS
@@ -87,6 +87,11 @@ export const pxToRem = buildConfig.pxToRem !== false;
87
87
  // build-tokens-src/merge-css.mjs). Default: false.
88
88
  export const mergeCustomProps = buildConfig.mergeCustomProps === true;
89
89
 
90
+ // addLayer: wraps the generated custom properties inside a CSS `@layer`
91
+ // at-rule (see formats/css.mjs), e.g. `@layer project { :root { ... } }`.
92
+ // Set to null, undefined or false (default) to emit no layer.
93
+ export const addLayer = buildConfig.addLayer ? String(buildConfig.addLayer).trim() : null;
94
+
90
95
  // customPropsGroups: custom properties whose first hyphen-separated name
91
96
  // segment matches one of a group's prefixes are pulled out, labelled with
92
97
  // that group's name and moved to the beginning of the generated CSS file, in
@@ -324,6 +324,12 @@ StyleDictionary.registerFormat({
324
324
  appendBlock(restProps);
325
325
 
326
326
  customPropsCount = sortedProps.length;
327
- return `${selector} {\n${outLines.join('\n')}\n}\n`;
327
+ const block = `${selector} {\n${outLines.join('\n')}\n}\n`;
328
+
329
+ // addLayer: wraps the whole block inside `@layer <name> { ... }`.
330
+ // Indentation is left to stylelint's fix step (run right after the build).
331
+ return options.addLayer
332
+ ? `@layer ${options.addLayer} {\n\n${block}}\n`
333
+ : block;
328
334
  },
329
335
  });
@@ -47,6 +47,7 @@ const JSON_TRANSFORMS = [
47
47
  * @param {'keep'|'calc'|'resolve'} opts.jsonExpression How to handle math expressions in dimension tokens.
48
48
  * @param {{name: string, prefixes: string[]}[]} opts.customPropsGroups Named groups of name prefixes, moved to the top of the CSS output in list order.
49
49
  * @param {boolean} opts.pxToRem If false, skips the px→rem transform on the CSS platform. Default: true.
50
+ * @param {string|null} opts.addLayer Wraps the generated custom properties inside `@layer <addLayer> { ... }`. null = no layer.
50
51
  * @returns {Record<string, PlatformConfig>} platforms object ready for Style Dictionary config
51
52
  */
52
53
  export const buildPlatforms = ({
@@ -59,6 +60,7 @@ export const buildPlatforms = ({
59
60
  concreteFilePaths = [],
60
61
  customPropsGroups = [],
61
62
  pxToRem = true,
63
+ addLayer = null,
62
64
  }) => {
63
65
  const cssTransforms = pxToRem
64
66
  ? CSS_TRANSFORMS
@@ -77,6 +79,7 @@ export const buildPlatforms = ({
77
79
  outputReferences: true,
78
80
  showFileHeader: true,
79
81
  customPropsGroups,
82
+ addLayer,
80
83
  },
81
84
  },
82
85
  ],
@@ -34,6 +34,7 @@ import {
34
34
  mergeCustomProps,
35
35
  customPropsGroups,
36
36
  pxToRem,
37
+ addLayer,
37
38
  } from './build-tokens-src/config.mjs';
38
39
 
39
40
  // ── 2. Custom transforms ─────────────────────────────────────────────────────
@@ -107,6 +108,7 @@ const sd = new StyleDictionary({
107
108
  concreteFilePaths,
108
109
  customPropsGroups,
109
110
  pxToRem,
111
+ addLayer,
110
112
  }),
111
113
  });
112
114
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massimo-cassandro/minimo",
3
- "version": "1.20.16",
3
+ "version": "1.21.1",
4
4
  "description": "Light css framework & utilities",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -90,9 +90,9 @@
90
90
  "devDependencies": {
91
91
  "@massimo-cassandro/eslint-config": "^3.0.13",
92
92
  "@massimo-cassandro/stylelint-config": "^2.3.13",
93
- "@types/node": "^26.1.2",
93
+ "@types/node": "^26.2.0",
94
94
  "jsdom": "^29.1.1",
95
- "style-dictionary": "^5.5.0"
95
+ "style-dictionary": "^5.5.1"
96
96
  },
97
97
  "dependencies": {
98
98
  "@inquirer/input": "^5.1.2",
@@ -1,146 +1,150 @@
1
- /* basato sul css di @tarekraafat/autocomplete.js */
1
+ @layer components {
2
2
 
3
+ /* basato sul css di @tarekraafat/autocomplete.js */
3
4
 
4
- .hmenu-subsection-emulazione {
5
- overflow-y: visible;
6
- }
7
5
 
8
- .ac-autocomplete-wrapper { /* assegnato all'elemento .form-group */
9
-
10
- --ac-color: #333;
11
- --ac-bg-color: #fff;
12
- --ac-border-color: #666;
13
- --ac-danger-color: #c00;
14
- --ac-box-shadow: 0 0 10px rgb(0 0 0 / .6);
15
- --ac-list-item-bg: #fff;
16
- --ac-hover-color: var(--secondary-100);
17
-
18
- position: relative;
19
-
20
- ul {
21
- position: absolute;
22
- top: 100%;
23
- right: 0;
24
- left: 0;
25
- z-index: 1000;
26
- max-height: 14rem;
27
- padding: 0;
28
- margin: .2rem 0 0;
29
- overflow-y: scroll;
30
- color: var(--ac-color);
31
- outline: none;
32
- background-color: var(--ac-bg-color);
33
- border: 1px solid var(--ac-border-color);
34
- border-radius: .6rem;
35
- box-shadow: var(--ac-box-shadow);
36
-
37
- &[hidden],
38
- &:empty {
39
- display: block;
40
- opacity: 0;
41
- transform: scale(0);
42
- }
6
+ .hmenu-subsection-emulazione {
7
+ overflow-y: visible;
8
+ }
43
9
 
44
- li {
10
+ .ac-autocomplete-wrapper { /* assegnato all'elemento .form-group */
11
+
12
+ --ac-color: #333;
13
+ --ac-bg-color: #fff;
14
+ --ac-border-color: #666;
15
+ --ac-danger-color: #c00;
16
+ --ac-box-shadow: 0 0 10px rgb(0 0 0 / .6);
17
+ --ac-list-item-bg: #fff;
18
+ --ac-hover-color: var(--secondary-100);
19
+
20
+ position: relative;
21
+
22
+ ul {
23
+ position: absolute;
24
+ top: 100%;
25
+ right: 0;
26
+ left: 0;
27
+ z-index: 1000;
28
+ max-height: 14rem;
45
29
  padding: 0;
46
- margin: .3rem;
47
- text-align: left;
48
- list-style: none;
30
+ margin: .2rem 0 0;
31
+ overflow-y: scroll;
32
+ color: var(--ac-color);
33
+ outline: none;
34
+ background-color: var(--ac-bg-color);
35
+ border: 1px solid var(--ac-border-color);
36
+ border-radius: .6rem;
37
+ box-shadow: var(--ac-box-shadow);
38
+
39
+ &[hidden],
40
+ &:empty {
41
+ display: block;
42
+ opacity: 0;
43
+ transform: scale(0);
44
+ }
49
45
 
50
- /* stylelint-disable declaration-no-important, max-nesting-depth, selector-max-compound-selectors */
51
- > div {
46
+ li {
47
+ padding: 0;
48
+ margin: .3rem;
49
+ text-align: left;
50
+ list-style: none;
52
51
 
53
- padding: .3rem .5rem;
54
- background-color: var(--ac-list-item-bg);
55
- border-radius: .35rem;
56
- transition: all .2s ease;
52
+ /* stylelint-disable declaration-no-important, max-nesting-depth, selector-max-compound-selectors */
53
+ > div {
57
54
 
58
- .badge {
59
- color: #fff;
60
- background-color: var(--ac-hover-color);
61
- }
55
+ padding: .3rem .5rem;
56
+ background-color: var(--ac-list-item-bg);
57
+ border-radius: .35rem;
58
+ transition: all .2s ease;
62
59
 
63
- &:hover {
64
- cursor: pointer;
65
- background-color: var(--ac-hover-color) !important;
66
- &, .text-muted {
67
- color: #fff !important;
68
- }
69
60
  .badge {
70
- color: var(--ac-hover-color) !important;
71
- background-color: color-mix(in srgb, #fff 70%, transparent) !important;
61
+ color: #fff;
62
+ background-color: var(--ac-hover-color);
72
63
  }
73
64
 
74
- mark {
75
- border-color: currentColor;
65
+ &:hover {
66
+ cursor: pointer;
67
+ background-color: var(--ac-hover-color) !important;
68
+ &, .text-muted {
69
+ color: #fff !important;
70
+ }
71
+ .badge {
72
+ color: var(--ac-hover-color) !important;
73
+ background-color: color-mix(in srgb, #fff 70%, transparent) !important;
74
+ }
75
+
76
+ mark {
77
+ border-color: currentColor;
78
+ }
76
79
  }
77
- }
78
80
 
79
- &.alert-item{
81
+ &.alert-item{
80
82
 
81
83
 
82
- &, .text-muted {
83
- color: var(--text-muted) !important;
84
- }
85
- background-color: color-mix(in srgb, var(--ac-danger-color) 1%, transparent);
86
- &:hover {
87
84
  &, .text-muted {
88
- color: rgb(255 255 255) !important;
85
+ color: var(--text-muted) !important;
86
+ }
87
+ background-color: color-mix(in srgb, var(--ac-danger-color) 1%, transparent);
88
+ &:hover {
89
+ &, .text-muted {
90
+ color: rgb(255 255 255) !important;
91
+ }
89
92
  }
90
93
  }
91
- }
92
94
 
93
- mark {
94
- padding: 0;
95
- color: currentColor;
96
- background-color: transparent;
97
- border-bottom: 4px double var(--ac-danger-color);
95
+ mark {
96
+ padding: 0;
97
+ color: currentColor;
98
+ background-color: transparent;
99
+ border-bottom: 4px double var(--ac-danger-color);
98
100
 
99
- /* stylelint-disable-next-line max-nesting-depth selector-max-type */
100
- /* &::selection {
101
+ /* stylelint-disable-next-line max-nesting-depth selector-max-type */
102
+ /* &::selection {
101
103
  color: rgba(#ffffff, 0);
102
104
  background-color: rgba(#ffffff, 0);
103
105
  } */
106
+ }
104
107
  }
105
- }
106
- /* stylelint-enable declaration-no-important, max-nesting-depth, selector-max-compound-selectors */
108
+ /* stylelint-enable declaration-no-important, max-nesting-depth, selector-max-compound-selectors */
107
109
 
108
- /* &[aria-selected='true'] {
110
+ /* &[aria-selected='true'] {
109
111
  background-color: var(--ada-grigio-2);
110
112
  } */
113
+ }
111
114
  }
112
- }
113
115
 
114
- .no-result {
115
- padding: .4rem .6rem;
116
- color: var(--ac-danger-color);
116
+ .no-result {
117
+ padding: .4rem .6rem;
118
+ color: var(--ac-danger-color);
119
+ }
117
120
  }
118
- }
119
121
 
120
122
 
121
- /* badge multiple select */
122
- .ac-badge {
123
- margin: 0 .5rem .2rem 0;
124
- font-size: .85rem;
125
- line-height: 1;
126
- white-space: nowrap;
123
+ /* badge multiple select */
124
+ .ac-badge {
125
+ margin: 0 .5rem .2rem 0;
126
+ font-size: .85rem;
127
+ line-height: 1;
128
+ white-space: nowrap;
129
+
130
+ &:has(.ac-badge-btn:hover) {
131
+ /* stylelint-disable-next-line declaration-no-important */
132
+ background-color: var(--ac-danger-color) !important;
133
+ }
134
+ }
135
+ .ac-badge-btn {
136
+ display: inline-flex;
137
+ align-items: center;
138
+ justify-content: center;
139
+ padding: 0;
140
+ margin-left: 4px;
141
+ font-size: 1.2em;
142
+ line-height: 1;
143
+ color: currentColor;
144
+ background-color: transparent;
145
+ border: none;
146
+ border-radius: 50%;
127
147
 
128
- &:has(.ac-badge-btn:hover) {
129
- /* stylelint-disable-next-line declaration-no-important */
130
- background-color: var(--ac-danger-color) !important;
131
148
  }
132
- }
133
- .ac-badge-btn {
134
- display: inline-flex;
135
- align-items: center;
136
- justify-content: center;
137
- padding: 0;
138
- margin-left: 4px;
139
- font-size: 1.2em;
140
- line-height: 1;
141
- color: currentColor;
142
- background-color: transparent;
143
- border: none;
144
- border-radius: 50%;
145
149
 
146
150
  }
@@ -1,13 +1,17 @@
1
- /*! minimo - Inner Nav */
1
+ @layer components {
2
2
 
3
- .inner-nav-main, .inner-nav {
4
- display: flex;
5
- gap: var(--inner-nav-gap);
6
- justify-content: flex-end;
7
- margin-block: var(--inner-nav-margin-block);
8
- /* text-align: end; */
3
+ /*! minimo - Inner Nav */
9
4
 
10
- @media print {
11
- display: none;
5
+ .inner-nav-main, .inner-nav {
6
+ display: flex;
7
+ gap: var(--inner-nav-gap);
8
+ justify-content: flex-end;
9
+ margin-block: var(--inner-nav-margin-block);
10
+ /* text-align: end; */
11
+
12
+ @media print {
13
+ display: none;
14
+ }
12
15
  }
16
+
13
17
  }