vueless 0.0.800 → 0.0.802

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": "0.0.800",
3
+ "version": "0.0.802",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -13,6 +13,7 @@ import type { Props } from "../types.ts";
13
13
 
14
14
  interface UAccordionArgs extends Props {
15
15
  slotTemplate?: string;
16
+ enum: "size";
16
17
  }
17
18
 
18
19
  export default {
@@ -20,26 +21,11 @@ export default {
20
21
  title: "Containers / Accordion",
21
22
  component: UAccordion,
22
23
  args: {
23
- accordions: [
24
- {
25
- name: "Excellence",
26
- title: "Excellence by necessity",
27
- description: `As creators and maintainers of the technologies you are using,
28
- our services are here to showcase the full power of our softwares.`,
29
- },
30
- {
31
- name: "Innovation",
32
- title: "Driving innovation forward",
33
- description: `All the people that will be involved in delivering your project are contributing
34
- to the technologies you are using, when they are not the creators themselves.`,
35
- },
36
- {
37
- name: "Collaboration",
38
- title: "Fostering collaboration",
39
- description: `By working with us, you are directly supporting the open source community,
40
- ensuring the ecosystem continuity and enabling Nuxt development.`,
41
- },
42
- ],
24
+ title: "Committed to Quality and Performance",
25
+ description: `
26
+ We take pride in delivering high-quality solutions tailored to your needs.
27
+ Our expertise ensures that your project is built with efficiency, scalability, and reliability in mind.
28
+ `,
43
29
  },
44
30
  argTypes: {
45
31
  ...getArgTypes(UAccordion.__name),
@@ -58,9 +44,47 @@ const DefaultTemplate: StoryFn<UAccordionArgs> = (args: UAccordionArgs) => ({
58
44
 
59
45
  return { args, slots };
60
46
  },
47
+ template: `
48
+ <UAccordion v-bind="args">
49
+ ${args.slotTemplate || getSlotsFragment("")}
50
+ </UAccordion>
51
+ `,
52
+ });
53
+
54
+ const AccordionsTemplate: StoryFn<UAccordionArgs> = (args: UAccordionArgs) => ({
55
+ components: { UAccordion, UButton },
56
+ setup() {
57
+ const slots = getSlotNames(UAccordion.__name);
58
+
59
+ const accordions = [
60
+ {
61
+ title: "Committed to Quality and Performance",
62
+ description: `
63
+ We take pride in delivering high-quality solutions tailored to your needs.
64
+ Our expertise ensures that your project is built with efficiency, scalability, and reliability in mind.
65
+ `,
66
+ },
67
+ {
68
+ title: "Pioneering Cutting-Edge Solutions",
69
+ description: `
70
+ Our team stays ahead of the curve, integrating the latest technologies and best practices
71
+ to drive innovation and create future-ready applications for your business.
72
+ `,
73
+ },
74
+ {
75
+ title: "Building Together for Long-Term Success",
76
+ description: `
77
+ We work closely with you to understand your goals, ensuring seamless communication
78
+ and a collaborative approach that leads to sustainable, impactful results.
79
+ `,
80
+ },
81
+ ];
82
+
83
+ return { args, slots, accordions };
84
+ },
61
85
  template: `
62
86
  <UAccordion
63
- v-for="(accordion, index) in args.accordions"
87
+ v-for="(accordion, index) in accordions"
64
88
  :key="index"
65
89
  v-bind="accordion"
66
90
  >
@@ -69,11 +93,30 @@ const DefaultTemplate: StoryFn<UAccordionArgs> = (args: UAccordionArgs) => ({
69
93
  `,
70
94
  });
71
95
 
96
+ const EnumVariantTemplate: StoryFn<UAccordionArgs> = (args: UAccordionArgs, { argTypes }) => ({
97
+ components: { UAccordion },
98
+ setup() {
99
+ return { args, options: argTypes?.[args.enum]?.options };
100
+ },
101
+ template: `
102
+ <UAccordion
103
+ v-for="(option, index) in options"
104
+ :key="index"
105
+ v-bind="args"
106
+ :[args.enum]="option"
107
+ :description="option"
108
+ />
109
+ `,
110
+ });
111
+
72
112
  export const Default = DefaultTemplate.bind({});
73
113
  Default.args = {};
74
114
 
75
- export const Size = DefaultTemplate.bind({});
76
- Size.args = { size: "sm" };
115
+ export const Accordions = AccordionsTemplate.bind({});
116
+ Accordions.args = {};
117
+
118
+ export const Size = EnumVariantTemplate.bind({});
119
+ Size.args = { enum: "size" };
77
120
 
78
121
  export const SlotToggle = DefaultTemplate.bind({});
79
122
  SlotToggle.args = {
@@ -22,8 +22,8 @@ const props = withDefaults(defineProps<Props>(), {
22
22
  const slots = useSlots();
23
23
 
24
24
  const isShownHeader = computed(() => {
25
- const isHeaderLeftSlot = hasSlotContent(slots["header-left"]);
26
- const isHeaderRightSlot = hasSlotContent(slots["header-left"]);
25
+ const isHeaderLeftSlot = hasSlotContent(slots["title"]);
26
+ const isHeaderRightSlot = hasSlotContent(slots["title"]);
27
27
 
28
28
  return props.title || isHeaderLeftSlot || isHeaderRightSlot;
29
29
  });
@@ -47,6 +47,8 @@ const {
47
47
  descriptionAttrs,
48
48
  contentAttrs,
49
49
  footerAttrs,
50
+ footerLeftAttrs,
51
+ footerRightAttrs,
50
52
  } = useUI<Config>(defaultConfig);
51
53
  </script>
52
54
 
@@ -55,10 +57,10 @@ const {
55
57
  <div v-if="isShownHeader" v-bind="headerAttrs">
56
58
  <div v-bind="headerLeftAttrs">
57
59
  <!-- @slot Use it to add something before left side of the header. -->
58
- <slot name="header-left-before" />
60
+ <slot name="before-title" />
59
61
 
60
62
  <!-- @slot Use it to customise left side of the header. -->
61
- <slot name="header-left">
63
+ <slot name="title">
62
64
  <div v-bind="headerLeftFallbackAttrs">
63
65
  <UHeader :label="title" size="xs" v-bind="titleAttrs" />
64
66
  <div v-if="description" v-bind="descriptionAttrs" v-text="description" />
@@ -66,11 +68,11 @@ const {
66
68
  </slot>
67
69
 
68
70
  <!-- @slot Use it to add something after left side of the header. -->
69
- <slot name="header-left-after" />
71
+ <slot name="after-title" />
70
72
  </div>
71
73
 
72
74
  <!-- @slot Use it to customise right side of the header. -->
73
- <slot name="header-right" />
75
+ <slot name="actions" />
74
76
  </div>
75
77
 
76
78
  <div v-bind="contentAttrs">
@@ -81,11 +83,15 @@ const {
81
83
  <UDivider v-if="isShownFooter" padding="none" v-bind="cardDividerAttrs" />
82
84
 
83
85
  <div v-if="isShownFooter" v-bind="footerAttrs">
84
- <!-- @slot Use it to add something to the left side of the footer. -->
85
- <slot name="footer-left" />
86
+ <div v-bind="footerLeftAttrs">
87
+ <!-- @slot Use it to add something to the left side of the footer. -->
88
+ <slot name="footer-left" />
89
+ </div>
86
90
 
87
- <!-- @slot Use it to add something to the right side of the footer. -->
88
- <slot name="footer-right" />
91
+ <div v-bind="footerRightAttrs">
92
+ <!-- @slot Use it to add something to the right side of the footer. -->
93
+ <slot name="footer-right" />
94
+ </div>
89
95
  </div>
90
96
  </div>
91
97
  </template>
@@ -7,7 +7,9 @@ export default /*tw*/ {
7
7
  description: "mt-1 text-sm font-normal text-gray-500",
8
8
  content: "text-sm",
9
9
  cardDivider: "{UDivider}",
10
- footer: "flex justify-between",
10
+ footer: "flex justify-between w-full",
11
+ footerLeft: "",
12
+ footerRight: "",
11
13
  defaults: {
12
14
  //
13
15
  },
@@ -10,6 +10,9 @@ import UInput from "../../ui.form-input/UInput.vue";
10
10
  import UButton from "../../ui.button/UButton.vue";
11
11
  import UIcon from "../../ui.image-icon/UIcon.vue";
12
12
  import UHeader from "../../ui.text-header/UHeader.vue";
13
+ import URow from "../../ui.container-row/URow.vue";
14
+ import UCol from "../../ui.container-col/UCol.vue";
15
+ import UBadge from "../../ui.text-badge/UBadge.vue";
13
16
 
14
17
  import type { Meta, StoryFn } from "@storybook/vue3";
15
18
  import type { Props } from "../types.ts";
@@ -23,7 +26,7 @@ export default {
23
26
  title: "Containers / Card",
24
27
  component: UCard,
25
28
  args: {
26
- title: "Title",
29
+ title: "User Profile",
27
30
  },
28
31
  argTypes: {
29
32
  ...getArgTypes(UCard.__name),
@@ -37,19 +40,24 @@ export default {
37
40
 
38
41
  const defaultTemplate = `
39
42
  <p>
40
- Lorem ipsum dolor sit amet, consectetur adipiscing elit,
41
- sed do eiusmod tempor incididunt ut labore et dolore magna
42
- aliqua. Ut enim ad minim veniam, quis nostrud exercitation
43
- ullamco laboris nisi ut aliquip ex ea commodo consequat.
44
- Duis aute irure dolor in reprehenderit in voluptate velit
45
- esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
46
- occaecat cupidatat non proident, sunt in culpa qui officia
47
- deserunt mollit anim id est laborum.
43
+ The <strong>Card</strong> component is a versatile UI element designed to present
44
+ structured content in an organized manner. It can be used for displaying
45
+ user profiles, product details, notifications, or any other grouped information.
46
+ </p>
47
+ <p>
48
+ With a clean layout that includes a title and content area, this component
49
+ is ideal for dashboards, settings pages, and interactive modals. You can
50
+ customize it further by adding buttons, images, icons, or additional
51
+ sections as needed.
52
+ </p>
53
+ <p>
54
+ Whether you're building a simple info box or a detailed summary card, this
55
+ component helps maintain a visually consistent and responsive design.
48
56
  </p>
49
57
  `;
50
58
 
51
59
  const DefaultTemplate: StoryFn<UCardArgs> = (args: UCardArgs) => ({
52
- components: { UCard, UButton, UInput, UIcon, UHeader },
60
+ components: { UCard, UButton, UInput, UIcon, UHeader, URow },
53
61
  setup() {
54
62
  const slots = getSlotNames(UCard.__name);
55
63
 
@@ -66,64 +74,59 @@ export const Default = DefaultTemplate.bind({});
66
74
  Default.args = {};
67
75
 
68
76
  export const Description = DefaultTemplate.bind({});
69
- Description.args = { description: "Card description" };
77
+ Description.args = { description: "Displays key details about a user, product, or feature." };
70
78
 
71
- export const SlotHeaderLeftBefore = DefaultTemplate.bind({});
72
- SlotHeaderLeftBefore.args = {
73
- slotTemplate: `
74
- <template #header-left-before>
75
- <UIcon name="star" size="sm" />
76
- </template>
77
- ${defaultTemplate}
78
- `,
79
- };
79
+ export const Slots: StoryFn<UCardArgs> = (args) => ({
80
+ components: { UCard, UIcon, URow, UCol, UButton, UBadge },
81
+ setup() {
82
+ return { args };
83
+ },
84
+ template: `
85
+ <UCol gap="lg">
86
+ <UCard v-bind="args" description="Before Title Slot">
87
+ <template #before-title>
88
+ <UIcon name="account_circle" size="sm" />
89
+ </template>
90
+ ${defaultTemplate}
91
+ </UCard>
80
92
 
81
- export const SlotHeaderLeft = DefaultTemplate.bind({});
82
- SlotHeaderLeft.args = {
83
- slotTemplate: `
84
- <template #header-left>
85
- <UHeader size="lg" label="Large title" />
86
- </template>
87
- ${defaultTemplate}
88
- `,
89
- };
93
+ <UCard v-bind="args">
94
+ <template #title>
95
+ <UBadge label="Title Slot" size="lg" />
96
+ </template>
97
+ ${defaultTemplate}
98
+ </UCard>
90
99
 
91
- export const SlotHeaderLeftAfter = DefaultTemplate.bind({});
92
- SlotHeaderLeftAfter.args = {
93
- slotTemplate: `
94
- <template #header-left-after>
95
- <UIcon name="star" size="sm" />
96
- </template>
97
- ${defaultTemplate}
98
- `,
99
- };
100
+ <UCard v-bind="args" description="After Title Slot">
101
+ <template #after-title>
102
+ <UIcon name="verified" size="sm" />
103
+ </template>
104
+ ${defaultTemplate}
105
+ </UCard>
100
106
 
101
- export const SlotHeaderRight = DefaultTemplate.bind({});
102
- SlotHeaderRight.args = {
103
- slotTemplate: `
104
- <template #header-right>
105
- <UButton size="sm" color="gray" label="Read more" />
106
- </template>
107
- ${defaultTemplate}
108
- `,
109
- };
107
+ <UCard v-bind="args" description="Actions Slot">
108
+ <template #actions>
109
+ <URow class="max-w-fit">
110
+ <UButton size="sm" label="Follow" />
111
+ <UButton size="sm" label="Message" />
112
+ </URow>
113
+ </template>
114
+ ${defaultTemplate}
115
+ </UCard>
110
116
 
111
- export const SlotFooterLeft = DefaultTemplate.bind({});
112
- SlotFooterLeft.args = {
113
- slotTemplate: `
114
- ${defaultTemplate}
115
- <template #footer-left>
116
- <UButton size="sm" label="Read more" />
117
- </template>
118
- `,
119
- };
117
+ <UCard v-bind="args" description="Footer Left Slot">
118
+ ${defaultTemplate}
119
+ <template #footer-left>
120
+ <UButton size="sm" label="Cancel" />
121
+ </template>
122
+ </UCard>
120
123
 
121
- export const SlotFooterRight = DefaultTemplate.bind({});
122
- SlotFooterRight.args = {
123
- slotTemplate: `
124
- ${defaultTemplate}
125
- <template #footer-right>
126
- <UButton size="sm" label="Read more" />
127
- </template>
124
+ <UCard v-bind="args" description="Footer Right Slot">
125
+ ${defaultTemplate}
126
+ <template #footer-right>
127
+ <UButton size="sm" label="Save Changes" />
128
+ </template>
129
+ </UCard>
130
+ </UCol>
128
131
  `,
129
- };
132
+ });
@@ -6,14 +6,17 @@ import {
6
6
  } from "../../utils/storybook.ts";
7
7
 
8
8
  import UCol from "../../ui.container-col/UCol.vue";
9
+ import URow from "../../ui.container-row/URow.vue";
9
10
  import UInput from "../../ui.form-input/UInput.vue";
10
11
  import UButton from "../../ui.button/UButton.vue";
12
+ import UPage from "../../ui.container-page/UPage.vue";
11
13
 
12
14
  import type { Meta, StoryFn } from "@storybook/vue3";
13
15
  import type { Props } from "../types.ts";
14
16
 
15
17
  interface UColArgs extends Props {
16
18
  slotTemplate?: string;
19
+ enum: "gap" | "align" | "content" | "justify";
17
20
  }
18
21
 
19
22
  export default {
@@ -28,20 +31,20 @@ export default {
28
31
  docs: {
29
32
  ...getDocsDescription(UCol.__name),
30
33
  story: {
31
- iframeHeight: 360,
34
+ height: "400px",
32
35
  },
33
36
  },
34
37
  },
35
38
  } as Meta;
36
39
 
37
40
  const defaultTemplate = `
38
- <UInput placeholder="Vasyl" label="Name" />
39
- <UInput placeholder="Vasylenko" label="Surname" />
40
- <UInput placeholder="Kyiv" label="Town" />
41
+ <UInput placeholder="Vasyl" label="Name" class="max-w-96" />
42
+ <UInput placeholder="Vasylenko" label="Surname" class="max-w-96" />
43
+ <UInput placeholder="Kyiv" label="City" class="max-w-96" />
41
44
  `;
42
45
 
43
46
  const DefaultTemplate: StoryFn<UColArgs> = (args: UColArgs) => ({
44
- components: { UCol, UInput, UButton },
47
+ components: { UCol, UInput, UButton, UPage },
45
48
  setup() {
46
49
  const slots = getSlotNames(UCol.__name);
47
50
 
@@ -54,21 +57,95 @@ const DefaultTemplate: StoryFn<UColArgs> = (args: UColArgs) => ({
54
57
  `,
55
58
  });
56
59
 
60
+ const EnumVariantTemplate: StoryFn<UColArgs> = (args: UColArgs, { argTypes }) => ({
61
+ components: { UCol, UButton, URow, UInput },
62
+ setup() {
63
+ return {
64
+ args,
65
+ options: argTypes?.[args.enum]?.options,
66
+ };
67
+ },
68
+ template: `
69
+ <URow gap="lg" class="h-[200px]" :class="{ '!flex-col': args.enum === 'content' }">
70
+ <UCol
71
+ v-for="(option, index) in options"
72
+ :key="index"
73
+ v-bind="args"
74
+ :[args.enum]="option"
75
+ class="w-full h-full border border-brand-500 rounded p-2"
76
+ >
77
+ <UButton :label="args.enum" />
78
+ <UButton :label="option" />
79
+ <div v-if="args.enum === 'content'" class="flex flex-col gap-2">
80
+ ${defaultTemplate}
81
+ </div>
82
+ </UCol>
83
+ </URow>
84
+ `,
85
+ });
86
+
57
87
  export const Default = DefaultTemplate.bind({});
58
- Default.args = {};
88
+ Default.args = { config: { wrapper: "h-[300px]" } };
89
+
90
+ export const Reverse = DefaultTemplate.bind({});
91
+ Reverse.args = { reverse: true };
92
+ Reverse.parameters = {
93
+ docs: {
94
+ description: {
95
+ story: "Reverse nested items order.",
96
+ },
97
+ story: {
98
+ height: "200px",
99
+ },
100
+ },
101
+ };
102
+
103
+ export const Gap = EnumVariantTemplate.bind({});
104
+ Gap.args = { enum: "gap" };
105
+ Gap.parameters = {
106
+ docs: {
107
+ description: {
108
+ story: "The distance between nested elements.",
109
+ },
110
+ },
111
+ };
112
+
113
+ export const Align = EnumVariantTemplate.bind({});
114
+ Align.args = { enum: "align" };
115
+ Align.parameters = {
116
+ docs: {
117
+ description: {
118
+ story: "Items horizontal align (align-items).",
119
+ },
120
+ },
121
+ };
122
+
123
+ export const Content = EnumVariantTemplate.bind({});
124
+ Content.args = { enum: "content", wrap: true };
125
+ Content.parameters = {
126
+ docs: {
127
+ description: {
128
+ story: "Items horizontal align for multi-row flex containers (align-content).",
129
+ },
130
+ },
131
+ };
132
+
133
+ export const Justify = EnumVariantTemplate.bind({});
134
+ Justify.args = { enum: "justify" };
135
+ Justify.parameters = {
136
+ docs: {
137
+ description: {
138
+ story: "Items vertical align (justify-content).",
139
+ },
140
+ },
141
+ };
59
142
 
60
143
  export const SlotDefault = DefaultTemplate.bind({});
61
144
  SlotDefault.args = {
62
145
  slotTemplate: `
63
146
  <template #default>
64
- <UInput placeholder="placeholder" label="Label" />
147
+ <UButton label="Submit" />
148
+ <UInput placeholder="Provide today's new data..." label="Daily report" />
65
149
  </template>
66
150
  `,
67
151
  };
68
- SlotDefault.parameters = {
69
- docs: {
70
- story: {
71
- iframeHeight: 240,
72
- },
73
- },
74
- };
@@ -7,6 +7,7 @@ import {
7
7
 
8
8
  import URow from "../../ui.container-row/URow.vue";
9
9
  import UDivider from "../../ui.container-divider/UDivider.vue";
10
+ import UCol from "../../ui.container-col/UCol.vue";
10
11
 
11
12
  import type { Meta, StoryFn } from "@storybook/vue3";
12
13
  import type { Props } from "../types.ts";
@@ -38,14 +39,22 @@ const DefaultTemplate: StoryFn<UDividerArgs> = (args: UDividerArgs) => ({
38
39
  return { args, slots };
39
40
  },
40
41
  template: `
42
+ <p>
43
+ Understanding your clients' needs is essential for building long-term business relationships.
44
+ By analyzing customer behavior and feedback, companies can tailor their services to provide more value.
45
+ </p>
41
46
  <UDivider v-bind="args">
42
47
  ${args.slotTemplate || getSlotsFragment("")}
43
48
  </UDivider>
49
+ <p>
50
+ Businesses that prioritize customer satisfaction see higher retention rates and increased referrals.
51
+ Implementing a structured follow-up process can help maintain strong client engagement and trust.
52
+ </p>
44
53
  `,
45
54
  });
46
55
 
47
56
  const EnumVariantTemplate: StoryFn<UDividerArgs> = (args: UDividerArgs, { argTypes }) => ({
48
- components: { UDivider, URow },
57
+ components: { UDivider, URow, UCol },
49
58
  setup() {
50
59
  return {
51
60
  args,
@@ -53,14 +62,21 @@ const EnumVariantTemplate: StoryFn<UDividerArgs> = (args: UDividerArgs, { argTyp
53
62
  };
54
63
  },
55
64
  template: `
56
- <URow>
57
- <UDivider
58
- class="w-1/4"
65
+ <URow gap="xl">
66
+ <UCol
59
67
  v-for="(option, index) in options"
60
- v-bind="args"
61
- :[args.enum]="option"
62
68
  :key="index"
63
- />
69
+ gap="none"
70
+ class="w-1/4"
71
+ >
72
+ <p>{{ option }}</p>
73
+ <UDivider
74
+ v-bind="args"
75
+ :[args.enum]="option"
76
+ :key="index"
77
+ />
78
+ <p>{{ option }}</p>
79
+ </UCol>
64
80
  </URow>
65
81
  `,
66
82
  });
@@ -86,11 +102,18 @@ Dotted.args = { dotted: true };
86
102
  export const Vertical = DefaultTemplate.bind({});
87
103
  Vertical.args = {
88
104
  vertical: true,
89
- label: "label",
105
+ label: "Feedback",
90
106
  config: {
91
107
  wrapper: "!h-32",
92
108
  },
93
109
  };
94
110
 
95
111
  export const NoBorder = DefaultTemplate.bind({});
96
- NoBorder.args = { label: "label", border: false };
112
+ NoBorder.args = { label: "Customer Feedback", border: false };
113
+ NoBorder.parameters = {
114
+ docs: {
115
+ description: {
116
+ story: "Keep only spacings by setting `border` prop to `false`.",
117
+ },
118
+ },
119
+ };
@@ -41,7 +41,7 @@ export interface Props {
41
41
  vertical?: boolean;
42
42
 
43
43
  /**
44
- * Show divider border (or keeps only spacings).
44
+ * Show divider border (or keep only spacings).
45
45
  */
46
46
  border?: boolean;
47
47
 
@@ -38,7 +38,7 @@ const {
38
38
 
39
39
  <div v-bind="headerAttrs">
40
40
  <!-- @slot Use it to add something on the left side of the header. -->
41
- <slot name="header-left">
41
+ <slot name="title">
42
42
  <div v-bind="headerLeftFallbackAttrs">
43
43
  <!-- @slot Use it to add something before the title. -->
44
44
  <slot name="before-title" />
@@ -51,7 +51,7 @@ const {
51
51
  </slot>
52
52
 
53
53
  <!-- @slot Use it to add something on the right side of the header. -->
54
- <slot name="header-right" />
54
+ <slot name="actions" />
55
55
  </div>
56
56
 
57
57
  <UDivider size="xl" padding="after" :border="underlined" v-bind="underlineAttrs" />