@namuna-nur/ui-kit 1.9.17 → 1.9.19
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/lib/atoms/index.js +375 -356
- package/lib/index.js +105 -103
- package/lib/molecules/index.js +1004 -975
- package/lib/src/atoms/Avatar/Avatar.d.ts +2 -1
- package/lib/src/atoms/Avatar/Avatar.stories.d.ts +1 -0
- package/lib/src/atoms/Avatar/Avatar.types.d.ts +1 -0
- package/lib/src/molecules/CommentList/CommentList.tokens.d.ts +1 -0
- package/lib/src/molecules/PhoneInput/PhoneInput.stories.d.ts +1 -0
- package/lib/src/molecules/PhoneInput/PhoneInput.types.d.ts +2 -0
- package/lib/src/utils/date.d.ts +3 -1
- package/lib/utils/index.js +32 -30
- package/package.json +1 -1
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { AvatarProps } from '..';
|
|
2
|
-
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -6,4 +6,5 @@ export declare const WithPhotoOnly: AvatarStory;
|
|
|
6
6
|
export declare const WithBadgeOnly: AvatarStory;
|
|
7
7
|
export declare const WithPhotoAndBadge: AvatarStory;
|
|
8
8
|
export declare const ActivePhotoAndBadge: AvatarStory;
|
|
9
|
+
export declare const AvatarImageUpload: AvatarStory;
|
|
9
10
|
export default meta;
|
|
@@ -3,6 +3,7 @@ import { PhoneInput } from './PhoneInput';
|
|
|
3
3
|
import { PhoneInputStory } from '..';
|
|
4
4
|
declare const meta: Meta<typeof PhoneInput>;
|
|
5
5
|
export declare const Default: PhoneInputStory;
|
|
6
|
+
export declare const PhoneNumberUz: PhoneInputStory;
|
|
6
7
|
export declare const Focus: PhoneInputStory;
|
|
7
8
|
export declare const Filled: PhoneInputStory;
|
|
8
9
|
export declare const Disabled: PhoneInputStory;
|
|
@@ -8,6 +8,7 @@ export type PhoneInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'onCha
|
|
|
8
8
|
status?: PhoneInputStatusType;
|
|
9
9
|
message?: string;
|
|
10
10
|
label?: string;
|
|
11
|
+
countryCode?: 'UZ' | 'DEFAULT';
|
|
11
12
|
onChange: (rawValue: string) => void;
|
|
12
13
|
classNames?: {
|
|
13
14
|
parent?: string;
|
|
@@ -19,6 +20,7 @@ export type PhoneInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'onCha
|
|
|
19
20
|
export type PhoneInputTokens = {
|
|
20
21
|
parent: string;
|
|
21
22
|
base: string;
|
|
23
|
+
title: string;
|
|
22
24
|
hover: string;
|
|
23
25
|
focus: string;
|
|
24
26
|
disabled: string;
|
package/lib/src/utils/date.d.ts
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare const DATE_FORMAT_DAY_MONTH_YEAR_DOT = "yyyy.MM.dd";
|
|
2
|
+
export declare const DATE_FORMAT_DAY_MONTH_YEAR_DASH = "yyyy-MM-dd";
|
|
3
|
+
export declare function formatDateToDayMonthYear(date: Date | string, formatDate: string): string;
|
package/lib/utils/index.js
CHANGED
|
@@ -3,28 +3,28 @@ import { clsx as l } from "clsx";
|
|
|
3
3
|
import { extendTailwindMerge as p } from "tailwind-merge";
|
|
4
4
|
import { typographyTokens as i, colorTokens as f } from "../tokens/index.js";
|
|
5
5
|
import { PieChart as u, LineChart as d } from "echarts/charts";
|
|
6
|
-
import { GridComponent as
|
|
7
|
-
import * as
|
|
6
|
+
import { GridComponent as M, TitleComponent as T, TooltipComponent as h, LegendComponent as y } from "echarts/components";
|
|
7
|
+
import * as x from "echarts/core";
|
|
8
8
|
import { CanvasRenderer as N } from "echarts/renderers";
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
-
return c(new Date(t),
|
|
9
|
+
const R = "yyyy.MM.dd", S = "yyyy-MM-dd";
|
|
10
|
+
function w(t, o) {
|
|
11
|
+
return c(new Date(t), o);
|
|
12
12
|
}
|
|
13
|
-
const m = (t, { splitClassName:
|
|
14
|
-
const o = {};
|
|
15
|
-
return Object.keys(t).forEach((r) => {
|
|
16
|
-
const [n, s] = e ? r.split("-") : ["", r], a = `text-${e ? n : r}`;
|
|
17
|
-
o[a] || (o[a] = []), o[a].push(s);
|
|
18
|
-
}), o;
|
|
19
|
-
}, y = (t) => {
|
|
13
|
+
const m = (t, { splitClassName: o } = { splitClassName: !0 }) => {
|
|
20
14
|
const e = {};
|
|
21
|
-
return Object.
|
|
22
|
-
const n = `text-${o}`;
|
|
23
|
-
e[
|
|
15
|
+
return Object.keys(t).forEach((r) => {
|
|
16
|
+
const [n, s] = o ? r.split("-") : ["", r], a = `text-${o ? n : r}`;
|
|
17
|
+
e[a] || (e[a] = []), e[a].push(s);
|
|
18
|
+
}), e;
|
|
19
|
+
}, C = (t) => {
|
|
20
|
+
const o = {};
|
|
21
|
+
return Object.entries(t).forEach(([e, r]) => {
|
|
22
|
+
const n = `text-${e}`;
|
|
23
|
+
o[n] = Object.keys(r).filter(
|
|
24
24
|
(s) => !isNaN(Number(s))
|
|
25
25
|
);
|
|
26
|
-
}),
|
|
27
|
-
},
|
|
26
|
+
}), o;
|
|
27
|
+
}, _ = p({
|
|
28
28
|
extend: {
|
|
29
29
|
classGroups: {
|
|
30
30
|
"font-size": [
|
|
@@ -36,28 +36,30 @@ const m = (t, { splitClassName: e } = { splitClassName: !0 }) => {
|
|
|
36
36
|
splitClassName: !1
|
|
37
37
|
})
|
|
38
38
|
],
|
|
39
|
-
"text-color": [
|
|
39
|
+
"text-color": [C(f)]
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
}),
|
|
43
|
-
const
|
|
42
|
+
}), z = (...t) => _(l(t)), B = (t) => new Intl.NumberFormat("ru-RU").format(Number(t)), G = (t) => {
|
|
43
|
+
const o = ["B", "KB", "MB", "GB"];
|
|
44
44
|
if (t === 0) return "0 B";
|
|
45
|
-
const
|
|
46
|
-
return `${(t / Math.pow(1024,
|
|
45
|
+
const e = Math.floor(Math.log(t) / Math.log(1024));
|
|
46
|
+
return `${(t / Math.pow(1024, e)).toFixed(2)}${o[e]}`;
|
|
47
47
|
};
|
|
48
|
-
|
|
48
|
+
x.use([
|
|
49
49
|
N,
|
|
50
50
|
u,
|
|
51
51
|
d,
|
|
52
|
-
h,
|
|
53
52
|
M,
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
T,
|
|
54
|
+
h,
|
|
55
|
+
y
|
|
56
56
|
]);
|
|
57
57
|
export {
|
|
58
|
-
|
|
58
|
+
S as DATE_FORMAT_DAY_MONTH_YEAR_DASH,
|
|
59
|
+
R as DATE_FORMAT_DAY_MONTH_YEAR_DOT,
|
|
60
|
+
z as cn,
|
|
59
61
|
m as convertToGroupedFontSizes,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
w as formatDateToDayMonthYear,
|
|
63
|
+
G as formatFileSize,
|
|
64
|
+
B as numberFormat
|
|
63
65
|
};
|