@pequity/squirrel 4.0.0 → 4.0.1

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.
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
3
  const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
4
- const _withScopeId = (n) => (vue.pushScopeId("data-v-189b159e"), n = n(), vue.popScopeId(), n);
4
+ const _withScopeId = (n) => (vue.pushScopeId("data-v-2662da21"), n = n(), vue.popScopeId(), n);
5
5
  const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "bg-info-circle-icon block h-3 w-3" }, null, -1));
6
6
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
7
7
  ...{
@@ -17,7 +17,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
17
  setup(__props) {
18
18
  return (_ctx, _cache) => {
19
19
  const _component_VTooltip = vue.resolveComponent("VTooltip");
20
- return vue.openBlock(), vue.createBlock(_component_VTooltip, null, {
20
+ return vue.openBlock(), vue.createBlock(_component_VTooltip, {
21
+ "popper-triggers": ["hover"],
22
+ delay: { show: 750, hide: 0 }
23
+ }, {
21
24
  popper: vue.withCtx(() => [
22
25
  vue.renderSlot(_ctx.$slots, "default", {}, () => [
23
26
  vue.createTextVNode(vue.toDisplayString(__props.text), 1)
@@ -31,5 +34,5 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
31
34
  };
32
35
  }
33
36
  });
34
- const PInfoIcon = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-189b159e"]]);
37
+ const PInfoIcon = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-2662da21"]]);
35
38
  module.exports = PInfoIcon;
@@ -111,7 +111,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
111
111
  ],
112
112
  setup(__props, { emit: __emit }) {
113
113
  vue.useCssVars((_ctx) => ({
114
- "8a536574": __props.maxWidth
114
+ "4d751ed2": __props.maxWidth
115
115
  }));
116
116
  let animatingZIndex = 0;
117
117
  const emit = __emit;
@@ -321,12 +321,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
321
321
  class: "mr-auto pt-4 text-xl font-semibold"
322
322
  }, vue.toDisplayString(__props.title), 9, _hoisted_5)) : vue.createCommentVNode("", true),
323
323
  vue.createElementVNode("div", _hoisted_6, [
324
- __props.enableClose ? (vue.openBlock(), vue.createBlock(pCloseBtn, {
325
- key: 0,
324
+ vue.createVNode(pCloseBtn, {
326
325
  disabled: __props.disabled,
326
+ class: vue.normalizeClass({ invisible: !__props.enableClose }),
327
327
  "aria-label": __props.closeLabel,
328
328
  onClick: vue.withModifiers(close, ["prevent"])
329
- }, null, 8, ["disabled", "aria-label"])) : vue.createCommentVNode("", true)
329
+ }, null, 8, ["disabled", "class", "aria-label"])
330
330
  ])
331
331
  ])
332
332
  ], true),
@@ -365,5 +365,5 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
365
365
  };
366
366
  }
367
367
  });
368
- const pModal = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-ee599a02"]]);
368
+ const pModal = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-fb5dbd9f"]]);
369
369
  module.exports = pModal;
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, renderSlot, createTextVNode, toDisplayString, pushScopeId, popScopeId, createElementVNode } from "vue";
2
2
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
3
- const _withScopeId = (n) => (pushScopeId("data-v-189b159e"), n = n(), popScopeId(), n);
3
+ const _withScopeId = (n) => (pushScopeId("data-v-2662da21"), n = n(), popScopeId(), n);
4
4
  const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("i", { class: "bg-info-circle-icon block h-3 w-3" }, null, -1));
