@surreal-ui/web 0.5.2 → 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 +6 -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
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surreal-ui/web",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"lit": "^3.2.0",
|
|
18
|
-
"@surreal-ui/core": "0.5.
|
|
18
|
+
"@surreal-ui/core": "0.5.3"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"tsup": "^8.0.2",
|
|
@@ -107,10 +107,9 @@ class SurrealGlassAlert extends HTMLElement {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
|
|
111
110
|
if (typeof customElements !== 'undefined' && !customElements.get('surreal-glassmorphism-alert')) {
|
|
112
111
|
customElements.define('surreal-glassmorphism-alert', SurrealGlassAlert);
|
|
113
|
-
}
|
|
112
|
+
}
|
|
114
113
|
export { SurrealGlassAlert as GlassmorphismAlert, SurrealGlassAlert };
|
|
115
114
|
|
|
116
115
|
export default SurrealGlassAlert;
|
|
@@ -9,9 +9,8 @@ class GlassButton extends HTMLElement {
|
|
|
9
9
|
attributeChangedCallback() {
|
|
10
10
|
this.render();
|
|
11
11
|
}
|
|
12
|
-
}
|
|
12
|
+
}
|
|
13
13
|
export { GlassButton as GlassmorphismButton, GlassButton };
|
|
14
|
-
;
|
|
15
14
|
if (typeof customElements !== 'undefined' && !customElements.get('surreal-glassmorphism-button')) {
|
|
16
15
|
customElements.define('surreal-glassmorphism-button', GlassButton);
|
|
17
16
|
}
|
|
@@ -15,11 +15,11 @@ class SurrealGlassmorphismCardSkeletonGrid extends HTMLElement {
|
|
|
15
15
|
render() {
|
|
16
16
|
const count = parseInt(this.getAttribute('count') || '6', 10);
|
|
17
17
|
this.shadowRoot.innerHTML = `<style>@import "https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css";</style><div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">${Array.from(
|
|
18
|
-
{ length: count }
|
|
18
|
+
{ length: count }
|
|
19
19
|
)
|
|
20
20
|
.map(
|
|
21
21
|
() =>
|
|
22
|
-
`<div class="relative flex flex-col justify-between rounded-2xl bg-slate-900/60 backdrop-blur-xl border border-slate-800/80 p-6 animate-pulse overflow-hidden space-y-4"><div class="space-y-3"><div class="flex items-center justify-between"><div class="h-5 w-28 bg-slate-800/80 rounded-md"></div><div class="h-4 w-12 bg-slate-800/60 rounded"></div></div><div class="space-y-2 pt-1"><div class="h-6 w-3/4 bg-slate-800/90 rounded-lg"></div><div class="h-3.5 w-full bg-slate-800/60 rounded"></div><div class="h-3.5 w-5/6 bg-slate-800/50 rounded"></div></div><div class="flex items-center gap-2 pt-2"><div class="h-4 w-16 bg-slate-800/70 rounded"></div><div class="h-4 w-14 bg-slate-800/60 rounded"></div><div class="h-4 w-12 bg-slate-800/50 rounded"></div></div></div><div class="pt-4 border-t border-slate-800/60 flex items-center justify-between"><div class="flex items-center gap-1.5"><div class="h-4 w-12 bg-slate-800/60 rounded"></div><div class="h-4 w-12 bg-slate-800/60 rounded"></div><div class="h-4 w-12 bg-slate-800/60 rounded"></div></div><div class="h-4 w-20 bg-slate-800/70 rounded"></div></div></div
|
|
22
|
+
`<div class="relative flex flex-col justify-between rounded-2xl bg-slate-900/60 backdrop-blur-xl border border-slate-800/80 p-6 animate-pulse overflow-hidden space-y-4"><div class="space-y-3"><div class="flex items-center justify-between"><div class="h-5 w-28 bg-slate-800/80 rounded-md"></div><div class="h-4 w-12 bg-slate-800/60 rounded"></div></div><div class="space-y-2 pt-1"><div class="h-6 w-3/4 bg-slate-800/90 rounded-lg"></div><div class="h-3.5 w-full bg-slate-800/60 rounded"></div><div class="h-3.5 w-5/6 bg-slate-800/50 rounded"></div></div><div class="flex items-center gap-2 pt-2"><div class="h-4 w-16 bg-slate-800/70 rounded"></div><div class="h-4 w-14 bg-slate-800/60 rounded"></div><div class="h-4 w-12 bg-slate-800/50 rounded"></div></div></div><div class="pt-4 border-t border-slate-800/60 flex items-center justify-between"><div class="flex items-center gap-1.5"><div class="h-4 w-12 bg-slate-800/60 rounded"></div><div class="h-4 w-12 bg-slate-800/60 rounded"></div><div class="h-4 w-12 bg-slate-800/60 rounded"></div></div><div class="h-4 w-20 bg-slate-800/70 rounded"></div></div></div>`
|
|
23
23
|
)
|
|
24
24
|
.join('')}</div>`;
|
|
25
25
|
}
|
|
@@ -27,7 +27,10 @@ class SurrealGlassmorphismCardSkeletonGrid extends HTMLElement {
|
|
|
27
27
|
|
|
28
28
|
if (typeof customElements !== 'undefined' && !customElements.get('surreal-glassmorphism-card')) {
|
|
29
29
|
customElements.define('surreal-glassmorphism-card', SurrealGlassmorphismCardSkeletonGrid);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
SurrealGlassmorphismCardSkeletonGrid as GlassmorphismCard,
|
|
33
|
+
SurrealGlassmorphismCardSkeletonGrid
|
|
30
34
|
};
|
|
31
|
-
export { SurrealGlassmorphismCardSkeletonGrid as GlassmorphismCard, SurrealGlassmorphismCardSkeletonGrid };
|
|
32
35
|
|
|
33
36
|
export default SurrealGlassmorphismCardSkeletonGrid;
|
|
@@ -21,9 +21,15 @@ class SurrealGlassmorphismEmptyState extends HTMLElement {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
if (
|
|
24
|
+
if (
|
|
25
|
+
typeof customElements !== 'undefined' &&
|
|
26
|
+
!customElements.get('surreal-glassmorphism-empty-state')
|
|
27
|
+
) {
|
|
25
28
|
customElements.define('surreal-glassmorphism-empty-state', SurrealGlassmorphismEmptyState);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
SurrealGlassmorphismEmptyState as GlassmorphismEmptyState,
|
|
32
|
+
SurrealGlassmorphismEmptyState
|
|
26
33
|
};
|
|
27
|
-
export { SurrealGlassmorphismEmptyState as GlassmorphismEmptyState, SurrealGlassmorphismEmptyState };
|
|
28
34
|
|
|
29
35
|
export default SurrealGlassmorphismEmptyState;
|
|
@@ -12,7 +12,7 @@ class GlassInputGroupElement extends HTMLElement {
|
|
|
12
12
|
'code-bundle',
|
|
13
13
|
'changelog-note',
|
|
14
14
|
'source-platform',
|
|
15
|
-
'loading'
|
|
15
|
+
'loading'
|
|
16
16
|
];
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -186,17 +186,20 @@ class GlassInputGroupElement extends HTMLElement {
|
|
|
186
186
|
detail: {
|
|
187
187
|
componentTypeId: this.componentTypeId,
|
|
188
188
|
aestheticId: this.aestheticId,
|
|
189
|
-
codeBundle: this.codeBundle
|
|
190
|
-
}
|
|
191
|
-
})
|
|
189
|
+
codeBundle: this.codeBundle
|
|
190
|
+
}
|
|
191
|
+
})
|
|
192
192
|
);
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
if (
|
|
197
|
+
if (
|
|
198
|
+
typeof customElements !== 'undefined' &&
|
|
199
|
+
!customElements.get('surreal-glassmorphism-input-group')
|
|
200
|
+
) {
|
|
198
201
|
customElements.define('surreal-glassmorphism-input-group', GlassInputGroupElement);
|
|
199
|
-
}
|
|
202
|
+
}
|
|
200
203
|
export { GlassInputGroupElement as GlassmorphismInputGroup, GlassInputGroupElement };
|
|
201
204
|
|
|
202
205
|
export default GlassInputGroupElement;
|
|
@@ -30,7 +30,7 @@ class SurrealGlassmorphismMenubar extends HTMLElement {
|
|
|
30
30
|
|
|
31
31
|
if (typeof customElements !== 'undefined' && !customElements.get('surreal-glassmorphism-menubar')) {
|
|
32
32
|
customElements.define('surreal-glassmorphism-menubar', SurrealGlassmorphismMenubar);
|
|
33
|
-
}
|
|
33
|
+
}
|
|
34
34
|
export { SurrealGlassmorphismMenubar as GlassmorphismMenubar, SurrealGlassmorphismMenubar };
|
|
35
35
|
|
|
36
36
|
export default SurrealGlassmorphismMenubar;
|
|
@@ -13,7 +13,7 @@ export class SurrealGlassmorphismScrollArea extends LitElement {
|
|
|
13
13
|
@property({ type: Boolean }) revertLoading = false;
|
|
14
14
|
_handleRevert(id: string) {
|
|
15
15
|
this.dispatchEvent(
|
|
16
|
-
new CustomEvent('revert', { detail: { versionId: id }, bubbles: true, composed: true })
|
|
16
|
+
new CustomEvent('revert', { detail: { versionId: id }, bubbles: true, composed: true })
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
@@ -69,14 +69,17 @@ export class SurrealGlassmorphismScrollArea extends LitElement {
|
|
|
69
69
|
: ''
|
|
70
70
|
}
|
|
71
71
|
</div>
|
|
72
|
-
|
|
72
|
+
`
|
|
73
73
|
)}
|
|
74
74
|
</div>
|
|
75
75
|
</div>
|
|
76
76
|
`;
|
|
77
77
|
}
|
|
78
|
-
}
|
|
79
|
-
if (
|
|
78
|
+
}
|
|
79
|
+
if (
|
|
80
|
+
typeof customElements !== 'undefined' &&
|
|
81
|
+
!customElements.get('surreal-glassmorphism-scroll-area')
|
|
82
|
+
) {
|
|
80
83
|
customElements.define('surreal-glassmorphism-scroll-area', GlassmorphismScrollArea);
|
|
81
84
|
}
|
|
82
85
|
|
|
@@ -46,7 +46,7 @@ class GlassTableElement extends HTMLElement {
|
|
|
46
46
|
|
|
47
47
|
if (typeof customElements !== 'undefined' && !customElements.get('surreal-glassmorphism-table')) {
|
|
48
48
|
customElements.define('surreal-glassmorphism-table', GlassTableElement);
|
|
49
|
-
}
|
|
49
|
+
}
|
|
50
50
|
export { GlassTableElement as GlassmorphismTable, GlassTableElement };
|
|
51
51
|
|
|
52
52
|
export default GlassTableElement;
|
|
@@ -59,8 +59,11 @@ export class SurrealGlassmorphismTypography extends LitElement {
|
|
|
59
59
|
</div>
|
|
60
60
|
`;
|
|
61
61
|
}
|
|
62
|
-
}
|
|
63
|
-
if (
|
|
62
|
+
}
|
|
63
|
+
if (
|
|
64
|
+
typeof customElements !== 'undefined' &&
|
|
65
|
+
!customElements.get('surreal-glassmorphism-typography')
|
|
66
|
+
) {
|
|
64
67
|
customElements.define('surreal-glassmorphism-typography', GlassmorphismTypography);
|
|
65
68
|
}
|
|
66
69
|
|
|
@@ -16,7 +16,7 @@ class SurrealShadcnAccordion extends HTMLElement {
|
|
|
16
16
|
this.render();
|
|
17
17
|
this.updateAttributes();
|
|
18
18
|
this.shadowRoot?.addEventListener('accordion-toggle', ((
|
|
19
|
-
e: CustomEvent<{ value: string; disabled: boolean }
|
|
19
|
+
e: CustomEvent<{ value: string; disabled: boolean }>
|
|
20
20
|
) => {
|
|
21
21
|
e.stopPropagation();
|
|
22
22
|
const { value, disabled } = e.detail;
|
|
@@ -87,8 +87,8 @@ class SurrealShadcnAccordion extends HTMLElement {
|
|
|
87
87
|
new CustomEvent('change', {
|
|
88
88
|
detail: { value: this._type === 'single' ? valueArray[0] || '' : valueArray },
|
|
89
89
|
bubbles: true,
|
|
90
|
-
composed: true
|
|
91
|
-
})
|
|
90
|
+
composed: true
|
|
91
|
+
})
|
|
92
92
|
);
|
|
93
93
|
}
|
|
94
94
|
|
|
@@ -194,8 +194,8 @@ class SurrealShadcnAccordionTrigger extends HTMLElement {
|
|
|
194
194
|
new CustomEvent('accordion-toggle', {
|
|
195
195
|
detail: { value: val, disabled: isItemDisabled },
|
|
196
196
|
bubbles: true,
|
|
197
|
-
composed: true
|
|
198
|
-
})
|
|
197
|
+
composed: true
|
|
198
|
+
})
|
|
199
199
|
);
|
|
200
200
|
};
|
|
201
201
|
|
|
@@ -225,10 +225,9 @@ class SurrealShadcnAccordionContent extends HTMLElement {
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
if (!customElements.get('surreal-accordion')) {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
228
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-accordion')) {
|
|
229
|
+
customElements.define('surreal-shadcn-accordion', SurrealShadcnAccordion);
|
|
230
|
+
}
|
|
232
231
|
}
|
|
233
232
|
if (!customElements.get('surreal-accordion-item')) {
|
|
234
233
|
customElements.define('surreal-shadcn-accordion', SurrealShadcnAccordionItem);
|
|
@@ -240,7 +239,12 @@ if (!customElements.get('surreal-accordion-content')) {
|
|
|
240
239
|
customElements.define('surreal-shadcn-accordion', SurrealShadcnAccordionContent);
|
|
241
240
|
}
|
|
242
241
|
|
|
243
|
-
export {
|
|
242
|
+
export {
|
|
243
|
+
SurrealShadcnAccordion,
|
|
244
|
+
SurrealShadcnAccordionItem,
|
|
245
|
+
SurrealShadcnAccordionTrigger,
|
|
246
|
+
SurrealShadcnAccordionContent
|
|
247
|
+
};
|
|
244
248
|
if (typeof customElements !== 'undefined' && !customElements.get('surreal-minimalist-accordion')) {
|
|
245
249
|
customElements.define('surreal-minimalist-accordion', SurrealShadcnAccordion);
|
|
246
250
|
}
|
|
@@ -86,10 +86,9 @@ class ModernAlertElement extends HTMLElement {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
|
|
90
89
|
if (typeof customElements !== 'undefined' && !customElements.get('surreal-modern-alert')) {
|
|
91
90
|
customElements.define('surreal-modern-alert', ModernAlertElement);
|
|
92
|
-
}
|
|
91
|
+
}
|
|
93
92
|
export { ModernAlertElement as MinimalistAlert, ModernAlertElement };
|
|
94
93
|
|
|
95
94
|
if (typeof customElements !== 'undefined' && !customElements.get('surreal-minimalist-alert')) {
|
|
@@ -56,7 +56,7 @@ class SurrealShadcnAlertDialog extends HTMLElement {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
const cancel = target.closest(
|
|
59
|
-
'[data-slot="alert-dialog-cancel"], [data-slot="alert-dialog-action"]'
|
|
59
|
+
'[data-slot="alert-dialog-cancel"], [data-slot="alert-dialog-action"]'
|
|
60
60
|
);
|
|
61
61
|
if (cancel) {
|
|
62
62
|
this.open = false;
|
|
@@ -86,14 +86,16 @@ class SurrealShadcnAlertDialog extends HTMLElement {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
if (!customElements.get('surreal-alert-dialog')) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-alert-dialog')) {
|
|
90
|
+
customElements.define('surreal-shadcn-alert-dialog', SurrealShadcnAlertDialog);
|
|
91
|
+
}
|
|
92
92
|
}
|
|
93
|
-
};
|
|
94
93
|
export { SurrealShadcnAlertDialog as MinimalistAlertDialog, SurrealShadcnAlertDialog };
|
|
95
94
|
|
|
96
|
-
if (
|
|
95
|
+
if (
|
|
96
|
+
typeof customElements !== 'undefined' &&
|
|
97
|
+
!customElements.get('surreal-minimalist-alert-dialog')
|
|
98
|
+
) {
|
|
97
99
|
customElements.define('surreal-minimalist-alert-dialog', SurrealShadcnAlertDialog);
|
|
98
100
|
}
|
|
99
101
|
|
|
@@ -22,12 +22,14 @@ export class AspectRatioElement extends HTMLElement {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
if (typeof customElements !== 'undefined' && !customElements.get('surreal-aspect-ratio')) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
25
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-aspect-ratio')) {
|
|
26
|
+
customElements.define('surreal-shadcn-aspect-ratio', AspectRatioElement);
|
|
27
|
+
}
|
|
29
28
|
}
|
|
30
|
-
if (
|
|
29
|
+
if (
|
|
30
|
+
typeof customElements !== 'undefined' &&
|
|
31
|
+
!customElements.get('surreal-minimalist-aspect-ratio')
|
|
32
|
+
) {
|
|
31
33
|
customElements.define('surreal-minimalist-aspect-ratio', AspectRatioElement);
|
|
32
34
|
}
|
|
33
35
|
|
|
@@ -62,10 +62,9 @@ export class SurrealShadcnAvatar extends HTMLElement {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
if (!customElements.get('surreal-avatar')) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
65
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-avatar')) {
|
|
66
|
+
customElements.define('surreal-shadcn-avatar', SurrealShadcnAvatar);
|
|
67
|
+
}
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
export class SurrealShadcnAvatarGroup extends HTMLElement {
|
|
@@ -11,13 +11,13 @@ const badgeVariants = cva(
|
|
|
11
11
|
'bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20',
|
|
12
12
|
outline: 'border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground',
|
|
13
13
|
ghost: 'hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50',
|
|
14
|
-
link: 'text-primary underline-offset-4 hover:underline'
|
|
15
|
-
}
|
|
14
|
+
link: 'text-primary underline-offset-4 hover:underline'
|
|
15
|
+
}
|
|
16
16
|
},
|
|
17
17
|
defaultVariants: {
|
|
18
|
-
variant: 'default'
|
|
19
|
-
}
|
|
20
|
-
}
|
|
18
|
+
variant: 'default'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
21
|
);
|
|
22
22
|
|
|
23
23
|
export class UiBadge extends HTMLElement {
|
|
@@ -59,10 +59,9 @@ export class UiBadge extends HTMLElement {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
if (!customElements.get('ui-badge')) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
62
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-badge')) {
|
|
63
|
+
customElements.define('surreal-shadcn-badge', UiBadge);
|
|
64
|
+
}
|
|
66
65
|
}
|
|
67
66
|
if (typeof customElements !== 'undefined' && !customElements.get('surreal-minimalist-badge')) {
|
|
68
67
|
customElements.define('surreal-minimalist-badge', UiBadge);
|
|
@@ -13,7 +13,7 @@ export class BreadcrumbList extends HTMLElement {
|
|
|
13
13
|
this.setAttribute('data-slot', 'breadcrumb-list');
|
|
14
14
|
this.className = cn(
|
|
15
15
|
'gap-1.5 text-sm text-muted-foreground flex flex-wrap items-center wrap-break-word list-none p-0 m-0',
|
|
16
|
-
this.className
|
|
16
|
+
this.className
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -51,7 +51,7 @@ export class BreadcrumbSeparator extends HTMLElement {
|
|
|
51
51
|
this.setAttribute('aria-hidden', 'true');
|
|
52
52
|
this.className = cn(
|
|
53
53
|
'[&>svg]:size-3.5 inline-flex items-center text-muted-foreground',
|
|
54
|
-
this.className
|
|
54
|
+
this.className
|
|
55
55
|
);
|
|
56
56
|
if (!this.innerHTML.trim()) {
|
|
57
57
|
this.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="size-3.5"><path d="m9 18 6-6-6-6"/></svg>`;
|
|
@@ -69,10 +69,10 @@ export class BreadcrumbEllipsis extends HTMLElement {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
if (!customElements.get('ui-breadcrumb'))
|
|
73
|
-
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-breadcrumb')) {
|
|
74
|
-
|
|
75
|
-
}
|
|
72
|
+
if (!customElements.get('ui-breadcrumb'))
|
|
73
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-breadcrumb')) {
|
|
74
|
+
customElements.define('surreal-shadcn-breadcrumb', BreadcrumbRoot);
|
|
75
|
+
}
|
|
76
76
|
if (!customElements.get('ui-breadcrumb-list'))
|
|
77
77
|
customElements.define('surreal-shadcn-breadcrumb', BreadcrumbList);
|
|
78
78
|
if (!customElements.get('ui-breadcrumb-item'))
|
|
@@ -14,7 +14,7 @@ const buttonVariants = cva(
|
|
|
14
14
|
'hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50',
|
|
15
15
|
destructive:
|
|
16
16
|
'bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40',
|
|
17
|
-
link: 'text-primary underline-offset-4 hover:underline'
|
|
17
|
+
link: 'text-primary underline-offset-4 hover:underline'
|
|
18
18
|
},
|
|
19
19
|
size: {
|
|
20
20
|
default:
|
|
@@ -27,14 +27,14 @@ const buttonVariants = cva(
|
|
|
27
27
|
"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
28
28
|
'icon-sm':
|
|
29
29
|
'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg',
|
|
30
|
-
'icon-lg': 'size-9'
|
|
31
|
-
}
|
|
30
|
+
'icon-lg': 'size-9'
|
|
31
|
+
}
|
|
32
32
|
},
|
|
33
33
|
defaultVariants: {
|
|
34
34
|
variant: 'default',
|
|
35
|
-
size: 'default'
|
|
36
|
-
}
|
|
37
|
-
}
|
|
35
|
+
size: 'default'
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
38
|
);
|
|
39
39
|
|
|
40
40
|
export class SurrealShadcnButton extends HTMLElement {
|
|
@@ -99,10 +99,9 @@ export class SurrealShadcnButton extends HTMLElement {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
if (!customElements.get('surreal-button')) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
102
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-button')) {
|
|
103
|
+
customElements.define('surreal-shadcn-button', SurrealShadcnButton);
|
|
104
|
+
}
|
|
106
105
|
}
|
|
107
106
|
if (typeof customElements !== 'undefined' && !customElements.get('surreal-minimalist-button')) {
|
|
108
107
|
customElements.define('surreal-minimalist-button', SurrealShadcnButton);
|
|
@@ -8,13 +8,13 @@ const buttonGroupVariants = cva(
|
|
|
8
8
|
horizontal:
|
|
9
9
|
'[&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]]:rounded-r-none [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0',
|
|
10
10
|
vertical:
|
|
11
|
-
'[&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! flex-col [&>[data-slot]]:rounded-b-none [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0'
|
|
12
|
-
}
|
|
11
|
+
'[&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! flex-col [&>[data-slot]]:rounded-b-none [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0'
|
|
12
|
+
}
|
|
13
13
|
},
|
|
14
14
|
defaultVariants: {
|
|
15
|
-
orientation: 'horizontal'
|
|
16
|
-
}
|
|
17
|
-
}
|
|
15
|
+
orientation: 'horizontal'
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
18
|
);
|
|
19
19
|
|
|
20
20
|
export class ButtonGroupElement extends HTMLElement {
|
|
@@ -63,7 +63,7 @@ export class ButtonGroupSeparatorElement extends HTMLElement {
|
|
|
63
63
|
const customClass = this.getAttribute('class') || '';
|
|
64
64
|
this.className = cn(
|
|
65
65
|
'bg-input relative self-stretch data-[orientation=horizontal]:mx-px data-[orientation=horizontal]:w-auto data-[orientation=vertical]:my-px data-[orientation=vertical]:h-auto',
|
|
66
|
-
customClass
|
|
66
|
+
customClass
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -86,16 +86,15 @@ export class ButtonGroupTextElement extends HTMLElement {
|
|
|
86
86
|
const customClass = this.getAttribute('class') || '';
|
|
87
87
|
this.className = cn(
|
|
88
88
|
"gap-2 rounded-lg border bg-muted px-2.5 text-sm font-medium [&_svg:not([class*='size-'])]:size-4 flex items-center [&_svg]:pointer-events-none",
|
|
89
|
-
customClass
|
|
89
|
+
customClass
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
if (!customElements.get('surreal-button-group')) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
95
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-button-group')) {
|
|
96
|
+
customElements.define('surreal-shadcn-button-group', ButtonGroupElement);
|
|
97
|
+
}
|
|
99
98
|
}
|
|
100
99
|
if (!customElements.get('surreal-button-group-separator')) {
|
|
101
100
|
customElements.define('surreal-shadcn-button-group', ButtonGroupSeparatorElement);
|
|
@@ -103,7 +102,10 @@ if (!customElements.get('surreal-button-group-separator')) {
|
|
|
103
102
|
if (!customElements.get('surreal-button-group-text')) {
|
|
104
103
|
customElements.define('surreal-shadcn-button-group', ButtonGroupTextElement);
|
|
105
104
|
}
|
|
106
|
-
if (
|
|
105
|
+
if (
|
|
106
|
+
typeof customElements !== 'undefined' &&
|
|
107
|
+
!customElements.get('surreal-minimalist-button-group')
|
|
108
|
+
) {
|
|
107
109
|
customElements.define('surreal-minimalist-button-group', ButtonGroupElement);
|
|
108
110
|
}
|
|
109
111
|
|
|
@@ -55,7 +55,7 @@ export class SurrealShadcnCalendar extends HTMLElement {
|
|
|
55
55
|
this._currentMonth = new Date(
|
|
56
56
|
this._currentMonth.getFullYear(),
|
|
57
57
|
this._currentMonth.getMonth() - 1,
|
|
58
|
-
1
|
|
58
|
+
1
|
|
59
59
|
);
|
|
60
60
|
this.render();
|
|
61
61
|
};
|
|
@@ -64,7 +64,7 @@ export class SurrealShadcnCalendar extends HTMLElement {
|
|
|
64
64
|
this._currentMonth = new Date(
|
|
65
65
|
this._currentMonth.getFullYear(),
|
|
66
66
|
this._currentMonth.getMonth() + 1,
|
|
67
|
-
1
|
|
67
|
+
1
|
|
68
68
|
);
|
|
69
69
|
this.render();
|
|
70
70
|
};
|
|
@@ -73,7 +73,7 @@ export class SurrealShadcnCalendar extends HTMLElement {
|
|
|
73
73
|
this._value = date;
|
|
74
74
|
this.setAttribute('value', date.toISOString());
|
|
75
75
|
this.dispatchEvent(
|
|
76
|
-
new CustomEvent('change', { detail: { value: date }, bubbles: true, composed: true })
|
|
76
|
+
new CustomEvent('change', { detail: { value: date }, bubbles: true, composed: true })
|
|
77
77
|
);
|
|
78
78
|
this.render();
|
|
79
79
|
}
|
|
@@ -93,20 +93,20 @@ export class SurrealShadcnCalendar extends HTMLElement {
|
|
|
93
93
|
'September',
|
|
94
94
|
'October',
|
|
95
95
|
'November',
|
|
96
|
-
'December'
|
|
96
|
+
'December'
|
|
97
97
|
];
|
|
98
98
|
const monthStr = new Intl.DateTimeFormat(this._locale, { month: 'long' }).format(
|
|
99
|
-
this._currentMonth
|
|
99
|
+
this._currentMonth
|
|
100
100
|
);
|
|
101
101
|
const yearStr = new Intl.DateTimeFormat(this._locale, { year: 'numeric' }).format(
|
|
102
|
-
this._currentMonth
|
|
102
|
+
this._currentMonth
|
|
103
103
|
);
|
|
104
104
|
|
|
105
105
|
const weekdays = [];
|
|
106
106
|
const temp = new Date(2023, 0, 1);
|
|
107
107
|
for (let i = 0; i < 7; i++) {
|
|
108
108
|
weekdays.push(
|
|
109
|
-
new Intl.DateTimeFormat(this._locale, { weekday: 'short' }).format(temp).slice(0, 2)
|
|
109
|
+
new Intl.DateTimeFormat(this._locale, { weekday: 'short' }).format(temp).slice(0, 2)
|
|
110
110
|
);
|
|
111
111
|
temp.setDate(temp.getDate() + 1);
|
|
112
112
|
}
|
|
@@ -138,7 +138,7 @@ export class SurrealShadcnCalendar extends HTMLElement {
|
|
|
138
138
|
!!this._value &&
|
|
139
139
|
d.getFullYear() === this._value.getFullYear() &&
|
|
140
140
|
d.getMonth() === this._value.getMonth() &&
|
|
141
|
-
d.getDate() === this._value.getDate()
|
|
141
|
+
d.getDate() === this._value.getDate()
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
|
|
@@ -153,7 +153,7 @@ export class SurrealShadcnCalendar extends HTMLElement {
|
|
|
153
153
|
!!this._value &&
|
|
154
154
|
d.getFullYear() === this._value.getFullYear() &&
|
|
155
155
|
d.getMonth() === this._value.getMonth() &&
|
|
156
|
-
d.getDate() === this._value.getDate()
|
|
156
|
+
d.getDate() === this._value.getDate()
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
|
|
@@ -169,7 +169,7 @@ export class SurrealShadcnCalendar extends HTMLElement {
|
|
|
169
169
|
!!this._value &&
|
|
170
170
|
d.getFullYear() === this._value.getFullYear() &&
|
|
171
171
|
d.getMonth() === this._value.getMonth() &&
|
|
172
|
-
d.getDate() === this._value.getDate()
|
|
172
|
+
d.getDate() === this._value.getDate()
|
|
173
173
|
});
|
|
174
174
|
nextD++;
|
|
175
175
|
}
|
|
@@ -195,7 +195,7 @@ export class SurrealShadcnCalendar extends HTMLElement {
|
|
|
195
195
|
${Array.from({ length: 21 }, (_, i) => year - 10 + i)
|
|
196
196
|
.map(
|
|
197
197
|
(y) =>
|
|
198
|
-
`<option value="${y}" ${y === year ? 'selected' : ''}>${y}</option
|
|
198
|
+
`<option value="${y}" ${y === year ? 'selected' : ''}>${y}</option>`
|
|
199
199
|
)
|
|
200
200
|
.join('')}
|
|
201
201
|
</select>
|
|
@@ -270,10 +270,9 @@ export class SurrealShadcnCalendar extends HTMLElement {
|
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
if (!customElements.get('surreal-calendar')) {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
273
|
+
if (typeof customElements !== 'undefined' && !customElements.get('surreal-shadcn-calendar')) {
|
|
274
|
+
customElements.define('surreal-shadcn-calendar', SurrealShadcnCalendar);
|
|
275
|
+
}
|
|
277
276
|
}
|
|
278
277
|
if (typeof customElements !== 'undefined' && !customElements.get('surreal-minimalist-calendar')) {
|
|
279
278
|
customElements.define('surreal-minimalist-calendar', SurrealShadcnCalendar);
|
|
@@ -118,10 +118,9 @@ class SurrealModernCard extends HTMLElement {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
|
|
122
121
|
if (typeof customElements !== 'undefined' && !customElements.get('surreal-modern-card')) {
|
|
123
122
|
customElements.define('surreal-modern-card', SurrealModernCard);
|
|
124
|
-
}
|
|
123
|
+
}
|
|
125
124
|
export { SurrealModernCard as MinimalistCard, SurrealModernCard };
|
|
126
125
|
|
|
127
126
|
if (typeof customElements !== 'undefined' && !customElements.get('surreal-minimalist-card')) {
|