@frollo/frollo-web-ui 0.0.2 → 0.0.5
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/cjs/index.js +585 -94
- package/esm/fw-button-0f8956b5.js +1323 -0
- package/esm/fw-button.js +2 -0
- package/esm/fw-navigation-menu.js +203 -0
- package/esm/index.js +30 -1021
- package/frollo-web-ui.esm.js +619 -96
- package/index.d.ts +143 -3
- package/package.json +3 -2
- package/tailwind.config.js +4 -2
- package/types/components/fw-button/fw-button.vue.d.ts +98 -0
- package/types/components/fw-button/index.d.ts +2 -0
- package/types/components/fw-navigation-menu/fw-navigation-menu.vue.d.ts +44 -0
- package/types/components/fw-navigation-menu/index.d.ts +2 -0
- package/types/components/index.d.ts +3 -1
- package/types/index-types.esm.d.ts +6 -0
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import { Plugin } from 'vue';
|
|
2
|
+
import { PropType, Plugin } from 'vue';
|
|
3
3
|
|
|
4
|
-
declare const _default: vue.DefineComponent<{
|
|
4
|
+
declare const _default$2: vue.DefineComponent<{
|
|
5
5
|
/**
|
|
6
6
|
* The header title of the card
|
|
7
7
|
*/
|
|
@@ -29,6 +29,146 @@ declare const _default: vue.DefineComponent<{
|
|
|
29
29
|
};
|
|
30
30
|
}>>, {}>;
|
|
31
31
|
|
|
32
|
+
declare type ButtonVariantName = 'primary' | 'secondary' | 'tertiary' | 'error' | 'success' | 'text';
|
|
33
|
+
interface ButtonDefinition {
|
|
34
|
+
text: string;
|
|
35
|
+
background: string;
|
|
36
|
+
border: string;
|
|
37
|
+
}
|
|
38
|
+
declare type ButtonDefinitionList = {
|
|
39
|
+
[key in ButtonVariantName]: ButtonDefinition;
|
|
40
|
+
};
|
|
41
|
+
declare type ButtonSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
42
|
+
declare type ButtonSizes = {
|
|
43
|
+
[key in ButtonSize]: string;
|
|
44
|
+
};
|
|
45
|
+
interface FwButtonProps {
|
|
46
|
+
to?: string | object;
|
|
47
|
+
href?: string;
|
|
48
|
+
size?: ButtonSize;
|
|
49
|
+
variant?: ButtonVariantName;
|
|
50
|
+
}
|
|
51
|
+
declare const _default$1: vue.DefineComponent<{
|
|
52
|
+
/**
|
|
53
|
+
* A `router-link` path or object
|
|
54
|
+
*/
|
|
55
|
+
to: {
|
|
56
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* A URL to link to using a native anchor element
|
|
60
|
+
*/
|
|
61
|
+
href: StringConstructor;
|
|
62
|
+
/**
|
|
63
|
+
* The size of the button. Accepts: 'sm', 'md', 'lg', 'xl', '2xl'
|
|
64
|
+
*/
|
|
65
|
+
size: {
|
|
66
|
+
type: PropType<ButtonSize>;
|
|
67
|
+
default: string;
|
|
68
|
+
validator: (value: string) => boolean;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* The colour variant of the button.
|
|
72
|
+
* Accepts 'primary', 'secondary', 'tertiary', 'error', 'success'
|
|
73
|
+
*/
|
|
74
|
+
variant: {
|
|
75
|
+
type: PropType<ButtonVariantName>;
|
|
76
|
+
default: string;
|
|
77
|
+
validator: (value: string) => boolean;
|
|
78
|
+
};
|
|
79
|
+
}, {
|
|
80
|
+
textColorClass: vue.ComputedRef<string>;
|
|
81
|
+
bgColorClass: vue.ComputedRef<string>;
|
|
82
|
+
sizeClass: vue.ComputedRef<string>;
|
|
83
|
+
borderClass: vue.ComputedRef<string>;
|
|
84
|
+
onClick: (this: GlobalEventHandlers, ev: MouseEvent) => any;
|
|
85
|
+
onMouseover: (this: GlobalEventHandlers, ev: MouseEvent) => any;
|
|
86
|
+
onMouseout: (this: GlobalEventHandlers, ev: MouseEvent) => any;
|
|
87
|
+
onFocusin: (this: GlobalEventHandlers, ev: FocusEvent) => any;
|
|
88
|
+
onFocusout: (this: GlobalEventHandlers, ev: FocusEvent) => any;
|
|
89
|
+
tagName: vue.ComputedRef<"router-link" | "a" | "button">;
|
|
90
|
+
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("click" | "mouseover" | "mouseout" | "focusin" | "focusout")[], "click" | "mouseover" | "mouseout" | "focusin" | "focusout", vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
91
|
+
/**
|
|
92
|
+
* A `router-link` path or object
|
|
93
|
+
*/
|
|
94
|
+
to: {
|
|
95
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* A URL to link to using a native anchor element
|
|
99
|
+
*/
|
|
100
|
+
href: StringConstructor;
|
|
101
|
+
/**
|
|
102
|
+
* The size of the button. Accepts: 'sm', 'md', 'lg', 'xl', '2xl'
|
|
103
|
+
*/
|
|
104
|
+
size: {
|
|
105
|
+
type: PropType<ButtonSize>;
|
|
106
|
+
default: string;
|
|
107
|
+
validator: (value: string) => boolean;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* The colour variant of the button.
|
|
111
|
+
* Accepts 'primary', 'secondary', 'tertiary', 'error', 'success'
|
|
112
|
+
*/
|
|
113
|
+
variant: {
|
|
114
|
+
type: PropType<ButtonVariantName>;
|
|
115
|
+
default: string;
|
|
116
|
+
validator: (value: string) => boolean;
|
|
117
|
+
};
|
|
118
|
+
}>> & {
|
|
119
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
120
|
+
onMouseover?: ((...args: any[]) => any) | undefined;
|
|
121
|
+
onMouseout?: ((...args: any[]) => any) | undefined;
|
|
122
|
+
onFocusin?: ((...args: any[]) => any) | undefined;
|
|
123
|
+
onFocusout?: ((...args: any[]) => any) | undefined;
|
|
124
|
+
}, {
|
|
125
|
+
size: ButtonSize;
|
|
126
|
+
variant: ButtonVariantName;
|
|
127
|
+
}>;
|
|
128
|
+
|
|
129
|
+
interface NavMenuItem {
|
|
130
|
+
to?: string | object;
|
|
131
|
+
href?: string;
|
|
132
|
+
label: string;
|
|
133
|
+
}
|
|
134
|
+
declare const _default: vue.DefineComponent<{
|
|
135
|
+
/**
|
|
136
|
+
* An array of menu items
|
|
137
|
+
* `{ to?: string | object; href?: string; label: string; }`
|
|
138
|
+
*/
|
|
139
|
+
menuItems: {
|
|
140
|
+
type: PropType<NavMenuItem[]>;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* The label for the action button.
|
|
144
|
+
* Also emits the `action` event.
|
|
145
|
+
*/
|
|
146
|
+
actionLabel: {
|
|
147
|
+
type: StringConstructor;
|
|
148
|
+
};
|
|
149
|
+
}, {
|
|
150
|
+
isMobileMenuOpen: vue.Ref<boolean>;
|
|
151
|
+
toggleMobileMenu: () => boolean;
|
|
152
|
+
actionClicked: () => void;
|
|
153
|
+
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "action"[], "action", vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
154
|
+
/**
|
|
155
|
+
* An array of menu items
|
|
156
|
+
* `{ to?: string | object; href?: string; label: string; }`
|
|
157
|
+
*/
|
|
158
|
+
menuItems: {
|
|
159
|
+
type: PropType<NavMenuItem[]>;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* The label for the action button.
|
|
163
|
+
* Also emits the `action` event.
|
|
164
|
+
*/
|
|
165
|
+
actionLabel: {
|
|
166
|
+
type: StringConstructor;
|
|
167
|
+
};
|
|
168
|
+
}>> & {
|
|
169
|
+
onAction?: ((...args: any[]) => any) | undefined;
|
|
170
|
+
}, {}>;
|
|
171
|
+
|
|
32
172
|
declare const install: Exclude<Plugin['install'], undefined>;
|
|
33
173
|
|
|
34
|
-
export { _default as FwCard, install as default };
|
|
174
|
+
export { ButtonDefinition, ButtonDefinitionList, ButtonSize, ButtonSizes, ButtonVariantName, _default$1 as FwButton, FwButtonProps, _default$2 as FwCard, _default as FwNavigationMenu, NavMenuItem, install as default };
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frollo/frollo-web-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Frollo's UI library for components, utilities and configs",
|
|
5
5
|
"exports": {
|
|
6
|
+
"./tailwind.config.js": "./tailwind.config.js",
|
|
6
7
|
".": {
|
|
7
8
|
"import": "./frollo-web-ui.esm.js",
|
|
8
9
|
"require": "./cjs/index.js"
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
"test:single": "jest --config jest.config.js --coverage --watchAll",
|
|
23
24
|
"lint": "eslint --cache ./ --ext .js,.ts,.vue",
|
|
24
25
|
"lint:fix": "eslint --cache ./ --fix --ext .js,.ts,.vue",
|
|
25
|
-
"tw-config-export": "mkdir -p ./dist && tailwind-config-viewer export ./dist/twconfig-viewer",
|
|
26
|
+
"tw-config-export": "mkdir -p ./dist && tailwind-config-viewer export ./dist/twconfig-viewer && rimraf ./dist/twconfig-viewer/favicon.ico",
|
|
26
27
|
"storybook": "start-storybook -p 6006",
|
|
27
28
|
"build-storybook": "build-storybook"
|
|
28
29
|
},
|
package/tailwind.config.js
CHANGED
|
@@ -5,7 +5,10 @@ module.exports = {
|
|
|
5
5
|
primary: 'var(--colorPrimary)',
|
|
6
6
|
secondary: 'var(--colorSecondary)',
|
|
7
7
|
tertiary: 'var(--colorTertiary)',
|
|
8
|
-
|
|
8
|
+
white: '#ffffff',
|
|
9
|
+
black: '#000000',
|
|
10
|
+
transparent: 'transparent',
|
|
11
|
+
body: '#000000',
|
|
9
12
|
error: '#eb5757',
|
|
10
13
|
success: '#00c48c',
|
|
11
14
|
grey: {
|
|
@@ -13,7 +16,6 @@ module.exports = {
|
|
|
13
16
|
light: '#bcbcbc',
|
|
14
17
|
lightest: '#f5f5f5'
|
|
15
18
|
}
|
|
16
|
-
|
|
17
19
|
},
|
|
18
20
|
fontSize: {
|
|
19
21
|
xs: ['12px', '1.5'],
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
export declare type ButtonVariantName = 'primary' | 'secondary' | 'tertiary' | 'error' | 'success' | 'text';
|
|
3
|
+
export interface ButtonDefinition {
|
|
4
|
+
text: string;
|
|
5
|
+
background: string;
|
|
6
|
+
border: string;
|
|
7
|
+
}
|
|
8
|
+
export declare type ButtonDefinitionList = {
|
|
9
|
+
[key in ButtonVariantName]: ButtonDefinition;
|
|
10
|
+
};
|
|
11
|
+
export declare type ButtonSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
12
|
+
export declare type ButtonSizes = {
|
|
13
|
+
[key in ButtonSize]: string;
|
|
14
|
+
};
|
|
15
|
+
export interface FwButtonProps {
|
|
16
|
+
to?: string | object;
|
|
17
|
+
href?: string;
|
|
18
|
+
size?: ButtonSize;
|
|
19
|
+
variant?: ButtonVariantName;
|
|
20
|
+
}
|
|
21
|
+
declare const _default: import("vue").DefineComponent<{
|
|
22
|
+
/**
|
|
23
|
+
* A `router-link` path or object
|
|
24
|
+
*/
|
|
25
|
+
to: {
|
|
26
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* A URL to link to using a native anchor element
|
|
30
|
+
*/
|
|
31
|
+
href: StringConstructor;
|
|
32
|
+
/**
|
|
33
|
+
* The size of the button. Accepts: 'sm', 'md', 'lg', 'xl', '2xl'
|
|
34
|
+
*/
|
|
35
|
+
size: {
|
|
36
|
+
type: PropType<ButtonSize>;
|
|
37
|
+
default: string;
|
|
38
|
+
validator: (value: string) => boolean;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* The colour variant of the button.
|
|
42
|
+
* Accepts 'primary', 'secondary', 'tertiary', 'error', 'success'
|
|
43
|
+
*/
|
|
44
|
+
variant: {
|
|
45
|
+
type: PropType<ButtonVariantName>;
|
|
46
|
+
default: string;
|
|
47
|
+
validator: (value: string) => boolean;
|
|
48
|
+
};
|
|
49
|
+
}, {
|
|
50
|
+
textColorClass: import("vue").ComputedRef<string>;
|
|
51
|
+
bgColorClass: import("vue").ComputedRef<string>;
|
|
52
|
+
sizeClass: import("vue").ComputedRef<string>;
|
|
53
|
+
borderClass: import("vue").ComputedRef<string>;
|
|
54
|
+
onClick: (this: GlobalEventHandlers, ev: MouseEvent) => any;
|
|
55
|
+
onMouseover: (this: GlobalEventHandlers, ev: MouseEvent) => any;
|
|
56
|
+
onMouseout: (this: GlobalEventHandlers, ev: MouseEvent) => any;
|
|
57
|
+
onFocusin: (this: GlobalEventHandlers, ev: FocusEvent) => any;
|
|
58
|
+
onFocusout: (this: GlobalEventHandlers, ev: FocusEvent) => any;
|
|
59
|
+
tagName: import("vue").ComputedRef<"router-link" | "a" | "button">;
|
|
60
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "mouseover" | "mouseout" | "focusin" | "focusout")[], "click" | "mouseover" | "mouseout" | "focusin" | "focusout", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
61
|
+
/**
|
|
62
|
+
* A `router-link` path or object
|
|
63
|
+
*/
|
|
64
|
+
to: {
|
|
65
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* A URL to link to using a native anchor element
|
|
69
|
+
*/
|
|
70
|
+
href: StringConstructor;
|
|
71
|
+
/**
|
|
72
|
+
* The size of the button. Accepts: 'sm', 'md', 'lg', 'xl', '2xl'
|
|
73
|
+
*/
|
|
74
|
+
size: {
|
|
75
|
+
type: PropType<ButtonSize>;
|
|
76
|
+
default: string;
|
|
77
|
+
validator: (value: string) => boolean;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* The colour variant of the button.
|
|
81
|
+
* Accepts 'primary', 'secondary', 'tertiary', 'error', 'success'
|
|
82
|
+
*/
|
|
83
|
+
variant: {
|
|
84
|
+
type: PropType<ButtonVariantName>;
|
|
85
|
+
default: string;
|
|
86
|
+
validator: (value: string) => boolean;
|
|
87
|
+
};
|
|
88
|
+
}>> & {
|
|
89
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
90
|
+
onMouseover?: ((...args: any[]) => any) | undefined;
|
|
91
|
+
onMouseout?: ((...args: any[]) => any) | undefined;
|
|
92
|
+
onFocusin?: ((...args: any[]) => any) | undefined;
|
|
93
|
+
onFocusout?: ((...args: any[]) => any) | undefined;
|
|
94
|
+
}, {
|
|
95
|
+
size: ButtonSize;
|
|
96
|
+
variant: ButtonVariantName;
|
|
97
|
+
}>;
|
|
98
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
export interface NavMenuItem {
|
|
3
|
+
to?: string | object;
|
|
4
|
+
href?: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: import("vue").DefineComponent<{
|
|
8
|
+
/**
|
|
9
|
+
* An array of menu items
|
|
10
|
+
* `{ to?: string | object; href?: string; label: string; }`
|
|
11
|
+
*/
|
|
12
|
+
menuItems: {
|
|
13
|
+
type: PropType<NavMenuItem[]>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The label for the action button.
|
|
17
|
+
* Also emits the `action` event.
|
|
18
|
+
*/
|
|
19
|
+
actionLabel: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
isMobileMenuOpen: import("vue").Ref<boolean>;
|
|
24
|
+
toggleMobileMenu: () => boolean;
|
|
25
|
+
actionClicked: () => void;
|
|
26
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "action"[], "action", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
|
+
/**
|
|
28
|
+
* An array of menu items
|
|
29
|
+
* `{ to?: string | object; href?: string; label: string; }`
|
|
30
|
+
*/
|
|
31
|
+
menuItems: {
|
|
32
|
+
type: PropType<NavMenuItem[]>;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* The label for the action button.
|
|
36
|
+
* Also emits the `action` event.
|
|
37
|
+
*/
|
|
38
|
+
actionLabel: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
};
|
|
41
|
+
}>> & {
|
|
42
|
+
onAction?: ((...args: any[]) => any) | undefined;
|
|
43
|
+
}, {}>;
|
|
44
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import install from './index.esm';
|
|
2
|
+
export default install;
|
|
3
|
+
export * from './components';
|
|
4
|
+
export * from './components/fw-card/fw-card.vue';
|
|
5
|
+
export * from './components/fw-button/fw-button.vue';
|
|
6
|
+
export * from './components/fw-navigation-menu/fw-navigation-menu.vue';
|