@massimo-cassandro/minimo 0.3.6 → 0.4.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 (101) hide show
  1. package/README.md +1 -1
  2. package/design-tokens/alerts.minimo.tokens.jsonc +28 -0
  3. package/design-tokens/badge.minimo.tokens.jsonc +42 -0
  4. package/design-tokens/basic.minimo.tokens.jsonc +58 -0
  5. package/design-tokens/btn-close.minimo.tokens.jsonc +96 -0
  6. package/design-tokens/btn-primary.minimo.tokens.jsonc +96 -0
  7. package/design-tokens/btn.minimo.tokens.jsonc +196 -0
  8. package/design-tokens/color-accent.minimo.tokens.jsonc +18 -0
  9. package/design-tokens/color-neutral.minimo.tokens.jsonc +18 -0
  10. package/design-tokens/color-primary.minimo.tokens.jsonc +18 -0
  11. package/design-tokens/color-secondary.minimo.tokens.jsonc +18 -0
  12. package/design-tokens/components/recaptcha.minimo.tokens.jsonc +28 -0
  13. package/design-tokens/components/sf-macro.minimo.tokens.jsonc +66 -0
  14. package/design-tokens/components/spinner.minimo.tokens.jsonc +24 -0
  15. package/design-tokens/components/toast.minimo.tokens.jsonc +32 -0
  16. package/design-tokens/flex-grid.minimo.tokens.jsonc +24 -0
  17. package/design-tokens/form.minimo.tokens.jsonc +314 -0
  18. package/design-tokens/headings.minimo.tokens.jsonc +62 -0
  19. package/design-tokens/link.minimo.tokens.jsonc +44 -0
  20. package/design-tokens/radius.minimo.tokens.jsonc +42 -0
  21. package/design-tokens/recaptcha.minimo.tokens.jsonc +28 -0
  22. package/design-tokens/sf-macro.minimo.tokens.jsonc +66 -0
  23. package/design-tokens/simple-datatable.minimo.tokens.jsonc +51 -0
  24. package/design-tokens/size.minimo.tokens.jsonc +46 -0
  25. package/design-tokens/spinner.minimo.tokens.jsonc +24 -0
  26. package/design-tokens/status.minimo.tokens.jsonc +98 -0
  27. package/design-tokens/table.minimo.tokens.jsonc +64 -0
  28. package/design-tokens/toast.minimo.tokens.jsonc +32 -0
  29. package/design-tokens/typography.minimo.tokens.jsonc +102 -0
  30. package/design-tokens/utility.minimo.tokens.jsonc +14 -0
  31. package/design-tokens/web-components/simple-datatable.minimo.tokens.jsonc +51 -0
  32. package/design-tokens/z-index.minimo.tokens.jsonc +14 -0
  33. package/design-tokens-src/_readme.md +27 -0
  34. package/design-tokens-src/alerts.minimo.tokens.mjs +25 -0
  35. package/{src/design-tokens → design-tokens-src}/form.minimo.tokens.jsonc +11 -1
  36. package/design-tokens-src/size.minimo.tokens.jsonc +105 -0
  37. package/design-tokens-utilities/build-tokens-src/config.mjs +108 -0
  38. package/design-tokens-utilities/build-tokens-src/formats/css.mjs +201 -0
  39. package/design-tokens-utilities/build-tokens-src/formats/penpot.mjs +262 -0
  40. package/design-tokens-utilities/build-tokens-src/platforms.mjs +80 -0
  41. package/design-tokens-utilities/build-tokens-src/transforms.mjs +200 -0
  42. package/design-tokens-utilities/build-tokens.mjs +114 -0
  43. package/design-tokens-utilities/check-unresolved-custom-props.mjs +137 -0
  44. package/design-tokens-utilities/readme.md +185 -0
  45. package/design-tokens-utilities/tokens-config-sample.mjs +98 -0
  46. package/package.json +10 -6
  47. package/src/components/{overlay.js → overlay/overlay.js} +1 -1
  48. package/src/{css/dialog-content.css → components/popup-page/popup-page.css} +1 -1
  49. package/src/components/{dialog-content.js → popup-page/popup-page.js} +6 -4
  50. package/src/css/forms/form-group.css +1 -1
  51. package/src/css/forms/forms.css +13 -7
  52. package/src/custom-properties-default.css +8 -6
  53. package/src/icons/x.svg +1 -0
  54. package/src/web-components/simple-datatable/simple-datatable.js +2 -2
  55. package/src/web-components/simple-datatable/simple-datatable.module.css +3 -3
  56. package/src/web-components/simple-datatable/src/parse-cols.js +2 -2
  57. package/src/design-tokens/TODO.md +0 -2
  58. package/src/design-tokens/alerts.minimo.tokens.jsonc +0 -25
  59. package/src/design-tokens/size.minimo.tokens.jsonc +0 -101
  60. package/src/design-tokens-utilities/build-tokens.mjs +0 -503
  61. package/src/design-tokens-utilities/check-unresolved-custom-props.mjs +0 -131
  62. package/src/design-tokens-utilities/config-templates/tokens-config.mjs +0 -34
  63. package/src/design-tokens-utilities/readme.md +0 -12
  64. /package/{src/design-tokens → design-tokens-src}/badge.minimo.tokens.jsonc +0 -0
  65. /package/{src/design-tokens → design-tokens-src}/basic.minimo.tokens.jsonc +0 -0
  66. /package/{src/design-tokens → design-tokens-src}/btn-close.minimo.tokens.jsonc +0 -0
  67. /package/{src/design-tokens → design-tokens-src}/btn-primary.minimo.tokens.jsonc +0 -0
  68. /package/{src/design-tokens → design-tokens-src}/btn-secondary.minimo.tokens.jsonc +0 -0
  69. /package/{src/design-tokens → design-tokens-src}/btn.minimo.tokens.jsonc +0 -0
  70. /package/{src/design-tokens → design-tokens-src}/color-accent.minimo.tokens.jsonc +0 -0
  71. /package/{src/design-tokens → design-tokens-src}/color-neutral.minimo.tokens.jsonc +0 -0
  72. /package/{src/design-tokens → design-tokens-src}/color-primary.minimo.tokens.jsonc +0 -0
  73. /package/{src/design-tokens → design-tokens-src}/color-secondary.minimo.tokens.jsonc +0 -0
  74. /package/{src/components/recaptcha → design-tokens-src/components}/recaptcha.minimo.tokens.jsonc +0 -0
  75. /package/{src/components/sf-macro → design-tokens-src/components}/sf-macro.minimo.tokens.jsonc +0 -0
  76. /package/{src/components/spinner → design-tokens-src/components}/spinner.minimo.tokens.jsonc +0 -0
  77. /package/{src/components/toast → design-tokens-src/components}/toast.minimo.tokens.jsonc +0 -0
  78. /package/{src/design-tokens → design-tokens-src}/flex-grid.minimo.tokens.jsonc +0 -0
  79. /package/{src/design-tokens → design-tokens-src}/gradients-shadowes.minimo.tokens.jsonc +0 -0
  80. /package/{src/design-tokens → design-tokens-src}/headings.minimo.tokens.jsonc +0 -0
  81. /package/{src/design-tokens → design-tokens-src}/link.minimo.tokens.jsonc +0 -0
  82. /package/{src/design-tokens → design-tokens-src}/radius.minimo.tokens.jsonc +0 -0
  83. /package/{src/design-tokens → design-tokens-src}/status.minimo.tokens.jsonc +0 -0
  84. /package/{src/design-tokens → design-tokens-src}/table.minimo.tokens.jsonc +0 -0
  85. /package/{src/design-tokens → design-tokens-src}/typography.minimo.tokens.jsonc +0 -0
  86. /package/{src/design-tokens → design-tokens-src}/utility.minimo.tokens.jsonc +0 -0
  87. /package/{src/web-components/simple-datatable → design-tokens-src/web-components}/simple-datatable.minimo.tokens.jsonc +0 -0
  88. /package/{src/design-tokens → design-tokens-src}/z-index.minimo.tokens.jsonc +0 -0
  89. /package/src/{css → components/overlay}/overlay.css +0 -0
  90. /package/src/{web-components/simple-datatable/icons → icons}/arrow-down.svg +0 -0
  91. /package/src/{web-components/simple-datatable/icons → icons}/arrow-up.svg +0 -0
  92. /package/src/{web-components/simple-datatable/icons → icons}/arrows-down-up.svg +0 -0
  93. /package/src/{web-components/simple-datatable/icons → icons}/caret-left.svg +0 -0
  94. /package/src/{web-components/simple-datatable/icons → icons}/caret-right.svg +0 -0
  95. /package/src/{web-components/simple-datatable/icons → icons}/check-bold.svg +0 -0
  96. /package/src/{components/modal-alert/svg → icons}/check-circle-duotone.svg +0 -0
  97. /package/src/{components/modal-alert/svg → icons}/info-duotone.svg +0 -0
  98. /package/src/{components/modal-alert/svg → icons}/question-duotone.svg +0 -0
  99. /package/src/{components/modal-alert/svg → icons}/warning-duotone.svg +0 -0
  100. /package/src/{web-components/simple-datatable/icons → icons}/x-bold.svg +0 -0
  101. /package/src/{components/modal-alert/svg → icons}/x-circle-duotone.svg +0 -0
