@frollo/frollo-web-ui 0.0.4 → 0.0.5

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
@@ -1259,7 +1259,7 @@ $$1({ target: 'Object', stat: true }, {
1259
1259
  entries: function entries(O) {
1260
1260
  return $entries(O);
1261
1261
  }
1262
- });var script$1 = vue.defineComponent({
1262
+ });var script$2 = vue.defineComponent({
1263
1263
  name: 'FwCard',
1264
1264
  props: {
1265
1265
  /**
@@ -1279,24 +1279,24 @@ $$1({ target: 'Object', stat: true }, {
1279
1279
  });var _hoisted_1$1 = {
1280
1280
  "class": "fw-card shadow rounded-lg"
1281
1281
  };
1282
- var _hoisted_2 = {
1282
+ var _hoisted_2$1 = {
1283
1283
  key: 0,
1284
1284
  "class": "fw-card--header text-lg px-8 py-4 font-bold bg-grey-lightest rounded-t-lg border-opacity-0"
1285
1285
  };
1286
- var _hoisted_3 = {
1286
+ var _hoisted_3$1 = {
1287
1287
  key: 0,
1288
1288
  "class": "fw-card--prefix-title text-primary"
1289
1289
  };
1290
- var _hoisted_4 = {
1290
+ var _hoisted_4$1 = {
1291
1291
  key: 1
1292
1292
  };
1293
- var _hoisted_5 = {
1293
+ var _hoisted_5$1 = {
1294
1294
  key: 1,
1295
1295
  "class": "p-8"
1296
1296
  };
1297
- function render$1(_ctx, _cache, $props, $setup, $data, $options) {
1298
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [_ctx.title || _ctx.prefixTitle ? (vue.openBlock(), vue.createElementBlock("h4", _hoisted_2, [_ctx.prefixTitle ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3, vue.toDisplayString(_ctx.prefixTitle), 1)) : vue.createCommentVNode("", true), _ctx.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4, vue.toDisplayString(_ctx.title), 1)) : vue.createCommentVNode("", true)])) : vue.createCommentVNode("", true), _ctx.$slots["default"] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [vue.renderSlot(_ctx.$slots, "default")])) : vue.createCommentVNode("", true)]);
1299
- }script$1.render = render$1;var es_array_includes = {};var objectDefineProperties = {};var DESCRIPTORS = descriptors;
1297
+ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
1298
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [_ctx.title || _ctx.prefixTitle ? (vue.openBlock(), vue.createElementBlock("h4", _hoisted_2$1, [_ctx.prefixTitle ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$1, vue.toDisplayString(_ctx.prefixTitle), 1)) : vue.createCommentVNode("", true), _ctx.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$1, vue.toDisplayString(_ctx.title), 1)) : vue.createCommentVNode("", true)])) : vue.createCommentVNode("", true), _ctx.$slots["default"] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$1, [vue.renderSlot(_ctx.$slots, "default")])) : vue.createCommentVNode("", true)]);
1299
+ }script$2.render = render$2;var es_array_includes = {};var objectDefineProperties = {};var DESCRIPTORS = descriptors;
1300
1300
  var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1301
1301
  var definePropertyModule$1 = objectDefineProperty;
1302
1302
  var anObject$1 = anObject$4;
@@ -1432,7 +1432,7 @@ $({ target: 'Array', proto: true }, {
1432
1432
  });
1433
1433
 
1434
1434
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1435
- addToUnscopables('includes');var script = vue.defineComponent({
1435
+ addToUnscopables('includes');var script$1 = vue.defineComponent({
1436
1436
  name: 'FwButton',
1437
1437
  emits: ['click', 'mouseover', 'mouseout', 'focusin', 'focusout'],
1438
1438
  props: {
@@ -1467,7 +1467,7 @@ addToUnscopables('includes');var script = vue.defineComponent({
1467
1467
  type: String,
1468
1468
  "default": 'primary',
1469
1469
  validator: function validator(value) {
1470
- return ['primary', 'secondary', 'tertiary', 'error', 'success'].includes(value);
1470
+ return ['primary', 'secondary', 'tertiary', 'error', 'success', 'text'].includes(value);
1471
1471
  }
1472
1472
  }
1473
1473
  },
@@ -1479,9 +1479,9 @@ addToUnscopables('includes');var script = vue.defineComponent({
1479
1479
  border: 'border-primary focus:ring-primary'
1480
1480
  },
1481
1481
  secondary: {
1482
- text: 'text-secondary hover:text-tertiary active:text-tertiary',
1483
- background: 'bg-tertiary hover:bg-secondary active:bg-secondary',
1484
- border: 'border-secondary focus:ring-secondary'
1482
+ text: 'text-primary hover:text-tertiary active:text-tertiary',
1483
+ background: 'bg-tertiary hover:bg-primary active:bg-primary',
1484
+ border: 'border-primary focus:ring-primary'
1485
1485
  },
1486
1486
  tertiary: {
1487
1487
  text: 'text-tertiary hover:text-secondary active:text-secondary',
@@ -1497,6 +1497,11 @@ addToUnscopables('includes');var script = vue.defineComponent({
1497
1497
  text: 'text-white hover:text-error active:text-error',
1498
1498
  background: 'bg-error hover:bg-white active:bg-white',
1499
1499
  border: 'border-error focus:ring-error'
1500
+ },
1501
+ text: {
1502
+ text: 'text-body font-medium hover:text-white active:text-white',
1503
+ background: 'bg-white hover:bg-body active:bg-body',
1504
+ border: 'border-transparent focus:ring-body'
1500
1505
  }
1501
1506
  });
1502
1507
  var sizes = vue.ref({
@@ -1558,6 +1563,11 @@ addToUnscopables('includes');var script = vue.defineComponent({
1558
1563
  return ctx.emit('focusout', e);
1559
1564
  };
1560
1565
 
1566
+ var tagName = vue.computed(function () {
1567
+ if (props.to) return 'router-link';
1568
+ if (props.href) return 'a';
1569
+ return 'button';
1570
+ });
1561
1571
  return {
1562
1572
  textColorClass: textColorClass,
1563
1573
  bgColorClass: bgColorClass,
@@ -1567,33 +1577,217 @@ addToUnscopables('includes');var script = vue.defineComponent({
1567
1577
  onMouseover: onMouseover,
1568
1578
  onMouseout: onMouseout,
1569
1579
  onFocusin: onFocusin,
1570
- onFocusout: onFocusout
1580
+ onFocusout: onFocusout,
1581
+ tagName: tagName
1571
1582
  };
1572
1583
  }
1573
- });var _hoisted_1 = ["to", "href"];
1574
- function render(_ctx, _cache, $props, $setup, $data, $options) {
1575
- return vue.openBlock(), vue.createElementBlock("button", {
1576
- "class": vue.normalizeClass(["fw-button font-bold rounded-full border-2 focus:outline-none ring-offset-2 focus:ring", [_ctx.textColorClass, _ctx.bgColorClass, _ctx.sizeClass, _ctx.borderClass]]),
1577
- type: "button",
1584
+ });function render$1(_ctx, _cache, $props, $setup, $data, $options) {
1585
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tagName), {
1586
+ "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]]),
1587
+ type: _ctx.tagName === 'button' ? _ctx.tagName : null,
1578
1588
  to: _ctx.to,
1579
1589
  href: _ctx.href,
1580
- onClick: _cache[0] || (_cache[0] = function () {
1581
- return _ctx.onClick && _ctx.onClick.apply(_ctx, arguments);
1590
+ onClick: _ctx.onClick,
1591
+ onFocusin: _ctx.onFocusin,
1592
+ onFocusout: _ctx.onFocusout,
1593
+ onMouseover: _ctx.onMouseover,
1594
+ onMouseout: _ctx.onMouseout
1595
+ }, {
1596
+ "default": vue.withCtx(function () {
1597
+ return [vue.renderSlot(_ctx.$slots, "default")];
1582
1598
  }),
1583
- onFocusin: _cache[1] || (_cache[1] = function () {
1584
- return _ctx.onFocusin && _ctx.onFocusin.apply(_ctx, arguments);
1599
+ _: 3
1600
+ }, 8, ["class", "type", "to", "href", "onClick", "onFocusin", "onFocusout", "onMouseover", "onMouseout"]);
1601
+ }script$1.render = render$1;var script = vue.defineComponent({
1602
+ name: 'FwNavigationMenu',
1603
+ emits: ['action'],
1604
+ components: {
1605
+ FwButton: script$1
1606
+ },
1607
+ props: {
1608
+ /**
1609
+ * An array of menu items
1610
+ * `{ to?: string | object; href?: string; label: string; }`
1611
+ */
1612
+ menuItems: {
1613
+ type: Array
1614
+ },
1615
+
1616
+ /**
1617
+ * The label for the action button.
1618
+ * Also emits the `action` event.
1619
+ */
1620
+ actionLabel: {
1621
+ type: String
1622
+ }
1623
+ },
1624
+ setup: function setup(_props, ctx) {
1625
+ var isMobileMenuOpen = vue.ref(false);
1626
+
1627
+ var toggleMobileMenu = function toggleMobileMenu() {
1628
+ return isMobileMenuOpen.value = !isMobileMenuOpen.value;
1629
+ };
1630
+
1631
+ var actionClicked = function actionClicked() {
1632
+ return ctx.emit('action');
1633
+ };
1634
+
1635
+ return {
1636
+ isMobileMenuOpen: isMobileMenuOpen,
1637
+ toggleMobileMenu: toggleMobileMenu,
1638
+ actionClicked: actionClicked
1639
+ };
1640
+ }
1641
+ });var _hoisted_1 = {
1642
+ "class": "fw-nav-menu relative z-50 h-20 shadow-md"
1643
+ };
1644
+ var _hoisted_2 = {
1645
+ "class": "px-6 flex-1 h-full flex bg-white items-stretch justify-between"
1646
+ };
1647
+ var _hoisted_3 = {
1648
+ key: 0,
1649
+ "class": "flex-shrink-0 flex items-center"
1650
+ };
1651
+ var _hoisted_4 = {
1652
+ key: 1,
1653
+ "class": "container hidden sm:flex items-center justify-start sm:ml-6"
1654
+ };
1655
+ var _hoisted_5 = {
1656
+ "class": "flex space-x-2"
1657
+ };
1658
+ var _hoisted_6 = {
1659
+ key: 2,
1660
+ "class": "hidden sm:flex items-center justify-start sm:ml-6"
1661
+ };
1662
+ var _hoisted_7 = {
1663
+ "class": "flex items-center sm:hidden"
1664
+ };
1665
+
1666
+ var _hoisted_8 = /*#__PURE__*/vue.createElementVNode("span", {
1667
+ "class": "sr-only"
1668
+ }, "Open main menu", -1);
1669
+
1670
+ var _hoisted_9 = {
1671
+ "class": "block h-6 w-6",
1672
+ xmlns: "http://www.w3.org/2000/svg",
1673
+ fill: "none",
1674
+ viewBox: "0 0 24 24",
1675
+ stroke: "currentColor",
1676
+ "aria-hidden": "true"
1677
+ };
1678
+ var _hoisted_10 = ["d"];
1679
+ var _hoisted_11 = {
1680
+ key: 0,
1681
+ "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"
1682
+ };
1683
+ var _hoisted_12 = {
1684
+ "class": "w-full flex flex-col"
1685
+ };
1686
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
1687
+ var _ctx$menuItems;
1688
+
1689
+ var _component_FwButton = vue.resolveComponent("FwButton");
1690
+
1691
+ return vue.openBlock(), vue.createElementBlock("nav", _hoisted_1, [vue.createElementVNode("div", _hoisted_2, [_ctx.$slots.logo ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [vue.renderSlot(_ctx.$slots, "logo")])) : vue.createCommentVNode("", true), ((_ctx$menuItems = _ctx.menuItems) === null || _ctx$menuItems === void 0 ? void 0 : _ctx$menuItems.length) > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [vue.createElementVNode("div", _hoisted_5, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.menuItems, function (item, i) {
1692
+ return vue.openBlock(), vue.createBlock(_component_FwButton, {
1693
+ key: i,
1694
+ variant: "text",
1695
+ href: item.href,
1696
+ to: item.to,
1697
+ size: "md",
1698
+ "aria-current": "page"
1699
+ }, {
1700
+ "default": vue.withCtx(function () {
1701
+ return [vue.createTextVNode(vue.toDisplayString(item.label), 1)];
1702
+ }),
1703
+ _: 2
1704
+ }, 1032, ["href", "to"]);
1705
+ }), 128))])])) : vue.createCommentVNode("", true), _ctx.actionLabel ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [vue.createVNode(_component_FwButton, {
1706
+ onClick: _ctx.actionClicked,
1707
+ size: "md",
1708
+ "aria-label": _ctx.actionLabel
1709
+ }, {
1710
+ "default": vue.withCtx(function () {
1711
+ return [vue.createTextVNode(vue.toDisplayString(_ctx.actionLabel), 1)];
1585
1712
  }),
1586
- onFocusout: _cache[2] || (_cache[2] = function () {
1587
- return _ctx.onFocusout && _ctx.onFocusout.apply(_ctx, arguments);
1713
+ _: 1
1714
+ }, 8, ["onClick", "aria-label"])])) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_7, [vue.createVNode(_component_FwButton, {
1715
+ variant: "text",
1716
+ size: "sm",
1717
+ onClick: _ctx.toggleMobileMenu
1718
+ }, {
1719
+ "default": vue.withCtx(function () {
1720
+ return [_hoisted_8, (vue.openBlock(), vue.createElementBlock("svg", _hoisted_9, [vue.createElementVNode("path", {
1721
+ "stroke-linecap": "round",
1722
+ "stroke-linejoin": "round",
1723
+ "stroke-width": "2",
1724
+ d: _ctx.isMobileMenuOpen ? 'M6 18L18 6M6 6l12 12' : 'M4 6h16M4 12h16M4 18h16'
1725
+ }, null, 8, _hoisted_10)]))];
1588
1726
  }),
1589
- onMouseover: _cache[3] || (_cache[3] = function () {
1590
- return _ctx.onMouseover && _ctx.onMouseover.apply(_ctx, arguments);
1727
+ _: 1
1728
+ }, 8, ["onClick"])])]), vue.createVNode(vue.Transition, {
1729
+ name: "slideInLeft"
1730
+ }, {
1731
+ "default": vue.withCtx(function () {
1732
+ var _ctx$menuItems2;
1733
+
1734
+ 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) {
1735
+ return vue.openBlock(), vue.createBlock(_component_FwButton, {
1736
+ key: i,
1737
+ "class": "w-full rounded-md px-2",
1738
+ variant: "text",
1739
+ href: item.href,
1740
+ to: item.to,
1741
+ size: "md",
1742
+ "aria-current": "page"
1743
+ }, {
1744
+ "default": vue.withCtx(function () {
1745
+ return [vue.createTextVNode(vue.toDisplayString(item.label), 1)];
1746
+ }),
1747
+ _: 2
1748
+ }, 1032, ["href", "to"]);
1749
+ }), 128))]), _ctx.actionLabel ? (vue.openBlock(), vue.createBlock(_component_FwButton, {
1750
+ key: 0,
1751
+ "class": "w-full rounded-md px-2",
1752
+ onClick: _ctx.actionClicked,
1753
+ size: "md"
1754
+ }, {
1755
+ "default": vue.withCtx(function () {
1756
+ return [vue.createTextVNode(vue.toDisplayString(_ctx.actionLabel), 1)];
1757
+ }),
1758
+ _: 1
1759
+ }, 8, ["onClick"])) : vue.createCommentVNode("", true)])) : vue.createCommentVNode("", true)];
1591
1760
  }),
