@uzum-tech/ui 1.12.4 → 1.12.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.
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.variantToCssVars = exports.defaultVariantOptions = void 0;
4
4
  exports.mergeVariantOptions = mergeVariantOptions;
5
- exports.mergeVariantWeights = mergeVariantWeights;
6
5
  exports.getVariantCssVars = getVariantCssVars;
7
6
  exports.getVariantTag = getVariantTag;
8
7
  const fontFamily = 'var(--u-font-famliy-variant)';
@@ -82,27 +81,42 @@ exports.defaultVariantOptions = {
82
81
  }
83
82
  }
84
83
  };
85
- const variantWeights = {
86
- display: ['', 'medium', 'semi-bold', 'bold'],
87
- heading: ['medium', 'semi-bold', 'bold'],
88
- title: ['medium', 'semi-bold', 'bold'],
89
- body: ['medium', 'semi-bold', 'bold']
90
- };
84
+ const weightOrder = [
85
+ '',
86
+ 'thin',
87
+ 'extra-light',
88
+ 'light',
89
+ 'normal',
90
+ 'medium',
91
+ 'semi-bold',
92
+ 'bold',
93
+ 'extra-bold',
94
+ 'black'
95
+ ];
91
96
  const fontWeights = {
92
- medium: { weight: '500', style: 'medium' },
93
- 'semi-bold': { weight: '600', style: 'semibold' },
94
- bold: { weight: '700', style: 'bold' },
95
- '': { weight: '700', style: 'bold' }
97
+ thin: { weight: '100', style: 'normal' },
98
+ 'extra-light': { weight: '200', style: 'normal' },
99
+ light: { weight: '300', style: 'normal' },
100
+ normal: { weight: '400', style: 'normal' },
101
+ medium: { weight: '500', style: 'normal' },
102
+ 'semi-bold': { weight: '600', style: 'normal' },
103
+ bold: { weight: '700', style: 'normal' },
104
+ 'extra-bold': { weight: '800', style: 'normal' },
105
+ black: { weight: '900', style: 'normal' },
106
+ '': { weight: '700', style: 'normal' }
96
107
  };
97
108
  function createVariant(options, category, size, weight) {
98
- var _a, _b, _c;
109
+ var _a, _b, _c, _d, _e, _f;
99
110
  const base = (_b = (_a = options === null || options === void 0 ? void 0 : options[category]) === null || _a === void 0 ? void 0 : _a[size]) !== null && _b !== void 0 ? _b : (_c = exports.defaultVariantOptions[category]) === null || _c === void 0 ? void 0 : _c[size];
100
- const { weight: fontWeight, style: fontStyle } = fontWeights[weight];
111
+ const effectiveWeight = weight === '' ? (_d = base === null || base === void 0 ? void 0 : base.defaultFontWeight) !== null && _d !== void 0 ? _d : '' : weight;
112
+ const { weight: fontWeight, style: fontStyle } = fontWeights[effectiveWeight] || fontWeights[''];
113
+ const resolvedFontFamily = (_e = base.fontFamily) !== null && _e !== void 0 ? _e : fontFamily;
114
+ const resolvedFontStyle = (_f = base.fontStyle) !== null && _f !== void 0 ? _f : fontStyle;
101
115
  return {
102
- fontFamily,
116
+ fontFamily: resolvedFontFamily,
103
117
  fontSize: base.fontSize,
104
118
  fontWeight,
105
- fontStyle,
119
+ fontStyle: resolvedFontStyle,
106
120
  lineHeight: base.lineHeight,
107
121
  letterSpacing: base.letterSpacing,
108
122
  tag: base.tag
@@ -122,34 +136,11 @@ function mergeVariantOptions(variantOptions) {
122
136
  });
123
137
  return mergedOptions;
124
138
  }
