vueless 0.0.390 → 0.0.392

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.390",
3
+ "version": "0.0.392",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -61,7 +61,7 @@ export default /*tw*/ {
61
61
  },
62
62
  },
63
63
  },
64
- withChild: "flex items-center no-underline hover:no-underline focus-within:ring-0 focus-within:ring-offset-0",
64
+ linkWithChild: "flex items-center no-underline hover:no-underline focus-within:ring-0 focus-within:ring-offset-0",
65
65
  defaults: {
66
66
  color: "brand",
67
67
  type: "link",
@@ -7,23 +7,24 @@ export default function useAttrs(props, { isActive, isExactActive }) {
7
7
  const { config, getKeysAttrs, hasSlotContent, getExtendingKeysClasses } = useUI(
8
8
  defaultConfig,
9
9
  () => props.config,
10
+ "link",
10
11
  );
11
12
  const slots = useSlots();
12
13
 
13
- const extendingKeys = ["withChild"];
14
+ const extendingKeys = ["linkWithChild"];
14
15
  const extendingKeysClasses = getExtendingKeysClasses(extendingKeys);
15
16
 
16
17
  const keysAttrs = getKeysAttrs({}, extendingKeys, {
17
18
  wrapper: {
18
19
  extend: computed(() => [
19
- hasSlotContent(slots["default"]) && extendingKeysClasses.withChild.value,
20
+ hasSlotContent(slots["default"]) && extendingKeysClasses.linkWithChild.value,
20
21
  isActive.value && props.wrapperActiveClass,
21
22
  isExactActive.value && props.wrapperExactActiveClass,
22
23
  ]),
23
24
  },
24
25
  link: {
25
26
  extend: computed(() => [
26
- hasSlotContent(slots["default"]) && extendingKeysClasses.withChild.value,
27
+ hasSlotContent(slots["default"]) && extendingKeysClasses.linkWithChild.value,
27
28
  isActive.value && props.activeClass,
28
29
  isExactActive.value && props.exactActiveClass,
29
30
  ]),
@@ -1,10 +1,11 @@
1
1
  <template>
2
2
  <div :data-test="dataTest" v-bind="wrapperAttrs" @click="onClickItem">
3
3
  <div v-bind="bodyAttrs">
4
- <div v-bind="titleAttrs">
5
- {{ title }}
4
+ <div v-bind="labelAttrs">
5
+ {{ label }}
6
6
  <!--
7
7
  @slot Use it to add something instead of the toggle icon.
8
+ @binding {string} icon-name
8
9
  @binding {string} icon-size
9
10
  @binding {boolean} opened
10
11
  -->
@@ -35,9 +36,9 @@ defineOptions({ inheritAttrs: false });
35
36
 
36
37
  const props = defineProps({
37
38
  /**
38
- * Accordion title.
39
+ * Accordion label.
39
40
  */
40
- title: {
41
+ label: {
41
42
  type: String,
42
43
  required: true,
43
44
  },
@@ -50,14 +51,6 @@ const props = defineProps({
50
51
  required: true,
51
52
  },
52
53
 
53
- /**
54
- * Unique block name.
55
- */
56
- name: {
57
- type: String,
58
- default: "",
59
- },
60
-
61
54
  /**
62
55
  * Accordion size.
63
56
  * @values sm, md, lg
@@ -87,7 +80,8 @@ const props = defineProps({
87
80
  const emit = defineEmits([
88
81
  /**
89
82
  * Triggers when the accordion item is toggled.
90
- * @property {string} name
83
+ * @property {string} elementId
84
+ * @property {boolean} isOpened
91
85
  */
92
86
  "click",
93
87
  ]);
@@ -101,7 +95,7 @@ const {
101
95
  wrapperAttrs,
102
96
  descriptionAttrs,
103
97
  bodyAttrs,
104
- titleAttrs,
98
+ labelAttrs,
105
99
  toggleIconAttrs,
106
100
  dividerAttrs,
107
101
  } = useAttrs(props, { isOpened });
@@ -123,6 +117,6 @@ const dividerSize = computed(() => {
123
117
  function onClickItem() {
124
118
  isOpened.value = !isOpened.value;
125
119
 
126
- emit("click", props.name);
120
+ emit("click", elementId, isOpened.value);
127
121
  }
128
122
  </script>
@@ -1,7 +1,7 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: "group cursor-pointer",
3
3
  body: "",
4
- title: {
4
+ label: {
5
5
  base: "flex items-center justify-between font-medium text-gray-900",
6
6
  variants: {
7
7
  size: {
@@ -21,7 +21,7 @@ export default /*tw*/ {
21
21
  },
22
22
  },
23
23
  },
24
- isOpened: "pt-2 h-full opacity-100",
24
+ descriptionShown: "pt-2 h-fit opacity-100",
25
25
  toggleIcon: "{UIcon}",
26
26
  divider: "{UDivider} group-last:hidden",
27
27
  defaults: {
@@ -14,19 +14,19 @@ export default {
14
14
  accordions: [
15
15
  {
16
16
  name: "Excellence",
17
- title: "Excellence by necessity",
17
+ label: "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
- title: "Driving innovation forward",
23
+ label: "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
- title: "Fostering collaboration",
29
+ label: "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
  },
@@ -9,12 +9,12 @@ export default function useAttrs(props, { isOpened }) {
9
9
  () => props.config,
10
10
  );
11
11
 
12
- const extendingKeys = ["isOpened"];
12
+ const extendingKeys = ["descriptionShown"];
13
13
  const extendingKeysClasses = getExtendingKeysClasses(extendingKeys);
14
14
 
15
15
  const keysAttrs = getKeysAttrs({}, extendingKeys, {
16
16
  description: {
17
- extend: computed(() => [isOpened.value && extendingKeysClasses.isOpened.value]),
17
+ extend: computed(() => [isOpened.value && extendingKeysClasses.descriptionShown.value]),
18
18
  },
19
19
  });
20
20
 
@@ -8,7 +8,7 @@
8
8
  <!-- @slot Use it to customise left side of the header. -->
9
9
  <slot name="header-left">
10
10
  <div v-bind="headerLeftFallbackAttrs">
11
- <UHeader :label="title" size="md" v-bind="titleAttrs" />
11
+ <UHeader :label="title" size="xs" v-bind="titleAttrs" />
12
12
  <div v-if="description" v-bind="descriptionAttrs" v-text="description" />
13
13
  </div>
14
14
  </slot>
@@ -21,12 +21,12 @@
21
21
  <slot name="header-right" />
22
22
  </div>
23
23
 
24
- <!-- @slot Use it to add something inside. -->
25
24
  <div v-bind="contentAttrs">
25
+ <!-- @slot Use it to add something inside. -->
26
26
  <slot />
27
27
  </div>
28
28
 
29
- <UDivider v-if="isShownFooter" no-top-padding no-bottom-padding v-bind="dividerAttrs" />
29
+ <UDivider v-if="isShownFooter" no-padding v-bind="dividerAttrs" />
30
30
 
31
31
  <div v-if="isShownFooter" v-bind="footerAttrs">
32
32
  <!-- @slot Use it to add something to the left side of the footer. -->
@@ -41,14 +41,10 @@
41
41
  <script setup>
42
42
  import { computed, useSlots } from "vue";
43
43
 
44
- import { getDefault } from "../utils/utilUI.js";
45
44
  import UHeader from "../ui.text-header/UHeader.vue";
46
45
  import UDivider from "../ui.container-divider/UDivider.vue";
47
46
 
48
- import { UCard } from "./constants.js";
49
- import defaultConfig from "./config.js";
50
47
  import useAttrs from "./useAttrs.js";
51
- import useBreakpoint from "../composables/useBreakpoint.js";
52
48
 
53
49
  defineOptions({ inheritAttrs: false });
54
50
 
@@ -71,23 +67,6 @@ const props = defineProps({
71
67
  default: "",
72
68
  },
73
69
 
74
- /**
75
- * Card padding.
76
- * @values sm, md, lg
77
- */
78
- padding: {
79
- type: String,
80
- default: getDefault(defaultConfig, UCard).padding,
81
- },
82
-
83
- /**
84
- * Reverse left and right footer blocks (in a mobile version only).
85
- */
86
- mobileFooterReverse: {
87
- type: Boolean,
88
- default: getDefault(defaultConfig, UCard).mobileFooterReverse,
89
- },
90
-
91
70
  /**
92
71
  * Component ui config object.
93
72
  */
@@ -116,8 +95,6 @@ const isShownFooter = computed(() => {
116
95
  return hasSlotContent(slots["footer-left"]) || hasSlotContent(slots["footer-right"]);
117
96
  });
118
97
 
119
- const { isMobileBreakpoint } = useBreakpoint();
120
-
121
98
  const {
122
99
  hasSlotContent,
123
100
  wrapperAttrs,
@@ -129,5 +106,5 @@ const {
129
106
  descriptionAttrs,
130
107
  contentAttrs,
131
108
  footerAttrs,
132
- } = useAttrs(props, { isMobileBreakpoint });
109
+ } = useAttrs(props);
133
110
  </script>
@@ -1,25 +1,14 @@
1
1
  export default /*tw*/ {
2
- wrapper: {
3
- base: "border rounded-dynamic border-gray-200 bg-white space-y-4 md:space-y-6 w-full",
4
- variants: {
5
- padding: {
6
- sm: "p-2 md:p-4",
7
- md: "p-4 md:p-6",
8
- lg: "p-6 md:p-8",
9
- },
10
- },
11
- },
2
+ wrapper: "p-4 md:p-5 border rounded-dynamic border-gray-200 bg-white space-y-4 w-full",
12
3
  header: "flex justify-between",
13
- headerLeft: "flex items-center space-x-4 w-full",
14
- headerLeftFallback: "flex flex-col w-full",
4
+ headerLeft: "flex items-center gap-2 w-fit",
5
+ headerLeftFallback: "flex flex-col w-fit",
15
6
  title: "{UHeader}",
16
- description: "mt-1.5 text-base font-normal text-gray-500",
17
- content: "",
7
+ description: "mt-1 text-sm font-normal text-gray-500",
8
+ content: "text-sm",
18
9
  divider: "{UDivider}",
19
10
  footer: "flex justify-between",
20
- footerMobileReverse: "flex flex-col-reverse space-y-reverse",
21
11
  defaults: {
22
- padding: "md",
23
- mobileFooterReverse: false,
12
+ //
24
13
  },
25
14
  };
@@ -1,7 +1,6 @@
1
1
  import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/utilStorybook.js";
2
2
 
3
3
  import UCard from "../../ui.container-card/UCard.vue";
4
- import URow from "../../ui.container-row/URow.vue";
5
4
  import UInput from "../../ui.form-input/UInput.vue";
6
5
  import UButton from "../../ui.button/UButton.vue";
7
6
  import UIcon from "../../ui.image-icon/UIcon.vue";
@@ -49,37 +48,12 @@ const DefaultTemplate = (args) => ({
49
48
  `,
50
49
  });
51
50
 
52
- const EnumVariantTemplate = (args, { argTypes } = {}) => ({
53
- components: { UCard, URow },
54
- setup() {
55
- return {
56
- args,
57
- options: argTypes[args.enum].options,
58
- };
59
- },
60
- template: `
61
- <URow>
62
- <UCard
63
- v-for="(option, index) in options"
64
- :key="index"
65
- v-bind="args"
66
- :[args.enum]="option"
67
- >
68
- ${defaultTemplate}
69
- </UCard>
70
- </URow>
71
- `,
72
- });
73
-
74
51
  export const Default = DefaultTemplate.bind({});
75
52
  Default.args = {};
76
53
 
77
54
  export const Description = DefaultTemplate.bind({});
78
55
  Description.args = { description: "Card description" };
79
56
 
80
- export const Padding = EnumVariantTemplate.bind({});
81
- Padding.args = { enum: "padding" };
82
-
83
57
  export const SlotHeaderLeftBefore = DefaultTemplate.bind({});
84
58
  SlotHeaderLeftBefore.args = {
85
59
  slotTemplate: `
@@ -125,7 +99,7 @@ SlotFooterLeft.args = {
125
99
  slotTemplate: `
126
100
  ${defaultTemplate}
127
101
  <template #footer-left>
128
- <UButton label="Read more" />
102
+ <UButton size="sm" label="Read more" />
129
103
  </template>
130
104
  `,
131
105
  };
@@ -135,7 +109,7 @@ SlotFooterRight.args = {
135
109
  slotTemplate: `
136
110
  ${defaultTemplate}
137
111
  <template #footer-right>
138
- <UButton label="Read more" />
112
+ <UButton size="sm" label="Read more" />
139
113
  </template>
140
114
  `,
141
115
  };
@@ -1,26 +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
- export default function useAttrs(props, { isMobileBreakpoint }) {
7
- const { config, getKeysAttrs, hasSlotContent, getExtendingKeysClasses } = useUI(
8
- defaultConfig,
9
- () => props.config,
10
- );
5
+ export default function useAttrs(props) {
6
+ const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
11
7
 
12
- const extendingKeys = ["footerMobileReverse"];
13
- const extendingKeysClasses = getExtendingKeysClasses(extendingKeys);
14
-
15
- const keysAttrs = getKeysAttrs({}, extendingKeys, {
16
- footer: {
17
- extend: computed(() => [
18
- props.mobileFooterReverse &&
19
- isMobileBreakpoint.value &&
20
- extendingKeysClasses.footerMobileReverse.value,
21
- ]),
22
- },
23
- });
8
+ const keysAttrs = getKeysAttrs();
24
9
 
25
10
  return {
26
11
  config,
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.390",
4
+ "version": "0.0.392",
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": "title",
66
+ "name": "label",
67
67
  "required": true,
68
- "description": "Accordion title.",
68
+ "description": "Accordion label.",
69
69
  "value": {
70
70
  "kind": "expression",
71
71
  "type": "string"
@@ -80,15 +80,6 @@
80
80
  "type": "string"
81
81
  }
82
82
  },
83
- {
84
- "name": "name",
85
- "description": "Unique block name.",
86
- "value": {
87
- "kind": "expression",
88
- "type": "string"
89
- },
90
- "default": "\"\""
91
- },
92
83
  {
93
84
  "name": "size",
94
85
  "description": "Accordion size.",
@@ -126,7 +117,13 @@
126
117
  "type": [
127
118
  "string"
128
119
  ],
129
- "name": "name"
120
+ "name": "elementId"
121
+ },
122
+ {
123
+ "type": [
124
+ "boolean"
125
+ ],
126
+ "name": "isOpened"
130
127
  }
131
128
  ]
132
129
  }
@@ -138,6 +135,7 @@
138
135
  "description": "Use it to add something instead of the toggle icon.",
139
136
  "bindings": [
140
137
  {
138
+ "type": "string",
141
139
  "name": "icon-name"
142
140
  },
143
141
  {
@@ -1367,24 +1365,6 @@
1367
1365
  },
1368
1366
  "default": "\"\""
1369
1367
  },
1370
- {
1371
- "name": "padding",
1372
- "description": "Card padding.",
1373
- "value": {
1374
- "kind": "expression",
1375
- "type": "'sm' | 'md' | 'lg'"
1376
- },
1377
- "default": "md"
1378
- },
1379
- {
1380
- "name": "mobileFooterReverse",
1381
- "description": "Reverse left and right footer blocks (in a mobile version only).",
1382
- "value": {
1383
- "kind": "expression",
1384
- "type": "boolean"
1385
- },
1386
- "default": "false"
1387
- },
1388
1368
  {
1389
1369
  "name": "config",
1390
1370
  "description": "Component ui config object.",
@@ -1422,7 +1402,8 @@
1422
1402
  "description": "Use it to customise right side of the header."
1423
1403
  },
1424
1404
  {
1425
- "name": "default"
1405
+ "name": "default",
1406
+ "description": "Use it to add something inside."
1426
1407
  },
1427
1408
  {
1428
1409
  "name": "footer-left",