@sondor-technology/sondor-components 1.0.0 → 1.0.1-develop.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.
Files changed (168) hide show
  1. package/README.md +8 -0
  2. package/dist/components/alert/alert.d.ts +13 -0
  3. package/dist/components/alert/alert.d.ts.map +1 -0
  4. package/dist/components/alert/alert.js +105 -0
  5. package/dist/components/badge/badge.d.ts +13 -0
  6. package/dist/components/badge/badge.d.ts.map +1 -0
  7. package/dist/components/badge/badge.js +101 -0
  8. package/dist/components/breadcrumb/breadcrumb.d.ts +19 -0
  9. package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -0
  10. package/dist/components/breadcrumb/breadcrumb.js +99 -0
  11. package/dist/components/button/button.d.ts +23 -0
  12. package/dist/components/button/button.d.ts.map +1 -0
  13. package/dist/components/button/button.js +304 -0
  14. package/dist/components/button-group/button-group.d.ts +6 -0
  15. package/dist/components/button-group/button-group.d.ts.map +1 -0
  16. package/dist/components/button-group/button-group.js +74 -0
  17. package/dist/components/card/card.d.ts +11 -0
  18. package/dist/components/card/card.d.ts.map +1 -0
  19. package/dist/components/card/card.js +54 -0
  20. package/dist/components/checkbox/checkbox.d.ts +28 -0
  21. package/dist/components/checkbox/checkbox.d.ts.map +1 -0
  22. package/dist/components/checkbox/checkbox.js +247 -0
  23. package/dist/components/code-block/code-block.d.ts +20 -0
  24. package/dist/components/code-block/code-block.d.ts.map +1 -0
  25. package/dist/components/code-block/code-block.js +260 -0
  26. package/dist/components/content-card/content-card.d.ts +13 -0
  27. package/dist/components/content-card/content-card.d.ts.map +1 -0
  28. package/dist/components/content-card/content-card.js +140 -0
  29. package/dist/components/divider/divider.d.ts +16 -0
  30. package/dist/components/divider/divider.d.ts.map +1 -0
  31. package/dist/components/divider/divider.js +82 -0
  32. package/dist/components/drawer/drawer.d.ts +22 -0
  33. package/dist/components/drawer/drawer.d.ts.map +1 -0
  34. package/dist/components/drawer/drawer.js +226 -0
  35. package/dist/components/field/field.d.ts +11 -0
  36. package/dist/components/field/field.d.ts.map +1 -0
  37. package/dist/components/field/field.js +32 -0
  38. package/dist/components/footer/footer.d.ts +6 -0
  39. package/dist/components/footer/footer.d.ts.map +1 -0
  40. package/dist/components/footer/footer.js +65 -0
  41. package/dist/components/form/form-step.d.ts +13 -0
  42. package/dist/components/form/form-step.d.ts.map +1 -0
  43. package/dist/components/form/form-step.js +41 -0
  44. package/dist/components/form/form.d.ts +25 -0
  45. package/dist/components/form/form.d.ts.map +1 -0
  46. package/dist/components/form/form.js +358 -0
  47. package/dist/components/grid/grid-row.d.ts +17 -0
  48. package/dist/components/grid/grid-row.d.ts.map +1 -0
  49. package/dist/components/grid/grid-row.js +92 -0
  50. package/dist/components/grid/grid.d.ts +13 -0
  51. package/dist/components/grid/grid.d.ts.map +1 -0
  52. package/dist/components/grid/grid.js +42 -0
  53. package/dist/components/icon/icon-paths.d.ts +116 -0
  54. package/dist/components/icon/icon-paths.d.ts.map +1 -0
  55. package/dist/components/icon/icon-paths.js +121 -0
  56. package/dist/components/icon/icon.d.ts +16 -0
  57. package/dist/components/icon/icon.d.ts.map +1 -0
  58. package/dist/components/icon/icon.js +95 -0
  59. package/dist/components/input/input.d.ts +31 -0
  60. package/dist/components/input/input.d.ts.map +1 -0
  61. package/dist/components/input/input.js +268 -0
  62. package/dist/components/link/link.d.ts +16 -0
  63. package/dist/components/link/link.d.ts.map +1 -0
  64. package/dist/components/link/link.js +116 -0
  65. package/dist/components/metadata/metadata.d.ts +18 -0
  66. package/dist/components/metadata/metadata.d.ts.map +1 -0
  67. package/dist/components/metadata/metadata.js +71 -0
  68. package/dist/components/modal/modal.d.ts +24 -0
  69. package/dist/components/modal/modal.d.ts.map +1 -0
  70. package/dist/components/modal/modal.js +163 -0
  71. package/dist/components/page-layout/page-layout.d.ts +46 -0
  72. package/dist/components/page-layout/page-layout.d.ts.map +1 -0
  73. package/dist/components/page-layout/page-layout.js +697 -0
  74. package/dist/components/radio/radio.d.ts +16 -0
  75. package/dist/components/radio/radio.d.ts.map +1 -0
  76. package/dist/components/radio/radio.js +152 -0
  77. package/dist/components/radio-group/radio-group.d.ts +27 -0
  78. package/dist/components/radio-group/radio-group.d.ts.map +1 -0
  79. package/dist/components/radio-group/radio-group.js +161 -0
  80. package/dist/components/router/router.d.ts +7 -0
  81. package/dist/components/router/router.d.ts.map +1 -0
  82. package/dist/components/router/router.js +37 -0
  83. package/dist/components/select/select.d.ts +16 -0
  84. package/dist/components/select/select.d.ts.map +1 -0
  85. package/dist/components/select/select.js +172 -0
  86. package/dist/components/skeleton/skeleton.d.ts +17 -0
  87. package/dist/components/skeleton/skeleton.d.ts.map +1 -0
  88. package/dist/components/skeleton/skeleton.js +78 -0
  89. package/dist/components/switch/switch.d.ts +25 -0
  90. package/dist/components/switch/switch.d.ts.map +1 -0
  91. package/dist/components/switch/switch.js +185 -0
  92. package/dist/components/table/data-table.d.ts +72 -0
  93. package/dist/components/table/data-table.d.ts.map +1 -0
  94. package/dist/components/table/data-table.js +551 -0
  95. package/dist/components/table/table.d.ts +22 -0
  96. package/dist/components/table/table.d.ts.map +1 -0
  97. package/dist/components/table/table.js +167 -0
  98. package/dist/components/tabs/tab-panel.d.ts +8 -0
  99. package/dist/components/tabs/tab-panel.d.ts.map +1 -0
  100. package/dist/components/tabs/tab-panel.js +46 -0
  101. package/dist/components/tabs/tab.d.ts +9 -0
  102. package/dist/components/tabs/tab.d.ts.map +1 -0
  103. package/dist/components/tabs/tab.js +91 -0
  104. package/dist/components/tabs/tabs.d.ts +14 -0
  105. package/dist/components/tabs/tabs.d.ts.map +1 -0
  106. package/dist/components/tabs/tabs.js +85 -0
  107. package/dist/components/textarea/textarea.d.ts +36 -0
  108. package/dist/components/textarea/textarea.d.ts.map +1 -0
  109. package/dist/components/textarea/textarea.js +231 -0
  110. package/dist/components/theme-toggle/theme-toggle.d.ts +15 -0
  111. package/dist/components/theme-toggle/theme-toggle.d.ts.map +1 -0
  112. package/dist/components/theme-toggle/theme-toggle.js +130 -0
  113. package/dist/components/vertical-nav/vertical-nav-group.d.ts +9 -0
  114. package/dist/components/vertical-nav/vertical-nav-group.d.ts.map +1 -0
  115. package/dist/components/vertical-nav/vertical-nav-group.js +111 -0
  116. package/dist/components/vertical-nav/vertical-nav-item.d.ts +8 -0
  117. package/dist/components/vertical-nav/vertical-nav-item.d.ts.map +1 -0
  118. package/dist/components/vertical-nav/vertical-nav-item.js +65 -0
  119. package/dist/styles/index.css +171 -0
  120. package/dist/styles/reset.d.ts +2 -0
  121. package/dist/styles/reset.d.ts.map +1 -0
  122. package/dist/styles/reset.js +50 -0
  123. package/package.json +3 -2
  124. package/src/components/alert/alert.ts +100 -100
  125. package/src/components/badge/badge.ts +96 -96
  126. package/src/components/breadcrumb/breadcrumb.ts +98 -98
  127. package/src/components/button/button.ts +281 -281
  128. package/src/components/button-group/button-group.ts +67 -67
  129. package/src/components/card/card.ts +52 -52
  130. package/src/components/checkbox/checkbox.ts +238 -238
  131. package/src/components/code-block/code-block.ts +256 -256
  132. package/src/components/content-card/content-card.ts +133 -133
  133. package/src/components/divider/divider.ts +68 -68
  134. package/src/components/drawer/drawer.ts +217 -217
  135. package/src/components/field/field.ts +30 -30
  136. package/src/components/footer/footer.ts +58 -58
  137. package/src/components/form/form-step.ts +32 -32
  138. package/src/components/form/form.ts +376 -376
  139. package/src/components/grid/grid-row.ts +75 -75
  140. package/src/components/grid/grid.ts +36 -36
  141. package/src/components/icon/icon-paths.ts +124 -124
  142. package/src/components/icon/icon.ts +82 -82
  143. package/src/components/input/input.ts +248 -248
  144. package/src/components/link/link.ts +97 -97
  145. package/src/components/metadata/metadata.ts +66 -66
  146. package/src/components/modal/modal.ts +158 -158
  147. package/src/components/page-layout/page-layout.ts +704 -704
  148. package/src/components/radio/radio.ts +142 -142
  149. package/src/components/radio-group/radio-group.ts +157 -157
  150. package/src/components/router/router.ts +46 -46
  151. package/src/components/select/select.ts +161 -161
  152. package/src/components/skeleton/skeleton.ts +67 -67
  153. package/src/components/switch/switch.ts +181 -181
  154. package/src/components/table/data-table.ts +556 -556
  155. package/src/components/table/table.ts +153 -153
  156. package/src/components/tabs/tab-panel.ts +30 -30
  157. package/src/components/tabs/tab.ts +76 -76
  158. package/src/components/tabs/tabs.ts +88 -88
  159. package/src/components/textarea/textarea.ts +215 -215
  160. package/src/components/theme-toggle/theme-toggle.ts +131 -131
  161. package/src/components/vertical-nav/vertical-nav-group.ts +96 -96
  162. package/src/components/vertical-nav/vertical-nav-item.ts +49 -49
  163. package/src/styles/globals.css +58 -58
  164. package/src/styles/index.css +80 -80
  165. package/src/styles/reset.ts +50 -50
  166. package/src/styles/theme.css +58 -58
  167. package/src/styles/typography.css +25 -25
  168. package/tsconfig.json +15 -15
