@frollo/frollo-web-ui 0.0.4 → 0.0.7

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
  /**
@@ -1274,29 +1274,57 @@ $$1({ target: 'Object', stat: true }, {
1274
1274
  */
1275
1275
  prefixTitle: {
1276
1276
  type: String
1277
- }
1277
+ },
1278
+
1279
+ /**
1280
+ * A `router-link` path or object
1281
+ */
1282
+ to: {
1283
+ type: [String, Object]
1284
+ },
1285
+
1286
+ /**
1287
+ * A URL to link to using a native anchor element
1288
+ */
1289
+ href: String
1290
+ },
1291
+ setup: function setup(props) {
1292
+ var componentName = vue.computed(function () {
1293
+ if (props.to) return 'router-link';
1294
+ if (props.href) return 'a';
1295
+ return 'div';
1296
+ });
1297
+ return {
1298
+ componentName: componentName
1299
+ };
1278
1300
  }
1279
1301
  });var _hoisted_1$1 = {
1280
- "class": "fw-card shadow rounded-lg"
1281
- };
1282
- var _hoisted_2 = {
1283
1302
  key: 0,
1284
1303
  "class": "fw-card--header text-lg px-8 py-4 font-bold bg-grey-lightest rounded-t-lg border-opacity-0"
1285
1304
  };
1286
- var _hoisted_3 = {
1305
+ var _hoisted_2$1 = {
1287
1306
  key: 0,
1288
1307
  "class": "fw-card--prefix-title text-primary"
1289
1308
  };
1290
- var _hoisted_4 = {
1309
+ var _hoisted_3$1 = {
1291
1310
  key: 1
1292
1311
  };
1293
- var _hoisted_5 = {
1312
+ var _hoisted_4$1 = {
1294
1313
  key: 1,
1295
1314
  "class": "p-8"
1296
1315
  };
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;
1316
+ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
1317
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.componentName), {
1318
+ to: _ctx.to ? _ctx.to : null,
1319
+ href: _ctx.href ? _ctx.href : null,
1320
+ "class": vue.normalizeClass(["fw-card shadow-card rounded-lg", _ctx.to || _ctx.href ? 'block focus:outline-none ring-offset-3 focus:ring focus:ring-primary transform-none transition-transform hover:-translate-y-1' : ''])
1321
+ }, {
1322
+ "default": vue.withCtx(function () {
1323
+ return [_ctx.title || _ctx.prefixTitle ? (vue.openBlock(), vue.createElementBlock("h4", _hoisted_1$1, [_ctx.prefixTitle ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$1, vue.toDisplayString(_ctx.prefixTitle), 1)) : vue.createCommentVNode("", true), _ctx.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$1, vue.toDisplayString(_ctx.title), 1)) : vue.createCommentVNode("", true)])) : vue.createCommentVNode("", true), _ctx.$slots["default"] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [vue.renderSlot(_ctx.$slots, "default")])) : vue.createCommentVNode("", true)];
1324
+ }),
1325
+ _: 3
1326
+ }, 8, ["to", "href", "class"]);
1327
+ }script$2.render = render$2;var es_array_includes = {};var objectDefineProperties = {};var DESCRIPTORS = descriptors;
1300
1328
  var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1301
1329
  var definePropertyModule$1 = objectDefineProperty;
1302
1330
  var anObject$1 = anObject$4;
@@ -1432,7 +1460,7 @@ $({ target: 'Array', proto: true }, {
1432
1460
  });
1433
1461
 
