@sondor-technology/sondor-components 1.0.1-develop.13 → 1.0.1-develop.14

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 (226) hide show
  1. package/dist/components/alert/alert.constants.d.ts +3 -0
  2. package/dist/components/alert/alert.constants.d.ts.map +1 -0
  3. package/dist/components/alert/alert.constants.js +2 -0
  4. package/dist/components/alert/alert.constants.js.map +1 -0
  5. package/dist/components/alert/alert.d.ts +4 -3
  6. package/dist/components/alert/alert.d.ts.map +1 -1
  7. package/dist/components/alert/alert.js +21 -11
  8. package/dist/components/alert/alert.js.map +1 -0
  9. package/dist/components/badge/badge.constants.d.ts +3 -0
  10. package/dist/components/badge/badge.constants.d.ts.map +1 -0
  11. package/dist/components/badge/badge.constants.js +2 -0
  12. package/dist/components/badge/badge.constants.js.map +1 -0
  13. package/dist/components/badge/badge.d.ts +1 -1
  14. package/dist/components/badge/badge.d.ts.map +1 -1
  15. package/dist/components/badge/badge.js +3 -2
  16. package/dist/components/badge/badge.js.map +1 -0
  17. package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
  18. package/dist/components/breadcrumb/breadcrumb.js +2 -1
  19. package/dist/components/breadcrumb/breadcrumb.js.map +1 -0
  20. package/dist/components/button/button.constants.d.ts +7 -0
  21. package/dist/components/button/button.constants.d.ts.map +1 -0
  22. package/dist/components/button/button.constants.js +4 -0
  23. package/dist/components/button/button.constants.js.map +1 -0
  24. package/dist/components/button/button.d.ts +8 -4
  25. package/dist/components/button/button.d.ts.map +1 -1
  26. package/dist/components/button/button.js +181 -137
  27. package/dist/components/button/button.js.map +1 -0
  28. package/dist/components/button-group/button-group.d.ts +1 -0
  29. package/dist/components/button-group/button-group.d.ts.map +1 -1
  30. package/dist/components/button-group/button-group.js +17 -21
  31. package/dist/components/button-group/button-group.js.map +1 -0
  32. package/dist/components/checkbox/checkbox.constants.d.ts +3 -0
  33. package/dist/components/checkbox/checkbox.constants.d.ts.map +1 -0
  34. package/dist/components/checkbox/checkbox.constants.js +2 -0
  35. package/dist/components/checkbox/checkbox.constants.js.map +1 -0
  36. package/dist/components/checkbox/checkbox.d.ts +5 -1
  37. package/dist/components/checkbox/checkbox.d.ts.map +1 -1
  38. package/dist/components/checkbox/checkbox.js +21 -5
  39. package/dist/components/checkbox/checkbox.js.map +1 -0
  40. package/dist/components/code-block/code-block.d.ts +7 -7
  41. package/dist/components/code-block/code-block.d.ts.map +1 -1
  42. package/dist/components/code-block/code-block.js +130 -66
  43. package/dist/components/code-block/code-block.js.map +1 -0
  44. package/dist/components/content-card/content-card.d.ts.map +1 -1
  45. package/dist/components/content-card/content-card.js +10 -15
  46. package/dist/components/content-card/content-card.js.map +1 -0
  47. package/dist/components/divider/divider.constants.d.ts +5 -0
  48. package/dist/components/divider/divider.constants.d.ts.map +1 -0
  49. package/dist/components/divider/divider.constants.js +3 -0
  50. package/dist/components/divider/divider.constants.js.map +1 -0
  51. package/dist/components/divider/divider.d.ts +4 -2
  52. package/dist/components/divider/divider.d.ts.map +1 -1
  53. package/dist/components/divider/divider.js +18 -9
  54. package/dist/components/divider/divider.js.map +1 -0
  55. package/dist/components/drawer/drawer.d.ts +7 -4
  56. package/dist/components/drawer/drawer.d.ts.map +1 -1
  57. package/dist/components/drawer/drawer.js +73 -30
  58. package/dist/components/drawer/drawer.js.map +1 -0
  59. package/dist/components/field/field.d.ts +2 -2
  60. package/dist/components/field/field.d.ts.map +1 -1
  61. package/dist/components/field/field.js +8 -9
  62. package/dist/components/field/field.js.map +1 -0
  63. package/dist/components/footer/footer.d.ts +8 -1
  64. package/dist/components/footer/footer.d.ts.map +1 -1
  65. package/dist/components/footer/footer.js +42 -12
  66. package/dist/components/footer/footer.js.map +1 -0
  67. package/dist/components/form/form-step.js +1 -0
  68. package/dist/components/form/form-step.js.map +1 -0
  69. package/dist/components/form/form.d.ts +3 -0
  70. package/dist/components/form/form.d.ts.map +1 -1
  71. package/dist/components/form/form.js +109 -69
  72. package/dist/components/form/form.js.map +1 -0
  73. package/dist/components/grid/grid-row.d.ts +3 -3
  74. package/dist/components/grid/grid-row.d.ts.map +1 -1
  75. package/dist/components/grid/grid-row.js +36 -22
  76. package/dist/components/grid/grid-row.js.map +1 -0
  77. package/dist/components/grid/grid.d.ts +2 -2
  78. package/dist/components/grid/grid.d.ts.map +1 -1
  79. package/dist/components/grid/grid.js +5 -2
  80. package/dist/components/grid/grid.js.map +1 -0
  81. package/dist/components/icon/icon-paths.d.ts +161 -86
  82. package/dist/components/icon/icon-paths.d.ts.map +1 -1
  83. package/dist/components/icon/icon-paths.js +176 -106
  84. package/dist/components/icon/icon-paths.js.map +1 -0
  85. package/dist/components/icon/icon.d.ts +1 -1
  86. package/dist/components/icon/icon.d.ts.map +1 -1
  87. package/dist/components/icon/icon.js +6 -5
  88. package/dist/components/icon/icon.js.map +1 -0
  89. package/dist/components/input/input.d.ts +9 -0
  90. package/dist/components/input/input.d.ts.map +1 -1
  91. package/dist/components/input/input.js +30 -37
  92. package/dist/components/input/input.js.map +1 -0
  93. package/dist/components/link/link.d.ts +6 -6
  94. package/dist/components/link/link.d.ts.map +1 -1
  95. package/dist/components/link/link.js +42 -19
  96. package/dist/components/link/link.js.map +1 -0
  97. package/dist/components/metadata/metadata.d.ts +3 -3
  98. package/dist/components/metadata/metadata.d.ts.map +1 -1
  99. package/dist/components/metadata/metadata.js +23 -20
  100. package/dist/components/metadata/metadata.js.map +1 -0
  101. package/dist/components/modal/modal.d.ts +4 -16
  102. package/dist/components/modal/modal.d.ts.map +1 -1
  103. package/dist/components/modal/modal.js +99 -62
  104. package/dist/components/modal/modal.js.map +1 -0
  105. package/dist/components/page-layout/page-layout.d.ts +4 -3
  106. package/dist/components/page-layout/page-layout.d.ts.map +1 -1
  107. package/dist/components/page-layout/page-layout.js +95 -68
  108. package/dist/components/page-layout/page-layout.js.map +1 -0
  109. package/dist/components/radio/radio.d.ts +8 -0
  110. package/dist/components/radio/radio.d.ts.map +1 -1
  111. package/dist/components/radio/radio.js +8 -12
  112. package/dist/components/radio/radio.js.map +1 -0
  113. package/dist/components/radio-group/radio-group.d.ts +6 -1
  114. package/dist/components/radio-group/radio-group.d.ts.map +1 -1
  115. package/dist/components/radio-group/radio-group.js +44 -18
  116. package/dist/components/radio-group/radio-group.js.map +1 -0
  117. package/dist/components/router/router.d.ts +5 -7
  118. package/dist/components/router/router.d.ts.map +1 -1
  119. package/dist/components/router/router.js +54 -38
  120. package/dist/components/router/router.js.map +1 -0
  121. package/dist/components/select/select.d.ts +1 -3
  122. package/dist/components/select/select.d.ts.map +1 -1
  123. package/dist/components/select/select.js +14 -5
  124. package/dist/components/select/select.js.map +1 -0
  125. package/dist/components/skeleton/skeleton.d.ts +3 -2
  126. package/dist/components/skeleton/skeleton.d.ts.map +1 -1
  127. package/dist/components/skeleton/skeleton.js +10 -13
  128. package/dist/components/skeleton/skeleton.js.map +1 -0
  129. package/dist/components/switch/switch.d.ts +12 -0
  130. package/dist/components/switch/switch.d.ts.map +1 -1
  131. package/dist/components/switch/switch.js +28 -22
  132. package/dist/components/switch/switch.js.map +1 -0
  133. package/dist/components/table/data-table.d.ts +3 -25
  134. package/dist/components/table/data-table.d.ts.map +1 -1
  135. package/dist/components/table/data-table.js +211 -146
  136. package/dist/components/table/data-table.js.map +1 -0
  137. package/dist/components/table/table.d.ts +3 -3
  138. package/dist/components/table/table.d.ts.map +1 -1
  139. package/dist/components/table/table.js +39 -20
  140. package/dist/components/table/table.js.map +1 -0
  141. package/dist/components/tabs/tab-panel.d.ts +3 -1
  142. package/dist/components/tabs/tab-panel.d.ts.map +1 -1
  143. package/dist/components/tabs/tab-panel.js +21 -11
  144. package/dist/components/tabs/tab-panel.js.map +1 -0
  145. package/dist/components/tabs/tab.d.ts +5 -1
  146. package/dist/components/tabs/tab.d.ts.map +1 -1
  147. package/dist/components/tabs/tab.js +46 -28
  148. package/dist/components/tabs/tab.js.map +1 -0
  149. package/dist/components/tabs/tabs.d.ts +4 -0
  150. package/dist/components/tabs/tabs.d.ts.map +1 -1
  151. package/dist/components/tabs/tabs.js +76 -13
  152. package/dist/components/tabs/tabs.js.map +1 -0
  153. package/dist/components/textarea/textarea.d.ts +13 -0
  154. package/dist/components/textarea/textarea.d.ts.map +1 -1
  155. package/dist/components/textarea/textarea.js +59 -13
  156. package/dist/components/textarea/textarea.js.map +1 -0
  157. package/dist/components/theme-toggle/theme-toggle.constants.d.ts +3 -0
  158. package/dist/components/theme-toggle/theme-toggle.constants.d.ts.map +1 -0
  159. package/dist/components/theme-toggle/theme-toggle.constants.js +2 -0
  160. package/dist/components/theme-toggle/theme-toggle.constants.js.map +1 -0
  161. package/dist/components/theme-toggle/theme-toggle.d.ts +3 -2
  162. package/dist/components/theme-toggle/theme-toggle.d.ts.map +1 -1
  163. package/dist/components/theme-toggle/theme-toggle.js +46 -19
  164. package/dist/components/theme-toggle/theme-toggle.js.map +1 -0
  165. package/dist/components/vertical-nav/vertical-nav-group.d.ts +5 -2
  166. package/dist/components/vertical-nav/vertical-nav-group.d.ts.map +1 -1
  167. package/dist/components/vertical-nav/vertical-nav-group.js +50 -14
  168. package/dist/components/vertical-nav/vertical-nav-group.js.map +1 -0
  169. package/dist/components/vertical-nav/vertical-nav-item.d.ts +3 -2
  170. package/dist/components/vertical-nav/vertical-nav-item.d.ts.map +1 -1
  171. package/dist/components/vertical-nav/vertical-nav-item.js +30 -8
  172. package/dist/components/vertical-nav/vertical-nav-item.js.map +1 -0
  173. package/dist/styles/index.css +48 -17
  174. package/dist/styles/reset.js +1 -0
  175. package/dist/styles/reset.js.map +1 -0
  176. package/package.json +2 -1
  177. package/src/components/alert/alert.constants.ts +2 -0
  178. package/src/components/alert/alert.ts +24 -15
  179. package/src/components/badge/badge.constants.ts +2 -0
  180. package/src/components/badge/badge.ts +3 -4
  181. package/src/components/breadcrumb/breadcrumb.ts +2 -2
  182. package/src/components/button/button.constants.ts +8 -0
  183. package/src/components/button/button.ts +184 -144
  184. package/src/components/button-group/button-group.ts +18 -22
  185. package/src/components/checkbox/checkbox.constants.ts +2 -0
  186. package/src/components/checkbox/checkbox.ts +33 -18
  187. package/src/components/code-block/code-block.ts +151 -84
  188. package/src/components/content-card/content-card.ts +10 -16
  189. package/src/components/divider/divider.constants.ts +5 -0
  190. package/src/components/divider/divider.ts +22 -11
  191. package/src/components/drawer/drawer.ts +79 -34
  192. package/src/components/field/field.ts +9 -11
  193. package/src/components/footer/footer.ts +43 -12
  194. package/src/components/form/form.ts +121 -84
  195. package/src/components/grid/grid-row.ts +45 -32
  196. package/src/components/grid/grid.ts +7 -4
  197. package/src/components/icon/icon-paths.ts +175 -106
  198. package/src/components/icon/icon.ts +6 -6
  199. package/src/components/input/input.ts +32 -42
  200. package/src/components/link/link.ts +45 -21
  201. package/src/components/metadata/metadata.ts +26 -24
  202. package/src/components/modal/modal.ts +108 -74
  203. package/src/components/page-layout/page-layout.ts +97 -72
  204. package/src/components/radio/radio.ts +8 -13
  205. package/src/components/radio-group/radio-group.ts +45 -21
  206. package/src/components/router/router.ts +73 -50
  207. package/src/components/select/select.ts +18 -19
  208. package/src/components/skeleton/skeleton.ts +14 -14
  209. package/src/components/switch/switch.ts +31 -25
  210. package/src/components/table/data-table.ts +248 -177
  211. package/src/components/table/table.ts +52 -29
  212. package/src/components/tabs/tab-panel.ts +25 -13
  213. package/src/components/tabs/tab.ts +58 -33
  214. package/src/components/tabs/tabs.ts +77 -15
  215. package/src/components/textarea/textarea.ts +63 -15
  216. package/src/components/theme-toggle/theme-toggle.constants.ts +2 -0
  217. package/src/components/theme-toggle/theme-toggle.ts +47 -22
  218. package/src/components/vertical-nav/vertical-nav-group.ts +57 -18
  219. package/src/components/vertical-nav/vertical-nav-item.ts +35 -12
  220. package/src/styles/globals.css +27 -4
  221. package/src/styles/theme.css +38 -32
  222. package/tsconfig.json +2 -1
  223. package/dist/components/card/card.d.ts +0 -11
  224. package/dist/components/card/card.d.ts.map +0 -1
  225. package/dist/components/card/card.js +0 -54
  226. package/src/components/card/card.ts +0 -53
