@sentropic/design-system-svelte 0.10.0 → 0.10.2

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.
@@ -115,14 +115,22 @@
115
115
  align-items: center;
116
116
  background: transparent;
117
117
  border: 0;
118
- color: inherit;
118
+ /* Trigger colour (P-B): per theme. Default = primary text (inherited base
119
+ render); DSFR = Bleu France, Carbon = primary. */
120
+ color: var(--st-component-accordion-text, inherit);
119
121
  cursor: pointer;
120
122
  display: flex;
121
123
  font: inherit;
122
- font-weight: 600;
124
+ /* Per-theme trigger typography (P-B). Defaults reproduce the prior render:
125
+ font-size inherits the heading size (≈18.72px), weight 600, normal
126
+ line-height. DSFR pins 16px / 500 / 24px, Carbon 13.33px / 400. */
127
+ font-size: var(--st-component-accordion-fontSize, inherit);
128
+ font-weight: var(--st-component-accordion-fontWeight, 600);
129
+ line-height: var(--st-component-accordion-lineHeight, normal);
123
130
  gap: 0.75rem;
124
131
  justify-content: space-between;
125
- padding: 0.875rem 0.5rem;
132
+ padding: var(--st-component-accordion-paddingBlock, 0.875rem)
133
+ var(--st-component-accordion-paddingInline, 0.5rem);
126
134
  text-align: start;
127
135
  transition: background-color var(--st-motion-fast, 120ms) var(--st-motion-easing, ease);
128
136
  width: 100%;
package/dist/Alert.svelte CHANGED
@@ -41,30 +41,69 @@
41
41
  <style>
42
42
  .st-alert {
43
43
  background: var(--st-component-alert-background, var(--st-semantic-surface-raised));
44
- border: 1px solid var(--st-component-alert-border, var(--st-semantic-border-subtle));
45
- border-left-width: 0.25rem;
44
+ /* Per-side box border (P-B): top/right/bottom resolve per theme (base = 1px
45
+ subtle box; DSFR = none; Carbon = none — its only visible edge is the left
46
+ bar). Fallbacks reproduce the prior 1px subtle box. */
47
+ border-top: var(
48
+ --st-component-alert-borderTop,
49
+ 1px solid var(--st-component-alert-border, var(--st-semantic-border-subtle))
50
+ );
51
+ border-right: var(
52
+ --st-component-alert-borderRight,
53
+ 1px solid var(--st-component-alert-border, var(--st-semantic-border-subtle))
54
+ );
55
+ border-bottom: var(
56
+ --st-component-alert-borderBottom,
57
+ 1px solid var(--st-component-alert-border, var(--st-semantic-border-subtle))
58
+ );
59
+ /* Left accent edge: a real left border of `accentWidth` (base 4px / Carbon
60
+ 3px), coloured per severity via --alert-accent. DSFR sets accentWidth 0 and
61
+ draws the accent as a ::before filet instead (see below). */
62
+ border-left-style: solid;
63
+ border-left-width: var(--st-component-alert-accentWidth, 0.25rem);
64
+ border-left-color: var(--alert-accent, var(--st-semantic-feedback-info));
46
65
  border-radius: 0;
47
66
  color: var(--st-component-alert-text, var(--st-semantic-text-primary));
48
67
  display: flex;
68
+ font-size: var(--st-component-alert-fontSize, inherit);
69
+ line-height: var(--st-component-alert-lineHeight, normal);
70
+ letter-spacing: var(--st-component-alert-letterSpacing, normal);
49
71
  gap: var(--st-spacing-4, 1rem);
50
72
  justify-content: space-between;
51
- padding: var(--st-spacing-4, 1rem);
73
+ position: relative;
74
+ padding: var(--st-component-alert-paddingTop, var(--st-spacing-4, 1rem))
75
+ var(--st-component-alert-paddingRight, var(--st-spacing-4, 1rem))
76
+ var(--st-component-alert-paddingBottom, var(--st-spacing-4, 1rem))
77
+ var(--st-component-alert-paddingLeft, var(--st-spacing-4, 1rem));
78
+ }
79
+
80
+ /* Severity filet (DSFR): a left bar drawn as a ::before INSIDE the box, so it
81
+ adds NO measured border (the real `.fr-alert` accent technique). Width 0 by
82
+ default (base/Carbon use a real left border) → the bar is invisible. */
83
+ .st-alert::before {
84
+ background: var(--alert-accent, var(--st-semantic-feedback-info));
85
+ bottom: 0;
86
+ content: "";
87
+ left: 0;
88
+ position: absolute;
89
+ top: 0;
90
+ width: var(--st-component-alert-filetWidth, 0);
52
91
  }
