@frollo/frollo-web-ui 0.0.8 → 0.0.11

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 CHANGED
@@ -1496,7 +1496,18 @@ addToUnscopables('includes');var script$2 = vue.defineComponent({
1496
1496
  type: String,
1497
1497
  "default": 'primary',
1498
1498
  validator: function validator(value) {
1499
- return ['primary', 'secondary', 'tertiary', 'error', 'success', 'text'].includes(value);
1499
+ return ['primary', 'secondary', 'tertiary', 'error', 'success', 'link', 'text'].includes(value);
1500
+ }
1501
+ },
1502
+
1503
+ /**
1504
+ * The type attribute of the button
1505
+ */
1506
+ buttonType: {
1507
+ type: String,
1508
+ "default": 'button',
1509
+ validator: function validator(value) {
1510
+ return ['button', 'submit', 'reset'].includes(value);
1500
1511
  }
1501
1512
  }
1502
1513
  },
@@ -1505,32 +1516,37 @@ addToUnscopables('includes');var script$2 = vue.defineComponent({
1505
1516
  primary: {
1506
1517
  text: 'text-tertiary hover:text-primary active:text-primary',
1507
1518
  background: 'bg-primary hover:bg-tertiary active:bg-tertiary',
1508
- border: 'border-primary focus:ring-primary'
1519
+ border: 'border-primary focus-visible:ring-primary'
1509
1520
  },
1510
1521
  secondary: {
1511
1522
  text: 'text-primary hover:text-tertiary active:text-tertiary',
1512
1523
  background: 'bg-tertiary hover:bg-primary active:bg-primary',
1513
- border: 'border-primary focus:ring-primary'
1524
+ border: 'border-primary focus-visible:ring-primary'
1514
1525
  },
1515
1526
  tertiary: {
1516
1527
  text: 'text-tertiary hover:text-secondary active:text-secondary',
1517
1528
  background: 'bg-secondary hover:bg-tertiary active:bg-tertiary',
1518
- border: 'border-tertiary focus:ring-tertiary'
1529
+ border: 'border-secondary focus-visible:ring-secondary'
1519
1530
  },
1520
1531
  success: {
1521
1532
  text: 'text-white hover:text-success active:text-success',
1522
1533
  background: 'bg-success hover:bg-white active:bg-white',
1523
- border: 'border-success focus:ring-success'
1534
+ border: 'border-success focus-visible:ring-success'
1524
1535
  },
1525
1536
  error: {
1526
1537
  text: 'text-white hover:text-error active:text-error',
1527
1538
  background: 'bg-error hover:bg-white active:bg-white',
1528
- border: 'border-error focus:ring-error'
1539
+ border: 'border-error focus-visible:ring-error'
1540
+ },
1541
+ link: {
1542
+ text: 'text-primary underline hover:no-underline active:no-underline focus-visible:no-underline',
1543
+ background: '',
1544
+ border: 'border-none rounded-none focus-visible:ring-primary'
1529
1545
  },
1530
1546
  text: {
1531
1547
  text: 'text-body font-medium hover:text-white active:text-white',
1532
1548
  background: 'bg-white hover:bg-body active:bg-body',
1533
- border: 'border-transparent focus:ring-body'
1549
+ border: 'border-transparent focus-visible:ring-body'
1534
1550
  }
1535
1551
  });
1536
1552
  var sizes = vue.ref({
@@ -1612,8 +1628,8 @@ addToUnscopables('includes');var script$2 = vue.defineComponent({
1612
1628
  }
1613
1629
  });function render$2(_ctx, _cache, $props, $setup, $data, $options) {
1614
1630
  return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tagName), {
1615
- "class": vue.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]]),
1616
- type: _ctx.tagName === 'button' ? _ctx.tagName : null,
1631
+ "class": vue.normalizeClass(["fw-button font-bold cursor-pointer whitespace-nowrap rounded-full border-2 focus:outline-0 focus-visible:outline-0 focus:ring-none ring-offset-2 focus-visible:ring", [_ctx.textColorClass, _ctx.bgColorClass, _ctx.sizeClass, _ctx.borderClass, _ctx.variant === 'link' ? 'pl-0 pr-0 pt-0 pb-0' : '']]),
1632
+ type: _ctx.tagName === 'button' ? _ctx.buttonType : null,
1617
1633
  to: _ctx.to ? _ctx.to : null,
