@vettvangur/design-system 2.0.14 → 2.0.16
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/dist/index.js +57 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2182,8 +2182,8 @@ async function generateColors(colors, config, outpath, projectName) {
|
|
|
2182
2182
|
message('finished generating colors');
|
|
2183
2183
|
}
|
|
2184
2184
|
|
|
2185
|
-
/* ---------------------------------------------
|
|
2186
|
-
* helpers
|
|
2185
|
+
/* ---------------------------------------------
|
|
2186
|
+
* helpers
|
|
2187
2187
|
* ------------------------------------------- */
|
|
2188
2188
|
|
|
2189
2189
|
function titleCase(str) {
|
|
@@ -2191,6 +2191,7 @@ function titleCase(str) {
|
|
|
2191
2191
|
}
|
|
2192
2192
|
function extractKey(prefix, key) {
|
|
2193
2193
|
// font-size-headline-1 -> headline-1
|
|
2194
|
+
|
|
2194
2195
|
return key.replace(prefix, '');
|
|
2195
2196
|
}
|
|
2196
2197
|
function getValue(values, mode) {
|
|
@@ -2200,8 +2201,8 @@ function isHeadline(id) {
|
|
|
2200
2201
|
return id.startsWith('headline-');
|
|
2201
2202
|
}
|
|
2202
2203
|
|
|
2203
|
-
/* ---------------------------------------------
|
|
2204
|
-
* normalize typography into semantic entries
|
|
2204
|
+
/* ---------------------------------------------
|
|
2205
|
+
* normalize typography into semantic entries
|
|
2205
2206
|
* ------------------------------------------- */
|
|
2206
2207
|
|
|
2207
2208
|
function buildEntries({
|
|
@@ -2231,8 +2232,8 @@ function buildEntries({
|
|
|
2231
2232
|
return map;
|
|
2232
2233
|
}
|
|
2233
2234
|
|
|
2234
|
-
/* ---------------------------------------------
|
|
2235
|
-
* category resolution
|
|
2235
|
+
/* ---------------------------------------------
|
|
2236
|
+
* category resolution
|
|
2236
2237
|
* ------------------------------------------- */
|
|
2237
2238
|
|
|
2238
2239
|
function resolveCategory(id) {
|
|
@@ -2245,28 +2246,37 @@ function resolveCategory(id) {
|
|
|
2245
2246
|
return null;
|
|
2246
2247
|
}
|
|
2247
2248
|
|
|
2248
|
-
/* ---------------------------------------------
|
|
2249
|
-
* preview render
|
|
2249
|
+
/* ---------------------------------------------
|
|
2250
|
+
* preview render
|
|
2250
2251
|
* ------------------------------------------- */
|
|
2251
2252
|
|
|
2252
2253
|
function renderPreview(id, title) {
|
|
2253
2254
|
if (isHeadline(id)) {
|
|
2254
2255
|
return `
|
|
2256
|
+
|
|
2255
2257
|
<vv-headline
|
|
2258
|
+
|
|
2256
2259
|
identifier="ds-preview-headline"
|
|
2260
|
+
|
|
2257
2261
|
text="${title}"
|
|
2262
|
+
|
|
2258
2263
|
size="@HeadlineSize.H2"
|
|
2264
|
+
|
|
2259
2265
|
modifier="${id}"
|
|
2266
|
+
|
|
2260
2267
|
/>`;
|
|
2261
2268
|
}
|
|
2262
2269
|
return `
|
|
2270
|
+
|
|
2263
2271
|
<p class="${id}">
|
|
2272
|
+
|
|
2264
2273
|
${title}
|
|
2274
|
+
|
|
2265
2275
|
</p>`;
|
|
2266
2276
|
}
|
|
2267
2277
|
|
|
2268
|
-
/* ---------------------------------------------
|
|
2269
|
-
* entry render
|
|
2278
|
+
/* ---------------------------------------------
|
|
2279
|
+
* entry render
|
|
2270
2280
|
* ------------------------------------------- */
|
|
2271
2281
|
|
|
2272
2282
|
function renderEntry(id, entry) {
|
|
@@ -2311,29 +2321,38 @@ ${renderPreview(id, title)}
|
|
|
2311
2321
|
</div>
|
|
2312
2322
|
|
|
2313
2323
|
<div class="ds-type-meta">
|
|
2314
|
-
|
|
2324
|
+
<div class="ds-type-meta__info">
|
|
2325
|
+
${renderMeta(mFamily, mSize, mLine)}
|
|
2326
|
+
</div>
|
|
2315
2327
|
</div>
|
|
2316
2328
|
</div>` : ''}
|
|
2317
2329
|
</div>`;
|
|
2318
2330
|
}
|
|
2319
2331
|
|
|
2320
|
-
/* ---------------------------------------------
|
|
2321
|
-
* category render
|
|
2332
|
+
/* ---------------------------------------------
|
|
2333
|
+
* category render
|
|
2322
2334
|
* ------------------------------------------- */
|
|
2323
2335
|
|
|
2324
2336
|
function renderCategory(title, entries) {
|
|
2325
2337
|
return `
|
|
2338
|
+
|
|
2326
2339
|
<section class="ds-type-category">
|
|
2340
|
+
|
|
2327
2341
|
<vv-headline text="${title}" size="@HeadlineSize.H2" modifier="headline-2" />
|
|
2328
2342
|
|
|
2343
|
+
|
|
2344
|
+
|
|
2329
2345
|
<div class="ds-type-grid">
|
|
2346
|
+
|
|
2330
2347
|
${entries.join('\n')}
|
|
2348
|
+
|
|
2331
2349
|
</div>
|
|
2350
|
+
|
|
2332
2351
|
</section>`;
|
|
2333
2352
|
}
|
|
2334
2353
|
|
|
2335
|
-
/* ---------------------------------------------
|
|
2336
|
-
* main render
|
|
2354
|
+
/* ---------------------------------------------
|
|
2355
|
+
* main render
|
|
2337
2356
|
* ------------------------------------------- */
|
|
2338
2357
|
|
|
2339
2358
|
function renderTypographyCshtml(data, projectName) {
|
|
@@ -2350,31 +2369,52 @@ function renderTypographyCshtml(data, projectName) {
|
|
|
2350
2369
|
const sections = Object.entries(categories).map(([title, items]) => renderCategory(title, items)).join('\n');
|
|
2351
2370
|
|
|
2352
2371
|
// @{
|
|
2372
|
+
|
|
2353
2373
|
// Layout = "Master.cshtml";
|
|
2374
|
+
|
|
2354
2375
|
// }
|
|
2376
|
+
|
|
2355
2377
|
return `@* AUTO-GENERATED - DO NOT EDIT BY HAND *@
|
|
2356
2378
|
|
|
2379
|
+
|
|
2380
|
+
|
|
2357
2381
|
<section class="ds-typography">
|
|
2382
|
+
|
|
2358
2383
|
<div class="ds__left">
|
|
2384
|
+
|
|
2359
2385
|
<partial name="${projectName}/DesignSystem/DSNavigation" />
|
|
2386
|
+
|
|
2360
2387
|
</div>
|
|
2361
2388
|
|
|
2389
|
+
|
|
2390
|
+
|
|
2362
2391
|
<div class="ds__right">
|
|
2392
|
+
|
|
2363
2393
|
<vv-headline
|
|
2394
|
+
|
|
2364
2395
|
identifier="ds-title"
|
|
2396
|
+
|
|
2365
2397
|
modifier="headline-1"
|
|
2398
|
+
|
|
2366
2399
|
size="@HeadlineSize.H2"
|
|
2400
|
+
|
|
2367
2401
|
text="Typography"
|
|
2402
|
+
|
|
2368
2403
|
/>
|
|
2369
2404
|
|
|
2405
|
+
|
|
2406
|
+
|
|
2370
2407
|
${sections}
|
|
2371
2408
|
|
|
2409
|
+
|
|
2410
|
+
|
|
2372
2411
|
</div>
|
|
2412
|
+
|
|
2373
2413
|
</section>`;
|
|
2374
2414
|
}
|
|
2375
2415
|
|
|
2376
|
-
/* ---------------------------------------------
|
|
2377
|
-
* public API
|
|
2416
|
+
/* ---------------------------------------------
|
|
2417
|
+
* public API
|
|
2378
2418
|
* ------------------------------------------- */
|
|
2379
2419
|
|
|
2380
2420
|
async function generateTypography(typography, config, outpath, projectName) {
|