@sondor-technology/sondor-components 1.0.0 → 1.0.1-develop.10

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 +31 -0
  21. package/dist/components/checkbox/checkbox.d.ts.map +1 -0
  22. package/dist/components/checkbox/checkbox.js +265 -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 +364 -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 +132 -0
  54. package/dist/components/icon/icon-paths.d.ts.map +1 -0
  55. package/dist/components/icon/icon-paths.js +137 -0
  56. package/dist/components/icon/icon.d.ts +17 -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 +35 -0
  69. package/dist/components/modal/modal.d.ts.map +1 -0
  70. package/dist/components/modal/modal.js +251 -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 +31 -0
  81. package/dist/components/router/router.d.ts.map +1 -0
  82. package/dist/components/router/router.js +97 -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 +16 -0
  87. package/dist/components/skeleton/skeleton.d.ts.map +1 -0
  88. package/dist/components/skeleton/skeleton.js +149 -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 +15 -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 +127 -0
  116. package/dist/components/vertical-nav/vertical-nav-item.d.ts +14 -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 +85 -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 +7 -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 +266 -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 +385 -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 +140 -124
  142. package/src/components/icon/icon.ts +84 -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 +246 -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 +133 -46
  151. package/src/components/select/select.ts +161 -161
  152. package/src/components/skeleton/skeleton.ts +134 -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 +115 -96
  162. package/src/components/vertical-nav/vertical-nav-item.ts +72 -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,152 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { LitElement, html, css } from "lit";
