@frollo/frollo-web-ui 8.5.3 → 9.0.0

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.
Files changed (135) hide show
  1. package/cjs/index.js +29804 -28762
  2. package/esm/{_rollupPluginBabelHelpers-DpC_oIQV.js → _rollupPluginBabelHelpers-DODWUb5N.js} +307 -345
  3. package/esm/fw-accordion.js +59 -56
  4. package/esm/fw-alert.js +68 -0
  5. package/esm/fw-bar-chart.js +4 -4
  6. package/esm/fw-button-CnQvA7oM.js +296 -0
  7. package/esm/fw-button.js +2 -4
  8. package/esm/{fw-card-bsYbpPmW.js → fw-card-D45R4kN-.js} +33 -9
  9. package/esm/fw-card.js +3 -1
  10. package/esm/fw-checkbox.js +39 -20
  11. package/esm/fw-date-picker.js +110 -78
  12. package/esm/fw-drawer.js +119 -83
  13. package/esm/{fw-dropdown-CbgOvgOt.js → fw-dropdown-58wyuzsW.js} +80 -61
  14. package/esm/fw-dropdown.js +5 -5
  15. package/esm/fw-icons.js +34 -0
  16. package/esm/{fw-image-Dl96Dc27.js → fw-image-D-OHafdw.js} +30 -13
  17. package/esm/fw-image.js +4 -4
  18. package/esm/{fw-input-XeI-IKly.js → fw-input-C2-cZ-BY.js} +65 -43
  19. package/esm/fw-input.js +2 -2
  20. package/esm/fw-loading-bar-DecYSBC_.js +45 -0
  21. package/esm/fw-loading.js +34 -15
  22. package/esm/fw-media-picker.js +43 -31
  23. package/esm/fw-modal.js +102 -48
  24. package/esm/fw-navigation-menu.js +180 -52
  25. package/esm/fw-popover-B4bsfuxm.js +620 -0
  26. package/esm/fw-popover.js +6 -293
  27. package/esm/fw-progress-bar.js +3 -2
  28. package/esm/fw-provider-list.js +58 -34
  29. package/esm/fw-sidebar-menu.js +22 -13
  30. package/esm/fw-slider.js +4 -4
  31. package/esm/fw-switch.js +147 -0
  32. package/esm/{fw-table-row-BetVCzHJ.js → fw-table-row-C61Bi8KB.js} +59 -59
  33. package/esm/fw-table.js +8 -7
  34. package/esm/fw-tabs.js +7 -7
  35. package/esm/{fw-tag-V0jMl-It.js → fw-tag-FWH6KttB.js} +37 -26
  36. package/esm/fw-tag.js +4 -6
  37. package/esm/fw-toast.js +14 -15
  38. package/esm/fw-transactions-card.js +8 -8
  39. package/esm/get-root-colours-DCjlYelc.js +62 -0
  40. package/esm/{index-CzZMBMV_.js → index-BsEH8YYr.js} +433 -130
  41. package/esm/index.js +76 -68
  42. package/esm/{uniqueId-DK6xzFd8.js → uniqueId-DZdGzBh8.js} +1 -1
  43. package/frollo-web-ui.esm.js +30114 -29022
  44. package/icons/arrow-connect.svg +3 -0
  45. package/icons/arrow-left.svg +3 -0
  46. package/icons/arrow-out-square.svg +3 -0
  47. package/icons/arrow-right.svg +3 -0
  48. package/icons/circle-exclamation.svg +5 -0
  49. package/icons/clock.svg +10 -0
  50. package/icons/default-provider.svg +5 -0
  51. package/icons/desktop.svg +8 -0
  52. package/icons/error.svg +3 -0
  53. package/icons/folder-arrow-down.svg +3 -0
  54. package/icons/index.ts +35 -3
  55. package/icons/loading.svg +0 -1
  56. package/icons/manual-account.svg +3 -0
  57. package/icons/mobile.svg +3 -0
  58. package/icons/paper-plane.svg +3 -0
  59. package/icons/pending.svg +10 -0
  60. package/icons/success-hill.svg +5 -0
  61. package/icons/user-plus.svg +3 -0
  62. package/index.d.ts +807 -571
  63. package/package.json +23 -29
  64. package/styles/tailwind.css +52 -0
  65. package/styles/typography.scss +24 -7
  66. package/styles/web-components.scss +2 -2
  67. package/tailwind.config.js +128 -22
  68. package/types/components/fw-accordion/fw-accordion.vue.d.ts +20 -20
  69. package/types/components/fw-alert/fw-alert.vue.d.ts +43 -0
  70. package/types/components/fw-alert/index.d.ts +2 -0
  71. package/types/components/fw-alert/index.types.d.ts +4 -0
  72. package/types/components/fw-bar-chart/fw-bar-chart.vue.d.ts +8 -8
  73. package/types/components/fw-button/fw-button.vue.d.ts +15 -17
  74. package/types/components/fw-button/index.d.ts +2 -0
  75. package/types/components/fw-button/index.types.d.ts +1 -3
  76. package/types/components/fw-card/fw-card.vue.d.ts +3 -2
  77. package/types/components/fw-checkbox/fw-checkbox.vue.d.ts +8 -5
  78. package/types/components/fw-date-picker/fw-date-picker.vue.d.ts +14 -19
  79. package/types/components/fw-date-picker/index.types.d.ts +5 -4
  80. package/types/components/fw-drawer/fw-drawer.vue.d.ts +26 -10
  81. package/types/components/fw-drawer/index.types.d.ts +1 -1
  82. package/types/components/fw-dropdown/fw-dropdown.vue.d.ts +11 -9
  83. package/types/components/fw-icons/index.d.ts +2 -0
  84. package/types/components/fw-image/fw-image.vue.d.ts +7 -5
  85. package/types/components/fw-input/fw-input.vue.d.ts +11 -17
  86. package/types/components/fw-input/index.types.d.ts +1 -1
  87. package/types/components/fw-loading/fw-loading-bar.vue.d.ts +5 -2
  88. package/types/components/fw-loading/fw-loading-dots.vue.d.ts +2 -0
  89. package/types/components/fw-loading/index.d.ts +2 -1
  90. package/types/components/fw-modal/fw-modal.vue.d.ts +51 -11
  91. package/types/components/fw-modal/index.types.d.ts +1 -1
  92. package/types/components/fw-navigation-menu/fw-navigation-menu.vue.d.ts +77 -6
  93. package/types/components/fw-navigation-menu/index.types.d.ts +11 -0
  94. package/types/components/fw-popover/fw-popover.vue.d.ts +10 -5
  95. package/types/components/fw-provider-list/fw-provider-list.vue.d.ts +8 -5
  96. package/types/components/fw-sidebar-menu/fw-sidebar-menu.vue.d.ts +20 -3
  97. package/types/components/fw-sidebar-menu/index.types.d.ts +9 -0
  98. package/types/components/fw-switch/fw-switch.vue.d.ts +101 -0
  99. package/types/components/fw-switch/index.d.ts +2 -0
  100. package/types/components/fw-switch/index.types.d.ts +8 -0
  101. package/types/components/fw-table/fw-table.vue.d.ts +7 -7
  102. package/types/components/fw-table/index.types.d.ts +0 -3
  103. package/types/components/fw-tabs/fw-tabs.vue.d.ts +1 -1
  104. package/types/components/fw-tabs/index.types.d.ts +1 -1
  105. package/types/components/fw-tag/fw-tag.vue.d.ts +2 -2
  106. package/types/components/fw-tag/index.types.d.ts +3 -3
  107. package/types/components/fw-toast/fw-toast.vue.d.ts +2 -2
  108. package/types/components/index.d.ts +4 -3
  109. package/types/components/index.types.d.ts +1 -0
  110. package/types/helpers/get-root-colours.d.ts +3 -0
  111. package/types/helpers/index.d.ts +2 -0
  112. package/types/helpers/vue-component-to-html.d.ts +2 -0
  113. package/types/icons/index.d.ts +18 -2
  114. package/types/index-types.esm.d.ts +1 -0
  115. package/types/index.d.ts +1 -0
  116. package/types/index.esm.d.ts +1 -0
  117. package/types/services/toast.d.ts +1 -1
  118. package/web-components/index.js +30112 -29028
  119. package/esm/check--YD4Ts6g.js +0 -17
  120. package/esm/fw-animations.js +0 -123
  121. package/esm/fw-button-DNozvo7B.js +0 -286
  122. package/esm/fw-loading-bar-DThRjdw1.js +0 -22
  123. package/esm/fw-loading-spinner-BFpFFRJm.js +0 -20
  124. package/esm/fw-period-selector.js +0 -90
  125. package/esm/get-root-colours-DYEoJPEb.js +0 -37
  126. package/icons/icons.stories.ts +0 -28
  127. package/styles/tailwind.scss +0 -68
  128. package/types/components/fw-animations/fw-email-pulse.vue.d.ts +0 -24
  129. package/types/components/fw-animations/fw-success-pulse.vue.d.ts +0 -24
  130. package/types/components/fw-animations/index.d.ts +0 -4
  131. package/types/components/fw-period-selector/fw-period-selector.vue.d.ts +0 -56
  132. package/types/components/fw-period-selector/index.d.ts +0 -2
  133. package/types/components/fw-period-selector/index.types.d.ts +0 -1
  134. /package/icons/{arrows-rotate.svg → arrow-rotate.svg} +0 -0
  135. /package/types/components/{fw-animations/fw-loading-spinner.vue.d.ts → fw-icons/fw-success-animation.vue.d.ts} +0 -0