1434
1462
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1435
- addToUnscopables('includes');var script = vue.defineComponent({
1463
+ addToUnscopables('includes');var script$1 = vue.defineComponent({
1436
1464
  name: 'FwButton',
1437
1465
  emits: ['click', 'mouseover', 'mouseout', 'focusin', 'focusout'],
1438
1466
  props: {
@@ -1467,7 +1495,7 @@ addToUnscopables('includes');var script = vue.defineComponent({
1467
1495
  type: String,
1468
1496
  "default": 'primary',
1469
1497
  validator: function validator(value) {
1470
- return ['primary', 'secondary', 'tertiary', 'error', 'success'].includes(value);
1498
+ return ['primary', 'secondary', 'tertiary', 'error', 'success', 'text'].includes(value);
1471
1499
  }
1472
1500
  }
1473
1501
  },
@@ -1479,9 +1507,9 @@ addToUnscopables('includes');var script = vue.defineComponent({
1479
1507
  border: 'border-primary focus:ring-primary'
1480
1508
  },
1481
1509
  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'
1510
+ text: 'text-primary hover:text-tertiary active:text-tertiary',
1511
+ background: 'bg-tertiary hover:bg-primary active:bg-primary',
1512
+ border: 'border-primary focus:ring-primary'
1485
1513
  },
1486
1514
  tertiary: {
1487
1515
  text: 'text-tertiary hover:text-secondary active:text-secondary',
@@ -1497,6 +1525,11 @@ addToUnscopables('includes');var script = vue.defineComponent({
1497
1525
  text: 'text-white hover:text-error active:text-error',
1498
1526
  background: 'bg-error hover:bg-white active:bg-white',
1499
1527
  border: 'border-error focus:ring-error'
1528
+ },
1529
+ text: {
1530
+ text: 'text-body font-medium hover:text-white active:text-white',
1531
+ background: 'bg-white hover:bg-body active:bg-body',
1532
+ border: 'border-transparent focus:ring-body'
1500
1533
  }
1501
1534
  });
1502
1535
  var sizes = vue.ref({
@@ -1558,6 +1591,11 @@ addToUnscopables('includes');var script = vue.defineComponent({
1558
1591
  return ctx.emit('focusout', e);
1559
1592
  };
1560
1593
 
1594
+ var tagName = vue.computed(function () {
1595
+ if (props.to) return 'router-link';
1596
+ if (props.href) return 'a';
1597
+ return 'button';
1598
+ });
1561
1599
  return {
1562
1600
  textColorClass: textColorClass,
1563
1601
  bgColorClass: bgColorClass,
@@ -1567,33 +1605,219 @@ addToUnscopables('includes');var script = vue.defineComponent({
1567
1605
  onMouseover: onMouseover,
1568
1606
  onMouseout: onMouseout,
1569
1607
  onFocusin: onFocusin,
1570
- onFocusout: onFocusout
1608
+ onFocusout: onFocusout,
1609
+ tagName: tagName
1571
1610
  };
1572
1611
  }
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",
1578
- to: _ctx.to,
1579
- href: _ctx.href,
1580
- onClick: _cache[0] || (_cache[0] = function () {
1581
- return _ctx.onClick && _ctx.onClick.apply(_ctx, arguments);
1612
+ });function render$1(_ctx, _cache, $props, $setup, $data, $options) {
1613
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tagName), {
1614
+ "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]]),
1615
+ type: _ctx.tagName === 'button' ? _ctx.tagName : null,
1616
+ to: _ctx.to ? _ctx.to : null,
1617
+ href: _ctx.href ? _ctx.href : null,
1618
+ onClick: _ctx.onClick,
1619
+ onFocusin: _ctx.onFocusin,
1620
+ onFocusout: _ctx.onFocusout,
1621
+ onMouseover: _ctx.onMouseover,
1622
+ onMouseout: _ctx.onMouseout
1623
+ }, {
1624
+ "default": vue.withCtx(function () {
1625
+ return [vue.renderSlot(_ctx.$slots, "default")];
1582
1626
  }),
1583
- onFocusin: _cache[1] || (_cache[1] = function () {
1584
- return _ctx.onFocusin && _ctx.onFocusin.apply(_ctx, arguments);
1627
+ _: 3
1628
+ }, 8, ["class", "type", "to", "href", "onClick", "onFocusin", "onFocusout", "onMouseover", "onMouseout"]);
1629
+ }function styleInject(css, ref) {
1630
+ if ( ref === void 0 ) ref = {};
1631
+ var insertAt = ref.insertAt;
1632
+
1633
+ if (!css || typeof document === 'undefined') { return; }
1634
+
1635
+ var head = document.head || document.getElementsByTagName('head')[0];
1636
+ var style = document.createElement('style');
1637
+ style.type = 'text/css';
1638
+
1639
+ if (insertAt === 'top') {
1640
+ if (head.firstChild) {
1641
+ head.insertBefore(style, head.firstChild);
1642
+ } else {
1643
+ head.appendChild(style);
1644
+ }
1645
+ } else {
1646
+ head.appendChild(style);
1647
+ }
1648
+
1649
+ if (style.styleSheet) {
1650
+ style.styleSheet.cssText = css;
1651
+ } else {
1652
+ style.appendChild(document.createTextNode(css));
1653
+ }
1654
+ }var css_248z$1 = ".fw-button{-webkit-transition:all .25s ease-in;-o-transition:all .25s ease-in;transition:all .25s ease-in}";
1655
+ var stylesheet$1 = ".fw-button{-webkit-transition:all .25s ease-in;-o-transition:all .25s ease-in;transition:all .25s ease-in}";
1656
+ styleInject(css_248z$1);script$1.render = render$1;var script = vue.defineComponent({
1657
+ name: 'FwNavigationMenu',
1658
+ emits: ['action'],
1659
+ components: {
1660
+ FwButton: script$1
1661
+ },
1662
+ props: {
1663
+ /**
1664
+ * An array of menu items
1665
+ * `{ to?: string | object; href?: string; label: string; }`
1666
+ */
1667
+ menuItems: {
1668
+ type: Array
1669
+ },
1670
+
1671
+ /**
1672
+ * The label for the action button.
1673
+ * Also emits the `action` event.
1674
+ */
1675
+ actionLabel: {
1676
+ type: String
1677
+ }
1678
+ },
1679
+ setup: function setup(_props, ctx) {
1680
+ var isMobileMenuOpen = vue.ref(false);
1681
+
1682
+ var toggleMobileMenu = function toggleMobileMenu() {
1683
+ return isMobileMenuOpen.value = !isMobileMenuOpen.value;
1684
+ };
1685
+
1686
+ var actionClicked = function actionClicked() {
1687
+ return ctx.emit('action');
1688
+ };
1689
+
1690
+ return {
1691
+ isMobileMenuOpen: isMobileMenuOpen,
1692
+ toggleMobileMenu: toggleMobileMenu,
1693
+ actionClicked: actionClicked
1694
+ };
1695
+ }
1696
+ });var _hoisted_1 = {
1697
+ "class": "fw-nav-menu relative z-50 h-20 shadow-md"
1698
+ };
1699
+ var _hoisted_2 = {
1700
+ "class": "px-6 flex-1 h-full flex bg-white items-stretch justify-between"
1701
+ };
1702
+ var _hoisted_3 = {
1703
+ key: 0,
1704
+ "class": "flex-shrink-0 flex items-center"
1705
+ };
1706
+ var _hoisted_4 = {
1707
+ key: 1,
1708
+ "class": "container hidden sm:flex items-center justify-start sm:ml-6"
1709
+ };
1710
+ var _hoisted_5 = {
1711
+ "class": "flex space-x-2"
1712
+ };
1713
+ var _hoisted_6 = {
1714
+ key: 2,
1715
+ "class": "hidden sm:flex items-center justify-start sm:ml-6"
1716
+ };
1717
+ var _hoisted_7 = {
1718
+ "class": "flex items-center sm:hidden"
1719
+ };
1720
+
1721
+ var _hoisted_8 = /*#__PURE__*/vue.createElementVNode("span", {
1722
+ "class": "sr-only"
1723
+ }, "Open main menu", -1);
1724
+
1725
+ var _hoisted_9 = {
1726
+ "class": "block h-6 w-6",
1727
+ xmlns: "http://www.w3.org/2000/svg",
1728
+ fill: "none",
1729
+ viewBox: "0 0 24 24",
1730
+ stroke: "currentColor",
1731
+ "aria-hidden": "true"
1732
+ };
1733
+ var _hoisted_10 = ["d"];
1734
+ var _hoisted_11 = {
1735
+ key: 0,
1736
+ "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"
1737
+ };
1738
+ var _hoisted_12 = {
1739
+ "class": "w-full flex flex-col"
1740
+ };
1741
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
1742
+ var _ctx$menuItems;
1743
+
1744
+ var _component_FwButton = vue.resolveComponent("FwButton");
1745
+
1746
+ 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) {
1747
+ return vue.openBlock(), vue.createBlock(_component_FwButton, {
1748
+ key: i,
1749
+ variant: "text",
1750
+ href: item.href,
1751
+ to: item.to,
1752
+ size: "md",
1753
+ "aria-current": "page"
1754
+ }, {
1755
+ "default": vue.withCtx(function () {
1756
+ return [vue.createTextVNode(vue.toDisplayString(item.label), 1)];
1757
+ }),
1758
+ _: 2
1759
+ }, 1032, ["href", "to"]);
1760
+ }), 128))])])) : vue.createCommentVNode("", true), _ctx.actionLabel ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [vue.createVNode(_component_FwButton, {
1761
+ onClick: _ctx.actionClicked,
1762
+ size: "md",
1763
+ "aria-label": _ctx.actionLabel
1764
+ }, {
1765
+ "default": vue.withCtx(function () {
1766
+ return [vue.createTextVNode(vue.toDisplayString(_ctx.actionLabel), 1)];
1585
1767
  }),
1586
- onFocusout: _cache[2] || (_cache[2] = function () {
1587
- return _ctx.onFocusout && _ctx.onFocusout.apply(_ctx, arguments);
1768
+ _: 1
1769
+ }, 8, ["onClick", "aria-label"])])) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_7, [vue.createVNode(_component_FwButton, {
1770
+ variant: "text",
1771
+ size: "sm",
1772
+ onClick: _ctx.toggleMobileMenu
1773
+ }, {
1774
+ "default": vue.withCtx(function () {
1775
+ return [_hoisted_8, (vue.openBlock(), vue.createElementBlock("svg", _hoisted_9, [vue.createElementVNode("path", {
1776
+ "stroke-linecap": "round",
1777
+ "stroke-linejoin": "round",
1778
+ "stroke-width": "2",
1779
+ d: _ctx.isMobileMenuOpen ? 'M6 18L18 6M6 6l12 12' : 'M4 6h16M4 12h16M4 18h16'
1780
+ }, null, 8, _hoisted_10)]))];
1588
1781
  }),
1589
- onMouseover: _cache[3] || (_cache[3] = function () {
1590
- return _ctx.onMouseover && _ctx.onMouseover.apply(_ctx, arguments);
1782
+ _: 1
1783
+ }, 8, ["onClick"])])]), vue.createVNode(vue.Transition, {
1784
+ name: "slideInLeft"
1785
+ }, {
1786
+ "default": vue.withCtx(function () {
1787
+ var _ctx$menuItems2;
1788
+
1789
+ 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) {
1790
+ return vue.openBlock(), vue.createBlock(_component_FwButton, {
1791
+ key: i,
1792
+ "class": "w-full rounded-md px-2",
1793
+ variant: "text",
1794
+ href: item.href,
1795
+ to: item.to,
1796
+ size: "md",
1797
+ "aria-current": "page"
1798
+ }, {
1799
+ "default": vue.withCtx(function () {
1800
+ return [vue.createTextVNode(vue.toDisplayString(item.label), 1)];
1801
+ }),
1802
+ _: 2
1803
+ }, 1032, ["href", "to"]);
1804
+ }), 128))]), _ctx.actionLabel ? (vue.openBlock(), vue.createBlock(_component_FwButton, {
1805
+ key: 0,
1806
+ "class": "w-full rounded-md px-2",
1807
+ onClick: _ctx.actionClicked,
1808
+ size: "md"
1809
+ }, {
1810
+ "default": vue.withCtx(function () {
1811
+ return [vue.createTextVNode(vue.toDisplayString(_ctx.actionLabel), 1)];
1812
+ }),
1813
+ _: 1
1814
+ }, 8, ["onClick"])) : vue.createCommentVNode("", true)])) : vue.createCommentVNode("", true)];
1591
1815
  }),
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) {
1816
+ _: 1
1817
+ })]);
1818
+ }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}}";
1819
+ 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}}";
1820
+ 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
1821
  Object.entries(components$1).forEach(function (_ref) {
1598
1822
  var _ref2 = _slicedToArray(_ref, 2),
1599
1823
  componentName = _ref2[0],
@@ -1601,7 +1825,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1601
1825
 
1602
1826
  app.component(componentName, component);
1603
1827
  });
