@skewedaspect/sleekspace-ui 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Dropdown/SkDropdown.vue.d.ts +9 -1
- package/dist/components/Dropdown/types.d.ts +2 -1
- package/dist/components/NavBar/SkNavBar.vue.d.ts +9 -1
- package/dist/components/NavBar/context.d.ts +2 -0
- package/dist/components/NavBar/types.d.ts +5 -1
- package/dist/components/Page/SkPage.vue.d.ts +9 -0
- package/dist/components/ScrollArea/SkScrollArea.vue.d.ts +105 -4
- package/dist/composables/useCustomColors.d.ts +18 -56
- package/{src → dist}/global.d.ts +6 -2
- package/dist/sleekspace-ui.css +4253 -1251
- package/dist/sleekspace-ui.es.js +204 -109
- package/dist/sleekspace-ui.umd.js +204 -109
- package/dist/static/classes.d.ts +18 -0
- package/dist/static/components/alert.d.ts +12 -0
- package/dist/static/components/avatar.d.ts +9 -0
- package/dist/static/components/breadcrumbs.d.ts +6 -0
- package/dist/static/components/button.d.ts +13 -0
- package/dist/static/components/card.d.ts +5 -0
- package/dist/static/components/checkbox.d.ts +10 -0
- package/dist/static/components/colorPicker.d.ts +8 -0
- package/dist/static/components/divider.d.ts +8 -0
- package/dist/static/components/dropdown.d.ts +8 -0
- package/dist/static/components/field.d.ts +15 -0
- package/dist/static/components/group.d.ts +5 -0
- package/dist/static/components/input.d.ts +14 -0
- package/dist/static/components/navBar.d.ts +16 -0
- package/dist/static/components/numberInput.d.ts +15 -0
- package/dist/static/components/page.d.ts +9 -0
- package/dist/static/components/pagination.d.ts +5 -0
- package/dist/static/components/panel.d.ts +11 -0
- package/dist/static/components/progress.d.ts +9 -0
- package/dist/static/components/radio.d.ts +11 -0
- package/dist/static/components/select.d.ts +10 -0
- package/dist/static/components/sidebar.d.ts +9 -0
- package/dist/static/components/skeleton.d.ts +11 -0
- package/dist/static/components/slider.d.ts +12 -0
- package/dist/static/components/spinner.d.ts +12 -0
- package/dist/static/components/switchInput.d.ts +10 -0
- package/dist/static/components/table.d.ts +12 -0
- package/dist/static/components/tag.d.ts +8 -0
- package/dist/static/components/tagsInput.d.ts +7 -0
- package/dist/static/components/textarea.d.ts +12 -0
- package/dist/static/components/toolbar.d.ts +12 -0
- package/dist/static/components/tooltip.d.ts +7 -0
- package/dist/static/escape.d.ts +2 -0
- package/dist/static/index.cjs.js +1 -0
- package/dist/static/index.d.ts +68 -0
- package/dist/static/index.es.js +732 -0
- package/dist/static/render.d.ts +12 -0
- package/dist/static/specs.d.ts +2 -0
- package/dist/static/types.d.ts +43 -0
- package/dist/tokens.css +322 -0
- package/dist/types/index.d.ts +36 -0
- package/docs/guides/installation.md +8 -2
- package/docs/guides/pure-css/_meta.yaml +8 -0
- package/docs/guides/pure-css/class-api.md +1070 -0
- package/docs/guides/pure-css/custom-elements.md +574 -0
- package/docs/guides/pure-css/index.md +86 -0
- package/docs/guides/pure-css/limitations.md +152 -0
- package/docs/guides/pure-css/static-helpers.md +1203 -0
- package/llms-full.txt +3736 -261
- package/package.json +16 -5
- package/src/components/Card/SkCard.vue +1 -0
- package/src/components/ContextMenu/SkContextMenuRadioGroup.vue +4 -1
- package/src/components/Dropdown/SkDropdown.vue +20 -3
- package/src/components/Dropdown/SkDropdownRadioGroup.vue +4 -1
- package/src/components/Dropdown/types.ts +2 -1
- package/src/components/NavBar/SkNavBar.vue +14 -4
- package/src/components/NavBar/context.ts +4 -2
- package/src/components/NavBar/types.ts +6 -1
- package/src/components/Page/SkPage.vue +11 -0
- package/src/components/Panel/SkPanel.vue +2 -1
- package/src/components/ScrollArea/SkScrollArea.vue +78 -5
- package/src/components/TreeView/SkTreeView.vue +7 -2
- package/src/composables/useCustomColors.ts +86 -77
- package/src/composables/usePortalContext.test.ts +0 -2
- package/src/shims.d.ts +10 -0
- package/src/static/__tests__/parity.test.ts +717 -0
- package/src/static/__tests__/parityHarness.test.ts +98 -0
- package/src/static/__tests__/parityHarness.ts +260 -0
- package/src/static/classes.test.ts +82 -0
- package/src/static/classes.ts +111 -0
- package/src/static/components/__tests__/helpers.test.ts +837 -0
- package/src/static/components/alert.ts +117 -0
- package/src/static/components/avatar.ts +86 -0
- package/src/static/components/breadcrumbs.ts +28 -0
- package/src/static/components/button.ts +75 -0
- package/src/static/components/card.ts +27 -0
- package/src/static/components/checkbox.ts +48 -0
- package/src/static/components/colorPicker.ts +45 -0
- package/src/static/components/divider.ts +39 -0
- package/src/static/components/dropdown.ts +36 -0
- package/src/static/components/field.ts +86 -0
- package/src/static/components/group.ts +27 -0
- package/src/static/components/input.ts +55 -0
- package/src/static/components/navBar.ts +94 -0
- package/src/static/components/numberInput.ts +64 -0
- package/src/static/components/page.ts +31 -0
- package/src/static/components/pagination.ts +27 -0
- package/src/static/components/panel.ts +33 -0
- package/src/static/components/progress.ts +31 -0
- package/src/static/components/radio.ts +53 -0
- package/src/static/components/select.ts +51 -0
- package/src/static/components/sidebar.ts +85 -0
- package/src/static/components/skeleton.ts +66 -0
- package/src/static/components/slider.ts +50 -0
- package/src/static/components/spinner.ts +94 -0
- package/src/static/components/switchInput.ts +49 -0
- package/src/static/components/table.ts +88 -0
- package/src/static/components/tag.ts +76 -0
- package/src/static/components/tagsInput.ts +35 -0
- package/src/static/components/textarea.ts +53 -0
- package/src/static/components/toolbar.ts +74 -0
- package/src/static/components/tooltip.ts +29 -0
- package/src/static/escape.test.ts +53 -0
- package/src/static/escape.ts +28 -0
- package/src/static/generated/defaults.ts +378 -0
- package/src/static/generated/propTypes.ts +425 -0
- package/src/static/index.ts +116 -0
- package/src/static/render.test.ts +83 -0
- package/src/static/render.ts +76 -0
- package/src/static/specs.test.ts +58 -0
- package/src/static/specs.ts +230 -0
- package/src/static/types.ts +176 -0
- package/src/styles/__tests__/testHelpers.ts +97 -0
- package/src/styles/base/_custom-elements.scss +51 -0
- package/src/styles/base/_index.scss +4 -0
- package/src/styles/components/__tests__/componentSelectors.test.ts +2575 -0
- package/src/styles/components/_alert.scss +82 -39
- package/src/styles/components/_avatar.scss +102 -47
- package/src/styles/components/_breadcrumbs.scss +39 -37
- package/src/styles/components/_button.scss +58 -5
- package/src/styles/components/_card.scss +64 -2
- package/src/styles/components/_checkbox.scss +35 -5
- package/src/styles/components/_color-picker.scss +48 -13
- package/src/styles/components/_divider.scss +86 -52
- package/src/styles/components/_dropdown.scss +214 -0
- package/src/styles/components/_field.scss +76 -23
- package/src/styles/components/_group.scss +190 -79
- package/src/styles/components/_index.scss +1 -0
- package/src/styles/components/_input.scss +81 -5
- package/src/styles/components/_menu.scss +1 -1
- package/src/styles/components/_navbar.scss +76 -45
- package/src/styles/components/_number-input.scss +88 -83
- package/src/styles/components/_page.scss +82 -23
- package/src/styles/components/_pagination.scss +240 -212
- package/src/styles/components/_panel.scss +268 -122
- package/src/styles/components/_progress.scss +120 -70
- package/src/styles/components/_radio.scss +35 -5
- package/src/styles/components/_scroll-area.scss +50 -22
- package/src/styles/components/_select.scss +40 -9
- package/src/styles/components/_sidebar.scss +59 -34
- package/src/styles/components/_skeleton.scss +111 -65
- package/src/styles/components/_slider.scss +34 -10
- package/src/styles/components/_spinner.scss +107 -56
- package/src/styles/components/_switch.scss +36 -5
- package/src/styles/components/_table.scss +150 -166
- package/src/styles/components/_tag.scss +244 -154
- package/src/styles/components/_tags-input.scss +46 -12
- package/src/styles/components/_textarea.scss +36 -5
- package/src/styles/components/_toolbar.scss +85 -31
- package/src/styles/components/_tooltip.scss +172 -3
- package/src/styles/mixins/_cut-border.scss +18 -4
- package/src/styles/mixins/_dual-selector.scss +192 -0
- package/src/styles/mixins/_index.scss +1 -0
- package/src/styles/mixins/dualSelector.test.ts +151 -0
- package/src/styles/themes/_colorful.scss +25 -0
- package/src/styles/themes/_greyscale.scss +25 -0
- package/src/styles/themes/_shade-scale.scss +39 -0
- package/src/styles/tokens/_semantic-color-kinds.scss +66 -0
- package/src/{types.ts → types/index.ts} +19 -11
- package/web-types.json +970 -137
- package/dist/composables/useCustomColors.test.d.ts +0 -1
- package/dist/composables/useFocusTrap.test.d.ts +0 -1
- package/dist/composables/usePortalContext.test.d.ts +0 -1
- package/dist/styles/mixins/fluidSize.test.d.ts +0 -1
- package/dist/types.d.ts +0 -29
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentCustomColors } from '../../types';
|
|
2
|
-
import { SkDropdownAlign, SkDropdownKind, SkDropdownSide } from './types';
|
|
2
|
+
import { SkDropdownAlign, SkDropdownKind, SkDropdownSide, SkDropdownSize } from './types';
|
|
3
3
|
export interface SkDropdownComponentProps extends ComponentCustomColors {
|
|
4
4
|
/**
|
|
5
5
|
* Semantic color kind that controls the menu's accent colors for hover states and
|
|
@@ -36,6 +36,13 @@ export interface SkDropdownComponentProps extends ComponentCustomColors {
|
|
|
36
36
|
* @default 4
|
|
37
37
|
*/
|
|
38
38
|
sideOffset?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Size of the default trigger button. When omitted and the dropdown is rendered inside
|
|
41
|
+
* an SkNavBar, falls back to the navbar's `size` prop so the trigger naturally matches
|
|
42
|
+
* surrounding nav controls. Ignored when the `trigger` slot is used.
|
|
43
|
+
* @default 'md' (or navbar size when nested in an SkNavBar)
|
|
44
|
+
*/
|
|
45
|
+
size?: SkDropdownSize;
|
|
39
46
|
}
|
|
40
47
|
declare function __VLS_template(): {
|
|
41
48
|
attrs: Partial<{}>;
|
|
@@ -49,6 +56,7 @@ declare function __VLS_template(): {
|
|
|
49
56
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
50
57
|
declare const __VLS_component: import('vue').DefineComponent<SkDropdownComponentProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SkDropdownComponentProps> & Readonly<{}>, {
|
|
51
58
|
kind: SkDropdownKind;
|
|
59
|
+
size: SkDropdownSize;
|
|
52
60
|
triggerText: string;
|
|
53
61
|
side: SkDropdownSide;
|
|
54
62
|
sideOffset: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ComponentKind } from '../../types';
|
|
1
|
+
import { ComponentKind, ComponentSize } from '../../types';
|
|
2
2
|
export type SkDropdownKind = ComponentKind;
|
|
3
|
+
export type SkDropdownSize = ComponentSize;
|
|
3
4
|
export type SkDropdownSide = 'top' | 'right' | 'bottom' | 'left';
|
|
4
5
|
export type SkDropdownAlign = 'start' | 'center' | 'end';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SkNavBarKind } from './types';
|
|
1
|
+
import { SkNavBarKind, SkNavBarSize } from './types';
|
|
2
2
|
import { ComponentCustomColors } from '../../types';
|
|
3
3
|
export interface SkNavBarComponentProps extends ComponentCustomColors {
|
|
4
4
|
/**
|
|
@@ -15,6 +15,13 @@ export interface SkNavBarComponentProps extends ComponentCustomColors {
|
|
|
15
15
|
* @default true
|
|
16
16
|
*/
|
|
17
17
|
sticky?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Default size for descendant components (buttons, dropdowns, sidebar toggles, etc.) that
|
|
20
|
+
* read the navbar context. Picks a size that fits the navbar's 4rem height without
|
|
21
|
+
* overflowing. Descendants can still override with their own `size` prop.
|
|
22
|
+
* @default 'md'
|
|
23
|
+
*/
|
|
24
|
+
size?: SkNavBarSize;
|
|
18
25
|
}
|
|
19
26
|
declare function __VLS_template(): {
|
|
20
27
|
attrs: Partial<{}>;
|
|
@@ -30,6 +37,7 @@ declare function __VLS_template(): {
|
|
|
30
37
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
31
38
|
declare const __VLS_component: import('vue').DefineComponent<SkNavBarComponentProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SkNavBarComponentProps> & Readonly<{}>, {
|
|
32
39
|
kind: SkNavBarKind;
|
|
40
|
+
size: SkNavBarSize;
|
|
33
41
|
sticky: boolean;
|
|
34
42
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
35
43
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { InjectionKey, Ref } from 'vue';
|
|
2
|
+
import { ComponentSize } from '../../types';
|
|
2
3
|
import { SkNavBarKind } from './types';
|
|
3
4
|
export declare const NAVBAR_KIND_KEY: InjectionKey<Ref<SkNavBarKind>>;
|
|
5
|
+
export declare const NAVBAR_SIZE_KEY: InjectionKey<Ref<ComponentSize>>;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { ComponentKind } from '../../types';
|
|
1
|
+
import { ComponentKind, ComponentSize } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Available kinds for the navbar component.
|
|
4
4
|
* Supports both semantic kinds (themeable) and color kinds (direct palette access).
|
|
5
5
|
*/
|
|
6
6
|
export type SkNavBarKind = ComponentKind;
|
|
7
|
+
/**
|
|
8
|
+
* Size hint propagated to descendant controls (buttons, dropdowns, sidebar toggles).
|
|
9
|
+
*/
|
|
10
|
+
export type SkNavBarSize = ComponentSize;
|
|
@@ -66,6 +66,14 @@ export interface SkPageComponentProps {
|
|
|
66
66
|
* @default false
|
|
67
67
|
*/
|
|
68
68
|
flush?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* When true, disables the bouncy overscroll / rubber-band effect on the page's scroll
|
|
71
|
+
* containers (main content, sidebar body, aside body). Applies `overscroll-behavior: none`
|
|
72
|
+
* to every scrollable region owned by SkPage. Note: the document-level bounce from scrolling
|
|
73
|
+
* the page itself (outside SkPage's containers) can only be killed on `html`/`body`.
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
noBounce?: boolean;
|
|
69
77
|
}
|
|
70
78
|
declare function __VLS_template(): {
|
|
71
79
|
attrs: Partial<{}>;
|
|
@@ -147,6 +155,7 @@ declare const __VLS_component: import('vue').DefineComponent<SkPageComponentProp
|
|
|
147
155
|
sidebarOpen: boolean;
|
|
148
156
|
asideOpen: boolean;
|
|
149
157
|
flush: boolean;
|
|
158
|
+
noBounce: boolean;
|
|
150
159
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
151
160
|
rootRef: HTMLDivElement;
|
|
152
161
|
sidebarDrawerRef: HTMLElement;
|
|
@@ -7,9 +7,10 @@ export interface SkScrollAreaComponentProps {
|
|
|
7
7
|
textColor?: string;
|
|
8
8
|
/**
|
|
9
9
|
* When true, fade the scrollable edges with a CSS mask so content visibly tapers
|
|
10
|
-
* into/out of the viewport.
|
|
10
|
+
* into/out of the viewport. Only edges with more content to scroll toward get the
|
|
11
|
+
* fade -- the top fade disappears at scrollTop=0, bottom fade at scroll end, etc.
|
|
11
12
|
* Override the fade distance via the `--sk-scroll-area-fade` custom property
|
|
12
|
-
* (default
|
|
13
|
+
* (default 1rem).
|
|
13
14
|
* @default false
|
|
14
15
|
*/
|
|
15
16
|
fade?: boolean;
|
|
@@ -19,7 +20,57 @@ declare function __VLS_template(): {
|
|
|
19
20
|
slots: {
|
|
20
21
|
default?(_: {}): any;
|
|
21
22
|
};
|
|
22
|
-
refs: {
|
|
23
|
+
refs: {
|
|
24
|
+
viewportRef: ({
|
|
25
|
+
$: import('vue').ComponentInternalInstance;
|
|
26
|
+
$data: {};
|
|
27
|
+
$props: {
|
|
28
|
+
readonly nonce?: string | undefined;
|
|
29
|
+
readonly asChild?: boolean | undefined;
|
|
30
|
+
readonly as?: (import('reka-ui').AsTag | import('vue').Component) | undefined;
|
|
31
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
32
|
+
$attrs: import('vue').Attrs;
|
|
33
|
+
$refs: {
|
|
34
|
+
[x: string]: unknown;
|
|
35
|
+
};
|
|
36
|
+
$slots: Readonly<{
|
|
37
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
40
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
41
|
+
$host: Element | null;
|
|
42
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
43
|
+
$el: any;
|
|
44
|
+
$options: import('vue').ComponentOptionsBase<Readonly<import('reka-ui').ScrollAreaViewportProps> & Readonly<{}>, {
|
|
45
|
+
viewportElement: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
46
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
47
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
48
|
+
created?: (() => void) | (() => void)[];
|
|
49
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
50
|
+
mounted?: (() => void) | (() => void)[];
|
|
51
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
52
|
+
updated?: (() => void) | (() => void)[];
|
|
53
|
+
activated?: (() => void) | (() => void)[];
|
|
54
|
+
deactivated?: (() => void) | (() => void)[];
|
|
55
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
56
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
57
|
+
destroyed?: (() => void) | (() => void)[];
|
|
58
|
+
unmounted?: (() => void) | (() => void)[];
|
|
59
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
60
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
61
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
62
|
+
};
|
|
63
|
+
$forceUpdate: () => void;
|
|
64
|
+
$nextTick: typeof import('vue').nextTick;
|
|
65
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
66
|
+
} & Readonly<{}> & Omit<Readonly<import('reka-ui').ScrollAreaViewportProps> & Readonly<{}>, "viewportElement"> & {
|
|
67
|
+
viewportElement: HTMLElement | undefined;
|
|
68
|
+
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
69
|
+
$slots: {
|
|
70
|
+
default?: (props: {}) => any;
|
|
71
|
+
};
|
|
72
|
+
}) | null;
|
|
73
|
+
};
|
|
23
74
|
rootEl: any;
|
|
24
75
|
};
|
|
25
76
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
@@ -30,7 +81,57 @@ declare const __VLS_component: import('vue').DefineComponent<SkScrollAreaCompone
|
|
|
30
81
|
textColor: string;
|
|
31
82
|
orientation: SkScrollAreaOrientation;
|
|
32
83
|
fade: boolean;
|
|
33
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
84
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
85
|
+
viewportRef: ({
|
|
86
|
+
$: import('vue').ComponentInternalInstance;
|
|
87
|
+
$data: {};
|
|
88
|
+
$props: {
|
|
89
|
+
readonly nonce?: string | undefined;
|
|
90
|
+
readonly asChild?: boolean | undefined;
|
|
91
|
+
readonly as?: (import('reka-ui').AsTag | import('vue').Component) | undefined;
|
|
92
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
93
|
+
$attrs: import('vue').Attrs;
|
|
94
|
+
$refs: {
|
|
95
|
+
[x: string]: unknown;
|
|
96
|
+
};
|
|
97
|
+
$slots: Readonly<{
|
|
98
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
99
|
+
}>;
|
|
100
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
101
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
102
|
+
$host: Element | null;
|
|
103
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
104
|
+
$el: any;
|
|
105
|
+
$options: import('vue').ComponentOptionsBase<Readonly<import('reka-ui').ScrollAreaViewportProps> & Readonly<{}>, {
|
|
106
|
+
viewportElement: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
107
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
108
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
109
|
+
created?: (() => void) | (() => void)[];
|
|
110
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
111
|
+
mounted?: (() => void) | (() => void)[];
|
|
112
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
113
|
+
updated?: (() => void) | (() => void)[];
|
|
114
|
+
activated?: (() => void) | (() => void)[];
|
|
115
|
+
deactivated?: (() => void) | (() => void)[];
|
|
116
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
117
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
118
|
+
destroyed?: (() => void) | (() => void)[];
|
|
119
|
+
unmounted?: (() => void) | (() => void)[];
|
|
120
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
121
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
122
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
123
|
+
};
|
|
124
|
+
$forceUpdate: () => void;
|
|
125
|
+
$nextTick: typeof import('vue').nextTick;
|
|
126
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
127
|
+
} & Readonly<{}> & Omit<Readonly<import('reka-ui').ScrollAreaViewportProps> & Readonly<{}>, "viewportElement"> & {
|
|
128
|
+
viewportElement: HTMLElement | undefined;
|
|
129
|
+
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
130
|
+
$slots: {
|
|
131
|
+
default?: (props: {}) => any;
|
|
132
|
+
};
|
|
133
|
+
}) | null;
|
|
134
|
+
}, any>;
|
|
34
135
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
35
136
|
export default _default;
|
|
36
137
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -2,73 +2,35 @@ import { Ref } from 'vue';
|
|
|
2
2
|
/**
|
|
3
3
|
* Composable for handling custom color props in components.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Generates CSS custom properties that override a component's default color tokens. Props accept
|
|
6
|
+
* either a kind name (e.g. `"neon-pink"`, `"primary"`), which resolves to the matching
|
|
7
|
+
* `--sk-<kind>-base/-text` token, or any raw CSS color value (hex, rgb, oklch, named, or
|
|
8
|
+
* `var(...)`), which is passed through unchanged. This lets consumers use SleekSpace's palette
|
|
9
|
+
* by name without having to remember the token syntax.
|
|
8
10
|
*
|
|
9
11
|
* Works with any component that follows the CSS variable naming convention:
|
|
10
12
|
* - `--sk-{componentName}-color-base` for the base/background color
|
|
11
13
|
* - `--sk-{componentName}-fg` for the foreground/text color
|
|
14
|
+
* - `--sk-{componentName}-border-base` / `--sk-{componentName}-border-color` for the border (optional)
|
|
12
15
|
*
|
|
13
|
-
* @param componentName - The component name used in CSS variable naming
|
|
14
|
-
*
|
|
15
|
-
* @param
|
|
16
|
-
*
|
|
16
|
+
* @param componentName - The component name used in CSS variable naming (e.g., 'button', 'panel')
|
|
17
|
+
* @param baseColor - Kind name or CSS color value for the base/background color
|
|
18
|
+
* @param textColor - Kind name or CSS color value for the foreground/text color. Falls back to
|
|
19
|
+
* `--sk-neutral-text` when only `baseColor` is provided.
|
|
20
|
+
* @param borderColor - Optional kind name or CSS color value for the border. When provided,
|
|
21
|
+
* both `--sk-<component>-border-base` and `--sk-<component>-border-color`
|
|
22
|
+
* are emitted so the border takes precedence over any kind's default.
|
|
17
23
|
*
|
|
18
24
|
* @returns Computed style object with CSS variables ready to bind to a component's style attribute
|
|
19
25
|
*
|
|
20
|
-
* @example
|
|
26
|
+
* @example Kind name shortcut
|
|
21
27
|
* ```vue
|
|
22
|
-
* <
|
|
23
|
-
* import { useCustomColors } from '@/composables/useCustomColors';
|
|
24
|
-
*
|
|
25
|
-
* const props = defineProps<{ baseColor?: string }>();
|
|
26
|
-
* const customColors = useCustomColors('button', toRef(() => props.baseColor), undefined);
|
|
27
|
-
* </script>
|
|
28
|
-
*
|
|
29
|
-
* <template>
|
|
30
|
-
* <button :style="customColors">Click me</button>
|
|
31
|
-
* </template>
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* @example With both base and text colors
|
|
35
|
-
* ```vue
|
|
36
|
-
* <SkButton base-color="oklch(0.7 0.25 300)" text-color="white">
|
|
37
|
-
* Custom Purple Button
|
|
38
|
-
* </SkButton>
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* @example Using CSS variables
|
|
42
|
-
* ```vue
|
|
43
|
-
* <SkPanel base-color="var(--my-custom-color)" text-color="var(--my-text-color)">
|
|
44
|
-
* Content
|
|
45
|
-
* </SkPanel>
|
|
28
|
+
* <SkPanel base-color="neon-pink" text-color="primary" border-color="neon-purple">...</SkPanel>
|
|
46
29
|
* ```
|
|
47
30
|
*
|
|
48
|
-
* @example
|
|
31
|
+
* @example Raw CSS values
|
|
49
32
|
* ```vue
|
|
50
|
-
* <
|
|
51
|
-
* import { useCustomColors } from '@/composables/useCustomColors';
|
|
52
|
-
*
|
|
53
|
-
* const props = defineProps<{ baseColor?: string; textColor?: string }>();
|
|
54
|
-
* const customColors = useCustomColors('my-widget', toRef(() => props.baseColor), toRef(() => props.textColor));
|
|
55
|
-
* </script>
|
|
56
|
-
*
|
|
57
|
-
* <template>
|
|
58
|
-
* <div class="my-widget" :style="customColors">
|
|
59
|
-
* <!-- Will generate: --sk-my-widget-color-base and --sk-my-widget-fg -->
|
|
60
|
-
* </div>
|
|
61
|
-
* </template>
|
|
33
|
+
* <SkButton base-color="oklch(0.7 0.25 300)" text-color="white">Click me</SkButton>
|
|
62
34
|
* ```
|
|
63
|
-
*
|
|
64
|
-
* Generated CSS variables:
|
|
65
|
-
* - `--sk-{componentName}-color-base` - The base color for backgrounds and accents
|
|
66
|
-
* - `--sk-{componentName}-fg` - The foreground/text color
|
|
67
|
-
*
|
|
68
|
-
* @remarks
|
|
69
|
-
* - If `textColor` is not provided, components will use `--sk-neutral-text` from the active theme
|
|
70
|
-
* - For best contrast, always provide `textColor` when using custom `baseColor`
|
|
71
|
-
* - The generated CSS variables integrate with the component's existing token system
|
|
72
|
-
* - Works with any component name - no need to register components beforehand
|
|
73
35
|
*/
|
|
74
|
-
export declare function useCustomColors(componentName: string, baseColor: Ref<string | undefined> | string | undefined, textColor: Ref<string | undefined> | string | undefined): Ref<Record<string, string>>;
|
|
36
|
+
export declare function useCustomColors(componentName: string, baseColor: Ref<string | undefined> | string | undefined, textColor: Ref<string | undefined> | string | undefined, borderColor?: Ref<string | undefined> | string | undefined): Ref<Record<string, string>>;
|
package/{src → dist}/global.d.ts
RENAMED
|
@@ -5,12 +5,16 @@
|
|
|
5
5
|
// Generated by: scripts/generate-global-types.ts
|
|
6
6
|
//
|
|
7
7
|
// This file provides TypeScript/Volar support for globally registered SleekSpace UI components.
|
|
8
|
-
//
|
|
8
|
+
// Consumers can opt in either by referencing the package export in a project .d.ts:
|
|
9
|
+
//
|
|
10
|
+
// /// <reference types="@skewedaspect/sleekspace-ui/global" />
|
|
11
|
+
//
|
|
12
|
+
// ...or by including the declaration file directly in tsconfig.json:
|
|
9
13
|
//
|
|
10
14
|
// {
|
|
11
15
|
// "include": [
|
|
12
16
|
// "src/**/*",
|
|
13
|
-
// "node_modules/@skewedaspect/sleekspace-ui/
|
|
17
|
+
// "node_modules/@skewedaspect/sleekspace-ui/dist/global.d.ts"
|
|
14
18
|
// ]
|
|
15
19
|
// }
|
|
16
20
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|