@maltjoy/core-vue 1.0.0-alpha.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/README.md +17 -0
- package/dist/components/JoyButton/JoyButton.types.d.ts +13 -0
- package/dist/components/JoyButton/JoyButton.vue.d.ts +95 -0
- package/dist/components/JoyInput/JoyInput.vue.d.ts +142 -0
- package/dist/components/JoyLabel/JoyLabel.types.d.ts +3 -0
- package/dist/components/JoyLabel/JoyLabel.vue.d.ts +35 -0
- package/dist/components/JoySpinner/JoySpinner.types.d.ts +2 -0
- package/dist/components/JoySpinner/JoySpinner.vue.d.ts +14 -0
- package/dist/components/JoyWrapper/JoyWrapper.vue.d.ts +42 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/main.d.ts +5 -0
- package/dist/joy-vue.js +318 -0
- package/dist/joy-vue.umd.cjs +1 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/vite-env.d.ts +1 -0
- package/index.d.ts +3 -0
- package/joy-components.d.ts +11 -0
- package/package.json +53 -0
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# @maltjoy/core-vue
|
|
2
|
+
|
|
3
|
+
Vue version of [@maltjoy/core](https://www.npmjs.com/package/@maltjoy/core) package.
|
|
4
|
+
|
|
5
|
+
In order to inherit from all [@maltjoy/themes](https://www.npmjs.com/package/@maltjoy/themes) custom properties, you will need to import as well the default theme:
|
|
6
|
+
|
|
7
|
+
> If you already use @maltjoy/core in your project, it already include the theme.
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm install @maltjoy/themes
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Then import the CSS :
|
|
14
|
+
|
|
15
|
+
```css
|
|
16
|
+
@use '@maltjoy/themes/dist/themes/default.css';
|
|
17
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GENERIC_VARIANTS, SIZES } from '../../types';
|
|
2
|
+
/** BUTTON VARIANTS/COLORS */
|
|
3
|
+
declare const BUTTONS_SPECIFIC_VARIANTS: readonly ["main", "admin", "white", "ghost"];
|
|
4
|
+
export declare const BUTTON_VARIANTS: ((typeof GENERIC_VARIANTS)[number] | (typeof BUTTONS_SPECIFIC_VARIANTS)[number])[];
|
|
5
|
+
export type ButtonVariants = (typeof BUTTON_VARIANTS)[number];
|
|
6
|
+
/** BUTTON SIZES */
|
|
7
|
+
export declare const BUTTON_SIZES: readonly ["xlarge", "large", "medium", "small", "xsmall", "xxsmall"];
|
|
8
|
+
export type ButtonSizes = (typeof BUTTON_SIZES)[number];
|
|
9
|
+
/** BUTTON ICON SIZES */
|
|
10
|
+
type ButtonSpecificIconsSizes = Exclude<(typeof SIZES)[number], 'xlarge' | 'large' | 'medium'>;
|
|
11
|
+
export declare const ICON_SIZES: ButtonSpecificIconsSizes[];
|
|
12
|
+
export type IconSizes = (typeof ICON_SIZES)[number];
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { ButtonSizes, ButtonVariants, IconSizes } from "./JoyButton.types";
|
|
2
|
+
import { PropType } from "vue";
|
|
3
|
+
declare const _sfc_main: import("vue").DefineComponent<{
|
|
4
|
+
/**
|
|
5
|
+
* If you only need a button with an icon. To keep your component accessible, you can give a text as slot, it will be used as title and aria-label.
|
|
6
|
+
* This property takes effect only if icon property is set
|
|
7
|
+
*/
|
|
8
|
+
circle: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
default: boolean;
|
|
11
|
+
};
|
|
12
|
+
/** Name of the icon, placed before the text */
|
|
13
|
+
icon: StringConstructor;
|
|
14
|
+
/** Change the component's state and display a JoySpinner. */
|
|
15
|
+
loading: {
|
|
16
|
+
type: BooleanConstructor;
|
|
17
|
+
default: boolean;
|
|
18
|
+
};
|
|
19
|
+
/** Button or Link color variant */
|
|
20
|
+
variant: {
|
|
21
|
+
type: PropType<"primary" | "secondary" | "main" | "admin" | "white" | "ghost">;
|
|
22
|
+
default: string;
|
|
23
|
+
validator(variant: ButtonVariants): boolean;
|
|
24
|
+
};
|
|
25
|
+
/** Button or Link size */
|
|
26
|
+
size: {
|
|
27
|
+
type: PropType<"xlarge" | "large" | "medium" | "small" | "xsmall" | "xxsmall">;
|
|
28
|
+
default: string;
|
|
29
|
+
validator(variant: ButtonSizes): boolean;
|
|
30
|
+
};
|
|
31
|
+
/** Override the icon size. Default to xsmall */
|
|
32
|
+
iconSize: {
|
|
33
|
+
type: PropType<"small" | "xsmall" | "xxsmall">;
|
|
34
|
+
default: string;
|
|
35
|
+
validator(iconSize: IconSizes): boolean;
|
|
36
|
+
};
|
|
37
|
+
}, {
|
|
38
|
+
props: any;
|
|
39
|
+
attrs: {
|
|
40
|
+
[x: string]: unknown;
|
|
41
|
+
};
|
|
42
|
+
spinnerColor: import("vue").ComputedRef<"white" | "teal">;
|
|
43
|
+
JoySpinner: import("vue").DefineComponent<{
|
|
44
|
+
color: {
|
|
45
|
+
type: PropType<"white" | "teal">;
|
|
46
|
+
validator(color: "white" | "teal"): boolean;
|
|
47
|
+
};
|
|
48
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
49
|
+
color: {
|
|
50
|
+
type: PropType<"white" | "teal">;
|
|
51
|
+
validator(color: "white" | "teal"): boolean;
|
|
52
|
+
};
|
|
53
|
+
}>>, {}>;
|
|
54
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
55
|
+
/**
|
|
56
|
+
* If you only need a button with an icon. To keep your component accessible, you can give a text as slot, it will be used as title and aria-label.
|
|
57
|
+
* This property takes effect only if icon property is set
|
|
58
|
+
*/
|
|
59
|
+
circle: {
|
|
60
|
+
type: BooleanConstructor;
|
|
61
|
+
default: boolean;
|
|
62
|
+
};
|
|
63
|
+
/** Name of the icon, placed before the text */
|
|
64
|
+
icon: StringConstructor;
|
|
65
|
+
/** Change the component's state and display a JoySpinner. */
|
|
66
|
+
loading: {
|
|
67
|
+
type: BooleanConstructor;
|
|
68
|
+
default: boolean;
|
|
69
|
+
};
|
|
70
|
+
/** Button or Link color variant */
|
|
71
|
+
variant: {
|
|
72
|
+
type: PropType<"primary" | "secondary" | "main" | "admin" | "white" | "ghost">;
|
|
73
|
+
default: string;
|
|
74
|
+
validator(variant: ButtonVariants): boolean;
|
|
75
|
+
};
|
|
76
|
+
/** Button or Link size */
|
|
77
|
+
size: {
|
|
78
|
+
type: PropType<"xlarge" | "large" | "medium" | "small" | "xsmall" | "xxsmall">;
|
|
79
|
+
default: string;
|
|
80
|
+
validator(variant: ButtonSizes): boolean;
|
|
81
|
+
};
|
|
82
|
+
/** Override the icon size. Default to xsmall */
|
|
83
|
+
iconSize: {
|
|
84
|
+
type: PropType<"small" | "xsmall" | "xxsmall">;
|
|
85
|
+
default: string;
|
|
86
|
+
validator(iconSize: IconSizes): boolean;
|
|
87
|
+
};
|
|
88
|
+
}>>, {
|
|
89
|
+
circle: boolean;
|
|
90
|
+
loading: boolean;
|
|
91
|
+
variant: "primary" | "secondary" | "main" | "admin" | "white" | "ghost";
|
|
92
|
+
size: "xlarge" | "large" | "medium" | "small" | "xsmall" | "xxsmall";
|
|
93
|
+
iconSize: "small" | "xsmall" | "xxsmall";
|
|
94
|
+
}>;
|
|
95
|
+
export default _sfc_main;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { PropType } from "vue";
|
|
2
|
+
declare const _sfc_main: import("vue").DefineComponent<{
|
|
3
|
+
clearable: {
|
|
4
|
+
type: BooleanConstructor;
|
|
5
|
+
default: boolean;
|
|
6
|
+
};
|
|
7
|
+
icon: StringConstructor;
|
|
8
|
+
invalid: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
default: boolean;
|
|
11
|
+
};
|
|
12
|
+
labelSize: PropType<"large" | "medium" | "small">;
|
|
13
|
+
modelValue: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* For accessibility purpose, the name is required. it will be mapped to the input ID, and the label "for" attribute as well.
|
|
19
|
+
*/
|
|
20
|
+
name: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
optionalLabel: StringConstructor;
|
|
25
|
+
required: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
default: boolean;
|
|
28
|
+
};
|
|
29
|
+
requiredMark: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
33
|
+
size: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
default: string;
|
|
36
|
+
};
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
unit: StringConstructor;
|
|
39
|
+
}, {
|
|
40
|
+
emit: (event: "update:modelValue", ...args: any[]) => void;
|
|
41
|
+
props: any;
|
|
42
|
+
input: import("vue").Ref<HTMLInputElement | undefined>;
|
|
43
|
+
root: import("vue").Ref<HTMLElement | undefined>;
|
|
44
|
+
attrs: {
|
|
45
|
+
[x: string]: unknown;
|
|
46
|
+
};
|
|
47
|
+
slots: Readonly<{
|
|
48
|
+
[name: string]: import("vue").Slot | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
isFocusing: import("vue").Ref<boolean>;
|
|
51
|
+
showClearableIcon: import("vue").ComputedRef<boolean>;
|
|
52
|
+
hasDefaultSlot: import("vue").ComputedRef<import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
53
|
+
[key: string]: any;
|
|
54
|
+
}>[] | undefined>;
|
|
55
|
+
withinJoyWrapper: import("vue").ComputedRef<boolean>;
|
|
56
|
+
inputType: import("vue").Ref<string | undefined>;
|
|
57
|
+
eventHandlers: {
|
|
58
|
+
onFocus: () => void;
|
|
59
|
+
onBlur: () => void;
|
|
60
|
+
onInput: (e: Event) => void;
|
|
61
|
+
clearValue: () => void;
|
|
62
|
+
};
|
|
63
|
+
JoyLabel: import("vue").DefineComponent<{
|
|
64
|
+
size: {
|
|
65
|
+
type: PropType<"large" | "medium" | "small">;
|
|
66
|
+
default: string;
|
|
67
|
+
validator(size: "large" | "medium" | "small"): boolean;
|
|
68
|
+
};
|
|
69
|
+
required: {
|
|
70
|
+
type: BooleanConstructor;
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
73
|
+
optionalLabel: {
|
|
74
|
+
type: StringConstructor;
|
|
75
|
+
};
|
|
76
|
+
}, {
|
|
77
|
+
props: any;
|
|
78
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
79
|
+
size: {
|
|
80
|
+
type: PropType<"large" | "medium" | "small">;
|
|
81
|
+
default: string;
|
|
82
|
+
validator(size: "large" | "medium" | "small"): boolean;
|
|
83
|
+
};
|
|
84
|
+
required: {
|
|
85
|
+
type: BooleanConstructor;
|
|
86
|
+
default: boolean;
|
|
87
|
+
};
|
|
88
|
+
optionalLabel: {
|
|
89
|
+
type: StringConstructor;
|
|
90
|
+
};
|
|
91
|
+
}>>, {
|
|
92
|
+
size: "large" | "medium" | "small";
|
|
93
|
+
required: boolean;
|
|
94
|
+
}>;
|
|
95
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
96
|
+
clearable: {
|
|
97
|
+
type: BooleanConstructor;
|
|
98
|
+
default: boolean;
|
|
99
|
+
};
|
|
100
|
+
icon: StringConstructor;
|
|
101
|
+
invalid: {
|
|
102
|
+
type: BooleanConstructor;
|
|
103
|
+
default: boolean;
|
|
104
|
+
};
|
|
105
|
+
labelSize: PropType<"large" | "medium" | "small">;
|
|
106
|
+
modelValue: {
|
|
107
|
+
type: StringConstructor;
|
|
108
|
+
default: string;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* For accessibility purpose, the name is required. it will be mapped to the input ID, and the label "for" attribute as well.
|
|
112
|
+
*/
|
|
113
|
+
name: {
|
|
114
|
+
type: StringConstructor;
|
|
115
|
+
required: true;
|
|
116
|
+
};
|
|
117
|
+
optionalLabel: StringConstructor;
|
|
118
|
+
required: {
|
|
119
|
+
type: BooleanConstructor;
|
|
120
|
+
default: boolean;
|
|
121
|
+
};
|
|
122
|
+
requiredMark: {
|
|
123
|
+
type: BooleanConstructor;
|
|
124
|
+
default: boolean;
|
|
125
|
+
};
|
|
126
|
+
size: {
|
|
127
|
+
type: StringConstructor;
|
|
128
|
+
default: string;
|
|
129
|
+
};
|
|
130
|
+
type: StringConstructor;
|
|
131
|
+
unit: StringConstructor;
|
|
132
|
+
}>> & {
|
|
133
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
134
|
+
}, {
|
|
135
|
+
size: string;
|
|
136
|
+
clearable: boolean;
|
|
137
|
+
invalid: boolean;
|
|
138
|
+
modelValue: string;
|
|
139
|
+
required: boolean;
|
|
140
|
+
requiredMark: boolean;
|
|
141
|
+
}>;
|
|
142
|
+
export default _sfc_main;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PropType } from "vue";
|
|
2
|
+
import { LabelSizes } from "./JoyLabel.types";
|
|
3
|
+
declare const _sfc_main: import("vue").DefineComponent<{
|
|
4
|
+
size: {
|
|
5
|
+
type: PropType<"large" | "medium" | "small">;
|
|
6
|
+
default: string;
|
|
7
|
+
validator(size: LabelSizes): boolean;
|
|
8
|
+
};
|
|
9
|
+
required: {
|
|
10
|
+
type: BooleanConstructor;
|
|
11
|
+
default: boolean;
|
|
12
|
+
};
|
|
13
|
+
optionalLabel: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
};
|
|
16
|
+
}, {
|
|
17
|
+
props: any;
|
|
18
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
size: {
|
|
20
|
+
type: PropType<"large" | "medium" | "small">;
|
|
21
|
+
default: string;
|
|
22
|
+
validator(size: LabelSizes): boolean;
|
|
23
|
+
};
|
|
24
|
+
required: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
optionalLabel: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
};
|
|
31
|
+
}>>, {
|
|
32
|
+
size: "large" | "medium" | "small";
|
|
33
|
+
required: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
export default _sfc_main;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PropType } from "vue";
|
|
2
|
+
import { SpinnerColors } from "./JoySpinner.types";
|
|
3
|
+
declare const _sfc_main: import("vue").DefineComponent<{
|
|
4
|
+
color: {
|
|
5
|
+
type: PropType<"white" | "teal">;
|
|
6
|
+
validator(color: SpinnerColors): boolean;
|
|
7
|
+
};
|
|
8
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
color: {
|
|
10
|
+
type: PropType<"white" | "teal">;
|
|
11
|
+
validator(color: SpinnerColors): boolean;
|
|
12
|
+
};
|
|
13
|
+
}>>, {}>;
|
|
14
|
+
export default _sfc_main;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
declare const _sfc_main: import("vue").DefineComponent<{
|
|
3
|
+
justify: {
|
|
4
|
+
type: PropType<"center" | "space-between" | "flex-start" | "flex-end">;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
align: {
|
|
8
|
+
type: PropType<"center" | "flex-start" | "flex-end" | "stretch">;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
direction: {
|
|
12
|
+
type: PropType<"row" | "column">;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
wrap: {
|
|
16
|
+
type: PropType<"nowrap" | "wrap">;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
justify: {
|
|
21
|
+
type: PropType<"center" | "space-between" | "flex-start" | "flex-end">;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
align: {
|
|
25
|
+
type: PropType<"center" | "flex-start" | "flex-end" | "stretch">;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
direction: {
|
|
29
|
+
type: PropType<"row" | "column">;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
wrap: {
|
|
33
|
+
type: PropType<"nowrap" | "wrap">;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
}>>, {
|
|
37
|
+
wrap: "nowrap" | "wrap";
|
|
38
|
+
justify: "center" | "space-between" | "flex-start" | "flex-end";
|
|
39
|
+
align: "center" | "flex-start" | "flex-end" | "stretch";
|
|
40
|
+
direction: "row" | "column";
|
|
41
|
+
}>;
|
|
42
|
+
export default _sfc_main;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import JoyButton from '../components/JoyButton/JoyButton.vue';
|
|
2
|
+
import JoySpinner from '../components/JoySpinner/JoySpinner.vue';
|
|
3
|
+
import JoyInput from '../components/JoyInput/JoyInput.vue';
|
|
4
|
+
import JoyLabel from '../components/JoyLabel/JoyLabel.vue';
|
|
5
|
+
import JoyWrapper from '../components/JoyWrapper/JoyWrapper.vue';
|
|
6
|
+
export { JoyButton, JoyInput, JoyLabel, JoySpinner, JoyWrapper };
|
package/dist/joy-vue.js
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { defineComponent as _, openBlock as a, createElementBlock as r, normalizeClass as y, useAttrs as $, computed as v, createBlock as I, resolveDynamicComponent as L, unref as l, withCtx as J, createCommentVNode as c, createElementVNode as S, renderSlot as g, mergeProps as x, toDisplayString as N, ref as m, useSlots as E, onBeforeMount as q } from "vue";
|
|
2
|
+
const T = ["teal", "white"], A = /* @__PURE__ */ _({
|
|
3
|
+
__name: "JoySpinner",
|
|
4
|
+
props: {
|
|
5
|
+
color: {
|
|
6
|
+
type: String,
|
|
7
|
+
validator(e) {
|
|
8
|
+
return T.includes(e);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
setup(e) {
|
|
13
|
+
return (n, t) => (a(), r("div", {
|
|
14
|
+
class: y(["joy-spinner", `joy-spinner_${e.color}`])
|
|
15
|
+
}, null, 2));
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
const b = (e, n) => {
|
|
19
|
+
const t = e.__vccOpts || e;
|
|
20
|
+
for (const [p, s] of n)
|
|
21
|
+
t[p] = s;
|
|
22
|
+
return t;
|
|
23
|
+
}, z = /* @__PURE__ */ b(A, [["__scopeId", "data-v-e97b61a5"]]), O = ["primary", "secondary"], F = ["xlarge", "large", "medium", "small", "xsmall", "xxsmall"], R = ["main", "admin", "white", "ghost"], W = [
|
|
24
|
+
...O,
|
|
25
|
+
...R
|
|
26
|
+
], Z = [...F], D = ["xxsmall", "xsmall", "small"], M = ["name", "size"], P = { class: "joy-button--slot" }, U = /* @__PURE__ */ _({
|
|
27
|
+
__name: "JoyButton",
|
|
28
|
+
props: {
|
|
29
|
+
/**
|
|
30
|
+
* If you only need a button with an icon. To keep your component accessible, you can give a text as slot, it will be used as title and aria-label.
|
|
31
|
+
* This property takes effect only if icon property is set
|
|
32
|
+
*/
|
|
33
|
+
circle: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: !1
|
|
36
|
+
},
|
|
37
|
+
/** Name of the icon, placed before the text */
|
|
38
|
+
icon: String,
|
|
39
|
+
/** Change the component's state and display a JoySpinner. */
|
|
40
|
+
loading: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: !1
|
|
43
|
+
},
|
|
44
|
+
/** Button or Link color variant */
|
|
45
|
+
variant: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: "primary",
|
|
48
|
+
validator(e) {
|
|
49
|
+
return W.includes(e);
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
/** Button or Link size */
|
|
53
|
+
size: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: "medium",
|
|
56
|
+
validator(e) {
|
|
57
|
+
return Z.includes(e);
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
/** Override the icon size. Default to xsmall */
|
|
61
|
+
iconSize: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: "xsmall",
|
|
64
|
+
validator(e) {
|
|
65
|
+
return D.includes(e);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
setup(e) {
|
|
70
|
+
const n = e, t = $(), p = v(() => ["white", "ghost", "secondary"].includes(n.variant) ? "teal" : "white");
|
|
71
|
+
return (s, f) => (a(), I(L(l(t).href ? "a" : "button"), {
|
|
72
|
+
disabled: e.loading || l(t).disabled,
|
|
73
|
+
class: y([
|
|
74
|
+
"joy-button",
|
|
75
|
+
`joy-button_${e.variant}`,
|
|
76
|
+
`joy-button_${e.size}`,
|
|
77
|
+
{
|
|
78
|
+
"joy-button_circle": n.circle,
|
|
79
|
+
"joy-button_loading": n.loading
|
|
80
|
+
}
|
|
81
|
+
])
|
|
82
|
+
}, {
|
|
83
|
+
default: J(() => [
|
|
84
|
+
e.icon ? (a(), r("joy-icon", {
|
|
85
|
+
key: 0,
|
|
86
|
+
name: e.icon,
|
|
87
|
+
size: e.iconSize,
|
|
88
|
+
lazy: !1
|
|
89
|
+
}, null, 8, M)) : c("", !0),
|
|
90
|
+
e.loading ? (a(), I(z, {
|
|
91
|
+
key: 1,
|
|
92
|
+
color: l(p)
|
|
93
|
+
}, null, 8, ["color"])) : c("", !0),
|
|
94
|
+
S("span", P, [
|
|
95
|
+
g(s.$slots, "default", {}, void 0, !0)
|
|
96
|
+
])
|
|
97
|
+
]),
|
|
98
|
+
_: 3
|
|
99
|
+
}, 8, ["disabled", "class"]));
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
const G = /* @__PURE__ */ b(U, [["__scopeId", "data-v-107b2043"]]), H = ["small", "medium", "large"], K = {
|
|
103
|
+
key: 0,
|
|
104
|
+
class: "joy-label-required"
|
|
105
|
+
}, Q = {
|
|
106
|
+
key: 1,
|
|
107
|
+
class: "joy-label-optional"
|
|
108
|
+
}, X = /* @__PURE__ */ _({
|
|
109
|
+
__name: "JoyLabel",
|
|
110
|
+
props: {
|
|
111
|
+
size: {
|
|
112
|
+
type: String,
|
|
113
|
+
default: "medium",
|
|
114
|
+
validator(e) {
|
|
115
|
+
return H.includes(e);
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
required: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: !1
|
|
121
|
+
},
|
|
122
|
+
optionalLabel: {
|
|
123
|
+
type: String
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
setup(e) {
|
|
127
|
+
const n = e;
|
|
128
|
+
return (t, p) => (a(), r("label", x({
|
|
129
|
+
class: ["joy-label", `joy-label--${e.size}`]
|
|
130
|
+
}, t.$attrs), [
|
|
131
|
+
g(t.$slots, "default", {}, void 0, !0),
|
|
132
|
+
n.required ? (a(), r("span", K, "*")) : c("", !0),
|
|
133
|
+
n.optionalLabel ? (a(), r("span", Q, " - " + N(n.optionalLabel), 1)) : c("", !0)
|
|
134
|
+
], 16));
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
const h = /* @__PURE__ */ b(X, [["__scopeId", "data-v-21392cc3"]]), Y = ["id", "type", "value"], ee = ["data-unit"], te = /* @__PURE__ */ _({
|
|
138
|
+
__name: "JoyInput",
|
|
139
|
+
props: {
|
|
140
|
+
clearable: {
|
|
141
|
+
type: Boolean,
|
|
142
|
+
default: !1
|
|
143
|
+
},
|
|
144
|
+
icon: String,
|
|
145
|
+
invalid: {
|
|
146
|
+
type: Boolean,
|
|
147
|
+
default: !1
|
|
148
|
+
},
|
|
149
|
+
labelSize: String,
|
|
150
|
+
modelValue: {
|
|
151
|
+
type: String,
|
|
152
|
+
default: ""
|
|
153
|
+
},
|
|
154
|
+
/**
|
|
155
|
+
* For accessibility purpose, the name is required. it will be mapped to the input ID, and the label "for" attribute as well.
|
|
156
|
+
*/
|
|
157
|
+
name: {
|
|
158
|
+
type: String,
|
|
159
|
+
required: !0
|
|
160
|
+
},
|
|
161
|
+
optionalLabel: String,
|
|
162
|
+
required: {
|
|
163
|
+
type: Boolean,
|
|
164
|
+
default: !1
|
|
165
|
+
},
|
|
166
|
+
requiredMark: {
|
|
167
|
+
type: Boolean,
|
|
168
|
+
default: !1
|
|
169
|
+
},
|
|
170
|
+
size: {
|
|
171
|
+
type: String,
|
|
172
|
+
default: "medium"
|
|
173
|
+
},
|
|
174
|
+
type: String,
|
|
175
|
+
unit: String
|
|
176
|
+
},
|
|
177
|
+
emits: ["update:modelValue"],
|
|
178
|
+
setup(e, { emit: n }) {
|
|
179
|
+
const t = e, p = m(), s = m(), f = $(), w = E(), j = m(!1), k = v(() => t.clearable && t.modelValue.length > 0 && !t.unit), V = v(() => w.default && w.default()), C = v(() => {
|
|
180
|
+
var u, o;
|
|
181
|
+
return !!((u = s.value) != null && u.closest("joy-wrapper")) || !!((o = s.value) != null && o.closest(".joy-wrapper"));
|
|
182
|
+
}), B = m(t.type);
|
|
183
|
+
q(() => {
|
|
184
|
+
B.value = t.unit ? "number" : t.unit || "text";
|
|
185
|
+
});
|
|
186
|
+
const i = {
|
|
187
|
+
onFocus: () => {
|
|
188
|
+
j.value = !0;
|
|
189
|
+
},
|
|
190
|
+
onBlur: () => {
|
|
191
|
+
j.value = !1;
|
|
192
|
+
},
|
|
193
|
+
onInput: (u) => {
|
|
194
|
+
let o = u.target.value;
|
|
195
|
+
n("update:modelValue", o);
|
|
196
|
+
},
|
|
197
|
+
clearValue: () => {
|
|
198
|
+
n("update:modelValue", "");
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
return (u, o) => (a(), r("div", {
|
|
202
|
+
ref_key: "root",
|
|
203
|
+
ref: s,
|
|
204
|
+
class: y([`joy-input--${t.size}`])
|
|
205
|
+
}, [
|
|
206
|
+
S("div", {
|
|
207
|
+
class: y([
|
|
208
|
+
"joy-input",
|
|
209
|
+
{
|
|
210
|
+
"joy-input--focusing": j.value,
|
|
211
|
+
"joy-input--disabled": l(f).disabled,
|
|
212
|
+
"joy-input--invalid": t.invalid,
|
|
213
|
+
"joy-input--valid": !t.invalid && !l(f).disabled
|
|
214
|
+
}
|
|
215
|
+
])
|
|
216
|
+
}, [
|
|
217
|
+
l(V) ? (a(), I(h, {
|
|
218
|
+
key: 0,
|
|
219
|
+
for: t.name,
|
|
220
|
+
required: t.required && t.requiredMark,
|
|
221
|
+
"optional-label": e.optionalLabel,
|
|
222
|
+
size: e.labelSize
|
|
223
|
+
}, {
|
|
224
|
+
default: J(() => [
|
|
225
|
+
g(u.$slots, "default", {}, void 0, !0)
|
|
226
|
+
]),
|
|
227
|
+
_: 3
|
|
228
|
+
}, 8, ["for", "required", "optional-label", "size"])) : c("", !0),
|
|
229
|
+
S("div", {
|
|
230
|
+
class: y([
|
|
231
|
+
"joy-input--wrapper",
|
|
232
|
+
{
|
|
233
|
+
"joy-input--wrapper-has-icon": !!t.icon,
|
|
234
|
+
"joy-input--wrapper---clearable": t.clearable,
|
|
235
|
+
"joy-input--wrapper-unit": !!t.unit,
|
|
236
|
+
"joy-input--wrapper-margin": !l(C)
|
|
237
|
+
}
|
|
238
|
+
])
|
|
239
|
+
}, [
|
|
240
|
+
S("input", x(u.$attrs, {
|
|
241
|
+
id: t.name,
|
|
242
|
+
ref_key: "input",
|
|
243
|
+
ref: p,
|
|
244
|
+
class: [
|
|
245
|
+
{
|
|
246
|
+
"joy-input--field-disabled": l(f).disabled,
|
|
247
|
+
"joy-input--field-invalid": t.invalid
|
|
248
|
+
}
|
|
249
|
+
],
|
|
250
|
+
type: B.value,
|
|
251
|
+
value: e.modelValue,
|
|
252
|
+
onFocus: o[0] || (o[0] = //@ts-ignore
|
|
253
|
+
(...d) => i.onFocus && i.onFocus(...d)),
|
|
254
|
+
onBlur: o[1] || (o[1] = //@ts-ignore
|
|
255
|
+
(...d) => i.onBlur && i.onBlur(...d)),
|
|
256
|
+
onInput: o[2] || (o[2] = //@ts-ignore
|
|
257
|
+
(...d) => i.onInput && i.onInput(...d))
|
|
258
|
+
}), null, 16, Y),
|
|
259
|
+
l(k) ? (a(), r("joy-icon", {
|
|
260
|
+
key: 0,
|
|
261
|
+
size: "xxsmall",
|
|
262
|
+
name: "cross",
|
|
263
|
+
class: "joy-input--clear",
|
|
264
|
+
onClick: o[3] || (o[3] = //@ts-ignore
|
|
265
|
+
(...d) => i.clearValue && i.clearValue(...d))
|
|
266
|
+
})) : c("", !0),
|
|
267
|
+
t.unit ? (a(), r("div", {
|
|
268
|
+
key: 1,
|
|
269
|
+
"data-unit": t.unit,
|
|
270
|
+
class: "joy-input--unit"
|
|
271
|
+
}, null, 8, ee)) : c("", !0)
|
|
272
|
+
], 2)
|
|
273
|
+
], 2)
|
|
274
|
+
], 2));
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
const ne = /* @__PURE__ */ b(te, [["__scopeId", "data-v-2249f4f9"]]), oe = /* @__PURE__ */ _({
|
|
278
|
+
__name: "JoyWrapper",
|
|
279
|
+
props: {
|
|
280
|
+
justify: {
|
|
281
|
+
type: String,
|
|
282
|
+
default: "flex-start"
|
|
283
|
+
},
|
|
284
|
+
align: {
|
|
285
|
+
type: String,
|
|
286
|
+
default: "center"
|
|
287
|
+
},
|
|
288
|
+
direction: {
|
|
289
|
+
type: String,
|
|
290
|
+
default: "row"
|
|
291
|
+
},
|
|
292
|
+
wrap: {
|
|
293
|
+
type: String,
|
|
294
|
+
default: "wrap"
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
setup(e) {
|
|
298
|
+
return (n, t) => (a(), r("div", {
|
|
299
|
+
class: y([
|
|
300
|
+
"joy-wrapper",
|
|
301
|
+
`joy-wrapper--justify-${e.justify}`,
|
|
302
|
+
`joy-wrapper--align-${e.align}`,
|
|
303
|
+
`joy-wrapper--direction-${e.direction}`,
|
|
304
|
+
`joy-wrapper--wrap-${e.wrap}`
|
|
305
|
+
])
|
|
306
|
+
}, [
|
|
307
|
+
g(n.$slots, "default")
|
|
308
|
+
], 2));
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
const le = {
|
|
312
|
+
install: (e) => {
|
|
313
|
+
e.component("JoyButton", G), e.component("JoyInput", ne), e.component("JoyLabel", h), e.component("JoySpinner", z), e.component("JoyWrapper", oe);
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
export {
|
|
317
|
+
le as default
|
|
318
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,d){typeof exports=="object"&&typeof module<"u"?module.exports=d(require("vue")):typeof define=="function"&&define.amd?define(["vue"],d):(e=typeof globalThis<"u"?globalThis:e||self,e["@maltjoy/core-vue"]=d(e.Vue))})(this,function(e){"use strict";const d=["teal","white"],g=e.defineComponent({__name:"JoySpinner",props:{color:{type:String,validator(t){return d.includes(t)}}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["joy-spinner",`joy-spinner_${t.color}`])},null,2))}}),P="",p=(t,o)=>{const n=t.__vccOpts||t;for(const[c,r]of o)n[c]=r;return n},m=p(g,[["__scopeId","data-v-e97b61a5"]]),B=["primary","secondary"],b=["xlarge","large","medium","small","xsmall","xxsmall"],j=["main","admin","white","ghost"],k=[...B,...j],C=[...b],w=["xxsmall","xsmall","small"],I=["name","size"],V={class:"joy-button--slot"},$=e.defineComponent({__name:"JoyButton",props:{circle:{type:Boolean,default:!1},icon:String,loading:{type:Boolean,default:!1},variant:{type:String,default:"primary",validator(t){return k.includes(t)}},size:{type:String,default:"medium",validator(t){return C.includes(t)}},iconSize:{type:String,default:"xsmall",validator(t){return w.includes(t)}}},setup(t){const o=t,n=e.useAttrs(),c=e.computed(()=>["white","ghost","secondary"].includes(o.variant)?"teal":"white");return(r,u)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(n).href?"a":"button"),{disabled:t.loading||e.unref(n).disabled,class:e.normalizeClass(["joy-button",`joy-button_${t.variant}`,`joy-button_${t.size}`,{"joy-button_circle":o.circle,"joy-button_loading":o.loading}])},{default:e.withCtx(()=>[t.icon?(e.openBlock(),e.createElementBlock("joy-icon",{key:0,name:t.icon,size:t.iconSize,lazy:!1},null,8,I)):e.createCommentVNode("",!0),t.loading?(e.openBlock(),e.createBlock(m,{key:1,color:e.unref(c)},null,8,["color"])):e.createCommentVNode("",!0),e.createElementVNode("span",V,[e.renderSlot(r.$slots,"default",{},void 0,!0)])]),_:3},8,["disabled","class"]))}}),W="",z=p($,[["__scopeId","data-v-107b2043"]]),E=["small","medium","large"],x={key:0,class:"joy-label-required"},N={key:1,class:"joy-label-optional"},h=e.defineComponent({__name:"JoyLabel",props:{size:{type:String,default:"medium",validator(t){return E.includes(t)}},required:{type:Boolean,default:!1},optionalLabel:{type:String}},setup(t){const o=t;return(n,c)=>(e.openBlock(),e.createElementBlock("label",e.mergeProps({class:["joy-label",`joy-label--${t.size}`]},n.$attrs),[e.renderSlot(n.$slots,"default",{},void 0,!0),o.required?(e.openBlock(),e.createElementBlock("span",x,"*")):e.createCommentVNode("",!0),o.optionalLabel?(e.openBlock(),e.createElementBlock("span",N," - "+e.toDisplayString(o.optionalLabel),1)):e.createCommentVNode("",!0)],16))}}),Z="",f=p(h,[["__scopeId","data-v-21392cc3"]]),J=["id","type","value"],L=["data-unit"],T=e.defineComponent({__name:"JoyInput",props:{clearable:{type:Boolean,default:!1},icon:String,invalid:{type:Boolean,default:!1},labelSize:String,modelValue:{type:String,default:""},name:{type:String,required:!0},optionalLabel:String,required:{type:Boolean,default:!1},requiredMark:{type:Boolean,default:!1},size:{type:String,default:"medium"},type:String,unit:String},emits:["update:modelValue"],setup(t,{emit:o}){const n=t,c=e.ref(),r=e.ref(),u=e.useAttrs(),_=e.useSlots(),y=e.ref(!1),O=e.computed(()=>n.clearable&&n.modelValue.length>0&&!n.unit),F=e.computed(()=>_.default&&_.default()),R=e.computed(()=>{var i,l;return!!((i=r.value)!=null&&i.closest("joy-wrapper"))||!!((l=r.value)!=null&&l.closest(".joy-wrapper"))}),S=e.ref(n.type);e.onBeforeMount(()=>{S.value=n.unit?"number":n.unit||"text"});const a={onFocus:()=>{y.value=!0},onBlur:()=>{y.value=!1},onInput:i=>{let l=i.target.value;o("update:modelValue",l)},clearValue:()=>{o("update:modelValue","")}};return(i,l)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"root",ref:r,class:e.normalizeClass([`joy-input--${n.size}`])},[e.createElementVNode("div",{class:e.normalizeClass(["joy-input",{"joy-input--focusing":y.value,"joy-input--disabled":e.unref(u).disabled,"joy-input--invalid":n.invalid,"joy-input--valid":!n.invalid&&!e.unref(u).disabled}])},[e.unref(F)?(e.openBlock(),e.createBlock(f,{key:0,for:n.name,required:n.required&&n.requiredMark,"optional-label":t.optionalLabel,size:t.labelSize},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default",{},void 0,!0)]),_:3},8,["for","required","optional-label","size"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["joy-input--wrapper",{"joy-input--wrapper-has-icon":!!n.icon,"joy-input--wrapper---clearable":n.clearable,"joy-input--wrapper-unit":!!n.unit,"joy-input--wrapper-margin":!e.unref(R)}])},[e.createElementVNode("input",e.mergeProps(i.$attrs,{id:n.name,ref_key:"input",ref:c,class:[{"joy-input--field-disabled":e.unref(u).disabled,"joy-input--field-invalid":n.invalid}],type:S.value,value:t.modelValue,onFocus:l[0]||(l[0]=(...s)=>a.onFocus&&a.onFocus(...s)),onBlur:l[1]||(l[1]=(...s)=>a.onBlur&&a.onBlur(...s)),onInput:l[2]||(l[2]=(...s)=>a.onInput&&a.onInput(...s))}),null,16,J),e.unref(O)?(e.openBlock(),e.createElementBlock("joy-icon",{key:0,size:"xxsmall",name:"cross",class:"joy-input--clear",onClick:l[3]||(l[3]=(...s)=>a.clearValue&&a.clearValue(...s))})):e.createCommentVNode("",!0),n.unit?(e.openBlock(),e.createElementBlock("div",{key:1,"data-unit":n.unit,class:"joy-input--unit"},null,8,L)):e.createCommentVNode("",!0)],2)],2)],2))}}),D="",q=p(T,[["__scopeId","data-v-2249f4f9"]]),A=e.defineComponent({__name:"JoyWrapper",props:{justify:{type:String,default:"flex-start"},align:{type:String,default:"center"},direction:{type:String,default:"row"},wrap:{type:String,default:"wrap"}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["joy-wrapper",`joy-wrapper--justify-${t.justify}`,`joy-wrapper--align-${t.align}`,`joy-wrapper--direction-${t.direction}`,`joy-wrapper--wrap-${t.wrap}`])},[e.renderSlot(o.$slots,"default")],2))}}),M="";return{install:t=>{t.component("JoyButton",z),t.component("JoyInput",q),t.component("JoyLabel",f),t.component("JoySpinner",m),t.component("JoyWrapper",A)}}});
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.joy-spinner[data-v-e97b61a5]{--spinner-default-color: var(--joy-color-secondary-50);--spinner-default-bg-color: var(--joy-color-secondary-10);--spinner-size: 25px;width:var(--spinner-size);height:var(--spinner-size);box-sizing:border-box;border-top:3px solid var(--spinner-default-bg-color);border-right:3px solid var(--spinner-default-bg-color);border-bottom:3px solid var(--spinner-default-bg-color);border-left:3px solid var(--spinner-default-color);position:absolute;margin:auto;font-size:10px;text-indent:-9999em;transform:translateZ(0);-webkit-animation:load8-e97b61a5 1.1s infinite linear;animation:load8-e97b61a5 1.1s infinite linear}.joy-spinner[data-v-e97b61a5],.joy-spinner[data-v-e97b61a5]:after{border-radius:50%;width:var(--spinner-size);height:var(--spinner-size)}@-webkit-keyframes load8-e97b61a5{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes load8-e97b61a5{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.joy-spinner_white[data-v-e97b61a5]{--spinner-default-color: #ffffff;--spinner-default-bg-color: rgba(255, 255, 255, .2)}.joy-button[data-v-107b2043]{--button-bg-color-main: var(--joy-color-primary-50);--button-bg-color-main-hover: var(--joy-color-primary-70);--button-bg-color-main-active: var(--joy-color-primary-90);--button-bg-color-primary: var(--joy-color-secondary-30);--button-bg-color-primary-hover: var(--joy-color-secondary-50);--button-bg-color-primary-active: var(--joy-color-secondary-90);--button-color-secondary: var(--joy-color-secondary-50);--button-color-secondary-active: var(--joy-color-secondary-90);--button-color-secondary-disabled: var(--joy-color-neutral-40);--button-border-color-secondary-disabled: var(--joy-color-neutral-30);--button-bg-color-secondary-hover: var(--joy-color-secondary-10);--button-color-ghost: var(--joy-color-secondary-50);--button-color-ghost-hover: var(--joy-color-secondary-50);--button-bg-color-ghost-hover: var(--joy-color-neutral-10);--button-color-ghost-active: var(--joy-color-secondary-50);--button-bg-color-ghost-active: var(--joy-color-secondary-10);--button-color-white: var(--joy-color-secondary-50);--button-color-white-hover: var(--joy-color-secondary-50);--button-color-white-active: var(--joy-color-secondary-90);--button-bg-color-white-hover: var(--joy-color-neutral-10);--button-bg-color-white-active: var(--joy-color-neutral-20);--button-icon-color-white-hover: var(--joy-color-secondary-90);--button-bg-color-admin: var(--joy-color-quaternary-50);--button-focus-border-color: var(--joy-color-neutral-60);--button-font-family: var(--joy-font-family);--button-bg-color-disabled: var(--joy-color-neutral-30);--button-color-disabled: var(--joy-color-neutral-40);--button-border-color-disabled: var(--joy-color-neutral-30);--button-icon-color-disabled: var(--joy-color-neutral-40);display:inline-flex;position:relative;justify-content:center;align-items:center;flex-wrap:nowrap;white-space:nowrap;box-sizing:border-box;font-family:var(--button-font-family);line-height:1;z-index:1;border:none;transition:background-color var(--joy-transition-duration-long),border var(--joy-transition-duration-long);text-decoration:none;text-align:center;cursor:pointer;outline:none;opacity:1}.joy-button joy-icon[data-v-107b2043]{margin-right:var(--joy-core-spacing-2);color:inherit}.joy-button[data-v-107b2043]:after{content:"";position:absolute;left:-4px;top:-4px;width:calc(100% + 8px);height:calc(100% + 8px);transition:box-shadow var(--joy-transition-duration-default)}.joy-button[data-v-107b2043]:focus-visible:after{box-shadow:0 0 0 2px var(--button-focus-border-color)}.joy-button *[data-v-107b2043]{pointer-events:none}.joy-button.disabled[data-v-107b2043],.joy-button[data-v-107b2043]:disabled,.joy-button[disabled][data-v-107b2043]:hover{background-color:var(--button-bg-color-disabled);color:var(--button-color-disabled);border-color:var(--button-border-color-disabled);cursor:not-allowed}.joy-button.disabled joy-icon[data-v-107b2043],.joy-button:disabled joy-icon[data-v-107b2043],.joy-button[disabled]:hover joy-icon[data-v-107b2043]{color:var(--button-icon-color-disabled)}.joy-button.joy-button_loading[data-v-107b2043]{cursor:not-allowed;color:transparent}.joy-button.joy-button_loading[data-v-107b2043]:hover{color:transparent}.joy-button.joy-button_loading joy-icon[data-v-107b2043]{color:transparent}.joy-button joy-spinner[data-v-107b2043]{position:absolute;margin:auto}.joy-button.joy-button_circle[data-v-107b2043]{padding:0;min-width:auto;border-radius:var(--joy-core-radius-5)}.joy-button.joy-button_circle joy-icon[data-v-107b2043]{margin:0}.joy-button.joy-button_circle .joy-button--slot[data-v-107b2043]{display:none}.joy-button_main[data-v-107b2043]{background-color:var(--button-bg-color-main);color:#fff}.joy-button_main[data-v-107b2043]:hover{background-color:var(--button-bg-color-main-hover)}.joy-button_main[data-v-107b2043]:active{background-color:var(--button-bg-color-main-active)}.joy-button_primary[data-v-107b2043]{background-color:var(--button-bg-color-primary);color:#fff}.joy-button_primary[data-v-107b2043]:hover{background-color:var(--button-bg-color-primary-hover)}.joy-button_primary[data-v-107b2043]:active{background-color:var(--button-bg-color-primary-active)}.joy-button_secondary[data-v-107b2043]{background-color:transparent;color:var(--button-color-secondary);border:2px solid var(--button-color-secondary)}.joy-button_secondary[data-v-107b2043]:hover,.joy-button_secondary[data-v-107b2043]:active{background-color:var(--button-bg-color-secondary-hover)}.joy-button_secondary[data-v-107b2043]:active{color:var(--button-bg-color-secondary-active);border-color:var(--button-bg-color-secondary-active)}.joy-button_secondary.disabled[data-v-107b2043],.joy-button_secondary[data-v-107b2043]:disabled,.joy-button_secondary[disabled][data-v-107b2043]:hover{cursor:not-allowed;color:var(--button-color-secondary-disabled);border-color:var(--button-border-color-secondary-disabled);background-color:#fff}.joy-button_white[data-v-107b2043]{color:var(--button-color-white);background-color:#fff}.joy-button_white[data-v-107b2043]:hover{color:var(--button-color-white-hover);background-color:var(--button-bg-color-white-hover)}.joy-button_white[data-v-107b2043]:active{color:var(--button-color-white-active);background-color:var(--button-bg-color-white-active)}.joy-button_white:not(:disabled):hover joy-icon[data-v-107b2043]{color:var(--button-icon-color-white-hover)}.joy-button_ghost[data-v-107b2043]{color:var(--button-color-ghost);background-color:transparent}.joy-button_ghost[data-v-107b2043]:hover{color:var(--button-color-ghost-hover);background-color:var(--button-bg-color-ghost-hover)}.joy-button_ghost[data-v-107b2043]:active{color:var(--button-color-ghost-active);background-color:var(--button-bg-color-ghost-active)}.joy-button_ghost:not(:disabled):hover joy-icon[data-v-107b2043]{color:var(--button-color-ghost-hover)}.joy-button_ghost[data-v-107b2043]:disabled,.joy-button_ghost[data-v-107b2043]:disabled:hover{background-color:transparent}.joy-button_admin[data-v-107b2043]{color:#fff;background-color:var(--button-bg-color-admin)}.joy-button_xxsmall[data-v-107b2043]{min-height:var(--joy-form-field-height-xxsmall);padding:var(--button-padding, var(--joy-core-spacing-2) var(--joy-core-spacing-4));font-size:var(--button-font-size, var(--joy-font-size-primary-100));border-radius:var(--button-border-radius, var(--joy-form-field-radius-xxsmall))}.joy-button_xxsmall .joy-spinner[data-v-107b2043]{--spinner-size: 12px}.joy-button_xxsmall[data-v-107b2043]:after{border-radius:calc(var(--joy-form-field-radius-xxsmall) + 2px)}.joy-button_xxsmall.joy-button_circle[data-v-107b2043]{width:var(--joy-form-field-height-xxsmall)}.joy-button_xsmall[data-v-107b2043]{min-height:var(--joy-form-field-height-xsmall);padding:var(--button-padding, var(--joy-core-spacing-2) var(--joy-core-spacing-8));font-size:var(--button-font-size, var(--joy-font-size-primary-200));border-radius:var(--button-border-radius, var(--joy-form-field-radius-xsmall))}.joy-button_xsmall .joy-spinner[data-v-107b2043]{--spinner-size: 16px}.joy-button_xsmall[data-v-107b2043]:after{border-radius:calc(var(--joy-form-field-radius-xsmall) + 2px)}.joy-button_xsmall.joy-button_circle[data-v-107b2043]{width:var(--joy-form-field-height-xsmall)}.joy-button_small[data-v-107b2043]{min-height:var(--joy-form-field-height-small);padding:var(--button-padding, var(--joy-core-spacing-3) var(--joy-core-spacing-9));font-size:var(--button-font-size, var(--joy-font-size-primary-300));border-radius:var(--button-border-radius, var(--joy-form-field-radius-small))}.joy-button_small .joy-spinner[data-v-107b2043]{--spinner-size: 20px}.joy-button_small[data-v-107b2043]:after{border-radius:calc(var(--joy-form-field-radius-small) + 2px)}.joy-button_small.joy-button_circle[data-v-107b2043]{width:var(--joy-form-field-height-small)}.joy-button_medium[data-v-107b2043]{min-height:var(--joy-form-field-height-medium);padding:var(--button-padding, var(--joy-core-spacing-3) var(--joy-core-spacing-9));font-size:var(--button-font-size, var(--joy-font-size-primary-400));border-radius:var(--button-border-radius, var(--joy-form-field-radius-medium))}.joy-button_medium[data-v-107b2043]:after{border-radius:calc(var(--joy-form-field-radius-medium) + 2px)}.joy-button_medium.joy-button_circle[data-v-107b2043]{width:var(--joy-form-field-height-medium)}.joy-button_large[data-v-107b2043]{min-height:var(--joy-form-field-height-large);padding:var(--button-padding, var(--joy-core-spacing-4) var(--joy-core-spacing-9));font-size:var(--button-font-size, var(--joy-font-size-primary-600));border-radius:var(--button-border-radius, var(--joy-form-field-radius-large));min-width:calc(var(--joy-core-spacing-base) * 40)}.joy-button_large[data-v-107b2043]:after{border-radius:calc(var(--joy-form-field-radius-large) + 2px)}.joy-button_large.joy-button_circle[data-v-107b2043]{width:var(--joy-form-field-height-large)}.joy-label[data-v-21392cc3]{--label-font-size: var(--joy-font-size-primary-400);display:block;width:100%;box-sizing:border-box;font-weight:var(--joy-font-weight-normal);line-height:var(--joy-line-height-large);font-size:var(--label-font-size);font-family:var(--joy-font-family);color:var(--joy-color-text-title);text-align:left;margin-bottom:var(--joy-core-spacing-2)}.joy-label--small[data-v-21392cc3]{--label-font-size: var(--joy-font-size-primary-300)}.joy-label--medium[data-v-21392cc3]{--label-font-size: var(--joy-font-size-primary-400)}.joy-label--large[data-v-21392cc3]{--label-font-size: var(--joy-font-size-primary-600)}.joy-label-required[data-v-21392cc3]{margin-left:var(--joy-core-spacing-1);font-size:var(--label-font-size);line-height:1}.joy-label-optional[data-v-21392cc3]{font-size:var(--joy-font-size-primary-300);font-style:italic;color:var(--joy-color-neutral-40)}.joy-input--small[data-v-2249f4f9]{--input-height: var(--joy-form-field-height-small);--input-radius: var(--joy-form-field-radius-small);--input-padding: var(--joy-core-spacing-2) var(--joy-core-spacing-5);--input-font-size: var(--joy-font-size-primary-200);--input-unit-height: 32px}.joy-input--medium[data-v-2249f4f9]{--input-height: var(--joy-form-field-height-medium);--input-radius: var(--joy-form-field-radius-medium);--input-padding: var(--joy-core-spacing-3) var(--joy-core-spacing-5);--input-font-size: var(--joy-font-size-primary-300);--input-unit-height: 40px}.joy-input--large[data-v-2249f4f9]{--input-height: var(--joy-form-field-height-large);--input-radius: var(--joy-form-field-radius-large);--input-padding: var(--joy-core-spacing-3) var(--joy-core-spacing-5);--input-font-size: var(--joy-font-size-primary-400);--input-unit-height: 56px}.joy-input[data-v-2249f4f9]{display:block;--input-color: var(--joy-color-neutral-60);--input-focus-color: var(--joy-color-secondary-30);--input-hover-color: var(--joy-color-neutral-60);--input-hover-border-color: var(--joy-color-state-hover);--input-focus-border-color: var(--joy-color-state-focus);--input-border-color: var(--joy-color-neutral-30);--input-bg-color: white;--input-color-disabled: var(--joy-color-neutral-40);--input-border-color-disabled: var(--joy-color-neutral-30);--input-bg-color-disabled: var(--joy-color-neutral-10);--input-color-invalid: var(--joy-color-error-50);--input-color-invalid-hover: var(--joy-color-error-90);--input-icon-color: var(--joy-color-neutral-50);--input-transition-duration: var(--joy-transition-duration-default);position:relative;font-family:var(--joy-font-family)}.joy-input input[data-v-2249f4f9]{position:relative;z-index:1;appearance:none;width:100%;box-sizing:border-box;background-color:var(--input-bg-color);border-width:var(--joy-form-border-width);border-style:solid;border-color:var(--input-border-color);transition:all var(--input-transition-duration) var(--joy-transition-timing-function);border-radius:var(--input-radius);height:var(--input-height);color:var(--input-color);font-size:var(--input-font-size);padding:var(--input-padding);outline:none}.joy-input input[data-v-2249f4f9]::-webkit-input-placeholder{color:var(--joy-color-neutral-40)}.joy-input input[data-v-2249f4f9]::-webkit-outer-spin-button,.joy-input input[data-v-2249f4f9]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.joy-input input[data-v-2249f4f9]::-webkit-search-cancel-button{appearance:none}.joy-input input[type=number][data-v-2249f4f9]{-moz-appearance:textfield}.joy-input input[type=password][data-v-2249f4f9]{font-family:Verdana;letter-spacing:.125em}.joy-input input[data-v-2249f4f9]:hover{border-color:var(--joy-color-state-hover)}.joy-input input:hover~joy-icon[data-v-2249f4f9]{color:var(--input-hover-color)}.joy-input input:hover~.joy-input--unit[data-v-2249f4f9]{border-color:var(--input-hover-color)}.joy-input input[data-v-2249f4f9]{transition:border-color var(--joy-transition-duration-default) var(--joy-transition-timing-function)}.joy-input input[data-v-2249f4f9]:focus{border-color:var(--joy-color-state-focus)}.joy-input input:focus~joy-icon[data-v-2249f4f9]{color:var(--input-focus-color)}.joy-input input:focus~.joy-input--unit[data-v-2249f4f9]{border-color:var(--input-focus-border-color)}.joy-input joy-icon[data-v-2249f4f9]{color:var(--input-color)}.joy-input .joy-input--password-icon[data-v-2249f4f9]{z-index:2;position:absolute;top:50%;transform:translateY(-50%);cursor:pointer;right:var(--joy-core-spacing-4)}.joy-input .joy-input--wrapper[data-v-2249f4f9]{display:flex;align-items:center;position:relative}.joy-input .joy-input--wrapper-margin[data-v-2249f4f9]{margin-bottom:var(--joy-core-spacing-4)}.joy-input .joy-input--wrapper-has-icon joy-icon[data-v-2249f4f9]{z-index:2;position:absolute;top:50%;transform:translateY(-50%);user-select:none;left:var(--joy-core-spacing-4)}.joy-input .joy-input--wrapper-has-icon input[data-v-2249f4f9]{padding-left:var(--joy-core-spacing-10)}.joy-input .joy-input--wrapper-unit input[data-v-2249f4f9]{border-right:0;border-bottom-right-radius:0;border-top-right-radius:0}.joy-input .joy-input--unit[data-v-2249f4f9]{display:flex;align-items:center;padding-right:4px;cursor:default;position:relative;background-color:var(--input-bg-color);height:var(--input-height);border-radius:0 var(--input-height) var(--input-height) 0;text-align:center;font-style:normal;flex-shrink:0;box-sizing:border-box;border-width:var(--joy-form-border-width);border-style:solid;border-color:var(--input-border-color);transition:all var(--input-transition-duration) var(--joy-transition-timing-function);border-left:0}.joy-input .joy-input--unit[data-v-2249f4f9]:before{content:attr(data-unit);display:flex;box-sizing:border-box;align-items:center;justify-content:center;position:relative;background-color:var(--joy-color-secondary-10);border-radius:var(--input-unit-height);font-size:var(--input-font-size);height:var(--input-unit-height);min-width:var(--input-unit-height);padding:0 var(--joy-core-spacing-3);color:var(--joy-color-secondary-50)}.joy-input input[data-v-2249f4f9]:disabled,.joy-input input[data-v-2249f4f9]:disabled:hover{cursor:not-allowed;background-color:var(--input-bg-color-disabled);border-color:var(--input-border-color-disabled);color:var(--input-color-disabled)}.joy-input input:disabled~joy-icon[data-v-2249f4f9],.joy-input input:disabled:hover~joy-icon[data-v-2249f4f9]{color:var(--input-color-disabled)}.joy-input input:disabled~.joy-input--unit[data-v-2249f4f9],.joy-input input:disabled:hover~.joy-input--unit[data-v-2249f4f9]{background-color:var(--input-bg-color-disabled);border-color:var(--input-border-color-disabled)}.joy-input input.joy-input--field-invalid[data-v-2249f4f9]{border-color:var(--input-color-invalid);color:var(--input-color-invalid)}.joy-input input.joy-input--field-invalid~joy-icon[data-v-2249f4f9]{color:var(--input-color-invalid)}.joy-input input.joy-input--field-invalid~.joy-input--unit[data-v-2249f4f9]{border-color:var(--input-color-invalid)}.joy-input input.joy-input--field-invalid[data-v-2249f4f9]:hover,.joy-input input.joy-input--field-invalid[data-v-2249f4f9]:focus{border-color:var(--input-color-invalid-hover)}.joy-input input.joy-input--field-invalid:hover~joy-icon[data-v-2249f4f9],.joy-input input.joy-input--field-invalid:focus~joy-icon[data-v-2249f4f9]{color:var(--input-color-invalid-hover)}.joy-input input.joy-input--field-invalid:hover~.joy-input--unit[data-v-2249f4f9],.joy-input input.joy-input--field-invalid:focus~.joy-input--unit[data-v-2249f4f9]{border-color:var(--input-color-invalid-hover)}.joy-input--wrapper---clearable input[data-v-2249f4f9]{padding-right:var(--joy-core-spacing-10)}.joy-input--clear[data-v-2249f4f9]{cursor:pointer;position:absolute;top:50%;z-index:2;right:var(--joy-core-spacing-5);transform:translateY(-50%)}.joy-wrapper{--wrapper-gap: var(--joy-core-spacing-8) var(--joy-core-spacing-4);display:flex;gap:var(--wrapper-gap);flex-wrap:wrap;margin-bottom:var(--joy-core-spacing-8)}.joy-wrapper--justify-flex-start{justify-content:flex-start}.joy-wrapper--justify-flex-end{justify-content:flex-end}.joy-wrapper--justify-center{justify-content:center}.joy-wrapper--justify-space-between{justify-content:space-between}.joy-wrapper--align-flex-start{align-items:flex-start}.joy-wrapper--align-flex-end{align-items:flex-end}.joy-wrapper--align-center{align-items:center}.joy-wrapper--align-stretch{align-items:stretch}.joy-wrapper--direction-row{flex-direction:row}.joy-wrapper--direction-column{flex-direction:column}.joy-wrapper--wrap-wrap{flex-wrap:wrap}.joy-wrapper--wrap-nowrap{flex-wrap:nowrap}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Here we can store the types that are commonly used by many components.
|
|
3
|
+
* We use the same naming convention for size, levels or colors, so let's gather everything here.
|
|
4
|
+
* Each component will start from these types and enrich them locally to pick what's nedeed.
|
|
5
|
+
*/
|
|
6
|
+
export declare const GENERIC_VARIANTS: readonly ["primary", "secondary"];
|
|
7
|
+
export declare const SIZES: readonly ["xlarge", "large", "medium", "small", "xsmall", "xxsmall"];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
declare module "vue" {
|
|
3
|
+
export interface GlobalComponents {
|
|
4
|
+
JoyButton: typeof import("./dist/components/JoyButton/JoyButton.vue")["default"];
|
|
5
|
+
JoySpinner: typeof import("./dist/components/JoySpinner/JoySpinner.vue")["default"];
|
|
6
|
+
JoyInput: typeof import("./dist/components/JoyInput/JoyInput.vue")["default"];
|
|
7
|
+
JoyLabel: typeof import("./dist/components/JoyLabel/JoyLabel.vue")["default"];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maltjoy/core-vue",
|
|
3
|
+
"version": "1.0.0-alpha.1.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist",
|
|
7
|
+
"index.d.ts",
|
|
8
|
+
"joy-components.d.ts"
|
|
9
|
+
],
|
|
10
|
+
"main": "./dist/joy-vue.umd.cjs",
|
|
11
|
+
"module": "./dist/joy-vue.js",
|
|
12
|
+
"types": "./index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./dist/joy-vue.js",
|
|
16
|
+
"require": "./dist/joy-vue.umd.cjs"
|
|
17
|
+
},
|
|
18
|
+
"./dist/style.css": "./dist/style.css"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"dev": "vite",
|
|
22
|
+
"build": "vue-tsc && vite build",
|
|
23
|
+
"preview": "vite preview",
|
|
24
|
+
"test": "vitest --dom --coverage",
|
|
25
|
+
"lint": "eslint --ext .ts,.vue src",
|
|
26
|
+
"lint:fix": "eslint --ext .ts,.vue src --fix",
|
|
27
|
+
"format": "prettier --write \"**/*.{js,ts,vue}\"",
|
|
28
|
+
"format:staged": "prettier --write"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@maltjoy/themes": "^2.1.2",
|
|
32
|
+
"vue": "3.2.45"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@rushstack/eslint-patch": "^1.2.0",
|
|
36
|
+
"@typescript-eslint/parser": "5.51.0",
|
|
37
|
+
"@vitejs/plugin-vue": "^4.0.0",
|
|
38
|
+
"@vitest/coverage-istanbul": "^0.28.4",
|
|
39
|
+
"@vue/runtime-core": "3.2.45",
|
|
40
|
+
"@vue/runtime-dom": "3.2.45",
|
|
41
|
+
"@vue/test-utils": "^2.2.10",
|
|
42
|
+
"eslint": "7.22.0",
|
|
43
|
+
"eslint-config-prettier": "^8.6.0",
|
|
44
|
+
"eslint-plugin-vue": "^9.9.0",
|
|
45
|
+
"happy-dom": "^8.2.6",
|
|
46
|
+
"prettier": "^2.8.3",
|
|
47
|
+
"typescript": "^4.9.3",
|
|
48
|
+
"vite": "^4.0.0",
|
|
49
|
+
"vite-plugin-dts": "^1.7.2",
|
|
50
|
+
"vitest": "^0.28.4",
|
|
51
|
+
"vue-tsc": "^1.0.11"
|
|
52
|
+
}
|
|
53
|
+
}
|