53
92
 
54
93
  .st-alert--info {
55
- border-left-color: var(--st-component-alert-infoBorder, var(--st-semantic-feedback-info));
94
+ --alert-accent: var(--st-component-alert-infoBorder, var(--st-semantic-feedback-info));
56
95
  }
57
96
 
58
97
  .st-alert--success {
59
- border-left-color: var(--st-component-alert-successBorder, var(--st-semantic-feedback-success));
98
+ --alert-accent: var(--st-component-alert-successBorder, var(--st-semantic-feedback-success));
60
99
  }
61
100
 
62
101
  .st-alert--warning {
63
- border-left-color: var(--st-component-alert-warningBorder, var(--st-semantic-feedback-warning));
102
+ --alert-accent: var(--st-component-alert-warningBorder, var(--st-semantic-feedback-warning));
64
103
  }
65
104
 
66
105
  .st-alert--error {
67
- border-left-color: var(--st-component-alert-errorBorder, var(--st-semantic-feedback-error));
106
+ --alert-accent: var(--st-component-alert-errorBorder, var(--st-semantic-feedback-error));
68
107
  }
69
108
 
70
109
  .st-alert__content {
package/dist/Badge.svelte CHANGED
@@ -18,14 +18,20 @@
18
18
  </span>
19
19
 
20
20
  <style>
21
+ /* P-C: per-theme badge anatomy. Every var falls back to the prior base literal,
22
+ so a theme that emits no `--st-component-badge-*` renders byte-identically. */
21
23
  .st-badge {
22
24
  display: inline-flex;
23
25
  align-items: center;
24
- border-radius: var(--st-radius-pill, 999px);
25
- font-size: 0.75rem;
26
- font-weight: 650;
27
- line-height: 1;
28
- padding: 0.25rem 0.5rem;
26
+ border-radius: var(--st-component-badge-radius, var(--st-radius-pill, 999px));
27
+ font-size: var(--st-component-badge-fontSize, 0.75rem);
28
+ font-weight: var(--st-component-badge-fontWeight, 650);
29
+ letter-spacing: var(--st-component-badge-letterSpacing, normal);
30
+ line-height: var(--st-component-badge-lineHeight, 1);
31
+ min-height: var(--st-component-badge-minHeight, 0);
32
+ padding: var(--st-component-badge-paddingBlock, 0.25rem)
33
+ var(--st-component-badge-paddingInline, 0.5rem);
34
+ text-transform: var(--st-component-badge-textTransform, none);
29
35
  }
30
36
 
31
37
  .st-badge--neutral {
@@ -49,7 +55,10 @@
49
55
  }
50
56
 
51
57
  .st-badge--info {
52
- background: color-mix(in srgb, var(--st-semantic-feedback-info) 14%, white);
53
- color: var(--st-semantic-feedback-info);
58
+ background: var(
59
+ --st-component-badge-infoBackground,
60
+ color-mix(in srgb, var(--st-semantic-feedback-info) 14%, white)
61
+ );
62
+ color: var(--st-component-badge-infoText, var(--st-semantic-feedback-info));
54
63
  }
55
64
  </style>
@@ -35,6 +35,16 @@
35
35
  </nav>
36
36
 
37
37
  <style>
38
+ /* F10: breadcrumb typography on the root so the trail/link/separator inherit
39
+ the per-theme size/line-height/tracking. Defaults (inherit / normal) keep
40
+ the base Sent Tech render byte-identical; DSFR/Carbon pin their real metrics
41
+ (DSFR 12px/20px, Carbon 14px/18px/0.16px). */
42
+ .st-breadcrumb {
43
+ font-size: var(--st-component-breadcrumb-fontSize, inherit);
44
+ letter-spacing: var(--st-component-breadcrumb-letterSpacing, normal);
45
+ line-height: var(--st-component-breadcrumb-lineHeight, normal);
46
+ }
47
+
38
48
  .st-breadcrumb ol {
39
49
  align-items: center;
40
50
  display: flex;
@@ -58,7 +68,7 @@
58
68
 
59
69
  .st-breadcrumb [aria-current="page"] {
60
70
  color: var(--st-component-breadcrumb-currentText, var(--st-semantic-text-primary));
61
- font-weight: 600;
71
+ font-weight: var(--st-component-breadcrumb-currentWeight, 600);
62
72
  }
63
73
 
64
74
  .st-breadcrumb__separator {
@@ -57,10 +57,17 @@
57
57
  box-shadow var(--st-motion-fast, 120ms) var(--st-motion-easing, ease);
58
58
  }
59
59
 
60
+ /* Padding is 4-value (top right bottom left): the trailing side reads
61
+ `paddingInlineEnd` so a theme can make the button asymmetric (Carbon's
62
+ label-left primary button has a large right gutter) without a per-component
63
+ escape. `paddingInlineEnd` falls back to `paddingInline` → symmetric for the
64
+ base / DSFR (unchanged). */
60
65
  .st-button--sm {
61
66
  min-height: var(--st-component-button-anatomy-density-sm-controlHeight, 2rem);
62
67
  min-width: var(--st-component-button-anatomy-density-sm-minWidth, 2rem);
63
68
  padding: var(--st-component-button-anatomy-density-sm-paddingBlock, 0)
69
+ var(--st-component-button-anatomy-density-sm-paddingInlineEnd, var(--st-component-button-anatomy-density-sm-paddingInline, 0.75rem))
70
+ var(--st-component-button-anatomy-density-sm-paddingBlock, 0)
64
71
  var(--st-component-button-anatomy-density-sm-paddingInline, 0.75rem);
65
72
  font-size: var(--st-component-button-anatomy-density-sm-fontSize, 0.875rem);
66
73
  }
@@ -69,6 +76,8 @@
69
76
  min-height: var(--st-component-button-anatomy-density-md-controlHeight, 2.5rem);
70
77
  min-width: var(--st-component-button-anatomy-density-md-minWidth, 2.5rem);
71
78
  padding: var(--st-component-button-anatomy-density-md-paddingBlock, 0)
79
+ var(--st-component-button-anatomy-density-md-paddingInlineEnd, var(--st-component-button-anatomy-density-md-paddingInline, 1rem))
80
+ var(--st-component-button-anatomy-density-md-paddingBlock, 0)
72
81
  var(--st-component-button-anatomy-density-md-paddingInline, 1rem);
73
82
  font-size: var(--st-component-button-anatomy-density-md-fontSize, var(--st-component-button-anatomy-typography-size, 0.9375rem));
74
83
  }
@@ -77,6 +86,8 @@
77
86
  min-height: var(--st-component-button-anatomy-density-lg-controlHeight, 3rem);
78
87
  min-width: var(--st-component-button-anatomy-density-lg-minWidth, 3rem);
79
88
  padding: var(--st-component-button-anatomy-density-lg-paddingBlock, 0)
89
+ var(--st-component-button-anatomy-density-lg-paddingInlineEnd, var(--st-component-button-anatomy-density-lg-paddingInline, 1.25rem))
90
+ var(--st-component-button-anatomy-density-lg-paddingBlock, 0)
80
91
  var(--st-component-button-anatomy-density-lg-paddingInline, 1.25rem);
81
92
  font-size: var(--st-component-button-anatomy-density-lg-fontSize, 1rem);
82
93
  }
