@skewedaspect/sleekspace-ui 0.9.0 → 0.9.1
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/NumberInput/SkNumberInput.vue.d.ts +8 -0
- package/dist/sleekspace-ui.css +6 -4
- package/dist/sleekspace-ui.es.js +97 -62
- package/dist/sleekspace-ui.umd.js +96 -61
- package/dist/utils/slots.d.ts +6 -0
- package/llms-full.txt +3 -0
- package/package.json +6 -3
- package/src/components/Alert/SkAlert.vue +4 -2
- package/src/components/Breadcrumbs/SkBreadcrumbs.vue +6 -12
- package/src/components/Button/SkButton.vue +8 -5
- package/src/components/Card/SkCard.vue +12 -5
- package/src/components/Checkbox/SkCheckbox.vue +9 -2
- package/src/components/Modal/SkModal.vue +11 -4
- package/src/components/NavBar/SkNavBar.vue +5 -4
- package/src/components/NumberInput/SkNumberInput.vue +10 -1
- package/src/components/Page/SkPage.vue +18 -15
- package/src/components/Popover/SkPopover.vue +11 -4
- package/src/components/Radio/SkRadio.vue +9 -2
- package/src/components/Switch/SkSwitch.vue +14 -13
- package/src/components/Tabs/SkTab.vue +7 -2
- package/src/components/TreeView/SkTreeItem.vue +10 -2
- package/src/static/generated/defaults.ts +1 -0
- package/src/static/generated/propTypes.ts +1 -0
- package/src/styles/components/_number-input.scss +10 -2
- package/src/utils/slots.ts +75 -0
- package/web-types.json +11 -1
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
:decoration-corner="decorationCorner"
|
|
16
16
|
:class="classes"
|
|
17
17
|
>
|
|
18
|
-
<div v-if="title ||
|
|
18
|
+
<div v-if="title || hasSlotContent(slots.header)" class="sk-card-header" :style="headerStyles">
|
|
19
19
|
<h3 v-if="title" class="sk-card-title">
|
|
20
20
|
{{ title }}
|
|
21
21
|
</h3>
|
|
22
22
|
<slot name="header" />
|
|
23
23
|
</div>
|
|
24
|
-
<div v-if="
|
|
24
|
+
<div v-if="hasSlotContent(slots.media)" class="sk-card-media">
|
|
25
25
|
<slot name="media" />
|
|
26
26
|
</div>
|
|
27
|
-
<div v-if="
|
|
27
|
+
<div v-if="hasSlotContent(slots.default)" :class="contentClasses">
|
|
28
28
|
<slot />
|
|
29
29
|
</div>
|
|
30
|
-
<div v-if="
|
|
30
|
+
<div v-if="hasSlotContent(slots.footer)" class="sk-card-footer">
|
|
31
31
|
<slot name="footer" />
|
|
32
32
|
</div>
|
|
33
33
|
</SkPanel>
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
* appropriate spacing.
|
|
65
65
|
*/
|
|
66
66
|
|
|
67
|
-
import { computed } from 'vue';
|
|
67
|
+
import { computed, useSlots } from 'vue';
|
|
68
68
|
|
|
69
69
|
// Types
|
|
70
70
|
import type { ComponentCustomColors } from '@/types';
|
|
@@ -74,6 +74,9 @@
|
|
|
74
74
|
// Components
|
|
75
75
|
import SkPanel from '../Panel/SkPanel.vue';
|
|
76
76
|
|
|
77
|
+
// Utils
|
|
78
|
+
import { hasSlotContent } from '@/utils/slots';
|
|
79
|
+
|
|
77
80
|
//------------------------------------------------------------------------------------------------------------------
|
|
78
81
|
|
|
79
82
|
export interface SkCardComponentProps extends ComponentCustomColors
|
|
@@ -170,6 +173,10 @@
|
|
|
170
173
|
|
|
171
174
|
//------------------------------------------------------------------------------------------------------------------
|
|
172
175
|
|
|
176
|
+
const slots = useSlots();
|
|
177
|
+
|
|
178
|
+
//------------------------------------------------------------------------------------------------------------------
|
|
179
|
+
|
|
173
180
|
const classes = computed(() =>
|
|
174
181
|
{
|
|
175
182
|
return {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
</svg>
|
|
43
43
|
</CheckboxIndicator>
|
|
44
44
|
</CheckboxRoot>
|
|
45
|
-
<span v-if="label ||
|
|
45
|
+
<span v-if="label || hasSlotContent(slots.default)" class="sk-checkbox-label">
|
|
46
46
|
<slot>{{ label }}</slot>
|
|
47
47
|
</span>
|
|
48
48
|
</label>
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
* @slot default - Custom label content. Overrides the `label` prop when provided.
|
|
72
72
|
*/
|
|
73
73
|
|
|
74
|
-
import { computed, toRef } from 'vue';
|
|
74
|
+
import { computed, toRef, useSlots } from 'vue';
|
|
75
75
|
import { CheckboxIndicator, CheckboxRoot } from 'reka-ui';
|
|
76
76
|
|
|
77
77
|
// Types
|
|
@@ -81,6 +81,9 @@
|
|
|
81
81
|
// Composables
|
|
82
82
|
import { useCustomColors } from '@/composables/useCustomColors';
|
|
83
83
|
|
|
84
|
+
// Utils
|
|
85
|
+
import { hasSlotContent } from '@/utils/slots';
|
|
86
|
+
|
|
84
87
|
//------------------------------------------------------------------------------------------------------------------
|
|
85
88
|
|
|
86
89
|
export interface SkCheckboxComponentProps extends ComponentCustomColors
|
|
@@ -151,6 +154,10 @@
|
|
|
151
154
|
|
|
152
155
|
//------------------------------------------------------------------------------------------------------------------
|
|
153
156
|
|
|
157
|
+
const slots = useSlots();
|
|
158
|
+
|
|
159
|
+
//------------------------------------------------------------------------------------------------------------------
|
|
160
|
+
|
|
154
161
|
const classes = computed(() => ({
|
|
155
162
|
'sk-checkbox': true,
|
|
156
163
|
[`sk-${ props.kind }`]: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<DialogRoot v-model:open="isOpen">
|
|
3
|
-
<DialogTrigger v-if="
|
|
3
|
+
<DialogTrigger v-if="hasSlotContent(slots.trigger) || triggerText" as-child>
|
|
4
4
|
<slot name="trigger">
|
|
5
5
|
<SkButton :kind="kind">
|
|
6
6
|
{{ triggerText }}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
@pointer-down-outside="handleOverlayClick"
|
|
18
18
|
@interact-outside="handleOverlayClick"
|
|
19
19
|
>
|
|
20
|
-
<div v-if="
|
|
20
|
+
<div v-if="hasSlotContent(slots.title) || title" class="sk-modal-header">
|
|
21
21
|
<DialogTitle class="sk-modal-title">
|
|
22
22
|
<slot name="title" :close="close">
|
|
23
23
|
{{ title }}
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<div class="sk-modal-body">
|
|
41
41
|
<slot :close="close" />
|
|
42
42
|
</div>
|
|
43
|
-
<div v-if="
|
|
43
|
+
<div v-if="hasSlotContent(slots.footer)" class="sk-modal-footer">
|
|
44
44
|
<slot name="footer" :close="close" />
|
|
45
45
|
</div>
|
|
46
46
|
</DialogContent>
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
* @slot footer - Footer content, typically containing action buttons. Receives `{ close }` slot prop.
|
|
89
89
|
*/
|
|
90
90
|
|
|
91
|
-
import { computed, ref, toRef, watch } from 'vue';
|
|
91
|
+
import { type Slots, computed, ref, toRef, useSlots, watch } from 'vue';
|
|
92
92
|
import {
|
|
93
93
|
DialogClose,
|
|
94
94
|
DialogContent,
|
|
@@ -106,6 +106,9 @@
|
|
|
106
106
|
import { useCustomColors } from '@/composables/useCustomColors';
|
|
107
107
|
import { usePortalContext } from '@/composables/usePortalContext';
|
|
108
108
|
|
|
109
|
+
// Utils
|
|
110
|
+
import { hasSlotContent } from '@/utils/slots';
|
|
111
|
+
|
|
109
112
|
// Components
|
|
110
113
|
import SkButton from '../Button/SkButton.vue';
|
|
111
114
|
|
|
@@ -206,6 +209,10 @@
|
|
|
206
209
|
|
|
207
210
|
//------------------------------------------------------------------------------------------------------------------
|
|
208
211
|
|
|
212
|
+
const slots : Slots = useSlots();
|
|
213
|
+
|
|
214
|
+
//------------------------------------------------------------------------------------------------------------------
|
|
215
|
+
|
|
209
216
|
const isOpen = ref(props.open);
|
|
210
217
|
|
|
211
218
|
watch(() => props.open, (newValue) =>
|
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
<template>
|
|
6
6
|
<nav :class="classes" :style="customColorStyles">
|
|
7
7
|
<div class="sk-navbar-content">
|
|
8
|
-
<div v-if="slots.leading" class="sk-navbar-leading">
|
|
8
|
+
<div v-if="hasSlotContent(slots.leading)" class="sk-navbar-leading">
|
|
9
9
|
<slot name="leading" />
|
|
10
10
|
</div>
|
|
11
11
|
|
|
12
|
-
<div v-if="slots.brand" class="sk-navbar-brand">
|
|
12
|
+
<div v-if="hasSlotContent(slots.brand)" class="sk-navbar-brand">
|
|
13
13
|
<slot name="brand" />
|
|
14
14
|
</div>
|
|
15
15
|
|
|
16
|
-
<div v-if="slots.default" class="sk-navbar-nav">
|
|
16
|
+
<div v-if="hasSlotContent(slots.default)" class="sk-navbar-nav">
|
|
17
17
|
<slot />
|
|
18
18
|
</div>
|
|
19
19
|
|
|
20
|
-
<div v-if="slots.actions" class="sk-navbar-actions">
|
|
20
|
+
<div v-if="hasSlotContent(slots.actions)" class="sk-navbar-actions">
|
|
21
21
|
<slot name="actions" />
|
|
22
22
|
</div>
|
|
23
23
|
</div>
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
import type { SkNavBarKind, SkNavBarSize } from './types';
|
|
63
63
|
import type { ComponentCustomColors } from '@/types';
|
|
64
64
|
import { useCustomColors } from '@/composables/useCustomColors';
|
|
65
|
+
import { hasSlotContent } from '@/utils/slots';
|
|
65
66
|
import { NAVBAR_KIND_KEY, NAVBAR_SIZE_KEY } from './context';
|
|
66
67
|
|
|
67
68
|
//------------------------------------------------------------------------------------------------------------------
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
:step="step"
|
|
18
18
|
>
|
|
19
19
|
<NumberFieldInput :class="inputClasses" :placeholder="placeholder" />
|
|
20
|
-
<div class="sk-number-input-steppers">
|
|
20
|
+
<div v-if="showSteppers" class="sk-number-input-steppers">
|
|
21
21
|
<NumberFieldIncrement class="sk-number-input-increment">
|
|
22
22
|
<svg
|
|
23
23
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -170,6 +170,14 @@
|
|
|
170
170
|
* @default 1
|
|
171
171
|
*/
|
|
172
172
|
step ?: number;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* When true, renders the increment/decrement stepper buttons on the right side of the
|
|
176
|
+
* input. Set to false for a plain numeric text field (users can still use arrow keys
|
|
177
|
+
* and type values directly).
|
|
178
|
+
* @default true
|
|
179
|
+
*/
|
|
180
|
+
showSteppers ?: boolean;
|
|
173
181
|
}
|
|
174
182
|
|
|
175
183
|
//------------------------------------------------------------------------------------------------------------------
|
|
@@ -185,6 +193,7 @@
|
|
|
185
193
|
min: undefined,
|
|
186
194
|
max: undefined,
|
|
187
195
|
step: 1,
|
|
196
|
+
showSteppers: true,
|
|
188
197
|
});
|
|
189
198
|
|
|
190
199
|
//------------------------------------------------------------------------------------------------------------------
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
<template>
|
|
6
6
|
<div ref="rootRef" :class="classes" :style="customStyles" :data-scheme="theme">
|
|
7
|
-
<header v-if="
|
|
7
|
+
<header v-if="hasSlotContent(slots.header)" class="sk-page-header">
|
|
8
8
|
<slot name="header" />
|
|
9
9
|
</header>
|
|
10
10
|
|
|
11
|
-
<div v-if="
|
|
11
|
+
<div v-if="hasSlotContent(slots.subheader)" class="sk-page-subheader">
|
|
12
12
|
<slot name="subheader" />
|
|
13
13
|
</div>
|
|
14
14
|
|
|
@@ -18,25 +18,25 @@
|
|
|
18
18
|
v-if="hasSidebar && !isSidebarDrawerActive"
|
|
19
19
|
class="sk-page-sidebar"
|
|
20
20
|
>
|
|
21
|
-
<div v-if="
|
|
21
|
+
<div v-if="hasSlotContent(slots['sidebar-header'])" class="sk-page-sidebar-header">
|
|
22
22
|
<slot name="sidebar-header" :is-drawer="false" />
|
|
23
23
|
</div>
|
|
24
24
|
<div class="sk-page-sidebar-body">
|
|
25
25
|
<slot name="sidebar" :is-drawer="false" />
|
|
26
26
|
</div>
|
|
27
|
-
<div v-if="
|
|
27
|
+
<div v-if="hasSlotContent(slots['sidebar-footer'])" class="sk-page-sidebar-footer">
|
|
28
28
|
<slot name="sidebar-footer" :is-drawer="false" />
|
|
29
29
|
</div>
|
|
30
30
|
</aside>
|
|
31
31
|
|
|
32
32
|
<div class="sk-page-center">
|
|
33
|
-
<div v-if="
|
|
33
|
+
<div v-if="hasSlotContent(slots['main-header'])" class="sk-page-main-header">
|
|
34
34
|
<slot name="main-header" />
|
|
35
35
|
</div>
|
|
36
36
|
<main class="sk-page-content">
|
|
37
37
|
<slot />
|
|
38
38
|
</main>
|
|
39
|
-
<div v-if="
|
|
39
|
+
<div v-if="hasSlotContent(slots['main-footer'])" class="sk-page-main-footer">
|
|
40
40
|
<slot name="main-footer" />
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
@@ -46,19 +46,19 @@
|
|
|
46
46
|
v-if="hasAside && !isAsideDrawerActive"
|
|
47
47
|
class="sk-page-aside"
|
|
48
48
|
>
|
|
49
|
-
<div v-if="
|
|
49
|
+
<div v-if="hasSlotContent(slots['aside-header'])" class="sk-page-aside-header">
|
|
50
50
|
<slot name="aside-header" :is-drawer="false" />
|
|
51
51
|
</div>
|
|
52
52
|
<div class="sk-page-aside-body">
|
|
53
53
|
<slot name="aside" :is-drawer="false" />
|
|
54
54
|
</div>
|
|
55
|
-
<div v-if="
|
|
55
|
+
<div v-if="hasSlotContent(slots['aside-footer'])" class="sk-page-aside-footer">
|
|
56
56
|
<slot name="aside-footer" :is-drawer="false" />
|
|
57
57
|
</div>
|
|
58
58
|
</aside>
|
|
59
59
|
</div>
|
|
60
60
|
|
|
61
|
-
<footer v-if="
|
|
61
|
+
<footer v-if="hasSlotContent(slots.footer)" class="sk-page-footer">
|
|
62
62
|
<slot name="footer" />
|
|
63
63
|
</footer>
|
|
64
64
|
|
|
@@ -84,13 +84,13 @@
|
|
|
84
84
|
tabindex="-1"
|
|
85
85
|
@click="onSidebarDrawerClick"
|
|
86
86
|
>
|
|
87
|
-
<div v-if="
|
|
87
|
+
<div v-if="hasSlotContent(slots['sidebar-header'])" class="sk-page-sidebar-header">
|
|
88
88
|
<slot name="sidebar-header" :is-drawer="true" />
|
|
89
89
|
</div>
|
|
90
90
|
<div class="sk-page-sidebar-body">
|
|
91
91
|
<slot name="sidebar" :is-drawer="true" />
|
|
92
92
|
</div>
|
|
93
|
-
<div v-if="
|
|
93
|
+
<div v-if="hasSlotContent(slots['sidebar-footer'])" class="sk-page-sidebar-footer">
|
|
94
94
|
<slot name="sidebar-footer" :is-drawer="true" />
|
|
95
95
|
</div>
|
|
96
96
|
</aside>
|
|
@@ -119,13 +119,13 @@
|
|
|
119
119
|
tabindex="-1"
|
|
120
120
|
@click="onAsideDrawerClick"
|
|
121
121
|
>
|
|
122
|
-
<div v-if="
|
|
122
|
+
<div v-if="hasSlotContent(slots['aside-header'])" class="sk-page-aside-header">
|
|
123
123
|
<slot name="aside-header" :is-drawer="true" />
|
|
124
124
|
</div>
|
|
125
125
|
<div class="sk-page-aside-body">
|
|
126
126
|
<slot name="aside" :is-drawer="true" />
|
|
127
127
|
</div>
|
|
128
|
-
<div v-if="
|
|
128
|
+
<div v-if="hasSlotContent(slots['aside-footer'])" class="sk-page-aside-footer">
|
|
129
129
|
<slot name="aside-footer" :is-drawer="true" />
|
|
130
130
|
</div>
|
|
131
131
|
</aside>
|
|
@@ -199,6 +199,9 @@
|
|
|
199
199
|
import { useFocusTrap } from '@/composables/useFocusTrap';
|
|
200
200
|
import { providePageDrawers } from '@/composables/usePageDrawer';
|
|
201
201
|
|
|
202
|
+
// Utils
|
|
203
|
+
import { hasSlotContent } from '@/utils/slots';
|
|
204
|
+
|
|
202
205
|
//------------------------------------------------------------------------------------------------------------------
|
|
203
206
|
|
|
204
207
|
export interface SkPageComponentProps
|
|
@@ -332,8 +335,8 @@
|
|
|
332
335
|
// Slot-derived state
|
|
333
336
|
//------------------------------------------------------------------------------------------------------------------
|
|
334
337
|
|
|
335
|
-
const hasSidebar = computed<boolean>(() =>
|
|
336
|
-
const hasAside = computed<boolean>(() =>
|
|
338
|
+
const hasSidebar = computed<boolean>(() => hasSlotContent(slots.sidebar));
|
|
339
|
+
const hasAside = computed<boolean>(() => hasSlotContent(slots.aside));
|
|
337
340
|
|
|
338
341
|
//------------------------------------------------------------------------------------------------------------------
|
|
339
342
|
// Responsive mode detection — driven by SkPage's own width, not the viewport, so embedded
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
:collision-padding="8"
|
|
15
15
|
>
|
|
16
16
|
<!-- Header -->
|
|
17
|
-
<div v-if="title ||
|
|
17
|
+
<div v-if="title || hasSlotContent(slots.header)" class="sk-popover-header">
|
|
18
18
|
<h3 v-if="title" class="sk-popover-title">
|
|
19
19
|
{{ title }}
|
|
20
20
|
</h3>
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
</div>
|
|
43
43
|
|
|
44
44
|
<!-- Content -->
|
|
45
|
-
<div v-if="
|
|
45
|
+
<div v-if="hasSlotContent(slots.default)" class="sk-popover-body">
|
|
46
46
|
<slot />
|
|
47
47
|
</div>
|
|
48
48
|
|
|
49
49
|
<!-- Footer -->
|
|
50
|
-
<div v-if="
|
|
50
|
+
<div v-if="hasSlotContent(slots.footer)" class="sk-popover-footer">
|
|
51
51
|
<slot name="footer" />
|
|
52
52
|
</div>
|
|
53
53
|
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
* button pairs or other closing actions.
|
|
101
101
|
*/
|
|
102
102
|
|
|
103
|
-
import { computed, toRef } from 'vue';
|
|
103
|
+
import { type Slots, computed, toRef, useSlots } from 'vue';
|
|
104
104
|
import {
|
|
105
105
|
PopoverArrow,
|
|
106
106
|
PopoverClose,
|
|
@@ -118,6 +118,9 @@
|
|
|
118
118
|
import { useCustomColors } from '@/composables/useCustomColors';
|
|
119
119
|
import { usePortalContext } from '@/composables/usePortalContext';
|
|
120
120
|
|
|
121
|
+
// Utils
|
|
122
|
+
import { hasSlotContent } from '@/utils/slots';
|
|
123
|
+
|
|
121
124
|
//------------------------------------------------------------------------------------------------------------------
|
|
122
125
|
|
|
123
126
|
export interface SkPopoverComponentProps extends ComponentCustomColors
|
|
@@ -223,6 +226,10 @@
|
|
|
223
226
|
|
|
224
227
|
//------------------------------------------------------------------------------------------------------------------
|
|
225
228
|
|
|
229
|
+
const slots : Slots = useSlots();
|
|
230
|
+
|
|
231
|
+
//------------------------------------------------------------------------------------------------------------------
|
|
232
|
+
|
|
226
233
|
const contentClasses = computed(() => ({
|
|
227
234
|
'sk-popover-content': true,
|
|
228
235
|
[`sk-${ props.kind }`]: true,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
>
|
|
13
13
|
<RadioGroupIndicator class="sk-radio-indicator" />
|
|
14
14
|
</RadioGroupItem>
|
|
15
|
-
<span v-if="label ||
|
|
15
|
+
<span v-if="label || hasSlotContent(slots.default)" class="sk-radio-label">
|
|
16
16
|
<slot>{{ label }}</slot>
|
|
17
17
|
</span>
|
|
18
18
|
</label>
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
* formatting, icons, or complex layouts alongside the radio button.
|
|
47
47
|
*/
|
|
48
48
|
|
|
49
|
-
import { type ComputedRef, computed, inject, toRef } from 'vue';
|
|
49
|
+
import { type ComputedRef, 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
|
+
// Utils
|
|
60
|
+
import { hasSlotContent } from '@/utils/slots';
|
|
61
|
+
|
|
59
62
|
//------------------------------------------------------------------------------------------------------------------
|
|
60
63
|
|
|
61
64
|
export interface SkRadioComponentProps extends ComponentCustomColors
|
|
@@ -110,6 +113,10 @@
|
|
|
110
113
|
|
|
111
114
|
//------------------------------------------------------------------------------------------------------------------
|
|
112
115
|
|
|
116
|
+
const slots = useSlots();
|
|
117
|
+
|
|
118
|
+
//------------------------------------------------------------------------------------------------------------------
|
|
119
|
+
|
|
113
120
|
// Inject parent kind and size
|
|
114
121
|
const parentKind = inject<ComputedRef<SkRadioKind | undefined>>('radio-kind', computed(() => undefined));
|
|
115
122
|
const parentSize = inject<ComputedRef<SkRadioSize | undefined>>('radio-size', computed(() => undefined));
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
</SwitchRoot>
|
|
19
19
|
<label v-if="showLabel" class="sk-switch-label">
|
|
20
20
|
<!-- Default slot overrides everything -->
|
|
21
|
-
<slot v-if="slots.default" />
|
|
21
|
+
<slot v-if="hasSlotContent(slots.default)" />
|
|
22
22
|
<!-- If using on/off labels with animation -->
|
|
23
23
|
<Transition v-else-if="useOnOffLabels && !disableLabelAnimation" name="sk-switch-label-fade" mode="out-in">
|
|
24
24
|
<span v-if="modelValue" :key="'on'">
|
|
25
|
-
<slot v-if="slots['label-on']" name="label-on" />
|
|
25
|
+
<slot v-if="hasSlotContent(slots['label-on'])" name="label-on" />
|
|
26
26
|
<template v-else>
|
|
27
27
|
{{ labelOn }}
|
|
28
28
|
</template>
|
|
29
29
|
</span>
|
|
30
30
|
<span v-else :key="'off'">
|
|
31
|
-
<slot v-if="slots['label-off']" name="label-off" />
|
|
31
|
+
<slot v-if="hasSlotContent(slots['label-off'])" name="label-off" />
|
|
32
32
|
<template v-else>
|
|
33
33
|
{{ labelOff }}
|
|
34
34
|
</template>
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
<!-- If using on/off labels without animation -->
|
|
38
38
|
<template v-else-if="useOnOffLabels && disableLabelAnimation">
|
|
39
39
|
<span v-if="modelValue">
|
|
40
|
-
<slot v-if="slots['label-on']" name="label-on" />
|
|
40
|
+
<slot v-if="hasSlotContent(slots['label-on'])" name="label-on" />
|
|
41
41
|
<template v-else>
|
|
42
42
|
{{ labelOn }}
|
|
43
43
|
</template>
|
|
44
44
|
</span>
|
|
45
45
|
<span v-else>
|
|
46
|
-
<slot v-if="slots['label-off']" name="label-off" />
|
|
46
|
+
<slot v-if="hasSlotContent(slots['label-off'])" name="label-off" />
|
|
47
47
|
<template v-else>
|
|
48
48
|
{{ labelOff }}
|
|
49
49
|
</template>
|
|
@@ -88,6 +88,9 @@
|
|
|
88
88
|
// Composables
|
|
89
89
|
import { useCustomColors } from '@/composables/useCustomColors';
|
|
90
90
|
|
|
91
|
+
// Utils
|
|
92
|
+
import { hasSlotContent } from '@/utils/slots';
|
|
93
|
+
|
|
91
94
|
//------------------------------------------------------------------------------------------------------------------
|
|
92
95
|
|
|
93
96
|
export interface SkSwitchComponentProps extends ComponentCustomColors
|
|
@@ -232,14 +235,12 @@
|
|
|
232
235
|
// - labelOn/labelOff props are provided, OR
|
|
233
236
|
// - label-on/label-off slots are provided, OR
|
|
234
237
|
// - fallback label prop is provided
|
|
235
|
-
return
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|| props.label
|
|
242
|
-
);
|
|
238
|
+
return hasSlotContent(slots.default)
|
|
239
|
+
|| Boolean(props.labelOn)
|
|
240
|
+
|| Boolean(props.labelOff)
|
|
241
|
+
|| hasSlotContent(slots['label-on'])
|
|
242
|
+
|| hasSlotContent(slots['label-off'])
|
|
243
|
+
|| Boolean(props.label);
|
|
243
244
|
});
|
|
244
245
|
|
|
245
246
|
const useOnOffLabels = computed(() =>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
:disabled="disabled"
|
|
9
9
|
:class="classes"
|
|
10
10
|
>
|
|
11
|
-
<span v-if="
|
|
11
|
+
<span v-if="hasSlotContent(slots.icon)" class="sk-tab-icon">
|
|
12
12
|
<slot name="icon" />
|
|
13
13
|
</span>
|
|
14
14
|
<span class="sk-tab-label">
|
|
@@ -47,9 +47,10 @@
|
|
|
47
47
|
* @slot icon - Optional icon displayed before the tab label. Useful for visual indicators.
|
|
48
48
|
*/
|
|
49
49
|
|
|
50
|
-
import { type ComputedRef, computed, inject } from 'vue';
|
|
50
|
+
import { type ComputedRef, type Slots, computed, inject, useSlots } from 'vue';
|
|
51
51
|
import { TabsTrigger } from 'reka-ui';
|
|
52
52
|
import type { ComponentKind } from '@/types';
|
|
53
|
+
import { hasSlotContent } from '@/utils/slots';
|
|
53
54
|
|
|
54
55
|
//------------------------------------------------------------------------------------------------------------------
|
|
55
56
|
|
|
@@ -93,6 +94,10 @@
|
|
|
93
94
|
|
|
94
95
|
//------------------------------------------------------------------------------------------------------------------
|
|
95
96
|
|
|
97
|
+
const slots : Slots = useSlots();
|
|
98
|
+
|
|
99
|
+
//------------------------------------------------------------------------------------------------------------------
|
|
100
|
+
|
|
96
101
|
// Inject parent kind (Sleekspace-specific for theming)
|
|
97
102
|
const parentKind = inject<ComputedRef<ComponentKind | undefined>>('tabs-kind', computed(() => undefined));
|
|
98
103
|
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<div v-else-if="showChevron" class="sk-tree-item-chevron-spacer" />
|
|
33
33
|
|
|
34
34
|
<!-- Leading slot (icons, checkboxes, etc.) -->
|
|
35
|
-
<div v-if="
|
|
35
|
+
<div v-if="hasSlotContent(slots.leading)" class="sk-tree-item-leading">
|
|
36
36
|
<slot name="leading" :is-expanded="isExpanded" :is-selected="isSelected" />
|
|
37
37
|
</div>
|
|
38
38
|
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
</div>
|
|
48
48
|
|
|
49
49
|
<!-- Trailing slot -->
|
|
50
|
-
<div v-if="
|
|
50
|
+
<div v-if="hasSlotContent(slots.trailing)" class="sk-tree-item-trailing">
|
|
51
51
|
<slot name="trailing" :is-expanded="isExpanded" :is-selected="isSelected" />
|
|
52
52
|
</div>
|
|
53
53
|
</TreeItem>
|
|
@@ -62,8 +62,12 @@
|
|
|
62
62
|
<!--------------------------------------------------------------------------------------------------------------------->
|
|
63
63
|
|
|
64
64
|
<script setup lang="ts">
|
|
65
|
+
import { type Slots, useSlots } from 'vue';
|
|
65
66
|
import { type FlattenedItem, TreeItem } from 'reka-ui';
|
|
66
67
|
|
|
68
|
+
// Utils
|
|
69
|
+
import { hasSlotContent } from '@/utils/slots';
|
|
70
|
+
|
|
67
71
|
//------------------------------------------------------------------------------------------------------------------
|
|
68
72
|
|
|
69
73
|
export interface SkTreeItemComponentProps
|
|
@@ -79,6 +83,10 @@
|
|
|
79
83
|
disabled: false,
|
|
80
84
|
showChevron: true,
|
|
81
85
|
});
|
|
86
|
+
|
|
87
|
+
//------------------------------------------------------------------------------------------------------------------
|
|
88
|
+
|
|
89
|
+
const slots : Slots = useSlots();
|
|
82
90
|
</script>
|
|
83
91
|
|
|
84
92
|
<!--------------------------------------------------------------------------------------------------------------------->
|
|
@@ -330,13 +330,21 @@
|
|
|
330
330
|
.sk-number-input-increment
|
|
331
331
|
{
|
|
332
332
|
position: relative;
|
|
333
|
-
border-bottom: var(--sk-border-width-thin) solid var(--sk-number-input-color-base);
|
|
334
333
|
|
|
335
|
-
//
|
|
334
|
+
// Shape-only: match the wrapper's top-right bevel so the button's background (and hover fill)
|
|
335
|
+
// doesn't square off the cut corner. We use zero-width / transparent so the mixin's `border:`
|
|
336
|
+
// shorthand doesn't paint a visible stroke on top/right/left — the wrapper and steppers already
|
|
337
|
+
// draw those sides.
|
|
336
338
|
@include cut-border(
|
|
337
339
|
$cut: var(--sk-number-input-cut),
|
|
340
|
+
$border-width: 0,
|
|
341
|
+
$border-color: transparent,
|
|
338
342
|
$corners: (top-right)
|
|
339
343
|
);
|
|
344
|
+
|
|
345
|
+
// Divider between increment and decrement. Must come after the mixin so the `border:`
|
|
346
|
+
// shorthand inside doesn't clobber it.
|
|
347
|
+
border-bottom: var(--sk-border-width-thin) solid var(--sk-number-input-color-base);
|
|
340
348
|
}
|
|
341
349
|
|
|
342
350
|
//----------------------------------------------------------------------------------------------------------------------
|