@dss-kit/ui-kit 0.3.10 → 1.0.1
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 +29 -29
- package/dist/components/builders/Modal/Modal.js +3 -3
- package/dist/components/builders/Modal/ModalFooter/ModalFooter.js +7 -7
- package/dist/components/builders/Modal/ModalHeader/ModalHeader.js +15 -15
- package/dist/components/builders/Modal/ModalMain/styles.js +3 -3
- package/dist/components/builders/Modal/styles.js +2 -2
- package/dist/components/builders/Table/Table.js +66 -58
- package/dist/components/builders/Table/Table.utils.js +5 -5
- package/dist/components/builders/Table/TableBodyRow/TableBodyRow.js +5 -5
- package/dist/components/builders/Table/TableHeadRow/TableHeadRow.js +4 -4
- package/dist/components/builders/Table/TablePagination/TablePagination.js +44 -44
- package/dist/components/builders/Table/TableWrapper/TableWrapper.js +19 -19
- package/dist/components/charts/LineChart/constants.js +16 -16
- package/dist/components/charts/LineChart/utils.js +2 -2
- package/dist/components/charts/PieProgressChart/constants.js +16 -10
- package/dist/components/controls/Button/Button.js +35 -35
- package/dist/components/controls/Button/styles.js +4 -4
- package/dist/components/controls/Checkbox/styles.js +7 -7
- package/dist/components/controls/IconButton/styles.js +27 -27
- package/dist/components/controls/Input/styles.js +10 -10
- package/dist/components/controls/MarkdownTextEditor/MarkdownTextEditor.js +28 -28
- package/dist/components/controls/MarkdownTextEditor/components/EditorToolbar/ActionMenuButton/ActionMenuButton.js +13 -13
- package/dist/components/controls/MarkdownTextEditor/components/EditorToolbar/ActionMenuButton/ActionMenuButton.styles.js +2 -2
- package/dist/components/controls/MarkdownTextEditor/components/EditorToolbar/EditorToolbar.js +43 -43
- package/dist/components/controls/MarkdownTextEditor/nodes/CustomLinkNode/parts/CustomLinkNodeComponent/CustomLinkNodeComponent.styles.js +3 -3
- package/dist/components/controls/MarkdownTextEditor/nodes/ImageRowNode/parts/ImageRowNodeComponent/ImageRowNodeComponent.styles.js +2 -2
- package/dist/components/controls/MarkdownTextEditor/themes/editor.theme.js +1 -1
- package/dist/components/controls/OtpInput/styles.js +11 -11
- package/dist/components/controls/RadioGroup/Radio.js +48 -48
- package/dist/components/controls/SegmentControl/SegmentControl.js +12 -12
- package/dist/components/controls/SegmentControl/styles.js +8 -8
- package/dist/components/controls/Select/styles.js +19 -19
- package/dist/components/controls/Switch/Switch.d.ts +3 -3
- package/dist/components/controls/Switch/styles.d.ts +1 -0
- package/dist/components/controls/Switch/styles.js +44 -34
- package/dist/components/controls/Tabs/TabItem/TabItem.d.ts +5 -0
- package/dist/components/controls/Tabs/TabItem/TabItem.js +68 -49
- package/dist/components/controls/Tabs/Tabs.d.ts +6 -1
- package/dist/components/controls/Tabs/Tabs.js +28 -25
- package/dist/components/shared/Avatar/Avatar.js +8 -8
- package/dist/components/shared/Badge/Badge.js +40 -40
- package/dist/components/shared/Counter/Counter.const.d.ts +6 -0
- package/dist/components/shared/Counter/Counter.const.js +16 -0
- package/dist/components/shared/Counter/Counter.d.ts +11 -0
- package/dist/components/shared/Counter/Counter.js +58 -0
- package/dist/components/shared/Counter/Counter.types.d.ts +29 -0
- package/dist/components/shared/Counter/Counter.utils.d.ts +2 -0
- package/dist/components/shared/Counter/Counter.utils.js +6 -0
- package/dist/components/shared/Counter/index.d.ts +2 -0
- package/dist/components/shared/Counter/styles.d.ts +2 -0
- package/dist/components/shared/Counter/styles.js +11 -0
- package/dist/components/shared/Dot/Dot.const.d.ts +5 -0
- package/dist/components/shared/Dot/Dot.const.js +15 -0
- package/dist/components/shared/Dot/Dot.d.ts +10 -0
- package/dist/components/shared/Dot/Dot.js +32 -0
- package/dist/components/shared/Dot/Dot.types.d.ts +17 -0
- package/dist/components/shared/Dot/index.d.ts +2 -0
- package/dist/components/shared/Dot/styles.d.ts +1 -0
- package/dist/components/shared/Dot/styles.js +7 -0
- package/dist/components/shared/Hint/styles.js +6 -6
- package/dist/components/shared/MarkdownText/MarkdownText.styles.js +4 -4
- package/dist/components/shared/Popover/PopoverContent/PopoverContent.js +2 -2
- package/dist/components/shared/Skeleton/Skeleton.js +11 -11
- package/dist/components/shared/Tag/Tag.js +14 -14
- package/dist/components/shared/Toast/Toast.js +30 -30
- package/dist/components/shared/Tooltip/Tooltip.js +28 -28
- package/dist/components/shared/Tooltip/constants.js +3 -3
- package/dist/components/shared/index.d.ts +2 -0
- package/dist/index.js +55 -48
- package/dist/providers/ThemeProviderScoped/ThemeProviderScoped.const.d.ts +8 -0
- package/dist/providers/ThemeProviderScoped/ThemeProviderScoped.context.d.ts +12 -0
- package/dist/providers/ThemeProviderScoped/ThemeProviderScoped.context.js +12 -0
- package/dist/providers/ThemeProviderScoped/ThemeProviderScoped.d.ts +1 -1
- package/dist/providers/ThemeProviderScoped/ThemeProviderScoped.js +37 -26
- package/dist/providers/ThemeProviderScoped/ThemeProviderScoped.types.d.ts +30 -5
- package/dist/providers/ThemeProviderScoped/index.d.ts +1 -0
- package/dist/root.css +1 -1
- package/dist/styles/utils/breakpoints/base.scss +11 -11
- package/dist/styles/utils/breakpoints/index.scss +3 -3
- package/dist/styles/utils/breakpoints/screen.scss +61 -61
- package/dist/styles/utils/breakpoints/semantic.scss +31 -31
- package/dist/styles/utils/fonts/font-family.scss +3 -3
- package/dist/styles/utils/fonts/index.scss +1 -1
- package/dist/styles/utils/index.scss +5 -5
- package/dist/styles/utils/size/index.scss +1 -1
- package/dist/styles/utils/size/modifiers.scss +40 -40
- package/dist/styles/utils/style/index.scss +1 -1
- package/dist/styles/utils/style/variants.scss +34 -34
- package/dist/styles/utils/typography/_font-weight.scss +33 -33
- package/dist/styles/utils/typography/_variants.scss +85 -85
- package/dist/styles/utils/typography/index.scss +2 -2
- package/dist/ui-kit.cjs +8 -8
- package/dist/ui-kit.css +1 -1
- package/dist/utils/theme/index.d.ts +141 -141
- package/dist/utils/theme/index.js +14 -14
- package/dist/utils/theme/palette.d.ts +184 -0
- package/dist/utils/theme/palette.js +187 -0
- package/package.json +94 -94
- package/dist/providers/ThemeProviderScoped/styles.module.scss.js +0 -7
- package/dist/utils/theme/color.d.ts +0 -184
- package/dist/utils/theme/color.js +0 -187
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as B, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { cx as y, css as x } from "@emotion/css";
|
|
3
|
-
import
|
|
4
|
-
import { Box as
|
|
5
|
-
import { theme as
|
|
6
|
-
import { Ripple as
|
|
3
|
+
import $ from "../../../assets/svg/shared/close-outline.svg.js";
|
|
4
|
+
import { Box as j } from "../../builders/Box/Box.js";
|
|
5
|
+
import { theme as R } from "../../../utils/theme/index.js";
|
|
6
|
+
import { Ripple as S } from "../../builders/Ripple/Ripple.js";
|
|
7
7
|
import { Text as h } from "../../builders/Text/Text.js";
|
|
8
|
-
const { color: e, cornerRadius:
|
|
8
|
+
const { color: e, cornerRadius: i, spacing: a } = R, b = {
|
|
9
9
|
neutral: {
|
|
10
|
-
border: e.border.
|
|
11
|
-
bg: e.status.
|
|
10
|
+
border: e.border.neutral_alpha_low,
|
|
11
|
+
bg: e.status.neutral_tint,
|
|
12
12
|
color: e.text.secondary,
|
|
13
13
|
colorName: "secondary"
|
|
14
14
|
},
|
|
15
15
|
accent: {
|
|
16
|
-
border: e.border.
|
|
17
|
-
bg: e.status.
|
|
16
|
+
border: e.border.accent_secondary,
|
|
17
|
+
bg: e.status.accent_tint_low,
|
|
18
18
|
color: e.text.accent,
|
|
19
19
|
colorName: "accent"
|
|
20
20
|
},
|
|
21
21
|
warning: {
|
|
22
|
-
border: e.border.
|
|
23
|
-
bg: e.status.
|
|
22
|
+
border: e.border.warning_secondary,
|
|
23
|
+
bg: e.status.warning_tint_low,
|
|
24
24
|
color: e.text.warning,
|
|
25
25
|
colorName: "warning"
|
|
26
26
|
},
|
|
27
27
|
positive: {
|
|
28
|
-
border: e.border.
|
|
29
|
-
bg: e.status.
|
|
28
|
+
border: e.border.positive_secondary,
|
|
29
|
+
bg: e.status.positive_tint_low,
|
|
30
30
|
color: e.text.positive,
|
|
31
31
|
colorName: "positive"
|
|
32
32
|
},
|
|
33
33
|
negative: {
|
|
34
|
-
border: e.border.
|
|
35
|
-
bg: e.status.
|
|
34
|
+
border: e.border.negative_secondary,
|
|
35
|
+
bg: e.status.negative_tint_low,
|
|
36
36
|
color: e.text.negative,
|
|
37
37
|
colorName: "negative"
|
|
38
38
|
},
|
|
@@ -46,35 +46,35 @@ const { color: e, cornerRadius: l, spacing: a } = $, b = {
|
|
|
46
46
|
xs: {
|
|
47
47
|
h: 18,
|
|
48
48
|
text: "caption-2",
|
|
49
|
-
corner:
|
|
49
|
+
corner: i.xs,
|
|
50
50
|
p: `3px ${a.xs}`,
|
|
51
51
|
gap: "2px"
|
|
52
52
|
},
|
|
53
53
|
sm: {
|
|
54
54
|
h: 24,
|
|
55
55
|
text: "caption-1",
|
|
56
|
-
corner:
|
|
56
|
+
corner: i.xs,
|
|
57
57
|
p: `6px ${a.sm}`,
|
|
58
58
|
gap: a.sm
|
|
59
59
|
},
|
|
60
60
|
md: {
|
|
61
61
|
h: 32,
|
|
62
62
|
text: "body-2",
|
|
63
|
-
corner:
|
|
63
|
+
corner: i.sm,
|
|
64
64
|
p: `6px ${a.md}`,
|
|
65
65
|
gap: a.sm
|
|
66
66
|
},
|
|
67
67
|
lg: {
|
|
68
68
|
h: 40,
|
|
69
69
|
text: "body-2",
|
|
70
|
-
corner:
|
|
70
|
+
corner: i.md,
|
|
71
71
|
p: `6px ${a.lg}`,
|
|
72
72
|
gap: a.sm
|
|
73
73
|
}
|
|
74
|
-
},
|
|
74
|
+
}, I = (d, s, o, m) => {
|
|
75
75
|
const t = b[s];
|
|
76
76
|
let r = t.bg, c = "none";
|
|
77
|
-
const
|
|
77
|
+
const l = t.color;
|
|
78
78
|
switch (d) {
|
|
79
79
|
case "outline":
|
|
80
80
|
r = "transparent", c = `1px solid ${t.border}`;
|
|
@@ -93,10 +93,10 @@ const { color: e, cornerRadius: l, spacing: a } = $, b = {
|
|
|
93
93
|
position: "relative",
|
|
94
94
|
transition: "background-color 0.2s, opacity 0.2s",
|
|
95
95
|
backgroundColor: r,
|
|
96
|
-
color:
|
|
96
|
+
color: l,
|
|
97
97
|
border: c
|
|
98
98
|
});
|
|
99
|
-
},
|
|
99
|
+
}, O = x({
|
|
100
100
|
display: "inline-flex",
|
|
101
101
|
cursor: "pointer",
|
|
102
102
|
opacity: 0.6,
|
|
@@ -105,7 +105,7 @@ const { color: e, cornerRadius: l, spacing: a } = $, b = {
|
|
|
105
105
|
display: "inline-flex",
|
|
106
106
|
alignItems: "center",
|
|
107
107
|
color: "inherit"
|
|
108
|
-
}),
|
|
108
|
+
}), T = ({
|
|
109
109
|
label: d,
|
|
110
110
|
color: s = "neutral",
|
|
111
111
|
size: o = "md",
|
|
@@ -113,30 +113,30 @@ const { color: e, cornerRadius: l, spacing: a } = $, b = {
|
|
|
113
113
|
width: t,
|
|
114
114
|
textAlign: r = "center",
|
|
115
115
|
leftElement: c,
|
|
116
|
-
rightElement:
|
|
116
|
+
rightElement: l,
|
|
117
117
|
disabled: u,
|
|
118
118
|
onClick: g,
|
|
119
119
|
onDelete: f,
|
|
120
120
|
className: N,
|
|
121
|
-
labelClassName:
|
|
122
|
-
deleteButtonClassName:
|
|
121
|
+
labelClassName: _,
|
|
122
|
+
deleteButtonClassName: C
|
|
123
123
|
}) => {
|
|
124
|
-
const
|
|
125
|
-
return /* @__PURE__ */
|
|
126
|
-
|
|
124
|
+
const k = I(m, s, u, g);
|
|
125
|
+
return /* @__PURE__ */ B(
|
|
126
|
+
j,
|
|
127
127
|
{
|
|
128
128
|
row: !0,
|
|
129
129
|
alignItems: "center",
|
|
130
130
|
justifyContent: "center",
|
|
131
131
|
p: p[o].p,
|
|
132
|
-
|
|
132
|
+
minHeight: p[o].h,
|
|
133
133
|
w: t,
|
|
134
134
|
overflow: "hidden",
|
|
135
135
|
borderRadius: p[o].corner,
|
|
136
136
|
onClick: g,
|
|
137
|
-
className: y(
|
|
137
|
+
className: y(k, N),
|
|
138
138
|
children: [
|
|
139
|
-
g && /* @__PURE__ */ n(
|
|
139
|
+
g && /* @__PURE__ */ n(S, {}),
|
|
140
140
|
c && /* @__PURE__ */ n("span", { className: w, children: c }),
|
|
141
141
|
/* @__PURE__ */ n(
|
|
142
142
|
h,
|
|
@@ -148,27 +148,27 @@ const { color: e, cornerRadius: l, spacing: a } = $, b = {
|
|
|
148
148
|
center: r === "center",
|
|
149
149
|
right: r === "right",
|
|
150
150
|
flex: t ? 1 : void 0,
|
|
151
|
-
className:
|
|
151
|
+
className: _,
|
|
152
152
|
children: d
|
|
153
153
|
}
|
|
154
154
|
),
|
|
155
|
-
|
|
155
|
+
l && /* @__PURE__ */ n("span", { className: w, children: l }),
|
|
156
156
|
f && !u && /* @__PURE__ */ n(
|
|
157
157
|
h,
|
|
158
158
|
{
|
|
159
|
-
className: y(
|
|
159
|
+
className: y(O, C),
|
|
160
160
|
colorName: b[s].colorName,
|
|
161
161
|
onClick: (v) => {
|
|
162
162
|
v.stopPropagation(), f(v);
|
|
163
163
|
},
|
|
164
|
-
children: /* @__PURE__ */ n(
|
|
164
|
+
children: /* @__PURE__ */ n($, {})
|
|
165
165
|
}
|
|
166
166
|
)
|
|
167
167
|
]
|
|
168
168
|
}
|
|
169
169
|
);
|
|
170
170
|
};
|
|
171
|
-
|
|
171
|
+
T.displayName = "Badge";
|
|
172
172
|
export {
|
|
173
|
-
|
|
173
|
+
T as Badge
|
|
174
174
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CounterColorName, CounterSize } from './Counter.types';
|
|
2
|
+
export declare const DEFAULT_MAX_NUMBER = 99;
|
|
3
|
+
export declare const COUNTER_CUTOUT_WIDTH = 1;
|
|
4
|
+
export declare const COUNTER_CUTOUT_COLOR: "var(--fill-bg-primary)";
|
|
5
|
+
export declare const COUNTER_BACKGROUND: Record<CounterColorName, string>;
|
|
6
|
+
export declare const COUNTER_HEIGHT: Record<CounterSize, number>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { theme as o } from "../../../utils/theme/index.js";
|
|
2
|
+
const { color: t } = o, n = 99, c = 1, e = t.fill.bg_primary, T = {
|
|
3
|
+
negative: t.status.negative,
|
|
4
|
+
accent: t.status.accent,
|
|
5
|
+
neutral: t.status.neutral
|
|
6
|
+
}, U = {
|
|
7
|
+
sm: 16,
|
|
8
|
+
md: 20
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
T as COUNTER_BACKGROUND,
|
|
12
|
+
e as COUNTER_CUTOUT_COLOR,
|
|
13
|
+
c as COUNTER_CUTOUT_WIDTH,
|
|
14
|
+
U as COUNTER_HEIGHT,
|
|
15
|
+
n as DEFAULT_MAX_NUMBER
|
|
16
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CounterProps } from './Counter.types';
|
|
2
|
+
/**
|
|
3
|
+
* Счётчик: число или короткий текст в цветной капсуле.
|
|
4
|
+
* @example
|
|
5
|
+
* ```tsx
|
|
6
|
+
* <Counter value={5} />
|
|
7
|
+
* <Counter value={120} maxNumber={99} colorName="accent" size="sm" />
|
|
8
|
+
* <Counter value="New" />
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare function Counter({ value, maxNumber, colorName, size, withBorder, className, }: CounterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { cx as s } from "@emotion/css";
|
|
3
|
+
import { useMemo as c } from "react";
|
|
4
|
+
import { DEFAULT_MAX_NUMBER as p, COUNTER_BACKGROUND as d, COUNTER_CUTOUT_COLOR as f, COUNTER_CUTOUT_WIDTH as u, COUNTER_HEIGHT as n } from "./Counter.const.js";
|
|
5
|
+
import { getCounterLabel as C } from "./Counter.utils.js";
|
|
6
|
+
import { counterLabelStyles as T, counterStyles as U } from "./styles.js";
|
|
7
|
+
import { Box as R } from "../../builders/Box/Box.js";
|
|
8
|
+
import { theme as h } from "../../../utils/theme/index.js";
|
|
9
|
+
import { Text as O } from "../../builders/Text/Text.js";
|
|
10
|
+
const { cornerRadius: b, spacing: x } = h;
|
|
11
|
+
function A({
|
|
12
|
+
value: r,
|
|
13
|
+
maxNumber: e = p,
|
|
14
|
+
colorName: i = "negative",
|
|
15
|
+
size: o = "md",
|
|
16
|
+
withBorder: m = !0,
|
|
17
|
+
className: a
|
|
18
|
+
}) {
|
|
19
|
+
const l = c(
|
|
20
|
+
() => C({ value: r, maxNumber: e }),
|
|
21
|
+
[r, e]
|
|
22
|
+
);
|
|
23
|
+
return /* @__PURE__ */ t(
|
|
24
|
+
R,
|
|
25
|
+
{
|
|
26
|
+
row: !0,
|
|
27
|
+
display: "inline-flex",
|
|
28
|
+
alignItems: "center",
|
|
29
|
+
justifyContent: "center",
|
|
30
|
+
flexShrink: 0,
|
|
31
|
+
h: n[o],
|
|
32
|
+
minWidth: n[o],
|
|
33
|
+
px: x.xs,
|
|
34
|
+
borderRadius: b.fullRound,
|
|
35
|
+
borderWidth: u,
|
|
36
|
+
borderStyle: "solid",
|
|
37
|
+
borderColor: m ? f : "transparent",
|
|
38
|
+
backgroundColor: d[i],
|
|
39
|
+
className: s(U, a),
|
|
40
|
+
children: /* @__PURE__ */ t(
|
|
41
|
+
O,
|
|
42
|
+
{
|
|
43
|
+
tag: "span",
|
|
44
|
+
variant: "caption-2",
|
|
45
|
+
fontWeight: "semibold",
|
|
46
|
+
colorName: "inverse",
|
|
47
|
+
whiteSpace: "nowrap",
|
|
48
|
+
center: !0,
|
|
49
|
+
className: T,
|
|
50
|
+
children: l
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
A as Counter
|
|
58
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AccentType, NegativeType, NeutralType, Size } from '../../../types/tokens.types';
|
|
2
|
+
export type CounterColorName = NegativeType | AccentType | NeutralType;
|
|
3
|
+
export type CounterSize = Extract<Size, "sm" | "md">;
|
|
4
|
+
export interface CounterProps {
|
|
5
|
+
/** Значение счётчика. Строка выводится как есть, число ограничивается через `maxNumber`. */
|
|
6
|
+
value: number | string;
|
|
7
|
+
/**
|
|
8
|
+
* Верхняя граница для числового `value`: при превышении выводится `${maxNumber}+`.
|
|
9
|
+
* `null` снимает ограничение. На строки не действует.
|
|
10
|
+
* @default 99
|
|
11
|
+
*/
|
|
12
|
+
maxNumber?: number | null;
|
|
13
|
+
/** Цветовая схема счётчика. @default "negative" */
|
|
14
|
+
colorName?: CounterColorName;
|
|
15
|
+
/** Размер счётчика: "sm" (16px) или "md" (20px). @default "md" */
|
|
16
|
+
size?: CounterSize;
|
|
17
|
+
/**
|
|
18
|
+
* Обводка цветом фона страницы. Отделяет счётчик от элемента, на который он наложен.
|
|
19
|
+
* При `false` рамка становится прозрачной, место под неё и размеры счётчика сохраняются.
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
withBorder?: boolean;
|
|
23
|
+
/** Класс для корневого элемента. Добавляется к внутренним классам, например для позиционирования снаружи. */
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface GetCounterLabelParams {
|
|
27
|
+
value: number | string;
|
|
28
|
+
maxNumber: number | null;
|
|
29
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DotColorName, DotSize } from './Dot.types';
|
|
2
|
+
export declare const DOT_CUTOUT_WIDTH = 1;
|
|
3
|
+
export declare const DOT_CUTOUT_COLOR: "var(--fill-bg-primary)";
|
|
4
|
+
export declare const DOT_BACKGROUND: Record<DotColorName, string>;
|
|
5
|
+
export declare const DOT_SIZE: Record<DotSize, number>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { theme as o } from "../../../utils/theme/index.js";
|
|
2
|
+
const { color: t } = o, e = 1, n = t.fill.bg_primary, c = {
|
|
3
|
+
negative: t.status.negative,
|
|
4
|
+
accent: t.status.accent,
|
|
5
|
+
neutral: t.status.neutral
|
|
6
|
+
}, a = {
|
|
7
|
+
sm: 6,
|
|
8
|
+
md: 8
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
c as DOT_BACKGROUND,
|
|
12
|
+
n as DOT_CUTOUT_COLOR,
|
|
13
|
+
e as DOT_CUTOUT_WIDTH,
|
|
14
|
+
a as DOT_SIZE
|
|
15
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DotProps } from './Dot.types';
|
|
2
|
+
/**
|
|
3
|
+
* Точка-индикатор без текста, например отметка непрочитанного.
|
|
4
|
+
* @example
|
|
5
|
+
* ```tsx
|
|
6
|
+
* <Dot />
|
|
7
|
+
* <Dot colorName="accent" size="sm" />
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
export declare function Dot({ colorName, size, withBorder, className, }: DotProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { cx as d } from "@emotion/css";
|
|
3
|
+
import { DOT_BACKGROUND as n, DOT_CUTOUT_COLOR as l, DOT_CUTOUT_WIDTH as f, DOT_SIZE as o } from "./Dot.const.js";
|
|
4
|
+
import { dotStyles as a } from "./styles.js";
|
|
5
|
+
import { Box as p } from "../../builders/Box/Box.js";
|
|
6
|
+
import { theme as s } from "../../../utils/theme/index.js";
|
|
7
|
+
const { cornerRadius: O } = s;
|
|
8
|
+
function _({
|
|
9
|
+
colorName: t = "negative",
|
|
10
|
+
size: r = "md",
|
|
11
|
+
withBorder: e = !0,
|
|
12
|
+
className: i
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ m(
|
|
15
|
+
p,
|
|
16
|
+
{
|
|
17
|
+
display: "inline-flex",
|
|
18
|
+
flexShrink: 0,
|
|
19
|
+
w: o[r],
|
|
20
|
+
h: o[r],
|
|
21
|
+
borderRadius: O.fullRound,
|
|
22
|
+
borderWidth: f,
|
|
23
|
+
borderStyle: "solid",
|
|
24
|
+
borderColor: e ? l : "transparent",
|
|
25
|
+
backgroundColor: n[t],
|
|
26
|
+
className: d(a, i)
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
_ as Dot
|
|
32
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AccentType, NegativeType, NeutralType, Size } from '../../../types/tokens.types';
|
|
2
|
+
export type DotColorName = NegativeType | AccentType | NeutralType;
|
|
3
|
+
export type DotSize = Extract<Size, "sm" | "md">;
|
|
4
|
+
export interface DotProps {
|
|
5
|
+
/** Цветовая схема точки. @default "negative" */
|
|
6
|
+
colorName?: DotColorName;
|
|
7
|
+
/** Размер точки вместе с обводкой: "sm" (6px) или "md" (8px). @default "md" */
|
|
8
|
+
size?: DotSize;
|
|
9
|
+
/**
|
|
10
|
+
* Обводка цветом фона страницы. Отделяет точку от элемента, на который она наложена.
|
|
11
|
+
* При `false` рамка становится прозрачной, место под неё и размеры точки сохраняются.
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
14
|
+
withBorder?: boolean;
|
|
15
|
+
/** Класс для корневого элемента. Добавляется к внутренним классам, например для позиционирования снаружи. */
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const dotStyles: string;
|
|
@@ -65,27 +65,27 @@ const { color: t, cornerRadius: o, spacing: n } = i, s = {
|
|
|
65
65
|
},
|
|
66
66
|
soft: {
|
|
67
67
|
warning: e({
|
|
68
|
-
background: t.status.
|
|
68
|
+
background: t.status.warning_tint_low,
|
|
69
69
|
color: t.text.warning
|
|
70
70
|
}),
|
|
71
71
|
negative: e({
|
|
72
|
-
background: t.status.
|
|
72
|
+
background: t.status.negative_tint_low,
|
|
73
73
|
color: t.text.negative
|
|
74
74
|
}),
|
|
75
75
|
positive: e({
|
|
76
|
-
background: t.status.
|
|
76
|
+
background: t.status.positive_tint_low,
|
|
77
77
|
color: t.text.positive
|
|
78
78
|
}),
|
|
79
79
|
accent: e({
|
|
80
|
-
background: t.status.
|
|
80
|
+
background: t.status.accent_tint_low,
|
|
81
81
|
color: t.text.accent
|
|
82
82
|
}),
|
|
83
83
|
neutral: e({
|
|
84
|
-
background: t.status.
|
|
84
|
+
background: t.status.neutral_tint_low,
|
|
85
85
|
color: t.text.tertiary
|
|
86
86
|
}),
|
|
87
87
|
transfer: e({
|
|
88
|
-
background: t.status.
|
|
88
|
+
background: t.status.transfer_tint_low,
|
|
89
89
|
color: t.text.transfer
|
|
90
90
|
})
|
|
91
91
|
}
|
|
@@ -58,7 +58,7 @@ const { color: o, cornerRadius: n, spacing: t } = l, h = i({
|
|
|
58
58
|
code: {
|
|
59
59
|
padding: `0 ${t.xs}`,
|
|
60
60
|
borderRadius: n.xs,
|
|
61
|
-
backgroundColor: o.fill.
|
|
61
|
+
backgroundColor: o.fill.neutral_secondary,
|
|
62
62
|
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'
|
|
63
63
|
},
|
|
64
64
|
"pre code": {
|
|
@@ -69,7 +69,7 @@ const { color: o, cornerRadius: n, spacing: t } = l, h = i({
|
|
|
69
69
|
blockquote: {
|
|
70
70
|
marginLeft: 0,
|
|
71
71
|
paddingLeft: t.md,
|
|
72
|
-
borderLeft: `3px solid ${o.border.
|
|
72
|
+
borderLeft: `3px solid ${o.border.neutral_alpha_basic}`,
|
|
73
73
|
color: o.text.secondary
|
|
74
74
|
},
|
|
75
75
|
table: {
|
|
@@ -77,12 +77,12 @@ const { color: o, cornerRadius: n, spacing: t } = l, h = i({
|
|
|
77
77
|
borderCollapse: "collapse"
|
|
78
78
|
},
|
|
79
79
|
"th, td": {
|
|
80
|
-
border: `1px solid ${o.border.
|
|
80
|
+
border: `1px solid ${o.border.neutral_alpha_basic}`,
|
|
81
81
|
padding: t.sm,
|
|
82
82
|
textAlign: "left"
|
|
83
83
|
},
|
|
84
84
|
th: {
|
|
85
|
-
backgroundColor: o.fill.
|
|
85
|
+
backgroundColor: o.fill.neutral_secondary
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
export {
|
|
@@ -11,7 +11,7 @@ const { color: o, cornerRadius: p } = i, f = m`
|
|
|
11
11
|
}
|
|
12
12
|
`, d = c({
|
|
13
13
|
animation: `${f} 0.2s ease-out`,
|
|
14
|
-
boxShadow: `0 4px 20px 0 ${o.effect.
|
|
14
|
+
boxShadow: `0 4px 20px 0 ${o.effect.shadow_s}`
|
|
15
15
|
}), b = ({
|
|
16
16
|
children: r,
|
|
17
17
|
className: t,
|
|
@@ -20,7 +20,7 @@ const { color: o, cornerRadius: p } = i, f = m`
|
|
|
20
20
|
n,
|
|
21
21
|
{
|
|
22
22
|
relative: !0,
|
|
23
|
-
backgroundColor: o.fill.
|
|
23
|
+
backgroundColor: o.fill.bg_primary,
|
|
24
24
|
borderRadius: p.md,
|
|
25
25
|
className: a(d, t),
|
|
26
26
|
...e,
|
|
@@ -8,7 +8,7 @@ const { color: A, cornerRadius: e, spacing: X } = S, k = {
|
|
|
8
8
|
md: { width: 32, height: 32 },
|
|
9
9
|
lg: { width: 40, height: 40 },
|
|
10
10
|
xl: { width: 48, height: 48 }
|
|
11
|
-
},
|
|
11
|
+
}, z = {
|
|
12
12
|
zero: e.zero,
|
|
13
13
|
xs: e.xs,
|
|
14
14
|
sm: e.sm,
|
|
@@ -23,7 +23,7 @@ const { color: A, cornerRadius: e, spacing: X } = S, k = {
|
|
|
23
23
|
"full-round": e.fullRound,
|
|
24
24
|
circular: "50%"
|
|
25
25
|
}, w = t({
|
|
26
|
-
backgroundColor: A.status.
|
|
26
|
+
backgroundColor: A.status.neutral_tint,
|
|
27
27
|
borderRadius: e.sm,
|
|
28
28
|
position: "relative",
|
|
29
29
|
overflow: "hidden",
|
|
@@ -37,7 +37,7 @@ const { color: A, cornerRadius: e, spacing: X } = S, k = {
|
|
|
37
37
|
background: "linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent)",
|
|
38
38
|
transform: "translateX(-100%)"
|
|
39
39
|
}
|
|
40
|
-
}),
|
|
40
|
+
}), M = t({
|
|
41
41
|
animation: "skeleton-pulse 1.5s ease-in-out infinite",
|
|
42
42
|
"@keyframes skeleton-pulse": {
|
|
43
43
|
"0%": {
|
|
@@ -50,7 +50,7 @@ const { color: A, cornerRadius: e, spacing: X } = S, k = {
|
|
|
50
50
|
opacity: 1
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), N = t({
|
|
54
54
|
"&::before": {
|
|
55
55
|
animation: "skeleton-wave 1.6s linear infinite"
|
|
56
56
|
},
|
|
@@ -68,7 +68,7 @@ const { color: A, cornerRadius: e, spacing: X } = S, k = {
|
|
|
68
68
|
}), b = (r, n) => {
|
|
69
69
|
if (n !== void 0)
|
|
70
70
|
return t({
|
|
71
|
-
borderRadius:
|
|
71
|
+
borderRadius: z[n]
|
|
72
72
|
});
|
|
73
73
|
switch (r) {
|
|
74
74
|
case "circular":
|
|
@@ -87,13 +87,13 @@ const { color: A, cornerRadius: e, spacing: X } = S, k = {
|
|
|
87
87
|
}, y = (r) => {
|
|
88
88
|
switch (r) {
|
|
89
89
|
case "pulse":
|
|
90
|
-
return z;
|
|
91
|
-
case "wave":
|
|
92
90
|
return M;
|
|
91
|
+
case "wave":
|
|
92
|
+
return N;
|
|
93
93
|
default:
|
|
94
94
|
return "";
|
|
95
95
|
}
|
|
96
|
-
},
|
|
96
|
+
}, T = ({
|
|
97
97
|
width: r,
|
|
98
98
|
height: n,
|
|
99
99
|
variant: s = "rectangular",
|
|
@@ -111,7 +111,7 @@ const { color: A, cornerRadius: e, spacing: X } = S, k = {
|
|
|
111
111
|
if (!d)
|
|
112
112
|
return null;
|
|
113
113
|
const h = r || k[i].width, g = n || k[i].height;
|
|
114
|
-
return s === "text" && a > 1 ? /* @__PURE__ */ o(l, { gap: X.sm, className: u, children: Array.from({ length: a }, (
|
|
114
|
+
return s === "text" && a > 1 ? /* @__PURE__ */ o(l, { gap: X.sm, className: u, children: Array.from({ length: a }, (_, p) => /* @__PURE__ */ o(
|
|
115
115
|
l,
|
|
116
116
|
{
|
|
117
117
|
className: x(
|
|
@@ -138,7 +138,7 @@ const { color: A, cornerRadius: e, spacing: X } = S, k = {
|
|
|
138
138
|
}
|
|
139
139
|
);
|
|
140
140
|
};
|
|
141
|
-
|
|
141
|
+
T.displayName = "Skeleton";
|
|
142
142
|
export {
|
|
143
|
-
|
|
143
|
+
T as Skeleton
|
|
144
144
|
};
|