@frollo/frollo-web-ui 0.0.6 → 0.0.9
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 +3476 -144
- package/esm/fw-button-02fc3f47.js +181 -0
- package/esm/fw-button.js +2 -1
- package/esm/fw-card.js +38 -9
- package/esm/fw-input.js +3328 -0
- package/esm/fw-navigation-menu.js +2 -1
- package/esm/index.js +7 -3
- package/esm/{fw-button-deb8cb87.js → style-inject.es-da8f7768.js} +1 -179
- package/frollo-web-ui.esm.js +3505 -150
- package/icons/alert.svg +3 -0
- package/icons/email-filled.svg +4 -0
- package/icons/generate.svg +1 -1
- package/icons/index.ts +15 -0
- package/icons/manage.svg +1 -1
- package/icons/not-found.svg +1 -1
- package/icons/view.svg +1 -1
- package/index.d.ts +132 -5
- package/package.json +5 -2
- package/tailwind.config.js +7 -13
- package/types/components/fw-card/fw-card.vue.d.ts +23 -1
- package/types/components/fw-input/fw-input.vue.d.ts +104 -0
- package/types/components/fw-input/index.d.ts +2 -0
- package/types/components/index.d.ts +1 -0
- package/types/icons/index.d.ts +7 -0
- package/types/index-types.esm.d.ts +2 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { u as styleInject } from './style-inject.es-da8f7768.js';
|
|
2
|
+
import { defineComponent, ref, computed, openBlock, createBlock, resolveDynamicComponent, normalizeClass, withCtx, renderSlot } from 'vue';
|
|
3
|
+
|
|
4
|
+
var script = defineComponent({
|
|
5
|
+
name: 'FwButton',
|
|
6
|
+
emits: ['click', 'mouseover', 'mouseout', 'focusin', 'focusout'],
|
|
7
|
+
props: {
|
|
8
|
+
/**
|
|
9
|
+
* A `router-link` path or object
|
|
10
|
+
*/
|
|
11
|
+
to: {
|
|
12
|
+
type: [String, Object]
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A URL to link to using a native anchor element
|
|
17
|
+
*/
|
|
18
|
+
href: String,
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The size of the button. Accepts: 'sm', 'md', 'lg', 'xl', '2xl'
|
|
22
|
+
*/
|
|
23
|
+
size: {
|
|
24
|
+
type: String,
|
|
25
|
+
"default": 'lg',
|
|
26
|
+
validator: function validator(value) {
|
|
27
|
+
return ['sm', 'md', 'lg', 'xl', '2xl'].includes(value);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The colour variant of the button.
|
|
33
|
+
* Accepts 'primary', 'secondary', 'tertiary', 'error', 'success'
|
|
34
|
+
*/
|
|
35
|
+
variant: {
|
|
36
|
+
type: String,
|
|
37
|
+
"default": 'primary',
|
|
38
|
+
validator: function validator(value) {
|
|
39
|
+
return ['primary', 'secondary', 'tertiary', 'error', 'success', 'text'].includes(value);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
setup: function setup(props, ctx) {
|
|
44
|
+
var buttonClasses = ref({
|
|
45
|
+
primary: {
|
|
46
|
+
text: 'text-tertiary hover:text-primary active:text-primary',
|
|
47
|
+
background: 'bg-primary hover:bg-tertiary active:bg-tertiary',
|
|
48
|
+
border: 'border-primary focus:ring-primary'
|
|
49
|
+
},
|
|
50
|
+
secondary: {
|
|
51
|
+
text: 'text-primary hover:text-tertiary active:text-tertiary',
|
|
52
|
+
background: 'bg-tertiary hover:bg-primary active:bg-primary',
|
|
53
|
+
border: 'border-primary focus:ring-primary'
|
|
54
|
+
},
|
|
55
|
+
tertiary: {
|
|
56
|
+
text: 'text-tertiary hover:text-secondary active:text-secondary',
|
|
57
|
+
background: 'bg-secondary hover:bg-tertiary active:bg-tertiary',
|
|
58
|
+
border: 'border-tertiary focus:ring-tertiary'
|
|
59
|
+
},
|
|
60
|
+
success: {
|
|
61
|
+
text: 'text-white hover:text-success active:text-success',
|
|
62
|
+
background: 'bg-success hover:bg-white active:bg-white',
|
|
63
|
+
border: 'border-success focus:ring-success'
|
|
64
|
+
},
|
|
65
|
+
error: {
|
|
66
|
+
text: 'text-white hover:text-error active:text-error',
|
|
67
|
+
background: 'bg-error hover:bg-white active:bg-white',
|
|
68
|
+
border: 'border-error focus:ring-error'
|
|
69
|
+
},
|
|
70
|
+
text: {
|
|
71
|
+
text: 'text-body font-medium hover:text-white active:text-white',
|
|
72
|
+
background: 'bg-white hover:bg-body active:bg-body',
|
|
73
|
+
border: 'border-transparent focus:ring-body'
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
var sizes = ref({
|
|
77
|
+
sm: 'px-2 py-0.5 text-sm',
|
|
78
|
+
md: 'px-6 py-1 text-md',
|
|
79
|
+
lg: 'px-10 py-2 text-lg',
|
|
80
|
+
xl: 'px-12 py-3 text-xl',
|
|
81
|
+
'2xl': 'px-16 py-4 text-2xl'
|
|
82
|
+
});
|
|
83
|
+
var textColorClass = computed(function () {
|
|
84
|
+
return buttonClasses.value[props.variant].text;
|
|
85
|
+
});
|
|
86
|
+
var bgColorClass = computed(function () {
|
|
87
|
+
return buttonClasses.value[props.variant].background;
|
|
88
|
+
});
|
|
89
|
+
var sizeClass = computed(function () {
|
|
90
|
+
return sizes.value[props.size];
|
|
91
|
+
});
|
|
92
|
+
var borderClass = computed(function () {
|
|
93
|
+
return buttonClasses.value[props.variant].border;
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* @event Click - Native click
|
|
97
|
+
*/
|
|
98
|
+
|
|
99
|
+
var onClick = function onClick(e) {
|
|
100
|
+
return ctx.emit('click', e);
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* @event mouseover - Native hover
|
|
104
|
+
*/
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
var onMouseover = function onMouseover(e) {
|
|
108
|
+
return ctx.emit('mouseover', e);
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* @event mouseout - Native hover out
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
var onMouseout = function onMouseout(e) {
|
|
116
|
+
return ctx.emit('mouseout', e);
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* @event focusin - Native focusin
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
var onFocusin = function onFocusin(e) {
|
|
124
|
+
return ctx.emit('focusin', e);
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* @event focusout - Native focusout
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
var onFocusout = function onFocusout(e) {
|
|
132
|
+
return ctx.emit('focusout', e);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
var tagName = computed(function () {
|
|
136
|
+
if (props.to) return 'router-link';
|
|
137
|
+
if (props.href) return 'a';
|
|
138
|
+
return 'button';
|
|
139
|
+
});
|
|
140
|
+
return {
|
|
141
|
+
textColorClass: textColorClass,
|
|
142
|
+
bgColorClass: bgColorClass,
|
|
143
|
+
sizeClass: sizeClass,
|
|
144
|
+
borderClass: borderClass,
|
|
145
|
+
onClick: onClick,
|
|
146
|
+
onMouseover: onMouseover,
|
|
147
|
+
onMouseout: onMouseout,
|
|
148
|
+
onFocusin: onFocusin,
|
|
149
|
+
onFocusout: onFocusout,
|
|
150
|
+
tagName: tagName
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
156
|
+
return openBlock(), createBlock(resolveDynamicComponent(_ctx.tagName), {
|
|
157
|
+
"class": normalizeClass(["fw-button font-bold cursor-pointer whitespace-nowrap rounded-full border-2 focus:outline-none ring-offset-2 focus:ring", [_ctx.textColorClass, _ctx.bgColorClass, _ctx.sizeClass, _ctx.borderClass]]),
|
|
158
|
+
type: _ctx.tagName === 'button' ? _ctx.tagName : null,
|
|
159
|
+
to: _ctx.to ? _ctx.to : null,
|
|
160
|
+
href: _ctx.href ? _ctx.href : null,
|
|
161
|
+
tabindex: _ctx.to ? 0 : null,
|
|
162
|
+
onClick: _ctx.onClick,
|
|
163
|
+
onFocusin: _ctx.onFocusin,
|
|
164
|
+
onFocusout: _ctx.onFocusout,
|
|
165
|
+
onMouseover: _ctx.onMouseover,
|
|
166
|
+
onMouseout: _ctx.onMouseout
|
|
167
|
+
}, {
|
|
168
|
+
"default": withCtx(function () {
|
|
169
|
+
return [renderSlot(_ctx.$slots, "default")];
|
|
170
|
+
}),
|
|
171
|
+
_: 3
|
|
172
|
+
}, 8, ["class", "type", "to", "href", "tabindex", "onClick", "onFocusin", "onFocusout", "onMouseover", "onMouseout"]);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
var css_248z = ".fw-button{-webkit-transition:all .25s ease-in;-o-transition:all .25s ease-in;transition:all .25s ease-in}";
|
|
176
|
+
var stylesheet = ".fw-button{-webkit-transition:all .25s ease-in;-o-transition:all .25s ease-in;transition:all .25s ease-in}";
|
|
177
|
+
styleInject(css_248z);
|
|
178
|
+
|
|
179
|
+
script.render = render;
|
|
180
|
+
|
|
181
|
+
export { script as s };
|
package/esm/fw-button.js
CHANGED
package/esm/fw-card.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock, toDisplayString, createCommentVNode, renderSlot } from 'vue';
|
|
1
|
+
import { defineComponent, computed, openBlock, createBlock, resolveDynamicComponent, normalizeClass, withCtx, createElementBlock, toDisplayString, createCommentVNode, renderSlot } from 'vue';
|
|
2
2
|
|
|
3
3
|
var script = defineComponent({
|
|
4
4
|
name: 'FwCard',
|
|
@@ -15,30 +15,59 @@ var script = defineComponent({
|
|
|
15
15
|
*/
|
|
16
16
|
prefixTitle: {
|
|
17
17
|
type: String
|
|
18
|
-
}
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A `router-link` path or object
|
|
22
|
+
*/
|
|
23
|
+
to: {
|
|
24
|
+
type: [String, Object]
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A URL to link to using a native anchor element
|
|
29
|
+
*/
|
|
30
|
+
href: String
|
|
31
|
+
},
|
|
32
|
+
setup: function setup(props) {
|
|
33
|
+
var componentName = computed(function () {
|
|
34
|
+
if (props.to) return 'router-link';
|
|
35
|
+
if (props.href) return 'a';
|
|
36
|
+
return 'div';
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
componentName: componentName
|
|
40
|
+
};
|
|
19
41
|
}
|
|
20
42
|
});
|
|
21
43
|
|
|
22
44
|
var _hoisted_1 = {
|
|
23
|
-
"class": "fw-card shadow rounded-lg"
|
|
24
|
-
};
|
|
25
|
-
var _hoisted_2 = {
|
|
26
45
|
key: 0,
|
|
27
46
|
"class": "fw-card--header text-lg px-8 py-4 font-bold bg-grey-lightest rounded-t-lg border-opacity-0"
|
|
28
47
|
};
|
|
29
|
-
var
|
|
48
|
+
var _hoisted_2 = {
|
|
30
49
|
key: 0,
|
|
31
50
|
"class": "fw-card--prefix-title text-primary"
|
|
32
51
|
};
|
|
33
|
-
var
|
|
52
|
+
var _hoisted_3 = {
|
|
34
53
|
key: 1
|
|
35
54
|
};
|
|
36
|
-
var
|
|
55
|
+
var _hoisted_4 = {
|
|
37
56
|
key: 1,
|
|
38
57
|
"class": "p-8"
|
|
39
58
|
};
|
|
40
59
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
41
|
-
return openBlock(),
|
|
60
|
+
return openBlock(), createBlock(resolveDynamicComponent(_ctx.componentName), {
|
|
61
|
+
to: _ctx.to ? _ctx.to : null,
|
|
62
|
+
href: _ctx.href ? _ctx.href : null,
|
|
63
|
+
tabindex: _ctx.to ? 0 : null,
|
|
64
|
+
"class": normalizeClass(["fw-card shadow-card rounded-lg", _ctx.to || _ctx.href ? 'block cursor-pointer focus:outline-none ring-offset-3 focus:ring focus:ring-primary transform-none transition-transform hover:-translate-y-1' : ''])
|
|
65
|
+
}, {
|
|
66
|
+
"default": withCtx(function () {
|
|
67
|
+
return [_ctx.title || _ctx.prefixTitle ? (openBlock(), createElementBlock("h4", _hoisted_1, [_ctx.prefixTitle ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(_ctx.prefixTitle), 1)) : createCommentVNode("", true), _ctx.title ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true)])) : createCommentVNode("", true), _ctx.$slots["default"] ? (openBlock(), createElementBlock("div", _hoisted_4, [renderSlot(_ctx.$slots, "default")])) : createCommentVNode("", true)];
|
|
68
|
+
}),
|
|
69
|
+
_: 3
|
|
70
|
+
}, 8, ["to", "href", "tabindex", "class"]);
|
|
42
71
|
}
|
|
43
72
|
|
|
44
73
|
script.render = render;
|