@skewedaspect/sleekspace-ui 0.8.1 → 0.9.0
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/dist/components/Dropdown/SkDropdown.vue.d.ts +9 -1
- package/dist/components/Dropdown/types.d.ts +2 -1
- package/dist/components/NavBar/SkNavBar.vue.d.ts +9 -1
- package/dist/components/NavBar/context.d.ts +2 -0
- package/dist/components/NavBar/types.d.ts +5 -1
- package/dist/components/Page/SkPage.vue.d.ts +9 -0
- package/dist/components/ScrollArea/SkScrollArea.vue.d.ts +105 -4
- package/dist/composables/useCustomColors.d.ts +18 -56
- package/{src → dist}/global.d.ts +6 -2
- package/dist/sleekspace-ui.css +4253 -1251
- package/dist/sleekspace-ui.es.js +204 -109
- package/dist/sleekspace-ui.umd.js +204 -109
- package/dist/static/classes.d.ts +18 -0
- package/dist/static/components/alert.d.ts +12 -0
- package/dist/static/components/avatar.d.ts +9 -0
- package/dist/static/components/breadcrumbs.d.ts +6 -0
- package/dist/static/components/button.d.ts +13 -0
- package/dist/static/components/card.d.ts +5 -0
- package/dist/static/components/checkbox.d.ts +10 -0
- package/dist/static/components/colorPicker.d.ts +8 -0
- package/dist/static/components/divider.d.ts +8 -0
- package/dist/static/components/dropdown.d.ts +8 -0
- package/dist/static/components/field.d.ts +15 -0
- package/dist/static/components/group.d.ts +5 -0
- package/dist/static/components/input.d.ts +14 -0
- package/dist/static/components/navBar.d.ts +16 -0
- package/dist/static/components/numberInput.d.ts +15 -0
- package/dist/static/components/page.d.ts +9 -0
- package/dist/static/components/pagination.d.ts +5 -0
- package/dist/static/components/panel.d.ts +11 -0
- package/dist/static/components/progress.d.ts +9 -0
- package/dist/static/components/radio.d.ts +11 -0
- package/dist/static/components/select.d.ts +10 -0
- package/dist/static/components/sidebar.d.ts +9 -0
- package/dist/static/components/skeleton.d.ts +11 -0
- package/dist/static/components/slider.d.ts +12 -0
- package/dist/static/components/spinner.d.ts +12 -0
- package/dist/static/components/switchInput.d.ts +10 -0
- package/dist/static/components/table.d.ts +12 -0
- package/dist/static/components/tag.d.ts +8 -0
- package/dist/static/components/tagsInput.d.ts +7 -0
- package/dist/static/components/textarea.d.ts +12 -0
- package/dist/static/components/toolbar.d.ts +12 -0
- package/dist/static/components/tooltip.d.ts +7 -0
- package/dist/static/escape.d.ts +2 -0
- package/dist/static/index.cjs.js +1 -0
- package/dist/static/index.d.ts +68 -0
- package/dist/static/index.es.js +732 -0
- package/dist/static/render.d.ts +12 -0
- package/dist/static/specs.d.ts +2 -0
- package/dist/static/types.d.ts +43 -0
- package/dist/tokens.css +322 -0
- package/dist/types/index.d.ts +36 -0
- package/docs/guides/installation.md +8 -2
- package/docs/guides/pure-css/_meta.yaml +8 -0
- package/docs/guides/pure-css/class-api.md +1070 -0
- package/docs/guides/pure-css/custom-elements.md +574 -0
- package/docs/guides/pure-css/index.md +86 -0
- package/docs/guides/pure-css/limitations.md +152 -0
- package/docs/guides/pure-css/static-helpers.md +1203 -0
- package/llms-full.txt +3736 -261
- package/package.json +16 -5
- package/src/components/Card/SkCard.vue +1 -0
- package/src/components/ContextMenu/SkContextMenuRadioGroup.vue +4 -1
- package/src/components/Dropdown/SkDropdown.vue +20 -3
- package/src/components/Dropdown/SkDropdownRadioGroup.vue +4 -1
- package/src/components/Dropdown/types.ts +2 -1
- package/src/components/NavBar/SkNavBar.vue +14 -4
- package/src/components/NavBar/context.ts +4 -2
- package/src/components/NavBar/types.ts +6 -1
- package/src/components/Page/SkPage.vue +11 -0
- package/src/components/Panel/SkPanel.vue +2 -1
- package/src/components/ScrollArea/SkScrollArea.vue +78 -5
- package/src/components/TreeView/SkTreeView.vue +7 -2
- package/src/composables/useCustomColors.ts +86 -77
- package/src/composables/usePortalContext.test.ts +0 -2
- package/src/shims.d.ts +10 -0
- package/src/static/__tests__/parity.test.ts +717 -0
- package/src/static/__tests__/parityHarness.test.ts +98 -0
- package/src/static/__tests__/parityHarness.ts +260 -0
- package/src/static/classes.test.ts +82 -0
- package/src/static/classes.ts +111 -0
- package/src/static/components/__tests__/helpers.test.ts +837 -0
- package/src/static/components/alert.ts +117 -0
- package/src/static/components/avatar.ts +86 -0
- package/src/static/components/breadcrumbs.ts +28 -0
- package/src/static/components/button.ts +75 -0
- package/src/static/components/card.ts +27 -0
- package/src/static/components/checkbox.ts +48 -0
- package/src/static/components/colorPicker.ts +45 -0
- package/src/static/components/divider.ts +39 -0
- package/src/static/components/dropdown.ts +36 -0
- package/src/static/components/field.ts +86 -0
- package/src/static/components/group.ts +27 -0
- package/src/static/components/input.ts +55 -0
- package/src/static/components/navBar.ts +94 -0
- package/src/static/components/numberInput.ts +64 -0
- package/src/static/components/page.ts +31 -0
- package/src/static/components/pagination.ts +27 -0
- package/src/static/components/panel.ts +33 -0
- package/src/static/components/progress.ts +31 -0
- package/src/static/components/radio.ts +53 -0
- package/src/static/components/select.ts +51 -0
- package/src/static/components/sidebar.ts +85 -0
- package/src/static/components/skeleton.ts +66 -0
- package/src/static/components/slider.ts +50 -0
- package/src/static/components/spinner.ts +94 -0
- package/src/static/components/switchInput.ts +49 -0
- package/src/static/components/table.ts +88 -0
- package/src/static/components/tag.ts +76 -0
- package/src/static/components/tagsInput.ts +35 -0
- package/src/static/components/textarea.ts +53 -0
- package/src/static/components/toolbar.ts +74 -0
- package/src/static/components/tooltip.ts +29 -0
- package/src/static/escape.test.ts +53 -0
- package/src/static/escape.ts +28 -0
- package/src/static/generated/defaults.ts +378 -0
- package/src/static/generated/propTypes.ts +425 -0
- package/src/static/index.ts +116 -0
- package/src/static/render.test.ts +83 -0
- package/src/static/render.ts +76 -0
- package/src/static/specs.test.ts +58 -0
- package/src/static/specs.ts +230 -0
- package/src/static/types.ts +176 -0
- package/src/styles/__tests__/testHelpers.ts +97 -0
- package/src/styles/base/_custom-elements.scss +51 -0
- package/src/styles/base/_index.scss +4 -0
- package/src/styles/components/__tests__/componentSelectors.test.ts +2575 -0
- package/src/styles/components/_alert.scss +82 -39
- package/src/styles/components/_avatar.scss +102 -47
- package/src/styles/components/_breadcrumbs.scss +39 -37
- package/src/styles/components/_button.scss +58 -5
- package/src/styles/components/_card.scss +64 -2
- package/src/styles/components/_checkbox.scss +35 -5
- package/src/styles/components/_color-picker.scss +48 -13
- package/src/styles/components/_divider.scss +86 -52
- package/src/styles/components/_dropdown.scss +214 -0
- package/src/styles/components/_field.scss +76 -23
- package/src/styles/components/_group.scss +190 -79
- package/src/styles/components/_index.scss +1 -0
- package/src/styles/components/_input.scss +81 -5
- package/src/styles/components/_menu.scss +1 -1
- package/src/styles/components/_navbar.scss +76 -45
- package/src/styles/components/_number-input.scss +88 -83
- package/src/styles/components/_page.scss +82 -23
- package/src/styles/components/_pagination.scss +240 -212
- package/src/styles/components/_panel.scss +268 -122
- package/src/styles/components/_progress.scss +120 -70
- package/src/styles/components/_radio.scss +35 -5
- package/src/styles/components/_scroll-area.scss +50 -22
- package/src/styles/components/_select.scss +40 -9
- package/src/styles/components/_sidebar.scss +59 -34
- package/src/styles/components/_skeleton.scss +111 -65
- package/src/styles/components/_slider.scss +34 -10
- package/src/styles/components/_spinner.scss +107 -56
- package/src/styles/components/_switch.scss +36 -5
- package/src/styles/components/_table.scss +150 -166
- package/src/styles/components/_tag.scss +244 -154
- package/src/styles/components/_tags-input.scss +46 -12
- package/src/styles/components/_textarea.scss +36 -5
- package/src/styles/components/_toolbar.scss +85 -31
- package/src/styles/components/_tooltip.scss +172 -3
- package/src/styles/mixins/_cut-border.scss +18 -4
- package/src/styles/mixins/_dual-selector.scss +192 -0
- package/src/styles/mixins/_index.scss +1 -0
- package/src/styles/mixins/dualSelector.test.ts +151 -0
- package/src/styles/themes/_colorful.scss +25 -0
- package/src/styles/themes/_greyscale.scss +25 -0
- package/src/styles/themes/_shade-scale.scss +39 -0
- package/src/styles/tokens/_semantic-color-kinds.scss +66 -0
- package/src/{types.ts → types/index.ts} +19 -11
- package/web-types.json +970 -137
- package/dist/composables/useCustomColors.test.d.ts +0 -1
- package/dist/composables/useFocusTrap.test.d.ts +0 -1
- package/dist/composables/usePortalContext.test.d.ts +0 -1
- package/dist/styles/mixins/fluidSize.test.d.ts +0 -1
- package/dist/types.d.ts +0 -29
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
// Auto-generated — do not edit. Run `npm run generate:static-types` to regenerate.
|
|
2
|
+
// Type references use bare names extracted from each component's Vue file — the types
|
|
3
|
+
// themselves live in the per-component types.ts files. This file is for documentation
|
|
4
|
+
// and drift detection, not direct import. ts-nocheck suppresses unknown-name errors.
|
|
5
|
+
// @ts-nocheck
|
|
6
|
+
|
|
7
|
+
import type { ComponentCustomColors } from '../../types';
|
|
8
|
+
|
|
9
|
+
export interface SkAccordionStaticProps extends ComponentCustomColors
|
|
10
|
+
{
|
|
11
|
+
type ? : SkAccordionType;
|
|
12
|
+
modelValue ? : string | string[];
|
|
13
|
+
collapsible ? : boolean;
|
|
14
|
+
kind ? : SkAccordionKind;
|
|
15
|
+
disabled ? : boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface SkAlertStaticProps extends ComponentCustomColors
|
|
19
|
+
{
|
|
20
|
+
kind ? : SkAlertKind;
|
|
21
|
+
subtle ? : boolean;
|
|
22
|
+
showIcon ? : boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface SkAvatarStaticProps extends ComponentCustomColors
|
|
26
|
+
{
|
|
27
|
+
src ? : string;
|
|
28
|
+
alt ? : string;
|
|
29
|
+
initials ? : string;
|
|
30
|
+
kind ? : ComponentKind;
|
|
31
|
+
size ? : SkAvatarSize;
|
|
32
|
+
baseColor ? : string;
|
|
33
|
+
textColor ? : string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface SkBreadcrumbsStaticProps extends ComponentCustomColors
|
|
37
|
+
{
|
|
38
|
+
kind ? : SkBreadcrumbsProps['kind'];
|
|
39
|
+
separator ? : string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface SkButtonStaticProps extends ComponentCustomColors
|
|
43
|
+
{
|
|
44
|
+
type ? : SkButtonType;
|
|
45
|
+
kind ? : SkButtonKind;
|
|
46
|
+
variant ? : SkButtonVariant;
|
|
47
|
+
size ? : SkButtonSize;
|
|
48
|
+
disabled ? : boolean;
|
|
49
|
+
loading ? : boolean;
|
|
50
|
+
pressed ? : boolean;
|
|
51
|
+
dense ? : boolean;
|
|
52
|
+
href ? : string;
|
|
53
|
+
to ? : string | Record<string, any>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface SkCardStaticProps extends ComponentCustomColors
|
|
57
|
+
{
|
|
58
|
+
kind ? : SkCardKind;
|
|
59
|
+
size ? : SkPanelSize;
|
|
60
|
+
showDecoration ? : boolean;
|
|
61
|
+
noDecoration ? : boolean;
|
|
62
|
+
noBorder ? : boolean;
|
|
63
|
+
title ? : string;
|
|
64
|
+
headerColor ? : string;
|
|
65
|
+
scrollable ? : boolean;
|
|
66
|
+
corners ? : SkPanelCorner[];
|
|
67
|
+
decorationCorner ? : SkPanelCorner;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface SkCheckboxStaticProps extends ComponentCustomColors
|
|
71
|
+
{
|
|
72
|
+
kind ? : SkCheckboxKind;
|
|
73
|
+
size ? : SkCheckboxSize;
|
|
74
|
+
disabled ? : boolean;
|
|
75
|
+
required ? : boolean;
|
|
76
|
+
name ? : string;
|
|
77
|
+
label ? : string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface SkCollapsibleStaticProps extends ComponentCustomColors
|
|
81
|
+
{
|
|
82
|
+
open ? : boolean;
|
|
83
|
+
defaultOpen ? : boolean;
|
|
84
|
+
disabled ? : boolean;
|
|
85
|
+
kind ? : SkCollapsibleKind;
|
|
86
|
+
triggerText ? : string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface SkColorPickerStaticProps extends ComponentCustomColors
|
|
90
|
+
{
|
|
91
|
+
kind ? : SkColorPickerKind;
|
|
92
|
+
size ? : SkColorPickerSize;
|
|
93
|
+
format ? : SkColorPickerFormat;
|
|
94
|
+
showAlpha ? : boolean;
|
|
95
|
+
disabled ? : boolean;
|
|
96
|
+
placeholder ? : string;
|
|
97
|
+
defaultValue ? : string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface SkContextMenuStaticProps extends ComponentCustomColors
|
|
101
|
+
{
|
|
102
|
+
kind ? : SkContextMenuKind;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface SkDividerStaticProps extends ComponentCustomColors
|
|
106
|
+
{
|
|
107
|
+
orientation ? : SkDividerOrientation;
|
|
108
|
+
kind ? : ComponentKind;
|
|
109
|
+
variant ? : SkDividerVariant;
|
|
110
|
+
size ? : ComponentSize;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface SkDropdownStaticProps extends ComponentCustomColors
|
|
114
|
+
{
|
|
115
|
+
kind ? : SkDropdownKind;
|
|
116
|
+
triggerText ? : string;
|
|
117
|
+
side ? : SkDropdownSide;
|
|
118
|
+
align ? : SkDropdownAlign;
|
|
119
|
+
sideOffset ? : number;
|
|
120
|
+
size ? : SkDropdownSize;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface SkFieldStaticProps extends ComponentCustomColors
|
|
124
|
+
{
|
|
125
|
+
label ? : string;
|
|
126
|
+
description ? : string;
|
|
127
|
+
error ? : string;
|
|
128
|
+
required ? : boolean;
|
|
129
|
+
labelPosition ? : SkFieldLabelPosition;
|
|
130
|
+
id ? : string;
|
|
131
|
+
state ? : boolean | null;
|
|
132
|
+
validKind ? : string;
|
|
133
|
+
invalidKind ? : string;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface SkGroupStaticProps extends ComponentCustomColors
|
|
137
|
+
{
|
|
138
|
+
orientation ? : SkGroupOrientation;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface SkInputStaticProps extends ComponentCustomColors
|
|
142
|
+
{
|
|
143
|
+
type ? : SkInputType;
|
|
144
|
+
kind ? : SkInputKind;
|
|
145
|
+
size ? : SkInputSize;
|
|
146
|
+
placeholder ? : string;
|
|
147
|
+
disabled ? : boolean;
|
|
148
|
+
readonly ? : boolean;
|
|
149
|
+
required ? : boolean;
|
|
150
|
+
name ? : string;
|
|
151
|
+
autocomplete ? : string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface SkListboxStaticProps extends ComponentCustomColors
|
|
155
|
+
{
|
|
156
|
+
kind ? : SkListboxKind;
|
|
157
|
+
size ? : SkListboxSize;
|
|
158
|
+
placeholder ? : string;
|
|
159
|
+
disabled ? : boolean;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface SkModalStaticProps extends ComponentCustomColors
|
|
163
|
+
{
|
|
164
|
+
kind ? : ComponentKind;
|
|
165
|
+
size ? : ComponentSize;
|
|
166
|
+
title ? : string;
|
|
167
|
+
triggerText ? : string;
|
|
168
|
+
open ? : boolean;
|
|
169
|
+
closeOnEscape ? : boolean;
|
|
170
|
+
closeOnOverlay ? : boolean;
|
|
171
|
+
noCloseOnEscape ? : boolean;
|
|
172
|
+
noCloseOnOverlay ? : boolean;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface SkNavBarStaticProps extends ComponentCustomColors
|
|
176
|
+
{
|
|
177
|
+
kind ? : SkNavBarKind;
|
|
178
|
+
sticky ? : boolean;
|
|
179
|
+
size ? : SkNavBarSize;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface SkNumberInputStaticProps extends ComponentCustomColors
|
|
183
|
+
{
|
|
184
|
+
kind ? : SkNumberInputKind;
|
|
185
|
+
size ? : SkNumberInputSize;
|
|
186
|
+
placeholder ? : string;
|
|
187
|
+
disabled ? : boolean;
|
|
188
|
+
readonly ? : boolean;
|
|
189
|
+
required ? : boolean;
|
|
190
|
+
name ? : string;
|
|
191
|
+
min ? : number;
|
|
192
|
+
max ? : number;
|
|
193
|
+
step ? : number;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export interface SkPageStaticProps extends ComponentCustomColors
|
|
197
|
+
{
|
|
198
|
+
fixedHeader ? : boolean;
|
|
199
|
+
fixedFooter ? : boolean;
|
|
200
|
+
sidebarWidth ? : string;
|
|
201
|
+
asideWidth ? : string;
|
|
202
|
+
sidebarMode ? : SkPagePanelMode;
|
|
203
|
+
asideMode ? : SkPagePanelMode;
|
|
204
|
+
sidebarBreakpoint ? : string;
|
|
205
|
+
asideBreakpoint ? : string;
|
|
206
|
+
sidebarOpen ? : boolean;
|
|
207
|
+
asideOpen ? : boolean;
|
|
208
|
+
theme ? : SkThemeName;
|
|
209
|
+
flush ? : boolean;
|
|
210
|
+
noBounce ? : boolean;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface SkPaginationStaticProps extends ComponentCustomColors
|
|
214
|
+
{
|
|
215
|
+
modelValue ? : number;
|
|
216
|
+
siblingCount ? : number;
|
|
217
|
+
showFirstLast ? : boolean;
|
|
218
|
+
showPrevNext ? : boolean;
|
|
219
|
+
kind ? : SkPaginationProps['kind'];
|
|
220
|
+
size ? : SkPaginationProps['size'];
|
|
221
|
+
variant ? : SkPaginationProps['variant'];
|
|
222
|
+
disabled ? : boolean;
|
|
223
|
+
total : number;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export interface SkPanelStaticProps extends ComponentCustomColors
|
|
227
|
+
{
|
|
228
|
+
kind ? : SkPanelKind;
|
|
229
|
+
size ? : SkPanelSize;
|
|
230
|
+
showDecoration ? : boolean;
|
|
231
|
+
noBorder ? : boolean;
|
|
232
|
+
corners ? : SkPanelCorner[];
|
|
233
|
+
decorationCorner ? : SkPanelCorner;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export interface SkPopoverStaticProps extends ComponentCustomColors
|
|
237
|
+
{
|
|
238
|
+
kind ? : ComponentKind;
|
|
239
|
+
side ? : SkPopoverSide;
|
|
240
|
+
align ? : SkPopoverAlign;
|
|
241
|
+
sideOffset ? : number;
|
|
242
|
+
showArrow ? : boolean;
|
|
243
|
+
title ? : string;
|
|
244
|
+
closable ? : boolean;
|
|
245
|
+
open ? : boolean;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface SkProgressStaticProps extends ComponentCustomColors
|
|
249
|
+
{
|
|
250
|
+
value ? : number | null;
|
|
251
|
+
max ? : number;
|
|
252
|
+
kind ? : ComponentKind;
|
|
253
|
+
size ? : SkProgressSize;
|
|
254
|
+
showValue ? : boolean;
|
|
255
|
+
valuePosition ? : SkProgressValuePosition;
|
|
256
|
+
baseColor ? : string;
|
|
257
|
+
trackColor ? : string;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export interface SkRadioStaticProps extends ComponentCustomColors
|
|
261
|
+
{
|
|
262
|
+
label ? : string;
|
|
263
|
+
disabled ? : boolean;
|
|
264
|
+
kind ? : SkRadioKind;
|
|
265
|
+
size ? : SkRadioSize;
|
|
266
|
+
value : string | number;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export interface SkScrollAreaStaticProps extends ComponentCustomColors
|
|
270
|
+
{
|
|
271
|
+
type ? : SkScrollAreaType;
|
|
272
|
+
orientation ? : SkScrollAreaOrientation;
|
|
273
|
+
kind ? : SkScrollAreaKind;
|
|
274
|
+
baseColor ? : string;
|
|
275
|
+
textColor ? : string;
|
|
276
|
+
fade ? : boolean;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export interface SkSelectStaticProps extends ComponentCustomColors
|
|
280
|
+
{
|
|
281
|
+
kind ? : SkSelectKind;
|
|
282
|
+
size ? : SkSelectSize;
|
|
283
|
+
placeholder ? : string;
|
|
284
|
+
disabled ? : boolean;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export interface SkSidebarStaticProps extends ComponentCustomColors
|
|
288
|
+
{
|
|
289
|
+
kind ? : SkSidebarKind;
|
|
290
|
+
width ? : string;
|
|
291
|
+
side ? : SkSidebarSide;
|
|
292
|
+
dense ? : boolean;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export interface SkSkeletonStaticProps extends ComponentCustomColors
|
|
296
|
+
{
|
|
297
|
+
variant ? : SkSkeletonVariant;
|
|
298
|
+
width ? : string;
|
|
299
|
+
height ? : string;
|
|
300
|
+
animation ? : SkSkeletonAnimation;
|
|
301
|
+
corners ? : SkSkeletonCorner[];
|
|
302
|
+
bevel ? : string;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export interface SkSliderStaticProps extends ComponentCustomColors
|
|
306
|
+
{
|
|
307
|
+
min ? : number;
|
|
308
|
+
max ? : number;
|
|
309
|
+
step ? : number;
|
|
310
|
+
kind ? : ComponentKind;
|
|
311
|
+
size ? : SkSliderSize;
|
|
312
|
+
orientation ? : SkSliderOrientation;
|
|
313
|
+
disabled ? : boolean;
|
|
314
|
+
name ? : string;
|
|
315
|
+
minStepsBetweenThumbs ? : number;
|
|
316
|
+
baseColor ? : string;
|
|
317
|
+
thumbColor ? : string;
|
|
318
|
+
modelValue : number | number[];
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export interface SkSpinnerStaticProps extends ComponentCustomColors
|
|
322
|
+
{
|
|
323
|
+
kind ? : ComponentKind;
|
|
324
|
+
size ? : SkSpinnerSize;
|
|
325
|
+
variant ? : SkSpinnerVariant;
|
|
326
|
+
color ? : string;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export interface SkSplitterStaticProps extends ComponentCustomColors
|
|
330
|
+
{
|
|
331
|
+
direction ? : SkSplitterDirection;
|
|
332
|
+
kind ? : SkSplitterKind;
|
|
333
|
+
baseColor ? : string;
|
|
334
|
+
textColor ? : string;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export interface SkSwitchStaticProps extends ComponentCustomColors
|
|
338
|
+
{
|
|
339
|
+
label ? : string;
|
|
340
|
+
labelOn ? : string;
|
|
341
|
+
labelOff ? : string;
|
|
342
|
+
kind ? : SkSwitchKind;
|
|
343
|
+
thumbKind ? : SkSwitchKind;
|
|
344
|
+
size ? : SkSwitchSize;
|
|
345
|
+
disabled ? : boolean;
|
|
346
|
+
disableLabelAnimation ? : boolean;
|
|
347
|
+
name ? : string;
|
|
348
|
+
value ? : string;
|
|
349
|
+
required ? : boolean;
|
|
350
|
+
modelValue : boolean;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export interface SkTableStaticProps extends ComponentCustomColors
|
|
354
|
+
{
|
|
355
|
+
kind ? : SkTableKind;
|
|
356
|
+
variant ? : SkTableVariant;
|
|
357
|
+
striped ? : boolean;
|
|
358
|
+
hoverable ? : boolean;
|
|
359
|
+
bordered ? : boolean;
|
|
360
|
+
innerBorders ? : boolean;
|
|
361
|
+
darkBackground ? : boolean;
|
|
362
|
+
subtle ? : boolean;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export interface SkTabsStaticProps extends ComponentCustomColors
|
|
366
|
+
{
|
|
367
|
+
orientation ? : SkTabsOrientation;
|
|
368
|
+
placement ? : SkTabsPlacement;
|
|
369
|
+
kind ? : ComponentKind;
|
|
370
|
+
flush ? : boolean;
|
|
371
|
+
modelValue : string | number;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export interface SkTagStaticProps extends ComponentCustomColors
|
|
375
|
+
{
|
|
376
|
+
kind ? : ComponentKind;
|
|
377
|
+
variant ? : SkTagVariant;
|
|
378
|
+
size ? : SkTagSize;
|
|
379
|
+
removable ? : boolean;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export interface SkTagsInputStaticProps extends ComponentCustomColors
|
|
383
|
+
{
|
|
384
|
+
kind ? : SkTagsInputKind;
|
|
385
|
+
size ? : SkTagsInputSize;
|
|
386
|
+
placeholder ? : string;
|
|
387
|
+
disabled ? : boolean;
|
|
388
|
+
max ? : number;
|
|
389
|
+
addOnPaste ? : boolean;
|
|
390
|
+
tagKind ? : string;
|
|
391
|
+
tagVariant ? : 'solid' | 'outline' | 'ghost';
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
export interface SkTextareaStaticProps extends ComponentCustomColors
|
|
395
|
+
{
|
|
396
|
+
kind ? : SkTextareaKind;
|
|
397
|
+
size ? : SkTextareaSize;
|
|
398
|
+
placeholder ? : string;
|
|
399
|
+
disabled ? : boolean;
|
|
400
|
+
readonly ? : boolean;
|
|
401
|
+
required ? : boolean;
|
|
402
|
+
name ? : string;
|
|
403
|
+
rows ? : number;
|
|
404
|
+
autocomplete ? : string;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export interface SkToolbarStaticProps extends ComponentCustomColors
|
|
408
|
+
{
|
|
409
|
+
kind ? : SkToolbarKind;
|
|
410
|
+
orientation ? : SkToolbarOrientation;
|
|
411
|
+
corners ? : SkToolbarCorner[];
|
|
412
|
+
baseColor ? : string;
|
|
413
|
+
textColor ? : string;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
export interface SkTooltipStaticProps extends ComponentCustomColors
|
|
417
|
+
{
|
|
418
|
+
kind ? : ComponentKind;
|
|
419
|
+
variant ? : 'solid' | 'outline';
|
|
420
|
+
side ? : SkTooltipSide;
|
|
421
|
+
align ? : 'start' | 'center' | 'end';
|
|
422
|
+
sideOffset ? : number;
|
|
423
|
+
delayDuration ? : number;
|
|
424
|
+
showArrow ? : boolean;
|
|
425
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
2
|
+
// Static Helpers — Public API
|
|
3
|
+
//
|
|
4
|
+
// Re-exports all static helper functions and their prop types, plus core utilities. Consumers
|
|
5
|
+
// import from `@skewedaspect/sleekspace-ui/static` to access the full helper surface without
|
|
6
|
+
// pulling in Vue or any other runtime dependency.
|
|
7
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
8
|
+
|
|
9
|
+
// Utilities
|
|
10
|
+
export { text, escapeAttr } from './escape';
|
|
11
|
+
export { composeClasses } from './classes';
|
|
12
|
+
export type { ClassSpec, ListFlagSpec, SingleChoiceFlagSpec } from './classes';
|
|
13
|
+
export { render } from './render';
|
|
14
|
+
export type { RenderSpec } from './render';
|
|
15
|
+
|
|
16
|
+
// Shared types
|
|
17
|
+
export type * from './types';
|
|
18
|
+
|
|
19
|
+
// Components — containers
|
|
20
|
+
export { panel } from './components/panel';
|
|
21
|
+
export type { PanelStaticProps } from './components/panel';
|
|
22
|
+
|
|
23
|
+
export { card } from './components/card';
|
|
24
|
+
export type { CardStaticProps } from './components/card';
|
|
25
|
+
|
|
26
|
+
export { alert } from './components/alert';
|
|
27
|
+
export type { AlertStaticProps } from './components/alert';
|
|
28
|
+
|
|
29
|
+
export { divider } from './components/divider';
|
|
30
|
+
export type { DividerStaticProps } from './components/divider';
|
|
31
|
+
|
|
32
|
+
export { page } from './components/page';
|
|
33
|
+
export type { PageStaticProps } from './components/page';
|
|
34
|
+
|
|
35
|
+
export { group } from './components/group';
|
|
36
|
+
export type { GroupStaticProps } from './components/group';
|
|
37
|
+
|
|
38
|
+
export { skeleton } from './components/skeleton';
|
|
39
|
+
export type { SkeletonStaticProps } from './components/skeleton';
|
|
40
|
+
|
|
41
|
+
export { progress } from './components/progress';
|
|
42
|
+
export type { ProgressStaticProps } from './components/progress';
|
|
43
|
+
|
|
44
|
+
export { spinner } from './components/spinner';
|
|
45
|
+
export type { SpinnerStaticProps } from './components/spinner';
|
|
46
|
+
|
|
47
|
+
export { navBar } from './components/navBar';
|
|
48
|
+
export type { NavBarStaticProps } from './components/navBar';
|
|
49
|
+
|
|
50
|
+
export { toolbar } from './components/toolbar';
|
|
51
|
+
export type { ToolbarStaticProps } from './components/toolbar';
|
|
52
|
+
|
|
53
|
+
export { sidebar } from './components/sidebar';
|
|
54
|
+
export type { SidebarStaticProps } from './components/sidebar';
|
|
55
|
+
|
|
56
|
+
export { breadcrumbs } from './components/breadcrumbs';
|
|
57
|
+
export type { BreadcrumbsStaticProps } from './components/breadcrumbs';
|
|
58
|
+
|
|
59
|
+
export { pagination } from './components/pagination';
|
|
60
|
+
export type { PaginationStaticProps } from './components/pagination';
|
|
61
|
+
|
|
62
|
+
export { tag } from './components/tag';
|
|
63
|
+
export type { TagStaticProps } from './components/tag';
|
|
64
|
+
|
|
65
|
+
export { avatar } from './components/avatar';
|
|
66
|
+
export type { AvatarStaticProps } from './components/avatar';
|
|
67
|
+
|
|
68
|
+
export { field } from './components/field';
|
|
69
|
+
export type { FieldStaticProps } from './components/field';
|
|
70
|
+
|
|
71
|
+
export { table } from './components/table';
|
|
72
|
+
export type { TableStaticProps } from './components/table';
|
|
73
|
+
|
|
74
|
+
export { tooltip } from './components/tooltip';
|
|
75
|
+
export type { TooltipStaticProps } from './components/tooltip';
|
|
76
|
+
|
|
77
|
+
// Form controls (class-only)
|
|
78
|
+
export { button } from './components/button';
|
|
79
|
+
export type { ButtonStaticProps } from './components/button';
|
|
80
|
+
|
|
81
|
+
export { input } from './components/input';
|
|
82
|
+
export type { InputStaticProps } from './components/input';
|
|
83
|
+
|
|
84
|
+
export { textarea } from './components/textarea';
|
|
85
|
+
export type { TextareaStaticProps } from './components/textarea';
|
|
86
|
+
|
|
87
|
+
export { select } from './components/select';
|
|
88
|
+
export type { SelectStaticProps } from './components/select';
|
|
89
|
+
|
|
90
|
+
export { slider } from './components/slider';
|
|
91
|
+
export type { SliderStaticProps } from './components/slider';
|
|
92
|
+
|
|
93
|
+
export { colorPicker } from './components/colorPicker';
|
|
94
|
+
export type { ColorPickerStaticProps } from './components/colorPicker';
|
|
95
|
+
|
|
96
|
+
// Compound form controls
|
|
97
|
+
export { checkbox } from './components/checkbox';
|
|
98
|
+
export type { CheckboxStaticProps } from './components/checkbox';
|
|
99
|
+
|
|
100
|
+
export { radio } from './components/radio';
|
|
101
|
+
export type { RadioStaticProps } from './components/radio';
|
|
102
|
+
|
|
103
|
+
export { switchInput } from './components/switchInput';
|
|
104
|
+
export type { SwitchStaticProps } from './components/switchInput';
|
|
105
|
+
|
|
106
|
+
export { numberInput } from './components/numberInput';
|
|
107
|
+
export type { NumberInputStaticProps } from './components/numberInput';
|
|
108
|
+
|
|
109
|
+
export { tagsInput } from './components/tagsInput';
|
|
110
|
+
export type { TagsInputStaticProps } from './components/tagsInput';
|
|
111
|
+
|
|
112
|
+
// Dropdown
|
|
113
|
+
export { dropdown } from './components/dropdown';
|
|
114
|
+
export type { DropdownStaticProps } from './components/dropdown';
|
|
115
|
+
|
|
116
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
2
|
+
// Render Core Tests
|
|
3
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
4
|
+
|
|
5
|
+
import { describe, expect, it } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { type RenderSpec, render } from './render';
|
|
8
|
+
|
|
9
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
const PANEL_SPEC : RenderSpec
|
|
12
|
+
= {
|
|
13
|
+
tag: 'div',
|
|
14
|
+
classSpec:
|
|
15
|
+
{
|
|
16
|
+
base: 'sk-panel',
|
|
17
|
+
kind: true,
|
|
18
|
+
size: true,
|
|
19
|
+
},
|
|
20
|
+
customColorVars: { base: '--sk-panel-color-base', text: '--sk-panel-fg' },
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
describe('render', () =>
|
|
24
|
+
{
|
|
25
|
+
it('emits a bare tag with base class when no props', () =>
|
|
26
|
+
{
|
|
27
|
+
expect(render(PANEL_SPEC, {}, '')).toBe('<div class="sk-panel"></div>');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('appends children verbatim', () =>
|
|
31
|
+
{
|
|
32
|
+
expect(render(PANEL_SPEC, {}, 'Hello')).toBe('<div class="sk-panel">Hello</div>');
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('embeds nested HTML children', () =>
|
|
36
|
+
{
|
|
37
|
+
expect(render(PANEL_SPEC, {}, '<span>inner</span>'))
|
|
38
|
+
.toBe('<div class="sk-panel"><span>inner</span></div>');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('includes classes from prop modifiers', () =>
|
|
42
|
+
{
|
|
43
|
+
expect(render(PANEL_SPEC, { kind: 'primary', size: 'lg' }, 'x'))
|
|
44
|
+
.toBe('<div class="sk-panel sk-primary sk-lg sk-size-lg">x</div>');
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('emits custom color inline style from baseColor / textColor', () =>
|
|
48
|
+
{
|
|
49
|
+
expect(render(PANEL_SPEC, { baseColor: '#f00', textColor: '#fff' }, 'x'))
|
|
50
|
+
.toBe('<div class="sk-panel" style="--sk-panel-color-base: #f00; --sk-panel-fg: #fff;">x</div>');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('uses tag="button" when spec overrides', () =>
|
|
54
|
+
{
|
|
55
|
+
const spec : RenderSpec = { tag: 'button', classSpec: { base: 'sk-button' } };
|
|
56
|
+
expect(render(spec, {}, 'Save')).toBe('<button class="sk-button" type="button">Save</button>');
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('omits type="button" for non-button tags', () =>
|
|
60
|
+
{
|
|
61
|
+
expect(render(PANEL_SPEC, {}, 'x')).not.toMatch(/type="button"/);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('respects `extraAttrs` from the spec', () =>
|
|
65
|
+
{
|
|
66
|
+
const spec : RenderSpec = { tag: 'div', classSpec: { base: 'sk-alert' }, extraAttrs: { role: 'alert' } };
|
|
67
|
+
expect(render(spec, {}, 'warning')).toBe('<div class="sk-alert" role="alert">warning</div>');
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('escapes attribute values containing dangerous characters', () =>
|
|
71
|
+
{
|
|
72
|
+
expect(render(PANEL_SPEC, { baseColor: '"><script>' }, 'x'))
|
|
73
|
+
.toContain('style="--sk-panel-color-base: "><script>;"');
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('renders void/self-closing elements without children when spec.void is true', () =>
|
|
77
|
+
{
|
|
78
|
+
const spec : RenderSpec = { tag: 'input', classSpec: { base: 'sk-input' }, void: true };
|
|
79
|
+
expect(render(spec, {}, '')).toBe('<input class="sk-input" />');
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
2
|
+
// Render Core
|
|
3
|
+
//
|
|
4
|
+
// Generic renderer used by every component helper. Takes a `RenderSpec` (element tag, class
|
|
5
|
+
// composition spec, optional extras) and a props object, and emits an HTML string.
|
|
6
|
+
//
|
|
7
|
+
// The output is the class-API form: <tag class="sk-component modifier-classes"> ... </tag>.
|
|
8
|
+
// Custom-element output is NOT emitted here — helpers always produce class-API HTML.
|
|
9
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
import { type ClassSpec, composeClasses } from './classes';
|
|
12
|
+
import { escapeAttr } from './escape';
|
|
13
|
+
|
|
14
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
export interface RenderSpec
|
|
17
|
+
{
|
|
18
|
+
tag : string; // HTML tag to render (e.g. "div", "button", "input")
|
|
19
|
+
classSpec : ClassSpec; // how props map to class modifiers
|
|
20
|
+
extraAttrs ?: Record<string, string>; // attributes always set (e.g. role="alert")
|
|
21
|
+
void ?: boolean; // self-closing with no children (e.g. <input />)
|
|
22
|
+
// Per-component custom-color CSS variable names. If omitted, no inline style is emitted
|
|
23
|
+
// for custom colors. Matches the Vue component's `useCustomColors` output.
|
|
24
|
+
customColorVars ?: { base ?: string; text ?: string };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
28
|
+
|
|
29
|
+
export function render(spec : RenderSpec, props : Record<string, unknown>, children : string) : string
|
|
30
|
+
{
|
|
31
|
+
const classes = composeClasses(spec.classSpec, props);
|
|
32
|
+
const attrs : string[] = [ `class="${ escapeAttr(classes) }"` ];
|
|
33
|
+
|
|
34
|
+
if(spec.tag === 'button')
|
|
35
|
+
{
|
|
36
|
+
attrs.push(`type="button"`);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if(spec.extraAttrs)
|
|
40
|
+
{
|
|
41
|
+
for(const [ name, value ] of Object.entries(spec.extraAttrs))
|
|
42
|
+
{
|
|
43
|
+
attrs.push(`${ name }="${ escapeAttr(value) }"`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const styleParts : string[] = [];
|
|
48
|
+
if(spec.customColorVars)
|
|
49
|
+
{
|
|
50
|
+
const { base, text: textVar } = spec.customColorVars;
|
|
51
|
+
if(base && typeof props.baseColor === 'string')
|
|
52
|
+
{
|
|
53
|
+
styleParts.push(`${ base }: ${ escapeAttr(props.baseColor) };`);
|
|
54
|
+
}
|
|
55
|
+
if(textVar && typeof props.textColor === 'string')
|
|
56
|
+
{
|
|
57
|
+
styleParts.push(`${ textVar }: ${ escapeAttr(props.textColor) };`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if(styleParts.length > 0)
|
|
62
|
+
{
|
|
63
|
+
attrs.push(`style="${ styleParts.join(' ') }"`);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const attrString = attrs.join(' ');
|
|
67
|
+
|
|
68
|
+
if(spec.void)
|
|
69
|
+
{
|
|
70
|
+
return `<${ spec.tag } ${ attrString } />`;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return `<${ spec.tag } ${ attrString }>${ children }</${ spec.tag }>`;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//----------------------------------------------------------------------------------------------------------------------
|