@ulu/frontend-vue 0.2.0-beta.8 → 0.3.0

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.
Files changed (174) hide show
  1. package/dist/components/collapsible/UluAccordionGroup.vue.d.ts +2 -2
  2. package/dist/components/collapsible/UluAccordionGroup.vue.d.ts.map +1 -1
  3. package/dist/components/collapsible/UluAccordionGroup.vue.js +22 -19
  4. package/dist/components/collapsible/UluDropdown.vue.d.ts +1 -1
  5. package/dist/components/collapsible/UluDropdown.vue.d.ts.map +1 -1
  6. package/dist/components/collapsible/UluDropdown.vue.js +22 -15
  7. package/dist/components/collapsible/UluModal.vue.d.ts +43 -248
  8. package/dist/components/collapsible/UluModal.vue.d.ts.map +1 -1
  9. package/dist/components/collapsible/UluModal.vue.js +139 -191
  10. package/dist/components/collapsible/UluTabGroup.vue.d.ts +2 -0
  11. package/dist/components/collapsible/UluTabGroup.vue.d.ts.map +1 -1
  12. package/dist/components/collapsible/UluTabGroup.vue.js +23 -14
  13. package/dist/components/elements/UluAlert.vue.d.ts +29 -144
  14. package/dist/components/elements/UluAlert.vue.d.ts.map +1 -1
  15. package/dist/components/elements/UluAlert.vue.js +39 -50
  16. package/dist/components/elements/UluBadge.vue.d.ts +6 -6
  17. package/dist/components/elements/UluBadgeStack.vue.d.ts +1 -1
  18. package/dist/components/elements/UluBadgeStack.vue.d.ts.map +1 -1
  19. package/dist/components/elements/UluBadgeStack.vue.js +12 -9
  20. package/dist/components/elements/UluButton.vue.d.ts +47 -177
  21. package/dist/components/elements/UluButton.vue.d.ts.map +1 -1
  22. package/dist/components/elements/UluButton.vue.js +59 -72
  23. package/dist/components/elements/UluButtonVerbose.vue.d.ts +38 -123
  24. package/dist/components/elements/UluButtonVerbose.vue.d.ts.map +1 -1
  25. package/dist/components/elements/UluButtonVerbose.vue.js +52 -65
  26. package/dist/components/elements/UluCallout.vue.d.ts +20 -25
  27. package/dist/components/elements/UluCallout.vue.d.ts.map +1 -1
  28. package/dist/components/elements/UluCallout.vue.js +11 -16
  29. package/dist/components/elements/UluCaptionedFigure.vue.d.ts +25 -0
  30. package/dist/components/elements/UluCaptionedFigure.vue.d.ts.map +1 -0
  31. package/dist/components/elements/UluCaptionedFigure.vue.js +48 -0
  32. package/dist/components/elements/UluCard.vue.d.ts +2 -2
  33. package/dist/components/elements/UluDefinitionList.vue.d.ts +4 -2
  34. package/dist/components/elements/UluDefinitionList.vue.d.ts.map +1 -1
  35. package/dist/components/elements/UluDefinitionList.vue.js +32 -28
  36. package/dist/components/elements/UluExternalLink.vue.d.ts +2 -2
  37. package/dist/components/elements/UluImage.vue.d.ts +14 -0
  38. package/dist/components/elements/UluImage.vue.d.ts.map +1 -0
  39. package/dist/components/elements/UluImage.vue.js +53 -0
  40. package/dist/components/elements/UluList.vue.d.ts.map +1 -1
  41. package/dist/components/elements/UluList.vue.js +14 -13
  42. package/dist/components/elements/UluOverflowScroller.vue.d.ts +49 -0
  43. package/dist/components/elements/UluOverflowScroller.vue.d.ts.map +1 -0
  44. package/dist/components/elements/UluOverflowScroller.vue.js +138 -0
  45. package/dist/components/elements/UluScrollSlider.vue.d.ts +38 -0
  46. package/dist/components/elements/UluScrollSlider.vue.d.ts.map +1 -0
  47. package/dist/components/elements/UluScrollSlider.vue.js +146 -0
  48. package/dist/components/elements/UluSlider.vue.d.ts +57 -0
  49. package/dist/components/elements/UluSlider.vue.d.ts.map +1 -0
  50. package/dist/components/elements/UluSlider.vue.js +277 -0
  51. package/dist/components/forms/UluFormFile.vue.d.ts +2 -2
  52. package/dist/components/forms/UluFormRadio.vue.d.ts +4 -4
  53. package/dist/components/index.d.ts +6 -0
  54. package/dist/components/layout/UluTitleRail.vue.d.ts +29 -87
  55. package/dist/components/layout/UluTitleRail.vue.d.ts.map +1 -1
  56. package/dist/components/layout/UluTitleRail.vue.js +51 -46
  57. package/dist/components/navigation/UluBreadcrumb.vue.d.ts +27 -68
  58. package/dist/components/navigation/UluBreadcrumb.vue.d.ts.map +1 -1
  59. package/dist/components/navigation/UluBreadcrumb.vue.js +51 -54
  60. package/dist/components/navigation/UluMenu.vue.d.ts +30 -138
  61. package/dist/components/navigation/UluMenu.vue.d.ts.map +1 -1
  62. package/dist/components/navigation/UluMenu.vue.js +85 -84
  63. package/dist/components/navigation/UluMenuStack.vue.d.ts +12 -2
  64. package/dist/components/navigation/UluMenuStack.vue.d.ts.map +1 -1
  65. package/dist/components/navigation/UluMenuStack.vue.js +26 -18
  66. package/dist/components/navigation/UluNavStrip.vue.d.ts +22 -134
  67. package/dist/components/navigation/UluNavStrip.vue.d.ts.map +1 -1
  68. package/dist/components/navigation/UluNavStrip.vue.js +43 -31
  69. package/dist/components/systems/facets/UluFacetsSidebarLayout.vue.js +10 -10
  70. package/dist/components/systems/facets/useFacets.d.ts +3 -0
  71. package/dist/components/systems/facets/useFacets.d.ts.map +1 -1
  72. package/dist/components/systems/facets/useFacets.js +124 -112
  73. package/dist/components/systems/index.d.ts +0 -3
  74. package/dist/components/systems/scroll-anchors/UluScrollAnchors.vue.d.ts +2 -2
  75. package/dist/components/systems/table-sticky/UluTableSticky.vue.d.ts +504 -432
  76. package/dist/components/systems/table-sticky/UluTableSticky.vue.d.ts.map +1 -1
  77. package/dist/components/systems/table-sticky/UluTableSticky.vue.js +313 -456
  78. package/dist/components/systems/table-sticky/UluTableStickyRows.vue.d.ts +40 -31
  79. package/dist/components/systems/table-sticky/UluTableStickyRows.vue.d.ts.map +1 -1
  80. package/dist/components/systems/table-sticky/UluTableStickyRows.vue.js +43 -45
  81. package/dist/components/systems/table-sticky/UluTableStickyTable.vue.d.ts +60 -146
  82. package/dist/components/systems/table-sticky/UluTableStickyTable.vue.d.ts.map +1 -1
  83. package/dist/components/systems/table-sticky/UluTableStickyTable.vue.js +156 -175
  84. package/dist/components/utils/UluAction.vue.d.ts +36 -0
  85. package/dist/components/utils/UluAction.vue.d.ts.map +1 -0
  86. package/dist/components/utils/UluAction.vue.js +59 -0
  87. package/dist/components/utils/UluConditionalText.vue.d.ts +7 -26
  88. package/dist/components/utils/UluConditionalText.vue.d.ts.map +1 -1
  89. package/dist/components/utils/UluConditionalText.vue.js +12 -14
  90. package/dist/components/utils/UluConditionalWrapper.vue.d.ts.map +1 -1
  91. package/dist/components/utils/UluConditionalWrapper.vue.js +11 -9
  92. package/dist/components/utils/UluPlaceholderImage.vue.d.ts +12 -57
  93. package/dist/components/utils/UluPlaceholderImage.vue.d.ts.map +1 -1
  94. package/dist/components/utils/UluPlaceholderImage.vue.js +18 -26
  95. package/dist/components/utils/UluPlaceholderText.vue.d.ts +6 -20
  96. package/dist/components/utils/UluPlaceholderText.vue.js +12 -14
  97. package/dist/components/utils/UluRouteAnnouncer.vue.d.ts +9 -58
  98. package/dist/components/utils/UluRouteAnnouncer.vue.d.ts.map +1 -1
  99. package/dist/components/utils/UluRouteAnnouncer.vue.js +28 -28
  100. package/dist/components/visualizations/UluAnimateNumber.vue.d.ts +20 -14
  101. package/dist/components/visualizations/UluAnimateNumber.vue.d.ts.map +1 -1
  102. package/dist/components/visualizations/UluAnimateNumber.vue.js +18 -26
  103. package/dist/components/visualizations/UluProgressCircle.vue.d.ts +2 -2
  104. package/dist/composables/useModifiers.d.ts +20 -25
  105. package/dist/composables/useModifiers.d.ts.map +1 -1
  106. package/dist/index.js +206 -200
  107. package/dist/plugins/modals/UluModalsDisplay.vue.d.ts +3 -12
  108. package/dist/plugins/modals/UluModalsDisplay.vue.js +24 -45
  109. package/dist/plugins/modals/index.js +6 -6
  110. package/dist/plugins/toast/UluToast.vue.d.ts +24 -49
  111. package/dist/plugins/toast/UluToast.vue.d.ts.map +1 -1
  112. package/dist/plugins/toast/UluToast.vue.js +68 -77
  113. package/dist/plugins/toast/UluToastDisplay.vue.d.ts +1 -9
  114. package/dist/plugins/toast/UluToastDisplay.vue.js +27 -35
  115. package/dist/plugins/toast/defaults.d.ts +40 -35
  116. package/dist/plugins/toast/defaults.js +2 -2
  117. package/dist/plugins/toast/index.js +4 -4
  118. package/dist/plugins/toast/store.d.ts +40 -35
  119. package/dist/plugins/toast/store.d.ts.map +1 -1
  120. package/dist/utils/props.d.ts +7 -0
  121. package/dist/utils/props.d.ts.map +1 -0
  122. package/dist/utils/props.js +6 -0
  123. package/lib/components/collapsible/UluAccordionGroup.vue +4 -1
  124. package/lib/components/collapsible/UluDropdown.vue +5 -1
  125. package/lib/components/collapsible/UluModal.vue +278 -298
  126. package/lib/components/collapsible/UluTabGroup.vue +21 -6
  127. package/lib/components/elements/UluAlert.vue +38 -51
  128. package/lib/components/elements/UluBadgeStack.vue +4 -1
  129. package/lib/components/elements/UluButton.vue +105 -129
  130. package/lib/components/elements/UluButtonVerbose.vue +67 -89
  131. package/lib/components/elements/UluCallout.vue +15 -19
  132. package/lib/components/elements/UluCaptionedFigure.vue +40 -0
  133. package/lib/components/elements/UluDefinitionList.vue +27 -6
  134. package/lib/components/elements/UluImage.vue +56 -0
  135. package/lib/components/elements/UluList.vue +1 -0
  136. package/lib/components/elements/UluOverflowScroller.vue +140 -0
  137. package/lib/components/elements/UluScrollSlider.vue +150 -0
  138. package/lib/components/elements/UluSlider.vue +488 -0
  139. package/lib/components/index.js +10 -0
  140. package/lib/components/layout/UluTitleRail.vue +55 -48
  141. package/lib/components/navigation/UluBreadcrumb.vue +29 -34
  142. package/lib/components/navigation/UluMenu.vue +60 -71
  143. package/lib/components/navigation/UluMenuStack.vue +6 -1
  144. package/lib/components/navigation/UluNavStrip.vue +43 -31
  145. package/lib/components/systems/facets/useFacets.js +33 -17
  146. package/lib/components/systems/index.js +0 -4
  147. package/lib/components/systems/table-sticky/UluTableSticky.vue +602 -576
  148. package/lib/components/systems/table-sticky/UluTableStickyRows.vue +16 -27
  149. package/lib/components/systems/table-sticky/UluTableStickyTable.vue +95 -96
  150. package/lib/components/utils/UluAction.vue +81 -0
  151. package/lib/components/utils/UluConditionalText.vue +13 -16
  152. package/lib/components/utils/UluConditionalWrapper.vue +5 -1
  153. package/lib/components/utils/UluPlaceholderImage.vue +44 -46
  154. package/lib/components/utils/UluPlaceholderText.vue +10 -13
  155. package/lib/components/utils/UluRouteAnnouncer.vue +59 -47
  156. package/lib/components/visualizations/UluAnimateNumber.vue +23 -30
  157. package/lib/composables/useModifiers.js +21 -26
  158. package/lib/plugins/modals/UluModalsDisplay.vue +44 -45
  159. package/lib/plugins/toast/UluToast.vue +28 -34
  160. package/lib/plugins/toast/UluToastDisplay.vue +9 -15
  161. package/lib/utils/props.js +8 -0
  162. package/package.json +9 -5
  163. package/dist/components/systems/slider/UluImageSlideShow.vue.d.ts +0 -130
  164. package/dist/components/systems/slider/UluImageSlideShow.vue.d.ts.map +0 -1
  165. package/dist/components/systems/slider/UluImageSlideShow.vue.js +0 -73
  166. package/dist/components/systems/slider/UluSlideShow.vue.d.ts +0 -205
  167. package/dist/components/systems/slider/UluSlideShow.vue.d.ts.map +0 -1
  168. package/dist/components/systems/slider/UluSlideShow.vue.js +0 -292
  169. package/dist/components/systems/slider/UluSlideShowSlide.vue.d.ts +0 -17
  170. package/dist/components/systems/slider/UluSlideShowSlide.vue.d.ts.map +0 -1
  171. package/dist/components/systems/slider/UluSlideShowSlide.vue.js +0 -26
  172. package/lib/components/systems/slider/UluImageSlideShow.vue +0 -75
  173. package/lib/components/systems/slider/UluSlideShow.vue +0 -336
  174. package/lib/components/systems/slider/UluSlideShowSlide.vue +0 -25
