@retailcrm/embed-ui-v1-components 0.5.6 → 0.5.8

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 CHANGED
@@ -1,5 +1,7 @@
1
1
  # `@retailcrm/embed-ui-v1-components`
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/@retailcrm/embed-ui-v1-components.svg)](https://www.npmjs.com/package/@retailcrm/embed-ui-v1-components)
4
+
3
5
  Компоненты UI для использования в JS-расширениях RetailCRM
4
6
 
5
7
  ## Установка
@@ -34,9 +36,8 @@ import { UiButton } from '@retailcrm/embed-ui-v1-components/remote'
34
36
  </script>
35
37
  ```
36
38
 
37
- **⚠ Важно**
38
-
39
- Расширения используют определения из remote части для передачи системе инструкций, из чего собирать
39
+ > [!IMPORTANT]
40
+ > Расширения используют определения из remote части для передачи системе инструкций, из чего собирать
40
41
  интерфейс. Библиотека также содержит `@retailcrm/embed-ui-v1-components/host` &ndash; набор компонентов,
41
42
  который будет использовать CRM при интерпретации инструкций от расширений. **_Не используйте_** host компоненты
42
- как часть кода расширения.
43
+ как часть кода расширения.
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M8.22 12.7199C8.07931 12.5793 8.00018 12.3887 8 12.1899V11.8099C8.0023 11.6114 8.08112 11.4216 8.22 11.2799L13.36 6.14985C13.4539 6.0552 13.5817 6.00195 13.715 6.00195C13.8483 6.00195 13.9761 6.0552 14.07 6.14985L14.78 6.85985C14.8741 6.95202 14.9271 7.07816 14.9271 7.20985C14.9271 7.34154 14.8741 7.46769 14.78 7.55985L10.33 11.9999L14.78 16.4399C14.8747 16.5337 14.9279 16.6615 14.9279 16.7949C14.9279 16.9282 14.8747 17.056 14.78 17.1499L14.07 17.8499C13.9761 17.9445 13.8483 17.9978 13.715 17.9978C13.5817 17.9978 13.4539 17.9445 13.36 17.8499L8.22 12.7199Z" fill="currentColor"/>
3
+ </svg>
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 8">
2
+ <g fill="currentColor">
3
+ <path d="M0 0V8H2.86724C3.70479 7.99267 4.34983 7.79121 4.80238 7.3956C5.25492 7 5.48119 6.41758 5.48119 5.64835C5.48119 5.1978 5.37144 4.81685 5.15192 4.50549C4.93578 4.19414 4.63858 3.98718 4.26034 3.88462C4.5913 3.74542 4.84966 3.52747 5.0354 3.23077C5.22115 2.9304 5.31402 2.58425 5.31402 2.19231C5.31402 1.47436 5.08268 0.930403 4.62001 0.560439C4.15733 0.186813 3.47852 0 2.58356 0H0ZM1.51974 6.67582V4.51648H2.91283C3.61191 4.52747 3.96145 4.89927 3.96145 5.63187C3.96145 5.95788 3.86014 6.21429 3.65751 6.4011C3.45825 6.58425 3.17963 6.67582 2.82165 6.67582H1.51974ZM2.64435 3.35165H1.51974V1.33517H2.58356C3.00233 1.33517 3.30797 1.41575 3.50047 1.57692C3.69634 1.73443 3.79428 1.99451 3.79428 2.35714C3.79428 3.00549 3.41097 3.337 2.64435 3.35165Z" />
4
+ <path d="M7.50306 6.35165H10.1677L10.6793 8H12.2953L9.53444 0H8.12615L5.38049 8H6.99648L7.50306 6.35165ZM9.75734 5.01648H7.91339L8.8303 2.02198L9.75734 5.01648Z" />
5
+ <path d="M12.3618 8V0H14.6312C15.2797 0 15.8589 0.159341 16.3688 0.478022C16.8821 0.79304 17.2823 1.24359 17.5694 1.82967C17.8565 2.41209 18 3.07509 18 3.81868V4.18681C18 4.9304 17.8582 5.59158 17.5745 6.17033C17.2942 6.74908 16.8973 7.1978 16.384 7.51648C15.8707 7.83516 15.2915 7.99634 14.6464 8H12.3618ZM13.8815 1.33517V6.67582H14.616C15.2104 6.67582 15.6647 6.4652 15.9787 6.04396C16.2928 5.62271 16.4532 5.02015 16.46 4.23626V3.81319C16.46 3 16.3046 2.38462 15.9939 1.96703C15.6832 1.54579 15.229 1.33517 14.6312 1.33517H13.8815Z" />
6
+ </g>
7
+ </svg>
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 8">
2
+ <g fill="currentColor">
3
+ <path d="M3.37348 6.01648L5.05767 0H6.76227L4.17475 8H2.57732L0 0H1.6995L3.37348 6.01648Z" />
4
+ <path d="M8.9901 8H7.45902V0H8.9901V8Z" />
5
+ <path d="M11.8406 8V5.18132H13.1828C14.064 5.18132 14.753 4.95604 15.2498 4.50549C15.7499 4.05128 16 3.43223 16 2.64835C16 2.13187 15.886 1.67216 15.6581 1.26923C15.4301 0.862638 15.1035 0.549451 14.6782 0.32967C14.2563 0.10989 13.7663 0 13.2083 0H10.3095V8H11.8406ZM13.2083 3.84615H11.8406V1.33517H13.2441C13.6217 1.34249 13.9177 1.46703 14.1321 1.70879C14.3464 1.95055 14.4536 2.2674 14.4536 2.65934C14.4536 3.04029 14.3464 3.33333 14.1321 3.53846C13.9211 3.74359 13.6132 3.84615 13.2083 3.84615Z" />
6
+ </g>
7
+ </svg>
@@ -21,6 +21,11 @@
21
21
  height: @size;
22
22
  }
23
23
 
24
+ .rectangle(@width, @height) {
25
+ width: @width;
26
+ height: @height;
27
+ }
28
+
24
29
  .square-rounded (@size, @border-radius) {
25
30
  .square(@size);
26
31
  border-radius: @border-radius;
package/dist/host.cjs CHANGED
@@ -4,14 +4,236 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
6
6
  const vue = require("vue");
7
+ const _hoisted_1$e = {
8
+ xmlns: "http://www.w3.org/2000/svg",
9
+ viewBox: "0 0 24 24"
10
+ };
11
+ function render$7(_ctx, _cache) {
12
+ return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$e, _cache[0] || (_cache[0] = [
13
+ vue.createElementVNode("path", {
14
+ fill: "currentColor",
15
+ "fill-rule": "evenodd",
16
+ d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10A10 10 0 0 0 12 2m0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16m3.237-10.576A2.424 2.424 0 0 0 12.812 7H11.13a2.424 2.424 0 0 0-2.424 2.424v.421c0 .233.188.421.42.421h.64a.42.42 0 0 0 .421-.42v-.422a.943.943 0 0 1 .943-.942h1.683c.521 0 .943.422.943.942v.472a.95.95 0 0 1-.64.9l-.8.261a1.58 1.58 0 0 0-1.085 1.499v.656c0 .233.188.421.42.421h.64a.42.42 0 0 0 .421-.42v-.657a.11.11 0 0 1 .101-.101l.8-.261a2.43 2.43 0 0 0 1.684-2.298zm-2.845 5.893h-.842a.42.42 0 0 0-.421.42v.842c0 .233.188.421.42.421h.843a.42.42 0 0 0 .42-.42v-.843a.42.42 0 0 0-.42-.42",
17
+ "clip-rule": "evenodd"
18
+ }, null, -1)
19
+ ]));
20
+ }
21
+ const IconHelpOutlined = { render: render$7 };
22
+ const _hoisted_1$d = {
23
+ xmlns: "http://www.w3.org/2000/svg",
24
+ viewBox: "0 0 18 8"
25
+ };
26
+ function render$6(_ctx, _cache) {
27
+ return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$d, _cache[0] || (_cache[0] = [
28
+ vue.createElementVNode("g", { fill: "currentColor" }, [
29
+ vue.createElementVNode("path", { d: "M0 0v8h2.867q1.257-.011 1.935-.604.68-.594.68-1.748 0-.675-.33-1.143a1.54 1.54 0 0 0-.892-.62q.497-.21.775-.654.279-.45.279-1.039 0-1.077-.694-1.632Q3.926 0 2.584 0zm1.52 6.676v-2.16h1.393q1.048.016 1.048 1.116 0 .488-.303.77-.3.273-.836.274zm1.124-3.324H1.52V1.335h1.064q.628 0 .916.242.294.236.294.78 0 .972-1.15.995M7.503 6.352h2.665L10.679 8h1.616l-2.76-8H8.125L5.38 8h1.616zm2.254-1.336H7.913l.917-2.994zM12.362 8V0h2.27q.972 0 1.737.478.77.473 1.2 1.352.432.873.431 1.989v.368q0 1.115-.425 1.983a3.17 3.17 0 0 1-1.191 1.346A3.26 3.26 0 0 1 14.646 8zm1.52-6.665v5.34h.734q.891 0 1.363-.631.47-.632.481-1.808v-.423q0-1.22-.466-1.846-.466-.632-1.363-.632z" })
30
+ ], -1)
31
+ ]));
32
+ }
33
+ const SpriteBAD = { render: render$6 };
34
+ const _hoisted_1$c = {
35
+ xmlns: "http://www.w3.org/2000/svg",
36
+ viewBox: "0 0 16 8"
37
+ };
38
+ function render$5(_ctx, _cache) {
39
+ return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$c, _cache[0] || (_cache[0] = [
40
+ vue.createElementVNode("g", { fill: "currentColor" }, [
41
+ vue.createElementVNode("path", { d: "M3.373 6.016 5.058 0h1.704L4.175 8H2.577L0 0h1.7zM8.99 8H7.46V0H8.99zM11.84 8V5.181h1.343q1.322 0 2.067-.676.75-.681.75-1.857 0-.774-.342-1.379a2.3 2.3 0 0 0-.98-.94Q14.045 0 13.208 0H10.31v8zm1.368-4.154h-1.367v-2.51h1.403q.567.01.888.373t.322.95q0 .571-.322.88-.316.307-.924.307" })
42
+ ], -1)
43
+ ]));
44
+ }
45
+ const SpriteVIP = { render: render$5 };
7
46
  const isURL = (href) => {
8
47
  try {
9
- new URL(href);
10
- return true;
48
+ const normalizedHref = href.includes("://") ? href : `http://${href}`;
49
+ const url = new URL(normalizedHref);
50
+ const urlPattern = /^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\S*)$/;
51
+ return urlPattern.test(url.href);
11
52
  } catch {
12
53
  return false;
13
54
  }
