@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
package/src/styles/tokens.scss
CHANGED
|
@@ -1,268 +1,21 @@
|
|
|
1
1
|
//----------------------------------------------------------------------------------------------------------------------
|
|
2
2
|
// SleekSpace UI - Tokens Only
|
|
3
3
|
//----------------------------------------------------------------------------------------------------------------------
|
|
4
|
-
//
|
|
5
|
-
//
|
|
4
|
+
// Pure CSS custom properties (design tokens) — no component styles, no Tailwind syntax. Safe
|
|
5
|
+
// for any consumer that needs the SleekSpace design tokens, including PrinceXML, plain SSGs,
|
|
6
|
+
// and any context that doesn't run a Tailwind toolchain.
|
|
6
7
|
//
|
|
7
|
-
//
|
|
8
|
+
// For Tailwind v4 integration (utilities like `bg-sk-primary`), import `tailwind.css` from
|
|
9
|
+
// this package alongside this file:
|
|
8
10
|
//
|
|
9
11
|
// @import "tailwindcss";
|
|
10
12
|
// @import "@skewedaspect/sleekspace-ui/tokens.css";
|
|
13
|
+
// @import "@skewedaspect/sleekspace-ui/tailwind.css";
|
|
11
14
|
//
|
|
12
|
-
//
|
|
13
|
-
// <div
|
|
14
|
-
// <div class="bg-sk-purple-50 text-white">Neon purple</div>
|
|
15
|
-
//
|
|
16
|
-
// Or with arbitrary values:
|
|
17
|
-
// <div class="bg-[var(--sk-primary-base)]">Direct CSS variable</div>
|
|
15
|
+
// Without Tailwind, you can still use the variables directly in arbitrary values:
|
|
16
|
+
// <div style="background: var(--sk-primary-base)">SleekSpace token</div>
|
|
18
17
|
//----------------------------------------------------------------------------------------------------------------------
|
|
19
18
|
|
|
20
19
|
@use "tokens/index" as tokens-module;
|
|
21
20
|
|
|
22
21
|
//----------------------------------------------------------------------------------------------------------------------
|
|
23
|
-
// Tailwind v4 Theme Integration
|
|
24
|
-
//----------------------------------------------------------------------------------------------------------------------
|
|
25
|
-
// Map SleekSpace CSS variables to Tailwind's @theme system for standard utilities
|
|
26
|
-
//----------------------------------------------------------------------------------------------------------------------
|
|
27
|
-
|
|
28
|
-
@theme inline {
|
|
29
|
-
/* Semantic Colors (theme-aware - change based on SkTheme) */
|
|
30
|
-
/* Each semantic color gets a full shade range using oklch lightness modifications */
|
|
31
|
-
|
|
32
|
-
/* Neutral */
|
|
33
|
-
--color-sk-neutral: var(--sk-neutral-base);
|
|
34
|
-
--color-sk-neutral-text: var(--sk-neutral-text);
|
|
35
|
-
--color-sk-neutral-5: oklch(from var(--sk-neutral-base) 0.95 c h);
|
|
36
|
-
--color-sk-neutral-10: oklch(from var(--sk-neutral-base) 0.90 c h);
|
|
37
|
-
--color-sk-neutral-20: oklch(from var(--sk-neutral-base) 0.85 c h);
|
|
38
|
-
--color-sk-neutral-30: oklch(from var(--sk-neutral-base) 0.80 c h);
|
|
39
|
-
--color-sk-neutral-40: oklch(from var(--sk-neutral-base) 0.75 c h);
|
|
40
|
-
--color-sk-neutral-50: var(--sk-neutral-base);
|
|
41
|
-
--color-sk-neutral-60: oklch(from var(--sk-neutral-base) calc(l * 0.85) c h);
|
|
42
|
-
--color-sk-neutral-70: oklch(from var(--sk-neutral-base) calc(l * 0.70) c h);
|
|
43
|
-
--color-sk-neutral-80: oklch(from var(--sk-neutral-base) calc(l * 0.55) c h);
|
|
44
|
-
--color-sk-neutral-90: oklch(from var(--sk-neutral-base) calc(l * 0.40) c h);
|
|
45
|
-
--color-sk-neutral-95: oklch(from var(--sk-neutral-base) calc(l * 0.25) c h);
|
|
46
|
-
|
|
47
|
-
/* Primary */
|
|
48
|
-
--color-sk-primary: var(--sk-primary-base);
|
|
49
|
-
--color-sk-primary-text: var(--sk-primary-text);
|
|
50
|
-
--color-sk-primary-5: oklch(from var(--sk-primary-base) 0.95 c h);
|
|
51
|
-
--color-sk-primary-10: oklch(from var(--sk-primary-base) 0.90 c h);
|
|
52
|
-
--color-sk-primary-20: oklch(from var(--sk-primary-base) 0.85 c h);
|
|
53
|
-
--color-sk-primary-30: oklch(from var(--sk-primary-base) 0.80 c h);
|
|
54
|
-
--color-sk-primary-40: oklch(from var(--sk-primary-base) 0.75 c h);
|
|
55
|
-
--color-sk-primary-50: var(--sk-primary-base);
|
|
56
|
-
--color-sk-primary-60: oklch(from var(--sk-primary-base) calc(l * 0.85) c h);
|
|
57
|
-
--color-sk-primary-70: oklch(from var(--sk-primary-base) calc(l * 0.70) c h);
|
|
58
|
-
--color-sk-primary-80: oklch(from var(--sk-primary-base) calc(l * 0.55) c h);
|
|
59
|
-
--color-sk-primary-90: oklch(from var(--sk-primary-base) calc(l * 0.40) c h);
|
|
60
|
-
--color-sk-primary-95: oklch(from var(--sk-primary-base) calc(l * 0.25) c h);
|
|
61
|
-
|
|
62
|
-
/* Accent */
|
|
63
|
-
--color-sk-accent: var(--sk-accent-base);
|
|
64
|
-
--color-sk-accent-text: var(--sk-accent-text);
|
|
65
|
-
--color-sk-accent-5: oklch(from var(--sk-accent-base) 0.95 c h);
|
|
66
|
-
--color-sk-accent-10: oklch(from var(--sk-accent-base) 0.90 c h);
|
|
67
|
-
--color-sk-accent-20: oklch(from var(--sk-accent-base) 0.85 c h);
|
|
68
|
-
--color-sk-accent-30: oklch(from var(--sk-accent-base) 0.80 c h);
|
|
69
|
-
--color-sk-accent-40: oklch(from var(--sk-accent-base) 0.75 c h);
|
|
70
|
-
--color-sk-accent-50: var(--sk-accent-base);
|
|
71
|
-
--color-sk-accent-60: oklch(from var(--sk-accent-base) calc(l * 0.85) c h);
|
|
72
|
-
--color-sk-accent-70: oklch(from var(--sk-accent-base) calc(l * 0.70) c h);
|
|
73
|
-
--color-sk-accent-80: oklch(from var(--sk-accent-base) calc(l * 0.55) c h);
|
|
74
|
-
--color-sk-accent-90: oklch(from var(--sk-accent-base) calc(l * 0.40) c h);
|
|
75
|
-
--color-sk-accent-95: oklch(from var(--sk-accent-base) calc(l * 0.25) c h);
|
|
76
|
-
|
|
77
|
-
/* Info */
|
|
78
|
-
--color-sk-info: var(--sk-info-base);
|
|
79
|
-
--color-sk-info-text: var(--sk-info-text);
|
|
80
|
-
--color-sk-info-5: oklch(from var(--sk-info-base) 0.95 c h);
|
|
81
|
-
--color-sk-info-10: oklch(from var(--sk-info-base) 0.90 c h);
|
|
82
|
-
--color-sk-info-20: oklch(from var(--sk-info-base) 0.85 c h);
|
|
83
|
-
--color-sk-info-30: oklch(from var(--sk-info-base) 0.80 c h);
|
|
84
|
-
--color-sk-info-40: oklch(from var(--sk-info-base) 0.75 c h);
|
|
85
|
-
--color-sk-info-50: var(--sk-info-base);
|
|
86
|
-
--color-sk-info-60: oklch(from var(--sk-info-base) calc(l * 0.85) c h);
|
|
87
|
-
--color-sk-info-70: oklch(from var(--sk-info-base) calc(l * 0.70) c h);
|
|
88
|
-
--color-sk-info-80: oklch(from var(--sk-info-base) calc(l * 0.55) c h);
|
|
89
|
-
--color-sk-info-90: oklch(from var(--sk-info-base) calc(l * 0.40) c h);
|
|
90
|
-
--color-sk-info-95: oklch(from var(--sk-info-base) calc(l * 0.25) c h);
|
|
91
|
-
|
|
92
|
-
/* Success */
|
|
93
|
-
--color-sk-success: var(--sk-success-base);
|
|
94
|
-
--color-sk-success-text: var(--sk-success-text);
|
|
95
|
-
--color-sk-success-5: oklch(from var(--sk-success-base) 0.95 c h);
|
|
96
|
-
--color-sk-success-10: oklch(from var(--sk-success-base) 0.90 c h);
|
|
97
|
-
--color-sk-success-20: oklch(from var(--sk-success-base) 0.85 c h);
|
|
98
|
-
--color-sk-success-30: oklch(from var(--sk-success-base) 0.80 c h);
|
|
99
|
-
--color-sk-success-40: oklch(from var(--sk-success-base) 0.75 c h);
|
|
100
|
-
--color-sk-success-50: var(--sk-success-base);
|
|
101
|
-
--color-sk-success-60: oklch(from var(--sk-success-base) calc(l * 0.85) c h);
|
|
102
|
-
--color-sk-success-70: oklch(from var(--sk-success-base) calc(l * 0.70) c h);
|
|
103
|
-
--color-sk-success-80: oklch(from var(--sk-success-base) calc(l * 0.55) c h);
|
|
104
|
-
--color-sk-success-90: oklch(from var(--sk-success-base) calc(l * 0.40) c h);
|
|
105
|
-
--color-sk-success-95: oklch(from var(--sk-success-base) calc(l * 0.25) c h);
|
|
106
|
-
|
|
107
|
-
/* Warning */
|
|
108
|
-
--color-sk-warning: var(--sk-warning-base);
|
|
109
|
-
--color-sk-warning-text: var(--sk-warning-text);
|
|
110
|
-
--color-sk-warning-5: oklch(from var(--sk-warning-base) 0.95 c h);
|
|
111
|
-
--color-sk-warning-10: oklch(from var(--sk-warning-base) 0.90 c h);
|
|
112
|
-
--color-sk-warning-20: oklch(from var(--sk-warning-base) 0.85 c h);
|
|
113
|
-
--color-sk-warning-30: oklch(from var(--sk-warning-base) 0.80 c h);
|
|
114
|
-
--color-sk-warning-40: oklch(from var(--sk-warning-base) 0.75 c h);
|
|
115
|
-
--color-sk-warning-50: var(--sk-warning-base);
|
|
116
|
-
--color-sk-warning-60: oklch(from var(--sk-warning-base) calc(l * 0.85) c h);
|
|
117
|
-
--color-sk-warning-70: oklch(from var(--sk-warning-base) calc(l * 0.70) c h);
|
|
118
|
-
--color-sk-warning-80: oklch(from var(--sk-warning-base) calc(l * 0.55) c h);
|
|
119
|
-
--color-sk-warning-90: oklch(from var(--sk-warning-base) calc(l * 0.40) c h);
|
|
120
|
-
--color-sk-warning-95: oklch(from var(--sk-warning-base) calc(l * 0.25) c h);
|
|
121
|
-
|
|
122
|
-
/* Danger */
|
|
123
|
-
--color-sk-danger: var(--sk-danger-base);
|
|
124
|
-
--color-sk-danger-text: var(--sk-danger-text);
|
|
125
|
-
--color-sk-danger-5: oklch(from var(--sk-danger-base) 0.95 c h);
|
|
126
|
-
--color-sk-danger-10: oklch(from var(--sk-danger-base) 0.90 c h);
|
|
127
|
-
--color-sk-danger-20: oklch(from var(--sk-danger-base) 0.85 c h);
|
|
128
|
-
--color-sk-danger-30: oklch(from var(--sk-danger-base) 0.80 c h);
|
|
129
|
-
--color-sk-danger-40: oklch(from var(--sk-danger-base) 0.75 c h);
|
|
130
|
-
--color-sk-danger-50: var(--sk-danger-base);
|
|
131
|
-
--color-sk-danger-60: oklch(from var(--sk-danger-base) calc(l * 0.85) c h);
|
|
132
|
-
--color-sk-danger-70: oklch(from var(--sk-danger-base) calc(l * 0.70) c h);
|
|
133
|
-
--color-sk-danger-80: oklch(from var(--sk-danger-base) calc(l * 0.55) c h);
|
|
134
|
-
--color-sk-danger-90: oklch(from var(--sk-danger-base) calc(l * 0.40) c h);
|
|
135
|
-
--color-sk-danger-95: oklch(from var(--sk-danger-base) calc(l * 0.25) c h);
|
|
136
|
-
|
|
137
|
-
/* Color Palette - Gray */
|
|
138
|
-
--color-sk-gray-5: var(--sk-color-gray-05);
|
|
139
|
-
--color-sk-gray-10: var(--sk-color-gray-10);
|
|
140
|
-
--color-sk-gray-20: var(--sk-color-gray-20);
|
|
141
|
-
--color-sk-gray-30: var(--sk-color-gray-30);
|
|
142
|
-
--color-sk-gray-40: var(--sk-color-gray-40);
|
|
143
|
-
--color-sk-gray-50: var(--sk-color-gray-50);
|
|
144
|
-
--color-sk-gray-60: var(--sk-color-gray-60);
|
|
145
|
-
--color-sk-gray-70: var(--sk-color-gray-70);
|
|
146
|
-
--color-sk-gray-80: var(--sk-color-gray-80);
|
|
147
|
-
--color-sk-gray-90: var(--sk-color-gray-90);
|
|
148
|
-
--color-sk-gray-95: var(--sk-color-gray-95);
|
|
149
|
-
|
|
150
|
-
/* Color Palette - Blue */
|
|
151
|
-
--color-sk-blue-5: var(--sk-color-blue-05);
|
|
152
|
-
--color-sk-blue-10: var(--sk-color-blue-10);
|
|
153
|
-
--color-sk-blue-20: var(--sk-color-blue-20);
|
|
154
|
-
--color-sk-blue-30: var(--sk-color-blue-30);
|
|
155
|
-
--color-sk-blue-40: var(--sk-color-blue-40);
|
|
156
|
-
--color-sk-blue-50: var(--sk-color-blue-50);
|
|
157
|
-
--color-sk-blue-60: var(--sk-color-blue-60);
|
|
158
|
-
--color-sk-blue-70: var(--sk-color-blue-70);
|
|
159
|
-
--color-sk-blue-80: var(--sk-color-blue-80);
|
|
160
|
-
--color-sk-blue-90: var(--sk-color-blue-90);
|
|
161
|
-
--color-sk-blue-95: var(--sk-color-blue-95);
|
|
162
|
-
|
|
163
|
-
/* Color Palette - Red */
|
|
164
|
-
--color-sk-red-5: var(--sk-color-red-05);
|
|
165
|
-
--color-sk-red-10: var(--sk-color-red-10);
|
|
166
|
-
--color-sk-red-20: var(--sk-color-red-20);
|
|
167
|
-
--color-sk-red-30: var(--sk-color-red-30);
|
|
168
|
-
--color-sk-red-40: var(--sk-color-red-40);
|
|
169
|
-
--color-sk-red-50: var(--sk-color-red-50);
|
|
170
|
-
--color-sk-red-60: var(--sk-color-red-60);
|
|
171
|
-
--color-sk-red-70: var(--sk-color-red-70);
|
|
172
|
-
--color-sk-red-80: var(--sk-color-red-80);
|
|
173
|
-
--color-sk-red-90: var(--sk-color-red-90);
|
|
174
|
-
--color-sk-red-95: var(--sk-color-red-95);
|
|
175
|
-
|
|
176
|
-
/* Color Palette - Orange */
|
|
177
|
-
--color-sk-orange-5: var(--sk-color-orange-05);
|
|
178
|
-
--color-sk-orange-10: var(--sk-color-orange-10);
|
|
179
|
-
--color-sk-orange-20: var(--sk-color-orange-20);
|
|
180
|
-
--color-sk-orange-30: var(--sk-color-orange-30);
|
|
181
|
-
--color-sk-orange-40: var(--sk-color-orange-40);
|
|
182
|
-
--color-sk-orange-50: var(--sk-color-orange-50);
|
|
183
|
-
--color-sk-orange-60: var(--sk-color-orange-60);
|
|
184
|
-
--color-sk-orange-70: var(--sk-color-orange-70);
|
|
185
|
-
--color-sk-orange-80: var(--sk-color-orange-80);
|
|
186
|
-
--color-sk-orange-90: var(--sk-color-orange-90);
|
|
187
|
-
--color-sk-orange-95: var(--sk-color-orange-95);
|
|
188
|
-
|
|
189
|
-
/* Color Palette - Yellow */
|
|
190
|
-
--color-sk-yellow-5: var(--sk-color-yellow-05);
|
|
191
|
-
--color-sk-yellow-10: var(--sk-color-yellow-10);
|
|
192
|
-
--color-sk-yellow-20: var(--sk-color-yellow-20);
|
|
193
|
-
--color-sk-yellow-30: var(--sk-color-yellow-30);
|
|
194
|
-
--color-sk-yellow-40: var(--sk-color-yellow-40);
|
|
195
|
-
--color-sk-yellow-50: var(--sk-color-yellow-50);
|
|
196
|
-
--color-sk-yellow-60: var(--sk-color-yellow-60);
|
|
197
|
-
--color-sk-yellow-70: var(--sk-color-yellow-70);
|
|
198
|
-
--color-sk-yellow-80: var(--sk-color-yellow-80);
|
|
199
|
-
--color-sk-yellow-90: var(--sk-color-yellow-90);
|
|
200
|
-
--color-sk-yellow-95: var(--sk-color-yellow-95);
|
|
201
|
-
|
|
202
|
-
/* Color Palette - Green */
|
|
203
|
-
--color-sk-green-5: var(--sk-color-green-05);
|
|
204
|
-
--color-sk-green-10: var(--sk-color-green-10);
|
|
205
|
-
--color-sk-green-20: var(--sk-color-green-20);
|
|
206
|
-
--color-sk-green-30: var(--sk-color-green-30);
|
|
207
|
-
--color-sk-green-40: var(--sk-color-green-40);
|
|
208
|
-
--color-sk-green-50: var(--sk-color-green-50);
|
|
209
|
-
--color-sk-green-60: var(--sk-color-green-60);
|
|
210
|
-
--color-sk-green-70: var(--sk-color-green-70);
|
|
211
|
-
--color-sk-green-80: var(--sk-color-green-80);
|
|
212
|
-
--color-sk-green-90: var(--sk-color-green-90);
|
|
213
|
-
--color-sk-green-95: var(--sk-color-green-95);
|
|
214
|
-
|
|
215
|
-
/* Color Palette - Mint */
|
|
216
|
-
--color-sk-mint-5: var(--sk-color-mint-05);
|
|
217
|
-
--color-sk-mint-10: var(--sk-color-mint-10);
|
|
218
|
-
--color-sk-mint-20: var(--sk-color-mint-20);
|
|
219
|
-
--color-sk-mint-30: var(--sk-color-mint-30);
|
|
220
|
-
--color-sk-mint-40: var(--sk-color-mint-40);
|
|
221
|
-
--color-sk-mint-50: var(--sk-color-mint-50);
|
|
222
|
-
--color-sk-mint-60: var(--sk-color-mint-60);
|
|
223
|
-
--color-sk-mint-70: var(--sk-color-mint-70);
|
|
224
|
-
--color-sk-mint-80: var(--sk-color-mint-80);
|
|
225
|
-
--color-sk-mint-90: var(--sk-color-mint-90);
|
|
226
|
-
--color-sk-mint-95: var(--sk-color-mint-95);
|
|
227
|
-
|
|
228
|
-
/* Color Palette - Cyan */
|
|
229
|
-
--color-sk-cyan-5: var(--sk-color-cyan-05);
|
|
230
|
-
--color-sk-cyan-10: var(--sk-color-cyan-10);
|
|
231
|
-
--color-sk-cyan-20: var(--sk-color-cyan-20);
|
|
232
|
-
--color-sk-cyan-30: var(--sk-color-cyan-30);
|
|
233
|
-
--color-sk-cyan-40: var(--sk-color-cyan-40);
|
|
234
|
-
--color-sk-cyan-50: var(--sk-color-cyan-50);
|
|
235
|
-
--color-sk-cyan-60: var(--sk-color-cyan-60);
|
|
236
|
-
--color-sk-cyan-70: var(--sk-color-cyan-70);
|
|
237
|
-
--color-sk-cyan-80: var(--sk-color-cyan-80);
|
|
238
|
-
--color-sk-cyan-90: var(--sk-color-cyan-90);
|
|
239
|
-
--color-sk-cyan-95: var(--sk-color-cyan-95);
|
|
240
|
-
|
|
241
|
-
/* Color Palette - Purple */
|
|
242
|
-
--color-sk-purple-5: var(--sk-color-purple-05);
|
|
243
|
-
--color-sk-purple-10: var(--sk-color-purple-10);
|
|
244
|
-
--color-sk-purple-20: var(--sk-color-purple-20);
|
|
245
|
-
--color-sk-purple-30: var(--sk-color-purple-30);
|
|
246
|
-
--color-sk-purple-40: var(--sk-color-purple-40);
|
|
247
|
-
--color-sk-purple-50: var(--sk-color-purple-50);
|
|
248
|
-
--color-sk-purple-60: var(--sk-color-purple-60);
|
|
249
|
-
--color-sk-purple-70: var(--sk-color-purple-70);
|
|
250
|
-
--color-sk-purple-80: var(--sk-color-purple-80);
|
|
251
|
-
--color-sk-purple-90: var(--sk-color-purple-90);
|
|
252
|
-
--color-sk-purple-95: var(--sk-color-purple-95);
|
|
253
|
-
|
|
254
|
-
/* Color Palette - Pink */
|
|
255
|
-
--color-sk-pink-5: var(--sk-color-pink-05);
|
|
256
|
-
--color-sk-pink-10: var(--sk-color-pink-10);
|
|
257
|
-
--color-sk-pink-20: var(--sk-color-pink-20);
|
|
258
|
-
--color-sk-pink-30: var(--sk-color-pink-30);
|
|
259
|
-
--color-sk-pink-40: var(--sk-color-pink-40);
|
|
260
|
-
--color-sk-pink-50: var(--sk-color-pink-50);
|
|
261
|
-
--color-sk-pink-60: var(--sk-color-pink-60);
|
|
262
|
-
--color-sk-pink-70: var(--sk-color-pink-70);
|
|
263
|
-
--color-sk-pink-80: var(--sk-color-pink-80);
|
|
264
|
-
--color-sk-pink-90: var(--sk-color-pink-90);
|
|
265
|
-
--color-sk-pink-95: var(--sk-color-pink-95);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
//----------------------------------------------------------------------------------------------------------------------
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
2
|
+
// Shared Corner Type
|
|
3
|
+
//
|
|
4
|
+
// Used by any component that supports per-corner bevel control (SkPanel, SkInputGroup, and the
|
|
5
|
+
// runtime-controllable form components SkInput / SkButton / SkSelect / SkNumberInput).
|
|
6
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
7
|
+
|
|
8
|
+
export type SkCorner = 'top-left' | 'top-right' | 'bottom-right' | 'bottom-left';
|
|
9
|
+
|
|
10
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
2
|
+
// Slot Utilities Tests
|
|
3
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
4
|
+
|
|
5
|
+
import { describe, expect, it } from 'vitest';
|
|
6
|
+
import { defineComponent, h, useSlots } from 'vue';
|
|
7
|
+
import { mount } from '@vue/test-utils';
|
|
8
|
+
|
|
9
|
+
import { hasSlotContent } from './slots';
|
|
10
|
+
|
|
11
|
+
//----------------------------------------------------------------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
describe('hasSlotContent', () =>
|
|
14
|
+
{
|
|
15
|
+
it('returns false when the slot is undefined', () =>
|
|
16
|
+
{
|
|
17
|
+
expect(hasSlotContent(undefined)).toBe(false);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('returns true for a slot that renders text content', () =>
|
|
21
|
+
{
|
|
22
|
+
const Probe = defineComponent({
|
|
23
|
+
setup()
|
|
24
|
+
{
|
|
25
|
+
const slots = useSlots();
|
|
26
|
+
return () => h('div', { 'data-has': hasSlotContent(slots.default) ? 'yes' : 'no' });
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const wrapper = mount(Probe, {
|
|
31
|
+
slots: { default: () => 'hello' },
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
expect(wrapper.attributes('data-has')).toBe('yes');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('returns false for a slot that only renders comments', () =>
|
|
38
|
+
{
|
|
39
|
+
const Probe = defineComponent({
|
|
40
|
+
setup()
|
|
41
|
+
{
|
|
42
|
+
const slots = useSlots();
|
|
43
|
+
return () => h('div', { 'data-has': hasSlotContent(slots.default) ? 'yes' : 'no' });
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const wrapper = mount(Probe, {
|
|
48
|
+
slots: { default: '<!-- nothing -->' },
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
expect(wrapper.attributes('data-has')).toBe('no');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('does not throw when a scoped slot destructures props and is called without props', () =>
|
|
55
|
+
{
|
|
56
|
+
// Reproduces the SkModal bug: consumer writes `<template #footer="{ close }">` and
|
|
57
|
+
// hasSlotContent invokes the slot with no args. Vue compiles destructuring like
|
|
58
|
+
// `(slotProps) => { const { close } = slotProps; ... }`, which throws if slotProps
|
|
59
|
+
// is undefined.
|
|
60
|
+
|
|
61
|
+
const Consumer = defineComponent({
|
|
62
|
+
components: {
|
|
63
|
+
Probe: defineComponent({
|
|
64
|
+
setup()
|
|
65
|
+
{
|
|
66
|
+
const slots = useSlots();
|
|
67
|
+
return () => h('div', {
|
|
68
|
+
'data-has-footer': hasSlotContent(slots.footer) ? 'yes' : 'no',
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
}),
|
|
72
|
+
},
|
|
73
|
+
template: `
|
|
74
|
+
<Probe>
|
|
75
|
+
<template #footer="{ close }">
|
|
76
|
+
<button @click="close">Close</button>
|
|
77
|
+
</template>
|
|
78
|
+
</Probe>
|
|
79
|
+
`,
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
expect(() => mount(Consumer)).not.toThrow();
|
|
83
|
+
|
|
84
|
+
const wrapper = mount(Consumer);
|
|
85
|
+
expect(wrapper.attributes('data-has-footer')).toBe('yes');
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
//----------------------------------------------------------------------------------------------------------------------
|
package/src/utils/slots.ts
CHANGED
|
@@ -43,7 +43,12 @@ export function hasRenderableContent(vnodes : VNode[]) : boolean
|
|
|
43
43
|
export function hasSlotContent(slot : SlotLike | undefined, props ?: Record<string, unknown>) : boolean
|
|
44
44
|
{
|
|
45
45
|
if(!slot) { return false; }
|
|
46
|
-
|
|
46
|
+
|
|
47
|
+
// Pass an object (not undefined) so scoped slots that destructure their props -- e.g.
|
|
48
|
+
// `<template #footer="{ close }">` -- don't throw "Cannot destructure property of undefined"
|
|
49
|
+
// during the content probe. Callers can still pass real props to drive `v-if` decisions
|
|
50
|
+
// inside the slot.
|
|
51
|
+
return hasRenderableContent(slot(props ?? {}) as VNode[]);
|
|
47
52
|
}
|
|
48
53
|
|
|
49
54
|
//----------------------------------------------------------------------------------------------------------------------
|