@klodd/ds 3.17.2 → 3.18.0

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.
@@ -328,19 +328,28 @@
328
328
  ==== RADIUS - pixel-numerisk
329
329
  --radius-N dar N = exakt antal pixlar.
330
330
  --radius-full = 9999px (pill-form OCH cirkel for kvadratiska element).
331
+
332
+ Pill-doktrin (DESIGN-LANGUAGE.md sektion 1, 2026-05-13):
333
+ komponenter ska anvanda BARA en av fyra:
334
+ --radius-4 thin bars + skeleton-placeholder
335
+ --radius-14 kort/paneler/containers
336
+ 50% / full cirklar + pills (knappar, inputs, en-rads-element med kant)
337
+
338
+ --radius-10 borttagen 2026-05-13 efter pill-konsolidering.
339
+ Ovriga tokens (2/6/8/12/16/20/24) ar legacy - anvand inte i
340
+ komponent-CSS. Kvar enbart for bakat-kompat under deprecation.
331
341
  ================================================================ */
332
342
  :root {
333
- --radius-2: 2px; /* mikro-staplar (cat-bar, hour-bar) */
334
- --radius-4: 4px; /* small bars, info-block-corners */
335
- --radius-6: 6px; /* equity-bars, focus-outlines */
336
- --radius-8: 8px; /* mellan-radius, sub-pills */
337
- --radius-10: 10px; /* mode-toggles */
338
- --radius-12: 12px; /* tx-icon, btn-md, sheet-pattern */
339
- --radius-14: 14px; /* input, btn, avi-image */
340
- --radius-16: 16px; /* banners */
341
- --radius-20: 20px; /* panels, cards */
342
- --radius-24: 24px; /* sheet top */
343
- --radius-full: 9999px; /* chips, knappar, nav, avatars */
343
+ --radius-2: 2px; /* legacy - anvand inte */
344
+ --radius-4: 4px; /* thin bars, skeleton-placeholder */
345
+ --radius-6: 6px; /* legacy - anvand inte */
346
+ --radius-8: 8px; /* legacy - anvand inte */
347
+ --radius-12: 12px; /* legacy - anvand inte */
348
+ --radius-14: 14px; /* kort, paneler, containers, textarea */
349
+ --radius-16: 16px; /* legacy - anvand inte */
350
+ --radius-20: 20px; /* legacy - anvand inte */
351
+ --radius-24: 24px; /* legacy - anvand inte (sheet-top via sheet-token) */
352
+ --radius-full: 9999px; /* pills, knappar, inputs, en-rads-element, avatars */
344
353
  }
345
354
 
346
355
 
@@ -24,7 +24,11 @@
24
24
  /* ================================================================
25
25
  ==== BAS
26
26
  Alla knappar har samma fundamental: 44px touch-target, medium-vikt,
27
- 10px radius, smooth transitions, fokusring.
27
+ pill-radius, smooth transitions, fokusring.
28
+
29
+ Pill-doktrin (DESIGN-LANGUAGE.md sektion 1, 2026-05-13): knappar
30
+ och en-rads-element med kant ska ha radius-full. Bara kort/paneler
31
+ har 14px radius.
28
32
  ================================================================ */
29
33
  .btn {
30
34
  display: inline-flex;
@@ -40,7 +44,7 @@
40
44
  color: var(--text-default);
41
45
  background: transparent;
42
46
  border: 1px solid transparent;
43
- border-radius: var(--radius-10);
47
+ border-radius: var(--radius-full);
44
48
  cursor: pointer;
45
49
  text-decoration: none;
46
50
  white-space: nowrap;
@@ -28,7 +28,7 @@
28
28
  min-width: 160px;
29
29
  background: var(--surface-overlay);
30
30
  border: 1px solid var(--border-default);
31
- border-radius: var(--radius-10);
31
+ border-radius: var(--radius-14);
32
32
  padding: var(--space-4) 0;
33
33
  /* Sprint 3a 2026-05-12: surface-overlay (parent) + border-default ger
34
34
  djupkanslag istallet for shadow. Dark-mode-doktrin (regel 10). */
@@ -142,7 +142,7 @@
142
142
  var(--surface-default) 100%
143
143
  );
