@surreal-ui/web 0.5.1 → 0.5.3
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.
- package/CHANGELOG.md +13 -0
- package/package.json +2 -2
- package/src/components/GlassmorphismAlert.ts +1 -2
- package/src/components/GlassmorphismButton.ts +1 -2
- package/src/components/GlassmorphismCard.ts +6 -3
- package/src/components/GlassmorphismEmptyState.ts +8 -2
- package/src/components/GlassmorphismInputGroup.ts +9 -6
- package/src/components/GlassmorphismMenubar.ts +1 -1
- package/src/components/GlassmorphismScrollArea.ts +7 -4
- package/src/components/GlassmorphismTable.ts +1 -1
- package/src/components/GlassmorphismTypography.ts +5 -2
- package/src/components/MinimalistAccordion.ts +14 -10
- package/src/components/MinimalistAlert.ts +1 -2
- package/src/components/MinimalistAlertDialog.ts +8 -6
- package/src/components/MinimalistAspectRatio.ts +7 -5
- package/src/components/MinimalistAvatar.ts +3 -4
- package/src/components/MinimalistBadge.ts +8 -9
- package/src/components/MinimalistBreadcrumb.ts +6 -6
- package/src/components/MinimalistButton.ts +9 -10
- package/src/components/MinimalistButtonGroup.ts +14 -12
- package/src/components/MinimalistCalendar.ts +14 -15
- package/src/components/MinimalistCard.ts +1 -2
- package/src/components/MinimalistCarousel.ts +4 -5
- package/src/components/MinimalistChart.ts +6 -7
- package/src/components/MinimalistCheckbox.ts +7 -8
- package/src/components/MinimalistCodeBlock.ts +4 -5
- package/src/components/MinimalistCollapsible.ts +13 -8
- package/src/components/MinimalistCommand.ts +7 -8
- package/src/components/MinimalistContextMenu.ts +7 -5
- package/src/components/MinimalistDialog.ts +4 -5
- package/src/components/MinimalistDrawer.ts +8 -9
- package/src/components/MinimalistDropdownMenu.ts +12 -7
- package/src/components/MinimalistEmpty.ts +11 -12
- package/src/components/MinimalistEmptyState.ts +5 -2
- package/src/components/MinimalistField.ts +27 -22
- package/src/components/MinimalistForm.ts +9 -8
- package/src/components/MinimalistHoverCard.ts +3 -4
- package/src/components/MinimalistInput.ts +7 -8
- package/src/components/MinimalistInputGroup.ts +10 -8
- package/src/components/MinimalistInputOtp.ts +6 -7
- package/src/components/MinimalistItem.ts +7 -8
- package/src/components/MinimalistKbd.ts +4 -5
- package/src/components/MinimalistLabel.ts +4 -5
- package/src/components/MinimalistMenubar.ts +7 -8
- package/src/components/MinimalistNativeSelect.ts +12 -7
- package/src/components/MinimalistNavigationMenu.ts +11 -6
- package/src/components/MinimalistPagination.ts +4 -5
- package/src/components/MinimalistPopover.ts +3 -4
- package/src/components/MinimalistProgress.ts +4 -5
- package/src/components/MinimalistRadioGroup.ts +10 -8
- package/src/components/MinimalistRangeCalendar.ts +18 -13
- package/src/components/MinimalistResizable.ts +1 -1
- package/src/components/MinimalistScrollArea.ts +34 -3
- package/src/components/MinimalistSelect.ts +3 -4
- package/src/components/MinimalistSeparator.ts +4 -5
- package/src/components/MinimalistSheet.ts +4 -5
- package/src/components/MinimalistSidebar.ts +3 -4
- package/src/components/MinimalistSkeleton.ts +3 -4
- package/src/components/MinimalistSlider.ts +7 -8
- package/src/components/MinimalistSonner.ts +5 -6
- package/src/components/MinimalistSpinner.ts +3 -4
- package/src/components/MinimalistSwitch.ts +5 -6
- package/src/components/MinimalistTable.ts +1 -1
- package/src/components/MinimalistTabs.ts +5 -6
- package/src/components/MinimalistTextarea.ts +9 -10
- package/src/components/MinimalistToggle.ts +11 -12
- package/src/components/MinimalistToggleGroup.ts +8 -6
- package/src/components/MinimalistTooltip.ts +3 -4
- package/src/components/MinimalistTypography.ts +1 -2
- package/src/components/NeubrutalismCard.ts +1 -1
- package/src/components/NeubrutalismItem.ts +1 -1
- package/src/components/ShadcnAccordion.ts +14 -10
- package/src/components/ShadcnAlertDialog.ts +4 -5
- package/src/components/ShadcnAspectRatio.ts +3 -4
- package/src/components/ShadcnAvatar.ts +3 -4
- package/src/components/ShadcnBadge.ts +8 -9
- package/src/components/ShadcnBreadcrumb.ts +6 -6
- package/src/components/ShadcnButton.ts +9 -10
- package/src/components/ShadcnButtonGroup.ts +10 -11
- package/src/components/ShadcnCalendar.ts +14 -15
- package/src/components/ShadcnCarousel.ts +4 -5
- package/src/components/ShadcnChart.ts +6 -7
- package/src/components/ShadcnCheckbox.ts +7 -8
- package/src/components/ShadcnCodeBlock.ts +4 -5
- package/src/components/ShadcnCollapsible.ts +9 -7
- package/src/components/ShadcnCommand.ts +7 -8
- package/src/components/ShadcnContextMenu.ts +3 -4
- package/src/components/ShadcnDialog.ts +4 -5
- package/src/components/ShadcnDrawer.ts +8 -9
- package/src/components/ShadcnDropdownMenu.ts +8 -6
- package/src/components/ShadcnEmpty.ts +11 -12
- package/src/components/ShadcnField.ts +27 -22
- package/src/components/ShadcnForm.ts +9 -8
- package/src/components/ShadcnHoverCard.ts +3 -4
- package/src/components/ShadcnInput.ts +7 -8
- package/src/components/ShadcnInputGroup.ts +6 -7
- package/src/components/ShadcnInputOtp.ts +6 -7
- package/src/components/ShadcnItem.ts +7 -8
- package/src/components/ShadcnKbd.ts +4 -5
- package/src/components/ShadcnLabel.ts +4 -5
- package/src/components/ShadcnMenubar.ts +7 -8
- package/src/components/ShadcnNativeSelect.ts +8 -6
- package/src/components/ShadcnNavigationMenu.ts +7 -5
- package/src/components/ShadcnPagination.ts +4 -5
- package/src/components/ShadcnPopover.ts +3 -4
- package/src/components/ShadcnProgress.ts +4 -5
- package/src/components/ShadcnRadioGroup.ts +6 -7
- package/src/components/ShadcnRangeCalendar.ts +14 -12
- package/src/components/ShadcnSelect.ts +3 -4
- package/src/components/ShadcnSeparator.ts +4 -5
- package/src/components/ShadcnSheet.ts +4 -5
- package/src/components/ShadcnSidebar.ts +3 -4
- package/src/components/ShadcnSkeleton.ts +3 -4
- package/src/components/ShadcnSlider.ts +7 -8
- package/src/components/ShadcnSonner.ts +5 -6
- package/src/components/ShadcnSpinner.ts +3 -4
- package/src/components/ShadcnSwitch.ts +5 -6
- package/src/components/ShadcnTabs.ts +5 -6
- package/src/components/ShadcnTextarea.ts +9 -10
- package/src/components/ShadcnToggle.ts +11 -12
- package/src/components/ShadcnToggleGroup.ts +4 -5
- package/src/components/ShadcnTooltip.ts +3 -4
|
@@ -64,8 +64,8 @@ class RangeCalendarComponent extends HTMLElement {
|
|
|
64
64
|
this.dispatchEvent(
|
|
65
65
|
new CustomEvent('range-change', {
|
|
66
66
|
detail: { start: this._startDate, end: this._endDate },
|
|
67
|
-
bubbles: true
|
|
68
|
-
})
|
|
67
|
+
bubbles: true
|
|
68
|
+
})
|
|
69
69
|
);
|
|
70
70
|
this.render();
|
|
71
71
|
}
|
|
@@ -104,12 +104,12 @@ class RangeCalendarComponent extends HTMLElement {
|
|
|
104
104
|
const target = new Date(
|
|
105
105
|
this._currentMonth.getFullYear(),
|
|
106
106
|
this._currentMonth.getMonth() + m,
|
|
107
|
-
1
|
|
107
|
+
1
|
|
108
108
|
);
|
|
109
109
|
const matrix = this.getMonthMatrix(target.getFullYear(), target.getMonth());
|
|
110
110
|
const monthTitle = new Intl.DateTimeFormat(this._locale, {
|
|
111
111
|
month: 'long',
|
|
112
|
-
year: 'numeric'
|
|
112
|
+
year: 'numeric'
|
|
113
113
|
}).format(target);
|
|
114
114
|
|
|
115
115
|
const rowsHtml = matrix
|
|
@@ -164,7 +164,7 @@ class RangeCalendarComponent extends HTMLElement {
|
|
|
164
164
|
})
|
|
165
165
|
.join('')}
|
|
166
166
|
</tr>
|
|
167
|
-
|
|
167
|
+
`
|
|
168
168
|
)
|
|
169
169
|
.join('');
|
|
170
170
|
|
|
@@ -179,7 +179,7 @@ class RangeCalendarComponent extends HTMLElement {
|
|
|
179
179
|
${weekdays
|
|
180
180
|
.map(
|
|
181
181
|
(w) =>
|
|
182
|
-
`<th class="w-9 rounded-md text-[0.8rem] font-normal text-muted-foreground text-center">${w}</th
|
|
182
|
+
`<th class="w-9 rounded-md text-[0.8rem] font-normal text-muted-foreground text-center">${w}</th>`
|
|
183
183
|
)
|
|
184
184
|
.join('')}
|
|
185
185
|
</tr>
|
|
@@ -223,7 +223,7 @@ class RangeCalendarComponent extends HTMLElement {
|
|
|
223
223
|
this._currentMonth = new Date(
|
|
224
224
|
this._currentMonth.getFullYear(),
|
|
225
225
|
this._currentMonth.getMonth() - 1,
|
|
226
|
-
1
|
|
226
|
+
1
|
|
227
227
|
);
|
|
228
228
|
this.render();
|
|
229
229
|
});
|
|
@@ -232,7 +232,7 @@ class RangeCalendarComponent extends HTMLElement {
|
|
|
232
232
|
this._currentMonth = new Date(
|
|
233
233
|
this._currentMonth.getFullYear(),
|
|
234
234
|
this._currentMonth.getMonth() + 1,
|
|
235
|
-
1
|
|
235
|
+
1
|
|
236
236
|
);
|
|
237
237
|
this.render();
|
|
238
238
|
});
|
|
@@ -253,11 +253,13 @@ class RangeCalendarComponent extends HTMLElement {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
if (!customElements.get('range-calendar')) {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
256
|
+
if (
|
|
257
|
+
typeof customElements !== 'undefined' &&
|
|
258
|
+
!customElements.get('surreal-shadcn-range-calendar')
|
|
259
|
+
) {
|
|
260
|
+
customElements.define('surreal-shadcn-range-calendar', RangeCalendarComponent);
|
|
261
|
+
}
|
|
259
262
|
}
|
|
260
|
-
};
|
|
261
263
|
export { RangeCalendarComponent as ShadcnRangeCalendar, RangeCalendarComponent };
|
|
262
264
|
|
|
263
265
|
export default RangeCalendarComponent;
|
|
@@ -90,11 +90,10 @@ class SurrealShadcnSelect extends HTMLElement {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
if (!customElements.get('surreal-select')) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-select')) {
|
|
94
|
+
customElements.define('surreal-shadcn-select', SurrealShadcnSelect);
|
|
95
|
+
}
|
|
96
96
|
}
|
|
97
|
-
};
|
|
98
97
|
export { SurrealShadcnSelect as ShadcnSelect, SurrealShadcnSelect };
|
|
99
98
|
|
|
100
99
|
export default SurrealShadcnSelect;
|
|
@@ -35,15 +35,14 @@ export class SurrealShadcnSeparator extends HTMLElement {
|
|
|
35
35
|
|
|
36
36
|
this.className = cn(
|
|
37
37
|
'shrink-0 bg-border block data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:h-full',
|
|
38
|
-
customClass
|
|
38
|
+
customClass
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
if (!customElements.get('surreal-separator')) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
44
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-separator')) {
|
|
45
|
+
customElements.define('surreal-shadcn-separator', SurrealShadcnSeparator);
|
|
46
|
+
}
|
|
48
47
|
}
|
|
49
48
|
export default SurrealShadcnSeparator;
|
|
@@ -62,7 +62,7 @@ class SurrealShadcnSheet extends HTMLElement {
|
|
|
62
62
|
right: 'top-0 right-0 h-full w-3/4 max-w-sm border-l translate-x-0',
|
|
63
63
|
left: 'top-0 left-0 h-full w-3/4 max-w-sm border-r translate-x-0',
|
|
64
64
|
top: 'top-0 inset-x-0 h-auto border-b translate-y-0',
|
|
65
|
-
bottom: 'bottom-0 inset-x-0 h-auto border-t translate-y-0'
|
|
65
|
+
bottom: 'bottom-0 inset-x-0 h-auto border-t translate-y-0'
|
|
66
66
|
}[side] || 'top-0 right-0 h-full w-3/4 max-w-sm border-l';
|
|
67
67
|
|
|
68
68
|
this.shadowRoot.innerHTML = `
|
|
@@ -152,11 +152,10 @@ class SurrealShadcnSheet extends HTMLElement {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
if (!customElements.get('surreal-sheet')) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-sheet')) {
|
|
156
|
+
customElements.define('surreal-shadcn-sheet', SurrealShadcnSheet);
|
|
157
|
+
}
|
|
158
158
|
}
|
|
159
|
-
};
|
|
160
159
|
export { SurrealShadcnSheet as ShadcnSheet, SurrealShadcnSheet };
|
|
161
160
|
|
|
162
161
|
export default SurrealShadcnSheet;
|
|
@@ -63,9 +63,8 @@ export class SurrealShadcnSidebar extends HTMLElement {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
if (!customElements.get('surreal-sidebar')) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
66
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-sidebar')) {
|
|
67
|
+
customElements.define('surreal-shadcn-sidebar', SurrealShadcnSidebar);
|
|
68
|
+
}
|
|
70
69
|
}
|
|
71
70
|
export default SurrealShadcnSidebar;
|
|
@@ -21,9 +21,8 @@ export class SurrealShadcnSkeleton extends HTMLElement {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
if (!customElements.get('surreal-skeleton')) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
24
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-skeleton')) {
|
|
25
|
+
customElements.define('surreal-shadcn-skeleton', SurrealShadcnSkeleton);
|
|
26
|
+
}
|
|
28
27
|
}
|
|
29
28
|
export default SurrealShadcnSkeleton;
|
|
@@ -76,7 +76,7 @@ export class SurrealShadcnSliderElement extends HTMLElement {
|
|
|
76
76
|
this._values = next;
|
|
77
77
|
this.renderThumbsAndRange();
|
|
78
78
|
this.dispatchEvent(
|
|
79
|
-
new CustomEvent('input', { detail: { value: this._values }, bubbles: true })
|
|
79
|
+
new CustomEvent('input', { detail: { value: this._values }, bubbles: true })
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -158,7 +158,7 @@ export class SurrealShadcnSliderElement extends HTMLElement {
|
|
|
158
158
|
this.releasePointerCapture(e.pointerId);
|
|
159
159
|
this._activeIndex = null;
|
|
160
160
|
this.dispatchEvent(
|
|
161
|
-
new CustomEvent('change', { detail: { value: this._values }, bubbles: true })
|
|
161
|
+
new CustomEvent('change', { detail: { value: this._values }, bubbles: true })
|
|
162
162
|
);
|
|
163
163
|
});
|
|
164
164
|
}
|
|
@@ -190,7 +190,7 @@ export class SurrealShadcnSliderElement extends HTMLElement {
|
|
|
190
190
|
data-index="${idx}"
|
|
191
191
|
class="absolute block size-4 shrink-0 rounded-full border border-primary bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"
|
|
192
192
|
></span>
|
|
193
|
-
|
|
193
|
+
`
|
|
194
194
|
)
|
|
195
195
|
.join('')}
|
|
196
196
|
`;
|
|
@@ -215,7 +215,7 @@ export class SurrealShadcnSliderElement extends HTMLElement {
|
|
|
215
215
|
const newVal = Math.max(this._min, Math.min(this._max, this._values[idx] + delta));
|
|
216
216
|
this.updateValue(idx, newVal);
|
|
217
217
|
this.dispatchEvent(
|
|
218
|
-
new CustomEvent('change', { detail: { value: this._values }, bubbles: true })
|
|
218
|
+
new CustomEvent('change', { detail: { value: this._values }, bubbles: true })
|
|
219
219
|
);
|
|
220
220
|
});
|
|
221
221
|
});
|
|
@@ -225,9 +225,8 @@ export class SurrealShadcnSliderElement extends HTMLElement {
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
if (!customElements.get('surreal-slider')) {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
228
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-slider')) {
|
|
229
|
+
customElements.define('surreal-shadcn-slider', SurrealShadcnSliderElement);
|
|
230
|
+
}
|
|
232
231
|
}
|
|
233
232
|
export default SurrealShadcnSliderElement;
|
|
@@ -22,14 +22,14 @@ class SonnerToasterElement extends HTMLElement {
|
|
|
22
22
|
message: string;
|
|
23
23
|
type?: 'success' | 'error' | 'info' | 'warning';
|
|
24
24
|
description?: string;
|
|
25
|
-
}
|
|
25
|
+
}>
|
|
26
26
|
) => {
|
|
27
27
|
this.addToast(event.detail.message, event.detail.type || 'info', event.detail.description);
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
public toast(
|
|
31
31
|
message: string,
|
|
32
|
-
options?: { type?: 'success' | 'error' | 'info' | 'warning'; description?: string }
|
|
32
|
+
options?: { type?: 'success' | 'error' | 'info' | 'warning'; description?: string }
|
|
33
33
|
) {
|
|
34
34
|
this.addToast(message, options?.type || 'info', options?.description);
|
|
35
35
|
}
|
|
@@ -80,10 +80,9 @@ class SonnerToasterElement extends HTMLElement {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
if (!customElements.get('sonner-toaster')) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
83
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-sonner')) {
|
|
84
|
+
customElements.define('surreal-shadcn-sonner', SonnerToasterElement);
|
|
85
|
+
}
|
|
87
86
|
}
|
|
88
87
|
|
|
89
88
|
export { SonnerToasterElement };
|
|
@@ -41,9 +41,8 @@ export class SurrealShadcnSpinner extends HTMLElement {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
if (!customElements.get('surreal-spinner')) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
44
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-spinner')) {
|
|
45
|
+
customElements.define('surreal-shadcn-spinner', SurrealShadcnSpinner);
|
|
46
|
+
}
|
|
48
47
|
}
|
|
49
48
|
export default SurrealShadcnSpinner;
|
|
@@ -127,8 +127,8 @@ class SurrealShadcnSwitch extends HTMLElement {
|
|
|
127
127
|
new CustomEvent('change', {
|
|
128
128
|
detail: { checked: this.checked },
|
|
129
129
|
bubbles: true,
|
|
130
|
-
composed: true
|
|
131
|
-
})
|
|
130
|
+
composed: true
|
|
131
|
+
})
|
|
132
132
|
);
|
|
133
133
|
}
|
|
134
134
|
|
|
@@ -153,10 +153,9 @@ class SurrealShadcnSwitch extends HTMLElement {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
if (!customElements.get('surreal-switch')) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
156
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-switch')) {
|
|
157
|
+
customElements.define('surreal-shadcn-switch', SurrealShadcnSwitch);
|
|
158
|
+
}
|
|
160
159
|
}
|
|
161
160
|
export { SurrealShadcnSwitch };
|
|
162
161
|
export default SurrealShadcnSwitch;
|
|
@@ -50,14 +50,14 @@ class SurrealShadcnTabs extends HTMLElement {
|
|
|
50
50
|
|
|
51
51
|
private handleClick(e: MouseEvent) {
|
|
52
52
|
const target = (e.target as HTMLElement).closest(
|
|
53
|
-
'[data-slot="tabs-trigger"]'
|
|
53
|
+
'[data-slot="tabs-trigger"]'
|
|
54
54
|
) as HTMLElement | null;
|
|
55
55
|
if (target && this.contains(target) && !target.hasAttribute('disabled')) {
|
|
56
56
|
const nextVal = target.getAttribute('value') || target.getAttribute('data-value') || '';
|
|
57
57
|
if (nextVal && nextVal !== this._value) {
|
|
58
58
|
this.value = nextVal;
|
|
59
59
|
this.dispatchEvent(
|
|
60
|
-
new CustomEvent('change', { detail: { value: nextVal }, bubbles: true })
|
|
60
|
+
new CustomEvent('change', { detail: { value: nextVal }, bubbles: true })
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -84,11 +84,10 @@ class SurrealShadcnTabs extends HTMLElement {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
if (typeof window !== 'undefined' && !customElements.get('surreal-tabs')) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-tabs')) {
|
|
88
|
+
customElements.define('surreal-shadcn-tabs', SurrealShadcnTabs);
|
|
89
|
+
}
|
|
90
90
|
}
|
|
91
|
-
};
|
|
92
91
|
export { SurrealShadcnTabs as ShadcnTabs, SurrealShadcnTabs };
|
|
93
92
|
|
|
94
93
|
export default SurrealShadcnTabs;
|
|
@@ -12,7 +12,7 @@ export class SurrealShadcnTextarea extends HTMLElement {
|
|
|
12
12
|
'name',
|
|
13
13
|
'required',
|
|
14
14
|
'aria-invalid',
|
|
15
|
-
'class'
|
|
15
|
+
'class'
|
|
16
16
|
];
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -33,8 +33,8 @@ export class SurrealShadcnTextarea extends HTMLElement {
|
|
|
33
33
|
new CustomEvent('input', {
|
|
34
34
|
bubbles: true,
|
|
35
35
|
composed: true,
|
|
36
|
-
detail: (e.target as HTMLTextAreaElement).value
|
|
37
|
-
})
|
|
36
|
+
detail: (e.target as HTMLTextAreaElement).value
|
|
37
|
+
})
|
|
38
38
|
);
|
|
39
39
|
});
|
|
40
40
|
this._textarea.addEventListener('change', (e) => {
|
|
@@ -42,8 +42,8 @@ export class SurrealShadcnTextarea extends HTMLElement {
|
|
|
42
42
|
new CustomEvent('change', {
|
|
43
43
|
bubbles: true,
|
|
44
44
|
composed: true,
|
|
45
|
-
detail: (e.target as HTMLTextAreaElement).value
|
|
46
|
-
})
|
|
45
|
+
detail: (e.target as HTMLTextAreaElement).value
|
|
46
|
+
})
|
|
47
47
|
);
|
|
48
48
|
});
|
|
49
49
|
}
|
|
@@ -65,7 +65,7 @@ export class SurrealShadcnTextarea extends HTMLElement {
|
|
|
65
65
|
private updateClasses() {
|
|
66
66
|
this._textarea.className = cn(
|
|
67
67
|
'rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 flex field-sizing-content min-h-16 w-full outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',
|
|
68
|
-
this.getAttribute('class')
|
|
68
|
+
this.getAttribute('class')
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -88,9 +88,8 @@ export class SurrealShadcnTextarea extends HTMLElement {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
if (!customElements.get('surreal-textarea')) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
91
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-textarea')) {
|
|
92
|
+
customElements.define('surreal-shadcn-textarea', SurrealShadcnTextarea);
|
|
93
|
+
}
|
|
95
94
|
}
|
|
96
95
|
export default SurrealShadcnTextarea;
|
|
@@ -6,20 +6,20 @@ const toggleVariants = cva(
|
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
8
8
|
default: 'bg-transparent',
|
|
9
|
-
outline: 'border border-input bg-transparent hover:bg-muted'
|
|
9
|
+
outline: 'border border-input bg-transparent hover:bg-muted'
|
|
10
10
|
},
|
|
11
11
|
size: {
|
|
12
12
|
default:
|
|
13
13
|
'h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
14
14
|
sm: "h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
15
|
-
lg: 'h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2'
|
|
16
|
-
}
|
|
15
|
+
lg: 'h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2'
|
|
16
|
+
}
|
|
17
17
|
},
|
|
18
18
|
defaultVariants: {
|
|
19
19
|
variant: 'default',
|
|
20
|
-
size: 'default'
|
|
21
|
-
}
|
|
22
|
-
}
|
|
20
|
+
size: 'default'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
23
|
);
|
|
24
24
|
|
|
25
25
|
export class SurrealShadcnToggle extends HTMLElement {
|
|
@@ -74,8 +74,8 @@ export class SurrealShadcnToggle extends HTMLElement {
|
|
|
74
74
|
new CustomEvent('change', {
|
|
75
75
|
detail: { pressed: this.pressed },
|
|
76
76
|
bubbles: true,
|
|
77
|
-
composed: true
|
|
78
|
-
})
|
|
77
|
+
composed: true
|
|
78
|
+
})
|
|
79
79
|
);
|
|
80
80
|
};
|
|
81
81
|
|
|
@@ -93,9 +93,8 @@ export class SurrealShadcnToggle extends HTMLElement {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
if (!customElements.get('surreal-toggle')) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
96
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-toggle')) {
|
|
97
|
+
customElements.define('surreal-shadcn-toggle', SurrealShadcnToggle);
|
|
98
|
+
}
|
|
100
99
|
}
|
|
101
100
|
export default SurrealShadcnToggle;
|
|
@@ -78,7 +78,7 @@ export class ToggleGroupComponent extends HTMLElement {
|
|
|
78
78
|
|
|
79
79
|
private handleClick(e: MouseEvent) {
|
|
80
80
|
const item = (e.target as HTMLElement).closest(
|
|
81
|
-
'toggle-group-item'
|
|
81
|
+
'toggle-group-item'
|
|
82
82
|
) as ToggleGroupItemComponent | null;
|
|
83
83
|
if (!item || item.hasAttribute('disabled') || this.hasAttribute('disabled')) return;
|
|
84
84
|
|
|
@@ -159,10 +159,9 @@ export class ToggleGroupItemComponent extends HTMLElement {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
if (!customElements.get('toggle-group')) {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
162
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-toggle-group')) {
|
|
163
|
+
customElements.define('surreal-shadcn-toggle-group', ToggleGroupComponent);
|
|
164
|
+
}
|
|
166
165
|
}
|
|
167
166
|
|
|
168
167
|
if (!customElements.get('toggle-group-item')) {
|
|
@@ -69,11 +69,10 @@ class SurrealShadcnTooltip extends HTMLElement {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
if (!customElements.get('surreal-tooltip')) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-tooltip')) {
|
|
73
|
+
customElements.define('surreal-shadcn-tooltip', SurrealShadcnTooltip);
|
|
74
|
+
}
|
|
75
75
|
}
|
|
76
|
-
};
|
|
77
76
|
export { SurrealShadcnTooltip as ShadcnTooltip, SurrealShadcnTooltip };
|
|
78
77
|
|
|
79
78
|
export default SurrealShadcnTooltip;
|