@skewedaspect/sleekspace-ui 0.9.1 → 0.10.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/Accordion/context.d.ts +4 -0
- package/dist/components/Autocomplete/SkAutocomplete.vue.d.ts +87 -0
- package/dist/components/Autocomplete/SkAutocompleteEmpty.vue.d.ts +17 -0
- package/dist/components/Autocomplete/SkAutocompleteGroup.vue.d.ts +17 -0
- package/dist/components/Autocomplete/SkAutocompleteGroupLabel.vue.d.ts +17 -0
- package/dist/components/Autocomplete/SkAutocompleteItem.vue.d.ts +39 -0
- package/dist/components/Autocomplete/SkAutocompleteSeparator.vue.d.ts +2 -0
- package/dist/components/Autocomplete/index.d.ts +7 -0
- package/dist/components/Autocomplete/types.d.ts +3 -0
- package/dist/components/Breadcrumbs/context.d.ts +4 -0
- package/dist/components/Button/SkButton.vue.d.ts +8 -1
- package/dist/components/Button/types.d.ts +2 -0
- package/dist/components/Card/SkCard.vue.d.ts +1 -1
- package/dist/components/ContextMenu/context.d.ts +3 -0
- package/dist/components/Dropdown/SkDropdown.vue.d.ts +1 -1
- package/dist/components/Dropdown/context.d.ts +3 -0
- package/dist/components/Field/SkField.vue.d.ts +7 -6
- package/dist/components/Input/SkInput.vue.d.ts +9 -2
- package/dist/components/Input/types.d.ts +2 -0
- package/dist/components/InputGroup/SkInputGroup.vue.d.ts +23 -0
- package/dist/components/InputGroup/SkInputGroupAddon.vue.d.ts +33 -0
- package/dist/components/InputGroup/types.d.ts +13 -0
- package/dist/components/NumberInput/SkNumberInput.vue.d.ts +7 -1
- package/dist/components/NumberInput/types.d.ts +2 -0
- package/dist/components/Pagination/context.d.ts +5 -0
- package/dist/components/Panel/SkPanel.vue.d.ts +1 -1
- package/dist/components/Panel/types.d.ts +2 -1
- package/dist/components/Radio/context.d.ts +4 -0
- package/dist/components/Select/SkSelect.vue.d.ts +7 -1
- package/dist/components/Select/types.d.ts +2 -0
- package/dist/components/Sidebar/SkSidebar.vue.d.ts +1 -1
- package/dist/components/Tabs/context.d.ts +6 -0
- package/dist/components/Textarea/SkTextarea.vue.d.ts +1 -1
- package/dist/components/Tooltip/SkTooltip.vue.d.ts +1 -1
- package/dist/composables/injectionKeys.d.ts +9 -0
- package/dist/global.d.ts +4 -0
- package/dist/index.d.ts +18 -0
- package/dist/sleekspace-ui.css +831 -277
- package/dist/sleekspace-ui.es.js +3693 -2514
- package/dist/sleekspace-ui.umd.js +3700 -2513
- package/dist/static/components/alert.d.ts +2 -1
- package/dist/static/components/avatar.d.ts +2 -1
- package/dist/static/components/breadcrumbs.d.ts +2 -1
- package/dist/static/components/button.d.ts +4 -2
- package/dist/static/components/card.d.ts +2 -1
- package/dist/static/components/checkbox.d.ts +2 -1
- package/dist/static/components/colorPicker.d.ts +2 -1
- package/dist/static/components/divider.d.ts +2 -1
- package/dist/static/components/dropdown.d.ts +2 -1
- package/dist/static/components/field.d.ts +2 -1
- package/dist/static/components/group.d.ts +2 -1
- package/dist/static/components/input.d.ts +4 -2
- package/dist/static/components/inputGroup.d.ts +8 -0
- package/dist/static/components/inputGroupAddon.d.ts +7 -0
- package/dist/static/components/navBar.d.ts +2 -1
- package/dist/static/components/numberInput.d.ts +4 -2
- package/dist/static/components/page.d.ts +2 -1
- package/dist/static/components/pagination.d.ts +2 -1
- package/dist/static/components/panel.d.ts +2 -1
- package/dist/static/components/progress.d.ts +2 -1
- package/dist/static/components/radio.d.ts +2 -1
- package/dist/static/components/select.d.ts +4 -2
- package/dist/static/components/sidebar.d.ts +2 -1
- package/dist/static/components/skeleton.d.ts +2 -1
- package/dist/static/components/slider.d.ts +2 -1
- package/dist/static/components/spinner.d.ts +2 -1
- package/dist/static/components/switchInput.d.ts +2 -1
- package/dist/static/components/table.d.ts +2 -1
- package/dist/static/components/tag.d.ts +2 -1
- package/dist/static/components/tagsInput.d.ts +2 -1
- package/dist/static/components/textarea.d.ts +2 -1
- package/dist/static/components/toolbar.d.ts +2 -1
- package/dist/static/components/tooltip.d.ts +2 -1
- package/dist/static/h.d.ts +2 -0
- package/dist/static/index.cjs.js +1 -1
- package/dist/static/index.d.ts +6 -0
- package/dist/static/index.es.js +366 -216
- package/dist/static/render.d.ts +2 -1
- package/dist/static/stringH.d.ts +2 -0
- package/dist/static/types.d.ts +5 -0
- package/dist/tailwind.css +222 -0
- package/dist/tokens.css +0 -223
- package/dist/types/corners.d.ts +1 -0
- package/llms-full.txt +14 -9
- package/package.json +6 -3
- package/src/components/Accordion/SkAccordion.vue +5 -2
- package/src/components/Accordion/SkAccordionItem.vue +7 -4
- package/src/components/Accordion/context.ts +23 -0
- package/src/components/Autocomplete/SkAutocomplete.test.ts +83 -0
- package/src/components/Autocomplete/SkAutocomplete.vue +305 -0
- package/src/components/Autocomplete/SkAutocompleteEmpty.vue +39 -0
- package/src/components/Autocomplete/SkAutocompleteGroup.vue +46 -0
- package/src/components/Autocomplete/SkAutocompleteGroupLabel.vue +39 -0
- package/src/components/Autocomplete/SkAutocompleteItem.vue +85 -0
- package/src/components/Autocomplete/SkAutocompleteSeparator.vue +39 -0
- package/src/components/Autocomplete/index.ts +13 -0
- package/src/components/Autocomplete/types.ts +10 -0
- package/src/components/Breadcrumbs/SkBreadcrumbItem.vue +8 -3
- package/src/components/Breadcrumbs/SkBreadcrumbSeparator.vue +8 -2
- package/src/components/Breadcrumbs/SkBreadcrumbs.vue +5 -2
- package/src/components/Breadcrumbs/context.ts +20 -0
- package/src/components/Button/SkButton.vue +46 -6
- package/src/components/Button/types.ts +6 -0
- package/src/components/ColorPicker/SkColorPicker.vue +27 -5
- package/src/components/ContextMenu/SkContextMenu.vue +4 -1
- package/src/components/ContextMenu/SkContextMenuSubmenu.vue +5 -2
- package/src/components/ContextMenu/context.ts +17 -0
- package/src/components/Dropdown/SkDropdown.vue +2 -1
- package/src/components/Dropdown/SkDropdownSubmenu.vue +4 -3
- package/src/components/Dropdown/context.ts +16 -0
- package/src/components/Field/SkField.test.ts +88 -0
- package/src/components/Field/SkField.vue +15 -7
- package/src/components/Input/SkInput.test.ts +61 -0
- package/src/components/Input/SkInput.vue +42 -7
- package/src/components/Input/types.ts +2 -0
- package/src/components/InputGroup/SkInputGroup.test.ts +171 -0
- package/src/components/InputGroup/SkInputGroup.vue +131 -0
- package/src/components/InputGroup/SkInputGroupAddon.test.ts +104 -0
- package/src/components/InputGroup/SkInputGroupAddon.vue +107 -0
- package/src/components/InputGroup/types.ts +27 -0
- package/src/components/Listbox/SkListbox.vue +27 -6
- package/src/components/NumberInput/SkNumberInput.vue +39 -7
- package/src/components/NumberInput/types.ts +2 -0
- package/src/components/Pagination/SkPagination.vue +6 -3
- package/src/components/Pagination/SkPaginationItem.vue +8 -5
- package/src/components/Pagination/context.ts +19 -0
- package/src/components/Panel/types.ts +3 -2
- package/src/components/Radio/SkRadio.vue +6 -3
- package/src/components/Radio/SkRadioGroup.vue +4 -2
- package/src/components/Radio/context.ts +17 -0
- package/src/components/Select/SkSelect.vue +39 -7
- package/src/components/Select/types.ts +2 -0
- package/src/components/Tabs/SkTab.vue +4 -2
- package/src/components/Tabs/SkTabList.vue +4 -2
- package/src/components/Tabs/SkTabs.vue +5 -3
- package/src/components/Tabs/context.ts +19 -0
- package/src/components/TagsInput/SkTagsInput.vue +28 -7
- package/src/components/Textarea/SkTextarea.vue +27 -6
- package/src/composables/injectionKeys.ts +52 -0
- package/src/index.ts +28 -0
- package/src/static/__tests__/parity.test.ts +2 -1
- package/src/static/__tests__/parityHarness.ts +5 -2
- package/src/static/components/__tests__/helpers.test.ts +191 -99
- package/src/static/components/alert.ts +12 -11
- package/src/static/components/avatar.ts +15 -16
- package/src/static/components/breadcrumbs.ts +3 -2
- package/src/static/components/button.ts +23 -27
- package/src/static/components/card.ts +3 -2
- package/src/static/components/checkbox.ts +11 -14
- package/src/static/components/colorPicker.ts +7 -9
- package/src/static/components/divider.ts +4 -3
- package/src/static/components/dropdown.ts +15 -6
- package/src/static/components/field.ts +32 -15
- package/src/static/components/group.ts +3 -2
- package/src/static/components/input.ts +20 -15
- package/src/static/components/inputGroup.ts +30 -0
- package/src/static/components/inputGroupAddon.ts +29 -0
- package/src/static/components/navBar.ts +30 -17
- package/src/static/components/numberInput.ts +17 -17
- package/src/static/components/page.ts +3 -2
- package/src/static/components/pagination.ts +3 -2
- package/src/static/components/panel.ts +3 -2
- package/src/static/components/progress.ts +3 -2
- package/src/static/components/radio.ts +14 -20
- package/src/static/components/select.ts +18 -15
- package/src/static/components/sidebar.ts +9 -13
- package/src/static/components/skeleton.ts +7 -10
- package/src/static/components/slider.ts +7 -9
- package/src/static/components/spinner.ts +22 -22
- package/src/static/components/switchInput.ts +12 -14
- package/src/static/components/table.ts +8 -10
- package/src/static/components/tag.ts +17 -11
- package/src/static/components/tagsInput.ts +3 -3
- package/src/static/components/textarea.ts +8 -13
- package/src/static/components/toolbar.ts +7 -10
- package/src/static/components/tooltip.ts +3 -2
- package/src/static/generated/defaults.ts +24 -9
- package/src/static/generated/propTypes.ts +18 -2
- package/src/static/h.ts +16 -0
- package/src/static/index.ts +8 -0
- package/src/static/render.test.ts +14 -10
- package/src/static/render.ts +33 -18
- package/src/static/specs.test.ts +1 -0
- package/src/static/specs.ts +22 -2
- package/src/static/stringH.ts +104 -0
- package/src/static/types.ts +25 -0
- package/src/styles/components/_autocomplete.scss +498 -0
- package/src/styles/components/_button.scss +55 -6
- package/src/styles/components/_index.scss +2 -0
- package/src/styles/components/_input-group.scss +292 -0
- package/src/styles/components/_input.scss +57 -9
- package/src/styles/components/_number-input.scss +84 -18
- package/src/styles/components/_select.scss +56 -9
- package/src/styles/mixins/_cut-border.scss +83 -0
- package/src/styles/tailwind.scss +262 -0
- package/src/styles/tokens.scss +8 -255
- package/src/types/corners.ts +10 -0
- package/src/utils/slots.test.ts +89 -0
- package/src/utils/slots.ts +6 -1
- package/web-types.json +382 -12
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
2
|
+
// InputGroup Component Types
|
|
3
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
4
|
+
|
|
5
|
+
import type { ComponentCustomColors, ComponentKind, ComponentSize } from '@/types';
|
|
6
|
+
import type { SkCorner } from '@/types/corners';
|
|
7
|
+
|
|
8
|
+
export type SkInputGroupKind = ComponentKind;
|
|
9
|
+
export type SkInputGroupSize = ComponentSize;
|
|
10
|
+
|
|
11
|
+
export type SkInputGroupCorner = SkCorner;
|
|
12
|
+
|
|
13
|
+
export type SkInputGroupAddonKind = SkInputGroupKind;
|
|
14
|
+
export type SkInputGroupAddonSize = SkInputGroupSize;
|
|
15
|
+
|
|
16
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
export interface SkInputGroupBaseProps extends ComponentCustomColors
|
|
19
|
+
{
|
|
20
|
+
kind ?: SkInputGroupKind;
|
|
21
|
+
size ?: SkInputGroupSize;
|
|
22
|
+
corners ?: SkInputGroupCorner[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type SkInputGroupComponentProps = SkInputGroupBaseProps;
|
|
26
|
+
|
|
27
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
* to create visual dividers between groups of options.
|
|
72
72
|
*/
|
|
73
73
|
|
|
74
|
-
import {
|
|
74
|
+
import { computed, inject, toRef } from 'vue';
|
|
75
75
|
import {
|
|
76
76
|
ComboboxAnchor,
|
|
77
77
|
ComboboxContent,
|
|
@@ -87,6 +87,13 @@
|
|
|
87
87
|
import type { SkListboxKind, SkListboxSize } from './types';
|
|
88
88
|
|
|
89
89
|
// Composables
|
|
90
|
+
import {
|
|
91
|
+
NO_KIND,
|
|
92
|
+
NO_SIZE,
|
|
93
|
+
inheritedKindKey,
|
|
94
|
+
inputGroupSizeKey,
|
|
95
|
+
validationKindKey,
|
|
96
|
+
} from '@/composables/injectionKeys';
|
|
90
97
|
import { useCustomColors } from '@/composables/useCustomColors';
|
|
91
98
|
import { usePortalContext } from '@/composables/usePortalContext';
|
|
92
99
|
|
|
@@ -131,7 +138,7 @@
|
|
|
131
138
|
|
|
132
139
|
const props = withDefaults(defineProps<SkListboxComponentProps>(), {
|
|
133
140
|
kind: undefined,
|
|
134
|
-
size:
|
|
141
|
+
size: undefined,
|
|
135
142
|
placeholder: 'Search...',
|
|
136
143
|
disabled: false,
|
|
137
144
|
});
|
|
@@ -150,19 +157,33 @@
|
|
|
150
157
|
// Handle portal context (theme injection/re-provision for nested portal components)
|
|
151
158
|
const { theme } = usePortalContext();
|
|
152
159
|
|
|
153
|
-
|
|
154
|
-
const
|
|
160
|
+
const validationKind = inject(validationKindKey, NO_KIND);
|
|
161
|
+
const inheritedKind = inject(inheritedKindKey, NO_KIND);
|
|
162
|
+
const inputGroupSize = inject(inputGroupSizeKey, NO_SIZE);
|
|
155
163
|
|
|
156
164
|
//------------------------------------------------------------------------------------------------------------------
|
|
157
165
|
|
|
158
|
-
const effectiveKind = computed(() =>
|
|
166
|
+
const effectiveKind = computed<SkListboxKind>(() =>
|
|
167
|
+
{
|
|
168
|
+
if(validationKind.value !== undefined) { return validationKind.value; }
|
|
169
|
+
if(props.kind !== undefined) { return props.kind; }
|
|
170
|
+
if(inheritedKind.value !== undefined) { return inheritedKind.value; }
|
|
171
|
+
return 'neutral';
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
const effectiveSize = computed<SkListboxSize>(() =>
|
|
175
|
+
{
|
|
176
|
+
if(props.size !== undefined) { return props.size; }
|
|
177
|
+
if(inputGroupSize.value !== undefined) { return inputGroupSize.value; }
|
|
178
|
+
return 'md';
|
|
179
|
+
});
|
|
159
180
|
|
|
160
181
|
//------------------------------------------------------------------------------------------------------------------
|
|
161
182
|
|
|
162
183
|
const wrapperClasses = computed(() => ({
|
|
163
184
|
'sk-listbox': true,
|
|
164
185
|
[`sk-${ effectiveKind.value }`]: true,
|
|
165
|
-
[`sk-${
|
|
186
|
+
[`sk-${ effectiveSize.value }`]: true,
|
|
166
187
|
}));
|
|
167
188
|
|
|
168
189
|
//------------------------------------------------------------------------------------------------------------------
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
* ```
|
|
75
75
|
*/
|
|
76
76
|
|
|
77
|
-
import {
|
|
77
|
+
import { computed, inject, toRef } from 'vue';
|
|
78
78
|
import {
|
|
79
79
|
NumberFieldDecrement,
|
|
80
80
|
NumberFieldIncrement,
|
|
@@ -84,9 +84,16 @@
|
|
|
84
84
|
|
|
85
85
|
// Types
|
|
86
86
|
import type { ComponentCustomColors } from '@/types';
|
|
87
|
-
import type { SkNumberInputKind, SkNumberInputSize } from './types';
|
|
87
|
+
import type { SkNumberInputCorner, SkNumberInputKind, SkNumberInputSize } from './types';
|
|
88
88
|
|
|
89
89
|
// Composables
|
|
90
|
+
import {
|
|
91
|
+
NO_KIND,
|
|
92
|
+
NO_SIZE,
|
|
93
|
+
inheritedKindKey,
|
|
94
|
+
inputGroupSizeKey,
|
|
95
|
+
validationKindKey,
|
|
96
|
+
} from '@/composables/injectionKeys';
|
|
90
97
|
import { useCustomColors } from '@/composables/useCustomColors';
|
|
91
98
|
|
|
92
99
|
//------------------------------------------------------------------------------------------------------------------
|
|
@@ -178,13 +185,19 @@
|
|
|
178
185
|
* @default true
|
|
179
186
|
*/
|
|
180
187
|
showSteppers ?: boolean;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Which corners receive the beveled cut. Pass an empty array for square corners.
|
|
191
|
+
* @default undefined (renders as ['top-right'])
|
|
192
|
+
*/
|
|
193
|
+
corners ?: SkNumberInputCorner[];
|
|
181
194
|
}
|
|
182
195
|
|
|
183
196
|
//------------------------------------------------------------------------------------------------------------------
|
|
184
197
|
|
|
185
198
|
const props = withDefaults(defineProps<SkNumberInputComponentProps>(), {
|
|
186
199
|
kind: undefined,
|
|
187
|
-
size:
|
|
200
|
+
size: undefined,
|
|
188
201
|
placeholder: undefined,
|
|
189
202
|
disabled: false,
|
|
190
203
|
readonly: false,
|
|
@@ -194,6 +207,7 @@
|
|
|
194
207
|
max: undefined,
|
|
195
208
|
step: 1,
|
|
196
209
|
showSteppers: true,
|
|
210
|
+
corners: undefined,
|
|
197
211
|
});
|
|
198
212
|
|
|
199
213
|
//------------------------------------------------------------------------------------------------------------------
|
|
@@ -207,19 +221,37 @@
|
|
|
207
221
|
|
|
208
222
|
//------------------------------------------------------------------------------------------------------------------
|
|
209
223
|
|
|
210
|
-
|
|
211
|
-
const
|
|
224
|
+
const validationKind = inject(validationKindKey, NO_KIND);
|
|
225
|
+
const inheritedKind = inject(inheritedKindKey, NO_KIND);
|
|
226
|
+
const inputGroupSize = inject(inputGroupSizeKey, NO_SIZE);
|
|
212
227
|
|
|
213
228
|
//------------------------------------------------------------------------------------------------------------------
|
|
214
229
|
|
|
215
|
-
const effectiveKind = computed(() =>
|
|
230
|
+
const effectiveKind = computed<SkNumberInputKind>(() =>
|
|
231
|
+
{
|
|
232
|
+
if(validationKind.value !== undefined) { return validationKind.value; }
|
|
233
|
+
if(props.kind !== undefined) { return props.kind; }
|
|
234
|
+
if(inheritedKind.value !== undefined) { return inheritedKind.value; }
|
|
235
|
+
return 'neutral';
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
const effectiveSize = computed<SkNumberInputSize>(() =>
|
|
239
|
+
{
|
|
240
|
+
if(props.size !== undefined) { return props.size; }
|
|
241
|
+
if(inputGroupSize.value !== undefined) { return inputGroupSize.value; }
|
|
242
|
+
return 'md';
|
|
243
|
+
});
|
|
216
244
|
|
|
217
245
|
//------------------------------------------------------------------------------------------------------------------
|
|
218
246
|
|
|
219
247
|
const wrapperClasses = computed(() => ({
|
|
220
248
|
'sk-number-input-wrapper': true,
|
|
221
249
|
[`sk-${ effectiveKind.value }`]: true,
|
|
222
|
-
[`sk-${
|
|
250
|
+
[`sk-${ effectiveSize.value }`]: true,
|
|
251
|
+
'sk-cut-top-left': props.corners?.includes('top-left') ?? false,
|
|
252
|
+
'sk-cut-top-right': props.corners?.includes('top-right') ?? false,
|
|
253
|
+
'sk-cut-bottom-right': props.corners?.includes('bottom-right') ?? false,
|
|
254
|
+
'sk-cut-bottom-left': props.corners?.includes('bottom-left') ?? false,
|
|
223
255
|
}));
|
|
224
256
|
|
|
225
257
|
//------------------------------------------------------------------------------------------------------------------
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
//----------------------------------------------------------------------------------------------------------------------
|
|
4
4
|
|
|
5
5
|
import type { ComponentKind, ComponentSize } from '@/types';
|
|
6
|
+
import type { SkCorner } from '@/types/corners';
|
|
6
7
|
|
|
7
8
|
export type SkNumberInputKind = ComponentKind;
|
|
8
9
|
export type SkNumberInputSize = ComponentSize;
|
|
10
|
+
export type SkNumberInputCorner = SkCorner;
|
|
9
11
|
|
|
10
12
|
//----------------------------------------------------------------------------------------------------------------------
|
|
@@ -81,6 +81,9 @@
|
|
|
81
81
|
import type { ComponentCustomColors } from '@/types';
|
|
82
82
|
import type { SkPaginationProps } from './types';
|
|
83
83
|
|
|
84
|
+
// Context
|
|
85
|
+
import { PAGINATION_KIND_KEY, PAGINATION_SIZE_KEY, PAGINATION_VARIANT_KEY } from './context';
|
|
86
|
+
|
|
84
87
|
//------------------------------------------------------------------------------------------------------------------
|
|
85
88
|
|
|
86
89
|
export interface SkPaginationComponentProps extends SkPaginationProps, ComponentCustomColors
|
|
@@ -189,9 +192,9 @@
|
|
|
189
192
|
|
|
190
193
|
//------------------------------------------------------------------------------------------------------------------
|
|
191
194
|
|
|
192
|
-
provide(
|
|
193
|
-
provide(
|
|
194
|
-
provide(
|
|
195
|
+
provide(PAGINATION_KIND_KEY, toRef(() => props.kind));
|
|
196
|
+
provide(PAGINATION_SIZE_KEY, toRef(() => props.size));
|
|
197
|
+
provide(PAGINATION_VARIANT_KEY, toRef(() => props.variant));
|
|
195
198
|
|
|
196
199
|
//------------------------------------------------------------------------------------------------------------------
|
|
197
200
|
|
|
@@ -39,10 +39,13 @@
|
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
|
-
import {
|
|
42
|
+
import { computed, inject } from 'vue';
|
|
43
43
|
|
|
44
44
|
// Types
|
|
45
|
-
import type { SkPaginationItemProps
|
|
45
|
+
import type { SkPaginationItemProps } from './types';
|
|
46
|
+
|
|
47
|
+
// Context
|
|
48
|
+
import { PAGINATION_KIND_KEY, PAGINATION_SIZE_KEY, PAGINATION_VARIANT_KEY } from './context';
|
|
46
49
|
|
|
47
50
|
//------------------------------------------------------------------------------------------------------------------
|
|
48
51
|
|
|
@@ -98,9 +101,9 @@
|
|
|
98
101
|
|
|
99
102
|
//------------------------------------------------------------------------------------------------------------------
|
|
100
103
|
|
|
101
|
-
const kindRef = inject
|
|
102
|
-
const sizeRef = inject
|
|
103
|
-
const variantRef = inject
|
|
104
|
+
const kindRef = inject(PAGINATION_KIND_KEY, undefined);
|
|
105
|
+
const sizeRef = inject(PAGINATION_SIZE_KEY, undefined);
|
|
106
|
+
const variantRef = inject(PAGINATION_VARIANT_KEY, undefined);
|
|
104
107
|
|
|
105
108
|
const kind = computed(() => kindRef?.value ?? 'neutral');
|
|
106
109
|
const size = computed(() => sizeRef?.value ?? 'md');
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
2
|
+
// Pagination Context
|
|
3
|
+
//
|
|
4
|
+
// Injection keys for SkPaginationItem descendants to inherit kind, size, and variant from the
|
|
5
|
+
// surrounding SkPagination without manual wiring.
|
|
6
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
7
|
+
|
|
8
|
+
import type { InjectionKey, Ref } from 'vue';
|
|
9
|
+
|
|
10
|
+
import type { SkPaginationKind, SkPaginationSize, SkPaginationVariant } from './types';
|
|
11
|
+
|
|
12
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
13
|
+
|
|
14
|
+
export const PAGINATION_KIND_KEY : InjectionKey<Ref<SkPaginationKind | undefined>> = Symbol('sk-pagination-kind');
|
|
15
|
+
export const PAGINATION_SIZE_KEY : InjectionKey<Ref<SkPaginationSize | undefined>> = Symbol('sk-pagination-size');
|
|
16
|
+
export const PAGINATION_VARIANT_KEY : InjectionKey<Ref<SkPaginationVariant | undefined>>
|
|
17
|
+
= Symbol('sk-pagination-variant');
|
|
18
|
+
|
|
19
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
//----------------------------------------------------------------------------------------------------------------------
|
|
4
4
|
|
|
5
5
|
import type { ComponentKind } from '@/types';
|
|
6
|
+
import type { SkCorner } from '@/types/corners';
|
|
6
7
|
|
|
7
8
|
//----------------------------------------------------------------------------------------------------------------------
|
|
8
9
|
|
|
@@ -12,7 +13,7 @@ export type SkPanelKind = ComponentKind;
|
|
|
12
13
|
// Panel sizes (only affects cut size, not padding or dimensions)
|
|
13
14
|
export type SkPanelSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
14
15
|
|
|
15
|
-
//
|
|
16
|
-
export type SkPanelCorner =
|
|
16
|
+
// Re-export under the legacy name so consumers and SkPanel continue to compile unchanged.
|
|
17
|
+
export type SkPanelCorner = SkCorner;
|
|
17
18
|
|
|
18
19
|
//----------------------------------------------------------------------------------------------------------------------
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
* formatting, icons, or complex layouts alongside the radio button.
|
|
47
47
|
*/
|
|
48
48
|
|
|
49
|
-
import {
|
|
49
|
+
import { computed, inject, toRef, useSlots } from 'vue';
|
|
50
50
|
import { RadioGroupIndicator, RadioGroupItem } from 'reka-ui';
|
|
51
51
|
|
|
52
52
|
// Types
|
|
@@ -56,6 +56,9 @@
|
|
|
56
56
|
// Composables
|
|
57
57
|
import { useCustomColors } from '@/composables/useCustomColors';
|
|
58
58
|
|
|
59
|
+
// Context
|
|
60
|
+
import { RADIO_KIND_KEY, RADIO_SIZE_KEY } from './context';
|
|
61
|
+
|
|
59
62
|
// Utils
|
|
60
63
|
import { hasSlotContent } from '@/utils/slots';
|
|
61
64
|
|
|
@@ -118,8 +121,8 @@
|
|
|
118
121
|
//------------------------------------------------------------------------------------------------------------------
|
|
119
122
|
|
|
120
123
|
// Inject parent kind and size
|
|
121
|
-
const parentKind = inject
|
|
122
|
-
const parentSize = inject
|
|
124
|
+
const parentKind = inject(RADIO_KIND_KEY, computed(() => undefined));
|
|
125
|
+
const parentSize = inject(RADIO_SIZE_KEY, computed(() => undefined));
|
|
123
126
|
|
|
124
127
|
//------------------------------------------------------------------------------------------------------------------
|
|
125
128
|
|
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
// Types
|
|
50
50
|
import type { SkRadioGroupOrientation, SkRadioKind, SkRadioSize } from './types';
|
|
51
51
|
|
|
52
|
+
import { RADIO_KIND_KEY, RADIO_SIZE_KEY } from './context';
|
|
53
|
+
|
|
52
54
|
//------------------------------------------------------------------------------------------------------------------
|
|
53
55
|
|
|
54
56
|
export interface SkRadioGroupComponentProps
|
|
@@ -134,8 +136,8 @@
|
|
|
134
136
|
//------------------------------------------------------------------------------------------------------------------
|
|
135
137
|
|
|
136
138
|
// Provide kind and size to child radios
|
|
137
|
-
provide(
|
|
138
|
-
provide(
|
|
139
|
+
provide(RADIO_KIND_KEY, computed(() => props.kind));
|
|
140
|
+
provide(RADIO_SIZE_KEY, computed(() => props.size));
|
|
139
141
|
|
|
140
142
|
//------------------------------------------------------------------------------------------------------------------
|
|
141
143
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
2
|
+
// Radio Context
|
|
3
|
+
//
|
|
4
|
+
// Injection keys for SkRadio descendants to inherit kind and size from the surrounding
|
|
5
|
+
// SkRadioGroup without manual wiring.
|
|
6
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
7
|
+
|
|
8
|
+
import type { ComputedRef, InjectionKey } from 'vue';
|
|
9
|
+
|
|
10
|
+
import type { SkRadioKind, SkRadioSize } from './types';
|
|
11
|
+
|
|
12
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
13
|
+
|
|
14
|
+
export const RADIO_KIND_KEY : InjectionKey<ComputedRef<SkRadioKind | undefined>> = Symbol('sk-radio-kind');
|
|
15
|
+
export const RADIO_SIZE_KEY : InjectionKey<ComputedRef<SkRadioSize | undefined>> = Symbol('sk-radio-size');
|
|
16
|
+
|
|
17
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
* to create visual dividers between groups of options.
|
|
73
73
|
*/
|
|
74
74
|
|
|
75
|
-
import {
|
|
75
|
+
import { computed, inject, provide, reactive, toRef } from 'vue';
|
|
76
76
|
import {
|
|
77
77
|
SelectContent,
|
|
78
78
|
SelectPortal,
|
|
@@ -84,9 +84,16 @@
|
|
|
84
84
|
|
|
85
85
|
// Types
|
|
86
86
|
import type { ComponentCustomColors } from '@/types';
|
|
87
|
-
import type { SkSelectKind, SkSelectSize } from './types';
|
|
87
|
+
import type { SkSelectCorner, SkSelectKind, SkSelectSize } from './types';
|
|
88
88
|
|
|
89
89
|
// Composables
|
|
90
|
+
import {
|
|
91
|
+
NO_KIND,
|
|
92
|
+
NO_SIZE,
|
|
93
|
+
inheritedKindKey,
|
|
94
|
+
inputGroupSizeKey,
|
|
95
|
+
validationKindKey,
|
|
96
|
+
} from '@/composables/injectionKeys';
|
|
90
97
|
import { useCustomColors } from '@/composables/useCustomColors';
|
|
91
98
|
import { usePortalContext } from '@/composables/usePortalContext';
|
|
92
99
|
|
|
@@ -124,15 +131,22 @@
|
|
|
124
131
|
* @default false
|
|
125
132
|
*/
|
|
126
133
|
disabled ?: boolean;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Which corners receive the beveled cut. Pass an empty array for square corners.
|
|
137
|
+
* @default undefined (renders as ['top-right'])
|
|
138
|
+
*/
|
|
139
|
+
corners ?: SkSelectCorner[];
|
|
127
140
|
}
|
|
128
141
|
|
|
129
142
|
//------------------------------------------------------------------------------------------------------------------
|
|
130
143
|
|
|
131
144
|
const props = withDefaults(defineProps<SkSelectComponentProps>(), {
|
|
132
145
|
kind: undefined,
|
|
133
|
-
size:
|
|
146
|
+
size: undefined,
|
|
134
147
|
placeholder: 'Select...',
|
|
135
148
|
disabled: false,
|
|
149
|
+
corners: undefined,
|
|
136
150
|
});
|
|
137
151
|
|
|
138
152
|
//------------------------------------------------------------------------------------------------------------------
|
|
@@ -148,8 +162,9 @@
|
|
|
148
162
|
// Handle portal context (theme injection/re-provision for nested portal components)
|
|
149
163
|
const { theme } = usePortalContext();
|
|
150
164
|
|
|
151
|
-
|
|
152
|
-
const
|
|
165
|
+
const validationKind = inject(validationKindKey, NO_KIND);
|
|
166
|
+
const inheritedKind = inject(inheritedKindKey, NO_KIND);
|
|
167
|
+
const inputGroupSize = inject(inputGroupSizeKey, NO_SIZE);
|
|
153
168
|
|
|
154
169
|
//------------------------------------------------------------------------------------------------------------------
|
|
155
170
|
|
|
@@ -175,14 +190,31 @@
|
|
|
175
190
|
|
|
176
191
|
//------------------------------------------------------------------------------------------------------------------
|
|
177
192
|
|
|
178
|
-
const effectiveKind = computed(() =>
|
|
193
|
+
const effectiveKind = computed<SkSelectKind>(() =>
|
|
194
|
+
{
|
|
195
|
+
if(validationKind.value !== undefined) { return validationKind.value; }
|
|
196
|
+
if(props.kind !== undefined) { return props.kind; }
|
|
197
|
+
if(inheritedKind.value !== undefined) { return inheritedKind.value; }
|
|
198
|
+
return 'neutral';
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
const effectiveSize = computed<SkSelectSize>(() =>
|
|
202
|
+
{
|
|
203
|
+
if(props.size !== undefined) { return props.size; }
|
|
204
|
+
if(inputGroupSize.value !== undefined) { return inputGroupSize.value; }
|
|
205
|
+
return 'md';
|
|
206
|
+
});
|
|
179
207
|
|
|
180
208
|
//------------------------------------------------------------------------------------------------------------------
|
|
181
209
|
|
|
182
210
|
const wrapperClasses = computed(() => ({
|
|
183
211
|
'sk-select': true,
|
|
184
212
|
[`sk-${ effectiveKind.value }`]: true,
|
|
185
|
-
[`sk-${
|
|
213
|
+
[`sk-${ effectiveSize.value }`]: true,
|
|
214
|
+
'sk-cut-top-left': props.corners?.includes('top-left') ?? false,
|
|
215
|
+
'sk-cut-top-right': props.corners?.includes('top-right') ?? false,
|
|
216
|
+
'sk-cut-bottom-right': props.corners?.includes('bottom-right') ?? false,
|
|
217
|
+
'sk-cut-bottom-left': props.corners?.includes('bottom-left') ?? false,
|
|
186
218
|
}));
|
|
187
219
|
|
|
188
220
|
//------------------------------------------------------------------------------------------------------------------
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
//----------------------------------------------------------------------------------------------------------------------
|
|
4
4
|
|
|
5
5
|
import type { ComponentKind, ComponentSize } from '@/types';
|
|
6
|
+
import type { SkCorner } from '@/types/corners';
|
|
6
7
|
|
|
7
8
|
export type SkSelectKind = ComponentKind;
|
|
8
9
|
export type SkSelectSize = ComponentSize;
|
|
10
|
+
export type SkSelectCorner = SkCorner;
|
|
9
11
|
|
|
10
12
|
//----------------------------------------------------------------------------------------------------------------------
|
|
@@ -47,11 +47,13 @@
|
|
|
47
47
|
* @slot icon - Optional icon displayed before the tab label. Useful for visual indicators.
|
|
48
48
|
*/
|
|
49
49
|
|
|
50
|
-
import { type
|
|
50
|
+
import { type Slots, computed, inject, useSlots } from 'vue';
|
|
51
51
|
import { TabsTrigger } from 'reka-ui';
|
|
52
52
|
import type { ComponentKind } from '@/types';
|
|
53
53
|
import { hasSlotContent } from '@/utils/slots';
|
|
54
54
|
|
|
55
|
+
import { TABS_KIND_KEY } from './context';
|
|
56
|
+
|
|
55
57
|
//------------------------------------------------------------------------------------------------------------------
|
|
56
58
|
|
|
57
59
|
export interface SkTabComponentProps
|
|
@@ -99,7 +101,7 @@
|
|
|
99
101
|
//------------------------------------------------------------------------------------------------------------------
|
|
100
102
|
|
|
101
103
|
// Inject parent kind (Sleekspace-specific for theming)
|
|
102
|
-
const parentKind = inject
|
|
104
|
+
const parentKind = inject(TABS_KIND_KEY, computed(() => undefined));
|
|
103
105
|
|
|
104
106
|
// Use prop kind if provided, otherwise use parent kind
|
|
105
107
|
const kind = computed(() => props.kind ?? parentKind.value);
|
|
@@ -37,6 +37,8 @@
|
|
|
37
37
|
import { TabsList } from 'reka-ui';
|
|
38
38
|
import type { SkTabsOrientation } from './types.ts';
|
|
39
39
|
|
|
40
|
+
import { TABS_ORIENTATION_KEY } from './context';
|
|
41
|
+
|
|
40
42
|
//------------------------------------------------------------------------------------------------------------------
|
|
41
43
|
|
|
42
44
|
export interface SkTabListComponentProps
|
|
@@ -60,11 +62,11 @@
|
|
|
60
62
|
// Inject orientation from parent (if prop not provided)
|
|
61
63
|
// Note: RekaUI's TabsList gets orientation from TabsRoot context automatically,
|
|
62
64
|
// but we need it for our styling classes
|
|
63
|
-
const contextOrientation = inject
|
|
65
|
+
const contextOrientation = inject(TABS_ORIENTATION_KEY, computed(() => 'horizontal' as const));
|
|
64
66
|
|
|
65
67
|
//------------------------------------------------------------------------------------------------------------------
|
|
66
68
|
|
|
67
|
-
const effectiveOrientation = computed(() => props.orientation
|
|
69
|
+
const effectiveOrientation = computed(() => props.orientation ?? contextOrientation.value);
|
|
68
70
|
|
|
69
71
|
const classes = computed(() =>
|
|
70
72
|
{
|
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
import type { ComponentCustomColors, ComponentKind } from '@/types';
|
|
50
50
|
import { useCustomColors } from '@/composables/useCustomColors';
|
|
51
51
|
|
|
52
|
+
import { TABS_KIND_KEY, TABS_ORIENTATION_KEY, TABS_PLACEMENT_KEY } from './context';
|
|
53
|
+
|
|
52
54
|
//------------------------------------------------------------------------------------------------------------------
|
|
53
55
|
|
|
54
56
|
export interface SkTabsComponentProps extends ComponentCustomColors
|
|
@@ -106,9 +108,9 @@
|
|
|
106
108
|
|
|
107
109
|
// Provide our custom props to child components for styling
|
|
108
110
|
// (RekaUI handles its own context internally, but we need these for our CSS classes)
|
|
109
|
-
provide(
|
|
110
|
-
provide(
|
|
111
|
-
provide(
|
|
111
|
+
provide(TABS_ORIENTATION_KEY, computed(() => props.orientation));
|
|
112
|
+
provide(TABS_PLACEMENT_KEY, computed(() => props.placement));
|
|
113
|
+
provide(TABS_KIND_KEY, computed(() => props.kind));
|
|
112
114
|
|
|
113
115
|
//------------------------------------------------------------------------------------------------------------------
|
|
114
116
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
2
|
+
// Tabs Context
|
|
3
|
+
//
|
|
4
|
+
// Injection keys for SkTab / SkTabList descendants to inherit kind, orientation, and placement
|
|
5
|
+
// from the surrounding SkTabs without manual wiring.
|
|
6
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
7
|
+
|
|
8
|
+
import type { ComputedRef, InjectionKey } from 'vue';
|
|
9
|
+
|
|
10
|
+
import type { ComponentKind } from '@/types';
|
|
11
|
+
import type { SkTabsOrientation, SkTabsPlacement } from './types';
|
|
12
|
+
|
|
13
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
export const TABS_KIND_KEY : InjectionKey<ComputedRef<ComponentKind | undefined>> = Symbol('sk-tabs-kind');
|
|
16
|
+
export const TABS_ORIENTATION_KEY : InjectionKey<ComputedRef<SkTabsOrientation>> = Symbol('sk-tabs-orientation');
|
|
17
|
+
export const TABS_PLACEMENT_KEY : InjectionKey<ComputedRef<SkTabsPlacement>> = Symbol('sk-tabs-placement');
|
|
18
|
+
|
|
19
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
* @slot - Not applicable. This component does not accept slot content.
|
|
65
65
|
*/
|
|
66
66
|
|
|
67
|
-
import {
|
|
67
|
+
import { computed, inject, toRef } from 'vue';
|
|
68
68
|
import {
|
|
69
69
|
TagsInputInput,
|
|
70
70
|
TagsInputItem,
|
|
@@ -78,6 +78,13 @@
|
|
|
78
78
|
import type { SkTagsInputKind, SkTagsInputSize } from './types';
|
|
79
79
|
|
|
80
80
|
// Composables
|
|
81
|
+
import {
|
|
82
|
+
NO_KIND,
|
|
83
|
+
NO_SIZE,
|
|
84
|
+
inheritedKindKey,
|
|
85
|
+
inputGroupSizeKey,
|
|
86
|
+
validationKindKey,
|
|
87
|
+
} from '@/composables/injectionKeys';
|
|
81
88
|
import { useCustomColors } from '@/composables/useCustomColors';
|
|
82
89
|
|
|
83
90
|
//------------------------------------------------------------------------------------------------------------------
|
|
@@ -151,7 +158,7 @@
|
|
|
151
158
|
|
|
152
159
|
const props = withDefaults(defineProps<SkTagsInputComponentProps>(), {
|
|
153
160
|
kind: undefined,
|
|
154
|
-
size:
|
|
161
|
+
size: undefined,
|
|
155
162
|
placeholder: 'Add tag...',
|
|
156
163
|
disabled: false,
|
|
157
164
|
max: undefined,
|
|
@@ -172,12 +179,26 @@
|
|
|
172
179
|
|
|
173
180
|
//------------------------------------------------------------------------------------------------------------------
|
|
174
181
|
|
|
175
|
-
|
|
176
|
-
const
|
|
182
|
+
const validationKind = inject(validationKindKey, NO_KIND);
|
|
183
|
+
const inheritedKind = inject(inheritedKindKey, NO_KIND);
|
|
184
|
+
const inputGroupSize = inject(inputGroupSizeKey, NO_SIZE);
|
|
177
185
|
|
|
178
186
|
//------------------------------------------------------------------------------------------------------------------
|
|
179
187
|
|
|
180
|
-
const effectiveKind = computed(() =>
|
|
188
|
+
const effectiveKind = computed<SkTagsInputKind>(() =>
|
|
189
|
+
{
|
|
190
|
+
if(validationKind.value !== undefined) { return validationKind.value; }
|
|
191
|
+
if(props.kind !== undefined) { return props.kind; }
|
|
192
|
+
if(inheritedKind.value !== undefined) { return inheritedKind.value; }
|
|
193
|
+
return 'neutral';
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
const effectiveSize = computed<SkTagsInputSize>(() =>
|
|
197
|
+
{
|
|
198
|
+
if(props.size !== undefined) { return props.size; }
|
|
199
|
+
if(inputGroupSize.value !== undefined) { return inputGroupSize.value; }
|
|
200
|
+
return 'md';
|
|
201
|
+
});
|
|
181
202
|
|
|
182
203
|
//------------------------------------------------------------------------------------------------------------------
|
|
183
204
|
|
|
@@ -204,7 +225,7 @@
|
|
|
204
225
|
const wrapperClasses = computed(() => ({
|
|
205
226
|
'sk-tags-input': true,
|
|
206
227
|
[`sk-${ effectiveKind.value }`]: true,
|
|
207
|
-
[`sk-${
|
|
228
|
+
[`sk-${ effectiveSize.value }`]: true,
|
|
208
229
|
}));
|
|
209
230
|
|
|
210
231
|
//------------------------------------------------------------------------------------------------------------------
|
|
@@ -218,7 +239,7 @@
|
|
|
218
239
|
const tagClasses = computed(() => ({
|
|
219
240
|
[`sk-${ effectiveTagKind.value }`]: true,
|
|
220
241
|
[`sk-${ props.tagVariant }`]: true,
|
|
221
|
-
[`sk-${
|
|
242
|
+
[`sk-${ effectiveSize.value }`]: true,
|
|
222
243
|
}));
|
|
223
244
|
|
|
224
245
|
//------------------------------------------------------------------------------------------------------------------
|