144
144
  background-size: 200% 100%;
145
- border-radius: var(--radius-10);
145
+ border-radius: var(--radius-4);
146
146
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
147
147
  }
148
148
 
@@ -66,7 +66,7 @@
66
66
  padding: 0 var(--space-10);
67
67
  background: var(--surface-sunken);
68
68
  border: 1px solid var(--border-default);
69
- border-radius: var(--radius-10);
69
+ border-radius: var(--radius-full);
70
70
  color: var(--text-default);
71
71
  font-family: inherit;
72
72
  font-size: var(--fs-16);
@@ -27,6 +27,9 @@
27
27
 
28
28
  /* ================================================================
29
29
  ==== BAS
30
+ Pill-doktrin (DESIGN-LANGUAGE.md sektion 1, 2026-05-13): en-rads-
31
+ element med kant har radius-full. .input + .select är en-rads,
32
+ .textarea är multi-rad och behåller container-radius (14).
30
33
  ================================================================ */
31
34
  .input,
32
35
  .textarea,
@@ -41,7 +44,7 @@
41
44
  color: var(--text-default);
42
45
  background: var(--surface-sunken);
43
46
  border: 1px solid var(--border-default);
44
- border-radius: var(--radius-10);
47
+ border-radius: var(--radius-full);
45
48
  outline: none;
46
49
  transition:
47
50
  border-color var(--dur-base) var(--ease-spring-snappy),
@@ -55,6 +58,7 @@
55
58
  min-height: 96px;
56
59
  padding: var(--space-12) var(--space-14);
57
60
  line-height: var(--lh-base);
61
+ border-radius: var(--radius-14);
58
62
  resize: vertical;
59
63
  }
60
64
 
@@ -144,7 +144,7 @@
144
144
  font-weight: var(--fw-medium);
145
145
  letter-spacing: 0.05em;
146
146
  text-transform: uppercase;
147
- border-radius: var(--radius-10);
147
+ border-radius: var(--radius-full);
148
148
  border: 2px solid currentColor;
149
149
  opacity: 0;
150
150
  transition: opacity var(--dur-fast) var(--ease-default);
@@ -24,7 +24,7 @@
24
24
  padding: 0 var(--space-12);
25
25
  background: transparent;
26
26
  border: 0;
27
- border-radius: var(--radius-10);
27
+ border-radius: var(--radius-full);
28
28
  color: var(--text-subtle);
29
29
  font-family: inherit;
30
30
  font-size: var(--fs-14);
@@ -35,7 +35,7 @@
35
35
  font-size: var(--fs-12);
36
36
  line-height: var(--lh-snug);
37
37
  padding: var(--space-4) var(--space-8);
38
- border-radius: var(--radius-10);
38
+ border-radius: var(--radius-full);
39
39
  border: 1px solid var(--border-default);
40
40
  white-space: nowrap;
41
41
  pointer-events: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klodd/ds",
3
- "version": "3.17.2",
3
+ "version": "3.18.0",
4
4
  "description": "Klodd shared design system - tokens, components, JS",
5
5
  "main": "css/index.css",
