@frollo/frollo-web-ui 0.0.2 → 0.0.3

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/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$1: vue.DefineComponent<{
5
5
  /**
6
6
  * The header title of the card
7
7
  */
@@ -29,6 +29,102 @@ declare const _default: vue.DefineComponent<{
29
29
  };
30
30
  }>>, {}>;
31
31
 
32
+ declare type ButtonVariantName = 'primary' | 'secondary' | 'tertiary' | 'error' | 'success';
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: 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
+ }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("click" | "mouseover" | "mouseout" | "focusin" | "focusout")[], "click" | "mouseover" | "mouseout" | "focusin" | "focusout", vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
90
+ /**
91
+ * A `router-link` path or object
92
+ */
93
+ to: {
94
+ type: (StringConstructor | ObjectConstructor)[];
95
+ };
96
+ /**
97
+ * A URL to link to using a native anchor element
98
+ */
99
+ href: StringConstructor;
100
+ /**
101
+ * The size of the button. Accepts: 'sm', 'md', 'lg', 'xl', '2xl'
102
+ */
103
+ size: {
104
+ type: PropType<ButtonSize>;
105
+ default: string;
106
+ validator: (value: string) => boolean;
107
+ };
108
+ /**
109
+ * The colour variant of the button.
110
+ * Accepts 'primary', 'secondary', 'tertiary', 'error', 'success'
111
+ */
112
+ variant: {
113
+ type: PropType<ButtonVariantName>;
114
+ default: string;
115
+ validator: (value: string) => boolean;
116
+ };
117
+ }>> & {
118
+ onClick?: ((...args: any[]) => any) | undefined;
119
+ onMouseover?: ((...args: any[]) => any) | undefined;
120
+ onMouseout?: ((...args: any[]) => any) | undefined;
121
+ onFocusin?: ((...args: any[]) => any) | undefined;
122
+ onFocusout?: ((...args: any[]) => any) | undefined;
123
+ }, {
124
+ size: ButtonSize;
125
+ variant: ButtonVariantName;
126
+ }>;
127
+
32
128
  declare const install: Exclude<Plugin['install'], undefined>;
33
129
 
34
- export { _default as FwCard, install as default };
130
+ export { ButtonDefinition, ButtonDefinitionList, ButtonSize, ButtonSizes, ButtonVariantName, _default as FwButton, FwButtonProps, _default$1 as FwCard, install as default };
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@frollo/frollo-web-ui",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
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
  },
@@ -5,6 +5,9 @@ module.exports = {
5
5
  primary: 'var(--colorPrimary)',
6
6
  secondary: 'var(--colorSecondary)',
7
7
  tertiary: 'var(--colorTertiary)',
8
+ white: '#ffffff',
9
+ black: '#000000',
10
+ transparent: 'transparent',
8
11
  body: '#2C3E50',
9
12
  error: '#eb5757',
10
13
  success: '#00c48c',
@@ -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,97 @@
1
+ import { PropType } from 'vue';
2
+ export declare type ButtonVariantName = 'primary' | 'secondary' | 'tertiary' | 'error' | 'success';
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
+ }, 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<{
60
+ /**
61
+ * A `router-link` path or object
62
+ */
63
+ to: {
64
+ type: (StringConstructor | ObjectConstructor)[];
65
+ };
66
+ /**
67
+ * A URL to link to using a native anchor element
68
+ */
69
+ href: StringConstructor;
70
+ /**
71
+ * The size of the button. Accepts: 'sm', 'md', 'lg', 'xl', '2xl'
72
+ */
73
+ size: {
74
+ type: PropType<ButtonSize>;
75
+ default: string;
76
+ validator: (value: string) => boolean;
77
+ };
78
+ /**
79
+ * The colour variant of the button.
80
+ * Accepts 'primary', 'secondary', 'tertiary', 'error', 'success'
81
+ */
82
+ variant: {
83
+ type: PropType<ButtonVariantName>;
84
+ default: string;
85
+ validator: (value: string) => boolean;
86
+ };
87
+ }>> & {
88
+ onClick?: ((...args: any[]) => any) | undefined;
89
+ onMouseover?: ((...args: any[]) => any) | undefined;
90
+ onMouseout?: ((...args: any[]) => any) | undefined;
91
+ onFocusin?: ((...args: any[]) => any) | undefined;
92
+ onFocusout?: ((...args: any[]) => any) | undefined;
93
+ }, {
94
+ size: ButtonSize;
95
+ variant: ButtonVariantName;
96
+ }>;
97
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import FwButton from './fw-button.vue';
2
+ export { FwButton };
@@ -1 +1,2 @@
1
- export { FwCard } from './fw-card';
1
+ export * from './fw-card';
2
+ export * from './fw-button';
@@ -0,0 +1,5 @@
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';