@meddleware/ui 0.1.0 → 0.1.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/AppFooter.vue.d.ts +25 -0
- package/dist/components/AppHeader.vue.d.ts +29 -0
- package/dist/components/AppSidebar.vue.d.ts +26 -0
- package/dist/components/ColorModeControl.vue.d.ts +20 -0
- package/dist/components/UiButton.vue.d.ts +22 -0
- package/dist/components/UiCard.vue.d.ts +20 -0
- package/dist/components/UiNotice.vue.d.ts +17 -0
- package/dist/components/UiSelect.vue.d.ts +20 -0
- package/dist/composables/useColorMode.d.ts +14 -0
- package/dist/index.d.ts +11 -0
- package/dist/internal/panel.d.ts +18 -0
- package/package.json +2 -2
- /package/dist/{ui.css → base.css} +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type PanelVariant, type PanelColors } from '../internal/panel';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** default transparent — footers usually sit over the page background. */
|
|
4
|
+
variant?: PanelVariant;
|
|
5
|
+
colors?: PanelColors;
|
|
6
|
+
};
|
|
7
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
start?: (props: typeof __VLS_1) => any;
|
|
10
|
+
} & {
|
|
11
|
+
default?: (props: typeof __VLS_3) => any;
|
|
12
|
+
} & {
|
|
13
|
+
end?: (props: typeof __VLS_5) => any;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
16
|
+
variant: PanelVariant;
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type PanelVariant, type PanelColors } from '../internal/panel';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** light | dark | transparent — default dark (token defaults, overridable). */
|
|
4
|
+
variant?: PanelVariant;
|
|
5
|
+
/** Per-instance colour overrides; token values are used by default. */
|
|
6
|
+
colors?: PanelColors;
|
|
7
|
+
/** Stick to the top of the viewport (full-width shells). */
|
|
8
|
+
sticky?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
|
|
11
|
+
type __VLS_Slots = {} & {
|
|
12
|
+
brand?: (props: typeof __VLS_1) => any;
|
|
13
|
+
} & {
|
|
14
|
+
default?: (props: typeof __VLS_3) => any;
|
|
15
|
+
} & {
|
|
16
|
+
actions?: (props: typeof __VLS_5) => any;
|
|
17
|
+
};
|
|
18
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
19
|
+
variant: PanelVariant;
|
|
20
|
+
sticky: boolean;
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type PanelVariant, type PanelColors } from '../internal/panel';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
variant?: PanelVariant;
|
|
4
|
+
colors?: PanelColors;
|
|
5
|
+
/** Sidebar width (CSS length). */
|
|
6
|
+
width?: string;
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
head?: (props: typeof __VLS_1) => any;
|
|
11
|
+
} & {
|
|
12
|
+
default?: (props: typeof __VLS_3) => any;
|
|
13
|
+
} & {
|
|
14
|
+
foot?: (props: typeof __VLS_5) => any;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
17
|
+
variant: PanelVariant;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ColorMode } from '../composables/useColorMode';
|
|
2
|
+
/**
|
|
3
|
+
* Presentational light/dark/system control. It owns NO state — bind it with
|
|
4
|
+
* `v-model` (or `:modelValue` + `@update:modelValue`) to external state, e.g.
|
|
5
|
+
* the `useColorMode()` composable or your store.
|
|
6
|
+
*/
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
modelValue: ColorMode;
|
|
9
|
+
/** Which modes to offer (default all three). */
|
|
10
|
+
modes?: ColorMode[];
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:modelValue": (args_0: ColorMode) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
+
"onUpdate:modelValue"?: ((args_0: ColorMode) => any) | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
modes: ColorMode[];
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
variant?: 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
3
|
+
type?: 'button' | 'submit' | 'reset';
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_1: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_1) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
11
|
+
variant: "primary" | "secondary" | "ghost" | "danger";
|
|
12
|
+
type: "button" | "submit" | "reset";
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
title?: string;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
header?: (props: typeof __VLS_1) => any;
|
|
7
|
+
} & {
|
|
8
|
+
default?: (props: typeof __VLS_3) => any;
|
|
9
|
+
} & {
|
|
10
|
+
footer?: (props: typeof __VLS_5) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Inline notice/alert. Abstracted from the token-deployer `AppNotice.vue`. */
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
type?: 'info' | 'error' | 'ok';
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_1: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_1) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type __VLS_ModelProps = {
|
|
2
|
+
modelValue?: string;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_1: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_1) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
11
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
12
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
export type ColorMode = 'light' | 'dark' | 'system';
|
|
3
|
+
/**
|
|
4
|
+
* External colour-mode state manager. `ColorModeControl` is presentational and
|
|
5
|
+
* does NOT own state — bind it to `mode`/`set` (or your own store) instead.
|
|
6
|
+
*
|
|
7
|
+
* @param defaultMode used only on first init when nothing is persisted.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useColorMode(defaultMode?: ColorMode): {
|
|
10
|
+
mode: Ref<ColorMode, ColorMode>;
|
|
11
|
+
set: (m: ColorMode) => void;
|
|
12
|
+
cycle: () => void;
|
|
13
|
+
isDark: () => boolean;
|
|
14
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as AppHeader } from './components/AppHeader.vue';
|
|
2
|
+
export { default as AppSidebar } from './components/AppSidebar.vue';
|
|
3
|
+
export { default as AppFooter } from './components/AppFooter.vue';
|
|
4
|
+
export { default as ColorModeControl } from './components/ColorModeControl.vue';
|
|
5
|
+
export { default as UiButton } from './components/UiButton.vue';
|
|
6
|
+
export { default as UiCard } from './components/UiCard.vue';
|
|
7
|
+
export { default as UiSelect } from './components/UiSelect.vue';
|
|
8
|
+
export { default as UiNotice } from './components/UiNotice.vue';
|
|
9
|
+
export { useColorMode } from './composables/useColorMode.js';
|
|
10
|
+
export type { ColorMode } from './composables/useColorMode.js';
|
|
11
|
+
export type { PanelVariant, PanelColors } from './internal/panel.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CSSProperties } from 'vue';
|
|
2
|
+
export type PanelVariant = 'light' | 'dark' | 'transparent';
|
|
3
|
+
/** Optional per-instance colour overrides (win over the token defaults). */
|
|
4
|
+
export interface PanelColors {
|
|
5
|
+
bg?: string;
|
|
6
|
+
surface?: string;
|
|
7
|
+
text?: string;
|
|
8
|
+
muted?: string;
|
|
9
|
+
border?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Resolve a panel variant to a set of local CSS variables (`--_bg`, `--_text`,
|
|
13
|
+
* …) that the header/sidebar/footer styles consume. Variants use the
|
|
14
|
+
* theme-INDEPENDENT `--mw-panel-*` tokens so a dark panel renders correctly on
|
|
15
|
+
* a light page (and vice-versa). Transparent inherits the page text colour.
|
|
16
|
+
* Any supplied `colors` override the defaults — token values are the default.
|
|
17
|
+
*/
|
|
18
|
+
export declare function panelVars(variant: PanelVariant, colors?: PanelColors): CSSProperties;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meddleware/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Shared Vue 3 component library for @meddleware UIs — layout shell (header/sidebar/footer), colour-mode control, and primitives. Built on @meddleware/design-tokens.",
|
|
5
5
|
"license": "0BSD",
|
|
6
6
|
"type": "module",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
|
-
"build": "vue-tsc -p tsconfig.build.json && vite build",
|
|
25
|
+
"build": "rm -rf dist && vue-tsc -p tsconfig.build.json && vite build",
|
|
26
26
|
"type-check": "vue-tsc --noEmit"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
File without changes
|