@@ -21,60 +21,47 @@
21
21
  </div>
22
22
  </template>
23
23
 
24
- <script>
24
+ <script setup>
25
25
  import { computed } from "vue";
26
- import UluButton from "./UluButton.vue";
27
26
  import UluIcon from "./UluIcon.vue";
28
27
  import { useModifiers } from "../../composables/useModifiers.js";
29
- /**
30
- * Callout with alert layout
31
- */
32
- export default {
33
- name: "UluAlert",
34
- components: {
35
- UluButton,
36
- UluIcon
37
- },
38
- props: {
39
- /**
40
- * Alert Title
41
- */
42
- title: String,
43
- /**
44
- * Alert description
45
- */
46
- description: String,
47
- /**
48
- * Pass specific icon definition, else it will resolve based on common types
49
- */
50
- icon: String,
51
- /**
52
- * Error, warning, info, success etc (must have these callout modifiers setup and this is used for type color [ie. color-error])
53
- */
54
- type: {
55
- type: String,
56
- default: "danger"
57
- },
58
- /**
59
- * Compact callout style
60
- */
61
- compact: Boolean,
62
- /**
63
- * Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
64
- */
65
- modifiers: [String, Array]
28
+
29
+ const props = defineProps({
30
+ /**
31
+ * Alert Title
32
+ */
33
+ title: String,
34
+ /**
35
+ * Alert description
36
+ */
37
+ description: String,
38
+ /**
39
+ * Pass specific icon definition, else it will resolve based on common types
40
+ */
41
+ icon: String,
42
+ /**
43
+ * Error, warning, info, success etc (must have these callout modifiers setup and this is used for type color [ie. color-error])
44
+ */
45
+ type: {
46
+ type: String,
47
+ default: "danger"
66
48
  },
67
- setup(props) {
68
- const { resolvedModifiers } = useModifiers({
69
- props,
70
- baseClass: "callout",
71
- internal: computed(() => ({
72
- [props.type] : props.type,
73
- "compact": props.compact,
74
- }))
75
- });
49
+ /**
50
+ * Compact callout style
51
+ */
52
+ compact: Boolean,
53
+ /**
54
+ * Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
55
+ */
56
+ modifiers: [String, Array]
57
+ });
76
58
 
77
- return { resolvedModifiers };
78
- }
79
- };
59
+ const { resolvedModifiers } = useModifiers({
60
+ props,
61
+ baseClass: "callout",
62
+ internal: computed(() => ({
63
+ [props.type] : props.type,
64
+ "compact": props.compact,
65
+ }))
66
+ });
80
67
  </script>
@@ -1,5 +1,8 @@
1
1
  <template>
2
- <ul class="badge-stack">
2
+ <ul
3
+ v-if="items?.length"
4
+ class="badge-stack"
5
+ >
3
6
  <li
4
7
  class="badge-stack__item"
5
8
  v-for="(item, index) in items"
@@ -1,22 +1,16 @@
1
1
  <template>
2
- <component
3
- :is="element"
2
+ <UluAction
3
+ :to="to"
4
+ :href="href"
5
+ :target="target"
6
+ :download="download"
4
7
  class="button"
5
8
  :class="[
6
9
  {
7
- 'button--transparent' : transparent,
8
- 'button--primary' : primary,
9
- 'button--secondary' : secondary,
10
- 'button--outline' : outline,
11
- 'button--small' : small,
12
- 'button--large' : large,
13
- 'button--icon' : iconOnly,
14
10
  'no-margin' : noMargin,
15
11
  },
16
- classes,
17
12
  resolvedModifiers
18
13
  ]"