8
+ import { customElement, property } from "lit/decorators.js";
9
+ import { resetStyles } from "../../styles/reset.js";
10
+ let StRadio = class StRadio extends LitElement {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.value = "";
14
+ this.checked = false;
15
+ this.disabled = false;
16
+ this.ariaLabel = "";
17
+ }
18
+ _handleChange(e) {
19
+ // Prevent the native change event from leaking out
20
+ e.stopPropagation();
21
+ if (!this.disabled) {
22
+ // Dispatch a custom event to tell the parent group this radio was selected
23
+ this.dispatchEvent(new CustomEvent("st-radio-select", {
24
+ detail: { value: this.value },
25
+ bubbles: true,
26
+ composed: true,
27
+ }));
28
+ }
29
+ }
30
+ render() {
31
+ return html `
32
+ <label>
33
+ <input
34
+ type="radio"
35
+ aria-label=${this.ariaLabel || ""}
36
+ .value=${this.value}
37
+ .checked=${this.checked}
38
+ ?disabled=${this.disabled}
39
+ @change=${this._handleChange}
40
+ />
41
+ <span class="control"></span>
42
+ <span class="label"><slot></slot></span>
43
+ </label>
44
+ `;
45
+ }
46
+ };
47
+ StRadio.styles = [
48
+ resetStyles,
49
+ css `
50
+ :host {
51
+ display: inline-block;
52
+ outline: none;
53
+ user-select: none;
54
+ }
55
+
56
+ label {
57
+ display: inline-flex;
58
+ align-items: center;
59
+ gap: var(--st-spacing-sm);
60
+ cursor: pointer;
61
+ color: var(--st-color-text);
62
+ font-size: var(--st-font-size-base);
63
+ }
64
+
65
+ /* Hide the native input visually, but keep it accessible for screen readers */
66
+ input {
67
+ position: absolute;
68
+ width: 1px;
69
+ height: 1px;
70
+ padding: 0;
71
+ margin: -1px;
72
+ overflow: hidden;
73
+ clip: rect(0, 0, 0, 0);
74
+ white-space: nowrap;
75
+ border-width: 0;
76
+ }
77
+
78
+ /* Custom Radio Circle */
79
+ .control {
80
+ display: flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ width: 1.25rem;
84
+ height: 1.25rem;
85
+ border: 1px solid var(--st-color-border);
86
+ border-radius: 50%;
87
+ background-color: var(--st-color-bg);
88
+ transition: all 0.2s ease;
89
+ flex-shrink: 0;
90
+ }
91
+
92
+ /* Inner Dot (Hidden by default) */
93
+ .control::after {
94
+ content: "";
95
+ width: 0.625rem;
96
+ height: 0.625rem;
97
+ border-radius: 50%;
98
+ background-color: var(--st-color-bg); /* Matches the dot color to background initially */
99
+ transition:
100
+ transform 0.2s ease,
101
+ background-color 0.2s ease;
102
+ transform: scale(0);
103
+ }
104
+
105
+ /* Hover State */
106
+ label:hover .control {
107
+ border-color: var(--st-color-primary-hover);
108
+ }
109
+
110
+ /* Focus State (Driven by the hidden input) */
111
+ input:focus-visible + .control {
112
+ box-shadow:
113
+ 0 0 0 2px var(--st-color-bg),
114
+ 0 0 0 4px var(--st-color-primary);
115
+ }
116
+
117
+ /* Checked State */
118
+ :host([checked]) .control {
119
+ border-color: var(--st-color-primary);
120
+ background-color: var(--st-color-primary);
121
+ }
122
+ :host([checked]) .control::after {
123
+ background-color: var(--st-white); /* White dot inside the primary circle */
124
+ transform: scale(1);
125
+ }
126
+
127
+ /* Disabled State */
128
+ :host([disabled]) {
129
+ pointer-events: none;
130
+ }
131
+ :host([disabled]) label {
132
+ opacity: 0.5;
133
+ cursor: not-allowed;
134
+ }
135
+ `,
136
+ ];
137
+ __decorate([
138
+ property({ type: String })
139
+ ], StRadio.prototype, "value", void 0);
140
+ __decorate([
141
+ property({ type: Boolean, reflect: true })
142
+ ], StRadio.prototype, "checked", void 0);
143
+ __decorate([
144
+ property({ type: Boolean, reflect: true })
145
+ ], StRadio.prototype, "disabled", void 0);
146
+ __decorate([
147
+ property({ attribute: "aria-label" })
148
+ ], StRadio.prototype, "ariaLabel", void 0);
149
+ StRadio = __decorate([
150
+ customElement("st-radio")
151
+ ], StRadio);
152
+ export { StRadio };
@@ -0,0 +1,27 @@
1
+ import { LitElement, PropertyValues } from "lit";
2
+ export declare class StRadioGroup extends LitElement {
3
+ static formAssociated: boolean;
4
+ private _internals;
5
+ name: string;
6
+ value: string;
7
+ label: string;
8
+ helpText: string;
9
+ disabled: boolean;
10
+ invalid: boolean;
11
+ private _radios;
12
+ constructor();
13
+ static styles: import("lit").CSSResult[];
14
+ connectedCallback(): void;
15
+ disconnectedCallback(): void;
16
+ private _handleRadioSelect;
17
+ updated(changedProperties: PropertyValues<this>): void;
18
+ private _syncRadios;
19
+ formResetCallback(): void;
20
+ render(): import("lit-html").TemplateResult<1>;
21
+ }
22
+ declare global {
23
+ interface HTMLElementTagNameMap {
24
+ "st-radio-group": StRadioGroup;
25
+ }
26
+ }
27
+ //# sourceMappingURL=radio-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../../src/components/radio-group/radio-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAa,cAAc,EAAC,MAAM,KAAK,CAAC;AAK1D,qBACa,YAAa,SAAQ,UAAU;IAC1C,MAAM,CAAC,cAAc,UAAQ;IAC7B,OAAO,CAAC,UAAU,CAAmB;IAEI,IAAI,SAAM;IACzB,KAAK,SAAM;IACX,KAAK,SAAM;IACD,QAAQ,SAAM;IACR,QAAQ,UAAS;IACjB,OAAO,UAAS;IAI1D,OAAO,CAAC,OAAO,CAAa;IAE5B,cAaC;IAED,MAAM,CAAC,MAAM,4BAiDX;IAEF,iBAAiB,SAIhB;IAED,oBAAoB,SAGnB;IAED,OAAO,CAAC,kBAAkB;IAMjB,OAAO,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,QAYvD;IAGD,OAAO,CAAC,WAAW;IAYnB,iBAAiB,SAIhB;IAED,MAAM,yCAYL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,YAAY,CAAC;KAChC;CACF"}
@@ -0,0 +1,161 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { LitElement, html, css } from "lit";
8
+ import { customElement, property, queryAssignedElements } from "lit/decorators.js";
9
+ import { resetStyles } from "../../styles/reset.js";
10
+ let StRadioGroup = class StRadioGroup extends LitElement {
11
+ constructor() {
12
+ super();
13
+ this.name = "";
14
+ this.value = "";
15
+ this.label = "";
16
+ this.helpText = "";
17
+ this.disabled = false;
18
+ this.invalid = false;
19
+ this._internals = this.attachInternals();
20
+ // 1. Trigger error state if the user clicks away and the field is invalid
21
+ this.addEventListener("change", () => {
22
+ this.invalid = !this._internals.validity.valid;
23
+ });
24
+ // 2. Trigger error state if the st-form tries to submit and fails
25
+ this.addEventListener("invalid", () => {
26
+ this.invalid = true;
27
+ });
28
+ }
29
+ connectedCallback() {
30
+ super.connectedCallback();
31
+ // Listen for selections from child radios
32
+ this.addEventListener("st-radio-select", this._handleRadioSelect);
33
+ }
34
+ disconnectedCallback() {
35
+ super.disconnectedCallback();
36
+ this.removeEventListener("st-radio-select", this._handleRadioSelect);
37
+ }
38
+ _handleRadioSelect(e) {
39
+ if (this.disabled)
40
+ return;
41
+ this.value = e.detail.value;
42
+ this.dispatchEvent(new Event("change", { bubbles: true, composed: true }));
43
+ }
44
+ updated(changedProperties) {
45
+ super.updated(changedProperties);
46
+ // When the group's value changes, sync the form and update all child radios
47
+ if (changedProperties.has("value")) {
48
+ this._internals.setFormValue(this.value);
49
+ this._syncRadios();
50
+ }
51
+ if (changedProperties.has("disabled")) {
52
+ this._syncRadios();
53
+ }
54
+ }
55
+ // Loops through children and unchecks/checks them based on the group's current value
56
+ _syncRadios() {
57
+ if (!this._radios)
58
+ return;
59
+ this._radios.forEach((radio) => {
60
+ radio.checked = radio.value === this.value;
61
+ if (this.disabled) {
62
+ radio.disabled = true;
63
+ }
64
+ });
65
+ }
66
+ // Fired natively by the browser if the parent <form> is reset
67
+ formResetCallback() {
68
+ this.value = "";
69
+ this._internals.setFormValue("");
70
+ this._syncRadios();
71
+ }
72
+ render() {
73
+ return html `
74
+ <fieldset ?disabled=${this.disabled}>
75
+ ${this.label ? html `<legend>${this.label}</legend>` : ""}
76
+
77
+ <div class="options">
78
+ <slot @slotchange=${this._syncRadios}></slot>
79
+ </div>
80
+
81
+ ${this.helpText ? html `<div class="help-text">${this.helpText}</div>` : ""}
82
+ </fieldset>
83
+ `;
84
+ }
85
+ };
86
+ StRadioGroup.formAssociated = true;
87
+ StRadioGroup.styles = [
88
+ resetStyles,
89
+ css `
90
+ :host {
91
+ display: block;
92
+ }
93
+
94
+ fieldset {
95
+ border: none;
96
+ padding: 0;
97
+ margin: 0;
98
+ display: flex;
99
+ flex-direction: column;
100
+ gap: var(--st-spacing-xs);
101
+ }
102
+
103
+ legend {
104
+ font-size: var(--st-font-size-sm);
105
+ font-weight: var(--st-font-weight-medium);
106
+ color: var(--st-color-text);
107
+ padding: 0;
108
+ margin-bottom: var(--st-spacing-xs);
109
+ }
110
+
111
+ .options {
112
+ display: flex;
113
+ flex-direction: column;
114
+ gap: var(--st-spacing-sm);
115
+ }
116
+
117
+ /* Horizontal layout modifier */
118
+ :host([layout="horizontal"]) .options {
119
+ flex-direction: row;
120
+ gap: var(--st-spacing-md);
121
+ }
122
+
123
+ .help-text {
124
+ font-size: var(--st-font-size-xs);
125
+ color: var(--st-color-text-muted);
126
+ margin: 0;
127
+ }
128
+
129
+ :host([invalid]) .help-text {
130
+ color: var(--st-color-error);
131
+ }
132
+ :host([invalid]) legend {
133
+ color: var(--st-color-error);
134
+ }
135
+ `,
136
+ ];
137
+ __decorate([
138
+ property({ type: String, reflect: true })
139
+ ], StRadioGroup.prototype, "name", void 0);
140
+ __decorate([
141
+ property({ type: String })
142
+ ], StRadioGroup.prototype, "value", void 0);
143
+ __decorate([
144
+ property({ type: String })
145
+ ], StRadioGroup.prototype, "label", void 0);
146
+ __decorate([
147
+ property({ attribute: "help-text" })
148
+ ], StRadioGroup.prototype, "helpText", void 0);
149
+ __decorate([
150
+ property({ type: Boolean, reflect: true })
151
+ ], StRadioGroup.prototype, "disabled", void 0);
152
+ __decorate([
153
+ property({ type: Boolean, reflect: true })
154
+ ], StRadioGroup.prototype, "invalid", void 0);
155
+ __decorate([
156
+ queryAssignedElements({ selector: "st-radio" })
157
+ ], StRadioGroup.prototype, "_radios", void 0);
158
+ StRadioGroup = __decorate([
159
+ customElement("st-radio-group")
160
+ ], StRadioGroup);
161
+ export { StRadioGroup };
@@ -0,0 +1,31 @@
1
+ export interface RouteDefinition {
2
+ component: string;
3
+ [key: string]: unknown;
4
+ }
5
+ export type RouteConfig = Record<string, RouteDefinition>;
6
+ export interface RouteMatch {
7
+ path: string;
8
+ component: string;
9
+ params: Record<string, string>;
10
+ definition: RouteDefinition;
11
+ }
12
+ export declare class AppRouter {
13
+ private _routes;
14
+ private _initialized;
15
+ constructor(routes?: RouteConfig);
16
+ /**
17
+ * Register or update the route configuration for this application.
18
+ */
19
+ setRoutes(routes: RouteConfig): void;
20
+ /**
21
+ * Programmatically navigate to an internal path.
22
+ */
23
+ navigate(path: string): void;
24
+ /**
25
+ * Matches a URL path against the registered routes.
26
+ */
27
+ matchRoute(currentPath: string): RouteMatch | null;
28
+ private _notify;
29
+ }
30
+ export declare const router: AppRouter;
31
+ //# sourceMappingURL=router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/components/router/router.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAE1D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,UAAU,EAAE,eAAe,CAAC;CAC7B;AASD,qBAAa,SAAS;IACpB,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,YAAY,CAAS;IAE7B,YAAY,MAAM,CAAC,EAAE,WAAW,EA+B/B;IAED;;OAEG;IACI,SAAS,CAAC,MAAM,EAAE,WAAW,QAUnC;IAED;;OAEG;IACI,QAAQ,CAAC,IAAI,EAAE,MAAM,QAG3B;IAED;;OAEG;IACI,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CA+BxD;IAED,OAAO,CAAC,OAAO;CAahB;AAGD,eAAO,MAAM,MAAM,WAAkB,CAAC"}
@@ -0,0 +1,97 @@
1
+ function getRouteWeight(pattern) {
2
+ const segments = pattern.split('/').filter(Boolean);
3
+ return segments.reduce((weight, seg) => {
4
+ return weight + (seg.startsWith(':') ? 1 : 10);
5
+ }, 0);
6
+ }
7
+ export class AppRouter {
8
+ constructor(routes) {
9
+ this._routes = {};
10
+ this._initialized = false;
11
+ if (routes) {
12
+ this.setRoutes(routes);
13
+ }
14
+ window.addEventListener('popstate', () => this._notify());
15
+ document.addEventListener('click', (e) => {
16
+ if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) {
17
+ return;
18
+ }
19
+ const path = e.composedPath();
20
+ const link = path.find((el) => el && typeof el.hasAttribute === 'function' && el.hasAttribute('href'));
21
+ if (!link)
22
+ return;
23
+ const href = link.getAttribute('href');
24
+ const target = link.getAttribute('target');
25
+ if (!href || href.startsWith('http') || href.startsWith('mailto:') || target === '_blank') {
26
+ return;
27
+ }
28
+ if (href.startsWith('/')) {
29
+ e.preventDefault();
30
+ this.navigate(href);
31
+ }
32
+ });
33
+ }
34
+ /**
35
+ * Register or update the route configuration for this application.
36
+ */
37
+ setRoutes(routes) {
38
+ this._routes = routes;
39
+ // Trigger initial route resolution once routes are registered
40
+ if (!this._initialized) {
41
+ this._initialized = true;
42
+ setTimeout(() => this._notify(), 0);
43
+ }
44
+ else {
45
+ this._notify();
46
+ }
47
+ }
48
+ /**
49
+ * Programmatically navigate to an internal path.
50
+ */
51
+ navigate(path) {
52
+ window.history.pushState(null, '', path);
53
+ this._notify();
54
+ }
55
+ /**
56
+ * Matches a URL path against the registered routes.
57
+ */
58
+ matchRoute(currentPath) {
59
+ const sortedRoutes = Object.entries(this._routes).sort(([patternA], [patternB]) => getRouteWeight(patternB) - getRouteWeight(patternA));
60
+ for (const [pattern, routeDef] of sortedRoutes) {
61
+ const paramNames = [];
62
+ const regexPath = pattern.replace(/:([a-zA-Z0-9_]+)/g, (_, paramName) => {
63
+ paramNames.push(paramName);
64
+ return '([^/]+)';
65
+ });
66
+ const regex = new RegExp(`^${regexPath}$`);
67
+ const match = currentPath.match(regex);
68
+ if (match) {
69
+ const params = {};
70
+ paramNames.forEach((name, index) => {
71
+ params[name] = decodeURIComponent(match[index + 1]);
72
+ });
73
+ return {
74
+ path: currentPath,
75
+ component: routeDef.component,
76
+ params,
77
+ definition: routeDef
78
+ };
79
+ }
80
+ }
81
+ return null;
82
+ }
83
+ _notify() {
84
+ const currentPath = window.location.pathname;
85
+ const match = this.matchRoute(currentPath);
86
+ window.dispatchEvent(new CustomEvent('route-changed', {
87
+ detail: {
88
+ path: currentPath,
89
+ component: match ? match.component : 'not-found-page',
90
+ params: match ? match.params : {},
91
+ definition: match ? match.definition : null
92
+ }
93
+ }));
94
+ }
95
+ }
96
+ // Export a singleton instance for standard app-wide use
97
+ export const router = new AppRouter();
@@ -0,0 +1,16 @@
1
+ import { LitElement } from 'lit';
2
+ export declare class StSelect extends LitElement {
3
+ size: 'sm' | 'md' | 'lg';
4
+ variant: 'outline' | 'filled';
5
+ color: 'default' | 'primary' | 'error';
6
+ focused: boolean;
7
+ constructor();
8
+ static styles: import("lit").CSSResult[];
9
+ render(): import("lit-html").TemplateResult<1>;
10
+ }
11
+ declare global {
12
+ interface HTMLElementTagNameMap {
13
+ 'st-select': StSelect;
14
+ }
15
+ }
16
+ //# sourceMappingURL=select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/components/select/select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,qBACa,QAAS,SAAQ,UAAU;IACK,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAChC,OAAO,EAAE,SAAS,GAAG,QAAQ,CAAa;IAC1C,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAa;IAGlD,OAAO,UAAS;IAE5D,cAKC;IAED,MAAM,CAAC,MAAM,4BA2HX;IAEF,MAAM,yCASL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
@@ -0,0 +1,172 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { LitElement, html, css } from 'lit';
8
+ import { customElement, property } from 'lit/decorators.js';
9
+ import { resetStyles } from '../../styles/reset.js';
10
+ let StSelect = class StSelect extends LitElement {
11
+ constructor() {
12
+ super();
13
+ this.size = 'md';
14
+ this.variant = 'outline';
15
+ this.color = 'default';
16
+ // Internal state to handle the chevron animation when the slotted select is focused
17
+ this.focused = false;
18
+ // Track focus states to animate the chevron
19
+ this.addEventListener('focusin', () => this.focused = true);
20
+ this.addEventListener('focusout', () => this.focused = false);
21
+ }
22
+ render() {
23
+ return html `
24
+ <div class="select-wrapper">
25
+ <slot></slot>
26
+ <svg class="chevron" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
27
+ <polyline points="6 9 12 15 18 9"></polyline>
28
+ </svg>
29
+ </div>
30
+ `;
31
+ }
32
+ };
33
+ StSelect.styles = [
34
+ resetStyles,
35
+ css `
36
+ :host {
37
+ display: inline-block;
38
+ width: 100%;
39
+ position: relative;
40
+ }
41
+
42
+ .select-wrapper {
43
+ position: relative;
44
+ display: flex;
45
+ align-items: center;
46
+ width: 100%;
47
+ }
48
+
49
+ /*
50
+ Target the native select provided by the user in the Light DOM.
51
+ This completely bypasses the browser rendering bug.
52
+ */
53
+ ::slotted(select) {
54
+ appearance: none;
55
+ -webkit-appearance: none;
56
+ width: 100%;
57
+ font-family: inherit;
58
+ background-color: transparent;
59
+ border-radius: var(--st-radius-md, 0.5rem);
60
+ color: var(--st-color-text);
61
+ cursor: pointer;
62
+ outline: none;
63
+ transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
64
+ }
65
+
66
+ ::slotted(select:disabled) {
67
+ opacity: 0.6;
68
+ cursor: not-allowed;
69
+ }
70
+
71
+ /* ==========================================================
72
+ Sizes
73
+ ========================================================== */
74
+ :host([size="sm"]) ::slotted(select) {
75
+ padding: 0.25rem 2rem 0.25rem 0.75rem;
76
+ font-size: 0.875rem;
77
+ height: 2rem;
78
+ }
79
+ :host([size="md"]) ::slotted(select) {
80
+ padding: 0.5rem 2.5rem 0.5rem 1rem;
81
+ font-size: 1rem;
82
+ height: 2.5rem;
83
+ }
84
+ :host([size="lg"]) ::slotted(select) {
85
+ padding: 0.75rem 3rem 0.75rem 1.25rem;
86
+ font-size: 1.125rem;
87
+ height: 3rem;
88
+ }
89
+
90
+ /* Multiple select formatting (No fixed height, no right padding for chevron) */
91
+ ::slotted(select[multiple]) {
92
+ height: auto !important;
93
+ padding-right: 1rem !important;
94
+ }
95
+
96
+ /* ==========================================================
97
+ Variants & Colors
98
+ ========================================================== */
99
+ :host([variant="outline"]) ::slotted(select) {
100
+ border: 1px solid var(--st-color-border);
101
+ }
102
+ :host([variant="outline"][color="default"]) ::slotted(select:focus-visible) {
103
+ border-color: var(--st-color-primary);
104
+ box-shadow: 0 0 0 2px rgba(var(--st-color-primary-rgb, 99, 102, 241), 0.2);
105
+ }
106
+
107
+ :host([variant="filled"]) ::slotted(select) {
108
+ border: 1px solid transparent;
109
+ background-color: var(--st-color-surface-hover, rgba(0, 0, 0, 0.05));
110
+ }
111
+ :host([variant="filled"]) ::slotted(select:not(:disabled):hover) {
112
+ background-color: var(--st-color-surface-active, rgba(0, 0, 0, 0.1));
113
+ }
114
+ :host([variant="filled"][color="default"]) ::slotted(select:focus-visible) {
115
+ border-color: var(--st-color-primary);
116
+ background-color: transparent;
117
+ }
118
+
119
+ /* Error Color State */
120
+ :host([color="error"]) ::slotted(select) {
121
+ border-color: var(--st-color-error, #ef4444);
122
+ }
123
+ :host([color="error"]) ::slotted(select:focus-visible) {
124
+ box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
125
+ }
126
+
127
+ /* Primary Color State */
128
+ :host([color="primary"]) ::slotted(select) {
129
+ border-color: var(--st-color-primary);
130
+ }
131
+
132
+ /* ==========================================================
133
+ Chevron Icon
134
+ ========================================================== */
135
+ .chevron {
136
+ position: absolute;
137
+ right: 0.75rem;
138
+ width: 1.25rem;
139
+ height: 1.25rem;
140
+ pointer-events: none;
141
+ color: var(--st-color-text-muted);
142
+ transition: transform 0.2s ease, color 0.2s ease;
143
+ }
144
+
145
+ /* Animate chevron when the wrapper detects focus */
146
+ :host([focused]) .chevron {
147
+ transform: rotate(180deg);
148
+ color: var(--st-color-primary);
149
+ }
150
+
151
+ /* Hide chevron if the user slots a native multiple select */
152
+ ::slotted(select[multiple]) ~ .chevron {
153
+ display: none;
154
+ }
155
+ `
156
+ ];
157
+ __decorate([
158
+ property({ type: String, reflect: true })
159
+ ], StSelect.prototype, "size", void 0);
160
+ __decorate([
161
+ property({ type: String, reflect: true })
162
+ ], StSelect.prototype, "variant", void 0);
163
+ __decorate([
164
+ property({ type: String, reflect: true })
165
+ ], StSelect.prototype, "color", void 0);
166
+ __decorate([
167
+ property({ type: Boolean, reflect: true })
168
+ ], StSelect.prototype, "focused", void 0);
169
+ StSelect = __decorate([
170
+ customElement('st-select')
171
+ ], StSelect);
172
+ export { StSelect };
@@ -0,0 +1,16 @@
1
+ import { LitElement } from 'lit';
2
+ export declare class StSkeleton extends LitElement {
3
+ variant: 'text' | 'circular' | 'rectangular';
4
+ animation: 'shimmer' | 'pulse' | 'none';
5
+ width: string;
6
+ height: string;
7
+ updated(changedProperties: Map<string | number | symbol, unknown>): void;
8
+ static styles: import("lit").CSSResult[];
9
+ render(): import("lit-html").TemplateResult<1>;
10
+ }
11
+ declare global {
12
+ interface HTMLElementTagNameMap {
13
+ 'st-skeleton': StSkeleton;
14
+ }
15
+ }
16
+ //# sourceMappingURL=skeleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/skeleton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,qBACa,UAAW,SAAQ,UAAU;IACG,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,CAAU;IACtD,SAAS,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,CAAa;IACnE,KAAK,SAAM;IACX,MAAM,SAAM;IAGxC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,QAkBhE;IAED,MAAM,CAAC,MAAM,4BAyFX;IAEF,MAAM,yCAIL;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}