vueless 1.1.1-beta.8 → 1.1.1-beta.9

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.1.1-beta.8",
3
+ "version": "1.1.1-beta.9",
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",
@@ -67,6 +67,7 @@ const {
67
67
  descriptionAttrs,
68
68
  bodyAttrs,
69
69
  titleAttrs,
70
+ contentAttrs,
70
71
  toggleIconAttrs,
71
72
  accordionDividerAttrs,
72
73
  } = useUI<Config>(defaultConfig, mutatedProps);
@@ -94,6 +95,11 @@ const {
94
95
  </div>
95
96
 
96
97
  <div :id="`description-${elementId}`" v-bind="descriptionAttrs" v-text="description" />
98
+
99
+ <div v-if="isOpened" v-bind="contentAttrs">
100
+ <!-- @slot Use it to add accordion content. -->
101
+ <slot />
102
+ </div>
97
103
  </div>
98
104
 
99
105
  <UDivider v-bind="accordionDividerAttrs" />
@@ -24,6 +24,7 @@ export default /*tw*/ {
24
24
  },
25
25
  },
26
26
  },
27
+ content: "",
27
28
  toggleIcon: {
28
29
  base: "{UIcon} transition duration-300",
29
30
  variants: {
@@ -10,6 +10,7 @@ import {
10
10
  import UAccordion from "../../ui.container-accordion/UAccordion.vue";
11
11
  import UButton from "../../ui.button/UButton.vue";
12
12
  import ULink from "../../ui.button-link/ULink.vue";
13
+ import UCol from "../../ui.container-col/UCol.vue";
13
14
 
14
15
  import type { Meta, StoryFn } from "@storybook/vue3-vite";
15
16
  import type { Props } from "../types.ts";
@@ -41,7 +42,7 @@ export default {
41
42
  } as Meta;
42
43
 
43
44
  const DefaultTemplate: StoryFn<UAccordionArgs> = (args: UAccordionArgs) => ({
44
- components: { UAccordion, ULink },
45
+ components: { UAccordion, ULink, UButton, UCol },
45
46
  setup: () => ({ args, slots: getSlotNames(UAccordion.__name) }),
46
47
  template: `
47
48
  <UAccordion v-bind="args">
@@ -113,6 +114,20 @@ Accordions.args = {};
113
114
  export const Sizes = EnumTemplate.bind({});
114
115
  Sizes.args = { enum: "size", description: "{enumValue}" };
115
116
 
117
+ export const DefaultSlot = DefaultTemplate.bind({});
118
+ DefaultSlot.args = {
119
+ description: "",
120
+ slotTemplate: `
121
+ <template #default>
122
+ <UCol gap="sm">
123
+ <ULink label="Email services" />
124
+ <ULink label="VPN" />
125
+ <ULink label="SEO Tools" />
126
+ </UCol>
127
+ </template>
128
+ `,
129
+ };
130
+
116
131
  export const ToggleSlot = DefaultTemplate.bind({});
117
132
  ToggleSlot.args = {
118
133
  slotTemplate: `
@@ -378,9 +378,7 @@ function onChangeLocalSelectedRows(selectedRows: Row[]) {
378
378
 
379
379
  selectAll.value = !!selectedRows.length;
380
380
 
381
- if (!isEqual(localSelectedRows.value, props.selectedRows)) {
382
- emit("update:selectedRows", localSelectedRows.value);
383
- }
381
+ emit("update:selectedRows", localSelectedRows.value);
384
382
  }
385
383
 
386
384
  function clearSelectedItems() {
@@ -471,7 +471,7 @@ const {
471
471
  <span
472
472
  :style="getMarginForSubCategory(option.level)"
473
473
  v-bind="optionContentAttrs"
474
- :title="String(option.label)"
474
+ :title="String(option[labelKey])"
475
475
  v-text="option[labelKey]"
476
476
  />
477
477
  </slot>
@@ -26,11 +26,11 @@ export default {
26
26
  component: UListbox,
27
27
  args: {
28
28
  options: [
29
- { label: "New York", id: ["1"] },
30
- { label: "Los Angeles", id: ["2"] },
31
- { label: "Chicago", id: ["3"] },
32
- { label: "Houston", id: ["4"] },
33
- { label: "San Francisco", id: ["5"] },
29
+ { label: "New York", id: 1 },
30
+ { label: "Los Angeles", id: 2 },
31
+ { label: "Chicago", id: 3 },
32
+ { label: "Houston", id: 4 },
33
+ { label: "San Francisco", id: 5 },
34
34
  ],
35
35
  },
36
36
  argTypes: {
@@ -118,7 +118,7 @@ export default /*tw*/ {
118
118
  clear: "{>toggle}",
119
119
  clearIcon: "{UIcon} {>selectIcon}",
120
120
  placeholder: {
121
- base: "flex items-center text-muted !leading-none",
121
+ base: "flex items-center text-muted !leading-none shrink-0",
122
122
  variants: {
123
123
  size: {
124
124
  sm: "text-small",
@@ -38,11 +38,11 @@ export default {
38
38
  label: "Choose a city",
39
39
  modelValue: null,
40
40
  options: [
41
- { label: "New York", id: "1" },
42
- { label: "Los Angeles", id: "2" },
43
- { label: "Chicago", id: "3" },
44
- { label: "Houston", id: "4" },
45
- { label: "San Francisco", id: "5" },
41
+ { label: "New York", id: 1 },
42
+ { label: "Los Angeles", id: 2 },
43
+ { label: "Chicago", id: 3 },
44
+ { label: "Houston", id: 4 },
45
+ { label: "San Francisco", id: 5 },
46
46
  ],
47
47
  },
48
48
  argTypes: {
@@ -124,6 +124,7 @@ const {
124
124
  nextButtonAttrs,
125
125
  activeButtonAttrs,
126
126
  inactiveButtonAttrs,
127
+ ellipsisAttrs,
127
128
  lastIconAttrs,
128
129
  firstIconAttrs,
129
130
  prevIconAttrs,
@@ -181,13 +182,7 @@ const {
181
182
  </UButton>
182
183
 
183
184
  <template v-for="page in pageButtons" :key="page">
184
- <UButton
185
- v-if="!isFinite(page.number)"
186
- square
187
- disabled
188
- variant="ghost"
189
- v-bind="inactiveButtonAttrs"
190
- >
185
+ <UButton v-if="!isFinite(page.number)" square disabled variant="ghost" v-bind="ellipsisAttrs">
191
186
  <!-- @slot Use it to add something instead of the ellipsis. -->
192
187
  <slot name="ellipsis">&hellip;</slot>
193
188
  </UButton>
@@ -19,6 +19,7 @@ export default /*tw*/ {
19
19
  nextButton: "{>paginationButton}",
20
20
  inactiveButton: "{>paginationButton}",
21
21
  activeButton: "{>paginationButton}",
22
+ ellipsis: "{>paginationButton} {>inactiveButton}",
22
23
  paginationIcon: {
23
24
  base: "{UIcon}",
24
25
  defaults: {
@@ -12,7 +12,7 @@ describe("UPagination.vue", () => {
12
12
  describe("Props", () => {
13
13
  // Variant prop
14
14
  it("applies the correct variant to buttons", async () => {
15
- const variants = ["solid", "outlined", "soft", "ghost"];
15
+ const variants = ["solid", "outlined", "subtle", "soft", "ghost"];
16
16
 
17
17
  variants.forEach((variant) => {
18
18
  const component = mount(UPagination, {
@@ -27,7 +27,7 @@ export interface Props {
27
27
  /**
28
28
  * Pagination variant.
29
29
  */
30
- variant?: "solid" | "outlined" | "soft" | "ghost";
30
+ variant?: "solid" | "outlined" | "subtle" | "soft" | "ghost";
31
31
 
32
32
  /**
33
33
  * Pagination size.