vueless 0.0.395 → 0.0.397

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,8 +1,24 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.395",
3
+ "version": "0.0.397",
4
4
  "license": "MIT",
5
- "description": "Vue Styleless Component Framework.",
5
+ "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
+ "keywords": [
7
+ "vueless",
8
+ "vue",
9
+ "vue.js",
10
+ "vue3",
11
+ "ui library",
12
+ "component library",
13
+ "vue framework",
14
+ "design system",
15
+ "tailwind",
16
+ "tailwindcss",
17
+ "unstyled",
18
+ "styleless",
19
+ "headlessui",
20
+ "ui"
21
+ ],
6
22
  "homepage": "https://vueless.com",
7
23
  "author": "Johnny Grid",
8
24
  "main": "index.js",
@@ -61,6 +77,9 @@
61
77
  "resolutions": {
62
78
  "jackspeak": "2.3.6"
63
79
  },
80
+ "engines": {
81
+ "node": ">=18"
82
+ },
64
83
  "repository": {
65
84
  "type": "git",
66
85
  "url": "git+https://github.com/vuelessjs/vueless.git"
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div :data-test="dataTest" v-bind="wrapperAttrs" @click="onClickItem">
3
3
  <div v-bind="bodyAttrs">
4
- <div v-bind="labelAttrs">
5
- {{ label }}
4
+ <div v-bind="titleAttrs">
5
+ {{ title }}
6
6
  <!--
7
7
  @slot Use it to add something instead of the toggle icon.
8
8
  @binding {string} icon-name
@@ -36,9 +36,9 @@ defineOptions({ inheritAttrs: false });
36
36
 
37
37
  const props = defineProps({
38
38
  /**
39
- * Accordion label.
39
+ * Accordion title.
40
40
  */
41
- label: {
41
+ title: {
42
42
  type: String,
43
43
  required: true,
44
44
  },
@@ -95,7 +95,7 @@ const {
95
95
  wrapperAttrs,
96
96
  descriptionAttrs,
97
97
  bodyAttrs,
98
- labelAttrs,
98
+ titleAttrs,
99
99
  toggleIconAttrs,
100
100
  dividerAttrs,
101
101
  } = useAttrs(props, { isOpened });
@@ -1,7 +1,7 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: "group cursor-pointer",
3
3
  body: "",
4
- label: {
4
+ title: {
5
5
  base: "flex items-center justify-between font-medium text-gray-900",
6
6
  variants: {
7
7
  size: {
@@ -14,19 +14,19 @@ export default {
14
14
  accordions: [
15
15
  {
16
16
  name: "Excellence",
17
- label: "Excellence by necessity",
17
+ title: "Excellence by necessity",
18
18
  description: `As creators and maintainers of the technologies you are using,
19
19
  our services are here to showcase the full power of our softwares.`,
20
20
  },
21
21
  {
22
22
  name: "Innovation",
23
- label: "Driving innovation forward",
23
+ title: "Driving innovation forward",
24
24
  description: `All the people that will be involved in delivering your project are contributing
25
25
  to the technologies you are using, when they are not the creators themselves.`,
26
26
  },
27
27
  {
28
28
  name: "Collaboration",
29
- label: "Fostering collaboration",
29
+ title: "Fostering collaboration",
30
30
  description: `By working with us, you are directly supporting the open source community,
31
31
  ensuring the ecosystem continuity and enabling Nuxt development.`,
32
32
  },
@@ -46,7 +46,7 @@ const props = defineProps({
46
46
  * @values none, before, after, all
47
47
  */
48
48
  padding: {
49
- type: Boolean,
49
+ type: String,
50
50
  default: getDefault(defaultConfig, UDivider).padding,
51
51
  },
52
52
 
@@ -9,9 +9,6 @@ export default /*tw*/ {
9
9
  label: {
10
10
  true: "items-center justify-center",
11
11
  },
12
- padding: {
13
- none: "p-0",
14
- },
15
12
  },
16
13
  compoundVariants: [
17
14
  { vertical: false, size: "xs", class: "py-2" },
@@ -28,6 +25,7 @@ export default /*tw*/ {
28
25
  { vertical: true, size: "xl", class: "px-6" },
29
26
  { vertical: true, padding: "after", class: "pl-0" },
30
27
  { vertical: true, padding: "before", class: "pr-0" },
28
+ { padding: "none", class: "p-0" },
31
29
  ],
32
30
  },
33
31
  divider: {
@@ -4,9 +4,9 @@
4
4
  <UDivider v-if="upperlined" size="xl" padding="after" v-bind="upperlineAttrs" />
5
5
 
6
6
  <div v-bind="headerAttrs">
7
- <!-- @slot Use it to add something left side of the header. -->
8
- <slot name="left">
9
- <div v-bind="headerFallbackAttrs">
7
+ <!-- @slot Use it to add something on the left side of the header. -->
8
+ <slot name="header-left">
9
+ <div v-bind="headerLeftFallbackAttrs">
10
10
  <!-- @slot Use it to add something before the title. -->
11
11
  <slot name="before-title" />
12
12
 
@@ -17,11 +17,11 @@
17
17
  </div>
18
18
  </slot>
19
19
 
20
- <!-- @slot Use it to add something right side of the header. -->
21
- <slot name="right" />
20
+ <!-- @slot Use it to add something on the right side of the header. -->
21
+ <slot name="header-right" />
22
22
  </div>
23
23
 
24
- <UDivider v-if="underlined" size="xl" v-bind="underlineAttrs" />
24
+ <UDivider size="xl" padding="after" :no-border="!underlined" v-bind="underlineAttrs" />
25
25
  </template>
26
26
 
27
27
  <div v-bind="contentAttrs">
@@ -44,7 +44,7 @@ defineOptions({ inheritAttrs: false });
44
44
 
45
45
  const props = defineProps({
46
46
  /**
47
- * Header title.
47
+ * Group title.
48
48
  */
49
49
  title: {
50
50
  type: String,
@@ -77,7 +77,7 @@ const props = defineProps({
77
77
  },
78
78
 
79
79
  /**
80
- *Component config object.
80
+ * Component config object.
81
81
  */
82
82
  config: {
83
83
  type: Object,
@@ -96,7 +96,7 @@ const props = defineProps({
96
96
  const {
97
97
  headerAttrs,
98
98
  wrapperAttrs,
99
- headerFallbackAttrs,
99
+ headerLeftFallbackAttrs,
100
100
  titleAttrs,
101
101
  upperlineAttrs,
102
102
  underlineAttrs,
@@ -1,17 +1,17 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: "w-full",
3
3
  upperline: "{UDivider}",
4
- header: {
5
- base: "flex items-center justify-between",
4
+ underline: {
5
+ component: "{UDivider}",
6
6
  variants: {
7
7
  underlined: {
8
- false: "pb-6",
8
+ true: "pt-1.5",
9
9
  },
10
10
  },
11
11
  },
12
- headerFallback: "flex items-center",
12
+ header: "flex items-center justify-between",
13
+ headerLeftFallback: "flex items-center",
13
14
  title: "{UHeader} pr-2",
14
- underline: "{UDivider} pt-1.5",
15
15
  content: {
16
16
  base: "flex flex-col items-stretch",
17
17
  variants: {
@@ -9,19 +9,19 @@
9
9
  :id="elementId"
10
10
  ref="wrapperRef"
11
11
  tabindex="0"
12
- :data-test="dataTest"
13
12
  v-bind="wrapperAttrs"
13
+ :data-test="dataTest"
14
14
  @keydown.self.esc="onKeydownEsc"
15
15
  >
16
16
  <div v-bind="innerWrapperAttrs" @click.self="onClickOutside">
17
17
  <div v-bind="modalAttrs">
18
18
  <div v-if="isExistHeader" v-bind="headerAttrs">
19
19
  <div v-bind="headerLeftAttrs">
20
- <!-- @slot Use it to add something before the left part of the header. -->
21
- <slot name="header-left-before" />
22
-
23
- <!-- @slot Use it to add something to the left part of the header.. -->
20
+ <!-- @slot Use it to add something to the left side of the header. -->
24
21
  <slot name="header-left">
22
+ <!-- @slot Use it to add something before the header title. -->
23
+ <slot name="before-title" />
24
+
25
25
  <div v-bind="headerLeftFallbackAttrs">
26
26
  <ULink
27
27
  v-if="isShownArrowButton"
@@ -41,17 +41,17 @@
41
41
  {{ backRoute.title }}
42
42
  </ULink>
43
43
 
44
- <UHeader :label="title" v-bind="titleAttrs" />
44
+ <UHeader :label="title" size="sm" v-bind="titleAttrs" />
45
45
  <div v-if="description" v-bind="descriptionAttrs" v-text="description" />
46
46
  </div>
47
- </slot>
48
47
 
49
- <!-- @slot Use it to add something after the left part of the header. -->
50
- <slot name="header-left-after" />
48
+ <!-- @slot Use it to add something after the header title. -->
49
+ <slot name="after-title" />
50
+ </slot>
51
51
  </div>
52
52
 
53
53
  <div v-bind="headerRightAttrs">
54
- <!-- @slot Use it to add something to the right part of the header. -->
54
+ <!-- @slot Use it to add something to the right side of the header. -->
55
55
  <slot name="header-right" />
56
56
  </div>
57
57
 
@@ -62,12 +62,13 @@
62
62
  -->
63
63
  <slot name="close-button" :icon-name="config.defaults.closeIcon">
64
64
  <UIcon
65
- v-if="closeButton"
65
+ v-if="closeOnCross"
66
66
  internal
67
67
  interactive
68
+ size="sm"
68
69
  :name="config.defaults.closeIcon"
69
- :data-test="`${dataTest}-close`"
70
70
  v-bind="closeIconAttrs"
71
+ :data-test="`${dataTest}-close`"
71
72
  @click="onClickCloseModal"
72
73
  />
73
74
  </slot>
@@ -75,7 +76,7 @@
75
76
  </div>
76
77
 
77
78
  <div v-bind="bodyAttrs">
78
- <!-- @slot Use it to add something to the modal body. -->
79
+ <!-- @slot Use it to add something into the modal body. -->
79
80
  <slot />
80
81
  </div>
81
82
 
@@ -86,12 +87,12 @@
86
87
 
87
88
  <div v-bind="footerAttrs">
88
89
  <div v-if="hasSlotContent($slots['footer-left'])" v-bind="footerLeftAttrs">
89
- <!-- @slot Use it to add something to the left part of the footer. -->
90
+ <!-- @slot Use it to add something to the left side of the footer. -->
90
91
  <slot name="footer-left" />
91
92
  </div>
92
93
 
93
94
  <div v-if="hasSlotContent($slots['footer-right'])" v-bind="footerRightAttrs">
94
- <!-- @slot Use it to add something to the right part of the footer. -->
95
+ <!-- @slot Use it to add something to the right side of the footer. -->
95
96
  <slot name="footer-right" />
96
97
  </div>
97
98
  </div>
@@ -123,7 +124,7 @@ const wrapperRef = ref(null);
123
124
 
124
125
  const props = defineProps({
125
126
  /**
126
- * Change modal state (hidden / shown).
127
+ * Set modal state (hidden / shown).
127
128
  */
128
129
  modelValue: {
129
130
  type: Boolean,
@@ -131,7 +132,7 @@ const props = defineProps({
131
132
  },
132
133
 
133
134
  /**
134
- * Set modal title.
135
+ * Modal title.
135
136
  */
136
137
  title: {
137
138
  type: String,
@@ -139,7 +140,7 @@ const props = defineProps({
139
140
  },
140
141
 
141
142
  /**
142
- * Sets modal description.
143
+ * Modal description.
143
144
  */
144
145
  description: {
145
146
  type: String,
@@ -147,44 +148,44 @@ const props = defineProps({
147
148
  },
148
149
 
149
150
  /**
150
- * Set back link route.
151
+ * Modal size (width).
152
+ * @values xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl
151
153
  */
152
- backRoute: {
153
- type: Object,
154
- default: () => ({}),
154
+ size: {
155
+ type: String,
156
+ default: getDefault(defaultConfig, UModal).size,
155
157
  },
156
158
 
157
159
  /**
158
- * Set width for modal.
159
- * @values xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl
160
+ * Back link route.
160
161
  */
161
- width: {
162
- type: String,
163
- default: getDefault(defaultConfig, UModal).width,
162
+ backRoute: {
163
+ type: Object,
164
+ default: () => ({}),
164
165
  },
165
166
 
166
167
  /**
167
- * Allow closing modal by clicking on overlay.
168
+ * Allow closing modal by clicking on close cross.
168
169
  */
169
- clickToClose: {
170
+ closeOnCross: {
170
171
  type: Boolean,
171
- default: getDefault(defaultConfig, UModal).clickToClose,
172
+ default: getDefault(defaultConfig, UModal).closeOnCross,
172
173
  },
173
174
 
174
175
  /**
175
- * Allow closing modal by clicking on close icon.
176
+ * Allow closing modal by clicking on overlay.
176
177
  */
177
- closeButton: {
178
+ closeOnOverlay: {
178
179
  type: Boolean,
179
- default: getDefault(defaultConfig, UModal).closeButton,
180
+ default: getDefault(defaultConfig, UModal).closeOnOverlay,
180
181
  },
181
182
 
182
183
  /**
183
- * Allow closing modal by pressing escape (esc) key.
184
+ * Allow closing modal by pressing escape (esc) on the keyboard.
184
185
  */
185
- escToClose: {
186
+ closeOnEsc: {
186
187
  type: Boolean,
187
- default: getDefault(defaultConfig, UModal).escToClose,
188
+ default: getDefault(defaultConfig, UModal).closeOnEsc,
188
189
  },
189
190
 
190
191
  /**
@@ -204,19 +205,19 @@ const props = defineProps({
204
205
  },
205
206
 
206
207
  /**
207
- * Reverse left and right footer blocks (mobile version only).
208
+ * Attach small modal to the bottom of the screen (mobile version only).
208
209
  */
209
- mobileFooterReverse: {
210
+ mobileStickBottom: {
210
211
  type: Boolean,
211
- default: getDefault(defaultConfig, UModal).mobileFooterReverse,
212
+ default: getDefault(defaultConfig, UModal).mobileStickBottom,
212
213
  },
213
214
 
214
215
  /**
215
- * Attach small modal to the bottom of the screen (mobile version only).
216
+ * Unique element id.
216
217
  */
217
- mobileBottomAlign: {
218
- type: Boolean,
219
- default: getDefault(defaultConfig, UModal).mobileBottomAlign,
218
+ id: {
219
+ type: String,
220
+ default: "",
220
221
  },
221
222
 
222
223
  /**
@@ -227,14 +228,6 @@ const props = defineProps({
227
228
  default: () => ({}),
228
229
  },
229
230
 
230
- /**
231
- * Unique element id.
232
- */
233
- id: {
234
- type: String,
235
- default: "",
236
- },
237
-
238
231
  /**
239
232
  * Set data-test attribute for automated testing.
240
233
  */
@@ -325,15 +318,15 @@ function onClickBackLink() {
325
318
  }
326
319
 
327
320
  function onClickOutside() {
328
- props.clickToClose && closeModal();
321
+ props.closeOnOverlay && closeModal();
329
322
  }
330
323
 
331
324
  function onKeydownEsc() {
332
- props.escToClose && closeModal();
325
+ props.closeOnEsc && closeModal();
333
326
  }
334
327
 
335
328
  function onClickCloseModal() {
336
- props.closeButton && closeModal();
329
+ props.closeOnCross && closeModal();
337
330
  }
338
331
 
339
332
  function closeModal() {
@@ -24,20 +24,19 @@ export default /*tw*/ {
24
24
  backLink: "{ULink} flex items-center gap-0.5",
25
25
  backLinkIcon: "{UIcon}",
26
26
  title: "{UHeader}",
27
- description: "mt-1.5 text-base font-normal text-gray-500",
27
+ description: "mt-1.5 text-sm font-normal text-gray-500",
28
28
  headerRight: "",
29
29
  closeIcon: "{UIcon}",
30
- body: "space-y-4 px-4 md:px-8",
30
+ body: "space-y-4 px-4 md:px-8 text-sm",
31
31
  divider: "{UDivider}",
32
32
  dividerSpacing: "{UDivider}",
33
33
  footer: "flex justify-between px-4 md:px-8 py-8 max-md:flex-col max-md:gap-4",
34
34
  footerLeft: "flex flex-col md:flex-row space-y-4 md:space-x-4 md:space-y-0 w-full",
35
35
  footerRight: "flex flex-col md:flex-row space-y-4 md:space-x-4 md:space-y-0 w-full justify-end",
36
- footerMobileReverse: "flex flex-col-reverse space-y-reverse group/reversed-footer",
37
36
  modal: {
38
37
  base: "mx-auto rounded-2xl bg-white",
39
38
  variants: {
40
- width: {
39
+ size: {
41
40
  xs: "md:w-[25rem]",
42
41
  sm: "md:w-[31.25rem]",
43
42
  md: "md:w-[37.5rem]",
@@ -54,14 +53,13 @@ export default /*tw*/ {
54
53
  },
55
54
  },
56
55
  defaults: {
57
- width: "sm",
56
+ size: "sm",
58
57
  inner: false,
59
- closeButton: true,
60
- escToClose: true,
61
- clickToClose: true,
62
58
  noDivider: false,
63
- mobileBottomAlign: false,
64
- mobileFooterReverse: false,
59
+ closeOnEsc: true,
60
+ closeOnCross: true,
61
+ closeOnOverlay: true,
62
+ mobileStickBottom: false,
65
63
  /* icons */
66
64
  backIcon: "arrow_back",
67
65
  closeIcon: "close",
@@ -66,7 +66,7 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
66
66
  components: { UModal, UButton, URow, UInput, UTextarea },
67
67
  setup() {
68
68
  function onClick(value) {
69
- args.width = value;
69
+ args.size = value;
70
70
  args.modelValue = true;
71
71
  }
72
72
 
@@ -98,7 +98,7 @@ export const Default = DefaultTemplate.bind({});
98
98
  Default.args = {};
99
99
 
100
100
  export const Sizes = EnumVariantTemplate.bind({});
101
- Sizes.args = { enum: "width", text: "" };
101
+ Sizes.args = { enum: "size" };
102
102
 
103
103
  export const BackRoute = DefaultTemplate.bind({});
104
104
  BackRoute.args = { backRoute: { title: "route title" } };
@@ -112,37 +112,31 @@ SlotDefault.args = {
112
112
  `,
113
113
  };
114
114
 
115
- export const SlotHeaderLeftBefore = DefaultTemplate.bind({});
116
- SlotHeaderLeftBefore.args = {
115
+ export const SlotBeforeTitle = DefaultTemplate.bind({});
116
+ SlotBeforeTitle.args = {
117
117
  slotTemplate: `
118
- <template #header-left-before>
119
- <UIcon
120
- name="star"
121
- color="gray"
122
- />
118
+ <template #before-title>
119
+ <UIcon name="star" color="gray" />
123
120
  </template>
124
121
  ${defaultTemplate}
125
122
  `,
126
123
  };
127
124
 
128
- export const SlotHeaderLeft = DefaultTemplate.bind({});
129
- SlotHeaderLeft.args = {
125
+ export const SlotAfterTitle = DefaultTemplate.bind({});
126
+ SlotAfterTitle.args = {
130
127
  slotTemplate: `
131
- <template #header-left>
132
- <UHeader size="lg" label="Large title" />
128
+ <template #after-title>
129
+ <UIcon name="star" color="gray" />
133
130
  </template>
134
131
  ${defaultTemplate}
135
132
  `,
136
133
  };
137
134
 
138
- export const SlotHeaderLeftAfter = DefaultTemplate.bind({});
139
- SlotHeaderLeftAfter.args = {
135
+ export const SlotHeaderLeft = DefaultTemplate.bind({});
136
+ SlotHeaderLeft.args = {
140
137
  slotTemplate: `
141
- <template #header-left-after>
142
- <UIcon
143
- name="star"
144
- color="gray"
145
- />
138
+ <template #header-left>
139
+ <UHeader size="lg" label="Large title" />
146
140
  </template>
147
141
  ${defaultTemplate}
148
142
  `,
@@ -1,29 +1,11 @@
1
- import { computed } from "vue";
2
1
  import useUI from "../composables/useUI.js";
3
2
 
4
3
  import defaultConfig from "./config.js";
5
4
 
6
- import useBreakpoint from "../composables/useBreakpoint.js";
7
-
8
5
  export default function useAttrs(props) {
9
- const { config, getKeysAttrs, hasSlotContent, getExtendingKeysClasses } = useUI(
10
- defaultConfig,
11
- () => props.config,
12
- );
13
- const { isMobileBreakpoint } = useBreakpoint();
14
-
15
- const extendingKeys = ["footerMobileReverse"];
16
- const extendingKeysClasses = getExtendingKeysClasses(extendingKeys);
6
+ const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
17
7
 
18
- const keysAttrs = getKeysAttrs({}, extendingKeys, {
19
- footer: {
20
- extend: computed(() => [
21
- props.mobileFooterReverse &&
22
- isMobileBreakpoint.value &&
23
- extendingKeysClasses.footerMobileReverse.value,
24
- ]),
25
- },
26
- });
8
+ const keysAttrs = getKeysAttrs();
27
9
 
28
10
  return {
29
11
  config,
@@ -1,34 +1,53 @@
1
1
  <template>
2
2
  <UModal
3
+ :id="id"
3
4
  v-model="isShownModal"
4
- :width="width"
5
+ :size="size"
5
6
  :title="title"
7
+ :description="description"
8
+ :inner="inner"
9
+ :close-on-esc="closeOnEsc"
10
+ :close-on-cross="closeOnCross"
11
+ :close-on-overlay="closeOnOverlay"
12
+ :mobile-stick-bottom="mobileStickBottom"
6
13
  no-divider
7
14
  mobile-bottom-align
8
15
  :data-test="dataTest"
9
- v-bind="modalAttrs"
16
+ v-bind="confirmModalAttrs"
10
17
  >
11
- <template #header-left-before>
12
- <slot name="header-left-before" />
13
- </template>
14
-
15
18
  <template #header-left>
19
+ <!-- @slot Use it to add something to the left side of the header. -->
16
20
  <slot name="header-left" />
17
21
  </template>
18
22
 
19
- <template #header-left-after>
20
- <slot name="header-left-after" />
23
+ <template #before-title>
24
+ <!-- @slot Use it to add something before the header title. -->
25
+ <slot name="before-title" />
26
+ </template>
27
+
28
+ <template #after-title>
29
+ <!-- @slot Use it to add something after the header title. -->
30
+ <slot name="after-title" />
21
31
  </template>
22
32
 
23
33
  <template #header-right>
34
+ <!-- @slot Use it to add something to the right side of the header. -->
24
35
  <slot name="header-right" />
25
36
  </template>
26
37
 
27
- <template #default>
28
- <slot />
38
+ <template #close-button="{ iconName }">
39
+ <!--
40
+ @slot Use it to add something instead of the close button.
41
+ @binding {string} icon-name
42
+ -->
43
+ <slot name="close-button" :icon-name="iconName" />
29
44
  </template>
30
45
 
46
+ <!-- @slot Use it to add something into the modal body. -->
47
+ <slot />
48
+
31
49
  <template #footer-left>
50
+ <!-- @slot Use it to add something to the left side of the footer. -->
32
51
  <slot v-if="hasSlotContent($slots['footer-left'])" name="footer-left" />
33
52
 
34
53
  <div v-else v-bind="footerLeftFallbackAttrs">
@@ -36,25 +55,25 @@
36
55
  :label="confirmLabel || currentLocale.confirm"
37
56
  :color="confirmColor"
38
57
  :disabled="confirmDisabled"
39
- :data-test="`${dataTest}-accept`"
40
58
  v-bind="confirmButtonAttrs"
59
+ :data-test="`${dataTest}-confirm`"
41
60
  @click="emitConfirmAction"
42
61
  />
43
62
 
44
63
  <UButton
45
- v-if="cancelButton"
64
+ v-if="!cancelHidden"
46
65
  :label="currentLocale.cancel"
47
- variant="thirdary"
66
+ variant="secondary"
48
67
  color="gray"
49
- filled
50
- :data-test="`${dataTest}-close`"
51
68
  v-bind="cancelButtonAttrs"
69
+ :data-test="`${dataTest}-close`"
52
70
  @click="onCloseModal"
53
71
  />
54
72
  </div>
55
73
  </template>
56
74
 
57
75
  <template #footer-right>
76
+ <!-- @slot Use it to add something to the right side of the footer. -->
58
77
  <slot name="footer-right" />
59
78
  </template>
60
79
  </UModal>
@@ -78,7 +97,7 @@ defineOptions({ inheritAttrs: false });
78
97
 
79
98
  const props = defineProps({
80
99
  /**
81
- * Change modal state (shown / hidden).
100
+ * Set modal state (hidden / shown).
82
101
  */
83
102
  modelValue: {
84
103
  type: Boolean,
@@ -93,6 +112,14 @@ const props = defineProps({
93
112
  default: "",
94
113
  },
95
114
 
115
+ /**
116
+ * Modal description.
117
+ */
118
+ description: {
119
+ type: String,
120
+ default: "",
121
+ },
122
+
96
123
  /**
97
124
  * Confirm button label.
98
125
  */
@@ -119,20 +146,68 @@ const props = defineProps({
119
146
  },
120
147
 
121
148
  /**
122
- * Show cancel button.
149
+ * Hide cancel button.
123
150
  */
124
- cancelButton: {
151
+ cancelHidden: {
125
152
  type: Boolean,
126
- default: getDefault(defaultConfig, UModalConfirm).cancelButton,
153
+ default: getDefault(defaultConfig, UModalConfirm).cancelHidden,
127
154
  },
128
155
 
129
156
  /**
130
- * Modal width.
157
+ * Modal size (width).
131
158
  * @values xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl
132
159
  */
133
- width: {
160
+ size: {
161
+ type: String,
162
+ default: getDefault(defaultConfig, UModalConfirm).size,
163
+ },
164
+
165
+ /**
166
+ * Allow closing modal by clicking on close cross.
167
+ */
168
+ closeOnCross: {
169
+ type: Boolean,
170
+ default: getDefault(defaultConfig, UModalConfirm).closeOnCross,
171
+ },
172
+
173
+ /**
174
+ * Allow closing modal by clicking on overlay.
175
+ */
176
+ closeOnOverlay: {
177
+ type: Boolean,
178
+ default: getDefault(defaultConfig, UModalConfirm).closeOnOverlay,
179
+ },
180
+
181
+ /**
182
+ * Allow closing modal by pressing escape (esc) on the keyboard.
183
+ */
184
+ closeOnEsc: {
185
+ type: Boolean,
186
+ default: getDefault(defaultConfig, UModalConfirm).closeOnEsc,
187
+ },
188
+
189
+ /**
190
+ * Add extra top margin for modal inside another modal.
191
+ */
192
+ inner: {
193
+ type: Boolean,
194
+ default: getDefault(defaultConfig, UModalConfirm).inner,
195
+ },
196
+
197
+ /**
198
+ * Attach small modal to the bottom of the screen (mobile version only).
199
+ */
200
+ mobileStickBottom: {
201
+ type: Boolean,
202
+ default: getDefault(defaultConfig, UModalConfirm).mobileStickBottom,
203
+ },
204
+
205
+ /**
206
+ * Unique element id.
207
+ */
208
+ id: {
134
209
  type: String,
135
- default: getDefault(defaultConfig, UModalConfirm).width,
210
+ default: "",
136
211
  },
137
212
 
138
213
  /**
@@ -175,7 +250,7 @@ const { tm } = useLocale();
175
250
  const {
176
251
  hasSlotContent,
177
252
  footerLeftFallbackAttrs,
178
- modalAttrs,
253
+ confirmModalAttrs,
179
254
  confirmButtonAttrs,
180
255
  cancelButtonAttrs,
181
256
  } = useAttrs(props);
@@ -1,5 +1,5 @@
1
1
  export default /*tw*/ {
2
- modal: "{UModal}",
2
+ confirmModal: "{UModal}",
3
3
  footerLeftFallback: "flex space-x-4",
4
4
  confirmButton: "{UButton} w-full",
5
5
  cancelButton: "{UButton} w-full",
@@ -8,9 +8,15 @@ export default /*tw*/ {
8
8
  cancel: "Cancel",
9
9
  },
10
10
  defaults: {
11
- width: "sm",
11
+ size: "sm",
12
12
  confirmColor: "brand",
13
+ inner: false,
14
+ noDivider: false,
15
+ closeOnEsc: true,
16
+ closeOnCross: true,
17
+ closeOnOverlay: true,
18
+ mobileStickBottom: false,
13
19
  confirmDisabled: false,
14
- cancelButton: true,
20
+ cancelHidden: false,
15
21
  },
16
22
  };
@@ -14,7 +14,7 @@ export default {
14
14
  title: "Containers / Modal Confirm",
15
15
  component: UModalConfirm,
16
16
  args: {
17
- title: "Modal Confirm title",
17
+ title: "Complete the transfer?",
18
18
  confirmLabel: "Confirm",
19
19
  modelValue: false,
20
20
  },
@@ -30,7 +30,10 @@ export default {
30
30
  },
31
31
  };
32
32
 
33
- const defaultTemplate = "Confirm the action?";
33
+ const defaultTemplate = `
34
+ It looks like you going to complete the transaction before the process will finished.
35
+ All unsaved data will be lost.
36
+ `;
34
37
 
35
38
  const DefaultTemplate = (args) => ({
36
39
  components: { UModalConfirm, UButton, UHeader, UIcon },
@@ -93,48 +96,42 @@ export const Default = DefaultTemplate.bind({});
93
96
  Default.args = {};
94
97
 
95
98
  export const WithoutCancelButton = DefaultTemplate.bind({});
96
- WithoutCancelButton.args = { cancelButton: false };
99
+ WithoutCancelButton.args = { cancelHidden: false };
97
100
 
98
101
  export const DisableAcceptButton = DefaultTemplate.bind({});
99
102
  DisableAcceptButton.args = { confirmDisabled: true };
100
103
 
101
104
  export const Sizes = EnumVariantTemplate.bind({});
102
- Sizes.args = { enum: "width" };
105
+ Sizes.args = { enum: "size" };
103
106
 
104
107
  export const Color = EnumVariantTemplate.bind({});
105
108
  Color.args = { enum: "confirmColor" };
106
109
 
107
- export const SlotHeaderLeftBefore = DefaultTemplate.bind({});
108
- SlotHeaderLeftBefore.args = {
110
+ export const SlotBeforeTitle = DefaultTemplate.bind({});
111
+ SlotBeforeTitle.args = {
109
112
  slotTemplate: `
110
- <template #header-left-before>
111
- <UIcon
112
- name="star"
113
- color="gray"
114
- />
113
+ <template #before-title>
114
+ <UIcon name="star" color="gray" />
115
115
  </template>
116
116
  ${defaultTemplate}
117
117
  `,
118
118
  };
119
119
 
120
- export const SlotHeaderLeft = DefaultTemplate.bind({});
121
- SlotHeaderLeft.args = {
120
+ export const SlotAfterTitle = DefaultTemplate.bind({});
121
+ SlotAfterTitle.args = {
122
122
  slotTemplate: `
123
- <template #header-left>
124
- <UHeader size="lg" label="Large title" />
123
+ <template #after-title>
124
+ <UIcon name="star" color="gray" />
125
125
  </template>
126
126
  ${defaultTemplate}
127
127
  `,
128
128
  };
129
129
 
130
- export const SlotHeaderLeftAfter = DefaultTemplate.bind({});
131
- SlotHeaderLeftAfter.args = {
130
+ export const SlotHeaderLeft = DefaultTemplate.bind({});
131
+ SlotHeaderLeft.args = {
132
132
  slotTemplate: `
133
- <template #header-left-after>
134
- <UIcon
135
- name="star"
136
- color="gray"
137
- />
133
+ <template #header-left>
134
+ <UHeader size="lg" label="Large title" />
138
135
  </template>
139
136
  ${defaultTemplate}
140
137
  `,
@@ -1,6 +1,6 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: {
3
- base: "flex gap-2 w-auto",
3
+ base: "flex gap-2 w-full",
4
4
  variants: {
5
5
  align: {
6
6
  top: "flex-col",
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.395",
4
+ "version": "0.0.397",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -63,9 +63,9 @@
63
63
  "description": "",
64
64
  "attributes": [
65
65
  {
66
- "name": "label",
66
+ "name": "title",
67
67
  "required": true,
68
- "description": "Accordion label.",
68
+ "description": "Accordion title.",
69
69
  "value": {
70
70
  "kind": "expression",
71
71
  "type": "string"
@@ -4035,7 +4035,7 @@
4035
4035
  "attributes": [
4036
4036
  {
4037
4037
  "name": "title",
4038
- "description": "Header title.",
4038
+ "description": "Group title.",
4039
4039
  "value": {
4040
4040
  "kind": "expression",
4041
4041
  "type": "string"
@@ -4090,8 +4090,8 @@
4090
4090
  ],
4091
4091
  "slots": [
4092
4092
  {
4093
- "name": "left",
4094
- "description": "Use it to add something left side of the header."
4093
+ "name": "header-left",
4094
+ "description": "Use it to add something on the left side of the header."
4095
4095
  },
4096
4096
  {
4097
4097
  "name": "before-title",
@@ -4102,8 +4102,8 @@
4102
4102
  "description": "Use it to add something after the title."
4103
4103
  },
4104
4104
  {
4105
- "name": "right",
4106
- "description": "Use it to add something right side of the header."
4105
+ "name": "header-right",
4106
+ "description": "Use it to add something on the right side of the header."
4107
4107
  },
4108
4108
  {
4109
4109
  "name": "default",
@@ -5923,7 +5923,7 @@
5923
5923
  "attributes": [
5924
5924
  {
5925
5925
  "name": "modelValue",
5926
- "description": "Change modal state (hidden / shown).",
5926
+ "description": "Set modal state (hidden / shown).",
5927
5927
  "value": {
5928
5928
  "kind": "expression",
5929
5929
  "type": "boolean"
@@ -5932,7 +5932,7 @@
5932
5932
  },
5933
5933
  {
5934
5934
  "name": "title",
5935
- "description": "Set modal title.",
5935
+ "description": "Modal title.",
5936
5936
  "value": {
5937
5937
  "kind": "expression",
5938
5938
  "type": "string"
@@ -5941,7 +5941,7 @@
5941
5941
  },
5942
5942
  {
5943
5943
  "name": "description",
5944
- "description": "Sets modal description.",
5944
+ "description": "Modal description.",
5945
5945
  "value": {
5946
5946
  "kind": "expression",
5947
5947
  "type": "string"
@@ -5949,26 +5949,26 @@
5949
5949
  "default": "\"\""
5950
5950
  },
5951
5951
  {
5952
- "name": "backRoute",
5953
- "description": "Set back link route.",
5952
+ "name": "size",
5953
+ "description": "Modal size (width).",
5954
5954
  "value": {
5955
5955
  "kind": "expression",
5956
- "type": "object"
5956
+ "type": "'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl'"
5957
5957
  },
5958
- "default": "{}"
5958
+ "default": "sm"
5959
5959
  },
5960
5960
  {
5961
- "name": "width",
5962
- "description": "Set width for modal.",
5961
+ "name": "backRoute",
5962
+ "description": "Back link route.",
5963
5963
  "value": {
5964
5964
  "kind": "expression",
5965
- "type": "'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl'"
5965
+ "type": "object"
5966
5966
  },
5967
- "default": "sm"
5967
+ "default": "{}"
5968
5968
  },
5969
5969
  {
5970
- "name": "clickToClose",
5971
- "description": "Allow closing modal by clicking on overlay.",
5970
+ "name": "closeOnCross",
5971
+ "description": "Allow closing modal by clicking on close cross.",
5972
5972
  "value": {
5973
5973
  "kind": "expression",
5974
5974
  "type": "boolean"
@@ -5976,8 +5976,8 @@
5976
5976
  "default": "true"
5977
5977
  },
5978
5978
  {
5979
- "name": "closeButton",
5980
- "description": "Allow closing modal by clicking on close icon.",
5979
+ "name": "closeOnOverlay",
5980
+ "description": "Allow closing modal by clicking on overlay.",
5981
5981
  "value": {
5982
5982
  "kind": "expression",
5983
5983
  "type": "boolean"
@@ -5985,8 +5985,8 @@
5985
5985
  "default": "true"
5986
5986
  },
5987
5987
  {
5988
- "name": "escToClose",
5989
- "description": "Allow closing modal by pressing escape (esc) key.",
5988
+ "name": "closeOnEsc",
5989
+ "description": "Allow closing modal by pressing escape (esc) on the keyboard.",
5990
5990
  "value": {
5991
5991
  "kind": "expression",
5992
5992
  "type": "boolean"
@@ -6012,8 +6012,8 @@
6012
6012
  "default": "false"
6013
6013
  },
6014
6014
  {
6015
- "name": "mobileFooterReverse",
6016
- "description": "Reverse left and right footer blocks (mobile version only).",
6015
+ "name": "mobileStickBottom",
6016
+ "description": "Attach small modal to the bottom of the screen (mobile version only).",
6017
6017
  "value": {
6018
6018
  "kind": "expression",
6019
6019
  "type": "boolean"
@@ -6021,13 +6021,13 @@
6021
6021
  "default": "false"
6022
6022
  },
6023
6023
  {
6024
- "name": "mobileBottomAlign",
6025
- "description": "Attach small modal to the bottom of the screen (mobile version only).",
6024
+ "name": "id",
6025
+ "description": "Unique element id.",
6026
6026
  "value": {
6027
6027
  "kind": "expression",
6028
- "type": "boolean"
6028
+ "type": "string"
6029
6029
  },
6030
- "default": "false"
6030
+ "default": "\"\""
6031
6031
  },
6032
6032
  {
6033
6033
  "name": "config",
@@ -6038,15 +6038,6 @@
6038
6038
  },
6039
6039
  "default": "{}"
6040
6040
  },
6041
- {
6042
- "name": "id",
6043
- "description": "Unique element id.",
6044
- "value": {
6045
- "kind": "expression",
6046
- "type": "string"
6047
- },
6048
- "default": "\"\""
6049
- },
6050
6041
  {
6051
6042
  "name": "dataTest",
6052
6043
  "description": "Set data-test attribute for automated testing.",
@@ -6077,20 +6068,20 @@
6077
6068
  ],
6078
6069
  "slots": [
6079
6070
  {
6080
- "name": "header-left-before",
6081
- "description": "Use it to add something before the left part of the header."
6071
+ "name": "header-left",
6072
+ "description": "Use it to add something to the left side of the header."
6082
6073
  },
6083
6074
  {
6084
- "name": "header-left",
6085
- "description": "Use it to add something to the left part of the header.."
6075
+ "name": "before-title",
6076
+ "description": "Use it to add something before the header title."
6086
6077
  },
6087
6078
  {
6088
- "name": "header-left-after",
6089
- "description": "Use it to add something after the left part of the header."
6079
+ "name": "after-title",
6080
+ "description": "Use it to add something after the header title."
6090
6081
  },
6091
6082
  {
6092
6083
  "name": "header-right",
6093
- "description": "Use it to add something to the right part of the header."
6084
+ "description": "Use it to add something to the right side of the header."
6094
6085
  },
6095
6086
  {
6096
6087
  "name": "close-button",
@@ -6105,15 +6096,15 @@
6105
6096
  },
6106
6097
  {
6107
6098
  "name": "default",
6108
- "description": "Use it to add something to the modal body."
6099
+ "description": "Use it to add something into the modal body."
6109
6100
  },
6110
6101
  {
6111
6102
  "name": "footer-left",
6112
- "description": "Use it to add something to the left part of the footer."
6103
+ "description": "Use it to add something to the left side of the footer."
6113
6104
  },
6114
6105
  {
6115
6106
  "name": "footer-right",
6116
- "description": "Use it to add something to the right part of the footer."
6107
+ "description": "Use it to add something to the right side of the footer."
6117
6108
  }
6118
6109
  ],
6119
6110
  "source": {
@@ -6127,7 +6118,7 @@
6127
6118
  "attributes": [
6128
6119
  {
6129
6120
  "name": "modelValue",
6130
- "description": "Change modal state (shown / hidden).",
6121
+ "description": "Set modal state (hidden / shown).",
6131
6122
  "value": {
6132
6123
  "kind": "expression",
6133
6124
  "type": "boolean"
@@ -6143,6 +6134,15 @@
6143
6134
  },
6144
6135
  "default": "\"\""
6145
6136
  },
6137
+ {
6138
+ "name": "description",
6139
+ "description": "Modal description.",
6140
+ "value": {
6141
+ "kind": "expression",
6142
+ "type": "string"
6143
+ },
6144
+ "default": "\"\""
6145
+ },
6146
6146
  {
6147
6147
  "name": "confirmLabel",
6148
6148
  "description": "Confirm button label.",
@@ -6171,23 +6171,77 @@
6171
6171
  "default": "false"
6172
6172
  },
6173
6173
  {
6174
- "name": "cancelButton",
6175
- "description": "Show cancel button.",
6174
+ "name": "cancelHidden",
6175
+ "description": "Hide cancel button.",
6176
6176
  "value": {
6177
6177
  "kind": "expression",
6178
6178
  "type": "boolean"
6179
6179
  },
6180
- "default": "true"
6180
+ "default": "false"
6181
6181
  },
6182
6182
  {
6183
- "name": "width",
6184
- "description": "Modal width.",
6183
+ "name": "size",
6184
+ "description": "Modal size (width).",
6185
6185
  "value": {
6186
6186
  "kind": "expression",
6187
6187
  "type": "'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl'"
6188
6188
  },
6189
6189
  "default": "sm"
6190
6190
  },
6191
+ {
6192
+ "name": "closeOnCross",
6193
+ "description": "Allow closing modal by clicking on close cross.",
6194
+ "value": {
6195
+ "kind": "expression",
6196
+ "type": "boolean"
6197
+ },
6198
+ "default": "true"
6199
+ },
6200
+ {
6201
+ "name": "closeOnOverlay",
6202
+ "description": "Allow closing modal by clicking on overlay.",
6203
+ "value": {
6204
+ "kind": "expression",
6205
+ "type": "boolean"
6206
+ },
6207
+ "default": "true"
6208
+ },
6209
+ {
6210
+ "name": "closeOnEsc",
6211
+ "description": "Allow closing modal by pressing escape (esc) on the keyboard.",
6212
+ "value": {
6213
+ "kind": "expression",
6214
+ "type": "boolean"
6215
+ },
6216
+ "default": "true"
6217
+ },
6218
+ {
6219
+ "name": "inner",
6220
+ "description": "Add extra top margin for modal inside another modal.",
6221
+ "value": {
6222
+ "kind": "expression",
6223
+ "type": "boolean"
6224
+ },
6225
+ "default": "false"
6226
+ },
6227
+ {
6228
+ "name": "mobileStickBottom",
6229
+ "description": "Attach small modal to the bottom of the screen (mobile version only).",
6230
+ "value": {
6231
+ "kind": "expression",
6232
+ "type": "boolean"
6233
+ },
6234
+ "default": "false"
6235
+ },
6236
+ {
6237
+ "name": "id",
6238
+ "description": "Unique element id.",
6239
+ "value": {
6240
+ "kind": "expression",
6241
+ "type": "string"
6242
+ },
6243
+ "default": "\"\""
6244
+ },
6191
6245
  {
6192
6246
  "name": "config",
6193
6247
  "description": "Component config object.",
@@ -6231,25 +6285,43 @@
6231
6285
  ],
6232
6286
  "slots": [
6233
6287
  {
6234
- "name": "header-left-before"
6288
+ "name": "header-left",
6289
+ "description": "Use it to add something to the left side of the header."
6235
6290
  },
6236
6291
  {
6237
- "name": "header-left"
6292
+ "name": "before-title",
6293
+ "description": "Use it to add something before the header title."
6238
6294
  },
6239
6295
  {
6240
- "name": "header-left-after"
6296
+ "name": "after-title",
6297
+ "description": "Use it to add something after the header title."
6241
6298
  },
6242
6299
  {
6243
- "name": "header-right"
6300
+ "name": "header-right",
6301
+ "description": "Use it to add something to the right side of the header."
6244
6302
  },
6245
6303
  {
6246
- "name": "default"
6304
+ "name": "close-button",
6305
+ "scoped": true,
6306
+ "description": "Use it to add something instead of the close button.",
6307
+ "bindings": [
6308
+ {
6309
+ "type": "string",
6310
+ "name": "icon-name"
6311
+ }
6312
+ ]
6313
+ },
6314
+ {
6315
+ "name": "default",
6316
+ "description": "Use it to add something into the modal body."
6247
6317
  },
6248
6318
  {
6249
- "name": "footer-left"
6319
+ "name": "footer-left",
6320
+ "description": "Use it to add something to the left side of the footer."
6250
6321
  },
6251
6322
  {
6252
- "name": "footer-right"
6323
+ "name": "footer-right",
6324
+ "description": "Use it to add something to the right side of the footer."
6253
6325
  }
6254
6326
  ],
6255
6327
  "source": {