@@ -86,10 +97,15 @@
86
97
  color: var(--st-component-button-primaryText, var(--st-semantic-action-primaryText));
87
98
  }
88
99
 
100
+ /* Secondary (G1): the surface is per-theme. Base/Carbon = filled neutral with
101
+ a subtle stroke; DSFR « Bouton secondaire » = transparent fill + a 1px Bleu
102
+ France border + Bleu France text (outlined, not a light-blue fill). The
103
+ border colour reads its own component token so a theme can paint it Bleu
104
+ France; the fallback (--st-semantic-border-subtle) keeps the base render. */
89
105
  .st-button--secondary {
90
106
  background: var(--st-component-button-secondaryBackground, var(--st-semantic-action-secondary));
91
107
  color: var(--st-component-button-secondaryText, var(--st-semantic-action-secondaryText));
92
- border-color: var(--st-semantic-border-subtle);
108
+ border-color: var(--st-component-button-secondaryBorder, var(--st-semantic-border-subtle));
93
109
  }
94
110
 
95
111
  /* Anatomy v1.1.0: hover bg sourced from states.hover.bg (= primaryHover).
@@ -98,8 +114,12 @@
98
114
  background: var(--st-component-button-anatomy-states-hover-bg, var(--st-semantic-action-primary));
99
115
  }
100
116
 
117
+ /* Secondary hover (G1): a per-theme hover surface — DSFR puts a LIGHT Bleu
118
+ France fill on its otherwise-transparent outlined button. The component
119
+ token falls back to the base secondary hover surface so Sent Tech is
120
+ unchanged. */
101
121
  .st-button--secondary:not(:disabled):hover {
102
- background: var(--st-semantic-action-secondaryHover, var(--st-semantic-action-secondary));
122
+ background: var(--st-component-button-secondaryHoverBackground, var(--st-semantic-action-secondaryHover, var(--st-semantic-action-secondary)));
103
123
  }