1592
- onMouseout: _cache[4] || (_cache[4] = function () {
1593
- return _ctx.onMouseout && _ctx.onMouseout.apply(_ctx, arguments);
1594
- })
1595
- }, [vue.renderSlot(_ctx.$slots, "default")], 42, _hoisted_1);
1596
- }script.render = render;var components$1=/*#__PURE__*/Object.freeze({__proto__:null,FwCard:script$1,FwButton:script});var install = function install(app) {
1761
+ _: 1
1762
+ })]);
1763
+ }function styleInject(css, ref) {
1764
+ if ( ref === void 0 ) ref = {};
1765
+ var insertAt = ref.insertAt;
1766
+
1767
+ if (!css || typeof document === 'undefined') { return; }
1768
+
1769
+ var head = document.head || document.getElementsByTagName('head')[0];
1770
+ var style = document.createElement('style');
1771
+ style.type = 'text/css';
1772
+
1773
+ if (insertAt === 'top') {
1774
+ if (head.firstChild) {
1775
+ head.insertBefore(style, head.firstChild);
1776
+ } else {
1777
+ head.appendChild(style);
1778
+ }
1779
+ } else {
1780
+ head.appendChild(style);
1781
+ }
1782
+
1783
+ if (style.styleSheet) {
1784
+ style.styleSheet.cssText = css;
1785
+ } else {
1786
+ style.appendChild(document.createTextNode(css));
1787
+ }
1788
+ }var css_248z = ".fw-nav-menu--mobile{z-index:-1}.fw-nav-menu--mobile,.slideInLeft-enter-active{-webkit-transition:left .35s ease-in;-o-transition:left .35s ease-in;transition:left .35s ease-in}.slideInLeft-enter-active{-webkit-animation:slideInLeft .35s;animation:slideInLeft .35s}.slideInLeft-leave-active{animation:slideInLeft .35s reverse;-webkit-transition:left .35s ease-in-out;-o-transition:left .35s ease-in-out;transition:left .35s ease-in-out}@-webkit-keyframes slideInLeft{0%{left:100%}to{left:0}}@keyframes slideInLeft{0%{left:100%}to{left:0}}";
1789
+ var stylesheet = ".fw-nav-menu--mobile{z-index:-1}.fw-nav-menu--mobile,.slideInLeft-enter-active{-webkit-transition:left .35s ease-in;-o-transition:left .35s ease-in;transition:left .35s ease-in}.slideInLeft-enter-active{-webkit-animation:slideInLeft .35s;animation:slideInLeft .35s}.slideInLeft-leave-active{animation:slideInLeft .35s reverse;-webkit-transition:left .35s ease-in-out;-o-transition:left .35s ease-in-out;transition:left .35s ease-in-out}@-webkit-keyframes slideInLeft{0%{left:100%}to{left:0}}@keyframes slideInLeft{0%{left:100%}to{left:0}}";
1790
+ styleInject(css_248z);script.render = render;var components$1=/*#__PURE__*/Object.freeze({__proto__:null,FwCard:script$2,FwButton:script$1,FwNavigationMenu:script});var install = function install(app) {
1597
1791
  Object.entries(components$1).forEach(function (_ref) {
1598
1792
  var _ref2 = _slicedToArray(_ref, 2),
1599
1793
  componentName = _ref2[0],
@@ -1601,7 +1795,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1601
1795
 
1602
1796
  app.component(componentName, component);
1603
1797
  });
1604
- };var components=/*#__PURE__*/Object.freeze({__proto__:null,'default':install,FwCard:script$1,FwButton:script});Object.entries(components).forEach(function (_ref) {
1798
+ };var components=/*#__PURE__*/Object.freeze({__proto__:null,'default':install,FwCard:script$2,FwButton:script$1,FwNavigationMenu:script});Object.entries(components).forEach(function (_ref) {
1605
1799
  var _ref2 = _slicedToArray(_ref, 2),
1606
1800
  componentName = _ref2[0],
1607
1801
  component = _ref2[1];
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, computed, openBlock, createElementBlock, normalizeClass, renderSlot } from 'vue';
1
+ import { defineComponent, ref, computed, openBlock, createBlock, resolveDynamicComponent, normalizeClass, withCtx, renderSlot } from 'vue';
2
2
 
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
 
@@ -1183,7 +1183,7 @@ var script = defineComponent({
1183
1183
  type: String,
1184
1184
  "default": 'primary',
1185
1185
  validator: function validator(value) {
1186
- return ['primary', 'secondary', 'tertiary', 'error', 'success'].includes(value);
1186
+ return ['primary', 'secondary', 'tertiary', 'error', 'success', 'text'].includes(value);
1187
1187
  }
1188
1188
  }
1189
1189
  },
@@ -1195,9 +1195,9 @@ var script = defineComponent({
1195
1195
  border: 'border-primary focus:ring-primary'
1196
1196
  },
1197
1197
  secondary: {
1198
- text: 'text-secondary hover:text-tertiary active:text-tertiary',
1199
- background: 'bg-tertiary hover:bg-secondary active:bg-secondary',
1200
- border: 'border-secondary focus:ring-secondary'
1198
+ text: 'text-primary hover:text-tertiary active:text-tertiary',
1199
+ background: 'bg-tertiary hover:bg-primary active:bg-primary',
1200
+ border: 'border-primary focus:ring-primary'
1201
1201
  },
1202
1202
  tertiary: {
1203
1203
  text: 'text-tertiary hover:text-secondary active:text-secondary',
@@ -1213,6 +1213,11 @@ var script = defineComponent({
1213
1213
  text: 'text-white hover:text-error active:text-error',
1214
1214
  background: 'bg-error hover:bg-white active:bg-white',
1215
1215
  border: 'border-error focus:ring-error'
1216
+ },
1217
+ text: {
1218
+ text: 'text-body font-medium hover:text-white active:text-white',
1219
+ background: 'bg-white hover:bg-body active:bg-body',
1220
+ border: 'border-transparent focus:ring-body'
1216
1221
  }
1217
1222
  });
1218
1223
  var sizes = ref({
@@ -1274,6 +1279,11 @@ var script = defineComponent({
1274
1279
  return ctx.emit('focusout', e);
1275
1280
  };
1276
1281
 
1282
+ var tagName = computed(function () {
1283
+ if (props.to) return 'router-link';
1284
+ if (props.href) return 'a';
1285
+ return 'button';
1286
+ });
1277
1287
  return {
1278
1288
  textColorClass: textColorClass,
1279
1289
  bgColorClass: bgColorClass,
@@ -1283,34 +1293,29 @@ var script = defineComponent({
1283
1293
  onMouseover: onMouseover,
1284
1294
  onMouseout: onMouseout,
1285
1295
  onFocusin: onFocusin,
1286
- onFocusout: onFocusout
1296
+ onFocusout: onFocusout,
1297
+ tagName: tagName
1287
1298
  };
1288
1299
  }
1289
1300
  });
1290
1301
 
1291
- var _hoisted_1 = ["to", "href"];
1292
1302
  function render(_ctx, _cache, $props, $setup, $data, $options) {
1293
- return openBlock(), createElementBlock("button", {
1294
- "class": normalizeClass(["fw-button font-bold rounded-full border-2 focus:outline-none ring-offset-2 focus:ring", [_ctx.textColorClass, _ctx.bgColorClass, _ctx.sizeClass, _ctx.borderClass]]),
1295
- type: "button",
1303
+ return openBlock(), createBlock(resolveDynamicComponent(_ctx.tagName), {
1304
+ "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]]),
1305
+ type: _ctx.tagName === 'button' ? _ctx.tagName : null,
1296
1306
  to: _ctx.to,
1297
1307
  href: _ctx.href,
1298
- onClick: _cache[0] || (_cache[0] = function () {
1299
- return _ctx.onClick && _ctx.onClick.apply(_ctx, arguments);
1300
- }),
1301
- onFocusin: _cache[1] || (_cache[1] = function () {
1302
- return _ctx.onFocusin && _ctx.onFocusin.apply(_ctx, arguments);
1303
- }),
1304
- onFocusout: _cache[2] || (_cache[2] = function () {
1305
- return _ctx.onFocusout && _ctx.onFocusout.apply(_ctx, arguments);
1306
- }),
1307
- onMouseover: _cache[3] || (_cache[3] = function () {
1308
- return _ctx.onMouseover && _ctx.onMouseover.apply(_ctx, arguments);
1308
+ onClick: _ctx.onClick,
1309
+ onFocusin: _ctx.onFocusin,
1310
+ onFocusout: _ctx.onFocusout,
1311
+ onMouseover: _ctx.onMouseover,
1312
+ onMouseout: _ctx.onMouseout
1313
+ }, {
1314
+ "default": withCtx(function () {
1315
+ return [renderSlot(_ctx.$slots, "default")];
1309
1316
  }),
1310
- onMouseout: _cache[4] || (_cache[4] = function () {
1311
- return _ctx.onMouseout && _ctx.onMouseout.apply(_ctx, arguments);
1312
- })
1313
- }, [renderSlot(_ctx.$slots, "default")], 42, _hoisted_1);
1317
+ _: 3
1318
+ }, 8, ["class", "type", "to", "href", "onClick", "onFocusin", "onFocusout", "onMouseover", "onMouseout"]);
1314
1319
  }
1315
1320
 
1316
1321
  script.render = render;
package/esm/fw-button.js CHANGED
@@ -1,2 +1,2 @@
1
- export { u as FwButton } from './index-758e7e1e.js';
1
+ export { u as FwButton } from './fw-button-0f8956b5.js';
2
2
  import 'vue';
@@ -0,0 +1,203 @@
1
+ import { defineComponent, ref, createElementVNode, resolveComponent, openBlock, createElementBlock, renderSlot, createCommentVNode, Fragment, renderList, createBlock, withCtx, createTextVNode, toDisplayString, createVNode, Transition } from 'vue';
2
+ import { u as script$1 } from './fw-button-0f8956b5.js';
3
+
4
+ var script = defineComponent({
5
+ name: 'FwNavigationMenu',
6
+ emits: ['action'],
7
+ components: {
8
+ FwButton: script$1
9
+ },
10
+ props: {
11
+ /**
12
+ * An array of menu items
13
+ * `{ to?: string | object; href?: string; label: string; }`
14
+ */
15
+ menuItems: {
16
+ type: Array
17
+ },
18
+
19
+ /**
20
+ * The label for the action button.
21
+ * Also emits the `action` event.
22
+ */
23
+ actionLabel: {
24
+ type: String
25
+ }
26
+ },
27
+ setup: function setup(_props, ctx) {
28
+ var isMobileMenuOpen = ref(false);
29
+
30
+ var toggleMobileMenu = function toggleMobileMenu() {
31
+ return isMobileMenuOpen.value = !isMobileMenuOpen.value;
32
+ };
33
+
34
+ var actionClicked = function actionClicked() {
35
+ return ctx.emit('action');
36
+ };
37
+
38
+ return {
39
+ isMobileMenuOpen: isMobileMenuOpen,
40
+ toggleMobileMenu: toggleMobileMenu,
41
+ actionClicked: actionClicked
42
+ };
43
+ }
44
+ });
45
+
46
+ var _hoisted_1 = {
47
+ "class": "fw-nav-menu relative z-50 h-20 shadow-md"
48
+ };
49
+ var _hoisted_2 = {
50
+ "class": "px-6 flex-1 h-full flex bg-white items-stretch justify-between"
51
+ };
52
+ var _hoisted_3 = {
53
+ key: 0,
54
+ "class": "flex-shrink-0 flex items-center"
55
+ };
56
+ var _hoisted_4 = {
57
+ key: 1,
58
+ "class": "container hidden sm:flex items-center justify-start sm:ml-6"
59
+ };
60
+ var _hoisted_5 = {
61
+ "class": "flex space-x-2"
62
+ };
63
+ var _hoisted_6 = {
64
+ key: 2,
65
+ "class": "hidden sm:flex items-center justify-start sm:ml-6"
66
+ };
67
+ var _hoisted_7 = {
68
+ "class": "flex items-center sm:hidden"
69
+ };
70
+
71
+ var _hoisted_8 = /*#__PURE__*/createElementVNode("span", {
72
+ "class": "sr-only"
73
+ }, "Open main menu", -1);
74
+
75
+ var _hoisted_9 = {
76
+ "class": "block h-6 w-6",
77
+ xmlns: "http://www.w3.org/2000/svg",
78
+ fill: "none",
79
+ viewBox: "0 0 24 24",
80
+ stroke: "currentColor",
81
+ "aria-hidden": "true"
82
+ };
83
+ var _hoisted_10 = ["d"];
84
+ var _hoisted_11 = {
85
+ key: 0,
86
+ "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"
87
+ };
88
+ var _hoisted_12 = {
89
+ "class": "w-full flex flex-col"
90
+ };
91
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
92
+ var _ctx$menuItems;
93
+
94
+ var _component_FwButton = resolveComponent("FwButton");
95
+
96
+ return openBlock(), createElementBlock("nav", _hoisted_1, [createElementVNode("div", _hoisted_2, [_ctx.$slots.logo ? (openBlock(), createElementBlock("div", _hoisted_3, [renderSlot(_ctx.$slots, "logo")])) : createCommentVNode("", true), ((_ctx$menuItems = _ctx.menuItems) === null || _ctx$menuItems === void 0 ? void 0 : _ctx$menuItems.length) > 0 ? (openBlock(), createElementBlock("div", _hoisted_4, [createElementVNode("div", _hoisted_5, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menuItems, function (item, i) {
97
+ return openBlock(), createBlock(_component_FwButton, {
98
+ key: i,
99
+ variant: "text",
100
+ href: item.href,
101
+ to: item.to,
102
+ size: "md",
103
+ "aria-current": "page"
104
+ }, {
105
+ "default": withCtx(function () {
106
+ return [createTextVNode(toDisplayString(item.label), 1)];
107
+ }),
108
+ _: 2
109
+ }, 1032, ["href", "to"]);
110
+ }), 128))])])) : createCommentVNode("", true), _ctx.actionLabel ? (openBlock(), createElementBlock("div", _hoisted_6, [createVNode(_component_FwButton, {
111
+ onClick: _ctx.actionClicked,
112
+ size: "md",
113
+ "aria-label": _ctx.actionLabel
114
+ }, {
115
+ "default": withCtx(function () {
116
+ return [createTextVNode(toDisplayString(_ctx.actionLabel), 1)];
117
+ }),
118
+ _: 1
119
+ }, 8, ["onClick", "aria-label"])])) : createCommentVNode("", true), createElementVNode("div", _hoisted_7, [createVNode(_component_FwButton, {
120
+ variant: "text",
121
+ size: "sm",
122
+ onClick: _ctx.toggleMobileMenu
123
+ }, {
124
+ "default": withCtx(function () {
125
+ return [_hoisted_8, (openBlock(), createElementBlock("svg", _hoisted_9, [createElementVNode("path", {
126
+ "stroke-linecap": "round",
127
+ "stroke-linejoin": "round",
128
+ "stroke-width": "2",
129
+ d: _ctx.isMobileMenuOpen ? 'M6 18L18 6M6 6l12 12' : 'M4 6h16M4 12h16M4 18h16'
130
+ }, null, 8, _hoisted_10)]))];
131
+ }),
132
+ _: 1
133
+ }, 8, ["onClick"])])]), createVNode(Transition, {
134
+ name: "slideInLeft"
135
+ }, {
136
+ "default": withCtx(function () {
137
+ var _ctx$menuItems2;
138
+
139
+ return [((_ctx$menuItems2 = _ctx.menuItems) === null || _ctx$menuItems2 === void 0 ? void 0 : _ctx$menuItems2.length) > 0 && _ctx.isMobileMenuOpen ? (openBlock(), createElementBlock("div", _hoisted_11, [createElementVNode("div", _hoisted_12, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menuItems, function (item, i) {
140
+ return openBlock(), createBlock(_component_FwButton, {
141
+ key: i,
142
+ "class": "w-full rounded-md px-2",
143
+ variant: "text",
144
+ href: item.href,
145
+ to: item.to,
146
+ size: "md",
147
+ "aria-current": "page"
148
+ }, {
149
+ "default": withCtx(function () {
150
+ return [createTextVNode(toDisplayString(item.label), 1)];
151
+ }),
152
+ _: 2
153
+ }, 1032, ["href", "to"]);
154
+ }), 128))]), _ctx.actionLabel ? (openBlock(), createBlock(_component_FwButton, {
155
+ key: 0,
156
+ "class": "w-full rounded-md px-2",
157
+ onClick: _ctx.actionClicked,
158
+ size: "md"
159
+ }, {
160
+ "default": withCtx(function () {
161
+ return [createTextVNode(toDisplayString(_ctx.actionLabel), 1)];
162
+ }),
163
+ _: 1
164
+ }, 8, ["onClick"])) : createCommentVNode("", true)])) : createCommentVNode("", true)];
165
+ }),
166
+ _: 1
167
+ })]);
168
+ }
169
+
170
+ function styleInject(css, ref) {
171
+ if ( ref === void 0 ) ref = {};
172
+ var insertAt = ref.insertAt;
173
+
174
+ if (!css || typeof document === 'undefined') { return; }
175
+
176
+ var head = document.head || document.getElementsByTagName('head')[0];
177
+ var style = document.createElement('style');
178
+ style.type = 'text/css';
179
+
180
+ if (insertAt === 'top') {
181
+ if (head.firstChild) {
182
+ head.insertBefore(style, head.firstChild);
183
+ } else {
184
+ head.appendChild(style);
185
+ }
186
+ } else {
187
+ head.appendChild(style);
188
+ }
189
+
190
+ if (style.styleSheet) {
191
+ style.styleSheet.cssText = css;
192
+ } else {
193
+ style.appendChild(document.createTextNode(css));
194
+ }
195
+ }
196
+
197
+ var css_248z = ".fw-nav-menu--mobile{z-index:-1}.fw-nav-menu--mobile,.slideInLeft-enter-active{-webkit-transition:left .35s ease-in;-o-transition:left .35s ease-in;transition:left .35s ease-in}.slideInLeft-enter-active{-webkit-animation:slideInLeft .35s;animation:slideInLeft .35s}.slideInLeft-leave-active{animation:slideInLeft .35s reverse;-webkit-transition:left .35s ease-in-out;-o-transition:left .35s ease-in-out;transition:left .35s ease-in-out}@-webkit-keyframes slideInLeft{0%{left:100%}to{left:0}}@keyframes slideInLeft{0%{left:100%}to{left:0}}";
198
+ var stylesheet = ".fw-nav-menu--mobile{z-index:-1}.fw-nav-menu--mobile,.slideInLeft-enter-active{-webkit-transition:left .35s ease-in;-o-transition:left .35s ease-in;transition:left .35s ease-in}.slideInLeft-enter-active{-webkit-animation:slideInLeft .35s;animation:slideInLeft .35s}.slideInLeft-leave-active{animation:slideInLeft .35s reverse;-webkit-transition:left .35s ease-in-out;-o-transition:left .35s ease-in-out;transition:left .35s ease-in-out}@-webkit-keyframes slideInLeft{0%{left:100%}to{left:0}}@keyframes slideInLeft{0%{left:100%}to{left:0}}";
199
+ styleInject(css_248z);
200
+
201
+ script.render = render;
202
+
203
+ export { script as FwNavigationMenu };
package/esm/index.js CHANGED
@@ -1,7 +1,10 @@
1
- import { f as functionUncurryThis, a as aCallable$1, b as functionBindNative, c as classofRaw$1, w as wellKnownSymbol$3, g as global$3, i as isCallable$2, d as fails$2, e as getBuiltIn$1, h as inspectSource$1, j as isObject$1, k as indexedObject, t as toObject$1, l as lengthOfArrayLike$1, _ as _export, r as redefine$1, m as documentCreateElement$1, n as createNonEnumerableProperty$1, o as descriptors, p as objectKeys$1, q as toIndexedObject$1, s as objectPropertyIsEnumerable, u as script$1 } from './index-758e7e1e.js';
2
- export { u as FwButton } from './index-758e7e1e.js';
1
+ import { f as functionUncurryThis, a as aCallable$1, b as functionBindNative, c as classofRaw$1, w as wellKnownSymbol$3, g as global$3, i as isCallable$2, d as fails$2, e as getBuiltIn$1, h as inspectSource$1, j as isObject$1, k as indexedObject, t as toObject$1, l as lengthOfArrayLike$1, _ as _export, r as redefine$1, m as documentCreateElement$1, n as createNonEnumerableProperty$1, o as descriptors, p as objectKeys$1, q as toIndexedObject$1, s as objectPropertyIsEnumerable, u as script$1 } from './fw-button-0f8956b5.js';
2
+ export { u as FwButton } from './fw-button-0f8956b5.js';
3
3
  import { FwCard as script } from './fw-card.js';