14
55
  };
56
+ const AvatarSizeKey = Symbol("UiAvatarSize");
57
+ var SIZE$5 = /* @__PURE__ */ ((SIZE2) => {
58
+ SIZE2["XS"] = "xs";
59
+ SIZE2["SM"] = "sm";
60
+ SIZE2["LG"] = "lg";
61
+ return SIZE2;
62
+ })(SIZE$5 || {});
63
+ var STATUS = /* @__PURE__ */ ((STATUS2) => {
64
+ STATUS2["NONE"] = "";
65
+ STATUS2["BUSY"] = "busy";
66
+ STATUS2["BREAK"] = "break";
67
+ STATUS2["DINNER"] = "dinner";
68
+ STATUS2["FREE"] = "free";
69
+ return STATUS2;
70
+ })(STATUS || {});
71
+ const _hoisted_1$b = ["src"];
72
+ const _hoisted_2$4 = {
73
+ key: 1,
74
+ class: "ui-v1-avatar__unresolved"
75
+ };
76
+ const _hoisted_3$3 = {
77
+ key: 3,
78
+ class: "ui-v1-avatar__initials"
79
+ };
80
+ const _hoisted_4$1 = {
81
+ key: 4,
82
+ class: "ui-v1-avatar__labels"
83
+ };
84
+ const _hoisted_5$1 = {
85
+ key: 0,
86
+ class: "ui-v1-avatar__label ui-v1-avatar__label_vip"
87
+ };
88
+ const _hoisted_6 = {
89
+ key: 1,
90
+ class: "ui-v1-avatar__label ui-v1-avatar__label_bad"
91
+ };
92
+ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
93
+ __name: "UiAvatar",
94
+ props: {
95
+ /** Путь к изображению */
96
+ src: {
97
+ type: String,
98
+ validator: (src) => isURL(src) || src.length === 0,
99
+ default: ""
100
+ },
101
+ /** Наименование участника */
102
+ name: {
103
+ type: String,
104
+ default: null
105
+ },
106
+ /** Ссылка для перехода */
107
+ href: {
108
+ type: String,
109
+ validator: (href) => isURL(href) || href.length === 0,
110
+ default: ""
111
+ },
112
+ /** Статус пользователя */
113
+ status: {
114
+ type: String,
115
+ validator: (status) => Object.values(STATUS).includes(status),
116
+ default: null
117
+ },
118
+ /** Пометка VIP в карточке пользователя */
119
+ vip: {
120
+ type: Boolean,
121
+ default: false
122
+ },
123
+ /** Пометка BAD в карточке пользователя */
124
+ bad: {
125
+ type: Boolean,
126
+ default: false
127
+ },
128
+ /** Размер изображения */
129
+ size: {
130
+ type: String,
131
+ validator: (size) => Object.values(SIZE$5).includes(size),
132
+ default: SIZE$5.SM
133
+ }
134
+ },
135
+ setup(__props) {
136
+ const firstLetterOf = (name) => name.charAt(0).toUpperCase();
137
+ const props = __props;
138
+ const slots = vue.useSlots();
139
+ const loaded = vue.ref(false);
140
+ const unresolved = vue.computed(() => !(props.name || slots.default));
141
+ const initials = vue.computed(() => {
142
+ if (!props.name) {
143
+ return "";
144
+ }
145
+ const [firstName, ...otherNames] = props.name.split(" ");
146
+ return otherNames.length > 0 ? firstLetterOf(firstName) + firstLetterOf(otherNames[otherNames.length - 1]) : firstLetterOf(firstName);
147
+ });
148
+ const size = vue.inject(AvatarSizeKey, vue.computed(() => props.size));
149
+ return (_ctx, _cache) => {
150
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.href ? "a" : "div"), vue.mergeProps({
151
+ ref: "root",
152
+ href: __props.href || void 0,
153
+ class: {
154
+ ["ui-v1-avatar"]: true,
155
+ [`ui-v1-avatar_${vue.unref(size)}`]: true,
156
+ ["ui-v1-avatar_bad"]: __props.bad,
157
+ ["ui-v1-avatar_vip"]: __props.vip
158
+ }
159
+ }, _ctx.$attrs), {
160
+ default: vue.withCtx(() => [
161
+ __props.src ? (vue.openBlock(), vue.createElementBlock("img", {
162
+ key: 0,
163
+ src: __props.src,
164
+ alt: "",
165
+ class: "ui-v1-avatar__image",
166
+ draggable: "false",
167
+ onLoad: _cache[0] || (_cache[0] = ($event) => loaded.value = true),
168
+ onError: _cache[1] || (_cache[1] = ($event) => loaded.value = false)
169
+ }, null, 40, _hoisted_1$b)) : !__props.src && unresolved.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$4, [
170
+ vue.createVNode(vue.unref(IconHelpOutlined))
171
+ ])) : vue.createCommentVNode("", true),
172
+ __props.status && !(__props.vip || __props.bad) ? (vue.openBlock(), vue.createElementBlock("span", {
173
+ key: 2,
174
+ class: vue.normalizeClass({
175
+ ["ui-v1-avatar__status"]: true,
176
+ [`ui-v1-avatar__status_${vue.unref(size)}`]: true,
177
+ [`ui-v1-avatar__status_${__props.status}`]: __props.status
178
+ })
179
+ }, null, 2)) : vue.createCommentVNode("", true),
180
+ !(unresolved.value || loaded.value) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, [
181
+ vue.renderSlot(_ctx.$slots, "default", {}, () => [
182
+ vue.createTextVNode(vue.toDisplayString(initials.value), 1)
183
+ ])
184
+ ])) : vue.createCommentVNode("", true),
185
+ __props.vip || __props.bad ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [
186
+ __props.vip ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$1, [
187
+ vue.createVNode(vue.unref(SpriteVIP), { class: "ui-v1-avatar__vip" })
188
+ ])) : vue.createCommentVNode("", true),
189
+ __props.bad ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6, [
190
+ vue.createVNode(vue.unref(SpriteBAD), { class: "ui-v1-avatar__bad" })
191
+ ])) : vue.createCommentVNode("", true)
192
+ ])) : vue.createCommentVNode("", true)
193
+ ]),
194
+ _: 3
195
+ }, 16, ["href", "class"]);
196
+ };
197
+ }
198
+ });
199
+ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
200
+ __name: "UiAvatarList",
201
+ props: {
202
+ /** Список аватарок пользователей */
203
+ avatars: {
204
+ type: Array,
205
+ default: () => []
206
+ },
207
+ /** Размер аватарок */
208
+ size: {
209
+ type: String,
210
+ validator: (size) => Object.values(SIZE$5).includes(size),
211
+ default: SIZE$5.SM
212
+ }
213
+ },
214
+ setup(__props) {
215
+ const props = __props;
216
+ vue.provide(AvatarSizeKey, vue.computed(() => props.size));
217
+ return (_ctx, _cache) => {
218
+ return vue.openBlock(), vue.createElementBlock("div", {
219
+ class: vue.normalizeClass(["ui-v1-avatar-list", `ui-v1-avatar-list_${__props.size}`])
220
+ }, [
221
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.avatars, (avatar, index) => {
222
+ return vue.openBlock(), vue.createElementBlock("div", {
223
+ key: index,
224
+ class: "ui-v1-avatar-list__item"
225
+ }, [
226
+ vue.createVNode(_sfc_main$h, {
227
+ src: avatar.src,
228
+ name: avatar.name
229
+ }, null, 8, ["src", "name"])
230
+ ]);
231
+ }), 128)),
232
+ vue.renderSlot(_ctx.$slots, "default")
233
+ ], 2);
234
+ };
235
+ }
236
+ });
15
237
  const SHAPE_FLAG_ARRAY_CHILDREN = 16;