@@ -0,0 +1,185 @@
1
+ # Design Token Utilities
2
+
3
+ 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
+
5
+ ## Scripts
6
+
7
+ | Script | Purpose |
8
+ |---|---|
9
+ | `build-tokens.mjs` | Generates a CSS custom properties file from design token source files |
10
+ | `check-unresolved-custom-props.mjs` | Scans CSS files and reports any `var(--...)` references not found in the generated token file |
11
+
12
+ Both scripts share the same config file, passed via `--config`.
13
+
14
+ ## Setup
15
+
16
+ The scripts are intended to be used as npm scripts. Add them to your `package.json`:
17
+
18
+ ```json
19
+ {
20
+ "scripts": {
21
+ "build tokens": "npx buildTokens --config ./path/to/tokens-config.mjs",
22
+ "check unresolved props": "npx checkUnresolvedProps --config ./path/to/tokens-config.mjs"
23
+ }
24
+ }
25
+ ```
26
+
27
+ ### Dependencies
28
+
29
+ The following packages must be present in your project:
30
+
31
+ ```json
32
+ {
33
+ "style-dictionary": "^5",
34
+ "stylelint": "^16"
35
+ }
36
+ ```
37
+
38
+ ## Configuration file
39
+
40
+ Both scripts read a shared config file passed with `--config`. Use `tokens-config-sample.mjs` as a starting point.
41
+
42
+ Read comments inside the sample file for more info.
43
+
44
+
45
+ ## `build-tokens.mjs`
46
+
47
+ Reads design token source files and generates:
48
+ - A **CSS file** containing all tokens as custom properties inside `:root { ... }`
49
+ - Optionally, one or more **W3C DTCG JSON/JSONC** files to import into Penpot/Figma (use in Figma requires a plugin).
50
+
51
+ ### Usage
52
+
53
+ ```sh
54
+ npx buildTokens --config ./path/to/tokens-config.mjs
55
+ ```
56
+
57
+ ### Source files
58
+
59
+ The `source` array accepts any combination of:
60
+ - Concrete file paths: `'./tokens/colors.jsonc'`
61
+ - Glob patterns: `'./tokens/**/*.{json,jsonc,mjs}'`
62
+
63
+ **Supported formats:**
64
+ - `.json` / `.jsonc` — parsed directly as token data
65
+ - `.mjs` / `.js` — imported as ES modules; must export a W3C DTCG-compliant object as `default`
66
+
67
+
68
+ ### Token file format (JS example)
69
+
70
+ 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
+
72
+ ```js
73
+ // colors.tokens.mjs
74
+ export default {
75
+ color: {
76
+ brand: {
77
+ primary: { $type: 'color', $value: '#0057FF' },
78
+ secondary: { $type: 'color', $value: '#FF6B00' },
79
+ },
80
+ neutral: {
81
+ '100': { $type: 'color', $value: '#F5F5F5' },
82
+ '900': { $type: 'color', $value: '#1A1A1A' },
83
+ },
84
+ },
85
+ semantic: {
86
+ color: {
87
+ text: {
88
+ primary: { $type: 'color', $value: '{color.neutral.900}' }, // alias
89
+ },
90
+ },
91
+ },
92
+ };
93
+ ```
94
+
95
+ The main advantage of `.mjs` over `.json` is the ability to use JavaScript variables, comments, and computed values within the token definition.
96
+
97
+ Values can be expressions like `"{size.base} * .25"`, see `tokens-config-sample.mjs` for more info.
98
+
99
+ ### Custom transforms
100
+
101
+ The following transforms are registered on top of Style Dictionary's built-ins:
102
+
103
+ | Name | Type | Description |
104
+ |---|---|---|
105
+ | `shadow/css` | value | Converts shadow objects (single or array) to a `box-shadow` CSS string. px values are converted to rem. |
106
+ | `size/pxToRem-smart` | value | Converts `dimension` token values from px to rem. Skips values already in rem. |
107
+ | `color/css-modern` | value | Color passthrough with transitive alias support. |
108
+ | `gradient/css` | value | Converts gradient objects to CSS `linear-gradient`, `radial-gradient` or `conic-gradient`. |
109
+ | `composite/css` | value | Converts `border`, `outline`, `transition` and `animation` objects to their CSS shorthand. |
110
+ | `typography/css` | value | Typography passthrough — the format handles exploding the value into individual properties. |
111
+
112
+ ### CSS output
113
+
114
+ All tokens are output as CSS custom properties inside `:root`, sorted alphabetically.
115
+
116
+ Typography tokens are expanded into multiple properties:
117
+ - `--token-name-font` — a `font` shorthand (when both `fontSize` and `fontFamily` are present)
118
+ - `--token-name-letter-spacing`, `--token-name-text-transform`, `--token-name-text-decoration` — individual properties
119
+
120
+ The generated file is linted and auto-fixed with stylelint using the config specified in `stylelintConfigPath`.
121
+
122
+ ### Penpot output
123
+
124
+ 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
+
126
+ **Single file** (`penpotDestFile` is a string):
127
+ ```
128
+ penpotBuildPath/tokens.jsonc ← all tokens in one file
129
+ ```
130
+
131
+ **One file per source** (`penpotDestFile` is `null` or omitted):
132
+ ```
133
+ penpotBuildPath/colors.tokens.jsonc
134
+ penpotBuildPath/spacing.tokens.jsonc
135
+ penpotBuildPath/typography.tokens.jsonc
136
+ ```
137
+
138
+ The `penpotFormat` option controls the output:
139
+
140
+ | Value | Extension | Disclaimer header |
141
+ |---|---|---|
142
+ | `'jsonc'` | `.jsonc` | Yes |
143
+ | `'json'` | `.json` | No |
144
+
145
+ Alias references (`{color.brand.primary}`) are preserved in the output so Penpot maintains token links between primitive and semantic tokens.
146
+
147
+ > Penpot token files intentionally use a minimal set of transforms (no px→rem conversion, no shorthand expansion) because Penpot expects original values and structured objects, not resolved CSS strings.
148
+
149
+ ---
150
+
151
+ ## `check-unresolved-custom-props.mjs`
152
+
153
+ 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
+
155
+ Results are written to `unresolved-props.md` in the same directory as the config file.
156
+
157
+ ### Usage
158
+
159
+ ```sh
160
+ npx checkUnresolvedProps --config ./path/to/tokens-config.mjs
161
+ ```
162
+
163
+ ### Output
164
+
165
+ 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
+
167
+ ```markdown
168
+ * [components.css :: 42](../src/components.css#L42) -> var(--color-action-hover)
169
+ * [layout.css :: 17](../src/layout.css#L17) -> var(--spacing-missing)
170
+ ```
171
+
172
+ In VS Code, Option/Alt-clicking on the URL opens the file at the required line.
173
+
174
+
175
+ ### Excluding properties
176
+
177
+ Use `exclude_pattern` to suppress false positives — for example, internal/private custom properties that are defined dynamically or inline:
178
+
179
+ ```js
180
+ // skips all custom props starting with `--_` or `--js-`
181
+ exclude_pattern: [
182
+ /^--_/,
183
+ /^--js-/,
184
+ ]
185
+ ```
@@ -0,0 +1,98 @@
1
+ // tokens-config-sample.mjs
2
+ // Sample project config for build-tokens.mjs and check-unresolved-custom-props.mjs.
3
+ // Copy and adapt this file for each project; pass it via the --config flag.
4
+ //
5
+ // All paths are relative to this config file (not to the CWD).
6
+
7
+ // import { homedir } from 'os';
8
+ import path from 'path';
9
+
10
+ // Path to the design token source files.
11
+ // You can use an absolute path, a relative path, or build it programmatically.
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
+
16
+ // Alternative: pre-built JSONC files from the same package
17
+ // const minimo_path = '../../node_modules/@massimo-cassandro/minimo/design-tokens';
18
+
19
+ // For local testing
20
+ // const minimo_path = path.resolve(homedir(), 'Sites/minimo/src');
21
+
22
+ const config = {
23
+
24
+ // ---------------------------------------------------------------------------
25
+ // build-tokens.mjs settings
26
+ // ---------------------------------------------------------------------------
27
+
28
+ // Path to the stylelint config used to lint the generated CSS file
29
+ stylelintConfigPath: '../../stylelint.config.mjs',
30
+
31
+ // Output directory for the CSS file generated by Style Dictionary
32
+ buildPath: '../src/css',
33
+
34
+ // Output filename for the generated CSS file
35
+ destFile: 'custom-properties.css',
36
+
37
+ // Source token files — accepts paths, globs, or a mix of both.
38
+ // Supported formats: .json, .jsonc, .mjs (must export a DTCG-compliant default object)
39
+ //
40
+ // WARNING: do not use path.join() to build glob patterns — it may corrupt
41
+ // the pattern syntax. Use template literals instead:
42
+ // OK: `${minimo_path}/**/*.{json,mjs}`
43
+ // NO: path.join(minimo_path, '/**/*.{json,mjs}')
44
+ source: [
45
+ `${minimo_path}/**/*.{jsonc,json,mjs}`,
46
+ './project-tokens/*.jsonc',
47
+
48
+ // optional extra token source (in this example, openProps, https://open-props.style/)
49
+ // '../../node_modules/open-props/open-props.style-dictionary-tokens.json',
50
+ ],
51
+
52
+ // ---------------------------------------------------------------------------
53
+ // Optional design tokens output
54
+ // Generates one or more json(c) files in addition to the CSS output file, for use
55
+ // in Penpot or Figma projects or as an alternative to the .mjs source files
56
+ // ---------------------------------------------------------------------------
57
+ // Output format for Penpot token files: 'jsonc' or 'json'
58
+ // 'jsonc' -> adds a generated-file disclaimer header, uses .jsonc extension
59
+ // 'json' -> plain JSON, no disclaimer
60
+ penpotFormat: 'jsonc',
61
+
62
+ // Output directory for the Penpot design token files.
63
+ // Set to null (or omit) to disable json output entirely.
64
+ penpotBuildPath: './path/to/generated/design-tokens-dir',
65
+
66
+ // Base name (without extension) for the aggregated Penpot output file.
67
+ // The extension is added automatically based on penpotFormat.
68
+ // Set to null (or omit) to generate one file per .mjs source file instead.
69
+ penpotDestFile: 'tokens',
70
+
71
+ // How to handle math expressions in dimension token $values (e.g. "{size.base} * .25"):
72
+ // 'keep' write the expression unchanged
73
+ // 'calc' — wrap in CSS calc(): "calc({size.base} * .25)"
74
+ // 'resolve' — (default) evaluate numerically, inheriting the unit from the first referenced token
75
+ // e.g. {size.base} = 16px, "{size.base} * .25" -> "4px"
76
+ penpotExpressions: 'resolve',
77
+
78
+ // ---------------------------------------------------------------------------
79
+ // check-unresolved-custom-props.mjs settings
80
+ // ---------------------------------------------------------------------------
81
+
82
+ // Additional CSS files that define custom properties used in the project
83
+ // but not generated by build-tokens (e.g. third-party libraries)
84
+ extra_custom_props_files: [
85
+ // '../../node_modules/open-props/open-props.min.css'
86
+ ],
87
+
88
+ // Directory containing the CSS files to scan for unresolved custom properties
89
+ dir_to_check: '../../src',
90
+
91
+ // Regular expressions for custom property names to exclude from the check.
92
+ // Useful for intentionally private/internal props (e.g. prefixed with --_).
93
+ exclude_pattern: [
94
+ /^--_/,
95
+ ],
96
+ };
97
+
98
+ export default config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massimo-cassandro/minimo",
3
- "version": "0.3.6",
3
+ "version": "0.4.1",
4
4
  "description": "Light css framework",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/massimo-cassandro/minimo#readme",