4
4
  export { FwCard } from './fw-card.js';
5
+ import './fw-button.js';
6
+ import { FwNavigationMenu as script$2 } from './fw-navigation-menu.js';
7
+ export { FwNavigationMenu } from './fw-navigation-menu.js';
5
8
  import 'vue';
6
9
 
7
10
  function _arrayWithHoles(arr) {
@@ -468,7 +471,8 @@ $({ target: 'Object', stat: true }, {
468
471
  var components = /*#__PURE__*/Object.freeze({
469
472
  __proto__: null,
470
473
  FwCard: script,
471
- FwButton: script$1
474
+ FwButton: script$1,
475
+ FwNavigationMenu: script$2
472
476
  });
473
477
 
474
478
  var install = function install(app) {
@@ -1,4 +1,4 @@
1
- import { defineComponent, openBlock, createElementBlock, toDisplayString, createCommentVNode, renderSlot, ref, computed, normalizeClass } from 'vue';
1
+ import { defineComponent, openBlock, createElementBlock, toDisplayString, createCommentVNode, renderSlot, ref, computed, createBlock, resolveDynamicComponent, normalizeClass, withCtx, createElementVNode, resolveComponent, Fragment, renderList, createTextVNode, createVNode, Transition } from 'vue';
2
2
 
3
3
  function _arrayWithHoles(arr) {
4
4
  if (Array.isArray(arr)) return arr;
@@ -1459,7 +1459,7 @@ $$1({ target: 'Object', stat: true }, {
1459
1459
  }
1460
1460
  });
1461
1461
 
1462
- var script$1 = defineComponent({
1462
+ var script$2 = defineComponent({
1463
1463
  name: 'FwCard',
1464
1464
  props: {
1465
1465
  /**
@@ -1481,26 +1481,26 @@ var script$1 = defineComponent({
1481
1481
  var _hoisted_1$1 = {
1482
1482
  "class": "fw-card shadow rounded-lg"
1483
1483
  };
1484
- var _hoisted_2 = {
1484
+ var _hoisted_2$1 = {
1485
1485
  key: 0,
1486
1486
  "class": "fw-card--header text-lg px-8 py-4 font-bold bg-grey-lightest rounded-t-lg border-opacity-0"
1487
1487
  };
1488
- var _hoisted_3 = {
1488
+ var _hoisted_3$1 = {
1489
1489
  key: 0,
1490
1490
  "class": "fw-card--prefix-title text-primary"
1491
1491
  };
1492
- var _hoisted_4 = {
1492
+ var _hoisted_4$1 = {
1493
1493
  key: 1
1494
1494
  };
1495
- var _hoisted_5 = {
1495
+ var _hoisted_5$1 = {
1496
1496
  key: 1,
1497
1497
  "class": "p-8"
1498
1498
  };
1499
- function render$1(_ctx, _cache, $props, $setup, $data, $options) {
1500
- return openBlock(), createElementBlock("div", _hoisted_1$1, [_ctx.title || _ctx.prefixTitle ? (openBlock(), createElementBlock("h4", _hoisted_2, [_ctx.prefixTitle ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(_ctx.prefixTitle), 1)) : createCommentVNode("", true), _ctx.title ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true)])) : createCommentVNode("", true), _ctx.$slots["default"] ? (openBlock(), createElementBlock("div", _hoisted_5, [renderSlot(_ctx.$slots, "default")])) : createCommentVNode("", true)]);
1499
+ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
1500
+ return openBlock(), createElementBlock("div", _hoisted_1$1, [_ctx.title || _ctx.prefixTitle ? (openBlock(), createElementBlock("h4", _hoisted_2$1, [_ctx.prefixTitle ? (openBlock(), createElementBlock("span", _hoisted_3$1, toDisplayString(_ctx.prefixTitle), 1)) : createCommentVNode("", true), _ctx.title ? (openBlock(), createElementBlock("span", _hoisted_4$1, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true)])) : createCommentVNode("", true), _ctx.$slots["default"] ? (openBlock(), createElementBlock("div", _hoisted_5$1, [renderSlot(_ctx.$slots, "default")])) : createCommentVNode("", true)]);
1501
1501
  }
1502
1502
 
1503
- script$1.render = render$1;
1503
+ script$2.render = render$2;
1504
1504
 
1505
1505
  var es_array_includes = {};
1506
1506
 
@@ -1652,7 +1652,7 @@ $({ target: 'Array', proto: true }, {
1652
1652
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1653
1653
  addToUnscopables('includes');
1654
1654
 
1655
- var script = defineComponent({
1655
+ var script$1 = defineComponent({
1656
1656
  name: 'FwButton',
1657
1657
  emits: ['click', 'mouseover', 'mouseout', 'focusin', 'focusout'],
1658
1658
  props: {
@@ -1687,7 +1687,7 @@ var script = defineComponent({
1687
1687
  type: String,
1688
1688
  "default": 'primary',
1689
1689
  validator: function validator(value) {
1690
- return ['primary', 'secondary', 'tertiary', 'error', 'success'].includes(value);
1690
+ return ['primary', 'secondary', 'tertiary', 'error', 'success', 'text'].includes(value);
1691
1691
  }
1692
1692
  }
1693
1693
  },
@@ -1699,9 +1699,9 @@ var script = defineComponent({
1699
1699
  border: 'border-primary focus:ring-primary'
1700
1700
  },
1701
1701
  secondary: {
1702
- text: 'text-secondary hover:text-tertiary active:text-tertiary',
1703
- background: 'bg-tertiary hover:bg-secondary active:bg-secondary',
1704
- border: 'border-secondary focus:ring-secondary'
1702
+ text: 'text-primary hover:text-tertiary active:text-tertiary',
1703
+ background: 'bg-tertiary hover:bg-primary active:bg-primary',
1704
+ border: 'border-primary focus:ring-primary'
1705
1705
  },
1706
1706
  tertiary: {
1707
1707
  text: 'text-tertiary hover:text-secondary active:text-secondary',
@@ -1717,6 +1717,11 @@ var script = defineComponent({
1717
1717
  text: 'text-white hover:text-error active:text-error',
1718
1718
  background: 'bg-error hover:bg-white active:bg-white',
1719
1719
  border: 'border-error focus:ring-error'
1720
+ },
1721
+ text: {
1722
+ text: 'text-body font-medium hover:text-white active:text-white',
1723
+ background: 'bg-white hover:bg-body active:bg-body',
1724
+ border: 'border-transparent focus:ring-body'
1720
1725
  }
1721
1726
  });
1722
1727
  var sizes = ref({
@@ -1778,6 +1783,11 @@ var script = defineComponent({
1778
1783
  return ctx.emit('focusout', e);
1779
1784
  };
1780
1785
 
1786
+ var tagName = computed(function () {
1787
+ if (props.to) return 'router-link';
1788
+ if (props.href) return 'a';
1789
+ return 'button';
1790
+ });
1781
1791
  return {
1782
1792
  textColorClass: textColorClass,
1783
1793
  bgColorClass: bgColorClass,
@@ -1787,42 +1797,237 @@ var script = defineComponent({
1787
1797
  onMouseover: onMouseover,
1788
1798
  onMouseout: onMouseout,
1789
1799
  onFocusin: onFocusin,
1790
- onFocusout: onFocusout
1800
+ onFocusout: onFocusout,
1801
+ tagName: tagName
1791
1802
  };
1792
1803
  }
1793
1804
  });
1794
1805
 
1795
- var _hoisted_1 = ["to", "href"];
1796
- function render(_ctx, _cache, $props, $setup, $data, $options) {
1797
- return openBlock(), createElementBlock("button", {
1798
- "class": normalizeClass(["fw-button font-bold rounded-full border-2 focus:outline-none ring-offset-2 focus:ring", [_ctx.textColorClass, _ctx.bgColorClass, _ctx.sizeClass, _ctx.borderClass]]),
1799
- type: "button",
1806
+ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
1807
+ return openBlock(), createBlock(resolveDynamicComponent(_ctx.tagName), {
1808
+ "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]]),
1809
+ type: _ctx.tagName === 'button' ? _ctx.tagName : null,
1800
1810
  to: _ctx.to,
1801
1811
  href: _ctx.href,
1802
- onClick: _cache[0] || (_cache[0] = function () {
1803
- return _ctx.onClick && _ctx.onClick.apply(_ctx, arguments);
1812
+ onClick: _ctx.onClick,
1813
+ onFocusin: _ctx.onFocusin,
1814
+ onFocusout: _ctx.onFocusout,
1815
+ onMouseover: _ctx.onMouseover,
1816
+ onMouseout: _ctx.onMouseout
1817
+ }, {
1818
+ "default": withCtx(function () {
1819
+ return [renderSlot(_ctx.$slots, "default")];
1804
1820
  }),
1805
- onFocusin: _cache[1] || (_cache[1] = function () {
1806
- return _ctx.onFocusin && _ctx.onFocusin.apply(_ctx, arguments);
1821
+ _: 3
1822
+ }, 8, ["class", "type", "to", "href", "onClick", "onFocusin", "onFocusout", "onMouseover", "onMouseout"]);
1823
+ }
1824
+
1825
+ script$1.render = render$1;
1826
+
1827
+ var script = defineComponent({
1828
+ name: 'FwNavigationMenu',
1829
+ emits: ['action'],
1830
+ components: {
1831
+ FwButton: script$1
1832
+ },
1833
+ props: {
1834
+ /**
1835
+ * An array of menu items
1836
+ * `{ to?: string | object; href?: string; label: string; }`
1837
+ */
1838
+ menuItems: {
1839
+ type: Array
1840
+ },
1841
+
1842
+ /**
1843
+ * The label for the action button.
1844
+ * Also emits the `action` event.
1845
+ */
1846
+ actionLabel: {
1847
+ type: String
1848
+ }
1849
+ },
1850
+ setup: function setup(_props, ctx) {
1851
+ var isMobileMenuOpen = ref(false);
1852
+
1853
+ var toggleMobileMenu = function toggleMobileMenu() {
1854
+ return isMobileMenuOpen.value = !isMobileMenuOpen.value;
1855
+ };
1856
+
1857
+ var actionClicked = function actionClicked() {
1858
+ return ctx.emit('action');
1859
+ };
1860
+
1861
+ return {
1862
+ isMobileMenuOpen: isMobileMenuOpen,
1863
+ toggleMobileMenu: toggleMobileMenu,
1864
+ actionClicked: actionClicked
1865
+ };
1866
+ }
1867
+ });
1868
+
1869
+ var _hoisted_1 = {
1870
+ "class": "fw-nav-menu relative z-50 h-20 shadow-md"
1871
+ };
1872
+ var _hoisted_2 = {
1873
+ "class": "px-6 flex-1 h-full flex bg-white items-stretch justify-between"
1874
+ };
1875
+ var _hoisted_3 = {
1876
+ key: 0,
1877
+ "class": "flex-shrink-0 flex items-center"
1878
+ };
1879
+ var _hoisted_4 = {
1880
+ key: 1,
1881
+ "class": "container hidden sm:flex items-center justify-start sm:ml-6"
1882
+ };
1883
+ var _hoisted_5 = {
1884
+ "class": "flex space-x-2"
1885
+ };
1886
+ var _hoisted_6 = {
1887
+ key: 2,
1888
+ "class": "hidden sm:flex items-center justify-start sm:ml-6"
1889
+ };
1890
+ var _hoisted_7 = {
1891
+ "class": "flex items-center sm:hidden"
1892
+ };
1893
+
1894
+ var _hoisted_8 = /*#__PURE__*/createElementVNode("span", {
1895
+ "class": "sr-only"
1896
+ }, "Open main menu", -1);
1897
+
1898
+ var _hoisted_9 = {
1899
+ "class": "block h-6 w-6",
1900
+ xmlns: "http://www.w3.org/2000/svg",
1901
+ fill: "none",
1902
+ viewBox: "0 0 24 24",
1903
+ stroke: "currentColor",
1904
+ "aria-hidden": "true"
1905
+ };
1906
+ var _hoisted_10 = ["d"];
1907
+ var _hoisted_11 = {
1908
+ key: 0,
1909
+ "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"
1910
+ };
1911
+ var _hoisted_12 = {
1912
+ "class": "w-full flex flex-col"
1913
+ };
1914
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
1915
+ var _ctx$menuItems;
1916
+
1917
+ var _component_FwButton = resolveComponent("FwButton");
1918
+
1919
+ return openBlock(), createElementBlock("nav", _hoisted_1, [createElementVNode("div", _hoisted_2, [_ctx.$slots.logo ? (openBlock(), createElementBlock("div", _hoisted_3, [renderSlot(_ctx.$slots, "logo")])) : createCommentVNode("", true), ((_ctx$menuItems = _ctx.menuItems) === null || _ctx$menuItems === void 0 ? void 0 : _ctx$menuItems.length) > 0 ? (openBlock(), createElementBlock("div", _hoisted_4, [createElementVNode("div", _hoisted_5, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menuItems, function (item, i) {
1920
+ return openBlock(), createBlock(_component_FwButton, {
1921
+ key: i,
1922
+ variant: "text",
1923
+ href: item.href,
1924
+ to: item.to,
1925
+ size: "md",
1926
+ "aria-current": "page"
1927
+ }, {
1928
+ "default": withCtx(function () {
1929
+ return [createTextVNode(toDisplayString(item.label), 1)];
1930
+ }),
1931
+ _: 2
1932
+ }, 1032, ["href", "to"]);
1933
+ }), 128))])])) : createCommentVNode("", true), _ctx.actionLabel ? (openBlock(), createElementBlock("div", _hoisted_6, [createVNode(_component_FwButton, {
1934
+ onClick: _ctx.actionClicked,
1935
+ size: "md",
1936
+ "aria-label": _ctx.actionLabel
1937
+ }, {
1938
+ "default": withCtx(function () {
1939
+ return [createTextVNode(toDisplayString(_ctx.actionLabel), 1)];
1807
1940
  }),
1808
- onFocusout: _cache[2] || (_cache[2] = function () {
1809
- return _ctx.onFocusout && _ctx.onFocusout.apply(_ctx, arguments);
1941
+ _: 1
1942
+ }, 8, ["onClick", "aria-label"])])) : createCommentVNode("", true), createElementVNode("div", _hoisted_7, [createVNode(_component_FwButton, {
1943
+ variant: "text",
1944
+ size: "sm",
1945
+ onClick: _ctx.toggleMobileMenu
1946
+ }, {
1947
+ "default": withCtx(function () {
1948
+ return [_hoisted_8, (openBlock(), createElementBlock("svg", _hoisted_9, [createElementVNode("path", {
1949
+ "stroke-linecap": "round",
1950
+ "stroke-linejoin": "round",
1951
+ "stroke-width": "2",
1952
+ d: _ctx.isMobileMenuOpen ? 'M6 18L18 6M6 6l12 12' : 'M4 6h16M4 12h16M4 18h16'
1953
+ }, null, 8, _hoisted_10)]))];
1810
1954
  }),
1811
- onMouseover: _cache[3] || (_cache[3] = function () {
1812
- return _ctx.onMouseover && _ctx.onMouseover.apply(_ctx, arguments);
1955
+ _: 1
1956
+ }, 8, ["onClick"])])]), createVNode(Transition, {
1957
+ name: "slideInLeft"
1958
+ }, {
1959
+ "default": withCtx(function () {
1960
+ var _ctx$menuItems2;
1961
+
1962
+ return [((_ctx$menuItems2 = _ctx.menuItems) === null || _ctx$menuItems2 === void 0 ? void 0 : _ctx$menuItems2.length) > 0 && _ctx.isMobileMenuOpen ? (openBlock(), createElementBlock("div", _hoisted_11, [createElementVNode("div", _hoisted_12, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menuItems, function (item, i) {
1963
+ return openBlock(), createBlock(_component_FwButton, {
1964
+ key: i,
1965
+ "class": "w-full rounded-md px-2",
1966
+ variant: "text",
1967
+ href: item.href,
1968
+ to: item.to,
1969
+ size: "md",
1970
+ "aria-current": "page"
1971
+ }, {
1972
+ "default": withCtx(function () {
1973
+ return [createTextVNode(toDisplayString(item.label), 1)];
1974
+ }),
1975
+ _: 2
1976
+ }, 1032, ["href", "to"]);
1977
+ }), 128))]), _ctx.actionLabel ? (openBlock(), createBlock(_component_FwButton, {
1978
+ key: 0,
1979
+ "class": "w-full rounded-md px-2",
1980
+ onClick: _ctx.actionClicked,
1981
+ size: "md"
1982
+ }, {
1983
+ "default": withCtx(function () {
1984
+ return [createTextVNode(toDisplayString(_ctx.actionLabel), 1)];
1985
+ }),
1986
+ _: 1
1987
+ }, 8, ["onClick"])) : createCommentVNode("", true)])) : createCommentVNode("", true)];
1813
1988
  }),
1814
- onMouseout: _cache[4] || (_cache[4] = function () {
1815
- return _ctx.onMouseout && _ctx.onMouseout.apply(_ctx, arguments);
1816
- })
1817
- }, [renderSlot(_ctx.$slots, "default")], 42, _hoisted_1);
1989
+ _: 1
1990
+ })]);
1991
+ }
1992
+
1993
+ function styleInject(css, ref) {
1994
+ if ( ref === void 0 ) ref = {};
1995
+ var insertAt = ref.insertAt;
1996
+
1997
+ if (!css || typeof document === 'undefined') { return; }
1998
+
1999
+ var head = document.head || document.getElementsByTagName('head')[0];
2000
+ var style = document.createElement('style');
2001
+ style.type = 'text/css';
2002
+
2003
+ if (insertAt === 'top') {
2004
+ if (head.firstChild) {
2005
+ head.insertBefore(style, head.firstChild);
2006
+ } else {
2007
+ head.appendChild(style);
2008
+ }
2009
+ } else {
2010
+ head.appendChild(style);
2011
+ }
2012
+
2013
+ if (style.styleSheet) {
2014
+ style.styleSheet.cssText = css;
2015
+ } else {
2016
+ style.appendChild(document.createTextNode(css));
2017
+ }
1818
2018
  }
