@vettvangur/design-system 2.0.11 → 2.0.12
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 +29 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2062,20 +2062,20 @@ function renderButtonsCshtml(buttons, projectName) {
|
|
|
2062
2062
|
const key = b.key;
|
|
2063
2063
|
const title = titleizeButton(key);
|
|
2064
2064
|
return ` <div class="ds-button-wrap">
|
|
2065
|
-
<vv-headline text="${title}" size="2" modifier="headline-2"
|
|
2065
|
+
<vv-headline text="${title}" size="2" modifier="headline-2" />
|
|
2066
2066
|
<vv-button
|
|
2067
2067
|
identifier="ds__button"
|
|
2068
2068
|
modifier="${key}"
|
|
2069
2069
|
type="@ButtonType.Button"
|
|
2070
2070
|
text="${title}"
|
|
2071
|
-
|
|
2071
|
+
/>
|
|
2072
2072
|
<vv-button
|
|
2073
2073
|
identifier="ds__button"
|
|
2074
2074
|
modifier="${key}"
|
|
2075
2075
|
type="@ButtonType.Button"
|
|
2076
2076
|
text="${title} disabled"
|
|
2077
2077
|
disabled="true"
|
|
2078
|
-
|
|
2078
|
+
/>
|
|
2079
2079
|
</div>`;
|
|
2080
2080
|
}).join('\n\n');
|
|
2081
2081
|
|
|
@@ -2093,7 +2093,7 @@ function renderButtonsCshtml(buttons, projectName) {
|
|
|
2093
2093
|
modifier="headline-2"
|
|
2094
2094
|
size="2"
|
|
2095
2095
|
text="Buttons"
|
|
2096
|
-
|
|
2096
|
+
/>
|
|
2097
2097
|
|
|
2098
2098
|
<div class="ds-section-grid">
|
|
2099
2099
|
|
|
@@ -2139,7 +2139,7 @@ function renderColorsCshtml(colors, projectName) {
|
|
|
2139
2139
|
</div>`;
|
|
2140
2140
|
}).join('\n');
|
|
2141
2141
|
return ` <section class="ds-color-group">
|
|
2142
|
-
<vv-headline text="${categoryTitle}" size="2" modifier="headline-2"
|
|
2142
|
+
<vv-headline text="${categoryTitle}" size="2" modifier="headline-2" />
|
|
2143
2143
|
<div class="ds-color-grid">
|
|
2144
2144
|
${items}
|
|
2145
2145
|
</div>
|
|
@@ -2160,7 +2160,7 @@ ${items}
|
|
|
2160
2160
|
modifier="headline-2"
|
|
2161
2161
|
size="2"
|
|
2162
2162
|
text="Colors"
|
|
2163
|
-
|
|
2163
|
+
/>
|
|
2164
2164
|
|
|
2165
2165
|
${sections}
|
|
2166
2166
|
|
|
@@ -2233,8 +2233,12 @@ function buildEntries({
|
|
|
2233
2233
|
* ------------------------------------------- */
|
|
2234
2234
|
|
|
2235
2235
|
function resolveCategory(id) {
|
|
2236
|
-
if (id.startsWith('headline'))
|
|
2237
|
-
|
|
2236
|
+
if (id.startsWith('headline')) {
|
|
2237
|
+
return 'Headlines';
|
|
2238
|
+
}
|
|
2239
|
+
if (id.startsWith('body') || id === 'blockquote') {
|
|
2240
|
+
return 'Bodies';
|
|
2241
|
+
}
|
|
2238
2242
|
return null;
|
|
2239
2243
|
}
|
|
2240
2244
|
|
|
@@ -2250,7 +2254,7 @@ function renderPreview(id, title) {
|
|
|
2250
2254
|
text="${title}"
|
|
2251
2255
|
size="2"
|
|
2252
2256
|
modifier="${id}"
|
|
2253
|
-
|
|
2257
|
+
/>`;
|
|
2254
2258
|
}
|
|
2255
2259
|
return `
|
|
2256
2260
|
<p class="${id}">
|
|
@@ -2303,7 +2307,7 @@ ${renderPreview(id, title)}
|
|
|
2303
2307
|
function renderCategory(title, entries) {
|
|
2304
2308
|
return `
|
|
2305
2309
|
<section class="ds-type-category">
|
|
2306
|
-
<vv-headline text="${title}" size="3" modifier="headline-2"
|
|
2310
|
+
<vv-headline text="${title}" size="3" modifier="headline-2" />
|
|
2307
2311
|
|
|
2308
2312
|
<div class="ds-type-grid">
|
|
2309
2313
|
${entries.join('\n')}
|
|
@@ -2320,7 +2324,9 @@ function renderTypographyCshtml(data, projectName) {
|
|
|
2320
2324
|
const categories = {};
|
|
2321
2325
|
for (const [id, entry] of Object.entries(entries)) {
|
|
2322
2326
|
const cat = resolveCategory(id);
|
|
2323
|
-
if (!cat || !entry.size || !entry.lineHeight || !entry.family)
|
|
2327
|
+
if (!cat || !entry.size || !entry.lineHeight || !entry.family) {
|
|
2328
|
+
continue;
|
|
2329
|
+
}
|
|
2324
2330
|
categories[cat] ??= [];
|
|
2325
2331
|
categories[cat].push(renderEntry(id, entry));
|
|
2326
2332
|
}
|
|
@@ -2342,7 +2348,7 @@ function renderTypographyCshtml(data, projectName) {
|
|
|
2342
2348
|
modifier="headline-1"
|
|
2343
2349
|
size="2"
|
|
2344
2350
|
text="Typography"
|
|
2345
|
-
|
|
2351
|
+
/>
|
|
2346
2352
|
|
|
2347
2353
|
${sections}
|
|
2348
2354
|
|
|
@@ -2380,7 +2386,7 @@ function renderTablesCshtml(projectName) {
|
|
|
2380
2386
|
modifier="headline-2"
|
|
2381
2387
|
size="2"
|
|
2382
2388
|
text="Tables"
|
|
2383
|
-
|
|
2389
|
+
/>
|
|
2384
2390
|
|
|
2385
2391
|
<div class="table">
|
|
2386
2392
|
<table class="table__element">
|
|
@@ -2436,7 +2442,7 @@ function renderRichtextCshtml(projectName) {
|
|
|
2436
2442
|
identifier="ds__headline"
|
|
2437
2443
|
modifier="headline-2"
|
|
2438
2444
|
text="Richtext"
|
|
2439
|
-
|
|
2445
|
+
/>
|
|
2440
2446
|
|
|
2441
2447
|
<div class="richtext">
|
|
2442
2448
|
<h1>h1</h1>
|
|
@@ -2522,10 +2528,15 @@ ${renderAttrs(attrs)}
|
|
|
2522
2528
|
/>`;
|
|
2523
2529
|
}
|
|
2524
2530
|
|
|
2525
|
-
// Razor TagHelpers
|
|
2531
|
+
// Our Razor TagHelpers are self-closing.
|
|
2532
|
+
if (tag.startsWith('vv-')) {
|
|
2533
|
+
return ` <${tag}
|
|
2534
|
+
${renderAttrs(attrs)}
|
|
2535
|
+
/>`;
|
|
2536
|
+
}
|
|
2526
2537
|
return ` <${tag}
|
|
2527
2538
|
${renderAttrs(attrs)}
|
|
2528
|
-
|
|
2539
|
+
></${tag}>`;
|
|
2529
2540
|
}
|
|
2530
2541
|
function renderSection({
|
|
2531
2542
|
title,
|
|
@@ -2537,7 +2548,7 @@ function renderSection({
|
|
|
2537
2548
|
identifier="ds__headline"
|
|
2538
2549
|
modifier="headline-2"
|
|
2539
2550
|
text="${escapeAttr(title)}"
|
|
2540
|
-
|
|
2551
|
+
/>
|
|
2541
2552
|
`;
|
|
2542
2553
|
if (layout === 'stack') {
|
|
2543
2554
|
const rows = (items || []).map(it => ` <div class="ds-inputs__row">\n${renderVoidComponent(it)}\n </div>`).join('\n\n');
|
|
@@ -2831,7 +2842,7 @@ ${razorPrelude}
|
|
|
2831
2842
|
identifier="ds__headline"
|
|
2832
2843
|
modifier="headline-2"
|
|
2833
2844
|
text="Inputs"
|
|
2834
|
-
|
|
2845
|
+
/>
|
|
2835
2846
|
|
|
2836
2847
|
<div class="ds-section-grid">
|
|
2837
2848
|
${renderedSections}
|