1604
- };var components=/*#__PURE__*/Object.freeze({__proto__:null,'default':install,FwCard:script$1,FwButton:script});Object.entries(components).forEach(function (_ref) {
1828
+ };var components=/*#__PURE__*/Object.freeze({__proto__:null,'default':install,FwCard:script$2,FwButton:script$1,FwNavigationMenu:script});Object.entries(components).forEach(function (_ref) {
1605
1829
  var _ref2 = _slicedToArray(_ref, 2),
1606
1830
  componentName = _ref2[0],
1607
1831
  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,36 +1293,62 @@ 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",
1296
- to: _ctx.to,
1297
- 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);
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,
1306
+ to: _ctx.to ? _ctx.to : null,
1307
+ href: _ctx.href ? _ctx.href : null,
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")];
1306
1316
  }),
1307
- onMouseover: _cache[3] || (_cache[3] = function () {
1308
- return _ctx.onMouseover && _ctx.onMouseover.apply(_ctx, arguments);
1309
- }),
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
 
1321
+ function styleInject(css, ref) {
1322
+ if ( ref === void 0 ) ref = {};
1323
+ var insertAt = ref.insertAt;
1324
+
1325
+ if (!css || typeof document === 'undefined') { return; }
1326
+
1327
+ var head = document.head || document.getElementsByTagName('head')[0];
1328
+ var style = document.createElement('style');
1329
+ style.type = 'text/css';
1330
+
1331
+ if (insertAt === 'top') {
1332
+ if (head.firstChild) {
1333
+ head.insertBefore(style, head.firstChild);
1334
+ } else {
1335
+ head.appendChild(style);
1336
+ }
1337
+ } else {
1338
+ head.appendChild(style);
1339
+ }
1340
+
1341
+ if (style.styleSheet) {
1342
+ style.styleSheet.cssText = css;
1343
+ } else {
1344
+ style.appendChild(document.createTextNode(css));
1345
+ }
1346
+ }
1347
+
1348
+ var css_248z = ".fw-button{-webkit-transition:all .25s ease-in;-o-transition:all .25s ease-in;transition:all .25s ease-in}";
1349
+ var stylesheet = ".fw-button{-webkit-transition:all .25s ease-in;-o-transition:all .25s ease-in;transition:all .25s ease-in}";
1350
+ styleInject(css_248z);
1351
+
1316
1352
  script.render = render;