1819
2019
 
2020
+ var css_248z = ".fw-nav-menu--mobile{z-index:-1}.fw-nav-menu--mobile,.slideInLeft-enter-active{-webkit-transition:left .35s ease-in;-o-transition:left .35s ease-in;transition:left .35s ease-in}.slideInLeft-enter-active{-webkit-animation:slideInLeft .35s;animation:slideInLeft .35s}.slideInLeft-leave-active{animation:slideInLeft .35s reverse;-webkit-transition:left .35s ease-in-out;-o-transition:left .35s ease-in-out;transition:left .35s ease-in-out}@-webkit-keyframes slideInLeft{0%{left:100%}to{left:0}}@keyframes slideInLeft{0%{left:100%}to{left:0}}";
2021
+ var stylesheet = ".fw-nav-menu--mobile{z-index:-1}.fw-nav-menu--mobile,.slideInLeft-enter-active{-webkit-transition:left .35s ease-in;-o-transition:left .35s ease-in;transition:left .35s ease-in}.slideInLeft-enter-active{-webkit-animation:slideInLeft .35s;animation:slideInLeft .35s}.slideInLeft-leave-active{animation:slideInLeft .35s reverse;-webkit-transition:left .35s ease-in-out;-o-transition:left .35s ease-in-out;transition:left .35s ease-in-out}@-webkit-keyframes slideInLeft{0%{left:100%}to{left:0}}@keyframes slideInLeft{0%{left:100%}to{left:0}}";
2022
+ styleInject(css_248z);
2023
+
1820
2024
  script.render = render;