@@ -8,8 +8,8 @@
8
8
  "url": "https://github.com/massimo-cassandro/minimo/issues"
9
9
  },
10
10
  "bin": {
11
- "buildTokens": "./src/design-tokens-utilities/build-tokens.mjs",
12
- "checkUnresolvedProps": "./src/design-tokens-utilities/check-unresolved-custom-props.mjs"
11
+ "buildTokens": "./design-tokens-utilities/build-tokens.mjs",
12
+ "checkUnresolvedProps": "./design-tokens-utilities/check-unresolved-custom-props.mjs"
13
13
  },
14
14
  "repository": {
15
15
  "type": "git",
@@ -19,8 +19,8 @@
19
19
  "UPD-version": "npx update-version # --config=./dev-utilities.config.mjs",
20
20
  "upd@m": "npx upd@m",
21
21
  "npm-publish": "npm publish",
22
- "build-tokens": "node ./src/design-tokens-utilities/build-tokens.mjs --config ./test/tokens-test/tokens-config.mjs",
23
- "check unresolved props": "node ./src/design-tokens-utilities/check-unresolved-custom-props.mjs --config ./test/tokens-test/tokens-config.mjs"
22
+ "build-tokens": "node ./design-tokens-utilities/build-tokens.mjs --config ./tokens-config.mjs",
23
+ "check unresolved props": "node ./design-tokens-utilities/check-unresolved-custom-props.mjs --config ./tokens-config.mjs"
24
24
  },
