@vettvangur/design-system 2.0.11 → 2.0.13

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 (2) hide show
  1. package/dist/index.js +53 -39
  2. 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"></vv-headline>
2065
+ <vv-headline text="${title}" size="@HeadlineSize.H2" 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
- ></vv-button>
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
- ></vv-button>
2078
+ />
2079
2079
  </div>`;
2080
2080
  }).join('\n\n');
2081
2081
 
@@ -2091,9 +2091,9 @@ function renderButtonsCshtml(buttons, projectName) {
2091
2091
  <vv-headline
2092
2092
  identifier="ds-title"
2093
2093
  modifier="headline-2"
2094
- size="2"
2094
+ size="@HeadlineSize.H2"
2095
2095
  text="Buttons"
2096
- ></vv-headline>
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"></vv-headline>
2142
+ <vv-headline text="${categoryTitle}" size="@HeadlineSize.H2" modifier="headline-2" />
2143
2143
  <div class="ds-color-grid">
2144
2144
  ${items}
2145
2145
  </div>
@@ -2158,9 +2158,9 @@ ${items}
2158
2158
  <vv-headline
2159
2159
  identifier="ds-title"
2160
2160
  modifier="headline-2"
2161
- size="2"
2161
+ size="@HeadlineSize.H2"
2162
2162
  text="Colors"
2163
- ></vv-headline>
2163
+ />
2164
2164
 
2165
2165
  ${sections}
2166
2166
 
@@ -2179,8 +2179,8 @@ async function generateColors(colors, config, outpath, projectName) {
2179
2179
  message('finished generating colors');
2180
2180
  }
2181
2181
 
2182
- /* ---------------------------------------------
2183
- * helpers
2182
+ /* ---------------------------------------------
2183
+ * helpers
2184
2184
  * ------------------------------------------- */
2185
2185
 
2186
2186
  function titleCase(str) {
@@ -2197,8 +2197,8 @@ function isHeadline(id) {
2197
2197
  return id.startsWith('headline-');
2198
2198
  }
2199
2199
 
2200
- /* ---------------------------------------------
2201
- * normalize typography into semantic entries
2200
+ /* ---------------------------------------------
2201
+ * normalize typography into semantic entries
2202
2202
  * ------------------------------------------- */
2203
2203
 
2204
2204
  function buildEntries({
@@ -2228,18 +2228,22 @@ function buildEntries({
2228
2228
  return map;
2229
2229
  }
2230
2230
 
2231
- /* ---------------------------------------------
2232
- * category resolution
2231
+ /* ---------------------------------------------
2232
+ * category resolution
2233
2233
  * ------------------------------------------- */
2234
2234
 
2235
2235
  function resolveCategory(id) {
2236
- if (id.startsWith('headline')) return 'Headlines';
2237
- if (id.startsWith('body') || id === 'blockquote') return 'Bodies';
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
 
2241
- /* ---------------------------------------------
2242
- * preview render
2245
+ /* ---------------------------------------------
2246
+ * preview render
2243
2247
  * ------------------------------------------- */
2244
2248
 
2245
2249
  function renderPreview(id, title) {
@@ -2248,9 +2252,9 @@ function renderPreview(id, title) {
2248
2252
  <vv-headline
2249
2253
  identifier="ds-preview-headline"
2250
2254
  text="${title}"
2251
- size="2"
2255
+ size="@HeadlineSize.H2"
2252
2256
  modifier="${id}"
2253
- ></vv-headline>`;
2257
+ />`;
2254
2258
  }
2255
2259
  return `
2256
2260
  <p class="${id}">
@@ -2258,8 +2262,8 @@ function renderPreview(id, title) {
2258
2262
  </p>`;
2259
2263
  }
2260
2264
 
2261
- /* ---------------------------------------------
2262
- * entry render
2265
+ /* ---------------------------------------------
2266
+ * entry render
2263
2267
  * ------------------------------------------- */
2264
2268
 
2265
2269
  function renderEntry(id, entry) {
@@ -2296,14 +2300,14 @@ ${renderPreview(id, title)}
2296
2300
  </div>`;
2297
2301
  }
2298
2302
 
2299
- /* ---------------------------------------------
2300
- * category render
2303
+ /* ---------------------------------------------
2304
+ * category render
2301
2305
  * ------------------------------------------- */
