@ghostvue/themes 0.1.0 → 0.2.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/calm.css +24 -14
- package/dist/components.d.ts +7 -2
- package/dist/components.js +6 -1
- package/dist/default.css +1006 -752
- package/dist/define.js +21 -3
- package/dist/generated/tokens.d.ts +11 -0
- package/dist/generated/tokens.js +11 -0
- package/dist/ghost-checkbox-group.d.ts +50 -0
- package/dist/ghost-checkbox-group.js +56 -0
- package/dist/ghost-field.d.ts +12 -3
- package/dist/ghost-field.js +6 -1
- package/dist/ghost-select.d.ts +52 -113
- package/dist/ghost-select.js +45 -68
- package/dist/ghost-submenu-content.d.ts +22 -0
- package/dist/ghost-submenu-content.js +17 -0
- package/dist/ghost-submenu-trigger.d.ts +11 -0
- package/dist/ghost-submenu-trigger.js +11 -0
- package/dist/ghost-submenu.d.ts +1 -0
- package/dist/ghost-submenu.js +1 -0
- package/dist/ghost-tags-input.d.ts +75 -0
- package/dist/ghost-tags-input.js +54 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +6 -1
- package/dist/manifest.json +471 -11
- package/dist/mono.css +24 -14
- package/dist/recipes/checkbox-group.css +30 -0
- package/dist/recipes/command-palette.css +52 -0
- package/dist/recipes/context-menu.css +95 -184
- package/dist/recipes/data-table.css +151 -144
- package/dist/recipes/dialog.css +68 -10
- package/dist/recipes/drawer.css +109 -11
- package/dist/recipes/dropdown-menu.css +95 -189
- package/dist/recipes/hover-card.css +19 -0
- package/dist/recipes/menubar.css +110 -191
- package/dist/recipes/popover.css +19 -0
- package/dist/recipes/progress.css +7 -2
- package/dist/recipes/scroll-area.css +43 -2
- package/dist/recipes/segmented-control.css +62 -3
- package/dist/recipes/tags-input.css +120 -0
- package/dist/tokens/semantic.json +5 -0
- package/dist/tokens.css +24 -14
- package/dist/tokens.json +15 -0
- package/dist/vibrant.css +24 -14
- package/package.json +3 -3
package/dist/define.js
CHANGED
|
@@ -4325,7 +4325,7 @@ function compileTokenDocuments(documents, options = {}) {
|
|
|
4325
4325
|
const defaultDensity = options.defaultDensity ?? DEFAULT_DENSITY;
|
|
4326
4326
|
return {
|
|
4327
4327
|
tokens,
|
|
4328
|
-
css: renderTokenCss(tokens,
|
|
4328
|
+
css: renderTokenCss(tokens, options),
|
|
4329
4329
|
typescript: renderTokenTypescript(tokens),
|
|
4330
4330
|
manifest: renderTokenManifest(tokens, { themeName, defaultDensity }),
|
|
4331
4331
|
docsMarkdown: renderTokenDocs(tokens)
|
|
@@ -4360,7 +4360,14 @@ function densityCssValue(token, density) {
|
|
|
4360
4360
|
var MOTION_INTENSITY_VAR = `${CSS_PREFIX}motion-intensity`;
|
|
4361
4361
|
function cssRuntimeValue(token, value) {
|
|
4362
4362
|
if (token.type === "duration") {
|
|
4363
|
-
|
|
4363
|
+
const scaled = `${value} * var(${MOTION_INTENSITY_VAR}, 1)`;
|
|
4364
|
+
if (token.name === "action.spinner.duration") {
|
|
4365
|
+
return `calc(${scaled} / var(--_ghost-progress-intensity-baseline, 1))`;
|
|
4366
|
+
}
|
|
4367
|
+
if (token.name === "motion.duration.fast") {
|
|
4368
|
+
return `calc(${scaled} / var(--_ghost-progress-update-baseline, 1))`;
|
|
4369
|
+
}
|
|
4370
|
+
return `calc(${scaled})`;
|
|
4364
4371
|
}
|
|
4365
4372
|
if (usesRoundness(token)) {
|
|
4366
4373
|
return `calc(${value} * var(${ROUNDNESS_VAR}, 1))`;
|
|
@@ -4650,6 +4657,10 @@ ${inheritedForcedVars}
|
|
|
4650
4657
|
* flash the opposite palette.
|
|
4651
4658
|
*/
|
|
4652
4659
|
@layer ghostvue-theme {
|
|
4660
|
+
${cssHost} {
|
|
4661
|
+
--_ghost-progress-intensity-baseline: ${options.progressIntensityBaseline ?? 1};
|
|
4662
|
+
}
|
|
4663
|
+
|
|
4653
4664
|
${systemHost} {
|
|
4654
4665
|
${lightVars}
|
|
4655
4666
|
}
|
|
@@ -5898,7 +5909,14 @@ function defineTheme(input) {
|
|
|
5898
5909
|
tree: clone(semanticSpaciousTemplate)
|
|
5899
5910
|
}
|
|
5900
5911
|
];
|
|
5901
|
-
const
|
|
5912
|
+
const preset = FLAGSHIP_THEME_INPUTS.find(
|
|
5913
|
+
(theme) => theme.name === input.name
|
|
5914
|
+
);
|
|
5915
|
+
const compileOptions = {
|
|
5916
|
+
themeName: input.name,
|
|
5917
|
+
defaultDensity: density,
|
|
5918
|
+
progressIntensityBaseline: preset?.motionIntensity ?? 1
|
|
5919
|
+
};
|
|
5902
5920
|
let compiled = compileTokenDocuments(documents, compileOptions);
|
|
5903
5921
|
const beforeFill = snapshotTokenValues(compiled.tokens);
|
|
5904
5922
|
ensureReadableActionFills(compiled.tokens);
|
|
@@ -4483,6 +4483,17 @@ export declare const tokens: {
|
|
|
4483
4483
|
readonly dark: "1rem";
|
|
4484
4484
|
};
|
|
4485
4485
|
};
|
|
4486
|
+
readonly "space.inset.scrollbar": {
|
|
4487
|
+
readonly name: "space.inset.scrollbar";
|
|
4488
|
+
readonly cssVar: "--ghost-space-inset-scrollbar";
|
|
4489
|
+
readonly type: "dimension";
|
|
4490
|
+
readonly tier: "semantic";
|
|
4491
|
+
readonly description: "16px clearance a scroll container keeps beside its scrollbar so overlay scrollbars never cover content. Same across densities: platform scrollbars do not scale with density.";
|
|
4492
|
+
readonly value: {
|
|
4493
|
+
readonly light: "1rem";
|
|
4494
|
+
readonly dark: "1rem";
|
|
4495
|
+
};
|
|
4496
|
+
};
|
|
4486
4497
|
readonly "space.inset.sm": {
|
|
4487
4498
|
readonly name: "space.inset.sm";
|
|
4488
4499
|
readonly cssVar: "--ghost-space-inset-sm";
|
package/dist/generated/tokens.js
CHANGED
|
@@ -4482,6 +4482,17 @@ export const tokens = {
|
|
|
4482
4482
|
dark: "1rem",
|
|
4483
4483
|
},
|
|
4484
4484
|
},
|
|
4485
|
+
"space.inset.scrollbar": {
|
|
4486
|
+
name: "space.inset.scrollbar",
|
|
4487
|
+
cssVar: "--ghost-space-inset-scrollbar",
|
|
4488
|
+
type: "dimension",
|
|
4489
|
+
tier: "semantic",
|
|
4490
|
+
description: "16px clearance a scroll container keeps beside its scrollbar so overlay scrollbars never cover content. Same across densities: platform scrollbars do not scale with density.",
|
|
4491
|
+
value: {
|
|
4492
|
+
light: "1rem",
|
|
4493
|
+
dark: "1rem",
|
|
4494
|
+
},
|
|
4495
|
+
},
|
|
4485
4496
|
"space.inset.sm": {
|
|
4486
4497
|
name: "space.inset.sm",
|
|
4487
4498
|
cssVar: "--ghost-space-inset-sm",
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type GhostCheckboxGroupElement, type GhostCheckboxGroupEmits, type GhostCheckboxGroupExposed, type GhostCheckboxGroupProps } from '@ghostvue/vue';
|
|
3
|
+
type CheckboxGroupListeners<TValue extends string> = {
|
|
4
|
+
[Event in keyof GhostCheckboxGroupEmits<TValue> as `on${Capitalize<Event>}`]?: (...args: GhostCheckboxGroupEmits<TValue>[Event]) => void;
|
|
5
|
+
};
|
|
6
|
+
declare const CheckboxGroup: (new <TValue extends string = string>(props: (GhostCheckboxGroupProps<TValue> & CheckboxGroupListeners<TValue> & ({
|
|
7
|
+
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
8
|
+
} | {
|
|
9
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
10
|
+
})) & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps) => import("vue").CreateComponentPublicInstanceWithMixins<GhostCheckboxGroupProps<TValue> & CheckboxGroupListeners<TValue> & ({
|
|
11
|
+
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
12
|
+
} | {
|
|
13
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
14
|
+
}), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, import("vue").PublicProps, {}, false, {}, {}, {}, {}, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
15
|
+
P: {};
|
|
16
|
+
B: {};
|
|
17
|
+
D: {};
|
|
18
|
+
C: {};
|
|
19
|
+
M: {};
|
|
20
|
+
Defaults: {};
|
|
21
|
+
}, {} & (GhostCheckboxGroupProps<TValue> & CheckboxGroupListeners<TValue> & ({
|
|
22
|
+
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
23
|
+
} | {
|
|
24
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
25
|
+
})), {}, {}, {}, {}, {}>) & {
|
|
26
|
+
props: {
|
|
27
|
+
modelValue: PropType<readonly string[] | undefined>;
|
|
28
|
+
defaultValue: PropType<readonly string[] | undefined>;
|
|
29
|
+
name: PropType<string | undefined>;
|
|
30
|
+
disabled: BooleanConstructor;
|
|
31
|
+
invalid: BooleanConstructor;
|
|
32
|
+
as: {
|
|
33
|
+
type: PropType<GhostCheckboxGroupElement | undefined>;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
emits: {
|
|
38
|
+
'update:modelValue': (value: string[]) => boolean;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Themed checkbox group: `.ghost-themed-scope` plus fieldset reset and vertical
|
|
43
|
+
* stack gap. Adds no visual props or per-component tokens.
|
|
44
|
+
*/
|
|
45
|
+
export declare const GhostCheckboxGroup: (new <TValue extends string = string>(...args: ConstructorParameters<typeof CheckboxGroup<TValue>>) => InstanceType<typeof CheckboxGroup<TValue>> & GhostCheckboxGroupExposed & {
|
|
46
|
+
$slots: {
|
|
47
|
+
default?: () => unknown;
|
|
48
|
+
};
|
|
49
|
+
}) & Pick<typeof CheckboxGroup, "props" | "emits">;
|
|
50
|
+
export type { GhostCheckboxGroupExposed };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { createVNode, defineComponent, h, resolveDynamicComponent, shallowRef, } from 'vue';
|
|
2
|
+
import { GhostCheckboxGroup as GhostUnstyledCheckboxGroup, } from '@ghostvue/vue';
|
|
3
|
+
const propOptions = {
|
|
4
|
+
modelValue: null,
|
|
5
|
+
defaultValue: null,
|
|
6
|
+
name: String,
|
|
7
|
+
disabled: Boolean,
|
|
8
|
+
invalid: Boolean,
|
|
9
|
+
as: {
|
|
10
|
+
type: [String, Object, Function],
|
|
11
|
+
default: 'fieldset',
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
const emits = {
|
|
15
|
+
'update:modelValue': (value) => Array.isArray(value),
|
|
16
|
+
};
|
|
17
|
+
// Vue infers the generic value union from setup. Attach runtime prop/emit
|
|
18
|
+
// options separately so constructors do not collapse TValue to string.
|
|
19
|
+
const CheckboxGroup = Object.assign(defineComponent((props, { attrs, emit, expose, slots }) => {
|
|
20
|
+
const inner = shallowRef(null);
|
|
21
|
+
expose({
|
|
22
|
+
get element() {
|
|
23
|
+
return inner.value?.element ?? null;
|
|
24
|
+
},
|
|
25
|
+
focus(options) {
|
|
26
|
+
inner.value?.focus(options);
|
|
27
|
+
},
|
|
28
|
+
blur() {
|
|
29
|
+
inner.value?.blur();
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
return () => h('span', { class: 'ghost-themed-scope' }, [
|
|
33
|
+
createVNode(resolveDynamicComponent(GhostUnstyledCheckboxGroup), {
|
|
34
|
+
...attrs,
|
|
35
|
+
ref: inner,
|
|
36
|
+
...(props.modelValue !== undefined
|
|
37
|
+
? { modelValue: props.modelValue }
|
|
38
|
+
: {}),
|
|
39
|
+
...(props.defaultValue !== undefined
|
|
40
|
+
? { defaultValue: props.defaultValue }
|
|
41
|
+
: {}),
|
|
42
|
+
name: props.name,
|
|
43
|
+
disabled: props.disabled,
|
|
44
|
+
invalid: props.invalid,
|
|
45
|
+
as: props.as,
|
|
46
|
+
'onUpdate:modelValue': (value) => {
|
|
47
|
+
emit('update:modelValue', value);
|
|
48
|
+
},
|
|
49
|
+
}, slots),
|
|
50
|
+
]);
|
|
51
|
+
}, { name: 'GhostCheckboxGroup', inheritAttrs: false }), { props: propOptions, emits });
|
|
52
|
+
/**
|
|
53
|
+
* Themed checkbox group: `.ghost-themed-scope` plus fieldset reset and vertical
|
|
54
|
+
* stack gap. Adds no visual props or per-component tokens.
|
|
55
|
+
*/
|
|
56
|
+
export const GhostCheckboxGroup = CheckboxGroup;
|
package/dist/ghost-field.d.ts
CHANGED
|
@@ -4,13 +4,17 @@ export declare const GhostField: import("vue").DefineComponent<import("vue").Ext
|
|
|
4
4
|
type: StringConstructor;
|
|
5
5
|
default: undefined;
|
|
6
6
|
};
|
|
7
|
+
name: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: undefined;
|
|
10
|
+
};
|
|
7
11
|
disabled: {
|
|
8
12
|
type: BooleanConstructor;
|
|
9
13
|
default: boolean;
|
|
10
14
|
};
|
|
11
15
|
invalid: {
|
|
12
16
|
type: BooleanConstructor;
|
|
13
|
-
default:
|
|
17
|
+
default: undefined;
|
|
14
18
|
};
|
|
15
19
|
required: {
|
|
16
20
|
type: BooleanConstructor;
|
|
@@ -23,22 +27,27 @@ export declare const GhostField: import("vue").DefineComponent<import("vue").Ext
|
|
|
23
27
|
type: StringConstructor;
|
|
24
28
|
default: undefined;
|
|
25
29
|
};
|
|
30
|
+
name: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: undefined;
|
|
33
|
+
};
|
|
26
34
|
disabled: {
|
|
27
35
|
type: BooleanConstructor;
|
|
28
36
|
default: boolean;
|
|
29
37
|
};
|
|
30
38
|
invalid: {
|
|
31
39
|
type: BooleanConstructor;
|
|
32
|
-
default:
|
|
40
|
+
default: undefined;
|
|
33
41
|
};
|
|
34
42
|
required: {
|
|
35
43
|
type: BooleanConstructor;
|
|
36
44
|
default: boolean;
|
|
37
45
|
};
|
|
38
46
|
}>> & Readonly<{}>, {
|
|
47
|
+
name: string;
|
|
39
48
|
invalid: boolean;
|
|
40
49
|
required: boolean;
|
|
41
50
|
disabled: boolean;
|
|
42
51
|
id: string;
|
|
43
52
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
44
|
-
export { GhostFieldControl, GhostFieldDescription, GhostFieldError, GhostFieldLabel, type GhostFieldControlSlotProps, type GhostFieldExposed, type GhostFieldLabelAssociate, } from '@ghostvue/vue';
|
|
53
|
+
export { GhostFieldControl, GhostFieldDescription, GhostFieldError, GhostFieldLabel, type GhostFieldControlSlotProps, type GhostFieldErrorSlotProps, type GhostFieldExposed, type GhostFieldLabelAssociate, type GhostFieldSlotProps, } from '@ghostvue/vue';
|
package/dist/ghost-field.js
CHANGED
|
@@ -9,13 +9,17 @@ export const GhostField = defineComponent({
|
|
|
9
9
|
type: String,
|
|
10
10
|
default: undefined,
|
|
11
11
|
},
|
|
12
|
+
name: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: undefined,
|
|
15
|
+
},
|
|
12
16
|
disabled: {
|
|
13
17
|
type: Boolean,
|
|
14
18
|
default: false,
|
|
15
19
|
},
|
|
16
20
|
invalid: {
|
|
17
21
|
type: Boolean,
|
|
18
|
-
default:
|
|
22
|
+
default: undefined,
|
|
19
23
|
},
|
|
20
24
|
required: {
|
|
21
25
|
type: Boolean,
|
|
@@ -34,6 +38,7 @@ export const GhostField = defineComponent({
|
|
|
34
38
|
...attrs,
|
|
35
39
|
ref: inner,
|
|
36
40
|
id: props.id,
|
|
41
|
+
name: props.name,
|
|
37
42
|
disabled: props.disabled,
|
|
38
43
|
invalid: props.invalid,
|
|
39
44
|
required: props.required,
|
package/dist/ghost-select.d.ts
CHANGED
|
@@ -1,115 +1,54 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
1
|
+
import { type GhostSelectExposed, type GhostSelectModelValue, type GhostSelectProps, type GhostSelectValueInput } from '@ghostvue/vue';
|
|
2
|
+
interface SelectListeners<Multiple extends boolean = false> {
|
|
3
|
+
'onUpdate:modelValue'?: (value: GhostSelectModelValue<Multiple>) => void;
|
|
4
|
+
'onUpdate:open'?: (open: boolean) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const Select: (new <Multiple extends boolean = false>(props: (GhostSelectProps<Multiple> & SelectListeners<Multiple> & ({
|
|
7
|
+
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
8
|
+
} | {
|
|
9
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
10
|
+
})) & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps) => import("vue").CreateComponentPublicInstanceWithMixins<GhostSelectProps<Multiple> & SelectListeners<Multiple> & ({
|
|
11
|
+
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
12
|
+
} | {
|
|
13
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
14
|
+
}), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, import("vue").PublicProps, {}, false, {}, {}, {}, {}, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
15
|
+
P: {};
|
|
16
|
+
B: {};
|
|
17
|
+
D: {};
|
|
18
|
+
C: {};
|
|
19
|
+
M: {};
|
|
20
|
+
Defaults: {};
|
|
21
|
+
}, {} & (GhostSelectProps<Multiple> & SelectListeners<Multiple> & ({
|
|
22
|
+
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
23
|
+
} | {
|
|
24
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
25
|
+
})), {}, {}, {}, {}, {}>) & {
|
|
26
|
+
props: {
|
|
27
|
+
multiple: BooleanConstructor;
|
|
28
|
+
modelValue: null;
|
|
29
|
+
defaultValue: null;
|
|
30
|
+
name: StringConstructor;
|
|
31
|
+
form: StringConstructor;
|
|
32
|
+
disabled: BooleanConstructor;
|
|
33
|
+
required: BooleanConstructor;
|
|
34
|
+
invalid: BooleanConstructor;
|
|
35
|
+
open: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
default: undefined;
|
|
38
|
+
};
|
|
39
|
+
defaultOpen: BooleanConstructor;
|
|
40
|
+
placeholder: StringConstructor;
|
|
41
|
+
messages: ObjectConstructor;
|
|
42
|
+
};
|
|
43
|
+
emits: {
|
|
44
|
+
'update:modelValue': (value: unknown) => value is string | string[] | undefined;
|
|
45
|
+
'update:open': (open: boolean) => boolean;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
3
48
|
/** Themed {@link GhostSelect} root wrapper. */
|
|
4
|
-
export declare const GhostSelect:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
default: undefined;
|
|
49
|
+
export declare const GhostSelect: (new <Multiple extends boolean = false>(...args: ConstructorParameters<typeof Select<Multiple>>) => InstanceType<typeof Select<Multiple>> & GhostSelectExposed & {
|
|
50
|
+
$slots: {
|
|
51
|
+
default?: () => unknown;
|
|
8
52
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
default: undefined;
|
|
12
|
-
};
|
|
13
|
-
name: {
|
|
14
|
-
type: PropType<string | undefined>;
|
|
15
|
-
default: undefined;
|
|
16
|
-
};
|
|
17
|
-
form: {
|
|
18
|
-
type: PropType<string | undefined>;
|
|
19
|
-
default: undefined;
|
|
20
|
-
};
|
|
21
|
-
disabled: {
|
|
22
|
-
type: BooleanConstructor;
|
|
23
|
-
default: boolean;
|
|
24
|
-
};
|
|
25
|
-
required: {
|
|
26
|
-
type: BooleanConstructor;
|
|
27
|
-
default: boolean;
|
|
28
|
-
};
|
|
29
|
-
invalid: {
|
|
30
|
-
type: BooleanConstructor;
|
|
31
|
-
default: boolean;
|
|
32
|
-
};
|
|
33
|
-
open: {
|
|
34
|
-
type: PropType<boolean | undefined>;
|
|
35
|
-
default: undefined;
|
|
36
|
-
};
|
|
37
|
-
defaultOpen: {
|
|
38
|
-
type: BooleanConstructor;
|
|
39
|
-
default: boolean;
|
|
40
|
-
};
|
|
41
|
-
placeholder: {
|
|
42
|
-
type: PropType<string | undefined>;
|
|
43
|
-
default: undefined;
|
|
44
|
-
};
|
|
45
|
-
messages: {
|
|
46
|
-
type: PropType<GhostSelectMessages | undefined>;
|
|
47
|
-
default: undefined;
|
|
48
|
-
};
|
|
49
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
50
|
-
[key: string]: any;
|
|
51
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
52
|
-
'update:modelValue': (value: string | undefined) => boolean;
|
|
53
|
-
'update:open': (open: boolean) => boolean;
|
|
54
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
55
|
-
modelValue: {
|
|
56
|
-
type: PropType<string | undefined>;
|
|
57
|
-
default: undefined;
|
|
58
|
-
};
|
|
59
|
-
defaultValue: {
|
|
60
|
-
type: PropType<string | undefined>;
|
|
61
|
-
default: undefined;
|
|
62
|
-
};
|
|
63
|
-
name: {
|
|
64
|
-
type: PropType<string | undefined>;
|
|
65
|
-
default: undefined;
|
|
66
|
-
};
|
|
67
|
-
form: {
|
|
68
|
-
type: PropType<string | undefined>;
|
|
69
|
-
default: undefined;
|
|
70
|
-
};
|
|
71
|
-
disabled: {
|
|
72
|
-
type: BooleanConstructor;
|
|
73
|
-
default: boolean;
|
|
74
|
-
};
|
|
75
|
-
required: {
|
|
76
|
-
type: BooleanConstructor;
|
|
77
|
-
default: boolean;
|
|
78
|
-
};
|
|
79
|
-
invalid: {
|
|
80
|
-
type: BooleanConstructor;
|
|
81
|
-
default: boolean;
|
|
82
|
-
};
|
|
83
|
-
open: {
|
|
84
|
-
type: PropType<boolean | undefined>;
|
|
85
|
-
default: undefined;
|
|
86
|
-
};
|
|
87
|
-
defaultOpen: {
|
|
88
|
-
type: BooleanConstructor;
|
|
89
|
-
default: boolean;
|
|
90
|
-
};
|
|
91
|
-
placeholder: {
|
|
92
|
-
type: PropType<string | undefined>;
|
|
93
|
-
default: undefined;
|
|
94
|
-
};
|
|
95
|
-
messages: {
|
|
96
|
-
type: PropType<GhostSelectMessages | undefined>;
|
|
97
|
-
default: undefined;
|
|
98
|
-
};
|
|
99
|
-
}>> & Readonly<{
|
|
100
|
-
"onUpdate:modelValue"?: (value: string | undefined) => any;
|
|
101
|
-
"onUpdate:open"?: (open: boolean) => any;
|
|
102
|
-
}>, {
|
|
103
|
-
name: string | undefined;
|
|
104
|
-
invalid: boolean;
|
|
105
|
-
form: string | undefined;
|
|
106
|
-
required: boolean;
|
|
107
|
-
disabled: boolean;
|
|
108
|
-
modelValue: string | undefined;
|
|
109
|
-
defaultValue: string | undefined;
|
|
110
|
-
open: boolean | undefined;
|
|
111
|
-
defaultOpen: boolean;
|
|
112
|
-
placeholder: string | undefined;
|
|
113
|
-
messages: GhostSelectMessages | undefined;
|
|
114
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
115
|
-
export type { GhostSelectExposed };
|
|
53
|
+
}) & Pick<typeof Select, "props" | "emits">;
|
|
54
|
+
export type { GhostSelectExposed, GhostSelectModelValue, GhostSelectProps, GhostSelectValueInput, };
|
package/dist/ghost-select.js
CHANGED
|
@@ -1,74 +1,51 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createVNode, defineComponent, ref, resolveDynamicComponent, } from 'vue';
|
|
2
2
|
import { GhostSelect as GhostUnstyledSelect, } from '@ghostvue/vue';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
const propOptions = {
|
|
4
|
+
multiple: Boolean,
|
|
5
|
+
modelValue: null,
|
|
6
|
+
defaultValue: null,
|
|
7
|
+
name: String,
|
|
8
|
+
form: String,
|
|
9
|
+
disabled: Boolean,
|
|
10
|
+
required: Boolean,
|
|
11
|
+
invalid: Boolean,
|
|
12
|
+
open: { type: Boolean, default: undefined },
|
|
13
|
+
defaultOpen: Boolean,
|
|
14
|
+
placeholder: String,
|
|
15
|
+
messages: Object,
|
|
16
|
+
};
|
|
17
|
+
const emits = {
|
|
18
|
+
'update:modelValue': (value) => value === undefined ||
|
|
19
|
+
typeof value === 'string' ||
|
|
20
|
+
(Array.isArray(value) && value.every((item) => typeof item === 'string')),
|
|
21
|
+
'update:open': (open) => typeof open === 'boolean',
|
|
22
|
+
};
|
|
23
|
+
// Generic setup overload mirrors GhostDataTable so `multiple` infers scalar vs
|
|
24
|
+
// string[] v-model payloads on the themed wrapper.
|
|
25
|
+
const Select = Object.assign(defineComponent((props, { attrs, emit, slots, expose }) => {
|
|
26
|
+
const inner = ref(null);
|
|
27
|
+
expose({
|
|
28
|
+
get element() {
|
|
29
|
+
return inner.value?.element ?? null;
|
|
11
30
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
default: undefined,
|
|
31
|
+
focus(options) {
|
|
32
|
+
inner.value?.focus(options);
|
|
15
33
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
disabled: { type: Boolean, default: false },
|
|
19
|
-
required: { type: Boolean, default: false },
|
|
20
|
-
invalid: { type: Boolean, default: false },
|
|
21
|
-
open: {
|
|
22
|
-
type: Boolean,
|
|
23
|
-
default: undefined,
|
|
34
|
+
blur() {
|
|
35
|
+
inner.value?.blur();
|
|
24
36
|
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
});
|
|
38
|
+
return () => createVNode(resolveDynamicComponent(GhostUnstyledSelect), {
|
|
39
|
+
...attrs,
|
|
40
|
+
...props,
|
|
41
|
+
ref: inner,
|
|
42
|
+
'onUpdate:modelValue': (next) => {
|
|
43
|
+
emit('update:modelValue', next);
|
|
29
44
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
default: undefined,
|
|
45
|
+
'onUpdate:open': (next) => {
|
|
46
|
+
emit('update:open', next);
|
|
33
47
|
},
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
setup(props, { attrs, emit, slots, expose }) {
|
|
40
|
-
const inner = ref(null);
|
|
41
|
-
expose({
|
|
42
|
-
get element() {
|
|
43
|
-
return inner.value?.element ?? null;
|
|
44
|
-
},
|
|
45
|
-
focus(options) {
|
|
46
|
-
inner.value?.focus(options);
|
|
47
|
-
},
|
|
48
|
-
blur() {
|
|
49
|
-
inner.value?.blur();
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
return () => h(GhostUnstyledSelect, {
|
|
53
|
-
...attrs,
|
|
54
|
-
ref: inner,
|
|
55
|
-
modelValue: props.modelValue,
|
|
56
|
-
defaultValue: props.defaultValue,
|
|
57
|
-
name: props.name,
|
|
58
|
-
form: props.form,
|
|
59
|
-
disabled: props.disabled,
|
|
60
|
-
required: props.required,
|
|
61
|
-
invalid: props.invalid,
|
|
62
|
-
open: props.open,
|
|
63
|
-
defaultOpen: props.defaultOpen,
|
|
64
|
-
placeholder: props.placeholder,
|
|
65
|
-
messages: props.messages,
|
|
66
|
-
'onUpdate:modelValue': (next) => {
|
|
67
|
-
emit('update:modelValue', next);
|
|
68
|
-
},
|
|
69
|
-
'onUpdate:open': (next) => {
|
|
70
|
-
emit('update:open', next);
|
|
71
|
-
},
|
|
72
|
-
}, slots);
|
|
73
|
-
},
|
|
74
|
-
});
|
|
48
|
+
}, slots);
|
|
49
|
+
}, { name: 'GhostSelect', inheritAttrs: false }), { props: propOptions, emits });
|
|
50
|
+
/** Themed {@link GhostSelect} root wrapper. */
|
|
51
|
+
export const GhostSelect = Select;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type GhostPortalTarget } from '@ghostvue/vue';
|
|
3
|
+
/** Themed child menu surface, including when portaled. */
|
|
4
|
+
export declare const GhostSubmenuContent: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
portal: BooleanConstructor;
|
|
6
|
+
portalTo: {
|
|
7
|
+
type: PropType<GhostPortalTarget>;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
portal: BooleanConstructor;
|
|
14
|
+
portalTo: {
|
|
15
|
+
type: PropType<GhostPortalTarget>;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
}>> & Readonly<{}>, {
|
|
19
|
+
portal: boolean;
|
|
20
|
+
portalTo: GhostPortalTarget;
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
22
|
+
export type { GhostSubmenuContentProps } from '@ghostvue/vue';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineComponent, h } from 'vue';
|
|
2
|
+
import { GhostSubmenuContent as UnstyledSubmenuContent, } from '@ghostvue/vue';
|
|
3
|
+
/** Themed child menu surface, including when portaled. */
|
|
4
|
+
export const GhostSubmenuContent = defineComponent({
|
|
5
|
+
name: 'GhostSubmenuContent',
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
props: {
|
|
8
|
+
portal: Boolean,
|
|
9
|
+
portalTo: {
|
|
10
|
+
type: [String, Object, null],
|
|
11
|
+
default: 'body',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
setup(props, { attrs, slots }) {
|
|
15
|
+
return () => h(UnstyledSubmenuContent, { ...attrs, ...props, 'data-themed': '' }, slots);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Themed menu item that opens a submenu. */
|
|
2
|
+
export declare const GhostSubmenuTrigger: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
disabled: BooleanConstructor;
|
|
4
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
disabled: BooleanConstructor;
|
|
8
|
+
}>> & Readonly<{}>, {
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
export type { GhostSubmenuTriggerProps } from '@ghostvue/vue';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineComponent, h } from 'vue';
|
|
2
|
+
import { GhostSubmenuTrigger as UnstyledSubmenuTrigger } from '@ghostvue/vue';
|
|
3
|
+
/** Themed menu item that opens a submenu. */
|
|
4
|
+
export const GhostSubmenuTrigger = defineComponent({
|
|
5
|
+
name: 'GhostSubmenuTrigger',
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
props: { disabled: Boolean },
|
|
8
|
+
setup(props, { attrs, slots }) {
|
|
9
|
+
return () => h(UnstyledSubmenuTrigger, { ...attrs, ...props, 'data-themed': '' }, slots);
|
|
10
|
+
},
|
|
11
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GhostSubmenu, type GhostSubmenuProps } from '@ghostvue/vue';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GhostSubmenu } from '@ghostvue/vue';
|