19
- v-bind="attrs"
20
14
  :aria-label="resolvedAriaLabel"
21
15
  >
22
16
  <slot name="before"/>
@@ -36,126 +30,108 @@
36
30
  class="button__icon"
37
31
  />
38
32
  <slot name="after"/>
39
- </component>
33
+ </UluAction>
40
34
  </template>
41
35
 
42
- <script>
43
- import { RouterLink } from "vue-router";
36
+ <script setup>
37
+ import { computed } from "vue";
38
+ import UluAction from "../utils/UluAction.vue";
44
39
  import UluIcon from "./UluIcon.vue";
45
40
  import { useModifiers } from "../../composables/useModifiers.js";
46
- export default {
47
- name: "UluButton",
48
- components: {
49
- UluIcon
50
- },
51
- props: {
52
- /**
53
- * Icon prop, if used will set the icon for the button, will use UluIcon (which uses font-awesome icons conditionally)
54
- * - If using custom icons don't use this prop, use before or after slots with correct classes (ie .button__icon)
55
- */
56
- icon: [String, Array],
57
- /**
58
- * If passing an icon (and not using iconOnly) this determines if the icon is before or after (default) the text
59
- */
60
- iconBefore: Boolean,
61
- /**
62
- * Button style for only icon
63
- */
64
- iconOnly: Boolean,
65
- /**
66
- * If set will use router-link for button component and pass to prop
67
- */
68
- to: [String, Object],
69
- /**
70
- * Sets the button to a link with this href
71
- */
72
- href: String,
73
- /**
74
- * Set a value for target attribute when button is a link
75
- */
76
- target: String,
77
- /**
78
- * Sets the download attribute on the link (passing string [filename] will populate the download attribute, true will just include it as boolean attribute)
79
- */
80
- download: [Boolean, String],
81
- /**
82
- * For icon only buttons or buttons that need an explicit label
83
- */
84
- alt: String,
85
- /**
86
- * If not using slot this sets the buttons text via prop
87
- */
88
- text: String,
89
- /**
90
- * Pass any sizes setup for button (ie. small, large, etc)
91
- */
92
- size: String,
93
- /**
94
- * Preset to set primary style (needs to be a button style in ulu scss)
95
- */
96
- primary: Boolean,
97
- /**
98
- * Preset to set secondary style (needs to be a button style in ulu scss)
99
- */
100
- secondary: Boolean,
101
- /**
102
- * Preset to set small size (use "size" for any sizes)
103
- */
104
- small: Boolean,
105
- /**
106
- * Preset to set large size (use "size" for any sizes)
107
- */
108
- large: Boolean,
109
- /**
110
- * Preset to set outline style button (needs to be a button style in ulu scss)
111
- */
112
- outline: Boolean,
113
- /**
114
- * Preset to set transparent style button (needs to be a button style in ulu scss)
115
- */
116
- transparent: Boolean,
117
- /**
118
- * Add no-margin utility
119
- */
120
- noMargin: Boolean,
121
- /**
122
- * Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
123
- */
124
- modifiers: [String, Array]
125
- },
126
- setup(props) {
127
- const { resolvedModifiers } = useModifiers({ props, baseClass: "button" });
128
- return { resolvedModifiers };
129
- },
130
- computed: {
131
- resolvedAriaLabel() {
132
- const label = this.alt || this.iconOnly && this.text;
133
- return label ? label : null;
134
- },
135
- classes() {
136
- const classes = [];
137
- const { size } = this;
138
- if (size) {
139
- classes.push(`button--${ size }`);
140
- }
141
- return classes;
142
- },
143
- element() {
144
- return this.to ? RouterLink : this.href ? "a" : "button";
145
- },
146
- attrs() {
147
- const { to, href, download, target } = this;
148
- const attrs = to ? { to } : href ? { href } : {};
149
- if (href) {
150
- if (target) {
151
- attrs.target = target;
152
- }
153
- if (download) {
154
- attrs.download = typeof download === "string" ? download : true;
155
- }
156
- }
157
- return attrs;
158
- }
159
- }
160
- };
41
+
42
+ const props = defineProps({
43
+ /**
44
+ * Icon prop, if used will set the icon for the button, will use UluIcon (which uses font-awesome icons conditionally)
45
+ * - If using custom icons don't use this prop, use before or after slots with correct classes (ie .button__icon)
46
+ */
47
+ icon: [String, Array],
48
+ /**
49
+ * If passing an icon (and not using iconOnly) this determines if the icon is before or after (default) the text
50
+ */
51
+ iconBefore: Boolean,
52
+ /**
53
+ * Button style for only icon
54
+ */
55
+ iconOnly: Boolean,
56
+ /**
57
+ * If set will use router-link for button component and pass to prop
58
+ */
59
+ to: [String, Object],
60
+ /**
61
+ * Sets the button to a link with this href
62
+ */
63
+ href: String,
64
+ /**
65
+ * Set a value for target attribute when button is a link
66
+ */
67
+ target: String,
68
+ /**
69
+ * Sets the download attribute on the link (passing string [filename] will populate the download attribute, true will just include it as boolean attribute)
70
+ */
71
+ download: [Boolean, String],
72
+ /**
73
+ * For icon only buttons or buttons that need an explicit label
74
+ */
75
+ alt: String,
76
+ /**
77
+ * If not using slot this sets the buttons text via prop
78
+ */
79
+ text: String,
80
+ /**
81
+ * Pass any sizes setup for button (ie. small, large, etc)
82
+ */
83
+ size: String,
84
+ /**
85
+ * Preset to set primary style (needs to be a button style in ulu scss)
86
+ */
87
+ primary: Boolean,
88
+ /**
89
+ * Preset to set secondary style (needs to be a button style in ulu scss)
90
+ */
91
+ secondary: Boolean,
92
+ /**
93
+ * Preset to set small size (use "size" for any sizes)
94
+ */
95
+ small: Boolean,
96
+ /**
97
+ * Preset to set large size (use "size" for any sizes)
98
+ */
99
+ large: Boolean,
100
+ /**
101
+ * Preset to set outline style button (needs to be a button style in ulu scss)
102
+ */
103
+ outline: Boolean,
104
+ /**
105
+ * Preset to set transparent style button (needs to be a button style in ulu scss)
106
+ */
107
+ transparent: Boolean,
108
+ /**
109
+ * Add no-margin utility
110
+ */
111
+ noMargin: Boolean,
112
+ /**
113
+ * Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
114
+ */
115
+ modifiers: [String, Array]
116
+ });
117
+
118
+ const { resolvedModifiers } = useModifiers({
119
+ props,
120
+ baseClass: "button",
121
+ internal: computed(() => ({
122
+ "transparent" : props.transparent,
123
+ "primary" : props.primary,
124
+ "secondary" : props.secondary,
125
+ "outline" : props.outline,
126
+ "small" : props.small,
127
+ "large" : props.large,
128
+ "icon" : props.iconOnly,
129
+ [props.size] : props.size
130
+ }))
131
+ });
132
+
133
+ const resolvedAriaLabel = computed(() => {
134
+ const label = props.alt || (props.iconOnly && props.text);
135
+ return label ? label : null;
136
+ });
161
137
  </script>