104
124
 
105
125
  .st-button--ghost {
package/dist/Card.svelte CHANGED
@@ -27,6 +27,13 @@
27
27
  border-radius: var(--st-component-card-anatomy-shape-radius, 0.5rem);
28
28
  box-shadow: var(--st-component-card-shadow, 0 1px 2px rgb(15 23 42 / 0.08));
29
29
  color: var(--st-semantic-text-primary);
30
+ /* Card body typography (anatomy, F5). The base card carried no explicit
31
+ type — so the fallbacks reproduce that exact render (inherit / normal /
32
+ normal). DSFR pins line-height 24px (1.5); Carbon pins its real tile body
33
+ metrics (14px / 14px / 0.16px). Base Sent Tech unchanged. */
34
+ font-size: var(--st-component-card-anatomy-typography-size, inherit);
35
+ line-height: var(--st-component-card-anatomy-typography-lineHeight, normal);
36
+ letter-spacing: var(--st-component-card-anatomy-typography-letterSpacing, normal);
30
37
  padding: var(--st-spacing-4, 1rem);
31
38
  }
32
39
 
@@ -9,12 +9,11 @@
9
9
  };
10
10
 
11
11
  let { label, helperText, invalid = false, class: className, ...rest }: CheckboxProps = $props();
12
- const classes = () => ["st-choice", className].filter(Boolean).join(" ");
12
+ const classes = () => ["st-choice", "st-choice--checkbox", className].filter(Boolean).join(" ");
13
13
  </script>
14
14
 
15
15
  <label class={classes()}>