16
238
  const SHAPE_FLAG_TEXT = 8;
17
239
  const inlines = ["b", "i", "span", "strong"];
@@ -3480,6 +3702,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
3480
3702
  });
3481
3703
  exports.I18nPlugin = plugin;
3482
3704
  exports.ModalPlugin = plugin$1;
3705
+ exports.UiAvatar = _sfc_main$h;
3706
+ exports.UiAvatarList = _sfc_main$g;
3483
3707
  exports.UiButton = _sfc_main$f;
3484
3708
  exports.UiCheckbox = _sfc_main$e;
3485
3709
  exports.UiError = _sfc_main$d;
package/dist/host.css CHANGED
@@ -1,3 +1,247 @@
1
+ .ui-v1-avatar {
2
+ background-color: #E9ECEE;
3
+ border-radius: 50%;
4
+ position: relative;
5
+ }
6
+ .ui-v1-avatar::before,
7
+ .ui-v1-avatar::after {
8
+ content: '';
9
+ border-radius: 50%;
10
+ position: absolute;
11
+ z-index: 2;
12
+ top: 0;
13
+ left: 0;
14
+ right: 0;
15
+ bottom: 0;
16
+ }
17
+ .ui-v1-avatar_xs {
18
+ width: 24px;
19
+ min-width: 24px;
20
+ height: 24px;
21
+ }
22
+ .ui-v1-avatar_xs .ui-v1-avatar__unresolved svg {
23
+ width: 16px;
24
+ min-width: 16px;
25
+ height: 16px;
26
+ }
27
+ .ui-v1-avatar_xs .ui-v1-avatar__initials {
28
+ font-size: 12px;
29
+ font-weight: 500;
30
+ line-height: 1.16666667;
31
+ }
32
+ .ui-v1-avatar_xs .ui-v1-avatar__label {
33
+ width: 13.33px;
34
+ height: 6.67px;
35
+ }
36
+ .ui-v1-avatar_xs .ui-v1-avatar__vip {
37
+ width: 9.33px;
38
+ height: 4px;
39
+ }
40
+ .ui-v1-avatar_xs .ui-v1-avatar__bad {
41
+ width: 7.62px;
42
+ height: 3.81px;
43
+ }
44
+ .ui-v1-avatar_xs .ui-v1-avatar__status {
45
+ right: 0;
46
+ bottom: 1px;
47
+ }
48
+ .ui-v1-avatar_sm {
49
+ width: 36px;
50
+ min-width: 36px;
51
+ height: 36px;
52
+ }
53
+ .ui-v1-avatar_sm .ui-v1-avatar__unresolved svg {
54
+ width: 20px;
55
+ min-width: 20px;
56
+ height: 20px;
57
+ }
58
+ .ui-v1-avatar_sm .ui-v1-avatar__initials {
59
+ font-size: 12px;
60
+ font-weight: 500;
61
+ line-height: 1.16666667;
62
+ }
63
+ .ui-v1-avatar_sm .ui-v1-avatar__label {
64
+ width: 20px;
65
+ height: 10px;
66
+ }
67
+ .ui-v1-avatar_sm .ui-v1-avatar__vip {
68
+ width: 12px;
69
+ height: 6px;
70
+ }
71
+ .ui-v1-avatar_sm .ui-v1-avatar__bad {
72
+ width: 14px;
73
+ height: 6px;
74
+ }
75
+ .ui-v1-avatar_sm .ui-v1-avatar__status {
76
+ bottom: 2px;
77
+ }
78
+ .ui-v1-avatar_lg {
79
+ width: 52px;
80
+ min-width: 52px;
81
+ height: 52px;
82
+ }
83
+ .ui-v1-avatar_lg .ui-v1-avatar__unresolved svg {
84
+ width: 24px;
85
+ min-width: 24px;
86
+ height: 24px;
87
+ }
88
+ .ui-v1-avatar_lg .ui-v1-avatar__initials {
89
+ font-size: 18px;
90
+ font-weight: 500;
91
+ line-height: 1.55555556;
92
+ }
93
+ .ui-v1-avatar_lg .ui-v1-avatar__label {
94
+ width: 28px;
95
+ height: 14px;
96
+ }
97
+ .ui-v1-avatar_lg .ui-v1-avatar__vip {
98
+ width: 16px;
99
+ height: 8px;
100
+ }
101
+ .ui-v1-avatar_lg .ui-v1-avatar__bad {
102
+ width: 18px;
103
+ height: 8px;
104
+ }
105
+ .ui-v1-avatar_lg .ui-v1-avatar__status {
106
+ right: 4px;
107
+ bottom: 4px;
108
+ }
109
+ .ui-v1-avatar_vip.ui-v1-avatar::before {
110
+ border: 2px solid #FEA530;
111
+ }
112
+ .ui-v1-avatar_bad.ui-v1-avatar::after {
113
+ border: 2px solid #FF5353;
114
+ }
115
+ .ui-v1-avatar.ui-v1-avatar_bad.ui-v1-avatar_vip::before {
116
+ left: 0;
117
+ right: 50%;
118
+ border-radius: 52px 0 0 52px;
119
+ border-right: none;
120
+ }
121
+ .ui-v1-avatar.ui-v1-avatar_bad.ui-v1-avatar_vip::after {
122
+ left: 50%;
123
+ right: 0;
124
+ border-radius: 0 52px 52px 0;
125
+ border-left: none;
126
+ }
127
+ .ui-v1-avatar_bad.ui-v1-avatar_vip .ui-v1-avatar__label_vip {
128
+ border-radius: 33px 0 0 33px;
129
+ }
130
+ .ui-v1-avatar_bad.ui-v1-avatar_vip .ui-v1-avatar__label_bad {
131
+ border-radius: 0 33px 33px 0;
132
+ }
133
+ .ui-v1-avatar__image {
134
+ display: block;
135
+ width: 100%;
136
+ min-width: 100%;
137
+ height: 100%;
138
+ border-radius: 50%;
139
+ object-fit: cover;
140
+ z-index: 1;
141
+ position: relative;
142
+ }
143
+ .ui-v1-avatar__unresolved {
144
+ display: flex;
145
+ align-items: center;
146
+ justify-content: center;
147
+ width: 100%;
148
+ min-width: 100%;
149
+ height: 100%;
150
+ color: #636F7F;
151
+ }
152
+ .ui-v1-avatar__status {
153
+ width: 8px;
154
+ min-width: 8px;
155
+ height: 8px;
156
+ border-radius: 50%;
157
+ z-index: 1;
158
+ position: absolute;
159
+ bottom: 2px;
160
+ right: 2px;
161
+ }
162
+ .ui-v1-avatar__status_busy {
163
+ background-color: #FF5353;
164
+ }
165
+ .ui-v1-avatar__status_break {
166
+ background-color: #FFE1BA;
167
+ }
168
+ .ui-v1-avatar__status_dinner {
169
+ background-color: #EF8E06;
170
+ }
171
+ .ui-v1-avatar__status_free {
172
+ background-color: #22C993;
173
+ }
174
+ .ui-v1-avatar__status_xs {
175
+ width: 6px;
176
+ min-width: 6px;
177
+ height: 6px;
178
+ }
179
+ .ui-v1-avatar__initials {
180
+ display: flex;
181
+ align-items: center;
182
+ justify-content: center;
183
+ width: 100%;
184
+ min-width: 100%;
185
+ height: 100%;
186
+ white-space: nowrap;
187
+ color: #636F7F;
188
+ overflow: hidden;
189
+ position: absolute;
190
+ z-index: 0;
191
+ top: 0;
192
+ left: 0;
193
+ }
194
+ .ui-v1-avatar__labels {
195
+ display: flex;
196
+ align-items: center;
197
+ justify-content: center;
198
+ width: 100%;
199
+ text-align: center;
200
+ z-index: 5;
201
+ position: absolute;
202
+ left: 0;
203
+ bottom: 0;
204
+ }
205
+ .ui-v1-avatar__label {
206
+ display: flex;
207
+ align-items: center;
208
+ justify-content: center;
209
+ color: #fff;
210
+ border-radius: 33px;
211
+ margin-left: auto;
212
+ }
213
+ .ui-v1-avatar__label_bad {
214
+ background-color: #FF5353;
215
+ }
216
+ .ui-v1-avatar__label_vip {
217
+ background-color: #FEA530;
218
+ }
219
+ .ui-v1-avatar-list {
220
+ --ui-v1-avatar-list-gap-color: #fff;
221
+ display: flex;
222
+ flex-wrap: wrap;
223
+ position: relative;
224
+ }
225
+ .ui-v1-avatar-list__item {
226
+ position: relative;
227
+ padding: 2px;
228
+ }
229
+ .ui-v1-avatar-list__item .ui-v1-avatar {
230
+ border: 2px solid var(--ui-v1-avatar-list-gap-color);
231
+ border-radius: 50%;
232
+ }
233
+ .ui-v1-avatar-list__item:not(:first-child) {
234
+ z-index: 2;
235
+ }
236
+ .ui-v1-avatar-list_xs .ui-v1-avatar-list__item:not(:first-child) {
237
+ margin-left: -12px;
238
+ }
239
+ .ui-v1-avatar-list_sm .ui-v1-avatar-list__item:not(:first-child) {
240
+ margin-left: -14px;
241
+ }
242
+ .ui-v1-avatar-list_lg .ui-v1-avatar-list__item:not(:first-child) {
243
+ margin-left: -16px;
244
+ }
1
245
  .ui-v1-button {
2
246
  --text-color: #1E2248;
3
247
  display: inline-block;
package/dist/host.d.ts CHANGED
@@ -136,8 +136,8 @@ onClosed?: ((...args: any[]) => any) | undefined;
136
136
  "onContainer:scroll:y:end"?: ((...args: any[]) => any) | undefined;
137
137
  "onContent:scroll:y:end"?: ((...args: any[]) => any) | undefined;
138
138
  }>, {
139
- appearance: APPEARANCE_3;
140
139
  id: string;
140
+ appearance: APPEARANCE_3;
141
141
  opened: boolean;
142
142
  closable: boolean;
143
143
  disposeTimeout: string | number | null;
@@ -148,16 +148,16 @@ responsive: boolean;
148
148
 
149
149
  declare const __VLS_component_2: DefineComponent_2<ExtractPropTypes< {
150
150
  size: {
151
- type: PropType<SIZE_5 | `${SIZE_5}`>;
152
- default: SIZE_5;
151
+ type: PropType<SIZE_6 | `${SIZE_6}`>;
152
+ default: SIZE_6;
153
153
  };
154
154
  }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
155
155
  size: {
156
- type: PropType<SIZE_5 | `${SIZE_5}`>;
157
- default: SIZE_5;
156
+ type: PropType<SIZE_6 | `${SIZE_6}`>;
157
+ default: SIZE_6;
158
158
  };
159
159
  }>> & Readonly<{}>, {
160
- size: "md" | "sm" | SIZE_5;
160
+ size: "sm" | "md" | SIZE_6;
161
161
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
162
162
 
163
163
  declare function __VLS_template(): {
@@ -265,13 +265,19 @@ declare enum SCROLLING_2 {
265
265
  }
266
266
 
267
267
  declare enum SIZE {
268
+ XS = "xs",
269
+ SM = "sm",
270
+ LG = "lg"
271
+ }
272
+
273
+ declare enum SIZE_2 {
268
274
  LG = "lg",
269
275
  MD = "md",
270
276
  SM = "sm",
271
277
  XS = "xs"
272
278
  }
273
279
 
274
- declare enum SIZE_2 {
280
+ declare enum SIZE_3 {
275
281
  ARTICLE = "article",
276
282
  BODY = "body",
277
283
  PARAGRAPH = "paragraph",
@@ -281,23 +287,57 @@ declare enum SIZE_2 {
281
287
  TITLE02 = "title-02"
282
288
  }
283
289
 
284
- declare enum SIZE_3 {
290
+ declare enum SIZE_4 {
285
291
  LG = "lg",
286
292
  SM = "sm"
287
293
  }
288
294
 
289
- declare enum SIZE_4 {
295
+ declare enum SIZE_5 {
290
296
  LG = "lg",
291
297
  MD = "md",
292
298
  SM = "sm",
293
299
  XS = "xs"
294
300
  }
295
301
 
296
- declare enum SIZE_5 {
302
+ declare enum SIZE_6 {
297
303
  SM = "sm",
298
304
  MD = "md"
299
305
  }
300
306
 
307
+ declare enum STATUS {
308
+ NONE = "",
309
+ BUSY = "busy",
310
+ BREAK = "break",
311
+ DINNER = "dinner",
312
+ FREE = "free"
313
+ }
314
+
315
+ export declare const UiAvatar: DefineComponent<
316
+ UiAvatarProperties
317
+ >;
318
+
319
+ export declare const UiAvatarList: DefineComponent<
320
+ UiAvatarListProperties
321
+ >;
322
+
323
+ declare type UiAvatarListProperties = {
324
+ avatars?: Array<{
325
+ src: string;
326
+ name: string;
327
+ }>;
328
+ size?: SIZE;
329
+ };
330
+
331
+ declare type UiAvatarProperties = {
332
+ src?: string;
333
+ name?: string;
334
+ href?: string;
335
+ status?: STATUS;
336
+ vip?: boolean;
337
+ bad?: boolean;
338
+ size?: SIZE;
339
+ };
340
+
301
341
  export declare const UiButton: DefineComponent<
302
342
  UiButtonProperties,
303
343
  UiButtonMethods
@@ -314,7 +354,7 @@ declare type UiButtonProperties = {
314
354
  href?: HTMLAnchorElement['href'] | undefined;
315
355
  appearance?: APPEARANCE | `${APPEARANCE}`;
316
356
  variant?: VARIANT | `${VARIANT}`;
317
- size?: SIZE | `${SIZE}`;
357
+ size?: SIZE_2 | `${SIZE_2}`;
318
358
  active?: boolean;
319
359
  disabled?: boolean;
320
360
  locked?: boolean;
@@ -354,7 +394,7 @@ declare type UiLinkProperties = {
354
394
  href?: string;
355
395
  external?: boolean;
356
396
  appearance?: APPEARANCE_2 | `${APPEARANCE_2}`;
357
- size?: SIZE_2 | `${SIZE_2}`;
397
+ size?: SIZE_3 | `${SIZE_3}`;
358
398
  light?: boolean;
359
399
  accent?: boolean;
360
400
  dotted?: boolean;
@@ -381,7 +421,7 @@ declare type UiModalSidebarProperties = {
381
421
  disposeTimeout?: number | string | null;
382
422
  fixed?: boolean;
383
423
  scrolling?: SCROLLING | `${SCROLLING}`;
384
- size?: SIZE_3 | `${SIZE_3}`;
424
+ size?: SIZE_4 | `${SIZE_4}`;
385
425
  };
386
426
 
387
427
  export declare const UiModalWindow: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -443,7 +483,7 @@ declare type UiScrollBoxProperties = {
443
483
  export declare const UiTag: DefineComponent<UiTagProperties>;
444
484
 
445
485
  declare type UiTagProperties = {
446
- size?: SIZE_4 | `${SIZE_4}`;
486
+ size?: SIZE_5 | `${SIZE_5}`;
447
487
  pinned?: boolean;
448
488
  removable?: boolean;
449
489
  interactive?: boolean;
package/dist/host.js CHANGED
@@ -1,15 +1,237 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { Text, Comment, defineComponent, ref, h, openBlock, createElementBlock, createElementVNode, computed, mergeProps, unref, createBlock, createCommentVNode, normalizeClass, renderSlot, createTextVNode, toDisplayString, createVNode, Transition, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps, normalizeStyle, reactive, inject, watch, onMounted, onActivated, onDeactivated, onBeforeUnmount, useAttrs, useSlots, Teleport, withDirectives, vShow, toHandlers, withModifiers, provide, createSlots } from "vue";
4
+ import { openBlock, createElementBlock, createElementVNode, defineComponent, useSlots, ref, computed, inject, createBlock, resolveDynamicComponent, mergeProps, unref, withCtx, createVNode, createCommentVNode, normalizeClass, renderSlot, createTextVNode, toDisplayString, provide, Fragment, renderList, Text, Comment, h, Transition, normalizeProps, guardReactiveProps, normalizeStyle, reactive, watch, onMounted, onActivated, onDeactivated, onBeforeUnmount, useAttrs, Teleport, withDirectives, vShow, toHandlers, withModifiers, createSlots } from "vue";
5
+ const _hoisted_1$e = {
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ viewBox: "0 0 24 24"
8
+ };
9
+ function render$7(_ctx, _cache) {
10
+ return openBlock(), createElementBlock("svg", _hoisted_1$e, _cache[0] || (_cache[0] = [
11
+ createElementVNode("path", {
12
+ fill: "currentColor",
13
+ "fill-rule": "evenodd",
14
+ d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10A10 10 0 0 0 12 2m0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16m3.237-10.576A2.424 2.424 0 0 0 12.812 7H11.13a2.424 2.424 0 0 0-2.424 2.424v.421c0 .233.188.421.42.421h.64a.42.42 0 0 0 .421-.42v-.422a.943.943 0 0 1 .943-.942h1.683c.521 0 .943.422.943.942v.472a.95.95 0 0 1-.64.9l-.8.261a1.58 1.58 0 0 0-1.085 1.499v.656c0 .233.188.421.42.421h.64a.42.42 0 0 0 .421-.42v-.657a.11.11 0 0 1 .101-.101l.8-.261a2.43 2.43 0 0 0 1.684-2.298zm-2.845 5.893h-.842a.42.42 0 0 0-.421.42v.842c0 .233.188.421.42.421h.843a.42.42 0 0 0 .42-.42v-.843a.42.42 0 0 0-.42-.42",
15
+ "clip-rule": "evenodd"
16
+ }, null, -1)
17
+ ]));
18
+ }
19
+ const IconHelpOutlined = { render: render$7 };
20
+ const _hoisted_1$d = {
21
+ xmlns: "http://www.w3.org/2000/svg",
22
+ viewBox: "0 0 18 8"
23
+ };
24
+ function render$6(_ctx, _cache) {
25
+ return openBlock(), createElementBlock("svg", _hoisted_1$d, _cache[0] || (_cache[0] = [
26
+ createElementVNode("g", { fill: "currentColor" }, [
27
+ createElementVNode("path", { d: "M0 0v8h2.867q1.257-.011 1.935-.604.68-.594.68-1.748 0-.675-.33-1.143a1.54 1.54 0 0 0-.892-.62q.497-.21.775-.654.279-.45.279-1.039 0-1.077-.694-1.632Q3.926 0 2.584 0zm1.52 6.676v-2.16h1.393q1.048.016 1.048 1.116 0 .488-.303.77-.3.273-.836.274zm1.124-3.324H1.52V1.335h1.064q.628 0 .916.242.294.236.294.78 0 .972-1.15.995M7.503 6.352h2.665L10.679 8h1.616l-2.76-8H8.125L5.38 8h1.616zm2.254-1.336H7.913l.917-2.994zM12.362 8V0h2.27q.972 0 1.737.478.77.473 1.2 1.352.432.873.431 1.989v.368q0 1.115-.425 1.983a3.17 3.17 0 0 1-1.191 1.346A3.26 3.26 0 0 1 14.646 8zm1.52-6.665v5.34h.734q.891 0 1.363-.631.47-.632.481-1.808v-.423q0-1.22-.466-1.846-.466-.632-1.363-.632z" })
28
+ ], -1)
29
+ ]));
30
+ }
31
+ const SpriteBAD = { render: render$6 };
32
+ const _hoisted_1$c = {
33
+ xmlns: "http://www.w3.org/2000/svg",
34
+ viewBox: "0 0 16 8"
35
+ };
36
+ function render$5(_ctx, _cache) {
37
+ return openBlock(), createElementBlock("svg", _hoisted_1$c, _cache[0] || (_cache[0] = [
38
+ createElementVNode("g", { fill: "currentColor" }, [
39
+ createElementVNode("path", { d: "M3.373 6.016 5.058 0h1.704L4.175 8H2.577L0 0h1.7zM8.99 8H7.46V0H8.99zM11.84 8V5.181h1.343q1.322 0 2.067-.676.75-.681.75-1.857 0-.774-.342-1.379a2.3 2.3 0 0 0-.98-.94Q14.045 0 13.208 0H10.31v8zm1.368-4.154h-1.367v-2.51h1.403q.567.01.888.373t.322.95q0 .571-.322.88-.316.307-.924.307" })
40
+ ], -1)
41
+ ]));
42
+ }
43
+ const SpriteVIP = { render: render$5 };
5
44
  const isURL = (href) => {
6
45
  try {
7
- new URL(href);
8
- return true;
46
+ const normalizedHref = href.includes("://") ? href : `http://${href}`;
47
+ const url = new URL(normalizedHref);
48
+ const urlPattern = /^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\S*)$/;
49
+ return urlPattern.test(url.href);
9
50
  } catch {
10
51
  return false;
11
52
  }
12
53
  };
54
+ const AvatarSizeKey = Symbol("UiAvatarSize");
55
+ var SIZE$5 = /* @__PURE__ */ ((SIZE2) => {
56
+ SIZE2["XS"] = "xs";
57
+ SIZE2["SM"] = "sm";
58
+ SIZE2["LG"] = "lg";
59
+ return SIZE2;
60
+ })(SIZE$5 || {});
61
+ var STATUS = /* @__PURE__ */ ((STATUS2) => {
62
+ STATUS2["NONE"] = "";
63
+ STATUS2["BUSY"] = "busy";
64
+ STATUS2["BREAK"] = "break";
65
+ STATUS2["DINNER"] = "dinner";
66
+ STATUS2["FREE"] = "free";
67
+ return STATUS2;
68
+ })(STATUS || {});
69
+ const _hoisted_1$b = ["src"];
70
+ const _hoisted_2$4 = {
71
+ key: 1,
72
+ class: "ui-v1-avatar__unresolved"
73
+ };
74
+ const _hoisted_3$3 = {
75
+ key: 3,
76
+ class: "ui-v1-avatar__initials"
77
+ };
78
+ const _hoisted_4$1 = {
79
+ key: 4,
80
+ class: "ui-v1-avatar__labels"
81
+ };
82
+ const _hoisted_5$1 = {
83
+ key: 0,
84
+ class: "ui-v1-avatar__label ui-v1-avatar__label_vip"
85
+ };
86
+ const _hoisted_6 = {
87
+ key: 1,
88
+ class: "ui-v1-avatar__label ui-v1-avatar__label_bad"
89
+ };
90
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
91
+ __name: "UiAvatar",
92
+ props: {
93
+ /** Путь к изображению */
94
+ src: {
95
+ type: String,
96
+ validator: (src) => isURL(src) || src.length === 0,
97
+ default: ""
98
+ },
99
+ /** Наименование участника */
100
+ name: {
101
+ type: String,
102
+ default: null
103
+ },
104
+ /** Ссылка для перехода */
105
+ href: {
106
+ type: String,
107
+ validator: (href) => isURL(href) || href.length === 0,
108
+ default: ""
109
+ },
110
+ /** Статус пользователя */
111
+ status: {
112
+ type: String,
113
+ validator: (status) => Object.values(STATUS).includes(status),
114
+ default: null
115
+ },
116
+ /** Пометка VIP в карточке пользователя */
117
+ vip: {
118
+ type: Boolean,
119
+ default: false
120
+ },
121
+ /** Пометка BAD в карточке пользователя */
122
+ bad: {
123
+ type: Boolean,
124
+ default: false
125
+ },
126
+ /** Размер изображения */
127
+ size: {
128
+ type: String,
129
+ validator: (size) => Object.values(SIZE$5).includes(size),
130
+ default: SIZE$5.SM
131
+ }
132
+ },
133
+ setup(__props) {
134
+ const firstLetterOf = (name) => name.charAt(0).toUpperCase();
135
+ const props = __props;
136
+ const slots = useSlots();
137
+ const loaded = ref(false);
138
+ const unresolved = computed(() => !(props.name || slots.default));
139
+ const initials = computed(() => {
140
+ if (!props.name) {
141
+ return "";
142
+ }
143
+ const [firstName, ...otherNames] = props.name.split(" ");
144
+ return otherNames.length > 0 ? firstLetterOf(firstName) + firstLetterOf(otherNames[otherNames.length - 1]) : firstLetterOf(firstName);
145
+ });
146
+ const size = inject(AvatarSizeKey, computed(() => props.size));
147
+ return (_ctx, _cache) => {
148
+ return openBlock(), createBlock(resolveDynamicComponent(__props.href ? "a" : "div"), mergeProps({
149
+ ref: "root",
150
+ href: __props.href || void 0,
151
+ class: {
152
+ ["ui-v1-avatar"]: true,
153
+ [`ui-v1-avatar_${unref(size)}`]: true,
154
+ ["ui-v1-avatar_bad"]: __props.bad,
155
+ ["ui-v1-avatar_vip"]: __props.vip
156
+ }
157
+ }, _ctx.$attrs), {
158
+ default: withCtx(() => [
159
+ __props.src ? (openBlock(), createElementBlock("img", {
160
+ key: 0,
161
+ src: __props.src,
162
+ alt: "",
163
+ class: "ui-v1-avatar__image",
164
+ draggable: "false",
165
+ onLoad: _cache[0] || (_cache[0] = ($event) => loaded.value = true),
166
+ onError: _cache[1] || (_cache[1] = ($event) => loaded.value = false)
167
+ }, null, 40, _hoisted_1$b)) : !__props.src && unresolved.value ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
168
+ createVNode(unref(IconHelpOutlined))
169
+ ])) : createCommentVNode("", true),
170
+ __props.status && !(__props.vip || __props.bad) ? (openBlock(), createElementBlock("span", {
171
+ key: 2,
172
+ class: normalizeClass({
173
+ ["ui-v1-avatar__status"]: true,
174
+ [`ui-v1-avatar__status_${unref(size)}`]: true,
175
+ [`ui-v1-avatar__status_${__props.status}`]: __props.status
176
+ })
177
+ }, null, 2)) : createCommentVNode("", true),
178
+ !(unresolved.value || loaded.value) ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
179
+ renderSlot(_ctx.$slots, "default", {}, () => [
180
+ createTextVNode(toDisplayString(initials.value), 1)
181
+ ])
182
+ ])) : createCommentVNode("", true),
183
+ __props.vip || __props.bad ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
184
+ __props.vip ? (openBlock(), createElementBlock("span", _hoisted_5$1, [
185
+ createVNode(unref(SpriteVIP), { class: "ui-v1-avatar__vip" })
186
+ ])) : createCommentVNode("", true),
187
+ __props.bad ? (openBlock(), createElementBlock("span", _hoisted_6, [
188
+ createVNode(unref(SpriteBAD), { class: "ui-v1-avatar__bad" })
189
+ ])) : createCommentVNode("", true)
190
+ ])) : createCommentVNode("", true)
191
+ ]),
192
+ _: 3
193
+ }, 16, ["href", "class"]);
194
+ };
195
+ }
196
+ });
197
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
198
+ __name: "UiAvatarList",
199
+ props: {
200
+ /** Список аватарок пользователей */
201
+ avatars: {
202
+ type: Array,
203
+ default: () => []
204
+ },
205
+ /** Размер аватарок */
206
+ size: {
207
+ type: String,
208
+ validator: (size) => Object.values(SIZE$5).includes(size),
209
+ default: SIZE$5.SM
210
+ }
211
+ },
212
+ setup(__props) {
213
+ const props = __props;
214
+ provide(AvatarSizeKey, computed(() => props.size));
215
+ return (_ctx, _cache) => {
216
+ return openBlock(), createElementBlock("div", {
217
+ class: normalizeClass(["ui-v1-avatar-list", `ui-v1-avatar-list_${__props.size}`])
218
+ }, [
219
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.avatars, (avatar, index) => {
220
+ return openBlock(), createElementBlock("div", {
221
+ key: index,
222
+ class: "ui-v1-avatar-list__item"
223
+ }, [
224
+ createVNode(_sfc_main$h, {
225
+ src: avatar.src,
226
+ name: avatar.name
227
+ }, null, 8, ["src", "name"])
228
+ ]);
229
+ }), 128)),
230
+ renderSlot(_ctx.$slots, "default")
231
+ ], 2);
232
+ };
233
+ }
234
+ });
13
235
  const SHAPE_FLAG_ARRAY_CHILDREN = 16;
