@ulu/frontend-vue 0.1.1-beta.17 → 0.1.1-beta.18

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.
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <dl :class="classes.list">
2
+ <dl class="definition-list" :class="[resolvedModifiers, classes.list]">
3
3
  <div
4
4
  v-for="(item, index) in items"
5
5
  :key="index"
@@ -10,6 +10,7 @@
10
10
  {{ item.term }}
11
11
  </slot>
12
12
  </dt>
13
+
13
14
  <dd :class="classes.description">
14
15
  <slot name="description" :item="item" :index="index">
15
16
  {{ item.description }}
@@ -20,7 +21,10 @@
20
21
  </template>
21
22
 
22
23
  <script setup>
23
- defineProps({
24
+ import { computed } from 'vue';
25
+ import { useModifiers } from "../../composables/useModifiers.js";
26
+
27
+ const props = defineProps({
24
28
  /**
25
29
  * Array of term, and description (props in object)
26
30
  * - Can use slots also
@@ -32,6 +36,54 @@
32
36
  classes: {
33
37
  type: Object,
34
38
  default: () => ({})
35
- }
39
+ },
40
+ /**
41
+ * Class modifiers (ie. 'transparent', 'secondary', etc)
42
+ */
43
+ modifiers: [String, Array],
44
+ /**
45
+ * Displays only the definition descriptions on the same line.
46
+ */
47
+ inline: Boolean,
48
+ /**
49
+ * Displays both the definition term and its descriptions on the same line.
50
+ */
51
+ inlineAll: Boolean,
52
+ /**
53
+ * Displays the list in a two-column grid on larger screens.
54
+ */
55
+ table: Boolean,
56
+ /**
57
+ * Adds a rule between each item.
58
+ */
59
+ separated: Boolean,
60
+ /**
61
+ * Adds a rule to the top of the first item.
62
+ */
63
+ separatedFirst: Boolean,
64
+ /**
65
+ * Adds a rule to the bottom of the last item.
66
+ */
67
+ separatedLast: Boolean,
68
+ /**
69
+ * Reduces the margin between items.
70
+ */
71
+ compact: Boolean,
72
+ });
73
+
74
+ const internalModifiers = computed(() => ({
75
+ "inline" : props.inline,
76
+ "inline-all" : props.inlineAll,
77
+ "table" : props.table,
78
+ "separated" : props.separated,
79
+ "separated-first" : props.separatedFirst,
80
+ "separated-last" : props.separatedLast,
81
+ "compact" : props.compact,
82
+ }));
83
+
84
+ const { resolvedModifiers } = useModifiers({
85
+ props,
86
+ internal: internalModifiers,
87
+ baseClass: "definition-list"
36
88
  });
37
89
  </script>
@@ -56,8 +56,8 @@
56
56
  });
57
57
 
58
58
  const internalModifiers = computed(() => ({
59
- 'hanging' : props.hanging,
60
- 'compact' : props.compact,
59
+ "hanging" : props.hanging,
60
+ "compact" : props.compact,
61
61
  }));
62
62
 
63
63
  const { resolvedModifiers } = useModifiers({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulu/frontend-vue",
3
- "version": "0.1.1-beta.17",
3
+ "version": "0.1.1-beta.18",
4
4
  "description": "A modular and tree-shakeable Vue 3 component library for the Ulu frontend",
5
5
  "type": "module",
6
6
  "files": [
@@ -63,7 +63,7 @@
63
63
  "peerDependencies": {
64
64
  "@formkit/auto-animate": "^0.9.0",
65
65
  "@headlessui/vue": "^1.7.23",
66
- "@ulu/frontend": "^0.1.0-beta.114",
66
+ "@ulu/frontend": "^0.1.0-beta.117",
67
67
  "@unhead/vue": "^2.0.11",
68
68
  "vue": "^3.5.17",
69
69
  "vue-router": "^4.5.1"
@@ -87,7 +87,7 @@
87
87
  "@storybook/addon-essentials": "^9.0.0-alpha.12",
88
88
  "@storybook/addon-links": "^9.1.1",
89
89
  "@storybook/vue3-vite": "^9.1.1",
90
- "@ulu/frontend": "^0.1.0-beta.114",
90
+ "@ulu/frontend": "^0.1.0-beta.117",
91
91
  "@unhead/vue": "^2.0.11",
92
92
  "@vitejs/plugin-vue": "^6.0.0",
93
93
  "ollama": "^0.5.16",
@@ -4,8 +4,16 @@ type __VLS_WithSlots<T, S> = T & (new () => {
4
4
  $slots: S;
5
5
  });
6
6
  declare const __VLS_component: import("vue").DefineComponent<{}, {
7
- $props: Partial<typeof __VLS_props>;
7
+ $props: Partial<typeof props>;
8
8
  classes: Record<string, any>;
9
+ table: boolean;
10
+ inline: boolean;
11
+ compact: boolean;
12
+ inlineAll: boolean;
13
+ separated: boolean;
14
+ separatedFirst: boolean;
15
+ separatedLast: boolean;
16
+ modifiers?: string | unknown[] | undefined;
9
17
  items?: unknown[] | undefined;
10
18
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
11
19
  type __VLS_Slots = {
@@ -19,8 +27,16 @@ type __VLS_Slots = {
19
27
  index: number;
20
28
  }) => any) | undefined;
21
29
  };
22
- declare const __VLS_props: {
30
+ declare const props: {
23
31
  readonly classes: Record<string, any>;
32
+ readonly table: boolean;
33
+ readonly inline: boolean;
34
+ readonly compact: boolean;
35
+ readonly inlineAll: boolean;
36
+ readonly separated: boolean;
37
+ readonly separatedFirst: boolean;
38
+ readonly separatedLast: boolean;
39
+ readonly modifiers?: string | unknown[] | undefined;
24
40
  readonly items?: unknown[] | undefined;
25
41
  };
26
42
  //# sourceMappingURL=UluDefinitionList.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UluDefinitionList.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/elements/UluDefinitionList.vue"],"names":[],"mappings":"wBA4HqB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;;qBAEpD,CAAC,EAAE,CAAC;;;AARzB;YAGmB,OAAO,CAAC,OAAO,WAAW,CAAC;;;2OAE3C;;;;;;;;;;;;AArFD;;;EAaG"}
1
+ {"version":3,"file":"UluDefinitionList.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/elements/UluDefinitionList.vue"],"names":[],"mappings":"wBAsOqB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;;qBAEpD,CAAC,EAAE,CAAC;;;AARzB;YAGmB,OAAO,CAAC,OAAO,KAAK,CAAC;;;;;;;;;;;2OAErC;;;;;;;;;;;;AAxID;;;;;;;;;;;EA6CG"}