1317
1353
 
1318
- export { _export as _, aCallable$1 as a, functionBindNative as b, classofRaw as c, fails$7 as d, getBuiltIn$4 as e, functionUncurryThis as f, global$l as g, inspectSource$2 as h, isCallable$9 as i, isObject$5 as j, indexedObject as k, lengthOfArrayLike$1 as l, documentCreateElement$1 as m, createNonEnumerableProperty$3 as n, descriptors as o, objectKeys$1 as p, toIndexedObject$4 as q, redefine$2 as r, objectPropertyIsEnumerable as s, toObject$1 as t, script as u, wellKnownSymbol$2 as w };
1354
+ export { _export as _, aCallable$1 as a, functionBindNative as b, classofRaw as c, fails$7 as d, getBuiltIn$4 as e, functionUncurryThis as f, global$l as g, inspectSource$2 as h, isCallable$9 as i, isObject$5 as j, indexedObject as k, lengthOfArrayLike$1 as l, documentCreateElement$1 as m, createNonEnumerableProperty$3 as n, descriptors as o, objectKeys$1 as p, toIndexedObject$4 as q, redefine$2 as r, objectPropertyIsEnumerable as s, toObject$1 as t, script as u, styleInject as v, wellKnownSymbol$2 as w };
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-6d5a9671.js';
2
2
  import 'vue';