14
236
  const SHAPE_FLAG_TEXT = 8;
15
237
  const inlines = ["b", "i", "span", "strong"];
@@ -3479,6 +3701,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3479
3701
  export {
3480
3702
  plugin as I18nPlugin,
3481
3703
  plugin$1 as ModalPlugin,
3704
+ _sfc_main$h as UiAvatar,
3705
+ _sfc_main$g as UiAvatarList,
3482
3706
  _sfc_main$f as UiButton,
3483
3707
  _sfc_main$e as UiCheckbox,
3484
3708
  _sfc_main$d as UiError,
package/dist/remote.cjs CHANGED
@@ -42,6 +42,10 @@ const defineRemoteComponent = (type, emits = void 0, slots = []) => vue.defineCo
42
42
  }, toRemoteSlots(slots, internalSlots));
43
43
  }
44
44
  });
45
+ const UiAvatarType = "UiAvatar";
46
+ const UiAvatar = defineRemoteComponent(UiAvatarType);
47
+ const UiAvatarListType = "UiAvatarList";
48
+ const UiAvatarList = defineRemoteComponent(UiAvatarListType);
45
49
  const UiButtonType = "UiButton";
46
50
  const UiButton = defineRemoteComponent(
47
51
  UiButtonType,
@@ -168,6 +172,10 @@ const UiYandexMap = defineRemoteComponent(
168
172
  "update:address"
169
173
  ]
170
174
  );