1821
2025
 
1822
2026
  var components = /*#__PURE__*/Object.freeze({
1823
2027
  __proto__: null,
1824
- FwCard: script$1,
1825
- FwButton: script
2028
+ FwCard: script$2,
2029
+ FwButton: script$1,
2030
+ FwNavigationMenu: script
1826
2031
  });
1827
2032
 
1828
2033
  var install = function install(app) {
@@ -1835,4 +2040,4 @@ var install = function install(app) {
1835
2040
  });
1836
2041
  };
1837
2042
 
1838
- export { script as FwButton, script$1 as FwCard, install as default };
2043
+ export { script$1 as FwButton, script$2 as FwCard, script as FwNavigationMenu, install as default };
package/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as vue from 'vue';
2
2
  import { PropType, Plugin } from 'vue';
3
3
 
4
- declare const _default$1: vue.DefineComponent<{
4
+ declare const _default$2: vue.DefineComponent<{
5
5
  /**
6
6
  * The header title of the card
7
7
  */
@@ -29,7 +29,7 @@ declare const _default$1: vue.DefineComponent<{
29
29
  };
30
30
  }>>, {}>;
31
31
 
32
- declare type ButtonVariantName = 'primary' | 'secondary' | 'tertiary' | 'error' | 'success';
32
+ declare type ButtonVariantName = 'primary' | 'secondary' | 'tertiary' | 'error' | 'success' | 'text';
33
33
  interface ButtonDefinition {
34
34
  text: string;
35
35
  background: string;
@@ -48,7 +48,7 @@ interface FwButtonProps {
48
48
  size?: ButtonSize;
49
49
  variant?: ButtonVariantName;
50
50
  }
51
- declare const _default: vue.DefineComponent<{
51
+ declare const _default$1: vue.DefineComponent<{
52
52
  /**
53
53
  * A `router-link` path or object
54
54
  */
@@ -86,6 +86,7 @@ declare const _default: vue.DefineComponent<{
86
86
  onMouseout: (this: GlobalEventHandlers, ev: MouseEvent) => any;
87
87
  onFocusin: (this: GlobalEventHandlers, ev: FocusEvent) => any;
88
88
  onFocusout: (this: GlobalEventHandlers, ev: FocusEvent) => any;
89
+ tagName: vue.ComputedRef<"router-link" | "a" | "button">;
89
90
  }, 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
  /**
91
92
  * A `router-link` path or object
@@ -125,6 +126,49 @@ declare const _default: vue.DefineComponent<{
125
126
  variant: ButtonVariantName;
126
127
  }>;
127
128
 
129
+ interface NavMenuItem {
130
+ to?: string | object;
131
+ href?: string;
132
+ label: string;
133
+ }
134
+ declare const _default: vue.DefineComponent<{
135
+ /**
136
+ * An array of menu items
137
+ * `{ to?: string | object; href?: string; label: string; }`
138
+ */
139
+ menuItems: {
140
+ type: PropType<NavMenuItem[]>;
141
+ };
142
+ /**
143
+ * The label for the action button.
144
+ * Also emits the `action` event.
145
+ */
146
+ actionLabel: {
147
+ type: StringConstructor;
148
+ };
149
+ }, {
150
+ isMobileMenuOpen: vue.Ref<boolean>;
151
+ toggleMobileMenu: () => boolean;
152
+ actionClicked: () => void;
153
+ }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "action"[], "action", vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
154
+ /**
155
+ * An array of menu items
156
+ * `{ to?: string | object; href?: string; label: string; }`
157
+ */
158
+ menuItems: {
159
+ type: PropType<NavMenuItem[]>;
160
+ };
161
+ /**
162
+ * The label for the action button.
163
+ * Also emits the `action` event.
164
+ */
165
+ actionLabel: {
166
+ type: StringConstructor;
167
+ };
168
+ }>> & {
169
+ onAction?: ((...args: any[]) => any) | undefined;
170
+ }, {}>;
171
+
128
172
  declare const install: Exclude<Plugin['install'], undefined>;
129
173
 
130
- export { ButtonDefinition, ButtonDefinitionList, ButtonSize, ButtonSizes, ButtonVariantName, _default as FwButton, FwButtonProps, _default$1 as FwCard, install as default };
174
+ export { ButtonDefinition, ButtonDefinitionList, ButtonSize, ButtonSizes, ButtonVariantName, _default$1 as FwButton, FwButtonProps, _default$2 as FwCard, _default as FwNavigationMenu, NavMenuItem, install as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frollo/frollo-web-ui",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Frollo's UI library for components, utilities and configs",
5
5
  "exports": {
6
6
  "./tailwind.config.js": "./tailwind.config.js",
@@ -8,7 +8,7 @@ module.exports = {
8
8
  white: '#ffffff',
9
9
  black: '#000000',
10
10
  transparent: 'transparent',
11
- body: '#2C3E50',
11
+ body: '#000000',
12
12
  error: '#eb5757',
13
13
  success: '#00c48c',
14
14
  grey: {
@@ -1,5 +1,5 @@
1
1
  import { PropType } from 'vue';
2
- export declare type ButtonVariantName = 'primary' | 'secondary' | 'tertiary' | 'error' | 'success';
2
+ export declare type ButtonVariantName = 'primary' | 'secondary' | 'tertiary' | 'error' | 'success' | 'text';
3
3
  export interface ButtonDefinition {
4
4
  text: string;
5
5
  background: string;
@@ -56,6 +56,7 @@ declare const _default: import("vue").DefineComponent<{
56
56
  onMouseout: (this: GlobalEventHandlers, ev: MouseEvent) => any;
57
57
  onFocusin: (this: GlobalEventHandlers, ev: FocusEvent) => any;
58
58
  onFocusout: (this: GlobalEventHandlers, ev: FocusEvent) => any;
59
+ tagName: import("vue").ComputedRef<"router-link" | "a" | "button">;
59
60
  }, 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
  /**
61
62
  * A `router-link` path or object
@@ -0,0 +1,44 @@
1
+ import { PropType } from 'vue';
2
+ export interface NavMenuItem {
3
+ to?: string | object;
4
+ href?: string;
5
+ label: string;
6
+ }
7
+ declare const _default: import("vue").DefineComponent<{
8
+ /**
9
+ * An array of menu items
10
+ * `{ to?: string | object; href?: string; label: string; }`
11
+ */
12
+ menuItems: {
13
+ type: PropType<NavMenuItem[]>;
14
+ };
15
+ /**
16
+ * The label for the action button.
17
+ * Also emits the `action` event.
18
+ */
19
+ actionLabel: {
20
+ type: StringConstructor;
21
+ };
22
+ }, {
23
+ isMobileMenuOpen: import("vue").Ref<boolean>;
24
+ toggleMobileMenu: () => boolean;
25
+ actionClicked: () => void;
26
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "action"[], "action", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
27
+ /**
28
+ * An array of menu items
29
+ * `{ to?: string | object; href?: string; label: string; }`
30
+ */
31
+ menuItems: {
32
+ type: PropType<NavMenuItem[]>;
33
+ };
34
+ /**
35
+ * The label for the action button.
36
+ * Also emits the `action` event.
37
+ */
38
+ actionLabel: {
39
+ type: StringConstructor;
40
+ };
41
+ }>> & {
42
+ onAction?: ((...args: any[]) => any) | undefined;
43
+ }, {}>;
44
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import FwNavigationMenu from './fw-navigation-menu.vue';
2
+ export { FwNavigationMenu };
@@ -1,2 +1,3 @@
1
1
  export * from './fw-card';
2
2
  export * from './fw-button';
3
+ export * from './fw-navigation-menu';
@@ -3,3 +3,4 @@ export default install;
3
3
  export * from './components';
4
4
  export * from './components/fw-card/fw-card.vue';
5
5
  export * from './components/fw-button/fw-button.vue';
6
+ export * from './components/fw-navigation-menu/fw-navigation-menu.vue';