@massimo-cassandro/minimo 0.5.2 → 0.5.4
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.
|
@@ -147,9 +147,32 @@ StyleDictionary.registerFormat({
|
|
|
147
147
|
|
|
148
148
|
const resolveRefs = makeResolveRefs(tokenByPath);
|
|
149
149
|
|
|
150
|
+
const sequenceList = [
|
|
151
|
+
'xxs', 'xs', 'sm', 'base', 'md', 'lg', 'xl', 'xxl', 'xxxl', '2xl', '3xl',
|
|
152
|
+
'xlight', 'light', 'regular', 'medium', 'semibold', 'bold', 'xbold'
|
|
153
|
+
]
|
|
154
|
+
|
|
155
|
+
const sortFunction = (a, b) => {
|
|
156
|
+
const idxA = sequenceList.indexOf(a.name);
|
|
157
|
+
const idxB = sequenceList.indexOf(b.name);
|
|
158
|
+
|
|
159
|
+
// Entrambi nella lista → ordine arbitrario
|
|
160
|
+
if (idxA !== -1 && idxB !== -1) return idxA - idxB;
|
|
161
|
+
|
|
162
|
+
// Solo A nella lista → A viene prima
|
|
163
|
+
if (idxA !== -1) return -1;
|
|
164
|
+
|
|
165
|
+
// Solo B nella lista → B viene prima
|
|
166
|
+
if (idxB !== -1) return 1;
|
|
167
|
+
|
|
168
|
+
// Nessuno nella lista → ordine alfabetico
|
|
169
|
+
return a.name.localeCompare(b.name, 'en', { numeric: true, sensitivity: 'base' });
|
|
170
|
+
};
|
|
171
|
+
|
|
150
172
|
const lines = dictionary.allTokens
|
|
151
173
|
.slice()
|
|
152
|
-
.sort((a, b) => a.name.localeCompare(b.name, 'en', {numeric: true, sensitivity: 'base'}))
|
|
174
|
+
// .sort((a, b) => a.name.localeCompare(b.name, 'en', {numeric: true, sensitivity: 'base'}))
|
|
175
|
+
.sort((a, b) => sortFunction(a,b))
|
|
153
176
|
.flatMap((token) => {
|
|
154
177
|
const type = token.$type ?? token.type;
|
|
155
178
|
const orig = token.original?.$value ?? token.original?.value;
|
package/package.json
CHANGED
|
@@ -23,7 +23,7 @@ fieldset.form-group, fieldset.form-collection-fset {
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
.
|
|
26
|
+
.fset { /* :not(.fupl-wrapper):not(.form-group):not(.form-collection-fset) { */
|
|
27
27
|
position: relative;
|
|
28
28
|
padding: 3rem 1rem 1rem;
|
|
29
29
|
margin: 1rem 0 2rem;
|
|
@@ -50,7 +50,7 @@ fieldset.form-group, fieldset.form-collection-fset {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
.
|
|
53
|
+
.fset { /* :not(.fupl-wrapper):not(.form-group) { */
|
|
54
54
|
padding-top: 2rem;
|
|
55
55
|
margin-bottom: .5rem;
|
|
56
56
|
border: none;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
font-size: var(--btn-font-size);
|
|
22
22
|
background-color: var(--form-input-group-background-color);
|
|
23
23
|
border: 1px solid var(--form-control-border-color);
|
|
24
|
-
border-radius: var(--
|
|
24
|
+
border-radius: var(--form-control-border-radius);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
> .btn, .input-group-text {
|