@frollo/frollo-web-ui 0.2.4 → 0.3.2

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/esm/fw-tag.js ADDED
@@ -0,0 +1,89 @@
1
+ import './es.array.includes-33e186c4.js';
2
+ import { defineComponent, ref, computed, openBlock, createElementBlock, normalizeClass, renderSlot } from 'vue';
3
+ import { s as styleInject } from './style-inject.es-1f59c1d0.js';
4
+ import './function-name-3bda6320.js';
5
+ import './add-to-unscopables-82352072.js';
6
+ import './is-forced-3323c994.js';
7
+
8
+ var script = defineComponent({
9
+ name: 'FwTag',
10
+ props: {
11
+ /**
12
+ * The size of the tag. Accepts: 'xs' & 'sm'
13
+ */
14
+ size: {
15
+ type: String,
16
+ "default": 'xs',
17
+ validator: function validator(value) {
18
+ return ['xs', 'sm'].includes(value);
19
+ }
20
+ },
21
+
22
+ /**
23
+ * The colour variant of the tag.
24
+ * Accepts 'primary', 'alert', 'error', 'success'
25
+ */
26
+ variant: {
27
+ type: String,
28
+ "default": 'primary',
29
+ validator: function validator(value) {
30
+ return ['primary', 'alert', 'error', 'success'].includes(value);
31
+ }
32
+ }
33
+ },
34
+ setup: function setup(props) {
35
+ var baseClass = ref( // eslint-disable-next-line max-len
36
+ "inline-block font-medium text-center whitespace-nowrap rounded-full");
37
+ var tagClasses = ref({
38
+ primary: {
39
+ text: 'text-tertiary',
40
+ background: 'bg-primary'
41
+ },
42
+ alert: {
43
+ text: 'text-white',
44
+ background: 'bg-alert'
45
+ },
46
+ success: {
47
+ text: 'text-white',
48
+ background: 'bg-success'
49
+ },
50
+ error: {
51
+ text: 'text-white',
52
+ background: 'bg-error'
53
+ }
54
+ });
55
+ var sizes = ref({
56
+ xs: 'px-2 py-px text-xs',
57
+ sm: 'px-4 py-1 text-xs'
58
+ });
59
+ var textColorClass = computed(function () {
60
+ return tagClasses.value[props.variant].text;
61
+ });
62
+ var bgColorClass = computed(function () {
63
+ return tagClasses.value[props.variant].background;
64
+ });
65
+ var sizeClass = computed(function () {
66
+ return sizes.value[props.size];
67
+ });
68
+ return {
69
+ baseClass: baseClass,
70
+ textColorClass: textColorClass,
71
+ bgColorClass: bgColorClass,
72
+ sizeClass: sizeClass
73
+ };
74
+ }
75
+ });
76
+
77
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
78
+ return openBlock(), createElementBlock("span", {
79
+ "class": normalizeClass(["fw-tag", [_ctx.baseClass, _ctx.textColorClass, _ctx.bgColorClass, _ctx.sizeClass]])
80
+ }, [renderSlot(_ctx.$slots, "default")], 2);
81
+ }
82
+
83
+ var css_248z = ".fw-tag{line-height:normal;-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out}";
84
+ var stylesheet = ".fw-tag{line-height:normal;-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out}";
85
+ styleInject(css_248z);
86
+
87
+ script.render = render;
88
+
89
+ export { script as FwTag };
package/esm/index.js CHANGED
@@ -18,6 +18,8 @@ import { s as script$7, u as uniqueId } from './index-59d76908.js';
18
18
  export { s as FwModal } from './index-59d76908.js';
19
19
  import { FwProgressBar as script$8 } from './fw-progress-bar.js';
20
20
  export { FwProgressBar } from './fw-progress-bar.js';
21
+ import { FwTag as script$9 } from './fw-tag.js';
22
+ export { FwTag } from './fw-tag.js';
21
23
  import { FwEmailPulse as __default__, FwSuccessPulse as __default__$1 } from './fw-animations.js';
22
24
  export { FwEmailPulse, FwSuccessPulse } from './fw-animations.js';
23
25
  import { F as Form } from './vee-validate.esm-b64acab1.js';
@@ -282,6 +284,7 @@ var components = /*#__PURE__*/Object.freeze({
282
284
  FwTab: script$6,
283
285
  FwModal: script$7,
284
286
  FwProgressBar: script$8,
287
+ FwTag: script$9,
285
288
  FwEmailPulse: __default__,
286
289
  FwSuccessPulse: __default__$1
287
290
  });