2302
2306
 
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"></vv-headline>
2310
+ <vv-headline text="${title}" size="@HeadlineSize.H2" modifier="headline-2" />
2307
2311
 
2308
2312
  <div class="ds-type-grid">
2309
2313
  ${entries.join('\n')}
@@ -2311,8 +2315,8 @@ ${entries.join('\n')}
2311
2315
  </section>`;
2312
2316
  }
2313
2317
 
2314
- /* ---------------------------------------------
2315
- * main render
2318
+ /* ---------------------------------------------
2319
+ * main render
2316
2320
  * ------------------------------------------- */
2317
2321
 
2318
2322
  function renderTypographyCshtml(data, projectName) {
@@ -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) continue;
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
  }
@@ -2340,9 +2346,9 @@ function renderTypographyCshtml(data, projectName) {
2340
2346
  <vv-headline
2341
2347
  identifier="ds-title"
2342
2348
  modifier="headline-1"
2343
- size="2"
2349
+ size="@HeadlineSize.H2"
2344
2350
  text="Typography"
2345
- ></vv-headline>
2351
+ />
2346
2352
 
2347
2353
  ${sections}
2348
2354
 
@@ -2350,8 +2356,8 @@ ${sections}
2350
2356
  </section>`;
2351
2357
  }
2352
2358
 
2353
- /* ---------------------------------------------
2354
- * public API
2359
+ /* ---------------------------------------------
2360
+ * public API
2355
2361
  * ------------------------------------------- */
2356
2362
 
2357
2363
  async function generateTypography(typography, config, outpath, projectName) {
@@ -2378,9 +2384,9 @@ function renderTablesCshtml(projectName) {
2378
2384
  <vv-headline
2379
2385
  identifier="ds__headline"
2380
2386
  modifier="headline-2"
2381
- size="2"
2387
+ size="@HeadlineSize.H2"
2382
2388
  text="Tables"
2383
- ></vv-headline>
2389
+ />
2384
2390
 
2385
2391
  <div class="table">
2386
2392
  <table class="table__element">
@@ -2435,8 +2441,9 @@ function renderRichtextCshtml(projectName) {
2435
2441
  <vv-headline
2436
2442
  identifier="ds__headline"
2437
2443
  modifier="headline-2"
2444
+ size="@HeadlineSize.H2"
2438
2445
  text="Richtext"
2439
- ></vv-headline>
2446
+ />
2440
2447
 
2441
2448
  <div class="richtext">
2442
2449
  <h1>h1</h1>
@@ -2522,10 +2529,15 @@ ${renderAttrs(attrs)}
2522
2529
  />`;
2523
2530
  }
2524
2531
 
2525
- // Razor TagHelpers generally must not be self-closing.
2532
+ // Our Razor TagHelpers are self-closing.
2533
+ if (tag.startsWith('vv-')) {
2534
+ return ` <${tag}
2535
+ ${renderAttrs(attrs)}
2536
+ />`;
2537
+ }
2526
2538
  return ` <${tag}
2527
2539
  ${renderAttrs(attrs)}
2528
- ></${tag}>`;
2540
+ ></${tag}>`;
2529
2541
  }
2530
2542
  function renderSection({
2531
2543
  title,
@@ -2536,8 +2548,9 @@ function renderSection({
2536
2548
  <vv-headline
2537
2549
  identifier="ds__headline"
2538
2550
  modifier="headline-2"
2551
+ size="@HeadlineSize.H2"
2539
2552
  text="${escapeAttr(title)}"
2540
- ></vv-headline>
2553
+ />
2541
2554
  `;
2542
2555
  if (layout === 'stack') {
2543
2556
  const rows = (items || []).map(it => ` <div class="ds-inputs__row">\n${renderVoidComponent(it)}\n </div>`).join('\n\n');
@@ -2830,8 +2843,9 @@ ${razorPrelude}
2830
2843
  <vv-headline
2831
2844
  identifier="ds__headline"
2832
2845
  modifier="headline-2"
2846
+ size="@HeadlineSize.H2"
2833
2847
  text="Inputs"
2834
- ></vv-headline>
2848
+ />
2835
2849
 
2836
2850
  <div class="ds-section-grid">
2837
2851
  ${renderedSections}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vettvangur/design-system",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "type": "module",