@massimo-cassandro/minimo 0.3.5 → 0.4.0
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.
- package/README.md +1 -1
- package/design-tokens/alerts.minimo.tokens.jsonc +28 -0
- package/design-tokens/badge.minimo.tokens.jsonc +42 -0
- package/design-tokens/basic.minimo.tokens.jsonc +58 -0
- package/design-tokens/btn-close.minimo.tokens.jsonc +96 -0
- package/design-tokens/btn-primary.minimo.tokens.jsonc +96 -0
- package/design-tokens/btn.minimo.tokens.jsonc +196 -0
- package/design-tokens/color-accent.minimo.tokens.jsonc +18 -0
- package/design-tokens/color-neutral.minimo.tokens.jsonc +18 -0
- package/design-tokens/color-primary.minimo.tokens.jsonc +18 -0
- package/design-tokens/color-secondary.minimo.tokens.jsonc +18 -0
- package/design-tokens/components/recaptcha.minimo.tokens.jsonc +28 -0
- package/design-tokens/components/sf-macro.minimo.tokens.jsonc +66 -0
- package/design-tokens/components/spinner.minimo.tokens.jsonc +24 -0
- package/design-tokens/components/toast.minimo.tokens.jsonc +32 -0
- package/design-tokens/flex-grid.minimo.tokens.jsonc +24 -0
- package/design-tokens/form.minimo.tokens.jsonc +304 -0
- package/design-tokens/headings.minimo.tokens.jsonc +62 -0
- package/design-tokens/link.minimo.tokens.jsonc +44 -0
- package/design-tokens/radius.minimo.tokens.jsonc +42 -0
- package/design-tokens/recaptcha.minimo.tokens.jsonc +28 -0
- package/design-tokens/sf-macro.minimo.tokens.jsonc +66 -0
- package/design-tokens/simple-datatable.minimo.tokens.jsonc +51 -0
- package/design-tokens/size.minimo.tokens.jsonc +46 -0
- package/design-tokens/spinner.minimo.tokens.jsonc +24 -0
- package/design-tokens/status.minimo.tokens.jsonc +98 -0
- package/design-tokens/table.minimo.tokens.jsonc +64 -0
- package/design-tokens/toast.minimo.tokens.jsonc +32 -0
- package/design-tokens/typography.minimo.tokens.jsonc +102 -0
- package/design-tokens/utility.minimo.tokens.jsonc +14 -0
- package/design-tokens/web-components/simple-datatable.minimo.tokens.jsonc +51 -0
- package/design-tokens/z-index.minimo.tokens.jsonc +14 -0
- package/design-tokens-src/_readme.md +27 -0
- package/design-tokens-src/alerts.minimo.tokens.mjs +25 -0
- package/design-tokens-src/components/sf-macro.minimo.tokens.jsonc +66 -0
- package/{src/design-tokens → design-tokens-src}/form.minimo.tokens.jsonc +9 -8
- package/design-tokens-src/size.minimo.tokens.jsonc +105 -0
- package/design-tokens-utilities/build-tokens-src/config.mjs +108 -0
- package/design-tokens-utilities/build-tokens-src/formats/css.mjs +201 -0
- package/design-tokens-utilities/build-tokens-src/formats/penpot.mjs +262 -0
- package/design-tokens-utilities/build-tokens-src/platforms.mjs +80 -0
- package/design-tokens-utilities/build-tokens-src/transforms.mjs +200 -0
- package/design-tokens-utilities/build-tokens.mjs +114 -0
- package/design-tokens-utilities/check-unresolved-custom-props.mjs +137 -0
- package/design-tokens-utilities/readme.md +185 -0
- package/design-tokens-utilities/tokens-config-sample.mjs +98 -0
- package/package.json +10 -6
- package/src/components/auto-datatable/auto-datatable.css +4 -4
- package/src/components/modal-alert/modal-alert.css +5 -5
- package/src/components/{overlay.js → overlay/overlay.js} +1 -1
- package/src/{css/dialog-content.css → components/popup-page/popup-page.css} +1 -1
- package/src/components/{dialog-content.js → popup-page/popup-page.js} +6 -4
- package/src/components/sf-macro/sf-macro.css +7 -14
- package/src/css/alerts.css +3 -3
- package/src/css/buttons/status-buttons.css +4 -4
- package/src/css/forms/fieldset.css +2 -2
- package/src/custom-properties-default.css +24 -12
- package/src/icons/x.svg +1 -0
- package/src/web-components/simple-datatable/simple-datatable.js +2 -2
- package/src/web-components/simple-datatable/simple-datatable.module.css +3 -3
- package/src/web-components/simple-datatable/src/parse-cols.js +2 -2
- package/src/design-tokens/TODO.md +0 -2
- package/src/design-tokens/alerts.minimo.tokens.jsonc +0 -25
- package/src/design-tokens/size.minimo.tokens.jsonc +0 -101
- package/src/design-tokens-utilities/build-tokens.mjs +0 -503
- package/src/design-tokens-utilities/check-unresolved-custom-props.mjs +0 -131
- package/src/design-tokens-utilities/config-templates/tokens-config.mjs +0 -34
- package/src/design-tokens-utilities/readme.md +0 -12
- /package/{src/design-tokens → design-tokens-src}/badge.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/basic.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/btn-close.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/btn-primary.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/btn-secondary.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/btn.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/color-accent.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/color-neutral.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/color-primary.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/color-secondary.minimo.tokens.jsonc +0 -0
- /package/{src/components/recaptcha → design-tokens-src/components}/recaptcha.minimo.tokens.jsonc +0 -0
- /package/{src/components/spinner → design-tokens-src/components}/spinner.minimo.tokens.jsonc +0 -0
- /package/{src/components/toast → design-tokens-src/components}/toast.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/flex-grid.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/gradients-shadowes.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/headings.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/link.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/radius.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/status.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/table.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/typography.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/utility.minimo.tokens.jsonc +0 -0
- /package/{src/web-components/simple-datatable → design-tokens-src/web-components}/simple-datatable.minimo.tokens.jsonc +0 -0
- /package/{src/design-tokens → design-tokens-src}/z-index.minimo.tokens.jsonc +0 -0
- /package/src/{css → components/overlay}/overlay.css +0 -0
- /package/src/{web-components/simple-datatable/icons → icons}/arrow-down.svg +0 -0
- /package/src/{web-components/simple-datatable/icons → icons}/arrow-up.svg +0 -0
- /package/src/{web-components/simple-datatable/icons → icons}/arrows-down-up.svg +0 -0
- /package/src/{web-components/simple-datatable/icons → icons}/caret-left.svg +0 -0
- /package/src/{web-components/simple-datatable/icons → icons}/caret-right.svg +0 -0
- /package/src/{web-components/simple-datatable/icons → icons}/check-bold.svg +0 -0
- /package/src/{components/modal-alert/svg → icons}/check-circle-duotone.svg +0 -0
- /package/src/{components/modal-alert/svg → icons}/info-duotone.svg +0 -0
- /package/src/{components/modal-alert/svg → icons}/question-duotone.svg +0 -0
- /package/src/{components/modal-alert/svg → icons}/warning-duotone.svg +0 -0
- /package/src/{web-components/simple-datatable/icons → icons}/x-bold.svg +0 -0
- /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
|
+
"version": "0.4.0",
|
|
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": "./
|
|
12
|
-
"checkUnresolvedProps": "./
|
|
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 ./
|
|
23
|
-
"check unresolved props": "node ./
|
|
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,
|
|
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
|
}
|
|
@@ -144,9 +144,9 @@
|
|
|
144
144
|
|
|
145
145
|
/* animation-timeline: scroll(self);
|
|
146
146
|
animation: detect-scroll linear;
|
|
147
|
-
--
|
|
148
|
-
--
|
|
149
|
-
background: var(--
|
|
147
|
+
--_bg-if-can-scroll: var(--_can-scroll) lime;
|
|
148
|
+
--_bg-if-cant-scroll: red;
|
|
149
|
+
background: var(--_bg-if-can-scroll, var(--_bg-if-cant-scroll)); */
|
|
150
150
|
|
|
151
151
|
|
|
152
152
|
.table thead th {
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
/*
|
|
208
208
|
@keyframes detect-scroll {
|
|
209
209
|
from, to {
|
|
210
|
-
--
|
|
210
|
+
--_can-scroll:;
|
|
211
211
|
}
|
|
212
212
|
} */
|
|
213
213
|
|
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
|
|
6
6
|
.modal-alert {
|
|
7
7
|
--malert-success-color: var(--status-success-color);
|
|
8
|
-
--malert-success-color-fg: var(--status-success-
|
|
8
|
+
--malert-success-color-fg: var(--status-success-foreground);
|
|
9
9
|
|
|
10
10
|
--malert-info-color: var(--status-info-color);
|
|
11
|
-
--malert-info-color-fg: var(--status-info-
|
|
11
|
+
--malert-info-color-fg: var(--status-info-foreground);
|
|
12
12
|
|
|
13
13
|
--malert-warning-color: var(--status-warning-color);
|
|
14
|
-
--malert-warning-color-fg: var(--status-warning-
|
|
14
|
+
--malert-warning-color-fg: var(--status-warning-foreground);
|
|
15
15
|
|
|
16
16
|
--malert-error-color: var(--status-danger-color);
|
|
17
|
-
--malert-error-color-fg: var(--status-danger-
|
|
17
|
+
--malert-error-color-fg: var(--status-danger-foreground);
|
|
18
18
|
|
|
19
19
|
--malert-confirm-color: var(--status-warning-color);
|
|
20
|
-
--malert-confirm-color-fg: var(--status-warning-
|
|
20
|
+
--malert-confirm-color-fg: var(--status-warning-foreground);
|
|
21
21
|
|
|
22
22
|
/* --malert-marks-stroke-width: 6px; */
|
|
23
23
|
--malert-backdrop: rgb(0 0 0 / .3);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
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">${
|
|
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>'+
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
.sf-macro-wrapper {
|
|
3
|
-
--sf-macro-rows-padding: .5rem;
|
|
4
|
-
--sf-macro-rows-margin-bottom: 1rem;
|
|
5
|
-
--sf-macro-rows-border-radius: .4rem;
|
|
6
|
-
--sf-macro-rows-hover-bg-color: color-mix(in srgb, var(--body-bg-color) 95%, #000);
|
|
7
|
-
--sf-macro-even-rows-bg-color: var(--body-bg-color); /* rgb(0 0 0 / .05); */
|
|
8
|
-
--sf-macro-rows-border: 1px solid var(--stone-5);
|
|
9
|
-
--sf-macro-close-btn-size: 2rem;
|
|
10
3
|
|
|
11
4
|
|
|
12
5
|
/* etichette campi righe successive alla prima */
|
|
13
|
-
@media (--
|
|
6
|
+
@media (--media-large-viewport-up) {
|
|
14
7
|
&:not(.always-show-labels) {
|
|
15
8
|
.sf-macro-riga {
|
|
16
9
|
&:not(:first-child) {
|
|
@@ -41,17 +34,17 @@
|
|
|
41
34
|
.sf-macro-riga {
|
|
42
35
|
position: relative;
|
|
43
36
|
padding: var(--sf-macro-rows-padding);
|
|
44
|
-
margin-bottom: var(--sf-macro-rows-margin-
|
|
37
|
+
margin-bottom: var(--sf-macro-rows-margin-block-end);
|
|
45
38
|
border: var(--sf-macro-rows-border);
|
|
46
39
|
border-radius: var(--sf-macro-rows-border-radius);
|
|
47
40
|
|
|
48
41
|
&:nth-child(even) {
|
|
49
|
-
background-color: var(--sf-macro-even-
|
|
42
|
+
background-color: var(--sf-macro-rows-even-background-color);
|
|
50
43
|
}
|
|
51
44
|
|
|
52
45
|
|
|
53
46
|
&:hover {
|
|
54
|
-
background-color: var(--sf-macro-rows-hover-
|
|
47
|
+
background-color: var(--sf-macro-rows-hover-background-color);
|
|
55
48
|
}
|
|
56
49
|
|
|
57
50
|
.form-group {
|
|
@@ -75,11 +68,11 @@
|
|
|
75
68
|
right: -.5rem;
|
|
76
69
|
z-index: 1;
|
|
77
70
|
display: block;
|
|
78
|
-
width: var(--sf-macro-close-
|
|
79
|
-
height: var(--sf-macro-close-
|
|
71
|
+
width: var(--sf-macro-btn-close-size);
|
|
72
|
+
height: var(--sf-macro-btn-close-size);
|
|
80
73
|
padding: 1px;
|
|
81
74
|
color: currentColor;
|
|
82
|
-
background-color: var(--
|
|
75
|
+
background-color: var(--sf-macro-btn-close-background-color);
|
|
83
76
|
border-radius: 50%;
|
|
84
77
|
|
|
85
78
|
|
package/src/css/alerts.css
CHANGED
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
|
|
34
34
|
&.alert-warning, &.alert-notice {
|
|
35
35
|
--_alert-bg-color: var(--status-warning-color);
|
|
36
|
-
--_alert-fg-color: var(--status-warning-
|
|
36
|
+
--_alert-fg-color: var(--status-warning-foreground);
|
|
37
37
|
--_alert-border-color: var(--status-warning-border-color);
|
|
38
38
|
}
|
|
39
39
|
&.alert-info {
|
|
40
40
|
--_alert-bg-color: var(--status-info-color);
|
|
41
|
-
--_alert-fg-color: var(--status-info-
|
|
41
|
+
--_alert-fg-color: var(--status-info-foreground);
|
|
42
42
|
--_alert-border-color: var(--status-info-border-color);
|
|
43
43
|
}
|
|
44
44
|
&.alert-success {
|
|
45
45
|
--_alert-bg-color: var(--status-success-color);
|
|
46
|
-
--_alert-fg-color: var(--status-success-
|
|
46
|
+
--_alert-fg-color: var(--status-success-foreground);
|
|
47
47
|
--_alert-border-color: var(--status-success-border-color);
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
&.btn-success {
|
|
4
4
|
--_bg: var(--status-success-color);
|
|
5
|
-
--_fg: var(--status-success-
|
|
5
|
+
--_fg: var(--status-success-foreground);
|
|
6
6
|
--_btn-bg-color: var(--_bg);
|
|
7
7
|
--_btn-fg-color: var(--_fg);
|
|
8
8
|
--_btn-border-color: var(--status-success-border-color);
|
|
9
9
|
}
|
|
10
10
|
&.btn-info {
|
|
11
11
|
--_bg: var(--status-info-color);
|
|
12
|
-
--_fg: var(--status-info-
|
|
12
|
+
--_fg: var(--status-info-foreground);
|
|
13
13
|
--_btn-bg-color: var(--_bg);
|
|
14
14
|
--_btn-fg-color: var(--_fg);
|
|
15
15
|
--_btn-border-color: var(--status-info-border-color);
|
|
16
16
|
}
|
|
17
17
|
&.btn-danger, &.btn-error {
|
|
18
18
|
--_bg: var(--status-danger-color);
|
|
19
|
-
--_fg: var(--status-danger-
|
|
19
|
+
--_fg: var(--status-danger-foreground);
|
|
20
20
|
--_btn-bg-color: var(--_bg);
|
|
21
21
|
--_btn-fg-color: var(--_fg);
|
|
22
22
|
--_btn-border-color: var(--status-danger-border-color);
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
&.btn-warning {
|
|
27
27
|
--_bg: var(--status-warning-color);
|
|
28
|
-
--_fg: var(--status-warning-
|
|
28
|
+
--_fg: var(--status-warning-foreground);
|
|
29
29
|
--_btn-bg-color: var(--_bg);
|
|
30
30
|
--_btn-fg-color: var(--_fg);
|
|
31
31
|
--_btn-border-color: var(--status-warning-border-color);
|
|
@@ -44,8 +44,8 @@ fieldset.form-group, fieldset.form-collection-fset {
|
|
|
44
44
|
font-size: .9rem;
|
|
45
45
|
font-weight: var(--font-weight-semibold);
|
|
46
46
|
line-height: 1.2;
|
|
47
|
-
color: var(--form-
|
|
48
|
-
background-color: var(--form-
|
|
47
|
+
color: var(--form-legend-color);
|
|
48
|
+
background-color: var(--form-legend-background-color);
|
|
49
49
|
border-radius: var(--btn-border-radius) var(--btn-border-radius) var(--btn-border-radius) 0;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--accent-base: #567d0d;
|
|
3
3
|
--accent-on-base: #fff;
|
|
4
|
-
--alert-border-radius: var(--radius-
|
|
5
|
-
--alert-
|
|
4
|
+
--alert-border-radius: var(--radius-sm);
|
|
5
|
+
--alert-box-shadow: 0 0 .5rem 0 oklch(0% 0 0 / .5);
|
|
6
6
|
--badge-background-color: var(--primary-base);
|
|
7
7
|
--badge-color: var(--primary-on-base);
|
|
8
8
|
--badge-font-size: var(--font-size-xs);
|
|
@@ -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);
|
|
@@ -134,13 +134,13 @@
|
|
|
134
134
|
--form-end-margin-block-end: var(--size-base);
|
|
135
135
|
--form-end-margin-block-start: var(--size-base);
|
|
136
136
|
--form-fieldset-border-width: .0625rem;
|
|
137
|
-
--form-fieldset-legend-background-color: transparent;
|
|
138
|
-
--form-fieldset-legend-color: var(--text-color);
|
|
139
137
|
--form-group-padding-block: 0 var(--size-base);
|
|
140
138
|
--form-input-group-background-color: transparent;
|
|
141
139
|
--form-label-color: var(--text-color);
|
|
142
140
|
--form-label-font-size: var(--font-size-sm);
|
|
143
141
|
--form-label-font-weight: var(--font-weight-semibold);
|
|
142
|
+
--form-legend-background-color: transparent;
|
|
143
|
+
--form-legend-color: var(--text-color);
|
|
144
144
|
--form-user-info-color: var(--text-muted);
|
|
145
145
|
--form-user-info-font-size: var(--font-size-xs);
|
|
146
146
|
--grid-cols: 3;
|
|
@@ -181,9 +181,17 @@
|
|
|
181
181
|
--sdt-pagination-border: var(--btn-border-width) var(--neutral-base);
|
|
182
182
|
--sdt-pagination-padding-block: var(--size-xxs);
|
|
183
183
|
--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));
|
|
184
|
+
--sdt-thead-hover-background-color: calc(color-mix(in srgb, var(--table-thead-background-color) 90%, var(--accent-base)));
|
|
185
185
|
--secondary-base: #650853;
|
|
186
186
|
--secondary-on-base: #fff;
|
|
187
|
+
--sf-macro-btn-close-background-color: var(--body-background-color);
|
|
188
|
+
--sf-macro-btn-close-size: 2rem;
|
|
189
|
+
--sf-macro-rows-border: 1px solid var(--neutral-base);
|
|
190
|
+
--sf-macro-rows-border-radius: var(--radius-xs);
|
|
191
|
+
--sf-macro-rows-even-background-color: var(--body-background-color);
|
|
192
|
+
--sf-macro-rows-hover-background-color: calc(color-mix(in srgb, var(--body-background-color) 95%, #000));
|
|
193
|
+
--sf-macro-rows-margin-block-end: var(--size-base);
|
|
194
|
+
--sf-macro-rows-padding: var(--size-xs);
|
|
187
195
|
--size-2xl: 3rem;
|
|
188
196
|
--size-3xl: 4rem;
|
|
189
197
|
--size-base: 1rem;
|
|
@@ -196,18 +204,22 @@
|
|
|
196
204
|
--spinner-color: var(--primary-base);
|
|
197
205
|
--spinner-size: var(--size-lg);
|
|
198
206
|
--spinner-stroke-width: .125rem;
|
|
207
|
+
--status-danger-background-color: var(--status-danger-color);
|
|
199
208
|
--status-danger-border-color: var(--status-danger-color);
|
|
200
209
|
--status-danger-color: #c00;
|
|
201
|
-
--status-danger-
|
|
210
|
+
--status-danger-foreground: #fff;
|
|
211
|
+
--status-info-background-color: var(--status-info-color);
|
|
202
212
|
--status-info-border-color: var(--status-info-color);
|
|
203
213
|
--status-info-color: #0665c5;
|
|
204
|
-
--status-info-
|
|
214
|
+
--status-info-foreground: #fff;
|
|
215
|
+
--status-success-background-color: var(--status-success-color);
|
|
205
216
|
--status-success-border-color: var(--status-success-color);
|
|
206
217
|
--status-success-color: #046d19;
|
|
207
|
-
--status-success-
|
|
218
|
+
--status-success-foreground: #fff;
|
|
219
|
+
--status-warning-background-color: var(--status-warning-color);
|
|
208
220
|
--status-warning-border-color: var(--status-warning-color);
|
|
209
221
|
--status-warning-color: #fc0;
|
|
210
|
-
--status-warning-
|
|
222
|
+
--status-warning-foreground: #4f2900;
|
|
211
223
|
--table-body-border-width: .0625rem;
|
|
212
224
|
--table-body-tr-alt-bg-color: #efefef;
|
|
213
225
|
--table-body-tr-hover-bg-color: #cbcbcb;
|
package/src/icons/x.svg
ADDED
|
@@ -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 '
|
|
10
|
-
import caretRightIcon from '
|
|
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
|
|