@@ -1,41 +1,44 @@
1
- import { LitElement, html, css, PropertyValues } from 'lit';
2
- import { customElement, property, state } from 'lit/decorators.js';
3
- import { resetStyles } from '../../styles/reset.js';
1
+ import {LitElement, html, css, PropertyValues} from "lit";
2
+ import {customElement, property, state} from "lit/decorators.js";
3
+ import {resetStyles} from "../../styles/reset.js";
4
4
 
5
- export type LayoutVariant = 'app-shell' | 'content-sidebar' | 'single-column' | 'three-column';
5
+ export type LayoutVariant = "app-shell" | "content-sidebar" | "single-column" | "three-column";
6
6
 
7
- @customElement('st-page-layout')
7
+ @customElement("st-page-layout")
8
8
  export class StPageLayout extends LitElement {
9
9
  /**
10
10
  * Defines the structural layout variant to render.
11
11
  */
12
- @property({ type: String, reflect: true })
13
- variant: LayoutVariant = 'single-column';
12
+ @property({type: String, reflect: true})
13
+ variant: LayoutVariant = "single-column";
14
14
 
15
15
  /**
16
16
  * Maximum width for the left sidebar section (e.g., '20rem', '300px').
17
17
  */
18
- @property({ type: String, attribute: 'sidebar-width' })
19
- sidebarWidth = '';
18
+ @property({type: String, attribute: "sidebar-width"})
19
+ sidebarWidth = "";
20
20
 
21
21
  /**
22
22
  * Maximum width for the right sidebar section (e.g., '16rem', '250px').
23
23
  */
24
- @property({ type: String, attribute: 'right-sidebar-width' })
25
- rightSidebarWidth = '';
24
+ @property({type: String, attribute: "right-sidebar-width"})
25
+ rightSidebarWidth = "";
26
26
 
27
27
  /**
28
28
  * Optional maximum width for the main content area (e.g., '48rem', '800px').
29
29
  */
30
- @property({ type: String, attribute: 'main-max-width' })
31
- mainMaxWidth = '';
30
+ @property({type: String, attribute: "main-max-width"})
31
+ mainMaxWidth = "";
32
32
 
33
33
  /**
34
34
  * When true, expands the main content area to fill 100% of the available width between sidebars.
35
35
  */
36
- @property({ type: Boolean, attribute: 'fill-main', reflect: true })
36
+ @property({type: Boolean, attribute: "fill-main", reflect: true})
37
37
  fillMain = false;
38
38
 
39
+ @property({type: Boolean, attribute: "clear-footer-padding", reflect: true})
40
+ clearFooterPadding = false;
41
+
39
42
  @state()
40
43
  private _mobileMenuOpen = false;
41
44
 
@@ -46,27 +49,27 @@ export class StPageLayout extends LitElement {
46
49
  override updated(changedProperties: PropertyValues<this>) {
47
50
  super.updated(changedProperties);
48
51
 
49
- if (changedProperties.has('sidebarWidth')) {
52
+ if (changedProperties.has("sidebarWidth")) {
50
53
  if (this.sidebarWidth) {
51
- this.style.setProperty('--layout-sidebar-width', this.sidebarWidth);
54
+ this.style.setProperty("--layout-sidebar-width", this.sidebarWidth);
52
55
  } else {
53
- this.style.removeProperty('--layout-sidebar-width');
56
+ this.style.removeProperty("--layout-sidebar-width");
54
57
  }
55
58
  }
56
59
 
57
- if (changedProperties.has('rightSidebarWidth')) {
60
+ if (changedProperties.has("rightSidebarWidth")) {
58
61
  if (this.rightSidebarWidth) {
59
- this.style.setProperty('--layout-right-sidebar-width', this.rightSidebarWidth);
62
+ this.style.setProperty("--layout-right-sidebar-width", this.rightSidebarWidth);
60
63
  } else {
61
- this.style.removeProperty('--layout-right-sidebar-width');
64
+ this.style.removeProperty("--layout-right-sidebar-width");
62
65
  }
63
66
  }
64
67
 
65
- if (changedProperties.has('mainMaxWidth')) {
68
+ if (changedProperties.has("mainMaxWidth")) {
66
69
  if (this.mainMaxWidth) {
67
- this.style.setProperty('--layout-main-max-width', this.mainMaxWidth);
70
+ this.style.setProperty("--layout-main-max-width", this.mainMaxWidth);
68
71
  } else {
69
- this.style.removeProperty('--layout-main-max-width');
72
+ this.style.removeProperty("--layout-main-max-width");
70
73
  }
71
74
  }
72
75
  }
@@ -82,9 +85,9 @@ export class StPageLayout extends LitElement {
82
85
  // Only close if an actual navigation link/item was clicked
83
86
  private _handleNavClick = (e: MouseEvent) => {
84
87
  const path = e.composedPath();
85
- const clickedLink = path.some(node => {
88
+ const clickedLink = path.some((node) => {
86
89
  const el = node as HTMLElement;
87
- return el.tagName === 'A' || el.tagName === 'ST-VERTICAL-NAV-ITEM';
90
+ return el.tagName === "A" || el.tagName === "ST-VERTICAL-NAV-ITEM";
88
91
  });
89
92
 
90
93
  if (clickedLink) {
@@ -97,7 +100,7 @@ export class StPageLayout extends LitElement {
97
100
  this._touchStartX = e.touches[0].clientX;
98
101
  this._isDragging = true;
99
102
  const sidebar = e.currentTarget as HTMLElement;
100
- sidebar.style.transition = 'none';
103
+ sidebar.style.transition = "none";
101
104
  };
102
105
 
103
106
  private _handleTouchMove = (e: TouchEvent) => {
@@ -116,13 +119,13 @@ export class StPageLayout extends LitElement {
116
119
  if (!this._isDragging || window.innerWidth >= 768) return;
117
120
  this._isDragging = false;
118
121
  const sidebar = e.currentTarget as HTMLElement;
119
- sidebar.style.transition = '';
122
+ sidebar.style.transition = "";
120
123
 
121
124
  if (this._currentTranslateX < -70) {
122
125
  this._closeMobileMenu();
123
- sidebar.style.transform = '';
126
+ sidebar.style.transform = "";
124
127
  } else {
125
- sidebar.style.transform = '';
128
+ sidebar.style.transform = "";
126
129
  }
127
130
  this._currentTranslateX = 0;
128
131
  };
@@ -135,12 +138,12 @@ export class StPageLayout extends LitElement {
135
138
 
136
139
  connectedCallback() {
137
140
  super.connectedCallback();
138
- window.addEventListener('resize', this._resizeListener);
141
+ window.addEventListener("resize", this._resizeListener);
139
142
  }
140
143
 
141
144
  disconnectedCallback() {
142
145
  super.disconnectedCallback();
143
- window.removeEventListener('resize', this._resizeListener);
146
+ window.removeEventListener("resize", this._resizeListener);
144
147
  }
145
148
 
146
149
  static styles = [
@@ -158,7 +161,9 @@ export class StPageLayout extends LitElement {
158
161
  --layout-nav-height: 4rem;
159
162
  }
160
163
 
161
- *, *::before, *::after {
164
+ *,
165
+ *::before,
166
+ *::after {
162
167
  box-sizing: inherit;
163
168
  }
164
169
 
@@ -283,7 +288,7 @@ export class StPageLayout extends LitElement {
283
288
  overflow: hidden;
284
289
  background-color: var(--layout-surface-color);
285
290
  }
286
-
291
+
287
292
  .app-shell-sidebar {
288
293
  display: none;
289
294
  border-right: 1px solid var(--layout-border-color);
@@ -294,14 +299,14 @@ export class StPageLayout extends LitElement {
294
299
  flex: 1;
295
300
  overflow-y: auto;
296
301
  }
297
-
302
+
298
303
  .app-shell-content {
299
304
  display: flex;
300
305
  flex-direction: column;
301
306
  flex: 1;
302
307
  width: 100%;
303
308
  }
304
-
309
+
305
310
  .app-shell-nav {
306
311
  height: var(--layout-nav-height);
307
312
  border-bottom: 1px solid var(--layout-border-color);
@@ -310,13 +315,13 @@ export class StPageLayout extends LitElement {
310
315
  align-items: center;
311
316
  padding: 0 var(--st-spacing-md);
312
317
  }
313
-
318
+
314
319
  .app-shell-main {
315
320
  flex: 1;
316
321
  overflow-y: auto;
317
322
  padding: var(--st-spacing-lg);
318
323
  }
319
-
324
+
320
325
  .app-shell-footer {
321
326
  background: var(--layout-bg-color);
322
327
  border-top: 1px solid var(--layout-border-color);
@@ -342,12 +347,12 @@ export class StPageLayout extends LitElement {
342
347
  flex-direction: column;
343
348
  background: var(--layout-bg-color);
344
349
  }
345
-
350
+
346
351
  .content-sidebar-nav {
347
352
  border-bottom: 1px solid var(--layout-border-color);
348
353
  background: var(--layout-bg-color);
349
354
  }
350
-
355
+
351
356
  .content-sidebar-container {
352
357
  flex: 1;
353
358
  width: 100%;
@@ -358,17 +363,17 @@ export class StPageLayout extends LitElement {
358
363
  flex-direction: column;
359
364
  gap: var(--st-spacing-xl);
360
365
  }
361
-
366
+
362
367
  .content-sidebar-main {
363
368
  flex: 1;
364
369
  max-width: 48rem;
365
370
  }
366
-
371
+
367
372
  .content-sidebar-aside {
368
373
  width: 100%;
369
374
  flex-shrink: 0;
370
375
  }
371
-
376
+
372
377
  .content-sidebar-footer {
373
378
  margin-top: auto;
374
379
  border-top: 1px solid var(--layout-border-color);
@@ -399,7 +404,7 @@ export class StPageLayout extends LitElement {
399
404
  flex-direction: column;
400
405
  background: var(--layout-bg-color);
401
406
  }
402
-
407
+
403
408
  .single-column-nav {
404
409
  position: sticky;
405
410
  top: 0;
@@ -408,13 +413,13 @@ export class StPageLayout extends LitElement {
408
413
  background: var(--layout-bg-color);
409
414
  border-bottom: 1px solid var(--layout-border-color);
410
415
  }
411
-
416
+
412
417
  .single-column-main {
413
418
  flex: 1;
414
419
  display: flex;
415
420
  flex-direction: column;
416
421
  }
417
-
422
+
418
423
  .single-column-footer {
419
424
  margin-top: auto;
420
425
  }
@@ -502,6 +507,10 @@ export class StPageLayout extends LitElement {
502
507
  padding: var(--st-spacing-lg);
503
508
  }
504
509
 
510
+ :host([clear-footer-padding]) footer {
511
+ padding: 0;
512
+ }
513
+
505
514
  @media (min-width: 768px) {
506
515
  .three-column-sidebar-left {
507
516
  display: block;
@@ -548,19 +557,23 @@ export class StPageLayout extends LitElement {
548
557
  overflow-y: auto;
549
558
  }
550
559
  }
551
- `
560
+ `,
552
561
  ];
553
562
 
554
563
  render() {
555
564
  const backdrop = html`
556
- <div
557
- class="mobile-backdrop ${this._mobileMenuOpen ? 'open' : ''}"
565
+ <div
566
+ class="mobile-backdrop ${this._mobileMenuOpen ? "open" : ""}"
558
567
  @click=${this._closeMobileMenu}
559
568
  ></div>
560
569
  `;
561
570
 
562
571
  const hamburgerBtn = html`
563
- <button class="mobile-menu-btn" @click=${this._toggleMobileMenu} aria-label="Open Navigation Menu">
572
+ <button
573
+ class="mobile-menu-btn"
574
+ @click=${this._toggleMobileMenu}
575
+ aria-label="Open Navigation Menu"
576
+ >
564
577
  <svg viewBox="0 0 24 24"><path d="M3 12h18M3 6h18M3 18h18"></path></svg>
565
578
  </button>
566
579
  `;
@@ -568,18 +581,23 @@ export class StPageLayout extends LitElement {
568
581
  const drawerHeader = html`
569
582
  <div class="mobile-drawer-header">
570
583
  <span class="mobile-drawer-title">Menu</span>
571
- <button class="mobile-close-btn" @click=${this._closeMobileMenu} aria-label="Close Navigation Menu">
584
+ <button
585
+ class="mobile-close-btn"
586
+ @click=${this._closeMobileMenu}
587
+ aria-label="Close Navigation Menu"
588
+ >
572
589
  <svg viewBox="0 0 24 24"><path d="M18 6L6 18M6 6l12 12"></path></svg>
573
590
  </button>
574
591
  </div>
575
592
  `;
576
593
 
577
- if (this.variant === 'app-shell') {
594
+ if (this.variant === "app-shell") {
578
595
  return html`
579
596
  ${backdrop}
580
597
  <div class="layout-app-shell">
581
- <aside
582
- class="app-shell-sidebar ${this._mobileMenuOpen ? 'open' : ''}"
598
+ <aside
599
+ class="app-shell-sidebar ${this._mobileMenuOpen ? "open" : ""}"
600
+ aria-label="Primary Sidebar"
583
601
  @click=${this._handleNavClick}
584
602
  @touchstart=${this._handleTouchStart}
585
603
  @touchmove=${this._handleTouchMove}
@@ -590,17 +608,17 @@ export class StPageLayout extends LitElement {
590
608
  <slot name="sidebar"></slot>
591
609
  </div>
592
610
  </aside>
593
-
611
+
594
612
  <div class="app-shell-content">
595
613
  <header class="app-shell-nav">
596
614
  ${hamburgerBtn}
597
615
  <slot name="nav"></slot>
598
616
  </header>
599
-
617
+
600
618
  <main class="app-shell-main">
601
619
  <slot></slot>
602
620
  </main>
603
-
621
+
604
622
  <footer class="app-shell-footer">
605
623
  <slot name="footer"></slot>
606
624
  </footer>
@@ -609,27 +627,29 @@ export class StPageLayout extends LitElement {
609
627
  `;
610
628
  }
611
629
 
612
- if (this.variant === 'content-sidebar') {
630
+ if (this.variant === "content-sidebar") {
613
631
  return html`
614
632
  <div class="layout-content-sidebar">
615
633
  <header class="content-sidebar-nav">
616
- <div style="display: flex; align-items: center; padding: 0 var(--st-spacing-md); height: var(--layout-nav-height);">
634
+ <div
635
+ style="display: flex; align-items: center; padding: 0 var(--st-spacing-md); height: var(--layout-nav-height);"
636
+ >
617
637
  <slot name="nav"></slot>
618
638
  </div>
619
639
  </header>
620
-
640
+
621
641
  <div class="content-sidebar-container">
622
642
  <main class="content-sidebar-main">
623
643
  <slot></slot>
624
644
  </main>
625
-
626
- <aside class="content-sidebar-aside">
645
+
646
+ <aside class="content-sidebar-aside" aria-label="Related Content">
627
647
  <div class="content-sidebar-aside-inner">
628
648
  <slot name="aside"></slot>
629
649
  </div>
630
650
  </aside>
631
651
  </div>
632
-
652
+
633
653
  <footer class="content-sidebar-footer">
634
654
  <slot name="footer"></slot>
635
655
  </footer>
@@ -637,7 +657,7 @@ export class StPageLayout extends LitElement {
637
657
  `;
638
658
  }
639
659
 
640
- if (this.variant === 'three-column') {
660
+ if (this.variant === "three-column") {
641
661
  return html`
642
662
  ${backdrop}
643
663
  <div class="layout-three-column">
@@ -647,8 +667,9 @@ export class StPageLayout extends LitElement {
647
667
  </header>
648
668
 
649
669
  <div class="three-column-body">
650
- <aside
651
- class="three-column-sidebar-left ${this._mobileMenuOpen ? 'open' : ''}"
670
+ <aside
671
+ class="three-column-sidebar-left ${this._mobileMenuOpen ? "open" : ""}"
672
+ aria-label="Primary Sidebar"
652
673
  @click=${this._handleNavClick}
653
674
  @touchstart=${this._handleTouchStart}
654
675
  @touchmove=${this._handleTouchMove}
@@ -664,7 +685,7 @@ export class StPageLayout extends LitElement {
664
685
  <slot></slot>
665
686
  </main>
666
687
 
667
- <aside class="three-column-sidebar-right">
688
+ <aside class="three-column-sidebar-right" aria-label="Secondary Sidebar">
668
689
  <div class="three-column-sidebar-right-inner">
669
690
  <slot name="sidebar-right"></slot>
670
691
  </div>
@@ -681,16 +702,20 @@ export class StPageLayout extends LitElement {
681
702
  return html`
682
703
  <div class="layout-single-column">
683
704
  <header class="single-column-nav">
684
- <div style="display: flex; align-items: center; padding: 0 var(--st-spacing-md); height: var(--layout-nav-height);">
705
+ <div
706
+ style="display: flex; align-items: center; padding: 0 var(--st-spacing-md); height: var(--layout-nav-height);"
707
+ >
685
708
  <slot name="nav"></slot>
686
709
  </div>
687
710
  </header>
688
-
711
+
689
712
  <main class="single-column-main">
690
713
  <slot></slot>
691
714
  </main>
692
-
693
- <footer class="single-column-footer">
715
+
716
+ <footer
717
+ class="single-column-footer ${this.clearFooterPadding ? "clear-footer-padding" : ""}"
718
+ >
694
719
  <slot name="footer"></slot>
695
720
  </footer>
696
721
  </div>
@@ -700,6 +725,6 @@ export class StPageLayout extends LitElement {
700
725
 
701
726
  declare global {
702
727
  interface HTMLElementTagNameMap {
703
- 'st-page-layout': StPageLayout;
728
+ "st-page-layout": StPageLayout;
704
729
  }
705
- }
730
+ }
@@ -1,13 +1,15 @@
1
1
  import {LitElement, html, css} from "lit";
2
2
  import {customElement, property} from "lit/decorators.js";
3
+ import {ifDefined} from "lit/directives/if-defined.js";
3
4
  import {resetStyles} from "../../styles/reset.js";
4
5
 
5
6
  @customElement("st-radio")
6
7
  export class StRadio extends LitElement {
8
+ static shadowRootOptions = {...LitElement.shadowRootOptions, delegatesFocus: true};
9
+
7
10
  @property({type: String}) value = "";
8
11
  @property({type: Boolean, reflect: true}) checked = false;
9
12
  @property({type: Boolean, reflect: true}) disabled = false;
10
-
11
13
  @property({attribute: "aria-label"}) ariaLabel = "";
12
14
 
13
15
  static styles = [
@@ -28,7 +30,6 @@ export class StRadio extends LitElement {
28
30
  font-size: var(--st-font-size-base);
29
31
  }
30
32
 
31
- /* Hide the native input visually, but keep it accessible for screen readers */
32
33
  input {
33
34
  position: absolute;
34
35
  width: 1px;
@@ -41,7 +42,6 @@ export class StRadio extends LitElement {
41
42
  border-width: 0;
42
43
  }
43
44
 
44
- /* Custom Radio Circle */
45
45
  .control {
46
46
  display: flex;
47
47
  align-items: center;
@@ -55,45 +55,42 @@ export class StRadio extends LitElement {
55
55
  flex-shrink: 0;
56
56
  }
57
57
 
58
- /* Inner Dot (Hidden by default) */
59
58
  .control::after {
60
59
  content: "";
61
60
  width: 0.625rem;
62
61
  height: 0.625rem;
63
62
  border-radius: 50%;
64
- background-color: var(--st-color-bg); /* Matches the dot color to background initially */
63
+ background-color: var(--st-color-bg);
65
64
  transition:
66
65
  transform 0.2s ease,
67
66
  background-color 0.2s ease;
68
67
  transform: scale(0);
69
68
  }
70
69
 
71
- /* Hover State */
72
70
  label:hover .control {
73
71
  border-color: var(--st-color-primary-hover);
74
72
  }
75
73
 
76
- /* Focus State (Driven by the hidden input) */
77
74
  input:focus-visible + .control {
78
75
  box-shadow:
79
76
  0 0 0 2px var(--st-color-bg),
80
77
  0 0 0 4px var(--st-color-primary);
81
78
  }
82
79
 
83
- /* Checked State */
84
80
  :host([checked]) .control {
85
81
  border-color: var(--st-color-primary);
86
82
  background-color: var(--st-color-primary);
87
83
  }
84
+
88
85
  :host([checked]) .control::after {
89
- background-color: var(--st-white); /* White dot inside the primary circle */
86
+ background-color: #ffffff; /* Explicitly white for contrast */
90
87
  transform: scale(1);
91
88
  }
92
89
 
93
- /* Disabled State */
94
90
  :host([disabled]) {
95
91
  pointer-events: none;
96
92
  }
93
+
97
94
  :host([disabled]) label {
98
95
  opacity: 0.5;
99
96
  cursor: not-allowed;
@@ -102,11 +99,9 @@ export class StRadio extends LitElement {
102
99
  ];
103
100
 
104
101
  private _handleChange(e: Event) {
105
- // Prevent the native change event from leaking out
106
102
  e.stopPropagation();
107
103
 
108
104
  if (!this.disabled) {
109
- // Dispatch a custom event to tell the parent group this radio was selected
110
105
  this.dispatchEvent(
111
106
  new CustomEvent("st-radio-select", {
112
107
  detail: {value: this.value},
@@ -122,7 +117,7 @@ export class StRadio extends LitElement {
122
117
  <label>
123
118
  <input
124
119
  type="radio"
125
- aria-label=${this.ariaLabel || ""}
120
+ aria-label=${ifDefined(this.ariaLabel || undefined)}
126
121
  .value=${this.value}
127
122
  .checked=${this.checked}
128
123
  ?disabled=${this.disabled}
@@ -12,23 +12,23 @@ export class StRadioGroup extends LitElement {
12
12
  @property({type: String}) value = "";
13
13
  @property({type: String}) label = "";
14
14
  @property({attribute: "help-text"}) helpText = "";
15
+ @property({type: String, reflect: true}) layout: "vertical" | "horizontal" = "vertical";
16
+ @property({type: Boolean, reflect: true}) required = false;
15
17
  @property({type: Boolean, reflect: true}) disabled = false;
16
18
  @property({type: Boolean, reflect: true}) invalid = false;
17
19
 
18
- // Grabs all slotted st-radio components automatically
19
20
  @queryAssignedElements({selector: "st-radio"})
20
21
  private _radios!: StRadio[];
21
22
 
22
23
  constructor() {
23
24
  super();
24
25
  this._internals = this.attachInternals();
26
+ this._internals.role = "radiogroup";
25
27
 
26
- // 1. Trigger error state if the user clicks away and the field is invalid
27
28
  this.addEventListener("change", () => {
28
29
  this.invalid = !this._internals.validity.valid;
29
30
  });
30
31
 
31
- // 2. Trigger error state if the st-form tries to submit and fails
32
32
  this.addEventListener("invalid", () => {
33
33
  this.invalid = true;
34
34
  });
@@ -64,7 +64,6 @@ export class StRadioGroup extends LitElement {
64
64
  gap: var(--st-spacing-sm);
65
65
  }
66
66
 
67
- /* Horizontal layout modifier */
68
67
  :host([layout="horizontal"]) .options {
69
68
  flex-direction: row;
70
69
  gap: var(--st-spacing-md);
@@ -76,36 +75,40 @@ export class StRadioGroup extends LitElement {
76
75
  margin: 0;
77
76
  }
78
77
 
79
- :host([invalid]) .help-text {
80
- color: var(--st-color-error);
81
- }
78
+ :host([invalid]) .help-text,
82
79
  :host([invalid]) legend {
83
80
  color: var(--st-color-error);
84
81
  }
85
82
  `,
86
83
  ];
87
84
 
85
+ private _handleRadioSelect = (e: Event) => {
86
+ if (this.disabled) return;
87
+
88
+ const customEvent = e as CustomEvent<{value: string}>;
89
+ this.value = customEvent.detail.value;
90
+
91
+ // 🚀 THE FIX: Clear the invalid visual state as soon as the user makes a selection
92
+ if (this.invalid) {
93
+ this.invalid = false;
94
+ }
95
+
96
+ this.dispatchEvent(new Event("change", {bubbles: true, composed: true}));
97
+ };
98
+
88
99
  connectedCallback() {
89
100
  super.connectedCallback();
90
- // Listen for selections from child radios
91
- this.addEventListener("st-radio-select", this._handleRadioSelect as EventListener);
101
+ this.addEventListener("st-radio-select", this._handleRadioSelect);
92
102
  }
93
103
 
94
104
  disconnectedCallback() {
95
105
  super.disconnectedCallback();
96
- this.removeEventListener("st-radio-select", this._handleRadioSelect as EventListener);
97
- }
98
-
99
- private _handleRadioSelect(e: CustomEvent<{value: string}>) {
100
- if (this.disabled) return;
101
- this.value = e.detail.value;
102
- this.dispatchEvent(new Event("change", {bubbles: true, composed: true}));
106
+ this.removeEventListener("st-radio-select", this._handleRadioSelect);
103
107
  }
104
108
 
105
109
  override updated(changedProperties: PropertyValues<this>) {
106
110
  super.updated(changedProperties);
107
111
 
108
- // When the group's value changes, sync the form and update all child radios
109
112
  if (changedProperties.has("value")) {
110
113
  this._internals.setFormValue(this.value);
111
114
  this._syncRadios();
@@ -114,9 +117,20 @@ export class StRadioGroup extends LitElement {
114
117
  if (changedProperties.has("disabled")) {
115
118
  this._syncRadios();
116
119
  }
120
+
121
+ if (changedProperties.has("value") || changedProperties.has("required")) {
122
+ this._syncValidity();
123
+ }
124
+ }
125
+
126
+ private _syncValidity() {
127
+ if (this.required && !this.value) {
128
+ this._internals.setValidity({valueMissing: true}, "Please select an option.");
129
+ } else {
130
+ this._internals.setValidity({});
131
+ }
117
132
  }
118
133
 
119
- // Loops through children and unchecks/checks them based on the group's current value
120
134
  private _syncRadios() {
121
135
  if (!this._radios) return;
122
136
 
@@ -128,11 +142,21 @@ export class StRadioGroup extends LitElement {
128
142
  });
129
143
  }
130
144
 
131
- // Fired natively by the browser if the parent <form> is reset
132
145
  formResetCallback() {
133
- this.value = "";
134
- this._internals.setFormValue("");
146
+ const initialValue = this.getAttribute("value") || "";
147
+ this.value = initialValue;
148
+ this._internals.setFormValue(initialValue);
135
149
  this._syncRadios();
150
+ this.updateComplete.then(() => this._syncValidity());
151
+ }
152
+
153
+ // Expose standard native methods
154
+ checkValidity() {
155
+ return this._internals.checkValidity();
156
+ }
157
+
158
+ reportValidity() {
159
+ return this._internals.reportValidity();
136
160
  }
137
161
 
138
162
  render() {