@frollo/frollo-web-ui 0.0.9 → 0.0.12

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 font-normal 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,
@@ -1737,7 +1753,7 @@ 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
  };
1740
- var _hoisted_12 = {
1756
+ var _hoisted_12$1 = {
1741
1757
  "class": "w-full flex flex-col"
1742
1758
  };
1743
1759
  function render$1(_ctx, _cache, $props, $setup, $data, $options) {
@@ -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$1, [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$1, [(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,21 @@ 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
5026
+ },
5027
+
5028
+ /**
5029
+ * The hint text shown below the input
5030
+ */
5031
+ hint: {
5032
+ type: String
5002
5033
  }
5003
5034
  },
5004
5035
  setup: function setup(props, ctx) {
@@ -5044,21 +5075,23 @@ if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) {
5044
5075
  var _hoisted_2 = {
5045
5076
  "class": "flex flex-col"
5046
5077
  };
5047
- var _hoisted_3 = ["for"];
5048
- var _hoisted_4 = {
5049
- "class": "relative"
5078
+ var _hoisted_3 = {
5079
+ "class": "flex flex-row justify-between"
5050
5080
  };
5081
+ var _hoisted_4 = ["for"];
5051
5082
  var _hoisted_5 = {
5052
- key: 0,
5053
- "class": "flex text-grey-base absolute w-9 h-full inset-y-0 left-0 items-center pl-3 pointer-events-none"
5083
+ key: 1
5084
+ };
5085
+ var _hoisted_6 = {
5086
+ "class": "relative"
5054
5087
  };
5055
- var _hoisted_6 = ["placeholder", "type"];
5056
5088
  var _hoisted_7 = {
5057
5089
  key: 0,
5058
- "class": "flex text-error absolute w-9 h-full inset-y-0 right-0 items-center pr-3 pointer-events-none"
5090
+ "class": "flex text-black absolute w-9 h-full inset-y-0 left-0 items-center pl-3 pointer-events-none"
5059
5091
  };
5092
+ var _hoisted_8 = ["placeholder", "type", "readonly", "disabled"];
5060
5093
 
5061
- var _hoisted_8 = /*#__PURE__*/vue.createElementVNode("svg", {
5094
+ var _hoisted_9 = /*#__PURE__*/vue.createElementVNode("svg", {
5062
5095
  fill: "currentColor",
5063
5096
  "aria-hidden": "true",
5064
5097
  focusable: "false",
@@ -5069,12 +5102,20 @@ var _hoisted_8 = /*#__PURE__*/vue.createElementVNode("svg", {
5069
5102
  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"
5070
5103
  })], -1);
5071
5104
 
5072
- var _hoisted_9 = [_hoisted_8];
5073
- var _hoisted_10 = {
5074
- "class": "text-error text-right text-sm font-medium mt-2 min-h-[21px]"
5075
- };
5105
+ var _hoisted_10 = [_hoisted_9];
5076
5106
  var _hoisted_11 = {
5077
- key: 0
5107
+ key: 1,
5108
+ "class": "flex text-black absolute w-10 h-full inset-y-0 right-0 items-center pr-3"
5109
+ };
5110
+ var _hoisted_12 = {
5111
+ "class": "italic text-right text-sm font-medium mt-2 min-h-[21px]"
5112
+ };
5113
+ var _hoisted_13 = {
5114
+ key: 0,
5115
+ "class": "text-error"
5116
+ };
5117
+ var _hoisted_14 = {
5118
+ key: 1
5078
5119
  };
5079
5120
  function render(_ctx, _cache, $props, $setup, $data, $options) {
5080
5121
  var _component_InputField = vue.resolveComponent("InputField");
@@ -5089,39 +5130,47 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
5089
5130
  }, {
5090
5131
  "default": vue.withCtx(function (_ref) {
5091
5132
  var field = _ref.field,
5133
+ errors = _ref.errors,
5092
5134
  errorMessage = _ref.errorMessage,
5093
5135
  meta = _ref.meta;
5094
- return [vue.createElementVNode("div", _hoisted_2, [_ctx.label ? (vue.openBlock(), vue.createElementBlock("label", {
5136
+ return [vue.createElementVNode("div", _hoisted_2, [vue.createElementVNode("div", _hoisted_3, [_ctx.label ? (vue.openBlock(), vue.createElementBlock("label", {
5095
5137
  key: 0,
5096
5138
  "for": _ctx.name,
5097
5139
  "class": "block mb-2"
5098
- }, 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, {
5140
+ }, vue.toDisplayString(_ctx.label), 9, _hoisted_4)) : vue.createCommentVNode("", true), _ctx.$slots.action ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [vue.renderSlot(_ctx.$slots, "action")])) : vue.createCommentVNode("", true)]), vue.createElementVNode("div", _hoisted_6, [_ctx.$slots.prefix ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [vue.renderSlot(_ctx.$slots, "prefix")])) : vue.createCommentVNode("", true), vue.createElementVNode("input", vue.mergeProps(field, {
5099
5141
  placeholder: _ctx.placeholder,
5100
5142
  type: _ctx.type,
5143
+ readonly: _ctx.readonly,
5144
+ disabled: _ctx.readonly,
5101
5145
  "class": ["border-2 border-grey-lightest rounded-lg focus:outline-none focus:ring-2 focus:ring-primary block w-full p-2.5", {
5102
- 'pl-10': !!_ctx.$slots.prefixIcon
5146
+ 'pl-10': !!_ctx.$slots.prefix,
5147
+ 'pr-20': !!_ctx.$slots.suffix
5103
5148
  }]
5104
- }), null, 16, _hoisted_6), vue.createVNode(vue.Transition, {
5105
- name: "errorFadeIn"
5149
+ }), null, 16, _hoisted_8), vue.createVNode(vue.Transition, {
5150
+ name: "fwFadeIn"
5106
5151
  }, {
5107
5152
  "default": vue.withCtx(function () {
5108
- return [errorMessage && meta.touched ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, _hoisted_9)) : vue.createCommentVNode("", true)];
5153
+ return [(errorMessage || errors[0]) && meta.touched ? (vue.openBlock(), vue.createElementBlock("div", {
5154
+ key: 0,
5155
+ "class": vue.normalizeClass(["flex text-error absolute w-9 h-full inset-y-0 right-0 items-center pr-3 pointer-events-none", _ctx.$slots.suffix ? 'mr-8' : ''])
5156
+ }, _hoisted_10, 2)) : vue.createCommentVNode("", true)];
5109
5157
  }),
5110
5158
  _: 2
5111
- }, 1024)]), vue.createElementVNode("div", _hoisted_10, [vue.createVNode(vue.Transition, {
5112
- name: "errorFadeIn"
5159
+ }, 1024), _ctx.$slots.suffix ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, [vue.renderSlot(_ctx.$slots, "suffix")])) : vue.createCommentVNode("", true)]), vue.createElementVNode("div", _hoisted_12, [vue.createVNode(vue.Transition, {
5160
+ name: "fwFadeIn",
5161
+ mode: "out-in"
5113
5162
  }, {
5114
5163
  "default": vue.withCtx(function () {
5115
- return [errorMessage && meta.touched ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_11, vue.toDisplayString(errorMessage), 1)) : vue.createCommentVNode("", true)];
5164
+ return [(errorMessage || errors[0]) && meta.touched ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_13, vue.toDisplayString(errorMessage || errors[0]), 1)) : _ctx.hint ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_14, vue.toDisplayString(_ctx.hint), 1)) : vue.createCommentVNode("", true)];
5116
5165
  }),
5117
5166
  _: 2
5118
5167
  }, 1024)])])];
5119
5168
  }),
