@stachelock/ui 0.6.14 → 0.6.16
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/BaseInformationInput-DmtT4C7P.js +4 -0
- package/dist/BaseInformationInput.vue_vue_type_script_setup_true_lang-B-qW4F69.js +154 -0
- package/dist/{DynamicForm.vue_vue_type_script_setup_true_lang-DMtVUXUN.js → DynamicForm.vue_vue_type_script_setup_true_lang-D8QXRuSo.js} +1 -1
- package/dist/{DynamicFormField.vue_vue_type_script_setup_true_lang-DSq31jjH.js → DynamicFormField.vue_vue_type_script_setup_true_lang-DVoVGq7g.js} +86 -38
- package/dist/NamesInput-DHs3Gie7.js +4 -0
- package/dist/NamesInput.vue_vue_type_script_setup_true_lang-BO54mB4C.js +195 -0
- package/dist/NavigationItem.vue_vue_type_script_setup_true_lang-a6F3LQ_P.js +56 -0
- package/dist/ScreenSizeSelector.vue_vue_type_script_setup_true_lang-FINxrVod.js +183 -0
- package/dist/UiMapAll.vue_vue_type_script_setup_true_lang-DKcK0HmT.js +501 -0
- package/dist/charts/BaseChart.js +76 -56
- package/dist/charts/chartTheme.js +199 -60
- package/dist/charts/index.js +30 -27
- package/dist/components/Button.js +109 -89
- package/dist/composables/index.js +41 -32
- package/dist/composables/useMap.js +1 -1
- package/dist/forms/DynamicForm.js +1 -1
- package/dist/forms/DynamicFormField.js +1 -1
- package/dist/index.js +2268 -1856
- package/dist/layouts/DashboardLayout.js +218 -2
- package/dist/layouts/NavigationItem.js +1 -1
- package/dist/maps/UiMap.js +167 -150
- package/dist/maps/UiMapAll.js +1 -1
- package/dist/maps/UiMapMarker.js +227 -118
- package/dist/maps/index.js +1 -1
- package/dist/src/components/UiProgressBar.d.ts +1 -1
- package/dist/src/components/UiRadialProgressBar.d.ts +1 -1
- package/dist/src/components/charts/chartTheme.d.ts +53 -0
- package/dist/src/components/formatters/DateFormatter.d.ts +1 -1
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/inputs/DatepickerInput.d.ts +4 -4
- package/dist/src/components/layouts/DashboardLayout.d.ts +80 -18
- package/dist/src/components/layouts/ShowcaseCard.d.ts +1 -0
- package/dist/src/components/layouts/UiDetailPanel.d.ts +65 -0
- package/dist/src/components/layouts/UiSplitPanelLayout.d.ts +96 -0
- package/dist/src/components/layouts/index.d.ts +2 -0
- package/dist/src/components/maps/UiMap.d.ts +13 -2
- package/dist/src/components/maps/UiMapAll.d.ts +13 -0
- package/dist/src/components/maps/UiMapMarker.d.ts +47 -10
- package/dist/src/components/modals/UiSlideOver.d.ts +104 -0
- package/dist/src/components/modals/index.d.ts +1 -0
- package/dist/src/components/palettes/UiCommandPalette.d.ts +166 -0
- package/dist/src/components/palettes/index.d.ts +1 -0
- package/dist/src/components/wrappers/BreakpointWrapper.d.ts +36 -0
- package/dist/src/components/wrappers/ResponsivePreviewWrapper.d.ts +85 -0
- package/dist/src/components/wrappers/ScreenSizeSelector.d.ts +74 -0
- package/dist/src/components/wrappers/index.d.ts +3 -0
- package/dist/src/composables/index.d.ts +1 -0
- package/dist/src/composables/useScreenSize.d.ts +131 -0
- package/dist/src/types/form.d.ts +24 -1
- package/dist/src/types/index.d.ts +1 -0
- package/dist/src/types/layouts.d.ts +42 -0
- package/dist/src/types/palettes.d.ts +134 -0
- package/dist/src/views/components/index.d.ts +2 -0
- package/dist/src/views/index.d.ts +5 -1
- package/dist/src/views/layouts/index.d.ts +3 -1
- package/dist/style.css +1 -1
- package/dist/useMap-CM59TKX6.js +318 -0
- package/dist/useScreenSize-Kr6cn5Zr.js +104 -0
- package/dist/wrappers/index.js +10 -6
- package/package.json +1 -1
- package/dist/DashboardLayout.vue_vue_type_script_setup_true_lang-BAx4gKqh.js +0 -239
- package/dist/NavigationItem.vue_vue_type_script_setup_true_lang-C8aX-84Q.js +0 -56
- package/dist/UiMapAll.vue_vue_type_script_setup_true_lang-11yT7mTH.js +0 -471
- package/dist/useMap-BGg0H582.js +0 -297
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { PropType, Component } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface CommandPaletteCommand {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: Component;
|
|
7
|
+
shortcut?: string;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface CommandPaletteCategory {
|
|
12
|
+
id: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
icon?: Component;
|
|
15
|
+
}
|
|
16
|
+
export interface CommandPaletteItem {
|
|
17
|
+
id?: string | number;
|
|
18
|
+
name?: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
avatar?: string;
|
|
22
|
+
initials?: string;
|
|
23
|
+
icon?: Component;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
items: {
|
|
32
|
+
type: PropType<CommandPaletteItem[]>;
|
|
33
|
+
default: () => never[];
|
|
34
|
+
};
|
|
35
|
+
commands: {
|
|
36
|
+
type: PropType<CommandPaletteCommand[]>;
|
|
37
|
+
default: () => never[];
|
|
38
|
+
};
|
|
39
|
+
categories: {
|
|
40
|
+
type: PropType<CommandPaletteCategory[]>;
|
|
41
|
+
default: () => never[];
|
|
42
|
+
};
|
|
43
|
+
placeholder: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
default: string;
|
|
46
|
+
};
|
|
47
|
+
loading: {
|
|
48
|
+
type: BooleanConstructor;
|
|
49
|
+
default: boolean;
|
|
50
|
+
};
|
|
51
|
+
showSearch: {
|
|
52
|
+
type: BooleanConstructor;
|
|
53
|
+
default: boolean;
|
|
54
|
+
};
|
|
55
|
+
emptyText: {
|
|
56
|
+
type: StringConstructor;
|
|
57
|
+
default: string;
|
|
58
|
+
};
|
|
59
|
+
activeCategory: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
default: string;
|
|
62
|
+
};
|
|
63
|
+
itemsLabel: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: string;
|
|
66
|
+
};
|
|
67
|
+
itemKey: {
|
|
68
|
+
type: StringConstructor;
|
|
69
|
+
default: string;
|
|
70
|
+
};
|
|
71
|
+
}>, {
|
|
72
|
+
focus: () => void | undefined;
|
|
73
|
+
blur: () => void | undefined;
|
|
74
|
+
searchInputRef: import('vue').Ref<HTMLInputElement | null, HTMLInputElement | null>;
|
|
75
|
+
contentRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
76
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
77
|
+
"update:modelValue": (value: string) => void;
|
|
78
|
+
select: (item: CommandPaletteItem) => void;
|
|
79
|
+
command: (command: CommandPaletteCommand) => void;
|
|
80
|
+
"category-change": (categoryId: string) => void;
|
|
81
|
+
search: (query: string) => void;
|
|
82
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
83
|
+
modelValue: {
|
|
84
|
+
type: StringConstructor;
|
|
85
|
+
default: string;
|
|
86
|
+
};
|
|
87
|
+
items: {
|
|
88
|
+
type: PropType<CommandPaletteItem[]>;
|
|
89
|
+
default: () => never[];
|
|
90
|
+
};
|
|
91
|
+
commands: {
|
|
92
|
+
type: PropType<CommandPaletteCommand[]>;
|
|
93
|
+
default: () => never[];
|
|
94
|
+
};
|
|
95
|
+
categories: {
|
|
96
|
+
type: PropType<CommandPaletteCategory[]>;
|
|
97
|
+
default: () => never[];
|
|
98
|
+
};
|
|
99
|
+
placeholder: {
|
|
100
|
+
type: StringConstructor;
|
|
101
|
+
default: string;
|
|
102
|
+
};
|
|
103
|
+
loading: {
|
|
104
|
+
type: BooleanConstructor;
|
|
105
|
+
default: boolean;
|
|
106
|
+
};
|
|
107
|
+
showSearch: {
|
|
108
|
+
type: BooleanConstructor;
|
|
109
|
+
default: boolean;
|
|
110
|
+
};
|
|
111
|
+
emptyText: {
|
|
112
|
+
type: StringConstructor;
|
|
113
|
+
default: string;
|
|
114
|
+
};
|
|
115
|
+
activeCategory: {
|
|
116
|
+
type: StringConstructor;
|
|
117
|
+
default: string;
|
|
118
|
+
};
|
|
119
|
+
itemsLabel: {
|
|
120
|
+
type: StringConstructor;
|
|
121
|
+
default: string;
|
|
122
|
+
};
|
|
123
|
+
itemKey: {
|
|
124
|
+
type: StringConstructor;
|
|
125
|
+
default: string;
|
|
126
|
+
};
|
|
127
|
+
}>> & Readonly<{
|
|
128
|
+
onSelect?: ((item: CommandPaletteItem) => any) | undefined;
|
|
129
|
+
onSearch?: ((query: string) => any) | undefined;
|
|
130
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
131
|
+
onCommand?: ((command: CommandPaletteCommand) => any) | undefined;
|
|
132
|
+
"onCategory-change"?: ((categoryId: string) => any) | undefined;
|
|
133
|
+
}>, {
|
|
134
|
+
placeholder: string;
|
|
135
|
+
loading: boolean;
|
|
136
|
+
modelValue: string;
|
|
137
|
+
items: CommandPaletteItem[];
|
|
138
|
+
itemKey: string;
|
|
139
|
+
commands: CommandPaletteCommand[];
|
|
140
|
+
categories: CommandPaletteCategory[];
|
|
141
|
+
showSearch: boolean;
|
|
142
|
+
emptyText: string;
|
|
143
|
+
activeCategory: string;
|
|
144
|
+
itemsLabel: string;
|
|
145
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
|
|
146
|
+
header?(_: {}): any;
|
|
147
|
+
"search-right"?(_: {}): any;
|
|
148
|
+
loading?(_: {}): any;
|
|
149
|
+
command?(_: {
|
|
150
|
+
command: CommandPaletteCommand;
|
|
151
|
+
active: boolean;
|
|
152
|
+
}): any;
|
|
153
|
+
item?(_: {
|
|
154
|
+
item: CommandPaletteItem;
|
|
155
|
+
active: boolean;
|
|
156
|
+
index: number;
|
|
157
|
+
}): any;
|
|
158
|
+
empty?(_: {}): any;
|
|
159
|
+
footer?(_: {}): any;
|
|
160
|
+
}>;
|
|
161
|
+
export default _default;
|
|
162
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
163
|
+
new (): {
|
|
164
|
+
$slots: S;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CommandPalette } from './UiCommandPalette';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { ScreenSize } from '../../composables/useScreenSize';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* BreakpointWrapper provides screen size context to child components via Vue's provide/inject.
|
|
6
|
+
*
|
|
7
|
+
* Child components can use `useScreenSizeContext()` to access the current breakpoint
|
|
8
|
+
* and render responsive content accordingly.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```vue
|
|
12
|
+
* <BreakpointWrapper size="md">
|
|
13
|
+
* <ResponsiveComponent />
|
|
14
|
+
* </BreakpointWrapper>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
18
|
+
/**
|
|
19
|
+
* The screen size to provide to child components
|
|
20
|
+
*/
|
|
21
|
+
size: {
|
|
22
|
+
type: PropType<ScreenSize>;
|
|
23
|
+
required: true;
|
|
24
|
+
validator: (value: string) => boolean;
|
|
25
|
+
};
|
|
26
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
27
|
+
/**
|
|
28
|
+
* The screen size to provide to child components
|
|
29
|
+
*/
|
|
30
|
+
size: {
|
|
31
|
+
type: PropType<ScreenSize>;
|
|
32
|
+
required: true;
|
|
33
|
+
validator: (value: string) => boolean;
|
|
34
|
+
};
|
|
35
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { ScreenSize } from '../../composables/useScreenSize';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ResponsivePreviewWrapper wraps content and applies width constraints
|
|
5
|
+
* based on the selected screen size. It also provides the BreakpointWrapper
|
|
6
|
+
* context so child components can respond to the simulated breakpoint.
|
|
7
|
+
*
|
|
8
|
+
* Use this component together with ScreenSizeSelector in your layout.
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* ScreenSizeSelector v-model="currentSize" :sizes="['sm', 'md', 'lg']"
|
|
12
|
+
* ResponsivePreviewWrapper :size="currentSize" -> YourComponent
|
|
13
|
+
*
|
|
14
|
+
* const currentSize = ref('lg');
|
|
15
|
+
*/
|
|
16
|
+
interface Props {
|
|
17
|
+
/**
|
|
18
|
+
* The screen size to simulate
|
|
19
|
+
*/
|
|
20
|
+
size: ScreenSize;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to show a border around the preview container
|
|
23
|
+
*/
|
|
24
|
+
showBorder?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Whether to center the preview container
|
|
27
|
+
*/
|
|
28
|
+
centered?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Custom background color for the preview container
|
|
31
|
+
*/
|
|
32
|
+
backgroundColor?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Enable transition animation when size changes
|
|
35
|
+
*/
|
|
36
|
+
animate?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Minimum height for the preview container
|
|
39
|
+
*/
|
|
40
|
+
minHeight?: string;
|
|
41
|
+
}
|
|
42
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
43
|
+
showBorder: boolean;
|
|
44
|
+
centered: boolean;
|
|
45
|
+
backgroundColor: string;
|
|
46
|
+
animate: boolean;
|
|
47
|
+
minHeight: string;
|
|
48
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
49
|
+
showBorder: boolean;
|
|
50
|
+
centered: boolean;
|
|
51
|
+
backgroundColor: string;
|
|
52
|
+
animate: boolean;
|
|
53
|
+
minHeight: string;
|
|
54
|
+
}>>> & Readonly<{}>, {
|
|
55
|
+
animate: boolean;
|
|
56
|
+
backgroundColor: string;
|
|
57
|
+
centered: boolean;
|
|
58
|
+
minHeight: string;
|
|
59
|
+
showBorder: boolean;
|
|
60
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
|
|
61
|
+
default?(_: {}): any;
|
|
62
|
+
}>;
|
|
63
|
+
export default _default;
|
|
64
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
65
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
66
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
67
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
68
|
+
} : {
|
|
69
|
+
type: import('vue').PropType<T[K]>;
|
|
70
|
+
required: true;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
type __VLS_WithDefaults<P, D> = {
|
|
74
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
75
|
+
default: D[K];
|
|
76
|
+
}> : P[K];
|
|
77
|
+
};
|
|
78
|
+
type __VLS_Prettify<T> = {
|
|
79
|
+
[K in keyof T]: T[K];
|
|
80
|
+
} & {};
|
|
81
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
82
|
+
new (): {
|
|
83
|
+
$slots: S;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ScreenSize } from '../../composables/useScreenSize';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ScreenSizeSelector provides a button group for selecting screen size breakpoints.
|
|
5
|
+
* Automatically hides sizes that can't be meaningfully previewed at the current window size.
|
|
6
|
+
*/
|
|
7
|
+
interface Props {
|
|
8
|
+
/**
|
|
9
|
+
* Currently selected screen size
|
|
10
|
+
*/
|
|
11
|
+
modelValue: ScreenSize;
|
|
12
|
+
/**
|
|
13
|
+
* Which sizes to display (defaults to all available based on window size)
|
|
14
|
+
*/
|
|
15
|
+
sizes?: ScreenSize[];
|
|
16
|
+
/**
|
|
17
|
+
* Visual theme
|
|
18
|
+
*/
|
|
19
|
+
theme?: 'light' | 'dark';
|
|
20
|
+
/**
|
|
21
|
+
* Whether to show text labels alongside icons
|
|
22
|
+
*/
|
|
23
|
+
showLabels?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Active button color (Tailwind text color class without prefix)
|
|
26
|
+
*/
|
|
27
|
+
activeColor?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Whether to automatically filter sizes based on window width
|
|
30
|
+
* When true, only shows sizes that can be previewed at the current window size
|
|
31
|
+
*/
|
|
32
|
+
autoFilter?: boolean;
|
|
33
|
+
}
|
|
34
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
35
|
+
sizes: () => string[];
|
|
36
|
+
theme: string;
|
|
37
|
+
showLabels: boolean;
|
|
38
|
+
activeColor: string;
|
|
39
|
+
autoFilter: boolean;
|
|
40
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
41
|
+
"update:modelValue": (value: ScreenSize) => void;
|
|
42
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
43
|
+
sizes: () => string[];
|
|
44
|
+
theme: string;
|
|
45
|
+
showLabels: boolean;
|
|
46
|
+
activeColor: string;
|
|
47
|
+
autoFilter: boolean;
|
|
48
|
+
}>>> & Readonly<{
|
|
49
|
+
"onUpdate:modelValue"?: ((value: ScreenSize) => any) | undefined;
|
|
50
|
+
}>, {
|
|
51
|
+
theme: "dark" | "light";
|
|
52
|
+
showLabels: boolean;
|
|
53
|
+
sizes: ScreenSize[];
|
|
54
|
+
activeColor: string;
|
|
55
|
+
autoFilter: boolean;
|
|
56
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
57
|
+
export default _default;
|
|
58
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
59
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
60
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
61
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
62
|
+
} : {
|
|
63
|
+
type: import('vue').PropType<T[K]>;
|
|
64
|
+
required: true;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
type __VLS_WithDefaults<P, D> = {
|
|
68
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
69
|
+
default: D[K];
|
|
70
|
+
}> : P[K];
|
|
71
|
+
};
|
|
72
|
+
type __VLS_Prettify<T> = {
|
|
73
|
+
[K in keyof T]: T[K];
|
|
74
|
+
} & {};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { default as BackgroundGradientWrapper } from './BackgroundGradientWrapper';
|
|
2
|
+
export { default as BreakpointWrapper } from './BreakpointWrapper';
|
|
2
3
|
export { default as CardWrapper } from './CardWrapper';
|
|
3
4
|
export { default as DisclosureWrapper } from './DisclosureWrapper';
|
|
4
5
|
export { default as FormErrorWrapper } from './FormErrorWrapper';
|
|
6
|
+
export { default as ResponsivePreviewWrapper } from './ResponsivePreviewWrapper';
|
|
7
|
+
export { default as ScreenSizeSelector } from './ScreenSizeSelector';
|
|
@@ -5,6 +5,7 @@ export * from './useFormValidation';
|
|
|
5
5
|
export * from './useMap';
|
|
6
6
|
export * from './useModal';
|
|
7
7
|
export * from './useNotifications';
|
|
8
|
+
export * from './useScreenSize';
|
|
8
9
|
export * from './useSimpleTabs';
|
|
9
10
|
export * from './useStringTransform';
|
|
10
11
|
export * from './useTabs';
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { Ref, InjectionKey } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Screen size breakpoint identifiers
|
|
5
|
+
*/
|
|
6
|
+
export type ScreenSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
7
|
+
/**
|
|
8
|
+
* Screen size breakpoint labels for display
|
|
9
|
+
*/
|
|
10
|
+
export type ScreenSizeLabel = 'Mobile' | 'Tablet' | 'Desktop' | 'Widescreen';
|
|
11
|
+
/**
|
|
12
|
+
* Screen size configuration with dimensions and labels
|
|
13
|
+
*/
|
|
14
|
+
export interface ScreenSizeConfig {
|
|
15
|
+
id: ScreenSize;
|
|
16
|
+
label: ScreenSizeLabel;
|
|
17
|
+
/** The minimum window width required to preview this size */
|
|
18
|
+
minWindowWidth: number;
|
|
19
|
+
/** The preview container width */
|
|
20
|
+
width: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Screen size configurations with breakpoints matching Tailwind defaults
|
|
24
|
+
* minWindowWidth indicates the minimum viewport needed to meaningfully preview this size
|
|
25
|
+
*/
|
|
26
|
+
export declare const screenSizeConfigs: ScreenSizeConfig[];
|
|
27
|
+
/**
|
|
28
|
+
* Injection key for screen size context
|
|
29
|
+
*/
|
|
30
|
+
export declare const ScreenSizeKey: InjectionKey<Ref<ScreenSize>>;
|
|
31
|
+
/**
|
|
32
|
+
* Detect current screen size based on window width
|
|
33
|
+
*/
|
|
34
|
+
export declare function detectScreenSize(): ScreenSize;
|
|
35
|
+
/**
|
|
36
|
+
* Get screen size config by id
|
|
37
|
+
*/
|
|
38
|
+
export declare function getScreenSizeConfig(size: ScreenSize): ScreenSizeConfig;
|
|
39
|
+
/**
|
|
40
|
+
* Get which preview sizes are available based on current window width
|
|
41
|
+
* Only shows sizes that are smaller than the current viewport
|
|
42
|
+
*/
|
|
43
|
+
export declare function getAvailablePreviewSizes(windowWidth: number): ScreenSize[];
|
|
44
|
+
/**
|
|
45
|
+
* Composable for detecting and tracking actual window/viewport size
|
|
46
|
+
*
|
|
47
|
+
* This is a tree-shakable utility that tracks the real browser window dimensions.
|
|
48
|
+
* Use this to make responsive decisions in your components.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* const { windowWidth, windowHeight, currentBreakpoint, isMobile, isTablet, isDesktop } = useWindowSize();
|
|
52
|
+
*/
|
|
53
|
+
export declare function useWindowSize(): {
|
|
54
|
+
windowWidth: Ref<number, number>;
|
|
55
|
+
windowHeight: Ref<number, number>;
|
|
56
|
+
currentBreakpoint: import('vue').ComputedRef<ScreenSize>;
|
|
57
|
+
isMobile: import('vue').ComputedRef<boolean>;
|
|
58
|
+
isTablet: import('vue').ComputedRef<boolean>;
|
|
59
|
+
isDesktop: import('vue').ComputedRef<boolean>;
|
|
60
|
+
isWidescreen: import('vue').ComputedRef<boolean>;
|
|
61
|
+
availablePreviewSizes: import('vue').ComputedRef<ScreenSize[]>;
|
|
62
|
+
canPreviewSize: (size: ScreenSize) => boolean;
|
|
63
|
+
updateDimensions: () => void;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Main composable for screen size management
|
|
67
|
+
*
|
|
68
|
+
* @param options Configuration options
|
|
69
|
+
* @returns Screen size state and utilities
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```vue
|
|
73
|
+
* <script setup>
|
|
74
|
+
* import { useScreenSize } from '@stachelock/ui';
|
|
75
|
+
*
|
|
76
|
+
* const {
|
|
77
|
+
* currentSize,
|
|
78
|
+
* setSize,
|
|
79
|
+
* previewStyle,
|
|
80
|
+
* isPreviewMode
|
|
81
|
+
* } = useScreenSize();
|
|
82
|
+
* </script>
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export declare function useScreenSize(options?: {
|
|
86
|
+
/**
|
|
87
|
+
* Initial size (defaults to detecting from window)
|
|
88
|
+
*/
|
|
89
|
+
initialSize?: ScreenSize;
|
|
90
|
+
/**
|
|
91
|
+
* Whether to track window resize (defaults to true)
|
|
92
|
+
*/
|
|
93
|
+
trackResize?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Whether this is for preview mode (manual size selection)
|
|
96
|
+
*/
|
|
97
|
+
previewMode?: boolean;
|
|
98
|
+
}): {
|
|
99
|
+
currentSize: import('vue').ComputedRef<ScreenSize>;
|
|
100
|
+
currentConfig: import('vue').ComputedRef<ScreenSizeConfig>;
|
|
101
|
+
isPreviewMode: import('vue').ComputedRef<boolean>;
|
|
102
|
+
detectedSize: Ref<ScreenSize, ScreenSize>;
|
|
103
|
+
setSize: (size: ScreenSize) => void;
|
|
104
|
+
resetToAuto: () => void;
|
|
105
|
+
updateDetectedSize: () => void;
|
|
106
|
+
provideScreenSize: () => void;
|
|
107
|
+
previewStyle: import('vue').ComputedRef<{
|
|
108
|
+
maxWidth: string;
|
|
109
|
+
width: string;
|
|
110
|
+
margin: string;
|
|
111
|
+
transition: string;
|
|
112
|
+
}>;
|
|
113
|
+
screenSizeConfigs: ScreenSizeConfig[];
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Inject screen size from parent BreakpointWrapper
|
|
117
|
+
*
|
|
118
|
+
* @param fallback Fallback size if not provided by parent
|
|
119
|
+
* @returns Reactive screen size ref
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```vue
|
|
123
|
+
* <script setup>
|
|
124
|
+
* import { useScreenSizeContext } from '@stachelock/ui';
|
|
125
|
+
*
|
|
126
|
+
* const screenSize = useScreenSizeContext();
|
|
127
|
+
* // screenSize.value will be 'sm' | 'md' | 'lg' | 'xl'
|
|
128
|
+
* </script>
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
export declare function useScreenSizeContext(fallback?: ScreenSize): Ref<ScreenSize>;
|
package/dist/src/types/form.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface FormValidationState {
|
|
|
20
20
|
}
|
|
21
21
|
export interface DynamicFormField {
|
|
22
22
|
name: string;
|
|
23
|
-
type: 'text' | 'email' | 'phone' | 'password' | 'number' | 'tel' | 'url' | 'textarea' | 'select' | 'combobox' | 'checkbox' | 'switch' | 'file' | 'date' | 'datetime-local' | 'time';
|
|
23
|
+
type: 'text' | 'email' | 'phone' | 'password' | 'number' | 'tel' | 'url' | 'textarea' | 'select' | 'combobox' | 'checkbox' | 'switch' | 'file' | 'date' | 'datetime-local' | 'time' | 'names' | 'baseInfo' | 'address' | 'selectText';
|
|
24
24
|
label?: string;
|
|
25
25
|
placeholder?: string;
|
|
26
26
|
description?: string;
|
|
@@ -58,6 +58,29 @@ export interface DynamicFormField {
|
|
|
58
58
|
autoDetectCountry?: boolean;
|
|
59
59
|
tertiaryLabel?: string;
|
|
60
60
|
successMessage?: string;
|
|
61
|
+
schema?: unknown;
|
|
62
|
+
requiredFields?: string[];
|
|
63
|
+
use?: string;
|
|
64
|
+
enableVerification?: boolean;
|
|
65
|
+
showSuggestionCount?: boolean;
|
|
66
|
+
allowManualEntry?: boolean;
|
|
67
|
+
select?: {
|
|
68
|
+
label?: string;
|
|
69
|
+
options: Array<{
|
|
70
|
+
label: string;
|
|
71
|
+
value: string;
|
|
72
|
+
}>;
|
|
73
|
+
placeholder?: string;
|
|
74
|
+
};
|
|
75
|
+
text?: {
|
|
76
|
+
label?: string;
|
|
77
|
+
placeholder?: string;
|
|
78
|
+
inputMode?: string;
|
|
79
|
+
maxLength?: number;
|
|
80
|
+
};
|
|
81
|
+
delimiter?: string;
|
|
82
|
+
formatter?: (value: FormValue) => string | undefined;
|
|
83
|
+
showValidCheck?: boolean;
|
|
61
84
|
condition?: (formData: FormData, field?: DynamicFormField) => boolean;
|
|
62
85
|
onChange?: (value: FormValue, field: DynamicFormField, formData: FormData) => void;
|
|
63
86
|
onBlur?: (event: FocusEvent) => void;
|
|
@@ -63,3 +63,45 @@ export type StepsItemType = {
|
|
|
63
63
|
props?: Record<string, unknown>;
|
|
64
64
|
valid: boolean | undefined;
|
|
65
65
|
};
|
|
66
|
+
export type RightPanelSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
67
|
+
export type MobileBreakpoint = 'sm' | 'md' | 'lg';
|
|
68
|
+
export interface SplitPanelLayoutProps {
|
|
69
|
+
/** Controls visibility of the right panel */
|
|
70
|
+
showRightPanel?: boolean;
|
|
71
|
+
/** Width of the right panel */
|
|
72
|
+
rightPanelSize?: RightPanelSize;
|
|
73
|
+
/** Minimum height of the layout container */
|
|
74
|
+
minHeight?: string;
|
|
75
|
+
/** Maximum height of the layout container */
|
|
76
|
+
maxHeight?: string;
|
|
77
|
+
/** Breakpoint for mobile slide-over behavior */
|
|
78
|
+
mobileBreakpoint?: MobileBreakpoint;
|
|
79
|
+
/** Title for mobile slide-over */
|
|
80
|
+
slideOverTitle?: string;
|
|
81
|
+
/** Show back button in right panel footer */
|
|
82
|
+
showBackButton?: boolean;
|
|
83
|
+
/** Apply rounded corners */
|
|
84
|
+
rounded?: boolean;
|
|
85
|
+
/** Apply shadow */
|
|
86
|
+
shadow?: boolean;
|
|
87
|
+
/** Apply ring border */
|
|
88
|
+
ring?: boolean;
|
|
89
|
+
}
|
|
90
|
+
export interface SplitPanelLayoutEmits {
|
|
91
|
+
(e: 'back'): void;
|
|
92
|
+
(e: 'close-right'): void;
|
|
93
|
+
}
|
|
94
|
+
export interface DetailPanelProps {
|
|
95
|
+
/** Minimum height of the panel */
|
|
96
|
+
minHeight?: string;
|
|
97
|
+
/** Maximum height of the panel */
|
|
98
|
+
maxHeight?: string;
|
|
99
|
+
/** Show loading state */
|
|
100
|
+
loading?: boolean;
|
|
101
|
+
/** Show empty state */
|
|
102
|
+
empty?: boolean;
|
|
103
|
+
/** Title for empty state */
|
|
104
|
+
emptyTitle?: string;
|
|
105
|
+
/** Description for empty state */
|
|
106
|
+
emptyDescription?: string;
|
|
107
|
+
}
|