1618
1634
  href: _ctx.href ? _ctx.href : null,
1619
1635
  tabindex: _ctx.to ? 0 : null,
@@ -1733,7 +1749,7 @@ var _hoisted_9$1 = {
1733
1749
  "aria-hidden": "true"
1734
1750
  };
1735
1751
  var _hoisted_10$1 = ["d"];
1736
- var _hoisted_11 = {
1752
+ var _hoisted_11$1 = {
1737
1753
  key: 0,
1738
1754
  "class": "fw-nav-menu--mobile min-h-screen top-0 left-0 pt-20 absolute w-full flex flex-col justify-between px-2 bg-white shadow-md pb-3 space-y-1"
1739
1755
  };
@@ -1788,7 +1804,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
1788
1804
  "default": vue.withCtx(function () {
1789
1805
  var _ctx$menuItems2;
1790
1806
 
1791
- return [((_ctx$menuItems2 = _ctx.menuItems) === null || _ctx$menuItems2 === void 0 ? void 0 : _ctx$menuItems2.length) > 0 && _ctx.isMobileMenuOpen ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, [vue.createElementVNode("div", _hoisted_12, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.menuItems, function (item, i) {
1807
+ return [((_ctx$menuItems2 = _ctx.menuItems) === null || _ctx$menuItems2 === void 0 ? void 0 : _ctx$menuItems2.length) > 0 && _ctx.isMobileMenuOpen ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$1, [vue.createElementVNode("div", _hoisted_12, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.menuItems, function (item, i) {
1792
1808
  return vue.openBlock(), vue.createBlock(_component_FwButton, {
1793
1809
  key: i,
1794
1810
  "class": "w-full rounded-md px-2",
@@ -4999,6 +5015,14 @@ function useSubmitForm(cb) {
4999
5015
  */
5000
5016
  rules: {
5001
5017
  type: [String, Object, Function]
5018
+ },
5019
+
5020
+ /**
5021
+ * Converts the input into a readonly disabled field
5022
+ */
5023
+ readonly: {
5024
+ type: Boolean,
5025
+ "default": false
5002
5026
  }
5003
5027
  },
5004
5028
  setup: function setup(props, ctx) {
@@ -5039,23 +5063,26 @@ if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) {
5039
5063
  }
5040
5064
  });
5041
5065
  }var _hoisted_1 = {
5066
+ "class": "fw-input w-full"
5067
+ };
5068
+ var _hoisted_2 = {
5042
5069
  "class": "flex flex-col"
5043
5070
  };
5044
- var _hoisted_2 = ["for"];
5045
- var _hoisted_3 = {
5071
+ var _hoisted_3 = ["for"];
5072
+ var _hoisted_4 = {
5046
5073
  "class": "relative"
5047
5074
  };
5048
- var _hoisted_4 = {
5075
+ var _hoisted_5 = {
5049
5076
  key: 0,
5050
5077
  "class": "flex text-grey-base absolute w-9 h-full inset-y-0 left-0 items-center pl-3 pointer-events-none"
5051
5078
  };
5052
- var _hoisted_5 = ["placeholder", "type"];
5053
- var _hoisted_6 = {
5079
+ var _hoisted_6 = ["placeholder", "type", "readonly", "disabled"];
5080
+ var _hoisted_7 = {
5054
5081
  key: 0,
5055
5082
  "class": "flex text-error absolute w-9 h-full inset-y-0 right-0 items-center pr-3 pointer-events-none"
5056
5083
  };
5057
5084
 
5058
- var _hoisted_7 = /*#__PURE__*/vue.createElementVNode("svg", {
5085
+ var _hoisted_8 = /*#__PURE__*/vue.createElementVNode("svg", {
5059
5086
  fill: "currentColor",
5060
5087
  "aria-hidden": "true",
5061
5088
  focusable: "false",
@@ -5063,20 +5090,20 @@ var _hoisted_7 = /*#__PURE__*/vue.createElementVNode("svg", {
5063
5090
  xmlns: "http://www.w3.org/2000/svg",
5064
5091
  viewBox: "0 0 512 512"
5065
5092
  }, [/*#__PURE__*/vue.createElementVNode("path", {
5066
- d: "M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM232 152C232 138.8\n 242.8 128 256 128s24 10.75 24 24v128c0 13.25-10.75 24-24 24S232 293.3 232 280V152zM256 400c-17.36\n 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 385.9 273.4\n 400 256 400z"
5093
+ d: "M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM232 152C232 138.8\n 242.8 128 256 128s24 10.75 24 24v128c0 13.25-10.75 24-24 24S232 293.3 232 280V152zM256 400c-17.36\n 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 385.9 273.4\n 400 256 400z"
5067
5094
  })], -1);
5068
5095
 
5069
- var _hoisted_8 = [_hoisted_7];
5070
- var _hoisted_9 = {
5071
- "class": "text-error text-right text-sm font-medium mt-2 min-h-[21px]"
5072
- };
5096
+ var _hoisted_9 = [_hoisted_8];
5073
5097
  var _hoisted_10 = {
5098
+ "class": "text-error italic text-right text-sm font-medium mt-2 min-h-[21px]"
5099
+ };
5100
+ var _hoisted_11 = {
5074
5101
  key: 0
5075
5102
  };
5076
5103
  function render(_ctx, _cache, $props, $setup, $data, $options) {
5077
5104
  var _component_InputField = vue.resolveComponent("InputField");
5078
5105
 
5079
- return vue.openBlock(), vue.createBlock(_component_InputField, {
5106
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [vue.createVNode(_component_InputField, {
5080
5107
  modelValue: _ctx.inputValue,
5081
5108
  "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
5082
5109
  return _ctx.inputValue = $event;
@@ -5086,39 +5113,42 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
5086
5113
  }, {
5087
5114
  "default": vue.withCtx(function (_ref) {
5088
5115
  var field = _ref.field,
5116
+ errors = _ref.errors,
5089
5117
  errorMessage = _ref.errorMessage,
5090
5118
  meta = _ref.meta;
5091
- return [vue.createElementVNode("div", _hoisted_1, [_ctx.label ? (vue.openBlock(), vue.createElementBlock("label", {
5119
+ return [vue.createElementVNode("div", _hoisted_2, [_ctx.label ? (vue.openBlock(), vue.createElementBlock("label", {
5092
5120
  key: 0,
5093
5121
  "for": _ctx.name,
5094
5122
  "class": "block mb-2"
5095
- }, vue.toDisplayString(_ctx.label), 9, _hoisted_2)) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_3, [_ctx.$slots.prefixIcon ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [vue.renderSlot(_ctx.$slots, "prefixIcon")])) : vue.createCommentVNode("", true), vue.createElementVNode("input", vue.mergeProps(field, {
5123
+ }, vue.toDisplayString(_ctx.label), 9, _hoisted_3)) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_4, [_ctx.$slots.prefixIcon ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [vue.renderSlot(_ctx.$slots, "prefixIcon")])) : vue.createCommentVNode("", true), vue.createElementVNode("input", vue.mergeProps(field, {
5096
5124
  placeholder: _ctx.placeholder,
5097
5125
  type: _ctx.type,
5126
+ readonly: _ctx.readonly,
5127
+ disabled: _ctx.readonly,
5098
5128
  "class": ["border-2 border-grey-lightest rounded-lg focus:outline-none focus:ring-2 focus:ring-primary block w-full p-2.5", {
5099
5129
  'pl-10': !!_ctx.$slots.prefixIcon
5100
5130
  }]
5101
- }), null, 16, _hoisted_5), vue.createVNode(vue.Transition, {
5131
+ }), null, 16, _hoisted_6), vue.createVNode(vue.Transition, {
5102
5132
  name: "errorFadeIn"
5103
5133
  }, {
5104
5134
  "default": vue.withCtx(function () {
5105
- return [errorMessage && meta.touched ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, _hoisted_8)) : vue.createCommentVNode("", true)];
5135
+ return [(errorMessage || errors[0]) && meta.touched ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, _hoisted_9)) : vue.createCommentVNode("", true)];
5106
5136
  }),
5107
5137
  _: 2
5108
- }, 1024)]), vue.createElementVNode("div", _hoisted_9, [vue.createVNode(vue.Transition, {
5138
+ }, 1024)]), vue.createElementVNode("div", _hoisted_10, [vue.createVNode(vue.Transition, {
5109
5139
  name: "errorFadeIn"
5110
5140
  }, {
5111
5141
  "default": vue.withCtx(function () {
5112
- return [errorMessage && meta.touched ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_10, vue.toDisplayString(errorMessage), 1)) : vue.createCommentVNode("", true)];
5142
+ return [(errorMessage || errors[0]) && meta.touched ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_11, vue.toDisplayString(errorMessage || errors[0]), 1)) : vue.createCommentVNode("", true)];
5113
5143
  }),
5114
5144
  _: 2
5115
5145
  }, 1024)])])];
5116
5146
  }),
5117
5147
  _: 3
5118
- }, 8, ["modelValue", "name", "rules"]);
5148
+ }, 8, ["modelValue", "name", "rules"])]);
5119
5149
  }var css_248z = ".errorFadeIn-enter-active{-webkit-animation:errorFadeIn .35s;animation:errorFadeIn .35s;-webkit-transition:opacity .35s ease-in;-o-transition:opacity .35s ease-in;transition:opacity .35s ease-in}.errorFadeIn-leave-active{animation:errorFadeIn .35s reverse;-webkit-transition:opacity .35s ease-out;-o-transition:opacity .35s ease-out;transition:opacity .35s ease-out}@-webkit-keyframes errorFadeIn{0%{opacity:0}to{opacity:1}}@keyframes errorFadeIn{0%{opacity:0}to{opacity:1}}";
5120
5150
  var stylesheet = ".errorFadeIn-enter-active{-webkit-animation:errorFadeIn .35s;animation:errorFadeIn .35s;-webkit-transition:opacity .35s ease-in;-o-transition:opacity .35s ease-in;transition:opacity .35s ease-in}.errorFadeIn-leave-active{animation:errorFadeIn .35s reverse;-webkit-transition:opacity .35s ease-out;-o-transition:opacity .35s ease-out;transition:opacity .35s ease-out}@-webkit-keyframes errorFadeIn{0%{opacity:0}to{opacity:1}}@keyframes errorFadeIn{0%{opacity:0}to{opacity:1}}";
5121
- styleInject(css_248z);script.render = render;var components$1=/*#__PURE__*/Object.freeze({__proto__:null,FwCard:script$3,FwButton:script$2,FwNavigationMenu:script$1,FwInput:script});var install = function install(app) {
5151
+ styleInject(css_248z);script.render = render;var components$1=/*#__PURE__*/Object.freeze({__proto__:null,FwCard:script$3,FwButton:script$2,FwNavigationMenu:script$1,FwForm:Form,FwInput:script});var install = function install(app) {
5122
5152
  Object.entries(components$1).forEach(function (_ref) {
5123
5153
  var _ref2 = _slicedToArray(_ref, 2),
5124
5154
  componentName = _ref2[0],
@@ -5126,7 +5156,7 @@ styleInject(css_248z);script.render = render;var components$1=/*#__PURE__*/Objec
5126
5156
 
5127
5157
  app.component(componentName, component);
5128
5158
  });
5129
- };var components=/*#__PURE__*/Object.freeze({__proto__:null,'default':install,FwCard:script$3,FwButton:script$2,FwNavigationMenu:script$1,FwInput:script});Object.entries(components).forEach(function (_ref) {
5159
+ };var components=/*#__PURE__*/Object.freeze({__proto__:null,'default':install,FwCard:script$3,FwButton:script$2,FwNavigationMenu:script$1,FwForm:Form,FwInput:script});Object.entries(components).forEach(function (_ref) {
5130
5160
  var _ref2 = _slicedToArray(_ref, 2),
5131
5161
  componentName = _ref2[0],
5132
5162
  component = _ref2[1];
@@ -36,7 +36,18 @@ var script = defineComponent({
36
36
  type: String,
37
37
  "default": 'primary',
38
38
  validator: function validator(value) {
39
- return ['primary', 'secondary', 'tertiary', 'error', 'success', 'text'].includes(value);
39
+ return ['primary', 'secondary', 'tertiary', 'error', 'success', 'link', 'text'].includes(value);
40
+ }
41
+ },
42
+
43
+ /**
44
+ * The type attribute of the button
45
+ */
46
+ buttonType: {
47
+ type: String,
48
+ "default": 'button',
49
+ validator: function validator(value) {
50
+ return ['button', 'submit', 'reset'].includes(value);
40
51
  }
41
52
  }
42
53
  },
@@ -45,32 +56,37 @@ var script = defineComponent({
45
56
  primary: {
46
57
  text: 'text-tertiary hover:text-primary active:text-primary',
47
58
  background: 'bg-primary hover:bg-tertiary active:bg-tertiary',
48
- border: 'border-primary focus:ring-primary'
59
+ border: 'border-primary focus-visible:ring-primary'
49
60
  },
50
61
  secondary: {
51
62
  text: 'text-primary hover:text-tertiary active:text-tertiary',
52
63
  background: 'bg-tertiary hover:bg-primary active:bg-primary',
53
- border: 'border-primary focus:ring-primary'
64
+ border: 'border-primary focus-visible:ring-primary'
54
65
  },
55
66
  tertiary: {
56
67
  text: 'text-tertiary hover:text-secondary active:text-secondary',
57
68
  background: 'bg-secondary hover:bg-tertiary active:bg-tertiary',
58
- border: 'border-tertiary focus:ring-tertiary'
69
+ border: 'border-secondary focus-visible:ring-secondary'
59
70
  },
60
71
  success: {
61
72
  text: 'text-white hover:text-success active:text-success',
62
73
  background: 'bg-success hover:bg-white active:bg-white',
63
- border: 'border-success focus:ring-success'
74
+ border: 'border-success focus-visible:ring-success'
64
75
  },
65
76
  error: {
66
77
  text: 'text-white hover:text-error active:text-error',
67
78
  background: 'bg-error hover:bg-white active:bg-white',
68
- border: 'border-error focus:ring-error'
79
+ border: 'border-error focus-visible:ring-error'
80
+ },
81
+ link: {
82
+ text: 'text-primary underline hover:no-underline active:no-underline focus-visible:no-underline',
83
+ background: '',
84
+ border: 'border-none rounded-none focus-visible:ring-primary'
69
85
  },
70
86
  text: {
71
87
  text: 'text-body font-medium hover:text-white active:text-white',
72
88
  background: 'bg-white hover:bg-body active:bg-body',
73
- border: 'border-transparent focus:ring-body'
89
+ border: 'border-transparent focus-visible:ring-body'
74
90
  }
75
91
  });
76
92
  var sizes = ref({
@@ -154,8 +170,8 @@ var script = defineComponent({
154
170
 
155
171
  function render(_ctx, _cache, $props, $setup, $data, $options) {
156
172
  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,
173
+ "class": normalizeClass(["fw-button font-bold cursor-pointer whitespace-nowrap rounded-full border-2 focus:outline-0 focus-visible:outline-0 focus:ring-none ring-offset-2 focus-visible:ring", [_ctx.textColorClass, _ctx.bgColorClass, _ctx.sizeClass, _ctx.borderClass, _ctx.variant === 'link' ? 'pl-0 pr-0 pt-0 pb-0' : '']]),
174
+ type: _ctx.tagName === 'button' ? _ctx.buttonType : null,
159
175
  to: _ctx.to ? _ctx.to : null,
160
176
  href: _ctx.href ? _ctx.href : null,
161
177
  tabindex: _ctx.to ? 0 : null,
package/esm/fw-button.js CHANGED
@@ -1,3 +1,3 @@
1
- export { s as FwButton } from './fw-button-02fc3f47.js';
1
+ export { s as FwButton } from './fw-button-430c8529.js';
2
2
  import './style-inject.es-da8f7768.js';
3
3
  import 'vue';
package/esm/fw-form.js ADDED
@@ -0,0 +1,2 @@
1
+ export { F as FwForm } from './vee-validate.esm-028c6424.js';
2
+ import 'vue';