5120
5169
  _: 3
5121
5170
  }, 8, ["modelValue", "name", "rules"])]);
5122
- }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}}";
5123
- 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}}";
5124
- 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) {
5171
+ }var css_248z = ".fwFadeIn-enter-active{-webkit-animation:fwFadeIn .35s;animation:fwFadeIn .35s;-webkit-transition:opacity .35s ease-in;-o-transition:opacity .35s ease-in;transition:opacity .35s ease-in}.fwFadeIn-leave-active{animation:fwFadeIn .35s reverse;-webkit-transition:opacity .35s ease-out;-o-transition:opacity .35s ease-out;transition:opacity .35s ease-out}@-webkit-keyframes fwFadeIn{0%{opacity:0}to{opacity:1}}@keyframes fwFadeIn{0%{opacity:0}to{opacity:1}}";
5172
+ var stylesheet = ".fwFadeIn-enter-active{-webkit-animation:fwFadeIn .35s;animation:fwFadeIn .35s;-webkit-transition:opacity .35s ease-in;-o-transition:opacity .35s ease-in;transition:opacity .35s ease-in}.fwFadeIn-leave-active{animation:fwFadeIn .35s reverse;-webkit-transition:opacity .35s ease-out;-o-transition:opacity .35s ease-out;transition:opacity .35s ease-out}@-webkit-keyframes fwFadeIn{0%{opacity:0}to{opacity:1}}@keyframes fwFadeIn{0%{opacity:0}to{opacity:1}}";
5173
+ 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) {
5125
5174
  Object.entries(components$1).forEach(function (_ref) {
5126
5175
  var _ref2 = _slicedToArray(_ref, 2),
5127
5176
  componentName = _ref2[0],
@@ -5129,7 +5178,7 @@ styleInject(css_248z);script.render = render;var components$1=/*#__PURE__*/Objec
5129
5178
 
5130
5179
  app.component(componentName, component);
5131
5180
  });
5132
- };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) {
5181
+ };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) {
5133
5182
  var _ref2 = _slicedToArray(_ref, 2),
5134
5183
  componentName = _ref2[0],
5135
5184
  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 font-normal 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-54999a6e.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';