vueless 1.2.10-beta.3 → 1.2.10-beta.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "1.2.10-beta.3",
3
+ "version": "1.2.10-beta.4",
4
4
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
5
5
  "author": "Johnny Grid <hello@vueless.com> (https://vueless.com)",
6
6
  "homepage": "https://vueless.com",
@@ -62,6 +62,7 @@ defineExpose({
62
62
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
63
63
  */
64
64
  const mutatedProps = computed(() => ({
65
+ icon: Boolean(props.icon) || hasSlotContent(slots["default"]),
65
66
  leftIcon: Boolean(props.leftIcon) || hasSlotContent(slots["left"]),
66
67
  rightIcon: Boolean(props.rightIcon) || hasSlotContent(slots["right"]),
67
68
  label: Boolean(props.label),
@@ -129,11 +130,6 @@ const {
129
130
  </template>
130
131
 
131
132
  <!-- This is needed to prevent changing button height -->
132
- <div
133
- v-if="(!label && !hasSlotContent(slots['default']) && !icon) || loading"
134
- tabindex="-1"
135
- v-bind="invisibleAttrs"
136
- v-text="'invisible'"
137
- />
133
+ <div v-if="icon || loading" tabindex="-1" v-bind="invisibleAttrs" v-text="'invisible'" />
138
134
  </component>
139
135
  </template>
@@ -54,6 +54,9 @@ export default /*tw*/ {
54
54
  loading: {
55
55
  true: "gap-0 pointer-events-none",
56
56
  },
57
+ icon: {
58
+ true: "gap-0",
59
+ },
57
60
  label: {
58
61
  false: "gap-0",
59
62
  },
@@ -62,6 +65,8 @@ export default /*tw*/ {
62
65
  },
63
66
  },
64
67
  compoundVariants: [
68
+ { label: false, leftIcon: true, class: "gap-0" },
69
+ { label: false, rightIcon: true, class: "gap-0" },
65
70
  { square: true, size: "2xs", class: "p-1" },
66
71
  { square: true, size: "xs", class: "p-1.5" },
67
72
  { square: true, size: "sm", class: "p-2" },
@@ -115,7 +115,7 @@ describe("UButton.vue", () => {
115
115
 
116
116
  const nestedUIconComponents = component.findAllComponents(UIcon);
117
117
 
118
- expect(component.text()).toBe("");
118
+ expect(component.text()).not.toBe(label);
119
119
  expect(nestedUIconComponents.length).toBe(1);
120
120
  expect(nestedUIconComponents[0].props("name")).toBe(icon);
121
121
  });
@@ -375,7 +375,7 @@ describe("UCalendar.vue", () => {
375
375
  },
376
376
  });
377
377
 
378
- const nextPrevButtons = component.findAll('[vl-key="nextPrevButton"]');
378
+ const nextPrevButtons = component.findAll('button[vl-key="nextPrevButton"]');
379
379
 
380
380
  expect(nextPrevButtons.length).toBe(4);
381
381
  });
@@ -391,7 +391,7 @@ describe("UCalendar.vue", () => {
391
391
  },
392
392
  });
393
393
 
394
- const nextPrevButtons = component.findAll('[vl-key="nextPrevButton"]');
394
+ const nextPrevButtons = component.findAll('button[vl-key="nextPrevButton"]');
395
395
 
396
396
  expect(nextPrevButtons.length).toBe(2);
397
397
  });
@@ -422,7 +422,7 @@ describe("UCalendar.vue", () => {
422
422
 
423
423
  const dayView = component.findComponent(DayView);
424
424
  const initialDays = dayView.findAll('[vl-key="day"]').map((day) => day.text());
425
- const navButtons = component.findAll('[vl-key="nextPrevButton"]');
425
+ const navButtons = component.findAll('button[vl-key="nextPrevButton"]');
426
426
 
427
427
  expect(navButtons.length).toBe(4);
428
428
 
@@ -446,7 +446,7 @@ describe("UCalendar.vue", () => {
446
446
 
447
447
  const dayView = component.findComponent(DayView);
448
448
  const initialDays = dayView.findAll('[vl-key="day"]').map((day) => day.text());
449
- const navButtons = component.findAll('[vl-key="nextPrevButton"]');
449
+ const navButtons = component.findAll('button[vl-key="nextPrevButton"]');
450
450
  const nextButton = navButtons[2];
451
451
 
452
452
  await nextButton.trigger("click");