package/esm/fw-card.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent, openBlock, createElementBlock, toDisplayString, createCommentVNode, renderSlot } from 'vue';
1
+ import { defineComponent, computed, openBlock, createBlock, resolveDynamicComponent, normalizeClass, withCtx, createElementBlock, toDisplayString, createCommentVNode, renderSlot } from 'vue';
2
2
 
3
3
  var script = defineComponent({
4
4
  name: 'FwCard',
@@ -15,30 +15,58 @@ var script = defineComponent({
15
15
  */
16
16
  prefixTitle: {
17
17
  type: String
18
- }
18
+ },
19
+
20
+ /**
21
+ * A `router-link` path or object
22
+ */
23
+ to: {
24
+ type: [String, Object]
25
+ },
26
+
27
+ /**
28
+ * A URL to link to using a native anchor element
29
+ */
30
+ href: String
31
+ },
32
+ setup: function setup(props) {
33
+ var componentName = computed(function () {
34
+ if (props.to) return 'router-link';
35
+ if (props.href) return 'a';
36
+ return 'div';
37
+ });
38
+ return {
39
+ componentName: componentName
40
+ };
19
41
  }
20
42
  });
21
43
 
22
44
  var _hoisted_1 = {
23
- "class": "fw-card shadow rounded-lg"
24
- };
25
- var _hoisted_2 = {
26
45
  key: 0,
27
46
  "class": "fw-card--header text-lg px-8 py-4 font-bold bg-grey-lightest rounded-t-lg border-opacity-0"
28
47
  };
