@ulu/frontend-vue 0.1.0-beta.5 → 0.1.0-beta.6
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/README.md +10 -2
- package/dist/{breakpoints-DVO2G7-7.js → breakpoints-SWofnYUx.js} +1 -1
- package/dist/frontend-vue.js +1 -1
- package/dist/{index-BPVCOXRL.js → index-CtdKSn3_.js} +326 -338
- package/lib/components/collapsible/UluAccordion.vue +1 -1
- package/lib/components/collapsible/UluModal.vue +4 -5
- package/lib/components/collapsible/UluOverflowPopover.vue +1 -1
- package/lib/components/elements/UluAlert.vue +1 -2
- package/lib/components/elements/UluButton.vue +2 -2
- package/lib/components/elements/UluExternalLink.vue +1 -2
- package/lib/components/elements/UluIcon.vue +6 -11
- package/lib/components/elements/UluTag.vue +1 -1
- package/lib/components/layout/UluTitleRail.vue +2 -4
- package/lib/components/navigation/UluBreadcrumb.vue +1 -2
- package/lib/components/navigation/UluMenu.vue +1 -1
- package/lib/plugins/core/index.js +5 -5
- package/lib/plugins/toast/UluToast.vue +1 -1
- package/package.json +13 -4
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<UluIcon
|
|
27
27
|
v-if="titleIcon"
|
|
28
28
|
class="modal__title-icon"
|
|
29
|
-
:
|
|
29
|
+
:icon="titleIcon"
|
|
30
30
|
/>
|
|
31
31
|
<span class="modal__title-text">{{ title }}</span>
|
|
32
32
|
</slot>
|
|
@@ -35,8 +35,7 @@
|
|
|
35
35
|
<slot name="closeIcon">
|
|
36
36
|
<UluIcon
|
|
37
37
|
class="modal__close-icon"
|
|
38
|
-
|
|
39
|
-
:definition="closeIcon"
|
|
38
|
+
:icon="closeIcon || 'type:close'"
|
|
40
39
|
/>
|
|
41
40
|
</slot>
|
|
42
41
|
</button>
|
|
@@ -56,7 +55,7 @@
|
|
|
56
55
|
</div>
|
|
57
56
|
<button v-if="resizerEnabled" class="modal__resizer" ref="resizer" type="button">
|
|
58
57
|
<slot name="resizerIcon">
|
|
59
|
-
<UluIcon class="modal__resizer-icon" :
|
|
58
|
+
<UluIcon class="modal__resizer-icon" :icon="resizerIcon || resizerIconType" />
|
|
60
59
|
</slot>
|
|
61
60
|
</button>
|
|
62
61
|
</dialog>
|
|
@@ -213,7 +212,7 @@
|
|
|
213
212
|
});
|
|
214
213
|
|
|
215
214
|
const resizerIconType = computed(() => {
|
|
216
|
-
return props.position === 'center' ? 'resizeBoth' : 'resizeHorizontal';
|
|
215
|
+
return props.position === 'center' ? 'type:resizeBoth' : 'type:resizeHorizontal';
|
|
217
216
|
});
|
|
218
217
|
|
|
219
218
|
// Define the internal modifiers object as a computed property (so it can react to changes)
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<slot name="before"/>
|
|
23
23
|
<UluIcon
|
|
24
24
|
v-if="icon && (iconBefore || iconOnly)"
|
|
25
|
-
:
|
|
25
|
+
:icon="icon"
|
|
26
26
|
class="button__icon"
|
|
27
27
|
/>
|
|
28
28
|
<span v-if="($slots.default || text) && !iconOnly">
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
</span>
|
|
33
33
|
<UluIcon
|
|
34
34
|
v-if="icon && (!iconBefore && !iconOnly)"
|
|
35
|
-
:
|
|
35
|
+
:icon="icon"
|
|
36
36
|
class="button__icon"
|
|
37
37
|
/>
|
|
38
38
|
<slot name="after"/>
|
|
@@ -27,15 +27,11 @@
|
|
|
27
27
|
let FaModule;
|
|
28
28
|
|
|
29
29
|
const props = defineProps({
|
|
30
|
-
/**
|
|
31
|
-
* Semantic type of icon to use, will be resolved from settings
|
|
32
|
-
*/
|
|
33
|
-
type: String,
|
|
34
30
|
/**
|
|
35
31
|
* Icon definition can be string (fa classes), or array or object (any prop format FaIcon accepts)
|
|
36
32
|
* - This will override the 'type' prop if both are provided
|
|
37
33
|
*/
|
|
38
|
-
|
|
34
|
+
icon: [String, Array, Object, Boolean],
|
|
39
35
|
});
|
|
40
36
|
|
|
41
37
|
const useStaticFa = computed(() => {
|
|
@@ -52,18 +48,17 @@
|
|
|
52
48
|
|
|
53
49
|
// Resolve the final icon definition, giving precedence to the `definition` prop
|
|
54
50
|
const resolvedDefinition = computed(() => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
if (props.type) {
|
|
51
|
+
const { icon } = props;
|
|
52
|
+
if (typeof icon === 'string' && icon.startsWith('type:')) {
|
|
59
53
|
try {
|
|
60
|
-
|
|
54
|
+
const type = icon.substring(5);
|
|
55
|
+
return uluCore.getIcon(type);
|
|
61
56
|
} catch (e) {
|
|
62
57
|
console.warn(e);
|
|
63
58
|
return null;
|
|
64
59
|
}
|
|
65
60
|
}
|
|
66
|
-
return
|
|
61
|
+
return icon;
|
|
67
62
|
});
|
|
68
63
|
|
|
69
64
|
const customIconProps = computed(() => {
|
|
@@ -8,10 +8,9 @@
|
|
|
8
8
|
:style="{ alignItems: iconAlign }"
|
|
9
9
|
>
|
|
10
10
|
<UluIcon
|
|
11
|
-
v-if="icon
|
|
11
|
+
v-if="icon"
|
|
12
12
|
:class="classes.icon"
|
|
13
|
-
:
|
|
14
|
-
:definition="icon"
|
|
13
|
+
:icon="icon"
|
|
15
14
|
/>
|
|
16
15
|
<slot>
|
|
17
16
|
{{ title }}
|
|
@@ -38,7 +37,6 @@
|
|
|
38
37
|
type: String,
|
|
39
38
|
default: "baseline"
|
|
40
39
|
},
|
|
41
|
-
iconType: String,
|
|
42
40
|
classes: {
|
|
43
41
|
type: Object,
|
|
44
42
|
default: () => ({
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<slot :item="item" :index="index">
|
|
27
27
|
<UluIcon
|
|
28
28
|
v-if="item.icon"
|
|
29
|
-
:
|
|
29
|
+
:icon="item.icon"
|
|
30
30
|
:class="[classes.linkIcon, item?.classes?.linkIcon]"
|
|
31
31
|
/>
|
|
32
32
|
<span :class="[classes.linkText, item?.classes?.linkText]">{{ item.title }}</span>
|
|
@@ -8,7 +8,7 @@ const defaults = {
|
|
|
8
8
|
fontAwesomeStatic: false,
|
|
9
9
|
iconComponent: null,
|
|
10
10
|
iconPropResolver: (definition) => ({ icon: definition }),
|
|
11
|
-
|
|
11
|
+
iconsByType: {
|
|
12
12
|
danger: "fas fa-triangle-exclamation",
|
|
13
13
|
warning: "fas fa-circle-exclamation",
|
|
14
14
|
info: "fas fa-circle-info",
|
|
@@ -25,14 +25,14 @@ const defaults = {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
export const iconKeys = Object.keys(defaults.
|
|
28
|
+
export const iconKeys = Object.keys(defaults.iconsByType);
|
|
29
29
|
|
|
30
30
|
export default function install(app, userSettings = {}) {
|
|
31
31
|
// A single reactive object for all settings
|
|
32
32
|
const settings = reactive({ ...defaults });
|
|
33
33
|
|
|
34
34
|
// Separate icon overrides from other options to handle them safely
|
|
35
|
-
const {
|
|
35
|
+
const { iconsByType: iconOverrides, ...otherOptions } = userSettings || {};
|
|
36
36
|
|
|
37
37
|
// Merge any user-provided options during installation
|
|
38
38
|
if (otherOptions) {
|
|
@@ -64,14 +64,14 @@ export default function install(app, userSettings = {}) {
|
|
|
64
64
|
settings[key] = value;
|
|
65
65
|
},
|
|
66
66
|
getIcon(type) {
|
|
67
|
-
const icons = settings.
|
|
67
|
+
const icons = settings.iconsByType;
|
|
68
68
|
if (!icons[type]) {
|
|
69
69
|
throw new Error(`Icon type "${type}" not found!`);
|
|
70
70
|
}
|
|
71
71
|
return icons[type];
|
|
72
72
|
},
|
|
73
73
|
setIcon(type, definition) {
|
|
74
|
-
settings.
|
|
74
|
+
settings.iconsByType[type] = definition;
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ulu/frontend-vue",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.6",
|
|
4
4
|
"description": "A modular and tree-shakeable Vue 3 component library for the Ulu frontend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -18,15 +18,23 @@
|
|
|
18
18
|
"./*": "./lib/*",
|
|
19
19
|
"./scss": "./lib/_index.scss"
|
|
20
20
|
},
|
|
21
|
+
"typesVersions": {
|
|
22
|
+
"*": {
|
|
23
|
+
"lib/*": [
|
|
24
|
+
"./types/*"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
21
28
|
"repository": {
|
|
22
29
|
"type": "git",
|
|
23
30
|
"url": "git+https://github.com/Jscherbe/frontend-vue.git"
|
|
24
31
|
},
|
|
25
32
|
"scripts": {
|
|
26
33
|
"dev": "storybook dev -p 6006",
|
|
27
|
-
"docs:build": "storybook build -o docs
|
|
34
|
+
"docs:build": "storybook build -o docs",
|
|
28
35
|
"build": "vite build",
|
|
29
|
-
"
|
|
36
|
+
"types": "npx tsc",
|
|
37
|
+
"deploy": "npm run types && npm run build && npm run docs:build"
|
|
30
38
|
},
|
|
31
39
|
"keywords": [
|
|
32
40
|
"vue",
|
|
@@ -78,7 +86,8 @@
|
|
|
78
86
|
"storybook": "^9.1.1",
|
|
79
87
|
"storybook-addon-vue-mdx": "^2.0.2",
|
|
80
88
|
"vite": "^7.0.0",
|
|
81
|
-
"vue-router": "^4.5.1"
|
|
89
|
+
"vue-router": "^4.5.1",
|
|
90
|
+
"typescript": "^5.3.3"
|
|
82
91
|
},
|
|
83
92
|
"volta": {
|
|
84
93
|
"node": "22.17.0"
|