@@ -1,25 +1,25 @@
1
- import { c as _asyncToGenerator, d as _regeneratorRuntime, a as _slicedToArray } from './_rollupPluginBabelHelpers-DpC_oIQV.js';
2
- import { defineComponent, ref, computed, watch, createElementVNode, resolveComponent, openBlock, createElementBlock, Fragment, createVNode, toDisplayString, withCtx, normalizeClass, withModifiers, createTextVNode, createCommentVNode } from 'vue';
3
- import { c as render$1, d as render$2, e as render$3, f as render$4, g as render$5, h as render$6 } from './index-CzZMBMV_.js';
4
- import { FwModal as script$1 } from './fw-modal.js';
1
+ import { c as _asyncToGenerator, d as _regeneratorRuntime, a as _slicedToArray } from './_rollupPluginBabelHelpers-DODWUb5N.js';
2
+ import { defineComponent, ref, computed, watch, createElementVNode, resolveComponent, createElementBlock, openBlock, Fragment, createVNode, toDisplayString, withCtx, withModifiers, normalizeClass, createCommentVNode, createTextVNode } from 'vue';
3
+ import { e as render$1, f as render$2, g as render$3, h as render$4, i as render$5, j as render$6 } from './index-BsEH8YYr.js';
4
+ import { FwModal as __default__ } from './fw-modal.js';
5
5
  import './fw-button.js';