5
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  ...{
@@ -16,7 +16,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
16
16
  setup(__props) {
17
17
  return (_ctx, _cache) => {
18
18
  const _component_VTooltip = resolveComponent("VTooltip");
19
- return openBlock(), createBlock(_component_VTooltip, null, {
19
+ return openBlock(), createBlock(_component_VTooltip, {
20
+ "popper-triggers": ["hover"],
21
+ delay: { show: 750, hide: 0 }
22
+ }, {
20
23
  popper: withCtx(() => [
21
24
  renderSlot(_ctx.$slots, "default", {}, () => [
22
25
  createTextVNode(toDisplayString(__props.text), 1)
@@ -30,7 +33,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
30
33
  };
31
34
  }
32
35
  });
33
- const PInfoIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-189b159e"]]);
36
+ const PInfoIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2662da21"]]);
34
37
  export {
35
38
  PInfoIcon as default
36
39
  };
@@ -110,7 +110,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
110
110
  ],
111
111
  setup(__props, { emit: __emit }) {
112
112
  useCssVars((_ctx) => ({
113
- "8a536574": __props.maxWidth
113
+ "4d751ed2": __props.maxWidth
114
114
  }));
115
115
  let animatingZIndex = 0;
116
116
  const emit = __emit;
@@ -320,12 +320,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
320
320
  class: "mr-auto pt-4 text-xl font-semibold"
321
321
  }, toDisplayString(__props.title), 9, _hoisted_5)) : createCommentVNode("", true),
322
322
  createElementVNode("div", _hoisted_6, [
323
- __props.enableClose ? (openBlock(), createBlock(PCloseBtn, {
324
- key: 0,
323
+ createVNode(PCloseBtn, {
325
324
  disabled: __props.disabled,
325
+ class: normalizeClass({ invisible: !__props.enableClose }),
326
326
  "aria-label": __props.closeLabel,
327
327
  onClick: withModifiers(close, ["prevent"])
328
- }, null, 8, ["disabled", "aria-label"])) : createCommentVNode("", true)
328
+ }, null, 8, ["disabled", "class", "aria-label"])
329
329
  ])
330
330
  ])
331
331
  ], true),
@@ -364,7 +364,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
364
364
  };
365
365
  }
366
366
  });
367
- const pModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ee599a02"]]);
367
+ const pModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fb5dbd9f"]]);
368
368
  export {
369
369
  pModal as default
370
370
  };
package/dist/style.css CHANGED
@@ -7,7 +7,7 @@
7
7
  transform: translateX(100%);
8
8
  }
9
9
  }
