@public-ui/theme-default 2.0.0-rc.2 → 2.0.0-rc.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.
package/dist/index.cjs CHANGED
@@ -377,18 +377,18 @@ var TagEnum = /* @__PURE__ */ ((TagEnum2) => {
377
377
  TagEnum2[TagEnum2["table"] = 41] = "table";
378
378
  TagEnum2[TagEnum2["tabs"] = 42] = "tabs";
379
379
  TagEnum2[TagEnum2["textarea"] = 43] = "textarea";
380
- TagEnum2[TagEnum2["toast"] = 44] = "toast";
381
- TagEnum2[TagEnum2["toast-container"] = 45] = "toast-container";
382
- TagEnum2[TagEnum2["toolbar"] = 46] = "toolbar";
383
- TagEnum2[TagEnum2["tooltip"] = 47] = "tooltip";
380
+ TagEnum2[TagEnum2["toast-container"] = 44] = "toast-container";
381
+ TagEnum2[TagEnum2["toolbar"] = 45] = "toolbar";
382
+ TagEnum2[TagEnum2["tooltip"] = 46] = "tooltip";
384
383
  return TagEnum2;
385
384
  })(TagEnum || {});
386
385
 
387
386
  const KoliBri = new Theme("kol", KeyEnum, TagEnum);
388
387
 