175
+ exports.UiAvatar = UiAvatar;
176
+ exports.UiAvatarList = UiAvatarList;
177
+ exports.UiAvatarListType = UiAvatarListType;
178
+ exports.UiAvatarType = UiAvatarType;
171
179
  exports.UiButton = UiButton;
172
180
  exports.UiButtonType = UiButtonType;
173
181
  exports.UiCheckbox = UiCheckbox;
package/dist/remote.d.ts CHANGED
@@ -67,13 +67,19 @@ declare type SerializedDOMRect = {
67
67
  };
68
68
 
69
69
  declare enum SIZE {
70
+ XS = "xs",
71
+ SM = "sm",
72
+ LG = "lg"
73
+ }
74
+
75
+ declare enum SIZE_2 {
70
76
  LG = "lg",
71
77
  MD = "md",
72
78
  SM = "sm",
73
79
  XS = "xs"
74
80
  }
75
81
 
76
- declare enum SIZE_2 {
82
+ declare enum SIZE_3 {
77
83
  ARTICLE = "article",
78
84
  BODY = "body",
79
85
  PARAGRAPH = "paragraph",
@@ -83,18 +89,68 @@ declare enum SIZE_2 {
83
89
  TITLE02 = "title-02"
84
90
  }
85
91
 
86
- declare enum SIZE_3 {
92
+ declare enum SIZE_4 {
87
93
  LG = "lg",
88
94
  SM = "sm"
89
95
  }
90
96
 
91
- declare enum SIZE_4 {
97
+ declare enum SIZE_5 {
92
98
  LG = "lg",
93
99
  MD = "md",
94
100
  SM = "sm",
95
101
  XS = "xs"
96
102
  }
97
103
 
104
+ declare enum STATUS {
105
+ NONE = "",
106
+ BUSY = "busy",
107
+ BREAK = "break",
108
+ DINNER = "dinner",
109
+ FREE = "free"
110
+ }
111
+
112
+ export declare const UiAvatar: Component< {
113
+ [x: string]: unknown;
114
+ }, RemoteProperties<UiAvatarProperties>, {
115
+ [x: string]: never;
116
+ }, {
117
+ [x: string]: never;
118
+ }, MethodOptions, {
119
+ [x: string]: never;
120
+ }>;
121
+
122
+ export declare const UiAvatarList: Component< {
123
+ [x: string]: unknown;
124
+ }, RemoteProperties<UiAvatarListProperties>, {
125
+ [x: string]: never;
126
+ }, {
127
+ [x: string]: never;
128
+ }, MethodOptions, {
129
+ [x: string]: never;
130
+ }>;
131
+
132
+ declare type UiAvatarListProperties = {
133
+ avatars?: Array<{
134
+ src: string;
135
+ name: string;
136
+ }>;
137
+ size?: SIZE;
138
+ };
139
+
140
+ export declare const UiAvatarListType: SchemaType<"UiAvatarList", RemoteProperties<UiAvatarListProperties>>;
141
+
142
+ declare type UiAvatarProperties = {
143
+ src?: string;
144
+ name?: string;
145
+ href?: string;
146
+ status?: STATUS;
147
+ vip?: boolean;
148
+ bad?: boolean;
149
+ size?: SIZE;
150
+ };
151
+
152
+ export declare const UiAvatarType: SchemaType<"UiAvatar", RemoteProperties<UiAvatarProperties>>;
153
+
98
154
  export declare const UiButton: Component< {
99
155
  [x: string]: unknown;
100
156
  }, RemoteProperties<UiButtonProperties>, {
@@ -118,7 +174,7 @@ declare type UiButtonProperties = {
118
174
  href?: HTMLAnchorElement['href'] | undefined;
119
175
  appearance?: APPEARANCE | `${APPEARANCE}`;
120
176
  variant?: VARIANT | `${VARIANT}`;
121
- size?: SIZE | `${SIZE}`;
177
+ size?: SIZE_2 | `${SIZE_2}`;
122
178
  active?: boolean;
123
179
  disabled?: boolean;
124
180
  locked?: boolean;
@@ -194,7 +250,7 @@ declare type UiLinkProperties = {
194
250
  href?: string;
195
251
  external?: boolean;
196
252
  appearance?: APPEARANCE_2 | `${APPEARANCE_2}`;
197
- size?: SIZE_2 | `${SIZE_2}`;
253
+ size?: SIZE_3 | `${SIZE_3}`;
198
254
  light?: boolean;
199
255
  accent?: boolean;
200
256
  dotted?: boolean;
@@ -253,7 +309,7 @@ declare type UiModalSidebarProperties = {
253
309
  disposeTimeout?: number | string | null;
254
310
  fixed?: boolean;
255
311
  scrolling?: SCROLLING | `${SCROLLING}`;
256
- size?: SIZE_3 | `${SIZE_3}`;
312
+ size?: SIZE_4 | `${SIZE_4}`;
257
313
  };
258
314
 
259
315
  export declare const UiModalSidebarType: SchemaType<"UiModalSidebar", RemoteProperties<UiModalSidebarProperties>, Record<string, never>>;
@@ -391,7 +447,7 @@ remove: () => boolean;
391
447
  }>;
392
448
 
393
449
  declare type UiTagProperties = {
394
- size?: SIZE_4 | `${SIZE_4}`;
450
+ size?: SIZE_5 | `${SIZE_5}`;
395
451
  pinned?: boolean;
396
452
  removable?: boolean;
397
453
  interactive?: boolean;
package/dist/remote.js CHANGED
@@ -40,6 +40,10 @@ const defineRemoteComponent = (type, emits = void 0, slots = []) => defineCompon
40
40
  }, toRemoteSlots(slots, internalSlots));
41
41
  }
42
42
  });
43
+ const UiAvatarType = "UiAvatar";
44
+ const UiAvatar = defineRemoteComponent(UiAvatarType);
45
+ const UiAvatarListType = "UiAvatarList";
46
+ const UiAvatarList = defineRemoteComponent(UiAvatarListType);
43
47
  const UiButtonType = "UiButton";
44
48
  const UiButton = defineRemoteComponent(
45
49
  UiButtonType,
@@ -167,6 +171,10 @@ const UiYandexMap = defineRemoteComponent(
167
171
  ]
168
172
  );
169
173
  export {
174
+ UiAvatar,
175
+ UiAvatarList,
176
+ UiAvatarListType,
177
+ UiAvatarType,
170
178
  UiButton,
171
179
  UiButtonType,
172
180
  UiCheckbox,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@retailcrm/embed-ui-v1-components",
3
3
  "type": "module",
4
- "version": "0.5.6",
4
+ "version": "0.5.8",
5
5
  "license": "MIT",
6
6
  "author": "RetailDriverLLC <integration@retailcrm.ru>",
7
7
  "repository": "git@github.com:retailcrm/embed-ui.git",
@@ -55,29 +55,31 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "@omnicajs/vue-remote": "^0.2.5",
58
- "@remote-ui/rpc": "^1.4.5"
58
+ "@remote-ui/rpc": "^1.4.5",
59
+ "remark-gfm": "^4.0.0"
59
60
  },
60
61
  "devDependencies": {
61
- "@storybook/addon-a11y": "^8.4.5",
62
- "@storybook/addon-essentials": "^8.4.5",
63
- "@storybook/addon-interactions": "^8.4.5",
64
- "@storybook/addon-links": "^8.4.5",
65
- "@storybook/addon-themes": "^8.4.5",
66
- "@storybook/blocks": "^8.4.5",
67
- "@storybook/builder-vite": "^8.4.5",
68
- "@storybook/manager-api": "^8.4.5",
69
- "@storybook/test": "^8.4.5",
70
- "@storybook/theming": "^8.4.5",
71
- "@storybook/types": "^8.4.5",
72
- "@storybook/vue3": "^8.4.5",
73
- "@storybook/vue3-vite": "^8.4.5",
62
+ "@storybook/addon-a11y": "^8.4.7",
63
+ "@storybook/addon-docs": "^8.4.7",
64
+ "@storybook/addon-essentials": "^8.4.7",
65
+ "@storybook/addon-interactions": "^8.4.7",
66
+ "@storybook/addon-links": "^8.4.7",
67
+ "@storybook/addon-themes": "^8.4.7",
68
+ "@storybook/blocks": "^8.4.7",
69
+ "@storybook/builder-vite": "^8.4.7",
70
+ "@storybook/manager-api": "^8.4.7",
71
+ "@storybook/test": "^8.4.7",
72
+ "@storybook/theming": "^8.4.7",
73
+ "@storybook/types": "^8.4.7",
74
+ "@storybook/vue3": "^8.4.7",
75
+ "@storybook/vue3-vite": "^8.4.7",
74
76
  "@vitejs/plugin-vue": "^5.1.4",
75
77
  "@vue/compiler-sfc": "^3.5.12",
76
78
  "@yandex/ymaps3-types": "^0.0.21",
77
79
  "less": "^4.2.0",
78
80
  "react": "^18.3.1",
79
81
  "react-dom": "^18.3.1",
80
- "storybook": "^8.4.5",
82
+ "storybook": "^8.4.7",
81
83
  "tsx": "^4.19.2",
82
84
  "typescript": "^5.6.3",
83
85
  "uuid": "^11.0.3",