29
- var _hoisted_3 = {
48
+ var _hoisted_2 = {
30
49
  key: 0,
31
50
  "class": "fw-card--prefix-title text-primary"
32
51
  };
33
- var _hoisted_4 = {
52
+ var _hoisted_3 = {
34
53
  key: 1
35
54
  };
36
- var _hoisted_5 = {
55
+ var _hoisted_4 = {
37
56
  key: 1,
38
57
  "class": "p-8"
39
58
  };
40
59
  function render(_ctx, _cache, $props, $setup, $data, $options) {
41
- return openBlock(), createElementBlock("div", _hoisted_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)]);
60
+ return openBlock(), createBlock(resolveDynamicComponent(_ctx.componentName), {
61
+ to: _ctx.to ? _ctx.to : null,
62
+ href: _ctx.href ? _ctx.href : null,
63
+ "class": normalizeClass(["fw-card shadow-card rounded-lg", _ctx.to || _ctx.href ? 'block focus:outline-none ring-offset-3 focus:ring focus:ring-primary transform-none transition-transform hover:-translate-y-1' : ''])
64
+ }, {
65
+ "default": withCtx(function () {
66
+ return [_ctx.title || _ctx.prefixTitle ? (openBlock(), createElementBlock("h4", _hoisted_1, [_ctx.prefixTitle ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(_ctx.prefixTitle), 1)) : createCommentVNode("", true), _ctx.title ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true)])) : createCommentVNode("", true), _ctx.$slots["default"] ? (openBlock(), createElementBlock("div", _hoisted_4, [renderSlot(_ctx.$slots, "default")])) : createCommentVNode("", true)];
67
+ }),
68
+ _: 3
69
+ }, 8, ["to", "href", "class"]);
42
70
  }
43
71
 
44
72
  script.render = render;