10
- .bg-info-circle-icon[data-v-189b159e] {
10
+ .bg-info-circle-icon[data-v-2662da21] {
11
11
  background-image: url("data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_4002_33291)'%3e%3cpath%20d='M0.5%206C0.5%207.45869%201.07946%208.85764%202.11091%209.88909C3.14236%2010.9205%204.54131%2011.5%206%2011.5C7.45869%2011.5%208.85764%2010.9205%209.88909%209.88909C10.9205%208.85764%2011.5%207.45869%2011.5%206C11.5%204.54131%2010.9205%203.14236%209.88909%202.11091C8.85764%201.07946%207.45869%200.5%206%200.5C4.54131%200.5%203.14236%201.07946%202.11091%202.11091C1.07946%203.14236%200.5%204.54131%200.5%206Z'%20stroke='%231A123B'%20stroke-miterlimit='10'/%3e%3cpath%20d='M6.5%203.5H5.5V2.5H6.5V3.5Z'%20fill='%231A123B'/%3e%3cpath%20d='M4.5%205H6V9M4.5%208.5H7.5'%20stroke='%231A123B'%20stroke-miterlimit='10'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_4002_33291'%3e%3crect%20width='12'%20height='12'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e");
12
12
  }
13
13
  div[id^=popper_].dropdown {
@@ -409,33 +409,33 @@ to {
409
409
  opacity: 0;
410
410
  transform: translate3d(0, -100%, 0);
411
411
  }
412
- }.pm[data-v-ee599a02] {
412
+ }.pm[data-v-fb5dbd9f] {
413
413
  width: calc(100% - 32px);
414
414
  min-width: 110px;
415
- max-width: var(--8a536574);
415
+ max-width: var(--4d751ed2);
416
416
  max-height: calc(100vh - 32px);
417
417
  }
418
- .fadeIn[data-v-ee599a02] {
418
+ .fadeIn[data-v-fb5dbd9f] {
419
419
  animation-duration: 0.4s;
420
- animation-name: fadeInFrames-ee599a02;
420
+ animation-name: fadeInFrames-fb5dbd9f;
421
421
  animation-fill-mode: both;
422
422
  }
423
- .fadeOut[data-v-ee599a02] {
423
+ .fadeOut[data-v-fb5dbd9f] {
424
424
  animation-duration: 0.2s;
425
- animation-name: fadeOutFrames-ee599a02;
425
+ animation-name: fadeOutFrames-fb5dbd9f;
426
426
  animation-fill-mode: both;
427
427
  }
428
- .slideInTop[data-v-ee599a02] {
428
+ .slideInTop[data-v-fb5dbd9f] {
429
429
  animation-duration: 0.4s;
430
- animation-name: fadeInFrames-ee599a02,slideInTopFrames-ee599a02;
430
+ animation-name: fadeInFrames-fb5dbd9f,slideInTopFrames-fb5dbd9f;
431
431
  animation-fill-mode: both;
432
432
  }
433
- .slideOutTop[data-v-ee599a02] {
433
+ .slideOutTop[data-v-fb5dbd9f] {
434
434
  animation-duration: 0.2s;
435
- animation-name: fadeOutFrames-ee599a02,slideOutTopFrames-ee599a02;
435
+ animation-name: fadeOutFrames-fb5dbd9f,slideOutTopFrames-fb5dbd9f;
436
436
  animation-fill-mode: both;
437
437
  }
438
- @keyframes slideInTopFrames-ee599a02 {
438
+ @keyframes slideInTopFrames-fb5dbd9f {
439
439
  from {
440
440
  transform: translate(0, -12px);
441
441
  animation-timing-function: cubic-bezier(0, 0, 0, 1);
@@ -444,7 +444,7 @@ to {
444
444
  transform: translate(0, 0);
445
445
  }
446
446
  }
447
- @keyframes slideOutTopFrames-ee599a02 {
447
+ @keyframes slideOutTopFrames-fb5dbd9f {
448
448
  from {
449
449
  transform: translate(0, 0);
450
450
  animation-timing-function: cubic-bezier(0.33, 0, 0.67, 1);
@@ -453,7 +453,7 @@ to {
453
453
  transform: translate(0, -12px);
454
454
  }
455
455
  }
456
- @keyframes fadeInFrames-ee599a02 {
456
+ @keyframes fadeInFrames-fb5dbd9f {
457
457
  from {
458
458
  opacity: 0;
459
459
  animation-timing-function: cubic-bezier(0, 0, 1, 1);
@@ -462,7 +462,7 @@ to {
462
462
  opacity: 1;
463
463
  }
464
464
  }
465
- @keyframes fadeOutFrames-ee599a02 {
465
+ @keyframes fadeOutFrames-fb5dbd9f {
466
466
  from {
467
467
  opacity: 1;
468
468
  animation-timing-function: cubic-bezier(0.33, 0, 0.67, 1);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pequity/squirrel",
3
3
  "description": "Squirrel component library",
4
- "version": "4.0.0",
4
+ "version": "4.0.1",
5
5
  "packageManager": "pnpm@9.7.1",
6
6
  "type": "module",
7
7
  "scripts": {
@@ -75,7 +75,7 @@
75
75
  "@types/jest": "^29.5.12",
76
76
  "@types/jsdom": "^21.1.7",
77
77
  "@types/lodash-es": "^4.17.12",
78
- "@types/node": "^22.4.1",
78
+ "@types/node": "^22.4.2",
79
79
  "@vitejs/plugin-vue": "^5.1.2",
80
80
  "@vue/compiler-sfc": "3.4.38",
81
81
  "@vue/test-utils": "^2.4.6",
@@ -83,7 +83,7 @@
83
83
  "autoprefixer": "^10.4.20",
84
84
  "babel-jest": "^29.7.0",
85
85
  "concurrently": "^8.2.2",
86
- "dayjs": "1.11.12",
86
+ "dayjs": "1.11.13",
87
87
  "eslint": "^8.57.0",
88
88
  "eslint-plugin-storybook": "^0.8.0",
89
89
  "floating-vue": "5.2.2",
@@ -55,4 +55,25 @@ describe('PInfoIcon.vue', () => {
55
55
 
56
56
  expect(wrapper.text()).toBe('Lorem ipsum dolor sit amet.');
57
57
  });
58
+
59
+ it('tooltip should stay visible on hover', async () => {
60
+ const wrapper = createWrapperFor(PInfoIcon, {
61
+ props: {
62
+ text: '',
63
+ },
64
+ slots: {
65
+ default: 'Lorem ipsum dolor sit amet.',
66
+ },
67
+ global: {
68
+ stubs: {
69
+ VTooltip: true,
70
+ },
71
+ },
72
+ });
73
+
74
+ const tooltip = wrapper.findComponent('v-tooltip-stub');
75
+
76
+ expect(tooltip.props().popperTriggers).toEqual(['hover']);
77
+ expect(tooltip.props().delay).toEqual({ show: 750, hide: 0 });
78
+ });
58
79
  });
@@ -55,3 +55,35 @@ export const DifferentPlacements = {
55
55
  },
56
56
  },
57
57
  };
58
+
59
+ export const WithBigText = {
60
+ render: (args) => ({
61
+ components: { PInfoIcon },
62
+ setup() {
63
+ return { args };
64
+ },
65
+ template: `
66
+ <div class="w-full pt-60 pb-20 flex justify-center">
67
+ <PInfoIcon v-bind="args" />
68
+ </div>`,
69
+ }),
70
+ args: {
71
+ text: `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed malesuada convallis ultricies.
72
+ Pellentesque rhoncus felis et neque pellentesque pretium.
73
+
74
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed malesuada convallis ultricies.
75
+ Pellentesque rhoncus felis et neque pellentesque pretium.
76
+
77
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed malesuada convallis ultricies.
78
+ Pellentesque rhoncus felis et neque pellentesque pretium.
79
+ `,
80
+ placement: 'top',
81
+ },
82
+ parameters: {
83
+ docs: {
84
+ description: {
85
+ story: `The info tooltip allows for long text and the ability to scroll.`,
86
+ },
87
+ },
88
+ },
89
+ };
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <VTooltip>
2
+ <VTooltip :popper-triggers="['hover']" :delay="{ show: 750, hide: 0 }">
3
3
  <i class="bg-info-circle-icon block h-3 w-3"></i>
4
4
  <template #popper>
5
5
  <slot>{{ text }}</slot>
@@ -9,7 +9,7 @@ const ModalParent = {
9
9
  template: `
10
10
  <div>
11
11
  <button type="button" class="open-modal-1" @click="showModal1 = true">Open modal 1</button>
12
- <Modal1 wrapperClass="modal-1" v-model="showModal1" :title="title" :live="live">
12
+ <Modal1 wrapperClass="modal-1" v-model="showModal1" :title="title" :live="live" :enable-close="enableClose">
13
13
  <div>
14
14
  <input v-if="showInput" type="text" value="" autofocus class="text-input" />
15
15
  <button type="button" class="open-modal-2" @click="showModal2 = true">Open modal 2</button>
@@ -52,6 +52,7 @@ const createModalsWrapper = (data) => {
52
52
  title: 'Test title',
53
53
  showModal1: false,
54
54
  showModal2: false,
55
+ enableClose: true,
55
56
  },
56
57
  ...data,
57
58
  };
@@ -321,4 +322,25 @@ describe('Modal features', () => {
321
322
 
322
323
  wrapper.unmount();
323
324
  });
325
+
326
+ it('makes the close button invisible instead of hidden, when enableClose is false', async () => {
327
+ const wrapper = createModalsWrapper({
328
+ enableClose: false,
329
+ });
330
+
331
+ await waitNT(wrapper.vm);
332
+
333
+ await wrapper.find('.open-modal-1').trigger('click');
334
+
335
+ await sleep(100);
336
+
337
+ const modal1 = wrapper.getComponent('.modal-1');
338
+
339
+ const closeBtn = modal1.find('button[aria-label="Close"]');
340
+
341
+ expect(closeBtn.isVisible()).toBe(true);
342
+ expect(closeBtn.classes()).toContain('invisible');
343
+
344
+ wrapper.unmount();
345
+ });
324
346
  });
@@ -36,7 +36,12 @@
36
36
  {{ title }}
37
37
  </h3>
38
38
  <div class="ml-auto">
39
- <PCloseBtn v-if="enableClose" :disabled="disabled" :aria-label="closeLabel" @click.prevent="close" />
39
+ <PCloseBtn
40
+ :disabled="disabled"
41
+ :class="{ invisible: !enableClose }"
42
+ :aria-label="closeLabel"
43
+ @click.prevent="close"
44
+ />
40
45
  </div>
41
46
  </div>
42
47
  </slot>
@@ -43,10 +43,10 @@ export const Active = {
43
43
  },
44
44
  };
45
45
 
46
- export const WithToolyip = {
46
+ export const WithTooltip = {
47
47
  args: {
48
48
  ...Default.args,
49
- tooltipText: 'This is a tooltip',
49
+ tooltipText: `Lorem ipsum dolor sit amet.`,
50
50
  },
51
51
  };
52
52