6
- import { s as script$2 } from './fw-button-DNozvo7B.js';
7
- import './check--YD4Ts6g.js';
8
- import './uniqueId-DK6xzFd8.js';
9
- import './style-inject.es-tgCJW-Cu.js';
10
- import './fw-loading-spinner-BFpFFRJm.js';
6
+ import { s as script$1 } from './fw-button-CnQvA7oM.js';
7
+ import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
8
+ import './fw-image-D-OHafdw.js';
9
+ import './fw-loading-bar-DecYSBC_.js';
10
+ import './get-root-colours-DCjlYelc.js';
11
11
 
12
12
  var script = defineComponent({
13
13
  name: 'MediaPicker',
14
14
  components: {
15
- PenSvg: render$1,
16
- PlusSvg: render$2,
17
- CloudArrowUpSvg: render$3,
15
+ FwModal: __default__,
16
+ FwButton: script$1,
17
+ ArrowRotateSvg: render$6,
18
+ CloudArrowUpSvg: render$5,
18
19
  GuideSvg: render$4,
19
- ArrowsRotateSvg: render$5,
20
- LoadingSvg: render$6,
21
- FwModal: script$1,
22
- FwButton: script$2
20
+ LoadingSvg: render$3,
21
+ PenSvg: render$2,
22
+ PlusSvg: render$1
23
23
  },
24
24
  emits: [/** Fired when media is selected */
25
25
  'selected'],
@@ -107,7 +107,7 @@ var script = defineComponent({
107
107
  return selectedFile.value && (selectedFile.value.size > props.maxFileSize || acceptedTypes.value.includes(selectedFile.value.type) === false);
108
108
  });
109
109
  watch(initialImageUrl, /*#__PURE__*/function () {
110
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(newVal, oldVal) {
110
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(newVal, oldVal) {
111
111
  var response, blob, mimeType;
112
112
  return _regeneratorRuntime().wrap(function _callee$(_context) {
113
113
  while (1) switch (_context.prev = _context.next) {
@@ -197,7 +197,7 @@ var script = defineComponent({
197
197
  var isEditingImage = ref(false);
198
198
  var interactionType = ref(null);
199
199
  var drawImageOnCanvas = /*#__PURE__*/function () {
200
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
200
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
201
201
  var save,
202
202
  ctx,
203
203
  imageBitmap,
@@ -377,7 +377,7 @@ var script = defineComponent({
377
377
  drawImageOnCanvas();
378
378
  };
379
379
  var save = /*#__PURE__*/function () {
380
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
380
+ var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
381
381
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
382
382
  while (1) switch (_context3.prev = _context3.next) {
383
383
  case 0:
@@ -438,15 +438,15 @@ var script = defineComponent({
438
438
 
439
439
  var _hoisted_1 = ["accept"];
440
440
  var _hoisted_2 = {
441
- "class": "cursor-pointer w-[160px] h-[160px]"
441
+ "class": "cursor-pointer w-[160px] h-[160px] bg-white"
442
442
  };
443
443
  var _hoisted_3 = ["src"];
444
444
  var _hoisted_4 = {
445
445
  key: 1,
446
- "class": "flex flex-col w-full h-full items-center justify-center gap-2 border-2 border-grey-40 rounded"
446
+ "class": "flex flex-col w-full h-full items-center justify-center gap-2 border border-grey-100 rounded"
447
447
  };
448
448
  var _hoisted_5 = {
449
- "class": "font-medium text-grey-80 group-hover:text-black transition-colors duration-300"
449
+ "class": "text-brand-text3 group-hover:text-brand-text2"
450
450
  };
451
451
  var _hoisted_6 = {
452
452
  "class": "pt-[23px] px-4 pb-2 mb-0 text-left"
@@ -479,6 +479,9 @@ var _hoisted_16 = {
479
479
  "class": "flex justify-start gap-2 flex-col sm:flex-row"
480
480
  };
481
481
  var _hoisted_17 = {
482
+ "class": "flex flex-row items-center gap-2"
483
+ };
484
+ var _hoisted_18 = {
482
485
  "class": "flex justify-end flex-col sm:flex-row"
483
486
  };
484
487
  function render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -489,7 +492,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
489
492
  var _component_FwButton = resolveComponent("FwButton");
490
493
  var _component_FwModal = resolveComponent("FwModal");
491
494
  var _component_GuideSvg = resolveComponent("GuideSvg");
492
- var _component_ArrowsRotateSvg = resolveComponent("ArrowsRotateSvg");
495
+ var _component_ArrowRotateSvg = resolveComponent("ArrowRotateSvg");
493
496
  return openBlock(), createElementBlock(Fragment, null, [createElementVNode("input", {
494
497
  ref: "fileInput",
495
498
  type: "file",
@@ -505,20 +508,23 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
505
508
  return _ctx.showEditor && _ctx.showEditor.apply(_ctx, arguments);
506
509
  })
507
510
  }, [createVNode(_component_PenSvg, {
511
+ name: "pen",
508
512
  "class": "absolute bottom-[-8px] right-[-8px] w-8 h-8 p-2 text-white bg-primary rounded-full"
509
513
  }), createElementVNode("img", {
510
514
  src: _ctx.previewImageUrl,
511
515
  "class": "object-cover rounded w-full h-full"
512
516
  }, null, 8, _hoisted_3)])) : _ctx.loading ? (openBlock(), createElementBlock("div", _hoisted_4, [createVNode(_component_LoadingSvg, {
513
- "class": "w-8 h-8 text-grey-80 animate-spin"
517
+ name: "loading",
518
+ "class": "w-8 h-8 text-brand-text2 animate-spin"
514
519
  })])) : (openBlock(), createElementBlock("div", {
515
520
  key: 2,
516
- "class": "group flex flex-col w-full h-full items-center justify-center gap-2 border-2 border-grey-40 rounded hover:text-primary hover:bg-grey-40/60 hover:border-primary transition-colors duration-300",
521
+ "class": "fw-media-picker--empty group",
517
522
  onClick: _cache[2] || (_cache[2] = function ($event) {
518
523
  return _ctx.isSelectMediaModalOpen = true;
519
524
  })
520
525
  }, [createVNode(_component_PlusSvg, {
521
- "class": "w-8 h-8 p-1 text-grey-80 rounded-full border-2 border-grey-80 group-hover:border-primary group-hover:text-primary transition-colors duration-300"
526
+ name: "plus",
527
+ "class": "w-8 h-8 p-1 text-brand-text3 rounded-full border border-brand-text3 group-hover:border-brand-text2 group-hover:text-brand-text2"
522
528
  }), createElementVNode("p", _hoisted_5, toDisplayString(_ctx.title), 1)]))]), createVNode(_component_FwModal, {
523
529
  modelValue: _ctx.isSelectMediaModalOpen,
524
530
  "onUpdate:modelValue": _cache[7] || (_cache[7] = function ($event) {
@@ -528,7 +534,6 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
528
534
  "show-cancel": false,
529
535
  "show-close-button": true,
530
536
  padding: false,
531
- "container-class": "!bg-[#F7F7F7]",
532
537
  "footer-class": "px-4 pb-8",
533
538
  onCancel: _cache[8] || (_cache[8] = function ($event) {
534
539
  return _ctx.isSelectMediaModalOpen = false;
@@ -556,6 +561,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
556
561
  return _ctx.dragDropFile && _ctx.dragDropFile.apply(_ctx, arguments);
557
562
  }, ["prevent"]))
558
563
  }, [createVNode(_component_CloudArrowUpSvg, {
564
+ name: "cloud-arrow-up",
559
565
  "class": "w-12 h-12 p-1 text-grey-80"
560
566
  }), createElementVNode("p", null, [createTextVNode(" Select file to "), createVNode(_component_FwButton, {
561
567
  variant: "link",
@@ -577,7 +583,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
577
583
  "show-cancel": false,
578
584
  "show-close-button": true,
579
585
  padding: false,
580
- "container-class": "!bg-[#F7F7F7]",
586
+ "container-class": "!bg-[#F7F7F7] w-full",
581
587
  "footer-class": "px-4 pb-8",
582
588
  onCancel: _cache[13] || (_cache[13] = function ($event) {
583
589
  return _ctx.isEditMediaModalOpen = false;
@@ -588,6 +594,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
588
594
  }),
589
595
  body: withCtx(function () {
590
596
  return [createElementVNode("div", _hoisted_12, [createElementVNode("div", _hoisted_13, [createVNode(_component_GuideSvg, {
597
+ name: "guide",
591
598
  "class": "absolute pointer-events-none"
592
599
  }), createElementVNode("canvas", {
593
600
  ref: "editorCanvas",
@@ -617,12 +624,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
617
624
  onClick: _ctx.reset
618
625
  }, {
619
626
  "default": withCtx(function () {
620
- return [createTextVNode(" Reset "), createVNode(_component_ArrowsRotateSvg, {
627
+ return [createElementVNode("div", _hoisted_17, [createTextVNode(" Reset "), createVNode(_component_ArrowRotateSvg, {
628
+ name: "arrow-rotate",
621
629
  "class": "inline-block ml-1 w-4 h-4"
622
- })];
630
+ })])];
623
631
  }),
624
632
  _: 1
625
- }, 8, ["onClick"])]), createElementVNode("div", _hoisted_17, [createVNode(_component_FwButton, {
633
+ }, 8, ["onClick"])]), createElementVNode("div", _hoisted_18, [createVNode(_component_FwButton, {
626
634
  variant: "primary",
627
635
  size: "md",
628
636
  onClick: _ctx.save
@@ -637,6 +645,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
637
645
  }, 8, ["modelValue"])], 64);
638
646
  }
639
647
 
648
+ var css_248z = ".fw-media-picker--empty{-webkit-box-orient:vertical;-webkit-box-direction:normal;-moz-box-orient:vertical;-moz-box-direction:normal;-webkit-box-align:center;-moz-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-moz-box-pack:center;-ms-flex-pack:center;--tw-border-opacity:1;-webkit-align-items:center;align-items:center;border-color:rgb(200 203 208/var(--tw-border-opacity));border-radius:.25rem;border-width:1px;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:.5rem;height:100%;-webkit-justify-content:center;justify-content:center;text-align:center;width:100%}.fw-media-picker--empty:hover{border-color:var(--colorText2);color:var(--colorText2)}";
649
+ var stylesheet = ".fw-media-picker--empty{-webkit-box-orient:vertical;-webkit-box-direction:normal;-moz-box-orient:vertical;-moz-box-direction:normal;-webkit-box-align:center;-moz-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-moz-box-pack:center;-ms-flex-pack:center;--tw-border-opacity:1;-webkit-align-items:center;align-items:center;border-color:rgb(200 203 208/var(--tw-border-opacity));border-radius:.25rem;border-width:1px;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:.5rem;height:100%;-webkit-justify-content:center;justify-content:center;text-align:center;width:100%}.fw-media-picker--empty:hover{border-color:var(--colorText2);color:var(--colorText2)}";
650
+ styleInject(css_248z);
651
+
640
652
  script.render = render;
641
653
 
642
654
  export { script as FwMediaPicker };
package/esm/fw-modal.js CHANGED
@@ -1,18 +1,18 @@
1
- import { defineComponent, ref, computed, onMounted, resolveComponent, openBlock, createBlock, Teleport, createVNode, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, createCommentVNode, createElementBlock, renderSlot, createTextVNode, toDisplayString, vShow } from 'vue';
2
- import { s as script$1 } from './fw-button-DNozvo7B.js';
3
- import { u as uniqueId } from './uniqueId-DK6xzFd8.js';
4
- import { b as render$1 } from './index-CzZMBMV_.js';
1
+ import { defineComponent, ref, computed, onMounted, useCssVars, resolveComponent, createBlock, createCommentVNode, openBlock, Teleport, createVNode, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, createElementBlock, createTextVNode, renderSlot, toDisplayString, vShow } from 'vue';
2
+ import { s as script } from './fw-button-CnQvA7oM.js';
3
+ import { _ as __default__$1 } from './fw-image-D-OHafdw.js';
4
+ import { u as useColours } from './get-root-colours-DCjlYelc.js';
5
+ import { d as render$1 } from './index-BsEH8YYr.js';
5
6
  import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
6
- import './fw-loading-spinner-BFpFFRJm.js';
7
- import './check--YD4Ts6g.js';
7
+ import './fw-loading-bar-DecYSBC_.js';
8
8
 
9
- var script = defineComponent({
9
+ var __default__ = defineComponent({
10
10
  name: 'FwModal',
11
11
  components: {
12
- FwButton: script$1,
13
- XMarkSvg: render$1
12
+ FwButton: script,
13
+ XMarkSvg: render$1,
14
+ FwImage: __default__$1
14
15
  },
15
- emits: ['cancel', 'confirm'],
16
16
  props: {
17
17
  /**
18
18
  * The modal's v-model. Controls the visibility of the modal.
@@ -72,9 +72,9 @@ var script = defineComponent({
72
72
  */
73
73
  cancelButtonType: {
74
74
  type: String,
75
- "default": 'secondary',
75
+ "default": 'tertiary',
76
76
  validator: function validator(value) {
77
- return ['primary', 'secondary', 'tertiary', 'error', 'success', 'link', 'text'].includes(value);
77
+ return ['primary', 'secondary', 'tertiary', 'quaternary', 'error', 'success', 'link', 'text', 'transparent', 'gradient'].includes(value);
78
78
  }
79
79
  },
80
80
  /**
@@ -91,9 +91,22 @@ var script = defineComponent({
91
91
  type: String,
92
92
  "default": 'primary',
93
93
  validator: function validator(value) {
94
- return ['primary', 'secondary', 'tertiary', 'error', 'success', 'link', 'text'].includes(value);
94
+ return ['primary', 'secondary', 'tertiary', 'quaternary', 'error', 'success', 'link', 'text', 'transparent', 'gradient'].includes(value);
95
95
  }
96
96
  },
97
+ /**
98
+ * Icon name for the confirm button
99
+ */
100
+ confirmIconName: {
101
+ type: String
102
+ },
103
+ /**
104
+ * Whether the confirm button loading animation is showing or not
105
+ */
106
+ confirmLoading: {
107
+ type: Boolean,
108
+ "default": false
109
+ },
97
110
  /**
98
111
  * Controls the outer padding of the modal
99
112
  */
@@ -119,36 +132,57 @@ var script = defineComponent({
119
132
  */
120
133
  footerClass: {
121
134
  type: String
135
+ },
136
+ /**
137
+ * Banner Image Url source
138
+ */
139
+ bannerUrl: {
140
+ type: String
122
141
  }
123
142
  },
143
+ emits: ['cancel', 'confirm'],
124
144
  setup: function setup(props) {
125
145
  var isMounted = ref(false);
126
- var uuid = uniqueId();
146
+ var uuid = globalThis.crypto.randomUUID();
127
147
  var isOpen = computed(function () {
128
148
  return props.modelValue;
129
149
  });
150
+ var _useColours = useColours(),
151
+ modalBgColour = _useColours.brandBg1Fade95;
130
152
  onMounted(function () {
131
153
  isMounted.value = true;
132
154
  });
133
155
  return {
134
156
  isOpen: isOpen,
135
157
  uuid: uuid,
136
- isMounted: isMounted
158
+ isMounted: isMounted,
159
+ modalBgColour: modalBgColour
137
160
  };
138
161
  }
139
162
  });
163
+ var __injectCSSVars__ = function __injectCSSVars__() {
164
+ useCssVars(function (_ctx) {
165
+ return {
166
+ "09c4fd1f": _ctx.modalBgColour
167
+ };
168
+ });
169
+ };
170
+ var __setup__ = __default__.setup;
171
+ __default__.setup = __setup__ ? function (props, ctx) {
172
+ __injectCSSVars__();
173
+ return __setup__(props, ctx);
174
+ } : __injectCSSVars__;
140
175
 
141
176
  var _hoisted_1 = ["id"];
142
177
  var _hoisted_2 = {
143
- "class": "fw-modal--mask fixed z-[9999] top-0 left-0 w-full h-full bg-black bg-opacity-50"
178
+ "class": "fw-modal--mask fixed z-[9999] top-0 left-0 w-full h-full"
144
179
  };
145
180
  var _hoisted_3 = {
146
- "class": "fw-modal--wrapper text-center overflow-auto flex justify-center items-center h-full"
181
+ "class": "fw-modal--wrapper overflow-auto flex justify-center items-center h-full"
147
182
  };
148
183
  var _hoisted_4 = ["role", "aria-labelledby", "aria-describedby"];
149
184
  var _hoisted_5 = {
150
- key: 1,
151
- "class": "fw-modal--header"
185
+ "class": "flex flex-row items-center gap-2"
152
186
  };
153
187
  var _hoisted_6 = {
154
188
  key: 0,
@@ -157,8 +191,9 @@ var _hoisted_6 = {
157
191
  var _hoisted_7 = ["id"];
158
192
  var _hoisted_8 = ["id", "innerHTML"];
159
193
  var _hoisted_9 = ["id"];
160
- var _hoisted_10 = ["innerHTML", "id"];
194
+ var _hoisted_10 = ["id", "innerHTML"];
161
195
  function render(_ctx, _cache, $props, $setup, $data, $options) {
196
+ var _component_FwImage = resolveComponent("FwImage");
162
197
  var _component_XMarkSvg = resolveComponent("XMarkSvg");
163
198
  var _component_FwButton = resolveComponent("FwButton");
164
199
  return _ctx.isMounted ? (openBlock(), createBlock(Teleport, {
@@ -170,55 +205,72 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
170
205
  }, {
171
206
  "default": withCtx(function () {
172
207
  return [withDirectives(createElementVNode("div", {
173
- "class": "fw-modal z-[9999] relative",
174
- id: "fw-modal-".concat(_ctx.uuid)
208
+ id: "fw-modal-".concat(_ctx.uuid),
209
+ "class": "fw-modal z-[9999] relative"
175
210
  }, [createElementVNode("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [createElementVNode("div", {
176
211
  role: _ctx.role,
177
212
  "aria-modal": "true",
178
- "class": normalizeClass([[_ctx.containerClass, _ctx.padding ? 'p-12' : ''], "fw-modal--container m-8 inline-block w-full max-w-[540px] bg-white rounded-lg shadow relative"]),
213
+ "class": normalizeClass([[_ctx.containerClass && !_ctx.bannerUrl ? _ctx.containerClass : '', _ctx.padding && !_ctx.bannerUrl ? 'inline-block p-8 md:p-12' : 'flex flex-col md:flex-row', _ctx.bannerUrl ? 'max-w-[800px]' : 'max-w-[750px]'], "fw-modal--container m-8 w-full bg-brand-appBg rounded-lg shadow relative max-h-screen"]),
179
214
  "aria-labelledby": _ctx.$slots.header || _ctx.header ? "modal_".concat(_ctx.uuid, "_header") : undefined,
180
215
  "aria-describedby": _ctx.$slots.body ? "modal_".concat(_ctx.uuid, "_body") : undefined
181
- }, [_ctx.showCloseButton ? (openBlock(), createBlock(_component_FwButton, {
216
+ }, [_ctx.bannerUrl ? (openBlock(), createElementBlock("div", {
182
217
  key: 0,
218
+ "class": "flex w-full md:w-1/2 h-[350px] md:h-full cursor-pointer hover:animate-pulse overflow-hidden",
183
219
  onClick: _cache[0] || (_cache[0] = function ($event) {
184
- return _ctx.$emit('cancel');
185
- }),
186
- variant: "text",
220
+ return _ctx.$emit('confirm');
221
+ })
222
+ }, [createVNode(_component_FwImage, {
223
+ src: _ctx.bannerUrl,
224
+ "enable-errors": false,
225
+ type: "background",
226
+ "class": "w-full h-full"
227
+ }, null, 8, ["src"])])) : createCommentVNode("", true), createElementVNode("div", {
228
+ "class": normalizeClass([_ctx.containerClass && _ctx.bannerUrl ? _ctx.containerClass : 'w-full', _ctx.bannerUrl && _ctx.padding ? 'w-full md:w-1/2 min-h-[120px] md:min-h-[520px] p-8 relative' : ''])
229
+ }, [_ctx.showCloseButton ? (openBlock(), createBlock(_component_FwButton, {
230
+ key: 0,
231
+ variant: "link",
187
232
  rounded: false,
188
233
  size: "sm",
189
- "class": "absolute top-[20px] right-[15px] !p-1.5"
234
+ "class": "absolute top-[20px] right-[15px] !p-1.5",
235
+ onClick: _cache[1] || (_cache[1] = function ($event) {
236
+ return _ctx.$emit('cancel');
237
+ })
190
238
  }, {
191
239
  "default": withCtx(function () {
192
- return [createVNode(_component_XMarkSvg, {
193
- "class": "w-4 h-4"
194
- })];
240
+ return [createElementVNode("div", _hoisted_5, [createVNode(_component_XMarkSvg, {
241
+ name: "xmark",
242
+ "class": "w-3.5 h-3.5"
243
+ }), createTextVNode(" Close ")])];
195
244
  }),
196
245
  _: 1
197
- })) : createCommentVNode("", true), _ctx.$slots.icon || _ctx.$slots.header || _ctx.header ? (openBlock(), createElementBlock("div", _hoisted_5, [_ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_6, [renderSlot(_ctx.$slots, "icon")])) : createCommentVNode("", true), _ctx.$slots.header ? (openBlock(), createElementBlock("div", {
246
+ })) : createCommentVNode("", true), _ctx.$slots.icon || _ctx.$slots.header || _ctx.header ? (openBlock(), createElementBlock("div", {
247
+ key: 1,
248
+ "class": normalizeClass(["fw-modal--header", _ctx.showCloseButton ? 'pt-6' : ''])
249
+ }, [_ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_6, [renderSlot(_ctx.$slots, "icon")])) : createCommentVNode("", true), _ctx.$slots.header ? (openBlock(), createElementBlock("div", {
198
250
  key: 1,
199
251
  id: "modal_".concat(_ctx.uuid, "_header")
200
252
  }, [renderSlot(_ctx.$slots, "header")], 8, _hoisted_7)) : _ctx.header ? (openBlock(), createElementBlock("div", {
201
253
  key: 2,
202
254
  id: "modal_".concat(_ctx.uuid, "_header"),
203
255
  innerHTML: _ctx.header
204
- }, null, 8, _hoisted_8)) : createCommentVNode("", true)])) : createCommentVNode("", true), _ctx.$slots.body ? (openBlock(), createElementBlock("div", {
256
+ }, null, 8, _hoisted_8)) : createCommentVNode("", true)], 2)) : createCommentVNode("", true), _ctx.$slots.body ? (openBlock(), createElementBlock("div", {
205
257
  key: 2,
206
- "class": "fw-modal--body mt-4",
207
- id: "modal_".concat(_ctx.uuid, "_body")
258
+ id: "modal_".concat(_ctx.uuid, "_body"),
259
+ "class": "fw-modal--body mt-6"
208
260
  }, [renderSlot(_ctx.$slots, "body")], 8, _hoisted_9)) : _ctx.body ? (openBlock(), createElementBlock("div", {
209
261
  key: 3,
210
- innerHTML: _ctx.body,
211
- "class": "fw-modal--body mt-4",
212
- id: "modal_".concat(_ctx.uuid, "_body")
262
+ id: "modal_".concat(_ctx.uuid, "_body"),
263
+ "class": "fw-modal--body mt-6",
264
+ innerHTML: _ctx.body
213
265
  }, null, 8, _hoisted_10)) : createCommentVNode("", true), _ctx.showConfirm || _ctx.showCancel ? (openBlock(), createElementBlock("div", {
214
266
  key: 4,
215
- "class": normalizeClass(["fw-modal--footer flex space-x-4 pt-4 justify-center", _ctx.footerClass])
267
+ "class": normalizeClass(["fw-modal--footer flex flex-col-reverse gap-4 md:flex-row pt-4 items-center justify-between mt-6", _ctx.footerClass])
216
268
  }, [_ctx.showCancel ? (openBlock(), createBlock(_component_FwButton, {
217
269
  key: 0,
218
- "class": "basis-1/2",
270
+ "class": "w-full md:w-fit",
219
271
  variant: _ctx.cancelButtonType,
220
272
  "aria-label": _ctx.cancelButtonText,
221
- onClick: _cache[1] || (_cache[1] = function ($event) {
273
+ onClick: _cache[2] || (_cache[2] = function ($event) {
222
274
  return _ctx.$emit('cancel');
223
275
  })
224
276
  }, {
@@ -228,10 +280,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
228
280
  _: 1
229
281
  }, 8, ["variant", "aria-label"])) : createCommentVNode("", true), _ctx.showConfirm ? (openBlock(), createBlock(_component_FwButton, {
230
282
  key: 1,
231
- "class": "basis-1/2",
283
+ "class": "w-full md:w-fit",
232
284
  variant: _ctx.confirmButtonType,
233
285
  "aria-label": _ctx.confirmButtonText,
234
- onClick: _cache[2] || (_cache[2] = function ($event) {
286
+ loading: _ctx.confirmLoading,
287
+ "icon-name": _ctx.confirmIconName,
288
+ onClick: _cache[3] || (_cache[3] = function ($event) {
235
289
  return _ctx.$emit('confirm');
236
290
  })
237
291
  }, {
@@ -239,16 +293,16 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
239
293
  return [createTextVNode(toDisplayString(_ctx.confirmButtonText), 1)];
240
294
  }),
241
295
  _: 1
242
- }, 8, ["variant", "aria-label"])) : createCommentVNode("", true)], 2)) : createCommentVNode("", true)], 10, _hoisted_4)])])], 8, _hoisted_1), [[vShow, _ctx.isOpen]])];
296
+ }, 8, ["variant", "aria-label", "loading", "icon-name"])) : createCommentVNode("", true)], 2)) : createCommentVNode("", true)], 2)], 10, _hoisted_4)])])], 8, _hoisted_1), [[vShow, _ctx.isOpen]])];
243
297
  }),
244
298
  _: 3
245
299
  })], 8, ["to"])) : createCommentVNode("", true);
246
300
  }
247
301
 
248
- var css_248z = ".modalFadeIn-enter-active{-webkit-animation:modalFadeIn .4s;-moz-animation:modalFadeIn .4s;animation:modalFadeIn .4s;-webkit-transition:opacity .4s ease-in;-moz-transition:opacity .4s ease-in;transition:opacity .4s ease-in}.modalFadeIn-leave-active{animation:modalFadeIn .4s reverse;-webkit-transition:opacity .4s ease-in-out;-moz-transition:opacity .4s ease-in-out;transition:opacity .4s ease-in-out}@-webkit-keyframes modalFadeIn{0%{opacity:0}to{opacity:1}}@-moz-keyframes modalFadeIn{0%{opacity:0}to{opacity:1}}@keyframes modalFadeIn{0%{opacity:0}to{opacity:1}}";
249
- var stylesheet = ".modalFadeIn-enter-active{-webkit-animation:modalFadeIn .4s;-moz-animation:modalFadeIn .4s;animation:modalFadeIn .4s;-webkit-transition:opacity .4s ease-in;-moz-transition:opacity .4s ease-in;transition:opacity .4s ease-in}.modalFadeIn-leave-active{animation:modalFadeIn .4s reverse;-webkit-transition:opacity .4s ease-in-out;-moz-transition:opacity .4s ease-in-out;transition:opacity .4s ease-in-out}@-webkit-keyframes modalFadeIn{0%{opacity:0}to{opacity:1}}@-moz-keyframes modalFadeIn{0%{opacity:0}to{opacity:1}}@keyframes modalFadeIn{0%{opacity:0}to{opacity:1}}";
302
+ var css_248z = ".modalFadeIn-enter-active{-webkit-animation:modalFadeIn .4s;-moz-animation:modalFadeIn .4s;animation:modalFadeIn .4s;-webkit-transition:opacity .4s ease-in;-moz-transition:opacity .4s ease-in;transition:opacity .4s ease-in}.modalFadeIn-leave-active{animation:modalFadeIn .4s reverse;-webkit-transition:opacity .4s ease-in-out;-moz-transition:opacity .4s ease-in-out;transition:opacity .4s ease-in-out}@-webkit-keyframes modalFadeIn{0%{opacity:0}to{opacity:1}}@-moz-keyframes modalFadeIn{0%{opacity:0}to{opacity:1}}@keyframes modalFadeIn{0%{opacity:0}to{opacity:1}}.fw-modal--mask{background-color:var(--09c4fd1f)}";
303
+ var stylesheet = ".modalFadeIn-enter-active{-webkit-animation:modalFadeIn .4s;-moz-animation:modalFadeIn .4s;animation:modalFadeIn .4s;-webkit-transition:opacity .4s ease-in;-moz-transition:opacity .4s ease-in;transition:opacity .4s ease-in}.modalFadeIn-leave-active{animation:modalFadeIn .4s reverse;-webkit-transition:opacity .4s ease-in-out;-moz-transition:opacity .4s ease-in-out;transition:opacity .4s ease-in-out}@-webkit-keyframes modalFadeIn{0%{opacity:0}to{opacity:1}}@-moz-keyframes modalFadeIn{0%{opacity:0}to{opacity:1}}@keyframes modalFadeIn{0%{opacity:0}to{opacity:1}}.fw-modal--mask{background-color:var(--09c4fd1f)}";
250
304
  styleInject(css_248z);
251
305
 
252
- script.render = render;
306
+ __default__.render = render;
253
307
 
254
- export { script as FwModal };
308
+ export { __default__ as FwModal };