@@ -0,0 +1,171 @@
1
+ /* src/styles/globals.css */
2
+ :root {
3
+ --st-purple-50: #faf5ff;
4
+ --st-purple-100: #f3e8ff;
5
+ --st-purple-400: #c084fc;
6
+ --st-purple-500: #a855f7;
7
+ --st-purple-600: #6d28d9;
8
+ --st-purple-700: #5b21b6;
9
+ --st-white: #ffffff;
10
+ --st-gray-50: #f9fafb;
11
+ --st-gray-100: #f3f4f6;
12
+ --st-gray-200: #e5e7eb;
13
+ --st-gray-700: #374151;
14
+ --st-gray-800: #27272a;
15
+ --st-gray-900: #18181b;
16
+ --st-red-100: #fee2e2;
17
+ --st-red-500: #ef4444;
18
+ --st-red-600: #dc2626;
19
+ --st-red-900: #7f1d1d;
20
+ --st-green-100: #dcfce7;
21
+ --st-green-500: #22c55e;
22
+ --st-green-600: #16a34a;
23
+ --st-green-900: #14532d;
24
+ --st-amber-100: #fef3c7;
25
+ --st-amber-500: #f59e0b;
26
+ --st-amber-600: #d97706;
27
+ --st-amber-900: #78350f;
28
+ --st-blue-100: #dbeafe;
29
+ --st-blue-500: #3b82f6;
30
+ --st-blue-600: #2563eb;
31
+ --st-blue-900: #1e3a8a;
32
+ --st-spacing-xs: 0.25rem;
33
+ --st-spacing-sm: 0.5rem;
34
+ --st-spacing-md: 1rem;
35
+ --st-spacing-lg: 1.5rem;
36
+ --st-spacing-xl: 2rem;
37
+ }
38
+
39
+ /* src/styles/typography.css */
40
+ :root {
41
+ --st-font-family-mono:
42
+ "Consolas",
43
+ "Courier New",
44
+ monospace;
45
+ --st-font-family:
46
+ "Inter",
47
+ system-ui,
48
+ -apple-system,
49
+ sans-serif;
50
+ --st-font-weight-regular: 400;
51
+ --st-font-weight-medium: 500;
52
+ --st-font-weight-bold: 700;
53
+ --st-font-size-xs: 0.75rem;
54
+ --st-font-size-sm: 0.875rem;
55
+ --st-font-size-base: 1rem;
56
+ --st-font-size-lg: 1.125rem;
57
+ --st-font-size-xl: 1.25rem;
58
+ --st-font-size-2xl: 1.5rem;
59
+ --st-font-size-3xl: 1.875rem;
60
+ --st-font-size-4xl: 2.25rem;
61
+ --st-line-height-none: 1;
62
+ --st-line-height-tight: 1.25;
63
+ --st-line-height-normal: 1.5;
64
+ --st-line-height-relaxed: 1.75;
65
+ }
66
+
67
+ /* src/styles/theme.css */
68
+ :root,
69
+ :root[data-theme=light] {
70
+ --st-color-bg: var(--st-white);
71
+ --st-color-surface: var(--st-gray-50);
72
+ --st-color-border: var(--st-gray-200);
73
+ --st-color-text: var(--st-gray-900);
74
+ --st-color-text-muted: var(--st-gray-700);
75
+ --st-color-primary: var(--st-purple-600);
76
+ --st-color-primary-hover: var(--st-purple-700);
77
+ --st-color-error: var(--st-red-600);
78
+ --st-color-error-bg: var(--st-red-100);
79
+ --st-color-success: var(--st-green-600);
80
+ --st-color-success-bg: var(--st-green-100);
81
+ --st-color-warning: var(--st-amber-600);
82
+ --st-color-warning-bg: var(--st-amber-100);
83
+ --st-color-info: var(--st-blue-600);
84
+ --st-color-info-bg: var(--st-blue-100);
85
+ }
86
+ :root:not([data-theme=light]),
87
+ :root[data-theme=dark] {
88
+ --st-color-bg: var(--st-gray-900);
89
+ --st-color-surface: var(--st-gray-800);
90
+ --st-color-surface-muted: color-mix(in srgb, var(--st-color-surface), black 15%);
91
+ --st-color-surface-hover: color-mix(in srgb, var(--st-color-surface), white 10%);
92
+ --st-color-border: var(--st-gray-700);
93
+ --st-color-text: var(--st-gray-50);
94
+ --st-color-text-muted: var(--st-gray-200);
95
+ --st-color-primary: var(--st-purple-400);
96
+ --st-color-primary-hover: var(--st-purple-600);
97
+ --st-color-error: var(--st-red-500);
98
+ --st-color-error-bg: #451a1a;
99
+ --st-color-success: var(--st-green-500);
100
+ --st-color-success-bg: #143620;
101
+ --st-color-warning: var(--st-amber-500);
102
+ --st-color-warning-bg: #422a14;
103
+ --st-color-info: var(--st-blue-500);
104
+ --st-color-info-bg: #172a54;
105
+ }
106
+
107
+ /* src/styles/index.css */
108
+ :not(:defined) {
109
+ visibility: hidden;
110
+ }
111
+ body {
112
+ background-color: var(--st-color-bg);
113
+ color: var(--st-color-text);
114
+ font-family: var(--st-font-family);
115
+ font-size: var(--st-font-size-base);
116
+ line-height: var(--st-line-height-normal);
117
+ -webkit-font-smoothing: antialiased;
118
+ padding: 0;
119
+ margin: 0;
120
+ }
121
+ h1,
122
+ h2,
123
+ h3,
124
+ h4,
125
+ h5,
126
+ h6 {
127
+ color: var(--st-color-text);
128
+ font-weight: var(--st-font-weight-bold);
129
+ line-height: var(--st-line-height-tight);
130
+ margin-top: 0;
131
+ margin-bottom: var(--st-spacing-md);
132
+ }
133
+ h1 {
134
+ font-size: var(--st-font-size-4xl);
135
+ }
136
+ h2 {
137
+ font-size: var(--st-font-size-3xl);
138
+ }
139
+ h3 {
140
+ font-size: var(--st-font-size-2xl);
141
+ }
142
+ h4 {
143
+ font-size: var(--st-font-size-xl);
144
+ }
145
+ h5 {
146
+ font-size: var(--st-font-size-lg);
147
+ }
148
+ h6 {
149
+ font-size: var(--st-font-size-base);
150
+ }
151
+ p {
152
+ margin-top: 0;
153
+ margin-bottom: var(--st-spacing-md);
154
+ }
155
+ a {
156
+ color: var(--st-color-primary);
157
+ text-decoration: none;
158
+ font-weight: var(--st-font-weight-medium);
159
+ transition: color 0.2s ease;
160
+ }
161
+ a:hover {
162
+ color: var(--st-color-primary-hover);
163
+ text-decoration: underline;
164
+ }
165
+ code {
166
+ font-family: var(--st-font-family-mono);
167
+ font-size: var(--st-font-size-sm);
168
+ background-color: var(--st-color-surface);
169
+ padding: var(--st-spacing-xs) var(--st-spacing-sm);
170
+ border-radius: 4px;
171
+ }
@@ -0,0 +1,2 @@
1
+ export declare const resetStyles: import("lit").CSSResult;
2
+ //# sourceMappingURL=reset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../src/styles/reset.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,yBAgDvB,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { css } from 'lit';
2
+ export const resetStyles = css `
3
+ /* 1. Box sizing rules */
4
+ :host,
5
+ *,
6
+ *::before,
7
+ *::after {
8
+ box-sizing: border-box;
9
+ }
10
+
11
+ /* 2. Prevent mobile tap highlights and set base behavior */
12
+ :host {
13
+ -webkit-tap-highlight-color: transparent;
14
+ }
15
+
16
+ /* 3. Strip user-agent margins and padding */
17
+ body,
18
+ h1, h2, h3, h4, h5, h6,
19
+ p, figure, blockquote, dl, dd {
20
+ margin: 0;
21
+ padding: 0;
22
+ }
23
+
24
+ /* 4. Form elements don't inherit typography by default, force them to */
25
+ input,
26
+ button,
27
+ textarea,
28
+ select {
29
+ font: inherit;
30
+ color: inherit;
31
+ margin: 0;
32
+ padding: 0;
33
+ }
34
+
35
+ /* 5. Make media easier to work with */
36
+ img,
37
+ picture,
38
+ svg {
39
+ max-width: 100%;
40
+ display: block;
41
+ }
42
+
43
+ /* 6. Strip default list styling if you use lists inside components */
44
+ ul,
45
+ ol {
46
+ list-style: none;
47
+ margin: 0;
48
+ padding: 0;
49
+ }
50
+ `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sondor-technology/sondor-components",
3
- "version": "1.0.0",
3
+ "version": "1.0.1-develop.2",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -187,5 +187,6 @@
187
187
  "concurrently": "^10.0.3",