16
16
  <input {...rest} class="st-choice__input" type="checkbox" aria-invalid={invalid ? "true" : undefined} />
17
- <span class="st-choice__box" aria-hidden="true"></span>
18
17
  <span class="st-choice__content">
19
18
  <span class="st-choice__label">{label}</span>
20
19
  {#if helperText}<span class="st-choice__help">{helperText}</span>{/if}
@@ -25,23 +24,43 @@
25
24
  .st-choice {
26
25
  align-items: start;
27
26
  color: var(--st-component-field-labelText, var(--st-semantic-text-primary));
27
+ cursor: var(--st-cursor-interactive, pointer);
28
28
  display: inline-grid;
29
29
  gap: 0.625rem;
30
30
  grid-template-columns: auto 1fr;
31
31
  }
32
32
 
33
33
  .st-choice__input {
34
- /* Thématise la coche native (couleur checked) sans markup custom — additif,
35
- a11y native préservée. Le visuel custom (forme/focus par stratégie) reste
36
- un item dédié (cf. backlog). */
34
+ /* Natif stylé : couleur de coche thémée + taille + focus par stratégie
35
+ d'anatomie + états. Aucun widget custom, a11y native préservée. */
37
36
  accent-color: var(--st-component-selection-checkedBackground, var(--st-semantic-action-primary));
37
+ cursor: inherit;
38
38
  height: 1rem;
39
39
  margin: 0.125rem 0 0;
40
40
  width: 1rem;
41
41
  }
42
42
 
43
- .st-choice__box {
44
- display: none;
43
+ /* Focus = stratégie d'anatomie partagée (outline DSFR / inset Carbon / ring base). */
44
+ .st-choice__input:focus-visible {
45
+ outline: var(--st-component-control-anatomy-focus-outline, none);
46
+ outline-offset: var(--st-component-control-anatomy-focus-offset, 0);
47
+ box-shadow: var(--st-component-control-anatomy-focus-boxShadow,
48
+ 0 0 0 2px var(--st-component-control-focusRing, var(--st-semantic-border-interactive)));
49
+ }
50
+
51
+ .st-choice__input[aria-invalid="true"] {
52
+ accent-color: var(--st-component-control-invalidBorder, var(--st-semantic-feedback-error));
53
+ outline-color: var(--st-component-control-invalidBorder, var(--st-semantic-feedback-error));
54
+ }
55
+
56
+ .st-choice__input:disabled {
57
+ cursor: var(--st-cursor-disabled, not-allowed);
58
+ opacity: 0.55;
59
+ }
60
+
61
+ .st-choice:has(.st-choice__input:disabled) {
62
+ color: var(--st-component-control-disabledText, var(--st-semantic-text-muted));
63
+ cursor: var(--st-cursor-disabled, not-allowed);
45
64
  }
46
65
 
47
66
  .st-choice__content {
@@ -50,7 +69,12 @@
50
69
  }
51
70
 
52
71
  .st-choice__label {
53
- font-size: 0.9375rem;
72
+ /* P-D: label typography per theme (base = 15px / normal / inherited colour).
73
+ The checked control colour + focus stay on the native input above. */
74
+ color: var(--st-component-selection-choiceLabelColor, inherit);
75
+ font-size: var(--st-component-selection-choiceLabelFontSize, 0.9375rem);
76
+ line-height: var(--st-component-selection-choiceLabelLineHeight, normal);
77
+ letter-spacing: var(--st-component-selection-choiceLabelLetterSpacing, normal);
54
78
  }
55
79
 
56
80
  .st-choice__help {
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Checkbox.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,KAAK,aAAa,GAAG,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,MAAM,CAAC,GAAG;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAsBJ,QAAA,MAAM,QAAQ,mDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Checkbox.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Checkbox.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,KAAK,aAAa,GAAG,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,MAAM,CAAC,GAAG;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAqBJ,QAAA,MAAM,QAAQ,mDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}