@kommo-crm/crm-react-ui-kit 1.11.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/ContentBlock.css +1 -1
- package/dist/components/ContentBlock/ContentBlock.js +5 -5
- package/dist/components/ContentBlock/ContentBlock.themes.d.ts +9 -0
- package/dist/components/ContentBlock/ContentBlock.themes.d.ts.map +1 -1
- package/dist/components/ContentBlock/ContentBlock.themes.js +12 -3
- package/dist/components/ContentBlock/index.d.ts +1 -1
- package/dist/components/ContentBlock/index.d.ts.map +1 -1
- package/dist/components/ContentBlock/index.js +4 -2
- package/dist/components/Select/Select.types.d.ts +27 -3
- package/dist/components/Select/Select.types.d.ts.map +1 -1
- package/dist/components/Select/Select.types.js +9 -1
- package/dist/components/Select/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Select/components/Button/Button.js +21 -17
- package/dist/components/Select/components/Item/Item.d.ts.map +1 -1
- package/dist/components/Select/components/Item/Item.js +41 -31
- package/dist/components/Select/components/Option/Option.js +11 -11
- package/dist/components/Select/components/Option/Option.props.d.ts +4 -0
- package/dist/components/Select/components/Option/Option.props.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._block_13dmy_1{box-sizing:var(--crm-ui-kit-content-block-box-sizing);padding:var(--crm-ui-kit-content-block-padding);border-radius:var(--crm-ui-kit-content-block-border-radius);box-shadow:var(--crm-ui-kit-content-block-box-shadow);background:var(--crm-ui-kit-content-block-background);border:var(--crm-ui-kit-content-block-border)}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as l } from "react";
|
|
3
3
|
import { c as n } from "../../index-L8X2o7IH.mjs";
|
|
4
|
-
import { useThemeClassName as
|
|
5
|
-
import '../../assets/ContentBlock.css';const
|
|
6
|
-
block:
|
|
4
|
+
import { useThemeClassName as i } from "../../hooks/useThemeClassName/useThemeClassName.js";
|
|
5
|
+
import '../../assets/ContentBlock.css';const f = "_block_13dmy_1", k = {
|
|
6
|
+
block: f
|
|
7
7
|
}, p = l((o, e) => {
|
|
8
|
-
const { className: s = "", theme: t, children:
|
|
9
|
-
return /* @__PURE__ */ a("div", { ref: e, className: n(k.block, r, s), ...
|
|
8
|
+
const { className: s = "", theme: t, children: m, ...c } = o, r = i(t);
|
|
9
|
+
return /* @__PURE__ */ a("div", { ref: e, className: n(k.block, r, s), ...c, children: m });
|
|
10
10
|
});
|
|
11
11
|
p.displayName = "ContentBlock";
|
|
12
12
|
export {
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
type ContentBlockKey = '--crm-ui-kit-content-block-box-shadow' | '--crm-ui-kit-content-block-background' | '--crm-ui-kit-content-block-box-sizing' | '--crm-ui-kit-content-block-padding' | '--crm-ui-kit-content-block-border-radius';
|
|
2
|
+
type ContentBlockOptionalKey = '--crm-ui-kit-content-block-border';
|
|
2
3
|
export type ContentBlockThemeType = {
|
|
3
4
|
[K in ContentBlockKey]: string;
|
|
5
|
+
} & {
|
|
6
|
+
[K in ContentBlockOptionalKey]?: string;
|
|
4
7
|
};
|
|
8
|
+
export declare const ContentBlockPrimaryTheme: ContentBlockThemeType;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated This theme will be removed in a future major version.
|
|
11
|
+
* Use {@link ContentBlockPrimaryTheme} instead.
|
|
12
|
+
*/
|
|
5
13
|
export declare const ContentBlockTheme: ContentBlockThemeType;
|
|
14
|
+
export declare const ContentBlockSecondaryTheme: ContentBlockThemeType;
|
|
6
15
|
export {};
|
|
7
16
|
//# sourceMappingURL=ContentBlock.themes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentBlock.themes.d.ts","sourceRoot":"","sources":["../../../src/components/ContentBlock/ContentBlock.themes.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAChB,uCAAuC,GACvC,uCAAuC,GACvC,uCAAuC,GACvC,oCAAoC,GACpC,0CAA0C,CAAC;AAE/C,MAAM,MAAM,qBAAqB,GAAG;KACjC,CAAC,IAAI,eAAe,GAAG,MAAM;CAC/B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"ContentBlock.themes.d.ts","sourceRoot":"","sources":["../../../src/components/ContentBlock/ContentBlock.themes.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAChB,uCAAuC,GACvC,uCAAuC,GACvC,uCAAuC,GACvC,oCAAoC,GACpC,0CAA0C,CAAC;AAE/C,KAAK,uBAAuB,GAAG,mCAAmC,CAAC;AAEnE,MAAM,MAAM,qBAAqB,GAAG;KACjC,CAAC,IAAI,eAAe,GAAG,MAAM;CAC/B,GAAG;KACD,CAAC,IAAI,uBAAuB,CAAC,CAAC,EAAE,MAAM;CACxC,CAAC;AAUF,eAAO,MAAM,wBAAwB,EAAE,qBAKtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,uBAA2B,CAAC;AAE1D,eAAO,MAAM,0BAA0B,EAAE,qBAMxC,CAAC"}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
const t = {
|
|
2
2
|
"--crm-ui-kit-content-block-box-sizing": "border-box",
|
|
3
|
-
"--crm-ui-kit-content-block-padding": "18px 18px 29px",
|
|
4
3
|
"--crm-ui-kit-content-block-border-radius": "var(--crm-ui-kit-border-radius-default)",
|
|
5
|
-
"--crm-ui-kit-content-block-box-shadow": "var(--crm-ui-kit-palette-content-block-box-shadow)",
|
|
6
4
|
"--crm-ui-kit-content-block-background": "var(--crm-ui-kit-palette-background-primary)"
|
|
5
|
+
}, o = {
|
|
6
|
+
...t,
|
|
7
|
+
"--crm-ui-kit-content-block-padding": "18px 18px 29px",
|
|
8
|
+
"--crm-ui-kit-content-block-box-shadow": "var(--crm-ui-kit-palette-content-block-box-shadow)"
|
|
9
|
+
}, c = o, e = {
|
|
10
|
+
...t,
|
|
11
|
+
"--crm-ui-kit-content-block-padding": "16px",
|
|
12
|
+
"--crm-ui-kit-content-block-border": "1px solid var(--crm-ui-kit-palette-border-primary)",
|
|
13
|
+
"--crm-ui-kit-content-block-box-shadow": "none"
|
|
7
14
|
};
|
|
8
15
|
export {
|
|
9
|
-
|
|
16
|
+
o as ContentBlockPrimaryTheme,
|
|
17
|
+
e as ContentBlockSecondaryTheme,
|
|
18
|
+
c as ContentBlockTheme
|
|
10
19
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { ContentBlock } from './ContentBlock';
|
|
2
|
-
export { type ContentBlockThemeType, ContentBlockTheme, } from './ContentBlock.themes';
|
|
2
|
+
export { type ContentBlockThemeType, ContentBlockTheme, ContentBlockPrimaryTheme, ContentBlockSecondaryTheme, } from './ContentBlock.themes';
|
|
3
3
|
export { type ContentBlockProps } from './ContentBlock.props';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ContentBlock/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,KAAK,qBAAqB,EAC1B,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ContentBlock/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ContentBlock as t } from "./ContentBlock.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ContentBlockPrimaryTheme as r, ContentBlockSecondaryTheme as m, ContentBlockTheme as c } from "./ContentBlock.themes.js";
|
|
3
3
|
export {
|
|
4
4
|
t as ContentBlock,
|
|
5
|
-
r as
|
|
5
|
+
r as ContentBlockPrimaryTheme,
|
|
6
|
+
m as ContentBlockSecondaryTheme,
|
|
7
|
+
c as ContentBlockTheme
|
|
6
8
|
};
|
|
@@ -1,11 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
interface SelectItemBase {
|
|
2
3
|
/**
|
|
3
4
|
* Value of the element.
|
|
4
5
|
*/
|
|
5
6
|
value: number | string;
|
|
7
|
+
}
|
|
8
|
+
export type SelectItem = (SelectItemBase & {
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
10
|
+
* Visual label shown in the list and in the trigger when the item is selected.
|
|
8
11
|
*/
|
|
9
12
|
option: string;
|
|
10
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Native tooltip text shown on hover.
|
|
15
|
+
* Defaults to `option` when omitted.
|
|
16
|
+
*/
|
|
17
|
+
title?: string;
|
|
18
|
+
}) | (SelectItemBase & {
|
|
19
|
+
/**
|
|
20
|
+
* Visual label shown in the list and in the trigger when the item is selected.
|
|
21
|
+
*/
|
|
22
|
+
option: ReactElement;
|
|
23
|
+
/**
|
|
24
|
+
* Native tooltip text shown on hover.
|
|
25
|
+
* Required because `option` is not a string and cannot be used as a fallback.
|
|
26
|
+
*/
|
|
27
|
+
title: string;
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* Resolves the tooltip text for a `SelectItem`. Uses the explicit `title` when
|
|
31
|
+
* provided, otherwise falls back to `option` if it is a string.
|
|
32
|
+
*/
|
|
33
|
+
export declare const getSelectItemTitle: (item: SelectItem) => string | undefined;
|
|
34
|
+
export {};
|
|
11
35
|
//# sourceMappingURL=Select.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.types.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Select.types.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,UAAU,cAAc;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,UAAU,GAClB,CAAC,cAAc,GAAG;IAChB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,GACF,CAAC,cAAc,GAAG;IAChB;;OAEG;IACH,MAAM,EAAE,YAAY,CAAC;IACrB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEP;;;GAGG;AACH,eAAO,MAAM,kBAAkB,SAAU,UAAU,KAAG,MAAM,GAAG,SAU9D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAgB,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAgB,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAO9E,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAM5C,eAAO,MAAM,MAAM,6FAyCjB,CAAC"}
|
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { SelectButton as
|
|
4
|
-
import { mergeRefs as
|
|
5
|
-
import { useSelectContext as
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as g, useRef as S, useCallback as B, useEffect as R } from "react";
|
|
3
|
+
import { SelectButton as v } from "../../../SelectButton/SelectButton.js";
|
|
4
|
+
import { mergeRefs as x } from "../../../../lib/utils.js";
|
|
5
|
+
import { useSelectContext as I } from "../../Select.context.js";
|
|
6
|
+
import { getSelectItemTitle as T } from "../../Select.types.js";
|
|
7
|
+
const s = "Select.Button", b = g((l, c) => {
|
|
8
|
+
const { theme: f, ...i } = l, { isDisabled: m, onOpen: t, isOpened: e, isInvalid: u, value: o } = I(s), r = S(null), p = B(() => {
|
|
8
9
|
t(!e);
|
|
9
10
|
}, [t]);
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
e && ((
|
|
13
|
-
}, [e])
|
|
14
|
-
|
|
11
|
+
R(() => () => {
|
|
12
|
+
var n;
|
|
13
|
+
e && ((n = r.current) == null || n.focus());
|
|
14
|
+
}, [e]);
|
|
15
|
+
const a = o ? T(o) : void 0;
|
|
16
|
+
return /* @__PURE__ */ d(
|
|
17
|
+
v,
|
|
15
18
|
{
|
|
16
|
-
ref:
|
|
17
|
-
onToggle:
|
|
18
|
-
|
|
19
|
+
ref: x(r, c),
|
|
20
|
+
onToggle: p,
|
|
21
|
+
title: a,
|
|
22
|
+
theme: f,
|
|
19
23
|
isDisabled: m,
|
|
20
24
|
isInvalid: u,
|
|
21
|
-
...
|
|
25
|
+
...i
|
|
22
26
|
}
|
|
23
27
|
);
|
|
24
28
|
});
|
|
25
|
-
b.displayName =
|
|
29
|
+
b.displayName = s;
|
|
26
30
|
export {
|
|
27
31
|
b as Button
|
|
28
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/components/Item/Item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/components/Item/Item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8C,MAAM,OAAO,CAAC;AAYnE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAUzC,eAAO,MAAM,IAAI,iFA8Df,CAAC"}
|
|
@@ -1,46 +1,56 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useThemeClassName as
|
|
5
|
-
import { noop as
|
|
6
|
-
import { useSelectContext as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as w, useCallback as y } from "react";
|
|
3
|
+
import { c as g } from "../../../../index-L8X2o7IH.mjs";
|
|
4
|
+
import { useThemeClassName as k } from "../../../../hooks/useThemeClassName/useThemeClassName.js";
|
|
5
|
+
import { noop as A } from "../../../../utils/noop/noop.js";
|
|
6
|
+
import { useSelectContext as D } from "../../Select.context.js";
|
|
7
|
+
import { getSelectItemTitle as H } from "../../Select.types.js";
|
|
8
|
+
import P from "../Option/Option.js";
|
|
9
|
+
import '../../../../assets/Item.css';const T = "_item_mywsb_1", j = "_selected_mywsb_24", E = "_hovered_mywsb_30", s = {
|
|
10
|
+
item: T,
|
|
11
|
+
selected: j,
|
|
12
|
+
hovered: E
|
|
13
|
+
}, c = "Select.Item", L = w((i, l) => {
|
|
14
|
+
const {
|
|
15
|
+
item: e,
|
|
16
|
+
children: t,
|
|
17
|
+
index: m,
|
|
18
|
+
className: a,
|
|
19
|
+
theme: d,
|
|
20
|
+
title: p,
|
|
21
|
+
...h
|
|
22
|
+
} = i, v = k(d), {
|
|
14
23
|
value: o,
|
|
15
|
-
onChange:
|
|
16
|
-
onHoveredIndexChange:
|
|
17
|
-
hoveredIndex:
|
|
18
|
-
} =
|
|
19
|
-
(
|
|
20
|
-
|
|
24
|
+
onChange: r = A,
|
|
25
|
+
onHoveredIndexChange: f,
|
|
26
|
+
hoveredIndex: _
|
|
27
|
+
} = D(c), { option: u, value: C } = e, x = y(
|
|
28
|
+
(b) => {
|
|
29
|
+
b.preventDefault(), f(m), r(e);
|
|
21
30
|
},
|
|
22
|
-
[
|
|
23
|
-
),
|
|
24
|
-
return /* @__PURE__ */
|
|
31
|
+
[r, e]
|
|
32
|
+
), I = (o == null ? void 0 : o.value) === C, N = _ === m, S = p ?? (t ? void 0 : H(e));
|
|
33
|
+
return /* @__PURE__ */ n(
|
|
25
34
|
"li",
|
|
26
35
|
{
|
|
27
36
|
...h,
|
|
28
37
|
ref: l,
|
|
29
|
-
|
|
30
|
-
|
|
38
|
+
title: S,
|
|
39
|
+
className: g(
|
|
40
|
+
s.item,
|
|
31
41
|
{
|
|
32
|
-
[
|
|
33
|
-
[
|
|
42
|
+
[s.selected]: I,
|
|
43
|
+
[s.hovered]: N
|
|
34
44
|
},
|
|
35
45
|
a,
|
|
36
|
-
|
|
46
|
+
v
|
|
37
47
|
),
|
|
38
|
-
onClick:
|
|
39
|
-
children:
|
|
48
|
+
onClick: x,
|
|
49
|
+
children: t || /* @__PURE__ */ n(P, { children: u })
|
|
40
50
|
}
|
|
41
51
|
);
|
|
42
52
|
});
|
|
43
|
-
|
|
53
|
+
L.displayName = c;
|
|
44
54
|
export {
|
|
45
|
-
|
|
55
|
+
L as Item
|
|
46
56
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c
|
|
4
|
-
import { Text as
|
|
2
|
+
import { forwardRef as a } from "react";
|
|
3
|
+
import { c } from "../../../../index-L8X2o7IH.mjs";
|
|
4
|
+
import { Text as l } from "../../../Text/Text.js";
|
|
5
5
|
import "../../../Text/Text.themes.js";
|
|
6
|
-
import { OptionTextTheme as
|
|
7
|
-
import '../../../../assets/Option.css';const
|
|
8
|
-
text:
|
|
9
|
-
},
|
|
10
|
-
const { children: r, className: s } = e;
|
|
11
|
-
return /* @__PURE__ */ t("span", { className:
|
|
6
|
+
import { OptionTextTheme as p } from "./Option.theme.js";
|
|
7
|
+
import '../../../../assets/Option.css';const n = "_text_gk4uj_1", x = {
|
|
8
|
+
text: n
|
|
9
|
+
}, f = "Select.Value", d = a((e, o) => {
|
|
10
|
+
const { children: r, className: s, title: i, ...m } = e;
|
|
11
|
+
return /* @__PURE__ */ t("span", { ...m, className: c(x.text, s), ref: o, title: i, children: /* @__PURE__ */ t(l, { theme: p, size: "l", isEllipsis: !0, children: r }) });
|
|
12
12
|
});
|
|
13
|
-
|
|
13
|
+
d.displayName = f;
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
d as default
|
|
16
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.props.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/components/Option/Option.props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,eAAe,CAAC;IAClE;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Option.props.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/components/Option/Option.props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,eAAe,CAAC;IAClE;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
package/package.json
CHANGED