6
6
  "bin": {
@@ -12,30 +12,41 @@ annat utan att layout-rytm bryts.
12
12
  Etablerad 2026-05-12 baserat på audit av 17 vyer (se
13
13
  `AUDIT-VISUAL-COHERENCE-2026-05-12.md`).
14
14
 
15
- ## 1. Border-radius-skala (fem värden)
15
+ ## 1. Border-radius-skala (fyra värden, pill-doktrin)
16
16
 
17
17
  **Regel:** all border-radius i komponent-CSS ska vara EN av:
18
18
 
19
19
  | Värde | Token | Användning |
20
20
  |---|---|---|
21
- | 4px | `--radius-4` | Thin-bars: progress, skeleton-line, split-bar-segment |
22
- | 10px | `--radius-10` | Button, inputs, tab-bar__item, small-action-button |
23
- | 14px | `--radius-14` | All cards/containers: card, panel, hub-card, job-card, swipe-card, banner, form-card, stat-card, list-row, setting-row, toast, dialog, sheet, collapsible, offline-wrap, sheet-content fields |
21
+ | 4px | `--radius-4` | Thin bars: progress, skeleton-placeholder, split-bar-segment |
22
+ | 14px | `--radius-14` | Kort/paneler/containers: card, panel, hub-card, job-card, swipe-card, banner, form-card, stat-card, list-row, setting-row, toast, dialog, sheet, collapsible, offline-wrap, dropdown-menu, textarea (multi-rad) |
24
23
  | 50% | (calculated) | Avatars, icon-circles, toggle-thumb |
25
- | 9999px | `--radius-full` | Pills: badge, chip, status-pill, dot-separator, score-pill |
26
-
27
- **Förbjudet:** 2px, 6px, 8px, 12px, 16px, 18px, 20px, 22px, 24px på
28
- komponent-element. (Existerar som tokens men ska inte appliceras
29
- direkt BR i komponent-CSS efter denna konsolidering.)
30
-
31
- **Rationale:** ögat skiljer på fem kategorier: thin-bar, button,
32
- container, circle, pill. 11+ värden ger visuell brus utan
33
- informations-värde. Calle's audit-observation "olika former" var
34
- denna BR-spridning.
35
-
36
- **Migration-not:** existerande paket-komponenter med BR=6/8/12/16/20/24
37
- flyttas till närmaste av de fem. Sprint 3b 2026-05-12 genomförde
38
- migrationen i paketet. App-domain-CSS följer samma regel.
24
+ | 9999px | `--radius-full` | Pills: alla knappar (.btn), inputs (single-rad), tab-bar__item, status-pill, score-pill, swipe-action-btn, swipe-decision-overlay, tooltip, badge, chip, dot-separator, alla en-rads-element med kant |
25
+
26
+ **Pill-doktrin (2026-05-13):** "Bara kort ska ha radius i hörnen.
27
+ Alla knappar och en-rads-element som har en kant ska ha en pill-form."
28
+ (Calle 2026-05-13.) Calle's tidigare audit-observation "olika former
29
+ nära varandra" var BR-spridningen + button-radius-10. Pill-formen
30
+ löser bägge.
31
+
32
+ **Förbjudet:** 2px, 6px, 8px, 10px, 12px, 16px, 18px, 20px, 22px, 24px på
33
+ komponent-element. (--radius-10 borttagen 2026-05-13.) Övriga tokens
34
+ existerar i primitives som legacy men appliceras INTE i komponent-CSS.
35
+
36
+ **Rationale:** ögat skiljer fyra kategorier:
37
+ - thin-bar (4px) - aldrig en kant, bara fill för progress
38
+ - container (14px) - kort, paneler, multi-rad-block
39
+ - circle (50%) - kvadratiska element som ska vara perfekt runda
40
+ - pill (full) - alla en-rads interaktiva element + alla en-rads med kant
41
+
42
+ Färre värden ger starkare visuell rytm. Pill-formen på knappar
43
+ markerar interaktivitet tydligare än mjuk 10px-radius och matchar
44
+ iOS-konvention (Apple HIG, SF Symbols badges).
45
+
46
+ **Migration-not:** Sprint 3b 2026-05-12 konsoliderade till fem värden
47
+ (4/10/14/50%/9999). 2026-05-13 reduceras till fyra (4/14/50%/9999) -
48
+ radius-10 → radius-full för button + en-rads-element med kant. App-
49
+ domain-CSS följer samma regel.
39
50
 
40
51
  ## 2. Shadow-policy (restriktiv)
41
52