@onereach/ui-components 2.69.2-beta.2136.0 → 2.69.3-beta.2138.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.
- package/dist/bundled/v2/{OrAvatar-2fa559e1.js → OrAvatar-ae61bfb9.js} +41 -15
- package/dist/bundled/v2/components/index.js +1 -1
- package/dist/bundled/v2/components/or-avatar-v3/OrAvatar.stories3.d.ts +1 -1
- package/dist/bundled/v2/components/or-avatar-v3/OrAvatar.vue.d.ts +11 -0
- package/dist/bundled/v2/components/or-avatar-v3/index.js +2 -1
- package/dist/bundled/v2/components/or-avatar-v3/props.d.ts +2 -1
- package/dist/bundled/v2/components/or-avatar-v3/styles.d.ts +2 -0
- package/dist/bundled/v2/index.js +2 -2
- package/dist/bundled/v3/{OrAvatar.vue_vue_type_script_lang-22e46ce1.js → OrAvatar.vue_vue_type_script_lang-0426862b.js} +35 -13
- package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-3993a015.js → OrCardCollection.vue_vue_type_script_lang-861158b5.js} +2 -2
- package/dist/bundled/v3/{OrIconButton-4bd33e3c.js → OrIconButton-1581013c.js} +1 -1
- package/dist/bundled/v3/{OrIconButton.vue_vue_type_script_lang-641f6e06.js → OrIconButton.vue_vue_type_script_lang-f6f801ff.js} +1 -1
- package/dist/bundled/v3/{OrInlineInput.vue_vue_type_script_lang-3a8189f4.js → OrInlineInput.vue_vue_type_script_lang-f29483f4.js} +2 -2
- package/dist/bundled/v3/{OrInlineTextarea.vue_vue_type_script_lang-890b97ab.js → OrInlineTextarea.vue_vue_type_script_lang-cc40af48.js} +2 -2
- package/dist/bundled/v3/OrInput.vue_vue_type_script_lang-f6d793d3.js +2 -2
- package/dist/bundled/v3/{OrModal.vue_vue_type_script_lang-00a477f0.js → OrModal.vue_vue_type_script_lang-80a7b906.js} +2 -2
- package/dist/bundled/v3/OrNotification.vue_vue_type_script_lang-fbb35355.js +2 -2
- package/dist/bundled/v3/OrSelect.vue_vue_type_script_lang-15285ce4.js +1 -1
- package/dist/bundled/v3/{OrTag.vue_vue_type_script_lang-92d9fb12.js → OrTag.vue_vue_type_script_lang-dc6a4011.js} +2 -2
- package/dist/bundled/v3/{OrToastContainer-afb51e5d.js → OrToastContainer-7c3c0b12.js} +1 -1
- package/dist/bundled/v3/components/index.js +10 -10
- package/dist/bundled/v3/components/or-avatar-v3/OrAvatar.stories3.d.ts +1 -1
- package/dist/bundled/v3/components/or-avatar-v3/OrAvatar.vue.d.ts +11 -0
- package/dist/bundled/v3/components/or-avatar-v3/index.js +3 -1
- package/dist/bundled/v3/components/or-avatar-v3/props.d.ts +2 -1
- package/dist/bundled/v3/components/or-avatar-v3/styles.d.ts +2 -0
- package/dist/bundled/v3/components/or-card-collection-v3/index.js +3 -3
- package/dist/bundled/v3/components/or-confirm-v3/index.js +2 -2
- package/dist/bundled/v3/components/or-icon-button-v3/index.js +1 -1
- package/dist/bundled/v3/components/or-inline-input-v3/index.js +3 -3
- package/dist/bundled/v3/components/or-inline-textarea-v3/index.js +3 -3
- package/dist/bundled/v3/components/or-input-v3/index.js +2 -2
- package/dist/bundled/v3/components/or-modal-v3/index.js +3 -3
- package/dist/bundled/v3/components/or-notification-v3/index.js +2 -2
- package/dist/bundled/v3/components/or-search-v3/index.js +2 -2
- package/dist/bundled/v3/components/or-select-v3/index.js +3 -3
- package/dist/bundled/v3/components/or-tag-v3/index.js +3 -3
- package/dist/bundled/v3/components/or-toast-v3/index.js +4 -4
- package/dist/bundled/v3/index.js +26 -20
- package/dist/bundled/v3/{types-6c5eee23.js → types-dcc78caa.js} +2 -2
- package/dist/esm/v2/{OrAvatar-0afdef36.js → OrAvatar-3d155af3.js} +41 -15
- package/dist/esm/v2/components/index.js +1 -1
- package/dist/esm/v2/components/or-avatar-v3/OrAvatar.stories3.d.ts +1 -1
- package/dist/esm/v2/components/or-avatar-v3/OrAvatar.vue.d.ts +11 -0
- package/dist/esm/v2/components/or-avatar-v3/index.js +2 -1
- package/dist/esm/v2/components/or-avatar-v3/props.d.ts +2 -1
- package/dist/esm/v2/components/or-avatar-v3/styles.d.ts +2 -0
- package/dist/esm/v2/index.js +1 -1
- package/dist/esm/v3/{OrAvatar-ef88d31c.js → OrAvatar-53a4429d.js} +43 -16
- package/dist/esm/v3/components/index.js +1 -1
- package/dist/esm/v3/components/or-avatar-v3/OrAvatar.stories3.d.ts +1 -1
- package/dist/esm/v3/components/or-avatar-v3/OrAvatar.vue.d.ts +11 -0
- package/dist/esm/v3/components/or-avatar-v3/index.js +2 -1
- package/dist/esm/v3/components/or-avatar-v3/props.d.ts +2 -1
- package/dist/esm/v3/components/or-avatar-v3/styles.d.ts +2 -0
- package/dist/esm/v3/index.js +1 -1
- package/package.json +1 -1
- package/src/components/or-avatar-v3/OrAvatar.stories3.ts +9 -7
- package/src/components/or-avatar-v3/OrAvatar.vue +22 -2
- package/src/components/or-avatar-v3/props.ts +1 -0
- package/src/components/or-avatar-v3/styles.ts +49 -11
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useToggle } from '@vueuse/core';
|
|
2
2
|
import { defineComponent, ref, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, renderSlot, createCommentVNode, createVNode, createElementVNode, toDisplayString, withModifiers, onBeforeMount, onBeforeUnmount, nextTick } from 'vue';
|
|
3
3
|
import { T as ToastType, P as PositionsX, b as PositionsY, c as TransitionType, d as useToastEventBus, a as useQueue } from './useToast-4d4329cd.js';
|
|
4
|
-
import './OrIconButton-
|
|
4
|
+
import './OrIconButton-1581013c.js';
|
|
5
5
|
import './OrLoader-c4bbef2f.js';
|
|
6
|
-
import { s as script$2 } from './OrIconButton.vue_vue_type_script_lang-
|
|
6
|
+
import { s as script$2 } from './OrIconButton.vue_vue_type_script_lang-f6f801ff.js';
|
|
7
7
|
import { s as script$3 } from './OrLoader.vue_vue_type_script_lang-5405040c.js';
|
|
8
8
|
import { s as styleInject } from './style-inject.es-4c6f2515.js';
|
|
9
9
|
import './OrOverlay.vue_vue_type_script_lang-cb3aad0c.js';
|
|
@@ -2,6 +2,7 @@ import { defineComponent, ref, computed, watchPostEffect } from 'vue-demi';
|
|
|
2
2
|
import { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
|
|
3
3
|
import '@vueuse/core';
|
|
4
4
|
import { h as hslToColorString, g as generateHslFromString } from './color-1f348774.js';
|
|
5
|
+
import { _ as __vue_component__$1 } from './OrIcon-5e394c62.js';
|
|
5
6
|
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
6
7
|
|
|
7
8
|
var AvatarSize;
|
|
@@ -10,6 +11,7 @@ var AvatarSize;
|
|
|
10
11
|
AvatarSize["L"] = "l";
|
|
11
12
|
AvatarSize["M"] = "m";
|
|
12
13
|
AvatarSize["S"] = "s";
|
|
14
|
+
AvatarSize["XS"] = "xs";
|
|
13
15
|
})(AvatarSize || (AvatarSize = {}));
|
|
14
16
|
var AvatarColor;
|
|
15
17
|
(function (AvatarColor) {
|
|
@@ -34,24 +36,19 @@ const AvatarImage = [
|
|
|
34
36
|
const AvatarRootSizes = {
|
|
35
37
|
'xl': [
|
|
36
38
|
// Box
|
|
37
|
-
'w-[80px]', 'h-[80px]',
|
|
38
|
-
// Typography
|
|
39
|
-
'text-[32px]'],
|
|
39
|
+
'w-[80px]', 'h-[80px]'],
|
|
40
40
|
'l': [
|
|
41
41
|
// Box
|
|
42
|
-
'w-[64px]', 'h-[64px]',
|
|
43
|
-
// Typography
|
|
44
|
-
'text-[24px]'],
|
|
42
|
+
'w-[64px]', 'h-[64px]'],
|
|
45
43
|
'm': [
|
|
46
44
|
// Box
|
|
47
|
-
'w-[40px]', 'h-[40px]',
|
|
48
|
-
// Typography
|
|
49
|
-
'text-[16px]'],
|
|
45
|
+
'w-[40px]', 'h-[40px]'],
|
|
50
46
|
's': [
|
|
51
47
|
// Box
|
|
52
|
-
'w-[32px]', 'h-[32px]',
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
'w-[32px]', 'h-[32px]'],
|
|
49
|
+
'xs': [
|
|
50
|
+
// Box
|
|
51
|
+
'w-[24px]', 'h-[24px]']
|
|
55
52
|
};
|
|
56
53
|
const AvatarRootColors = {
|
|
57
54
|
[AvatarColor.blue]: [
|
|
@@ -73,9 +70,26 @@ const AvatarRootColors = {
|
|
|
73
70
|
// Theme
|
|
74
71
|
'text-white', 'dark:text-overlay-dark']
|
|
75
72
|
};
|
|
73
|
+
const AvatarRootAbbreviationSizes = {
|
|
74
|
+
'xl': ['typography-headline-1'],
|
|
75
|
+
'l': ['typography-headline-1'],
|
|
76
|
+
'm': ['typography-body-1-bold'],
|
|
77
|
+
's': ['typography-body-1-bold'],
|
|
78
|
+
'xs': ['typography-caption-semibold']
|
|
79
|
+
};
|
|
80
|
+
const AvatarRootIconSizes = {
|
|
81
|
+
'xl': ['text-[40px]'],
|
|
82
|
+
'l': ['text-[32px]'],
|
|
83
|
+
'm': ['text-[20px]'],
|
|
84
|
+
's': ['text-[16px]'],
|
|
85
|
+
'xs': ['text-[16px]']
|
|
86
|
+
};
|
|
76
87
|
|
|
77
88
|
var script = defineComponent({
|
|
78
89
|
name: 'OrAvatar',
|
|
90
|
+
components: {
|
|
91
|
+
OrIcon: __vue_component__$1
|
|
92
|
+
},
|
|
79
93
|
inheritAttrs: false,
|
|
80
94
|
props: {
|
|
81
95
|
src: {
|
|
@@ -86,6 +100,10 @@ var script = defineComponent({
|
|
|
86
100
|
type: String,
|
|
87
101
|
default: AvatarSize.M
|
|
88
102
|
},
|
|
103
|
+
icon: {
|
|
104
|
+
type: String,
|
|
105
|
+
default: undefined
|
|
106
|
+
},
|
|
89
107
|
color: {
|
|
90
108
|
type: String,
|
|
91
109
|
default: AvatarColor.auto,
|
|
@@ -101,9 +119,12 @@ var script = defineComponent({
|
|
|
101
119
|
setup(props) {
|
|
102
120
|
// Refs
|
|
103
121
|
const root = ref();
|
|
122
|
+
const isIcon = computed(() => {
|
|
123
|
+
return !props.icon;
|
|
124
|
+
});
|
|
104
125
|
// Styles
|
|
105
126
|
const classAttribute = useClassAttribute();
|
|
106
|
-
const rootStyles = computed(() => ['or-avatar', ...AvatarRoot, ...AvatarRootSizes[props.size], ...AvatarRootColors[props.color], classAttribute.value]);
|
|
127
|
+
const rootStyles = computed(() => ['or-avatar', ...AvatarRoot, ...AvatarRootSizes[props.size], ...AvatarRootColors[props.color], ...(isIcon.value ? AvatarRootAbbreviationSizes[props.size] : AvatarRootIconSizes[props.size]), classAttribute.value]);
|
|
107
128
|
const imageStyles = computed(() => [...AvatarImage]);
|
|
108
129
|
// Effects
|
|
109
130
|
watchPostEffect(() => {
|
|
@@ -136,13 +157,18 @@ var __vue_render__ = function () {
|
|
|
136
157
|
ref: "root",
|
|
137
158
|
class: _vm.rootStyles
|
|
138
159
|
}, 'div', _vm.$attrs, false), [_vm._t("default", function () {
|
|
139
|
-
return [_c('img', {
|
|
160
|
+
return [_vm.src ? _c('img', {
|
|
140
161
|
class: _vm.imageStyles,
|
|
141
162
|
attrs: {
|
|
142
163
|
"src": _vm.src,
|
|
143
164
|
"alt": ''
|
|
144
165
|
}
|
|
145
|
-
})
|
|
166
|
+
}) : _vm.icon ? _c('or-icon', {
|
|
167
|
+
attrs: {
|
|
168
|
+
"icon": _vm.icon,
|
|
169
|
+
"size": "inherit"
|
|
170
|
+
}
|
|
171
|
+
}) : _vm._e()];
|
|
146
172
|
})], 2);
|
|
147
173
|
};
|
|
148
174
|
var __vue_staticRenderFns__ = [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { O as OR_AVATAR_SIZE, _ as OrAvatar } from '../OrAvatar-4824c57f.js';
|
|
2
|
-
export { a as AvatarColor, A as AvatarSize, _ as OrAvatarV3 } from '../OrAvatar-
|
|
2
|
+
export { a as AvatarColor, A as AvatarSize, _ as OrAvatarV3 } from '../OrAvatar-3d155af3.js';
|
|
3
3
|
export { _ as OrBottomSheetV3 } from '../OrBottomSheet-16c2e610.js';
|
|
4
4
|
export { _ as OrButton, a as OrButtonColors, b as OrButtonSizes, O as OrButtonViews } from '../OrButton-2ca1c3d6.js';
|
|
5
5
|
export { _ as OrButtonV2 } from '../OrButton-c4f9955b.js';
|
|
@@ -20,7 +20,7 @@ export declare const WithTextInSlot: StoryFn<import("vue").ComponentOptions<impo
|
|
|
20
20
|
} | string[], {} & {}, {
|
|
21
21
|
[x: number]: string;
|
|
22
22
|
} | {}, true>)>;
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const WithIcon: StoryFn<import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<unknown>, import("@vue/composition-api").MethodOptions, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>, import("@vue/composition-api").ExtractPropTypes<import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
24
24
|
[x: string]: ((...args: any[]) => any) | null;
|
|
25
25
|
} | string[], {} & {}, {
|
|
26
26
|
[x: number]: string;
|
|
@@ -13,6 +13,10 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
13
13
|
type: PropType<AvatarSize>;
|
|
14
14
|
default: AvatarSize;
|
|
15
15
|
};
|
|
16
|
+
icon: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: undefined;
|
|
19
|
+
};
|
|
16
20
|
color: {
|
|
17
21
|
type: PropType<AvatarColor>;
|
|
18
22
|
default: AvatarColor;
|
|
@@ -32,6 +36,10 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
32
36
|
type: PropType<AvatarSize>;
|
|
33
37
|
default: AvatarSize;
|
|
34
38
|
};
|
|
39
|
+
icon: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
default: undefined;
|
|
42
|
+
};
|
|
35
43
|
color: {
|
|
36
44
|
type: PropType<AvatarColor>;
|
|
37
45
|
default: AvatarColor;
|
|
@@ -45,6 +53,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
45
53
|
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
46
54
|
src: string;
|
|
47
55
|
size: AvatarSize;
|
|
56
|
+
icon: string;
|
|
48
57
|
color: AvatarColor;
|
|
49
58
|
colorSalt: string;
|
|
50
59
|
} & {}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
@@ -54,11 +63,13 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
54
63
|
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, {}, {
|
|
55
64
|
src: string;
|
|
56
65
|
size: AvatarSize;
|
|
66
|
+
icon: string;
|
|
57
67
|
color: AvatarColor;
|
|
58
68
|
colorSalt: string;
|
|
59
69
|
} & {}, {
|
|
60
70
|
src: string;
|
|
61
71
|
size: AvatarSize;
|
|
72
|
+
icon: string;
|
|
62
73
|
color: AvatarColor;
|
|
63
74
|
colorSalt: string;
|
|
64
75
|
}, true>);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { a as AvatarColor, A as AvatarSize, _ as OrAvatarV3 } from '../../OrAvatar-
|
|
1
|
+
export { a as AvatarColor, A as AvatarSize, _ as OrAvatarV3 } from '../../OrAvatar-3d155af3.js';
|
|
2
2
|
import 'vue-demi';
|
|
3
3
|
import '../../useClassAttribute-47fdb016.js';
|
|
4
4
|
import '@vueuse/core';
|
|
5
5
|
import '../../color-1f348774.js';
|
|
6
|
+
import '../../OrIcon-5e394c62.js';
|
|
6
7
|
import '../../normalize-component-6e8e3d80.js';
|
|
@@ -3,3 +3,5 @@ export declare const AvatarRoot: string[];
|
|
|
3
3
|
export declare const AvatarImage: string[];
|
|
4
4
|
export declare const AvatarRootSizes: Record<AvatarSize, string[]>;
|
|
5
5
|
export declare const AvatarRootColors: Record<AvatarColor, string[]>;
|
|
6
|
+
export declare const AvatarRootAbbreviationSizes: Record<AvatarSize, string[]>;
|
|
7
|
+
export declare const AvatarRootIconSizes: Record<AvatarSize, string[]>;
|
package/dist/esm/v2/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { O as OR_AVATAR_SIZE, _ as OrAvatar } from './OrAvatar-4824c57f.js';
|
|
2
|
-
export { a as AvatarColor, A as AvatarSize, _ as OrAvatarV3 } from './OrAvatar-
|
|
2
|
+
export { a as AvatarColor, A as AvatarSize, _ as OrAvatarV3 } from './OrAvatar-3d155af3.js';
|
|
3
3
|
export { _ as OrBottomSheetV3 } from './OrBottomSheet-16c2e610.js';
|
|
4
4
|
export { _ as OrButton, a as OrButtonColors, b as OrButtonSizes, O as OrButtonViews } from './OrButton-2ca1c3d6.js';
|
|
5
5
|
export { _ as OrButtonV2 } from './OrButton-c4f9955b.js';
|
|
@@ -2,7 +2,8 @@ import { defineComponent, ref, computed, watchPostEffect } from 'vue-demi';
|
|
|
2
2
|
import { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
|
|
3
3
|
import '@vueuse/core';
|
|
4
4
|
import { h as hslToColorString, g as generateHslFromString } from './color-1f348774.js';
|
|
5
|
-
import {
|
|
5
|
+
import { s as script$1 } from './OrIcon-b195169c.js';
|
|
6
|
+
import { resolveComponent, openBlock, createElementBlock, mergeProps, renderSlot, normalizeClass, createBlock, createCommentVNode } from 'vue';
|
|
6
7
|
|
|
7
8
|
var AvatarSize;
|
|
8
9
|
(function (AvatarSize) {
|
|
@@ -10,6 +11,7 @@ var AvatarSize;
|
|
|
10
11
|
AvatarSize["L"] = "l";
|
|
11
12
|
AvatarSize["M"] = "m";
|
|
12
13
|
AvatarSize["S"] = "s";
|
|
14
|
+
AvatarSize["XS"] = "xs";
|
|
13
15
|
})(AvatarSize || (AvatarSize = {}));
|
|
14
16
|
var AvatarColor;
|
|
15
17
|
(function (AvatarColor) {
|
|
@@ -34,24 +36,19 @@ const AvatarImage = [
|
|
|
34
36
|
const AvatarRootSizes = {
|
|
35
37
|
'xl': [
|
|
36
38
|
// Box
|
|
37
|
-
'w-[80px]', 'h-[80px]',
|
|
38
|
-
// Typography
|
|
39
|
-
'text-[32px]'],
|
|
39
|
+
'w-[80px]', 'h-[80px]'],
|
|
40
40
|
'l': [
|
|
41
41
|
// Box
|
|
42
|
-
'w-[64px]', 'h-[64px]',
|
|
43
|
-
// Typography
|
|
44
|
-
'text-[24px]'],
|
|
42
|
+
'w-[64px]', 'h-[64px]'],
|
|
45
43
|
'm': [
|
|
46
44
|
// Box
|
|
47
|
-
'w-[40px]', 'h-[40px]',
|
|
48
|
-
// Typography
|
|
49
|
-
'text-[16px]'],
|
|
45
|
+
'w-[40px]', 'h-[40px]'],
|
|
50
46
|
's': [
|
|
51
47
|
// Box
|
|
52
|
-
'w-[32px]', 'h-[32px]',
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
'w-[32px]', 'h-[32px]'],
|
|
49
|
+
'xs': [
|
|
50
|
+
// Box
|
|
51
|
+
'w-[24px]', 'h-[24px]']
|
|
55
52
|
};
|
|
56
53
|
const AvatarRootColors = {
|
|
57
54
|
[AvatarColor.blue]: [
|
|
@@ -73,9 +70,26 @@ const AvatarRootColors = {
|
|
|
73
70
|
// Theme
|
|
74
71
|
'text-white', 'dark:text-overlay-dark']
|
|
75
72
|
};
|
|
73
|
+
const AvatarRootAbbreviationSizes = {
|
|
74
|
+
'xl': ['typography-headline-1'],
|
|
75
|
+
'l': ['typography-headline-1'],
|
|
76
|
+
'm': ['typography-body-1-bold'],
|
|
77
|
+
's': ['typography-body-1-bold'],
|
|
78
|
+
'xs': ['typography-caption-semibold']
|
|
79
|
+
};
|
|
80
|
+
const AvatarRootIconSizes = {
|
|
81
|
+
'xl': ['text-[40px]'],
|
|
82
|
+
'l': ['text-[32px]'],
|
|
83
|
+
'm': ['text-[20px]'],
|
|
84
|
+
's': ['text-[16px]'],
|
|
85
|
+
'xs': ['text-[16px]']
|
|
86
|
+
};
|
|
76
87
|
|
|
77
88
|
var script = defineComponent({
|
|
78
89
|
name: 'OrAvatar',
|
|
90
|
+
components: {
|
|
91
|
+
OrIcon: script$1
|
|
92
|
+
},
|
|
79
93
|
inheritAttrs: false,
|
|
80
94
|
props: {
|
|
81
95
|
src: {
|
|
@@ -86,6 +100,10 @@ var script = defineComponent({
|
|
|
86
100
|
type: String,
|
|
87
101
|
default: AvatarSize.M
|
|
88
102
|
},
|
|
103
|
+
icon: {
|
|
104
|
+
type: String,
|
|
105
|
+
default: undefined
|
|
106
|
+
},
|
|
89
107
|
color: {
|
|
90
108
|
type: String,
|
|
91
109
|
default: AvatarColor.auto,
|
|
@@ -101,9 +119,12 @@ var script = defineComponent({
|
|
|
101
119
|
setup(props) {
|
|
102
120
|
// Refs
|
|
103
121
|
const root = ref();
|
|
122
|
+
const isIcon = computed(() => {
|
|
123
|
+
return !props.icon;
|
|
124
|
+
});
|
|
104
125
|
// Styles
|
|
105
126
|
const classAttribute = useClassAttribute();
|
|
106
|
-
const rootStyles = computed(() => ['or-avatar', ...AvatarRoot, ...AvatarRootSizes[props.size], ...AvatarRootColors[props.color], classAttribute.value]);
|
|
127
|
+
const rootStyles = computed(() => ['or-avatar', ...AvatarRoot, ...AvatarRootSizes[props.size], ...AvatarRootColors[props.color], ...(isIcon.value ? AvatarRootAbbreviationSizes[props.size] : AvatarRootIconSizes[props.size]), classAttribute.value]);
|
|
107
128
|
const imageStyles = computed(() => [...AvatarImage]);
|
|
108
129
|
// Effects
|
|
109
130
|
watchPostEffect(() => {
|
|
@@ -126,15 +147,21 @@ var script = defineComponent({
|
|
|
126
147
|
|
|
127
148
|
const _hoisted_1 = ["src"];
|
|
128
149
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
150
|
+
const _component_or_icon = resolveComponent("or-icon");
|
|
129
151
|
return openBlock(), createElementBlock("div", mergeProps({
|
|
130
152
|
ref: "root"
|
|
131
153
|
}, _ctx.$attrs, {
|
|
132
154
|
class: _ctx.rootStyles
|
|
133
|
-
}), [renderSlot(_ctx.$slots, "default", {}, () => [
|
|
155
|
+
}), [renderSlot(_ctx.$slots, "default", {}, () => [_ctx.src ? (openBlock(), createElementBlock("img", {
|
|
156
|
+
key: 0,
|
|
134
157
|
class: normalizeClass(_ctx.imageStyles),
|
|
135
158
|
src: _ctx.src,
|
|
136
159
|
alt: ''
|
|
137
|
-
}, null, 10 /* CLASS, PROPS */, _hoisted_1)
|
|
160
|
+
}, null, 10 /* CLASS, PROPS */, _hoisted_1)) : _ctx.icon ? (openBlock(), createBlock(_component_or_icon, {
|
|
161
|
+
key: 1,
|
|
162
|
+
icon: _ctx.icon,
|
|
163
|
+
size: "inherit"
|
|
164
|
+
}, null, 8 /* PROPS */, ["icon"])) : createCommentVNode("v-if", true)])], 16 /* FULL_PROPS */);
|
|
138
165
|
}
|
|
139
166
|
|
|
140
167
|
script.render = render;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { O as OR_AVATAR_SIZE, s as OrAvatar } from '../OrAvatar-2808a314.js';
|
|
2
|
-
export { a as AvatarColor, A as AvatarSize, s as OrAvatarV3 } from '../OrAvatar-
|
|
2
|
+
export { a as AvatarColor, A as AvatarSize, s as OrAvatarV3 } from '../OrAvatar-53a4429d.js';
|
|
3
3
|
export { s as OrBottomSheetV3 } from '../OrBottomSheet-62817aec.js';
|
|
4
4
|
export { s as OrButton, a as OrButtonColors, b as OrButtonSizes, O as OrButtonViews } from '../OrButton-fca9019a.js';
|
|
5
5
|
export { b as BUTTON_COLOR, d as BUTTON_LOADER_TYPE, c as BUTTON_SIZE, B as BUTTON_TYPE, I as ICON_BUTTON_TYPE, s as OrButtonV2, a as OrIconButton } from '../OrIconButton-8be9c89f.js';
|
|
@@ -20,7 +20,7 @@ export declare const WithTextInSlot: StoryFn<import("vue").ComponentOptions<impo
|
|
|
20
20
|
} | string[], {} & {}, {
|
|
21
21
|
[x: number]: string;
|
|
22
22
|
} | {}, true>)>;
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const WithIcon: StoryFn<import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<unknown>, import("@vue/composition-api").MethodOptions, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>, import("@vue/composition-api").ExtractPropTypes<import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
24
24
|
[x: string]: ((...args: any[]) => any) | null;
|
|
25
25
|
} | string[], {} & {}, {
|
|
26
26
|
[x: number]: string;
|
|
@@ -13,6 +13,10 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
13
13
|
type: PropType<AvatarSize>;
|
|
14
14
|
default: AvatarSize;
|
|
15
15
|
};
|
|
16
|
+
icon: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: undefined;
|
|
19
|
+
};
|
|
16
20
|
color: {
|
|
17
21
|
type: PropType<AvatarColor>;
|
|
18
22
|
default: AvatarColor;
|
|
@@ -32,6 +36,10 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
32
36
|
type: PropType<AvatarSize>;
|
|
33
37
|
default: AvatarSize;
|
|
34
38
|
};
|
|
39
|
+
icon: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
default: undefined;
|
|
42
|
+
};
|
|
35
43
|
color: {
|
|
36
44
|
type: PropType<AvatarColor>;
|
|
37
45
|
default: AvatarColor;
|
|
@@ -45,6 +53,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
45
53
|
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
46
54
|
src: string;
|
|
47
55
|
size: AvatarSize;
|
|
56
|
+
icon: string;
|
|
48
57
|
color: AvatarColor;
|
|
49
58
|
colorSalt: string;
|
|
50
59
|
} & {}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
@@ -54,11 +63,13 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
54
63
|
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, {}, {
|
|
55
64
|
src: string;
|
|
56
65
|
size: AvatarSize;
|
|
66
|
+
icon: string;
|
|
57
67
|
color: AvatarColor;
|
|
58
68
|
colorSalt: string;
|
|
59
69
|
} & {}, {
|
|
60
70
|
src: string;
|
|
61
71
|
size: AvatarSize;
|
|
72
|
+
icon: string;
|
|
62
73
|
color: AvatarColor;
|
|
63
74
|
colorSalt: string;
|
|
64
75
|
}, true>);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { a as AvatarColor, A as AvatarSize, s as OrAvatarV3 } from '../../OrAvatar-
|
|
1
|
+
export { a as AvatarColor, A as AvatarSize, s as OrAvatarV3 } from '../../OrAvatar-53a4429d.js';
|
|
2
2
|
import 'vue-demi';
|
|
3
3
|
import '../../useClassAttribute-47fdb016.js';
|
|
4
4
|
import '@vueuse/core';
|
|
5
5
|
import '../../color-1f348774.js';
|
|
6
|
+
import '../../OrIcon-b195169c.js';
|
|
6
7
|
import 'vue';
|
|
@@ -3,3 +3,5 @@ export declare const AvatarRoot: string[];
|
|
|
3
3
|
export declare const AvatarImage: string[];
|
|
4
4
|
export declare const AvatarRootSizes: Record<AvatarSize, string[]>;
|
|
5
5
|
export declare const AvatarRootColors: Record<AvatarColor, string[]>;
|
|
6
|
+
export declare const AvatarRootAbbreviationSizes: Record<AvatarSize, string[]>;
|
|
7
|
+
export declare const AvatarRootIconSizes: Record<AvatarSize, string[]>;
|
package/dist/esm/v3/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { O as OR_AVATAR_SIZE, s as OrAvatar } from './OrAvatar-2808a314.js';
|
|
2
|
-
export { a as AvatarColor, A as AvatarSize, s as OrAvatarV3 } from './OrAvatar-
|
|
2
|
+
export { a as AvatarColor, A as AvatarSize, s as OrAvatarV3 } from './OrAvatar-53a4429d.js';
|
|
3
3
|
export { s as OrBottomSheetV3 } from './OrBottomSheet-62817aec.js';
|
|
4
4
|
export { s as OrButton, a as OrButtonColors, b as OrButtonSizes, O as OrButtonViews } from './OrButton-fca9019a.js';
|
|
5
5
|
export { b as BUTTON_COLOR, d as BUTTON_LOADER_TYPE, c as BUTTON_SIZE, B as BUTTON_TYPE, I as ICON_BUTTON_TYPE, s as OrButtonV2, a as OrIconButton } from './OrIconButton-8be9c89f.js';
|
package/package.json
CHANGED
|
@@ -2,7 +2,6 @@ import { Meta, StoryFn } from '@storybook/vue3';
|
|
|
2
2
|
import OrAvatarDocs from './OrAvatar.docs.mdx';
|
|
3
3
|
import OrAvatar from './OrAvatar.vue';
|
|
4
4
|
import { AvatarColor, AvatarSize } from './props';
|
|
5
|
-
import { OrIconV3 as OrIcon } from '../or-icon-v3';
|
|
6
5
|
import { getAbbreviation } from '../../utils/functions/text';
|
|
7
6
|
import { computed } from 'vue-demi';
|
|
8
7
|
|
|
@@ -39,6 +38,10 @@ export default {
|
|
|
39
38
|
colorSalt: {
|
|
40
39
|
control: { type: 'text' },
|
|
41
40
|
},
|
|
41
|
+
|
|
42
|
+
icon: {
|
|
43
|
+
control: { type: 'text' },
|
|
44
|
+
},
|
|
42
45
|
},
|
|
43
46
|
|
|
44
47
|
parameters: {
|
|
@@ -58,7 +61,6 @@ export default {
|
|
|
58
61
|
const DefaultTemplate: StoryFn<typeof OrAvatar> = (args) => ({
|
|
59
62
|
components: {
|
|
60
63
|
OrAvatar,
|
|
61
|
-
OrIcon,
|
|
62
64
|
},
|
|
63
65
|
|
|
64
66
|
setup() {
|
|
@@ -114,22 +116,22 @@ WithTextInSlot.args = {
|
|
|
114
116
|
colorSalt: 'A username',
|
|
115
117
|
};
|
|
116
118
|
|
|
117
|
-
export const
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
export const WithIcon = DefaultTemplate.bind({});
|
|
120
|
+
WithIcon.args = {
|
|
121
|
+
icon: 'store',
|
|
120
122
|
colorSalt: 'Any string here',
|
|
121
123
|
};
|
|
122
124
|
|
|
123
125
|
export const WithColor = DefaultTemplate.bind({});
|
|
124
126
|
WithColor.args = {
|
|
125
127
|
color: AvatarColor.blue,
|
|
126
|
-
|
|
128
|
+
icon: 'person',
|
|
127
129
|
};
|
|
128
130
|
|
|
129
131
|
export const XL = DefaultTemplate.bind({});
|
|
130
132
|
XL.args = {
|
|
131
133
|
size: AvatarSize.XL,
|
|
132
|
-
|
|
134
|
+
icon: 'person',
|
|
133
135
|
colorSalt: 'Big Avatar',
|
|
134
136
|
};
|
|
135
137
|
|
|
@@ -6,10 +6,16 @@
|
|
|
6
6
|
>
|
|
7
7
|
<slot>
|
|
8
8
|
<img
|
|
9
|
+
v-if="src"
|
|
9
10
|
:class="imageStyles"
|
|
10
11
|
:src="src"
|
|
11
12
|
:alt="''"
|
|
12
13
|
>
|
|
14
|
+
<or-icon
|
|
15
|
+
v-else-if="icon"
|
|
16
|
+
:icon="icon"
|
|
17
|
+
size="inherit"
|
|
18
|
+
/>
|
|
13
19
|
</slot>
|
|
14
20
|
</div>
|
|
15
21
|
</template>
|
|
@@ -19,10 +25,14 @@ import { computed, defineComponent, PropType, ref, watchPostEffect } from 'vue-d
|
|
|
19
25
|
import { useClassAttribute } from '../../hooks';
|
|
20
26
|
import { generateHslFromString, hslToColorString } from '../../utils/functions/color';
|
|
21
27
|
import { AvatarColor, AvatarSize } from './props';
|
|
22
|
-
import { AvatarImage, AvatarRoot, AvatarRootColors, AvatarRootSizes } from './styles';
|
|
28
|
+
import { AvatarImage, AvatarRoot, AvatarRootColors, AvatarRootSizes, AvatarRootAbbreviationSizes, AvatarRootIconSizes } from './styles';
|
|
29
|
+
import { OrIconV3 as OrIcon } from '../or-icon-v3';
|
|
23
30
|
|
|
24
31
|
export default defineComponent({
|
|
25
32
|
name: 'OrAvatar',
|
|
33
|
+
components: {
|
|
34
|
+
OrIcon,
|
|
35
|
+
},
|
|
26
36
|
|
|
27
37
|
inheritAttrs: false,
|
|
28
38
|
|
|
@@ -36,7 +46,10 @@ export default defineComponent({
|
|
|
36
46
|
type: String as PropType<AvatarSize>,
|
|
37
47
|
default: AvatarSize.M,
|
|
38
48
|
},
|
|
39
|
-
|
|
49
|
+
icon: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: undefined,
|
|
52
|
+
},
|
|
40
53
|
color: {
|
|
41
54
|
type: String as PropType<AvatarColor>,
|
|
42
55
|
default: AvatarColor.auto,
|
|
@@ -58,6 +71,9 @@ export default defineComponent({
|
|
|
58
71
|
// Refs
|
|
59
72
|
const root = ref<HTMLElement>();
|
|
60
73
|
|
|
74
|
+
const isIcon = computed(() => {
|
|
75
|
+
return !props.icon;
|
|
76
|
+
});
|
|
61
77
|
// Styles
|
|
62
78
|
const classAttribute = useClassAttribute();
|
|
63
79
|
|
|
@@ -66,6 +82,10 @@ export default defineComponent({
|
|
|
66
82
|
...AvatarRoot,
|
|
67
83
|
...AvatarRootSizes[props.size],
|
|
68
84
|
...AvatarRootColors[props.color],
|
|
85
|
+
...(isIcon.value
|
|
86
|
+
? AvatarRootAbbreviationSizes[props.size]
|
|
87
|
+
: AvatarRootIconSizes[props.size]
|
|
88
|
+
),
|
|
69
89
|
classAttribute.value,
|
|
70
90
|
]);
|
|
71
91
|
|