389
- const css = (input) => input.join(``);
388
+ const cssWithCustomLayerName = (layerName) => (input) => `@layer ${layerName} { ${input.join(``)} }`;
389
+ const css = (input) => cssWithCustomLayerName("kol-theme-component")(input);
390
390
  const DEFAULT = KoliBri.createTheme("default", {
391
- GLOBAL: css`
391
+ GLOBAL: cssWithCustomLayerName("kol-theme-global")`
392
392
  :host {
393
393
  --border-radius: var(--kolibri-border-radius, 5px);
394
394
  --font-family: var(--kolibri-font-family, BundesSans Web, Calibri, Verdana, Arial, Helvetica, sans-serif);
@@ -1489,71 +1489,6 @@ const DEFAULT = KoliBri.createTheme("default", {
1489
1489
  font-size: 1.2rem;
1490
1490
  }
1491
1491
  `,
1492
- "KOL-SPIN": css`
1493
- .spin {
1494
- display: inline-block;
1495
- height: 1rem;
1496
- position: relative;
1497
- width: 3rem;
1498
- }
1499
- .spin span {
1500
- animation-timing-function: cubic-bezier(0, 1, 1, 0);
1501
- border: 0.1rem solid rgb(255, 255, 255);
1502
- border-radius: 50%;
1503
- height: 0.8rem;
1504
- width: 0.8rem;
1505
- top: 0.1rem;
1506
- position: absolute;
1507
- }
1508
- .spin span:nth-child(1) {
1509
- background-color: #fc0;
1510
- z-index: 0;
1511
- animation: 2s ease 0s infinite normal none running spin1;
1512
- left: 0.1rem;
1513
- }
1514
- .spin span:nth-child(2) {
1515
- background-color: #f00;
1516
- z-index: 1;
1517
- animation: 2s ease 0s infinite normal none running spin2;
1518
- left: 0.1rem;
1519
- }
1520
- .spin span:nth-child(3) {
1521
- background-color: #000;
1522
- z-index: 1;
1523
- animation: 2s ease 0s infinite normal none running spin2;
1524
- left: 1.1rem;
1525
- }
1526
- .spin span:nth-child(4) {
1527
- background-color: #666;
1528
- z-index: 0;
1529
- animation: 2s ease 0s infinite normal none running spin3;
1530
- left: 2.1rem;
1531
- }
1532
- @keyframes spin1 {
1533
- 0% {
1534
- transform: scale(0);
1535
- }
1536
- 100% {
1537
- transform: scale(1);
1538
- }
1539
- }
1540
- @keyframes spin2 {
1541
- 0% {
1542
- transform: translate(0px, 0px);
1543
- }
1544
- 100% {
1545
- transform: translate(1rem, 0px);
1546
- }
1547
- }
1548
- @keyframes spin3 {
1549
- 0% {
1550
- transform: scale(1);
1551
- }
1552
- 100% {
1553
- transform: scale(0);
1554
- }
1555
- }
1556
- `,
1557
1492
  "KOL-PROGRESS": css`
1558
1493
  :host progress,
1559
1494
  :host span {
@@ -1659,13 +1594,15 @@ const DEFAULT = KoliBri.createTheme("default", {
1659
1594
  }
1660
1595
  select option {
1661
1596
  margin: 1px 0;
1662
- padding: 0.5em;
1663
1597
  border-radius: var(--border-radius);
1664
1598
  cursor: pointer;
1665
1599
  }
1666
1600
  select option:disabled {
1667
1601
  cursor: not-allowed;
1668
1602
  }
1603
+ select:not([multiple]) option {
1604
+ padding: 0.5em;
1605
+ }
1669
1606
  option:active:not(:disabled),
1670
1607
  option:checked:not(:disabled),
1671
1608
  option:focus:not(:disabled),
@@ -2240,7 +2177,7 @@ const DEFAULT = KoliBri.createTheme("default", {
2240
2177
  display: grid;
2241
2178
  gap: 0.25em;
2242
2179
  }
2243
- fieldset div {
2180
+ .radio-input-wrapper {
2244
2181
  align-items: center;
2245
2182
  cursor: pointer;
2246
2183
  display: flex;
@@ -2250,16 +2187,16 @@ const DEFAULT = KoliBri.createTheme("default", {
2250
2187
  min-height: var(--a11y-min-size);
2251
2188
  position: relative;
2252
2189
  }
2253
- fieldset div label {
2190
+ .radio-input-wrapper label {
2254
2191
  cursor: pointer;
2255
2192
  display: flex;
2256
2193
  padding-left: calc(var(--spacing) / 2);
2257
2194
  width: 100%;
2258
2195
  }
2259
- fieldset div label span {
2196
+ .radio-input-wrapper label span {
2260
2197
  margin-top: 0.125em;
2261
2198
  }
2262
- fieldset div input[type='radio'] {
2199
+ .radio-input-wrapper input[type='radio'] {
2263
2200
  appearance: none;
2264
2201
  transition: 0.5s;
2265
2202
  border-radius: 100%;
@@ -2267,16 +2204,16 @@ const DEFAULT = KoliBri.createTheme("default", {
2267
2204
  min-width: calc(6 * 0.25rem);
2268
2205
  width: calc(6 * 0.25rem);
2269
2206
  }
2270
- fieldset div input[type='radio']:before {
2207
+ .radio-input-wrapper input[type='radio']:before {
2271
2208
  content: '';
2272
2209
  cursor: pointer;
2273
2210
  border-radius: 100%;
2274
2211
  display: block;
2275
2212
  }
2276
- fieldset div input[type='radio']:checked:before {
2213
+ .radio-input-wrapper input[type='radio']:checked:before {
2277
2214
  background-color: var(--color-primary);
2278
2215
  }
2279
- fieldset div input[type='radio']:disabled {
2216
+ .radio-input-wrapper input[type='radio']:disabled {
2280
2217
  cursor: not-allowed;
2281
2218
  background-color: var(--color-mute-variant);
2282
2219
  }
@@ -2323,7 +2260,7 @@ const DEFAULT = KoliBri.createTheme("default", {
2323
2260
  fieldset .input-slot {
2324
2261
  gap: var(--spacing);
2325
2262
  }
2326
- fieldset div label {
2263
+ .radio-input-wrapper label {
2327
2264
  padding-left: 0;
2328
2265
  }
2329
2266
  `,
@@ -2333,8 +2270,6 @@ const DEFAULT = KoliBri.createTheme("default", {
2333
2270
  right: 1rem;
2334
2271
  width: 440px;
2335
2272
  }
2336
- `,
2337
- "KOL-TOAST": css`
2338
2273
  .toast {
2339
2274
  margin-top: 1rem;
2340
2275
  }
@@ -2474,38 +2409,46 @@ const DEFAULT = KoliBri.createTheme("default", {
2474
2409
  }
2475
2410
  `,
2476
2411
  "KOL-PAGINATION": css`
2477
- :host {
2478
- display: grid;
2479
- gap: 1rem;
2480
- }
2481
- :host .navigation-list {
2482
- display: inline-flex;
2483
- flex-wrap: wrap;
2484
- align-items: center;
2485
- gap: 0.5rem;
2412
+ .button:focus {
2413
+ outline: none;
2486
2414
  }
2487
- :host .selected button {
2488
- min-width: var(--a11y-min-size);
2489
- min-height: var(--a11y-min-size);
2490
- display: grid;
2491
- place-items: center;
2492
- font-family: var(--font-family);
2493
- cursor: not-allowed;
2415
+ .button-inner {
2416
+ background-color: var(--color-light);
2417
+ border-radius: var(--border-radius);
2418
+ border: 1px solid var(--color-primary);
2419
+ color: var(--color-primary);
2494
2420
  font-weight: 700;
2495
- border-radius: 50%;
2496
- border: none;
2497
- font-style: normal;
2421
+ min-height: var(--a11y-min-size);
2422
+ min-width: var(--a11y-min-size);
2423
+ padding: 8px;
2498
2424
  text-align: center;
2499
- width: inherit;
2500
2425
  transition-duration: 0.5s;
2501
2426
  transition-property: background-color, color, border-color;
2502
- color: var(--color-primary);
2503
- background-color: var(--color-mute-variant);
2504
2427
  }
2505
- :host > div > span {
2506
- align-self: flex-end;
2507
- padding-bottom: 0.5rem;
2508
- color: var(--color-primary);
2428
+ .button:focus .button-inner {
2429
+ outline-offset: 2px;
2430
+ outline: 2px solid var(--color-primary-variant);
2431
+ transition: outline-offset 0.2s linear;
2432
+ }
2433
+ .button:is(:active, :hover):not(:disabled) .button-inner {
2434
+ background-color: var(--color-primary-variant);
2435
+ border-color: var(--color-primary-variant);
2436
+ box-shadow: 0 2px 8px 2px rgba(8, 35, 48, 0.24);
2437
+ color: var(--color-light);
2438
+ }
2439
+ .button:active .button-inner {
2440
+ color: var(--color-light);
2441
+ outline: none;
2442
+ }
2443
+ .button:disabled .button-inner {
2444
+ cursor: not-allowed;
2445
+ opacity: 0.5;
2446
+ }
2447
+ .selected .button-inner {
2448
+ background-color: var(--color-mute-variant);
2449
+ border-radius: var(--a11y-min-size);
2450
+ border: 0;
2451
+ opacity: 1 !important;
2509
2452
  }
2510
2453
  `,
2511
2454
  "KOL-INPUT-RANGE": css`
@@ -2798,9 +2741,11 @@ const DEFAULT = KoliBri.createTheme("default", {
2798
2741
  cursor: pointer;
2799
2742
  }
2800
2743
  `,
2801
- "KOL-SPLIT-BUTTON": `.popover {
2802
- background: #fff;
2803
- }`
2744
+ "KOL-SPLIT-BUTTON": css`
2745
+ .popover {
2746
+ background: #fff;
2747
+ }
2748
+ `
2804
2749
  });
2805
2750
 
2806
2751
  exports.DEFAULT = DEFAULT;
package/dist/index.d.ts CHANGED
@@ -45,7 +45,6 @@ declare const DEFAULT: (patch: (name: string, map: {
45
45
  "KOL-TABLE"?: string | undefined;
46
46
  "KOL-TABS"?: string | undefined;
47
47
  "KOL-TEXTAREA"?: string | undefined;
48
- "KOL-TOAST"?: string | undefined;
49
48
  "KOL-TOAST-CONTAINER"?: string | undefined;
50
49
  "KOL-TOOLBAR"?: string | undefined;
51
50
  "KOL-TOOLTIP"?: string | undefined;
package/dist/index.mjs CHANGED
@@ -375,18 +375,18 @@ var TagEnum = /* @__PURE__ */ ((TagEnum2) => {
375
375
  TagEnum2[TagEnum2["table"] = 41] = "table";
376
376
  TagEnum2[TagEnum2["tabs"] = 42] = "tabs";
377
377
  TagEnum2[TagEnum2["textarea"] = 43] = "textarea";
378
- TagEnum2[TagEnum2["toast"] = 44] = "toast";
379
- TagEnum2[TagEnum2["toast-container"] = 45] = "toast-container";
380
- TagEnum2[TagEnum2["toolbar"] = 46] = "toolbar";
381
- TagEnum2[TagEnum2["tooltip"] = 47] = "tooltip";
378
+ TagEnum2[TagEnum2["toast-container"] = 44] = "toast-container";
379
+ TagEnum2[TagEnum2["toolbar"] = 45] = "toolbar";
380
+ TagEnum2[TagEnum2["tooltip"] = 46] = "tooltip";
382
381
  return TagEnum2;
383
382
  })(TagEnum || {});
384
383
 
385
384
  const KoliBri = new Theme("kol", KeyEnum, TagEnum);
386
385
 
387
- const css = (input) => input.join(``);
386
+ const cssWithCustomLayerName = (layerName) => (input) => `@layer ${layerName} { ${input.join(``)} }`;
387
+ const css = (input) => cssWithCustomLayerName("kol-theme-component")(input);
388
388
  const DEFAULT = KoliBri.createTheme("default", {
389
- GLOBAL: css`
389
+ GLOBAL: cssWithCustomLayerName("kol-theme-global")`
390
390
  :host {
391
391
  --border-radius: var(--kolibri-border-radius, 5px);
392
392
  --font-family: var(--kolibri-font-family, BundesSans Web, Calibri, Verdana, Arial, Helvetica, sans-serif);
@@ -1487,71 +1487,6 @@ const DEFAULT = KoliBri.createTheme("default", {
1487
1487
  font-size: 1.2rem;
1488
1488
  }
1489
1489
  `,
1490
- "KOL-SPIN": css`
1491
- .spin {
1492
- display: inline-block;
1493
- height: 1rem;
1494
- position: relative;
1495
- width: 3rem;
1496
- }
1497
- .spin span {
1498
- animation-timing-function: cubic-bezier(0, 1, 1, 0);
1499
- border: 0.1rem solid rgb(255, 255, 255);
1500
- border-radius: 50%;
1501
- height: 0.8rem;
1502
- width: 0.8rem;
1503
- top: 0.1rem;
1504
- position: absolute;
1505
- }
1506
- .spin span:nth-child(1) {
1507
- background-color: #fc0;
1508
- z-index: 0;
1509
- animation: 2s ease 0s infinite normal none running spin1;
1510
- left: 0.1rem;
1511
- }
1512
- .spin span:nth-child(2) {
1513
- background-color: #f00;
1514
- z-index: 1;
1515
- animation: 2s ease 0s infinite normal none running spin2;
1516
- left: 0.1rem;
1517
- }
1518
- .spin span:nth-child(3) {
1519
- background-color: #000;
1520
- z-index: 1;
1521
- animation: 2s ease 0s infinite normal none running spin2;
1522
- left: 1.1rem;
1523
- }
1524
- .spin span:nth-child(4) {
1525
- background-color: #666;
1526
- z-index: 0;
1527
- animation: 2s ease 0s infinite normal none running spin3;
1528
- left: 2.1rem;
1529
- }
1530
- @keyframes spin1 {
1531
- 0% {
1532
- transform: scale(0);
1533
- }
1534
- 100% {
1535
- transform: scale(1);
1536
- }
1537
- }
1538
- @keyframes spin2 {
1539
- 0% {
1540
- transform: translate(0px, 0px);
1541
- }
1542
- 100% {
1543
- transform: translate(1rem, 0px);
1544
- }
1545
- }
1546
- @keyframes spin3 {
1547
- 0% {
1548
- transform: scale(1);
1549
- }
1550
- 100% {
1551
- transform: scale(0);
1552
- }
1553
- }
1554
- `,
1555
1490
  "KOL-PROGRESS": css`
1556
1491
  :host progress,
1557
1492
  :host span {
@@ -1657,13 +1592,15 @@ const DEFAULT = KoliBri.createTheme("default", {
1657
1592
  }
1658
1593
  select option {
1659
1594
  margin: 1px 0;
1660
- padding: 0.5em;
1661
1595
  border-radius: var(--border-radius);
1662
1596
  cursor: pointer;
1663
1597
  }
1664
1598
  select option:disabled {
1665
1599
  cursor: not-allowed;
1666
1600
  }
1601
+ select:not([multiple]) option {
1602
+ padding: 0.5em;
1603
+ }
1667
1604
  option:active:not(:disabled),
1668
1605
  option:checked:not(:disabled),
1669
1606
  option:focus:not(:disabled),
@@ -2238,7 +2175,7 @@ const DEFAULT = KoliBri.createTheme("default", {
2238
2175
  display: grid;
2239
2176
  gap: 0.25em;
2240
2177
  }
2241
- fieldset div {
2178
+ .radio-input-wrapper {
2242
2179
  align-items: center;
2243
2180
  cursor: pointer;
2244
2181
  display: flex;
@@ -2248,16 +2185,16 @@ const DEFAULT = KoliBri.createTheme("default", {
2248
2185
  min-height: var(--a11y-min-size);
2249
2186
  position: relative;
2250
2187
  }
2251
- fieldset div label {
2188
+ .radio-input-wrapper label {
2252
2189
  cursor: pointer;
2253
2190
  display: flex;
2254
2191
  padding-left: calc(var(--spacing) / 2);
2255
2192
  width: 100%;
2256
2193
  }
2257
- fieldset div label span {
2194
+ .radio-input-wrapper label span {
2258
2195
  margin-top: 0.125em;
2259
2196
  }
2260
- fieldset div input[type='radio'] {
2197
+ .radio-input-wrapper input[type='radio'] {
2261
2198
  appearance: none;
2262
2199
  transition: 0.5s;
2263
2200
  border-radius: 100%;
@@ -2265,16 +2202,16 @@ const DEFAULT = KoliBri.createTheme("default", {
2265
2202
  min-width: calc(6 * 0.25rem);
2266
2203
  width: calc(6 * 0.25rem);
2267
2204
  }
2268
- fieldset div input[type='radio']:before {
2205
+ .radio-input-wrapper input[type='radio']:before {
2269
2206
  content: '';
2270
2207
  cursor: pointer;
2271
2208
  border-radius: 100%;
2272
2209
  display: block;
2273
2210
  }
2274
- fieldset div input[type='radio']:checked:before {
2211
+ .radio-input-wrapper input[type='radio']:checked:before {
2275
2212
  background-color: var(--color-primary);
2276
2213
  }
2277
- fieldset div input[type='radio']:disabled {
2214
+ .radio-input-wrapper input[type='radio']:disabled {
2278
2215
  cursor: not-allowed;
2279
2216
  background-color: var(--color-mute-variant);
2280
2217
  }
@@ -2321,7 +2258,7 @@ const DEFAULT = KoliBri.createTheme("default", {
2321
2258
  fieldset .input-slot {
2322
2259
  gap: var(--spacing);
2323
2260
  }
2324
- fieldset div label {
2261
+ .radio-input-wrapper label {
2325
2262
  padding-left: 0;
2326
2263
  }
2327
2264
  `,
@@ -2331,8 +2268,6 @@ const DEFAULT = KoliBri.createTheme("default", {
2331
2268
  right: 1rem;
2332
2269
  width: 440px;
2333
2270
  }
2334
- `,
2335
- "KOL-TOAST": css`
2336
2271
  .toast {
2337
2272
  margin-top: 1rem;
2338
2273
  }
@@ -2472,38 +2407,46 @@ const DEFAULT = KoliBri.createTheme("default", {
2472
2407
  }
2473
2408
  `,
2474
2409
  "KOL-PAGINATION": css`
2475
- :host {
2476
- display: grid;
2477
- gap: 1rem;
2478
- }
2479
- :host .navigation-list {
2480
- display: inline-flex;
2481
- flex-wrap: wrap;
2482
- align-items: center;
2483
- gap: 0.5rem;
2410
+ .button:focus {
2411
+ outline: none;
2484
2412
  }
2485
- :host .selected button {
2486
- min-width: var(--a11y-min-size);
2487
- min-height: var(--a11y-min-size);
2488
- display: grid;
2489
- place-items: center;
2490
- font-family: var(--font-family);
2491
- cursor: not-allowed;
2413
+ .button-inner {
2414
+ background-color: var(--color-light);
2415
+ border-radius: var(--border-radius);
2416
+ border: 1px solid var(--color-primary);
2417
+ color: var(--color-primary);
2492
2418
  font-weight: 700;
2493
- border-radius: 50%;
2494
- border: none;
2495
- font-style: normal;
2419
+ min-height: var(--a11y-min-size);
2420
+ min-width: var(--a11y-min-size);
2421
+ padding: 8px;
2496
2422
  text-align: center;
2497
- width: inherit;
2498
2423
  transition-duration: 0.5s;
2499
2424
  transition-property: background-color, color, border-color;
2500
- color: var(--color-primary);
2501
- background-color: var(--color-mute-variant);
2502
2425
  }
2503
- :host > div > span {
2504
- align-self: flex-end;
2505
- padding-bottom: 0.5rem;
2506
- color: var(--color-primary);
2426
+ .button:focus .button-inner {
2427
+ outline-offset: 2px;
2428
+ outline: 2px solid var(--color-primary-variant);
2429
+ transition: outline-offset 0.2s linear;
2430
+ }
2431
+ .button:is(:active, :hover):not(:disabled) .button-inner {
2432
+ background-color: var(--color-primary-variant);
2433
+ border-color: var(--color-primary-variant);
2434
+ box-shadow: 0 2px 8px 2px rgba(8, 35, 48, 0.24);
2435
+ color: var(--color-light);
2436
+ }
2437
+ .button:active .button-inner {
2438
+ color: var(--color-light);
2439
+ outline: none;
2440
+ }
2441
+ .button:disabled .button-inner {
2442
+ cursor: not-allowed;
2443
+ opacity: 0.5;
2444
+ }
2445
+ .selected .button-inner {
2446
+ background-color: var(--color-mute-variant);
2447
+ border-radius: var(--a11y-min-size);
2448
+ border: 0;
2449
+ opacity: 1 !important;
2507
2450
  }
2508
2451
  `,
2509
2452
  "KOL-INPUT-RANGE": css`
@@ -2796,9 +2739,11 @@ const DEFAULT = KoliBri.createTheme("default", {
2796
2739
  cursor: pointer;
2797
2740
  }
2798
2741
  `,
2799
- "KOL-SPLIT-BUTTON": `.popover {
2800
- background: #fff;
2801
- }`
2742
+ "KOL-SPLIT-BUTTON": css`
2743
+ .popover {
2744
+ background: #fff;
2745
+ }
2746
+ `
2802
2747
  });
2803
2748
 
2804
2749
  export { DEFAULT };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@public-ui/theme-default",
3
- "version": "2.0.0-rc.2",
3
+ "version": "2.0.0-rc.4",
4
4
  "license": "EUPL-1.2",
5
5
  "homepage": "https://public-ui.github.io",
6
6
  "repository": "https://github.com/public-ui/kolibri",
@@ -38,18 +38,18 @@
38
38
  "wcag"
39
39
  ],
40
40
  "devDependencies": {
41
- "@public-ui/schema": "2.0.0-rc.2",
42
- "@public-ui/visual-tests": "2.0.0-rc.2",
41
+ "@public-ui/schema": "2.0.0-rc.4",
42
+ "@public-ui/visual-tests": "2.0.0-rc.4",
43
43
  "@types/node": "ts5.2",
44
- "@typescript-eslint/eslint-plugin": "6.8.0",
45
- "@typescript-eslint/parser": "6.8.0",
46
- "eslint": "8.51.0",
44
+ "@typescript-eslint/eslint-plugin": "6.9.0",
45
+ "@typescript-eslint/parser": "6.9.0",
46
+ "eslint": "8.52.0",
47
47
  "eslint-plugin-no-loops": "0.3.0",
48
48
  "typescript": "5.2.2",
49
49
  "unbuild": "1.2.1"
50
50
  },
51
51
  "peerDependencies": {
52
- "@public-ui/components": "2.0.0-rc.2"
52
+ "@public-ui/components": "2.0.0-rc.4"
53
53
  },
54
54
  "sideEffects": false,
55
55
  "type": "module",