25
25
  "license": "MIT",
26
26
  "author": "Massimo Cassandro",
@@ -29,10 +29,14 @@
29
29
  },
30
30
  "main": "./src/index.js",
31
31
  "files": [
32
- "src/**/*.{js,mjs,css,svg,tokens.json,tokens.jsonc,md}"
32
+ "src/**/*.{js,mjs,css,svg,md}",
33
+ "design-tokens/**/*.{tokens.json,tokens.jsonc}",
34
+ "design-tokens-src/**/*.{tokens.json,tokens.jsonc,mjs,js,md}",
35
+ "design-tokens-utilities/**/*.{mjs,md}"
33
36
  ],
34
37
  "devDependencies": {
35
38
  "@massimo-cassandro/dev-updater": "^3.0.3",
39
+ "@massimo-cassandro/eslint-config": "^3.0.6",
36
40
  "@massimo-cassandro/stylelint-config": "^2.3.4",
37
41
  "style-dictionary": "^5.4.0"
38
42
  }
@@ -1,4 +1,4 @@
1
- // import './overlay.css'; incorporato nel css principale
1
+ import './overlay.css';
2
2
 
3
3
  export function overlay(context = document.body, scroll_lock = false) {
4
4
  context.insertAdjacentHTML('beforeend', '<div class="overlay"/>');
@@ -37,7 +37,7 @@
37
37
  aspect-ratio: 1;
38
38
  padding: 4px;
39
39
  background-color: var(--body-background-color);
40
- border: 1px solid var(--gray-4);
40
+ border: 1px solid var(--neutral-base);
41
41
  border-radius: 50%;
42
42
  box-shadow: var(--shadow-3);
43
43
 
@@ -1,6 +1,8 @@
1
- import './dialog-content.css';
2
- import x_icon from '@icone/x.svg?inline';
3
- import { spinner } from './spinner/spinner';
1
+ // TODO completare
2
+
3
+ import './popup-page.css';
4
+ import xIcon from '@icone/x.svg?inline';
5
+ import { spinner } from '../spinner/spinner';
4
6
  /**
5
7
  `indicator_class`: classe da aggiungere al wrapper per indicare in modo univoco il dialog
6
8
  */
@@ -9,7 +11,7 @@ export function content_dialog_markup(indicator_class) {
9
11
  return `<dialog class="${indicator_class} content-dialog">` +
10
12
  '<div class="content-dialog-inner">' +
11
13
  '<div class="content-dialog-close">' +
12
- `<button type="button" class="btn-reset content-dialog-close-btn" aria-label="Chiudi finestra">${x_icon}</button>` +
14
+ `<button type="button" class="btn-reset content-dialog-close-btn" aria-label="Chiudi finestra">${xIcon}</button>` +
13
15
  '</div>' +
14
16
  '<div class="content-dialog-body"></div>' +
15
17
  '</div>'+
@@ -11,7 +11,7 @@
11
11
  &:has(textarea) {
12
12
  height: 100%;
13
13
  }
14
-
14
+
15
15
  .grid & {
16
16
  padding-block-end: 0;
17
17
  }
@@ -4,7 +4,7 @@
4
4
  /* TODO classe grid specifica per i form ?? (.form-grid?) */
5
5
  /* TODO customizable select */
6
6
 
7
- .form-group:has([required]) .form-label {
7
+ .form-group:has([required]):not(:has([disabled])) .form-label {
8
8
  position: relative;
9
9
  padding-inline-start: var(--size-base);
10
10
  &::before {
@@ -45,17 +45,23 @@
45
45
  }
46
46
 
47
47
  &[disabled] {
48
- /* color: $form-select-disabled-color;
49
- background-color: $form-select-disabled-bg;
50
- border-color: $form-select-disabled-border-color; */
48
+ color: var(--form-control-disabled-color);
49
+ /* border-color: $form-select-disabled-border-color; */
51
50
  background-color: var(--form-control-disabled-background-color);
52
- /* opacity: .6; */
53
- &::placeholder {
54
- font-style: italic;
51
+ &, &::placeholder {
52
+ font-style: var(--form-control-disabled-font-style);
55
53
  }
56
54
  }
57
55
  }
58
56
 
57
+ .form-group:has([disabled]) {
58
+ opacity: var(--form-control-disabled-opacity);
59
+ .form-label {
60
+ font-style: var(--form-control-disabled-font-style);
61
+ color: var(--form-control-disabled-color);
62
+ }
63
+ }
64
+
59
65
  .form-control, .form-control-static {
60
66
 
61
67
  padding: var(--form-control-padding-block) var(--form-control-padding-inline);
@@ -44,16 +44,16 @@
44
44
  --btn-md-padding-inline: var(--size-sm);
45
45
  --btn-padding-block: var(--size-xs);
46
46
  --btn-padding-inline: var(--size-base);
47
- --btn-primary-active-background-color: color-mix(in srgb, var(--btn-primary-background-color) 60%, #000);
47
+ --btn-primary-active-background-color: calc(color-mix(in srgb, var(--btn-primary-background-color) 60%, #000) ;);
48
48
  --btn-primary-active-border-color: var(--btn-primary-active-background-color);
49
49
  --btn-primary-active-color: var(--btn-primary-color);
50
50
  --btn-primary-background-color: var(--primary-base);
51
51
  --btn-primary-border-color: var(--btn-primary-background-color);
52
52
  --btn-primary-color: var(--primary-on-base);
53
- --btn-primary-focus-outline-color: color-mix(in srgb, var(--btn-primary-background-color) 60%, transparent);
53
+ --btn-primary-focus-outline-color: calc(color-mix(in srgb, var(--btn-primary-background-color) 60%, transparent) ;);
54
54
  --btn-primary-hollow-background-color: var(--btn-primary-color);
55
55
  --btn-primary-hollow-color: var(--btn-primary-background-color);
56
- --btn-primary-hollow-hover-background-color: color-mix(in srgb, var(--btn-primary-hollow-color) 20%, transparent);
56
+ --btn-primary-hollow-hover-background-color: calc(color-mix(in srgb, var(--btn-primary-hollow-color) 20%, transparent) ;);
57
57
  --btn-primary-hollow-hover-color: var(--btn-primary-hollow-color);
58
58
  --btn-primary-hover-background-color: var(--btn-primary-color);
59
59
  --btn-primary-hover-border-color: var(--btn-primary-hover-color);
@@ -96,7 +96,9 @@
96
96
  --form-control-border-color: #666;
97
97
  --form-control-border-radius: var(--radius-xxs);
98
98
  --form-control-border-width: .0625rem;
99
- --form-control-disabled-background-color: #999;
99
+ --form-control-disabled-background-color: #ddd;
100
+ --form-control-disabled-color: #999;
101
+ --form-control-disabled-font-style: italic;
100
102
  --form-control-disabled-opacity: .3;
101
103
  --form-control-focus-color: hsl(205 69% 45% / .508);
102
104
  --form-control-focus-outline-width: .25rem;
@@ -181,7 +183,7 @@
181
183
  --sdt-pagination-border: var(--btn-border-width) var(--neutral-base);
182
184
  --sdt-pagination-padding-block: var(--size-xxs);
183
185
  --sdt-pagination-padding-inline: var(--size-xs);
184
- --sdt-thead-hover-background-color: color-mix(in srgb, var(--table-thead-background-color) 90%, var(--accent-base));
186
+ --sdt-thead-hover-background-color: calc(color-mix(in srgb, var(--table-thead-background-color) 90%, var(--accent-base)));
185
187
  --secondary-base: #650853;
186
188
  --secondary-on-base: #fff;
187
189
  --sf-macro-btn-close-background-color: var(--body-background-color);
@@ -189,7 +191,7 @@
189
191
  --sf-macro-rows-border: 1px solid var(--neutral-base);
190
192
  --sf-macro-rows-border-radius: var(--radius-xs);
191
193
  --sf-macro-rows-even-background-color: var(--body-background-color);
192
- --sf-macro-rows-hover-background-color: color-mix(in srgb, var(--body-background-color) 95%, #000);
194
+ --sf-macro-rows-hover-background-color: calc(color-mix(in srgb, var(--body-background-color) 95%, #000));
193
195
  --sf-macro-rows-margin-block-end: var(--size-base);
194
196
  --sf-macro-rows-padding: var(--size-xs);
195
197
  --size-2xl: 3rem;
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path></svg>
@@ -6,8 +6,8 @@ import { parseCols } from './src/parse-cols.js';
6
6
 
7
7
  import * as styles from './simple-datatable.module.css';
8
8
 
9
- import caretLeftIcon from './icons/caret-left.svg?inline';
10
- import caretRightIcon from './icons/caret-right.svg?inline';
9
+ import caretLeftIcon from '../../icons/caret-left.svg?inline';
10
+ import caretRightIcon from '../../icons/caret-right.svg?inline';
11
11
 
12
12
  // TODO possibilità di definizione cols anche da js. In questo caso, in presenza ANCHE dell'attributo, deve prevalere quest'ultimo
13
13
 
@@ -80,19 +80,19 @@
80
80
 
81
81
  &:not(.sortAscending):not(.sortDescending){
82
82
  .sortBtn::after {
83
- content: url('./icons/arrows-down-up.svg?cssInline');
83
+ content: url('../../icons/arrows-down-up.svg?cssInline');
84
84
  opacity: .4;
85
85
  }
86
86
  }
87
87
  }
88
88
  .sortAscending {
89
89
  .sortBtn::after {
90
- content: url('./icons/arrow-up.svg?cssInline');
90
+ content: url('../../icons/arrow-up.svg?cssInline');
91
91
  }
92
92
  }
93
93
  .sortDescending {
94
94
  .sortBtn::after {
95
- content: url('./icons/arrow-down.svg?cssInline');
95
+ content: url('../../icons/arrow-down.svg?cssInline');
96
96
  }
97
97
  }
98
98
 
@@ -6,8 +6,8 @@ import { classnames } from '@massimo-cassandro/js-utilities/index.js';
6
6
 
7
7
  import * as styles from '../simple-datatable.module.css';
8
8
 
9
- import checkIcon from '../icons/check-bold.svg?inline';
10
- import xIcon from '../icons/x-bold.svg?inline';
9
+ import checkIcon from '../../../icons/check-bold.svg?inline';
10
+ import xIcon from '../../../icons/x-bold.svg?inline';
11
11
 
12
12
  // col_obj è l'oggetto che descrive una singola colonna del datatable
13
13
  // vine utilizzato per produrre l'oggetto columns di simple-datatable
@@ -1,2 +0,0 @@
1
- * conversione in js?
2
- * automatizzare la creazione di proprietà ricorrenti (es il padding)
@@ -1,25 +0,0 @@
1
- {
2
- "alert": {
3
- "border": {
4
- "radius": {
5
- "$value": "{radius.sm}",
6
- "$type": "dimension"
7
- },
8
- },
9
-
10
- "box-shadow": {
11
- // "$type": "string",
12
- // "$value": "none"
13
- "$type": "shadow",
14
- "$value": [
15
- {
16
- "offsetX": 0,
17
- "offsetY": 0,
18
- "blur": "8px",
19
- "spread": 0,
20
- "color": "oklch(0 0 0 / 0.5)"
21
- }
22
- ]
23
- }
24
- }
25
- }
@@ -1,101 +0,0 @@
1
- {
2
-
3
-
4
- // in attesa di modifica dello script per il parser automatico delle espressioni
5
- // NB: "$type": "string" necessario, dimension converte i valori come se fossero px
6
- "size": {
7
- "xs": {
8
- "$value": ".5rem",
9
- "$type": "dimension",
10
- "$description": ""
11
- },
12
- "md": {
13
- "$value": "1.2rem",
14
- "$type": "dimension",
15
- "$description": ""
16
- },
17
- "3xl": {
18
- "$value": "4rem",
19
- "$type": "dimension",
20
- "$description": ""
21
- },
22
- "2xl": {
23
- "$value": "3rem",
24
- "$type": "dimension",
25
- "$description": ""
26
- },
27
- "base": {
28
- "$value": "1rem",
29
- "$type": "dimension",
30
- "$description": ""
31
- },
32
- "lg": {
33
- "$value": "1.5rem",
34
- "$type": "dimension",
35
- "$description": ""
36
- },
37
- "xxs": {
38
- "$value": ".25rem",
39
- "$type": "dimension",
40
- "$description": ""
41
- },
42
- "xl": {
43
- "$value": "2rem",
44
- "$type": "dimension",
45
- "$description": ""
46
- },
47
- "sm": {
48
- "$value": ".75rem",
49
- "$type": "dimension",
50
- "$description": ""
51
- }
52
- },
53
-
54
- // "size": {
55
- // "xxs": {
56
- // "$value": "{size.base} * .25",
57
- // "$type": "dimension",
58
- // "$description": ""
59
- // },
60
- // "xs": {
61
- // "$value": "{size.base} * .5",
62
- // "$type": "dimension",
63
- // "$description": ""
64
- // },
65
- // "sm": {
66
- // "$value": "{size.base} * .75",
67
- // "$type": "dimension",
68
- // "$description": ""
69
- // },
70
- // "base": {
71
- // "$value": "1rem",
72
- // "$type": "dimension",
73
- // "$description": ""
74
- // },
75
- // "md": {
76
- // "$value": "{size.base} * 1.2",
77
- // "$type": "dimension",
78
- // "$description": ""
79
- // },
80
- // "lg": {
81
- // "$value": "{size.base} * 1.5",
82
- // "$type": "dimension",
83
- // "$description": ""
84
- // },
85
- // "xl": {
86
- // "$value": "{size.base} * 2",
87
- // "$type": "dimension",
88
- // "$description": ""
89
- // },
90
- // "2xl": {
91
- // "$value": "{size.base} * 3",
92
- // "$type": "dimension",
93
- // "$description": ""
94
- // },
95
- // "3xl": {
96
- // "$value": "{size.base} * 4",
97
- // "$type": "dimension",
98
- // "$description": ""
99
- // }
100
- // }
101
- }