125
- function mergeVariantWeights(variantWeightsOptions) {
126
- if (!variantWeightsOptions)
127
- return variantWeights;
128
- const mergedWeights = {};
129
- const categories = new Set([
130
- ...Object.keys(variantWeights),
131
- ...Object.keys(variantWeightsOptions)
132
- ]);
133
- categories.forEach((category) => {
134
- const defaultWeights = variantWeights[category] || [];
135
- const customWeights = variantWeightsOptions[category] || [];
136
- const combined = [...defaultWeights];
137
- customWeights.forEach((weight) => {
138
- if (!combined.includes(weight)) {
139
- combined.push(weight);
140
- }
141
- });
142
- mergedWeights[category] = combined;
143
- });
144
- return mergedWeights;
145
- }
146
- function createVariantToCssVars(variantOptions, variantWeightsOptions) {
139
+ function createVariantToCssVars(variantOptions) {
147
140
  const configs = {};
148
- const mergedWeights = mergeVariantWeights(variantWeightsOptions);
149
141
  Object.entries(variantOptions).forEach(([category, sizes]) => {
150
- const weights = mergedWeights[category] || [];
151
142
  Object.keys(sizes).forEach((size) => {
152
- weights.forEach((weight) => {
143
+ weightOrder.forEach((weight) => {
153
144
  const variantKey = `${category}-${size}${weight ? `-${weight}` : ''}`;
154
145
  configs[variantKey] = createVariant(variantOptions, category, size, weight);
155
146
  });
@@ -157,25 +148,25 @@ function createVariantToCssVars(variantOptions, variantWeightsOptions) {
157
148
  });
158
149
  return configs;
159
150
  }
160
- function resolveVariantConfigs(variantOptions, variantWeightsOptions) {
151
+ function resolveVariantConfigs(variantOptions) {
161
152
  const hasCustomOptions = variantOptions && Object.keys(variantOptions).length > 0;
162
- const hasCustomWeights = variantWeightsOptions && Object.keys(variantWeightsOptions).length > 0;
163
- if (!hasCustomOptions && !hasCustomWeights) {
153
+ if (!hasCustomOptions) {
164
154
  return exports.variantToCssVars;
165
155
  }
166
- return createVariantToCssVars(mergeVariantOptions(variantOptions), variantWeightsOptions);
156
+ const mergedOptions = mergeVariantOptions(variantOptions);
157
+ return createVariantToCssVars(mergedOptions);
167
158
  }
168
- function getVariantCssVars(variant, baseVars, fontFamilyVariant, variantOptions, variantWeightsOptions) {
159
+ function getVariantCssVars(variant, baseVars, fontFamilyVariant, variantOptions) {
169
160
  const variantStyles = variant
170
- ? resolveVariantConfigs(variantOptions, variantWeightsOptions)[variant]
161
+ ? resolveVariantConfigs(variantOptions)[variant]
171
162
  : undefined;
172
163
  if (!variantStyles) {
173
164
  return baseVars;
174
165
  }
175
166
  return Object.assign(Object.assign({}, baseVars), { '--u-font-famliy-variant': fontFamilyVariant, '--u-variant-font-size': variantStyles.fontSize, '--u-variant-font-weight': variantStyles.fontWeight, '--u-variant-line-height': variantStyles.lineHeight, '--u-variant-font-family': variantStyles.fontFamily, '--u-variant-font-style': variantStyles.fontStyle, '--u-variant-letter-spacing': variantStyles.letterSpacing });
176
167
  }
177
- function getVariantTag(variant, variantOptions, variantWeightsOptions) {
168
+ function getVariantTag(variant, variantOptions) {
178
169
  var _a;
179
- return (_a = resolveVariantConfigs(variantOptions, variantWeightsOptions)[variant]) === null || _a === void 0 ? void 0 : _a.tag;
170
+ return (_a = resolveVariantConfigs(variantOptions)[variant]) === null || _a === void 0 ? void 0 : _a.tag;
180
171
  }
181
- exports.variantToCssVars = createVariantToCssVars(exports.defaultVariantOptions, variantWeights);
172
+ exports.variantToCssVars = createVariantToCssVars(exports.defaultVariantOptions);
@@ -389,7 +389,7 @@ exports.default = (0, vue_1.defineComponent)({
389
389
  };
390
390
  const renderFooter = () => {
391
391
  return ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-main__footer` },
392
- (0, vue_1.h)(upload_1.UUpload, Object.assign({ abstract: true, multiple: true, defaultUpload: false, fileList: attachmentFileList.value, onUpdateFileList: handleFileListUpdate }, footerUploadPropsRef.value, { onChange: handleOnChange() }), {
392
+ (0, vue_1.h)(upload_1.UUpload, Object.assign({ abstract: true, multiple: true, defaultUpload: false, fileList: attachmentFileList.value, onUpdateFileList: !handleOnChange() ? handleFileListUpdate : undefined }, footerUploadPropsRef.value, { onChange: handleOnChange() }), {
393
393
  default: () => ((0, vue_1.h)(flex_1.UFlex, { align: "end", size: "small", wrap: false, class: `${mergedClsPrefixRef.value}-chat-main__input-container` }, {
394
394
  default: () => ((0, vue_1.h)(vue_1.Fragment, null,
395
395
  (0, vue_1.h)(upload_1.UUploadTrigger, { abstract: true }, {
@@ -0,0 +1,3 @@
1
+ import type { ULocale } from './enUS';
2
+ declare const ruRu: ULocale;
3
+ export default ruRu;
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const ruRu = {
4
+ name: 'ru-RU',
5
+ global: {
6
+ undo: 'Отменить',
7
+ redo: 'Вернуть',
8
+ confirm: 'Подтвердить',
9
+ clear: 'Очистить'
10
+ },
11
+ Popconfirm: {
12
+ positiveText: 'Подтвердить',
13
+ negativeText: 'Отмена'
14
+ },
15
+ Cascader: {
16
+ placeholder: 'Выбрать',
17
+ loading: 'Загрузка',
18
+ loadingRequiredMessage: (label) => `Загрузите все дочерние узлы ${label} прежде чем они станут необязательными`
19
+ },
20
+ Time: {
21
+ dateFormat: 'yyyy-MM-dd',
22
+ dateTimeFormat: 'yyyy-MM-dd HH:mm:ss'
23
+ },
24
+ DatePicker: {
25
+ yearFormat: 'yyyy',
26
+ monthFormat: 'MMM',
27
+ dayFormat: 'eeeeee',
28
+ yearTypeFormat: 'yyyy',
29
+ monthTypeFormat: 'yyyy-MM',
30
+ dateFormat: 'yyyy-MM-dd',
31
+ dateTimeFormat: 'yyyy-MM-dd HH:mm:ss',
32
+ quarterFormat: 'yyyy-qqq',
33
+ clear: 'Очистить',
34
+ now: 'Сейчас',
35
+ confirm: 'Подтвердить',
36
+ selectTime: 'Выбрать время',
37
+ selectDate: 'Выбрать дату',
38
+ datePlaceholder: 'Выбрать дату',
39
+ datetimePlaceholder: 'Выбрать дату и время',
40
+ monthPlaceholder: 'Выберите месяц',
41
+ // FIXME: translation needed
42
+ yearPlaceholder: 'Select Year',
43
+ quarterPlaceholder: 'Select Quarter',
44
+ startDatePlaceholder: 'Дата начала',
45
+ endDatePlaceholder: 'Дата окончания',
46
+ startDatetimePlaceholder: 'Дата и время начала',
47
+ endDatetimePlaceholder: 'Дата и время окончания',
48
+ // FIXME: translation needed
49
+ startMonthPlaceholder: 'Start Month',
50
+ endMonthPlaceholder: 'End Month',
51
+ monthBeforeYear: true,
52
+ firstDayOfWeek: 0,
53
+ today: 'Сегодня'
54
+ },
55
+ DataTable: {
56
+ checkTableAll: 'Выбрать все в таблице',
57
+ uncheckTableAll: 'Отменить все в таблице',
58
+ confirm: 'Подтвердить',
59
+ clear: 'Очистить'
60
+ },
61
+ LegacyTransfer: {
62
+ sourceTitle: 'Источник',
63
+ targetTitle: 'Назначение'
64
+ },
65
+ // TODO: translation
66
+ Transfer: {
67
+ selectAll: 'Select all',
68
+ unselectAll: 'Unselect all',
69
+ clearAll: 'Clear',
70
+ total: (num) => `Total ${num} items`,
71
+ selected: (num) => `${num} items selected`
72
+ },
73
+ Empty: {
74
+ title: 'Нет совпадений',
75
+ description: 'Попробуйте изменить поисковый запрос'
76
+ },
77
+ Select: {
78
+ placeholder: 'Выбрать'
79
+ },
80
+ TimePicker: {
81
+ placeholder: 'Выбрать время',
82
+ positiveText: 'OK',
83
+ negativeText: 'Отменить',
84
+ now: 'Сейчас'
85
+ },
86
+ Pagination: {
87
+ goto: 'Перейти',
88
+ selectionSuffix: 'страница'
89
+ },
90
+ DynamicTags: {
91
+ add: 'Добавить'
92
+ },
93
+ Log: {
94
+ loading: 'Загрузка'
95
+ },
96
+ Input: {
97
+ placeholder: 'Ввести',
98
+ copied: 'Скопировано'
99
+ },
100
+ InputNumber: {
101
+ placeholder: 'Ввести'
102
+ },
103
+ DynamicInput: {
104
+ create: 'Создать'
105
+ },
106
+ ThemeEditor: {
107
+ title: 'Редактор темы',
108
+ clearAllVars: 'Очистить все',
109
+ clearSearch: 'Очистить поиск',
110
+ filterCompName: 'Фильтровать по имени компонента',
111
+ filterVarName: 'Фильтровать имена переменных',
112
+ import: 'Импорт',
113
+ export: 'Экспорт',
114
+ restore: 'Сбросить'
115
+ },
116
+ // TODO: translation
117
+ Image: {
118
+ tipPrevious: 'Previous picture (←)',
119
+ tipNext: 'Next picture (→)',
120
+ tipCounterclockwise: 'Counterclockwise',
121
+ tipClockwise: 'Clockwise',
122
+ tipZoomOut: 'Zoom out',
123
+ tipZoomIn: 'Zoom in',
124
+ tipDownload: 'Download',
125
+ tipClose: 'Close (Esc)',
126
+ // TODO: translation
127
+ tipOriginalSize: 'Zoom to original size'
128
+ },
129
+ Upload: {
130
+ title: 'Выберите файл или перетащите сюда',
131
+ subtitle: 'PDF, PNG, JPEG не более 100 MB',
132
+ uploading: 'Загружается'
133
+ },
134
+ Chat: {
135
+ inputPlaceholder: 'Написать сообщение...',
136
+ typingText: 'Печатает...',
137
+ retryText: 'Повторно отправить',
138
+ closeButtonText: 'Завершить чат',
139
+ shareButtonTooltip: 'Поделиться чатом',
140
+ profileButtonTooltip: 'Просмотреть профиль',
141
+ unreadNotificationText: 'новых сообщений',
142
+ editText: 'Редактировать',
143
+ copyText: 'Скопировать',
144
+ deleteText: 'Удалить',
145
+ editingTitle: 'Редактирование'
146
+ },
147
+ Header: {
148
+ desktopSearchTitle: 'Поиск',
149
+ searchPlaceholder: 'Поиск по сайту',
150
+ primaryActionText: 'Стать клиентом',
151
+ secondaryActionText: 'Перейти в приложение'
152
+ }
153
+ };
154
+ exports.default = ruRu;
@@ -0,0 +1,3 @@
1
+ import { type UDateLocale } from './enUS';
2
+ declare const dateRuRU: UDateLocale;
3
+ export default dateRuRU;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const ru_1 = __importDefault(require("date-fns/locale/ru")); //
7
+ const dateRuRU = {
8
+ name: 'ru-RU',
9
+ locale: ru_1.default
10
+ };
11
+ exports.default = dateRuRU;
@@ -1,5 +1,7 @@
1
1
  export { default as enUS } from './common/enUS';
2
+ export { default as ruRU } from './common/ruRU';
2
3
  export { default as dateEnUS } from './date/enUS';
4
+ export { default as dateRuRU } from './date/ruRU';
3
5
  export type { ULocale } from './common/enUS';
4
6
  export type { UDateLocale } from './date/enUS';
5
7
  export type { UPartialLocale } from './utils/index';
@@ -3,10 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createLocale = exports.dateEnUS = exports.enUS = void 0;
6
+ exports.createLocale = exports.dateRuRU = exports.dateEnUS = exports.ruRU = exports.enUS = void 0;
7
7
  var enUS_1 = require("./common/enUS");
8
8
  Object.defineProperty(exports, "enUS", { enumerable: true, get: function () { return __importDefault(enUS_1).default; } });
9
+ var ruRU_1 = require("./common/ruRU");
10
+ Object.defineProperty(exports, "ruRU", { enumerable: true, get: function () { return __importDefault(ruRU_1).default; } });
9
11
  var enUS_2 = require("./date/enUS");
10
12
  Object.defineProperty(exports, "dateEnUS", { enumerable: true, get: function () { return __importDefault(enUS_2).default; } });
13
+ var ruRU_2 = require("./date/ruRU");
14
+ Object.defineProperty(exports, "dateRuRU", { enumerable: true, get: function () { return __importDefault(ruRU_2).default; } });
11
15
  var index_1 = require("./utils/index");
12
16
  Object.defineProperty(exports, "createLocale", { enumerable: true, get: function () { return index_1.createLocale; } });
@@ -20,4 +20,8 @@ export type { OlProps } from './src/ol';
20
20
  export { default as ULi } from './src/li';
21
21
  export { default as UText, textProps } from './src/text';
22
22
  export type { TextProps } from './src/text';
23
- export type { TypographyVariant, TypographyVariantOptions, TypographyVariantWeightsOptions } from '../_internal/typography';
23
+ export type { TypographyVariant, TypographyVariantOptions,
24
+ /**
25
+ * @deprecated Weight options are fixed; kept for backwards compatibility.
26
+ */
27
+ TypographyVariantWeightsOptions } from '../_internal/typography';
package/lib/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "1.12.4";
1
+ declare const _default: "1.12.6";
2
2
  export default _default;
package/lib/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '1.12.4';
3
+ exports.default = '1.12.6';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uzum-tech/ui",
3
- "version": "1.12.4",
3
+ "version": "1.12.6",
4
4
  "description": "A Vue 3 Component Library. Fairly Complete, Theme Customizable, Uses TypeScript, Fast",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
package/web-types.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
4
  "name": "@uzum-tech/ui",
5
- "version": "1.12.4",
5
+ "version": "1.12.6",
6
6
  "js-types-syntax": "typescript",
7
7
  "contributions": {
8
8
  "html": {
@@ -17062,14 +17062,14 @@
17062
17062
  "name": "variantOptions",
17063
17063
  "doc-url": "https://uzum-ui.kapitalbank.uz/en-US/os-theme/components/typography",
17064
17064
  "type": "TypographyVariantOptions",
17065
- "description": "Custom varinats as object: TypographyVariantOptions",
17065
+ "description": "Custom variants as object: TypographyVariantOptions (`fontWeight` is controlled internally; set `defaultFontWeight` inside a variant config to override the default weight used for suffix-less variants)",
17066
17066
  "default": "() => ({})"
17067
17067
  },
17068
17068
  {
17069
17069
  "name": "variantWeightsOptions",
17070
17070
  "doc-url": "https://uzum-ui.kapitalbank.uz/en-US/os-theme/components/typography",
17071
17071
  "type": "TypographyVariantWeightsOptions",
17072
- "description": "Custom varinatWeights as object: Record<PropertyKey, readonly string[]>",
17072
+ "description": "**Deprecated**. Weight options are fixed;",
17073
17073
  "default": "() => ({})"
17074
17074
  }
17075
17075
  ],