@@ -1,15 +1,11 @@
1
1
  <template>
2
- <component
3
- :is="element"
2
+ <UluAction
3
+ :to="to"
4
+ :href="href"
5
+ :target="target"
6
+ :download="download"
4
7
  class="button-verbose"
5
- :class="[
6
- {
7
- 'button-verbose--inline': inline,
8
- 'button-verbose--full-width': fullWidth,
9
- },
10
- resolvedModifiers
11
- ]"
12
- v-bind="attrs"
8
+ :class="resolvedModifiers"
13
9
  >
14
10
  <component
15
11
  v-if="$slots.title || title"
@@ -31,89 +27,71 @@
31
27
  class="button-verbose__icon"
32
28
  aria-hidden="true"
33
29
  />
34
- </component>
30
+ </UluAction>
35
31
  </template>
36
32
 
37
- <script>
38
- import { RouterLink } from "vue-router";
33
+ <script setup>
34
+ import { computed } from "vue";
35
+ import UluAction from "../utils/UluAction.vue";
39
36
  import UluIcon from "./UluIcon.vue";
40
37
  import { useModifiers } from "../../composables/useModifiers.js";
41
38
 
42
- export default {
43
- name: "UluButtonVerbose",
44
- components: {
45
- UluIcon
39
+ const props = defineProps({
40
+ /**
41
+ * The title of the button. Can also be passed via slot.
42
+ */
43
+ title: String,
44
+ /**
45
+ * Optional element to use for title
46
+ */
47
+ titleElement: {
48
+ type: String,
49
+ default: "strong"
46
50
  },
47
- props: {
48
- /**
49
- * The title of the button. Can also be passed via slot.
50
- */
51
- title: String,
52
- /**
53
- * Optional element to use for title
54
- */
55
- titleElement: {
56
- type: String,
57
- default: "strong"
58
- },
59
- /**
60
- * The body text of the button. Can also be passed via slot.
61
- */
62
- body: String,
63
- /**
64
- * Icon prop, if used will set the icon for the button, will use UluIcon (which uses font-awesome icons conditionally)
65
- */
66
- icon: [String, Array],
67
- /**
68
- * If set will use router-link for button component and pass to prop
69
- */
70
- to: [String, Object],
71
- /**
72
- * Sets the button to a link with this href
73
- */
74
- href: String,
75
- /**
76
- * Set a value for target attribute when button is a link
77
- */
78
- target: String,
79
- /**
80
- * Sets the download attribute on the link (passing string [filename] will populate the download attribute, true will just include it as boolean attribute)
81
- */
82
- download: [Boolean, String],
83
- /**
84
- * Preset to set inline style
85
- */
86
- inline: Boolean,
87
- /**
88
- * Preset to set full-width style
89
- */
90
- fullWidth: Boolean,
91
- /**
92
- * Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
93
- */
94
- modifiers: [String, Array]
95
- },
96
- setup(props) {
97
- const { resolvedModifiers } = useModifiers({ props, baseClass: "button-verbose" });
98
- return { resolvedModifiers };
99
- },
100
- computed: {
101
- element() {
102
- return this.to ? RouterLink : this.href ? "a" : "button";
103
- },
104
- attrs() {
105
- const { to, href, download, target } = this;
106
- const attrs = to ? { to } : href ? { href } : {};
107
- if (href) {
108
- if (target) {
109
- attrs.target = target;
110
- }
111
- if (download) {
112
- attrs.download = typeof download === "string" ? download : true;
113
- }
114
- }
115
- return attrs;
116
- }
117
- }
118
- };
51
+ /**
52
+ * The body text of the button. Can also be passed via slot.
53
+ */
54
+ body: String,
55
+ /**
56
+ * Icon prop, if used will set the icon for the button, will use UluIcon (which uses font-awesome icons conditionally)
57
+ */
58
+ icon: [String, Array],
59
+ /**
60
+ * If set will use router-link for button component and pass to prop
61
+ */
62
+ to: [String, Object],
63
+ /**
64
+ * Sets the button to a link with this href
65
+ */
66
+ href: String,
67
+ /**
68
+ * Set a value for target attribute when button is a link
69
+ */
70
+ target: String,
71
+ /**
72
+ * Sets the download attribute on the link (passing string [filename] will populate the download attribute, true will just include it as boolean attribute)
73
+ */
74
+ download: [Boolean, String],
75
+ /**
76
+ * Preset to set inline style
77
+ */
78
+ inline: Boolean,
79
+ /**
80
+ * Preset to set full-width style
81
+ */
82
+ fullWidth: Boolean,
83
+ /**
84
+ * Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
85
+ */
86
+ modifiers: [String, Array]
87
+ });
88
+
89
+ const { resolvedModifiers } = useModifiers({
90
+ props,
91
+ baseClass: "button-verbose",
92
+ internal: computed(() => ({
93
+ "inline": props.inline,
94
+ "full-width": props.fullWidth,
95
+ }))
96
+ });
119
97
  </script>
@@ -7,24 +7,20 @@
7
7
  </div>
8
8
  </template>
9
9
 
10
- <script>
10
+ <script setup>
11
11
  import { useModifiers } from "../../composables/useModifiers.js";
12
- export default {
13
- name: "UluCallout",
14
- props: {
15
- /**
16
- * Add full height utility class
17
- */
18
- fullHeight: Boolean,
19
- /**
20
- * Class modifiers (ie. 'transparent', 'secondary', etc)
21
- * - Can be String or Array of Strings
22
- */
23
- modifiers: [String, Array]
24
- },
25
- setup(props) {
26
- const { resolvedModifiers } = useModifiers({ props, baseClass: "callout" });
27
- return { resolvedModifiers };
28
- }
29
- };
12
+
13
+ const props = defineProps({
14
+ /**
15
+ * Add full height utility class
16
+ */
17
+ fullHeight: Boolean,
18
+ /**
19
+ * Class modifiers (ie. 'transparent', 'secondary', etc)
20
+ * - Can be String or Array of Strings
21
+ */
22
+ modifiers: [String, Array]
23
+ });
24
+
25
+ const { resolvedModifiers } = useModifiers({ props, baseClass: "callout" });
30
26
  </script>
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <figure class="captioned-figure" :class="resolvedModifiers">
3
+ <slot></slot>
4
+ <figcaption v-if="caption || $slots.caption" class="captioned-figure__caption">
5
+ <slot name="caption">{{ caption }}</slot>
6
+ </figcaption>
7
+ </figure>
8
+ </template>
9
+
10
+ <script setup>
11
+ import { computed } from "vue";
12
+ import { useModifiers } from '../../composables/useModifiers.js';
13
+
14
+ const props = defineProps({
15
+ /**
16
+ * The text content for the caption.
17
+ */
18
+ caption: {
19
+ type: String,
20
+ default: ''
21
+ },
22
+ /**
23
+ * Positioning (e.g., 'bottom', 'center', 'right') else defaults to traditional
24
+ */
25
+ position: String,
26
+ /**
27
+ * Modifiers for styling and positioning (e.g., 'bottom', 'center', 'right', 'traditional').
28
+ */
29
+ modifiers: [String, Array]
30
+ });
31
+
32
+ const { resolvedModifiers } = useModifiers({
33
+ props,
34
+ baseClass: "captioned-figure",
35
+ internal: computed(() => ({
36
+ "traditional" : !props.position,
37
+ [props.position] : props.position
38
+ }))
39
+ });
40
+ </script>