@pequity/squirrel 8.3.2 → 8.3.3

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/dist/cjs/index.js CHANGED
@@ -661,7 +661,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
661
661
  }
662
662
  });
663
663
  const _hoisted_1$2 = { class: "flex items-center gap-2" };
664
- const _hoisted_2$2 = ["onClick"];
664
+ const _hoisted_2$2 = ["data-state", "onClick"];
665
665
  const _hoisted_3$2 = {
666
666
  key: 0,
667
667
  class: "flex items-center"
@@ -698,6 +698,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
698
698
  }, [
699
699
  vue.createElementVNode("div", {
700
700
  class: vue.normalizeClass(["text-nowrap rounded-full border px-4 py-1 text-sm font-semibold", [stepClasses(step, i), { "cursor-pointer": _ctx.clickable && !step.disabled }]]),
701
+ "data-state": step.value === _ctx.activeStep ? "active" : "inactive",
701
702
  onClick: ($event) => emit("click:step", step, i)
702
703
  }, vue.toDisplayString(step.text || vue.unref(lodashEs.startCase)(String(step.value))), 11, _hoisted_2$2),
703
704
  i < _ctx.steps.length - 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$2, [
package/dist/es/index.js CHANGED
@@ -661,7 +661,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
661
661
  }
662
662
  });
663
663
  const _hoisted_1$2 = { class: "flex items-center gap-2" };
664
- const _hoisted_2$2 = ["onClick"];
664
+ const _hoisted_2$2 = ["data-state", "onClick"];
665
665
  const _hoisted_3$2 = {
666
666
  key: 0,
667
667
  class: "flex items-center"
@@ -698,6 +698,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
698
698
  }, [
699
699
  createElementVNode("div", {
700
700
  class: normalizeClass(["text-nowrap rounded-full border px-4 py-1 text-sm font-semibold", [stepClasses(step, i2), { "cursor-pointer": _ctx.clickable && !step.disabled }]]),
701
+ "data-state": step.value === _ctx.activeStep ? "active" : "inactive",
701
702
  onClick: ($event) => emit("click:step", step, i2)
702
703
  }, toDisplayString(step.text || unref(startCase)(String(step.value))), 11, _hoisted_2$2),
703
704
  i2 < _ctx.steps.length - 1 ? (openBlock(), createElementBlock("div", _hoisted_3$2, [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pequity/squirrel",
3
3
  "description": "Squirrel component library",
4
- "version": "8.3.2",
4
+ "version": "8.3.3",
5
5
  "packageManager": "pnpm@10.6.4",
6
6
  "type": "module",
7
7
  "scripts": {
@@ -2,15 +2,15 @@
2
2
 
3
3
  exports[`PSteps.vue > render tests > renders correctly 1`] = `
4
4
  "<div class="flex items-center gap-2">
5
- <div class="text-nowrap rounded-full border px-4 py-1 text-sm font-semibold border-p-gray-30 text-p-gray-30">First</div>
5
+ <div class="text-nowrap rounded-full border px-4 py-1 text-sm font-semibold border-p-gray-30 text-p-gray-30" data-state="inactive">First</div>
6
6
  <div class="flex items-center">
7
7
  <iconify-icon icon="material-symbols:arrow-right-alt-rounded" class="text-p-gray-30"></iconify-icon>
8
8
  </div>
9
- <div class="text-nowrap rounded-full border px-4 py-1 text-sm font-semibold border-p-gray-30 text-p-gray-30">Second</div>
9
+ <div class="text-nowrap rounded-full border px-4 py-1 text-sm font-semibold border-p-gray-30 text-p-gray-30" data-state="inactive">Second</div>
10
10
  <div class="flex items-center">
11
11
  <iconify-icon icon="material-symbols:arrow-right-alt-rounded" class="text-p-gray-30"></iconify-icon>
12
12
  </div>
13
- <div class="text-nowrap rounded-full border px-4 py-1 text-sm font-semibold border-p-gray-30 text-p-gray-30">Third</div>
13
+ <div class="text-nowrap rounded-full border px-4 py-1 text-sm font-semibold border-p-gray-30 text-p-gray-30" data-state="inactive">Third</div>
14
14
  <!--v-if-->
15
15
  </div>"
16
16
  `;
@@ -37,7 +37,7 @@ describe('PSteps.vue', () => {
37
37
  expect(stepElements.length).toBe(createSteps().length);
38
38
  });
39
39
 
40
- it('applies correct classes for current step', () => {
40
+ it('applies correct classes and data-state for current step', () => {
41
41
  const wrapper = createWrapper({
42
42
  activeStep: 'second',
43
43
  });
@@ -48,17 +48,20 @@ describe('PSteps.vue', () => {
48
48
  expect(stepElements[0].classes()).toContain('text-nowrap');
49
49
  expect(stepElements[0].classes()).toContain('text-p-blue-50');
50
50
  expect(stepElements[0].classes()).toContain('border-p-blue-50');
51
+ expect(stepElements[0].attributes('data-state')).toBe('inactive');
51
52
 
52
53
  // Second step should be current (blue background)
53
54
  expect(stepElements[1].classes()).toContain('text-nowrap');
54
55
  expect(stepElements[1].classes()).toContain('bg-p-blue-50');
55
56
  expect(stepElements[1].classes()).toContain('text-surface');
56
57
  expect(stepElements[1].classes()).toContain('border-p-blue-50');
58
+ expect(stepElements[1].attributes('data-state')).toBe('active');
57
59
 
58
60
  // Third step should be upcoming (gray)
59
61
  expect(stepElements[2].classes()).toContain('text-nowrap');
60
62
  expect(stepElements[2].classes()).toContain('text-p-gray-30');
61
63
  expect(stepElements[2].classes()).toContain('border-p-gray-30');
64
+ expect(stepElements[2].attributes('data-state')).toBe('inactive');
62
65
  });
63
66
 
64
67
  it('displays step titles', () => {
@@ -4,6 +4,7 @@
4
4
  <div
5
5
  class="text-nowrap rounded-full border px-4 py-1 text-sm font-semibold"
6
6
  :class="[stepClasses(step, i), { 'cursor-pointer': clickable && !step.disabled }]"
7
+ :data-state="step.value === activeStep ? 'active' : 'inactive'"
7
8
  @click="emit('click:step', step, i)"
8
9
  >
9
10
  {{ step.text || startCase(String(step.value)) }}