188
188
  "esbuild": "^0.28.1",
189
189
  "typescript": "^7.0.2"
190
- }
190
+ },
191
+ "readme": "README.md"
191
192
  }
@@ -1,101 +1,101 @@
1
- import { LitElement, html, css } from 'lit';
2
- import { customElement, property } from 'lit/decorators.js';
3
- import { resetStyles } from '../../styles/reset.js';
4
-
5
- export type AlertColor = 'info' | 'success' | 'warning' | 'error';
6
-
7
- @customElement('st-alert')
8
- export class StAlert extends LitElement {
9
- @property({ type: String, reflect: true }) color: AlertColor = 'info';
10
-
11
- static styles = [
12
- resetStyles,
13
- css`
14
- :host {
15
- display: flex;
16
- gap: var(--st-spacing-md);
17
- padding: var(--st-spacing-md);
18
- border-radius: 6px;
19
- border: 1px solid transparent;
20
- font-size: var(--st-font-size-base);
21
- line-height: 1.5;
22
-
23
- /* Default Palette */
24
- --_alert-bg: var(--st-color-info-bg);
25
- --_alert-border: var(--st-color-info);
26
- --_alert-text: var(--st-color-text);
27
- --_alert-icon: var(--st-color-info);
28
- }
29
-
30
- /* State Modifiers */
31
- :host([color="error"]) {
32
- --_alert-bg: var(--st-color-error-bg);
33
- --_alert-border: var(--st-color-error);
34
- --_alert-icon: var(--st-color-error);
35
- }
36
-
37
- :host([color="success"]) {
38
- --_alert-bg: var(--st-color-success-bg);
39
- --_alert-border: var(--st-color-success);
40
- --_alert-icon: var(--st-color-success);
41
- }
42
-
43
- :host([color="warning"]) {
44
- --_alert-bg: var(--st-color-warning-bg);
45
- --_alert-border: var(--st-color-warning);
46
- --_alert-icon: var(--st-color-warning);
47
- /* Amber backgrounds often need forced dark text in light mode, but your tokens handle this */
48
- }
49
-
50
- /* Apply the variables */
51
- :host {
52
- background-color: var(--_alert-bg);
53
- border-color: var(--_alert-border);
54
- color: var(--_alert-text);
55
- }
56
-
57
- /* Icon Slot */
58
- .icon-container {
59
- display: flex;
60
- flex-shrink: 0;
61
- color: var(--_alert-icon);
62
- /* Align icon with the first line of text */
63
- margin-top: 2px;
64
- }
65
-
66
- ::slotted([slot="icon"]) {
67
- width: 1.25rem;
68
- height: 1.25rem;
69
- fill: none;
70
- stroke: currentColor;
71
- stroke-width: 2;
72
- stroke-linecap: round;
73
- stroke-linejoin: round;
74
- }
75
-
76
- .content {
77
- display: flex;
78
- flex-direction: column;
79
- gap: var(--st-spacing-xs);
80
- flex: 1;
81
- }
82
- `
83
- ];
84
-
85
- render() {
86
- return html`
87
- <div class="icon-container">
88
- <slot name="icon"></slot>
89
- </div>
90
- <div class="content">
91
- <slot></slot>
92
- </div>
93
- `;
94
- }
95
- }
96
-
97
- declare global {
98
- interface HTMLElementTagNameMap {
99
- 'st-alert': StAlert;
100
- }
1
+ import { LitElement, html, css } from 'lit';
2
+ import { customElement, property } from 'lit/decorators.js';
3
+ import { resetStyles } from '../../styles/reset.js';
4
+
5
+ export type AlertColor = 'info' | 'success' | 'warning' | 'error';
6
+
7
+ @customElement('st-alert')
8
+ export class StAlert extends LitElement {
9
+ @property({ type: String, reflect: true }) color: AlertColor = 'info';
10
+
11
+ static styles = [
12
+ resetStyles,
13
+ css`
14
+ :host {
15
+ display: flex;
16
+ gap: var(--st-spacing-md);
17
+ padding: var(--st-spacing-md);
18
+ border-radius: 6px;
19
+ border: 1px solid transparent;
20
+ font-size: var(--st-font-size-base);
21
+ line-height: 1.5;
22
+
23
+ /* Default Palette */
24
+ --_alert-bg: var(--st-color-info-bg);
25
+ --_alert-border: var(--st-color-info);
26
+ --_alert-text: var(--st-color-text);
27
+ --_alert-icon: var(--st-color-info);
28
+ }
29
+
30
+ /* State Modifiers */
31
+ :host([color="error"]) {
32
+ --_alert-bg: var(--st-color-error-bg);
33
+ --_alert-border: var(--st-color-error);
34
+ --_alert-icon: var(--st-color-error);
35
+ }
36
+
37
+ :host([color="success"]) {
38
+ --_alert-bg: var(--st-color-success-bg);
39
+ --_alert-border: var(--st-color-success);
40
+ --_alert-icon: var(--st-color-success);
41
+ }
42
+
43
+ :host([color="warning"]) {
44
+ --_alert-bg: var(--st-color-warning-bg);
45
+ --_alert-border: var(--st-color-warning);
46
+ --_alert-icon: var(--st-color-warning);
47
+ /* Amber backgrounds often need forced dark text in light mode, but your tokens handle this */
48
+ }
49
+
50
+ /* Apply the variables */
51
+ :host {
52
+ background-color: var(--_alert-bg);
53
+ border-color: var(--_alert-border);
54
+ color: var(--_alert-text);
55
+ }
56
+
57
+ /* Icon Slot */
58
+ .icon-container {
59
+ display: flex;
60
+ flex-shrink: 0;
61
+ color: var(--_alert-icon);
62
+ /* Align icon with the first line of text */
63
+ margin-top: 2px;
64
+ }
65
+
66
+ ::slotted([slot="icon"]) {
67
+ width: 1.25rem;
68
+ height: 1.25rem;
69
+ fill: none;
70
+ stroke: currentColor;
71
+ stroke-width: 2;
72
+ stroke-linecap: round;
73
+ stroke-linejoin: round;
74
+ }
75
+
76
+ .content {
77
+ display: flex;
78
+ flex-direction: column;
79
+ gap: var(--st-spacing-xs);
80
+ flex: 1;
81
+ }
82
+ `
83
+ ];
84
+
85
+ render() {
86
+ return html`
87
+ <div class="icon-container">
88
+ <slot name="icon"></slot>
89
+ </div>
90
+ <div class="content">
91
+ <slot></slot>
92
+ </div>
93
+ `;
94
+ }
95
+ }
96
+
97
+ declare global {
98
+ interface HTMLElementTagNameMap {
99
+ 'st-alert': StAlert;
100
+ }
101
101
  }
@@ -1,97 +1,97 @@
1
- import { LitElement, html, css } from 'lit';
2
- import { customElement, property } from 'lit/decorators.js';
3
- import { resetStyles } from '../../styles/reset.js';
4
-
5
- export type BadgeColor = 'primary' | 'neutral' | 'success' | 'warning' | 'error' | 'info';
6
-
7
- @customElement('st-badge')
8
- export class StBadge extends LitElement {
9
- @property({ type: String, reflect: true }) color: BadgeColor = 'neutral';
10
-
11
- static styles = [
12
- resetStyles,
13
- css`
14
- :host {
15
- display: inline-flex;
16
- align-items: center;
17
- justify-content: center;
18
- padding: 0.125rem 0.5rem; /* 2px 8px */
19
- font-size: var(--st-font-size-xs);
20
- font-weight: var(--st-font-weight-medium);
21
- border-radius: 999px; /* Pill shape */
22
- line-height: 1.25;
23
- white-space: nowrap;
24
-
25
- /* Base / Neutral Palette */
26
- --_badge-bg: var(--st-color-surface);
27
- --_badge-text: var(--st-color-text-muted);
28
- --_badge-border: var(--st-color-border);
29
- }
30
-
31
- /* Base Application */
32
- :host {
33
- background-color: var(--_badge-bg);
34
- color: var(--_badge-text);
35
- border: 1px solid var(--_badge-border);
36
- }
37
-
38
- /* ==========================================================
39
- Soft Semantic Variants
40
- ========================================================== */
41
- :host([color="primary"]) {
42
- --_badge-bg: var(--st-color-primary);
43
- --_badge-text: var(--st-white);
44
- --_badge-border: transparent;
45
- }
46
-
47
- :host([color="success"]) {
48
- --_badge-bg: var(--st-color-success-bg);
49
- --_badge-text: var(--st-color-success);
50
- --_badge-border: transparent;
51
- }
52
-
53
- :host([color="warning"]) {
54
- --_badge-bg: var(--st-color-warning-bg);
55
- --_badge-text: var(--st-color-warning);
56
- --_badge-border: transparent;
57
- }
58
-
59
- :host([color="error"]) {
60
- --_badge-bg: var(--st-color-error-bg);
61
- --_badge-text: var(--st-color-error);
62
- --_badge-border: transparent;
63
- }
64
-
65
- :host([color="info"]) {
66
- --_badge-bg: var(--st-color-info-bg);
67
- --_badge-text: var(--st-color-info);
68
- --_badge-border: transparent;
69
- }
70
-
71
- /* Optional icon support inside the badge */
72
- ::slotted(svg) {
73
- width: 0.75rem;
74
- height: 0.75rem;
75
- margin-right: 0.25rem;
76
- fill: none;
77
- stroke: currentColor;
78
- stroke-width: 2;
79
- stroke-linecap: round;
80
- stroke-linejoin: round;
81
- }
82
- `
83
- ];
84
-
85
- render() {
86
- return html`
87
- <slot name="icon"></slot>
88
- <slot></slot>
89
- `;
90
- }
91
- }
92
-
93
- declare global {
94
- interface HTMLElementTagNameMap {
95
- 'st-badge': StBadge;
96
- }
1
+ import { LitElement, html, css } from 'lit';
2
+ import { customElement, property } from 'lit/decorators.js';
3
+ import { resetStyles } from '../../styles/reset.js';
4
+
5
+ export type BadgeColor = 'primary' | 'neutral' | 'success' | 'warning' | 'error' | 'info';
6
+
7
+ @customElement('st-badge')
8
+ export class StBadge extends LitElement {
9
+ @property({ type: String, reflect: true }) color: BadgeColor = 'neutral';
10
+
11
+ static styles = [
12
+ resetStyles,
13
+ css`
14
+ :host {
15
+ display: inline-flex;
16
+ align-items: center;
17
+ justify-content: center;
18
+ padding: 0.125rem 0.5rem; /* 2px 8px */
19
+ font-size: var(--st-font-size-xs);
20
+ font-weight: var(--st-font-weight-medium);
21
+ border-radius: 999px; /* Pill shape */
22
+ line-height: 1.25;
23
+ white-space: nowrap;
24
+
25
+ /* Base / Neutral Palette */
26
+ --_badge-bg: var(--st-color-surface);
27
+ --_badge-text: var(--st-color-text-muted);
28
+ --_badge-border: var(--st-color-border);
29
+ }
30
+
31
+ /* Base Application */
32
+ :host {
33
+ background-color: var(--_badge-bg);
34
+ color: var(--_badge-text);
35
+ border: 1px solid var(--_badge-border);
36
+ }
37
+
38
+ /* ==========================================================
39
+ Soft Semantic Variants
40
+ ========================================================== */
41
+ :host([color="primary"]) {
42
+ --_badge-bg: var(--st-color-primary);
43
+ --_badge-text: var(--st-white);
44
+ --_badge-border: transparent;
45
+ }
46
+
47
+ :host([color="success"]) {
48
+ --_badge-bg: var(--st-color-success-bg);
49
+ --_badge-text: var(--st-color-success);
50
+ --_badge-border: transparent;
51
+ }
52
+
53
+ :host([color="warning"]) {
54
+ --_badge-bg: var(--st-color-warning-bg);
55
+ --_badge-text: var(--st-color-warning);
56
+ --_badge-border: transparent;
57
+ }
58
+
59
+ :host([color="error"]) {
60
+ --_badge-bg: var(--st-color-error-bg);
61
+ --_badge-text: var(--st-color-error);
62
+ --_badge-border: transparent;
63
+ }
64
+
65
+ :host([color="info"]) {
66
+ --_badge-bg: var(--st-color-info-bg);
67
+ --_badge-text: var(--st-color-info);
68
+ --_badge-border: transparent;
69
+ }
70
+
71
+ /* Optional icon support inside the badge */
72
+ ::slotted(svg) {
73
+ width: 0.75rem;
74
+ height: 0.75rem;
75
+ margin-right: 0.25rem;
76
+ fill: none;
77
+ stroke: currentColor;
78
+ stroke-width: 2;
79
+ stroke-linecap: round;
80
+ stroke-linejoin: round;
81
+ }
82
+ `
83
+ ];
84
+
85
+ render() {
86
+ return html`
87
+ <slot name="icon"></slot>
88
+ <slot></slot>
89
+ `;
90
+ }
91
+ }
92
+
93
+ declare global {
94
+ interface HTMLElementTagNameMap {
95
+ 'st-badge': StBadge;
96
+ }
97
97
  }