@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.
@@ -1 +1 @@
1
- ._block_1efq7_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)}
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 f } from "../../hooks/useThemeClassName/useThemeClassName.js";
5
- import '../../assets/ContentBlock.css';const i = "_block_1efq7_1", k = {
6
- block: i
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: c, ...m } = o, r = f(t);
9
- return /* @__PURE__ */ a("div", { ref: e, className: n(k.block, r, s), ...m, children: c });
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,qBAS/B,CAAC"}
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
- t as ContentBlockTheme
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,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
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 { ContentBlockTheme as r } from "./ContentBlock.themes.js";
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 ContentBlockTheme
5
+ r as ContentBlockPrimaryTheme,
6
+ m as ContentBlockSecondaryTheme,
7
+ c as ContentBlockTheme
6
8
  };
@@ -1,11 +1,35 @@
1
- export type SelectItem = {
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
- * Description of the element.
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,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
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,9 @@
1
-
1
+ const e = (t) => {
2
+ if (t.title)
3
+ return t.title;
4
+ if (typeof t.option == "string")
5
+ return t.option;
6
+ };
7
+ export {
8
+ e as getSelectItemTitle
9
+ };
@@ -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;AAM9E,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAM5C,eAAO,MAAM,MAAM,6FAiCjB,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 p } from "react/jsx-runtime";
2
- import { forwardRef as a, useRef as d, useCallback as g, useEffect as B } from "react";
3
- import { SelectButton as R } from "../../../SelectButton/SelectButton.js";
4
- import { mergeRefs as S } from "../../../../lib/utils.js";
5
- import { useSelectContext as x } from "../../Select.context.js";
6
- const n = "Select.Button", b = a((s, f) => {
7
- const { theme: c, ...l } = s, { isDisabled: m, onOpen: t, isOpened: e, isInvalid: u } = x(n), o = d(null), i = g(() => {
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
- return B(() => () => {
11
- var r;
12
- e && ((r = o.current) == null || r.focus());
13
- }, [e]), /* @__PURE__ */ p(
14
- R,
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: S(o, f),
17
- onToggle: i,
18
- theme: c,
19
+ ref: x(r, c),
20
+ onToggle: p,
21
+ title: a,
22
+ theme: f,
19
23
  isDisabled: m,
20
24
  isInvalid: u,
21
- ...l
25
+ ...i
22
26
  }
23
27
  );
24
28
  });
25
- b.displayName = n;
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;AAWnE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAUzC,eAAO,MAAM,IAAI,iFA8Cf,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 r } from "react/jsx-runtime";
2
- import { forwardRef as b, useCallback as w } from "react";
3
- import { c as y } from "../../../../index-L8X2o7IH.mjs";
4
- import { useThemeClassName as S } from "../../../../hooks/useThemeClassName/useThemeClassName.js";
5
- import { noop as k } from "../../../../utils/noop/noop.js";
6
- import { useSelectContext as g } from "../../Select.context.js";
7
- import A from "../Option/Option.js";
8
- import '../../../../assets/Item.css';const D = "_item_mywsb_1", H = "_selected_mywsb_24", j = "_hovered_mywsb_30", t = {
9
- item: D,
10
- selected: H,
11
- hovered: j
12
- }, c = "Select.Item", E = b((i, l) => {
13
- const { item: e, children: s, index: m, className: a, theme: d, ...h } = i, p = S(d), {
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: n = k,
16
- onHoveredIndexChange: v,
17
- hoveredIndex: f
18
- } = g(c), { option: _, value: u } = e, C = w(
19
- (I) => {
20
- I.preventDefault(), v(m), n(e);
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
- [n, e]
23
- ), x = (o == null ? void 0 : o.value) === u, N = f === m;
24
- return /* @__PURE__ */ r(
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
- className: y(
30
- t.item,
38
+ title: S,
39
+ className: g(
40
+ s.item,
31
41
  {
32
- [t.selected]: x,
33
- [t.hovered]: N
42
+ [s.selected]: I,
43
+ [s.hovered]: N
34
44
  },
35
45
  a,
36
- p
46
+ v
37
47
  ),
38
- onClick: C,
39
- children: s || /* @__PURE__ */ r(A, { children: _ })
48
+ onClick: x,
49
+ children: t || /* @__PURE__ */ n(P, { children: u })
40
50
  }
41
51
  );
42
52
  });
43
- E.displayName = c;
53
+ L.displayName = c;
44
54
  export {
45
- E as Item
55
+ L as Item
46
56
  };
@@ -1,16 +1,16 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as m } from "react";
3
- import { c as i } from "../../../../index-L8X2o7IH.mjs";
4
- import { Text as a } from "../../../Text/Text.js";
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 c } from "./Option.theme.js";
7
- import '../../../../assets/Option.css';const p = "_text_gk4uj_1", l = {
8
- text: p
9
- }, n = "Select.Value", x = m((e, o) => {
10
- const { children: r, className: s } = e;
11
- return /* @__PURE__ */ t("span", { className: i(l.text, s), ref: o, children: /* @__PURE__ */ t(a, { theme: c, size: "l", isEllipsis: !0, children: r }) });
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
- x.displayName = n;
13
+ d.displayName = f;
14
14
  export {
15
- x as default
15
+ d as default
16
16
  };
@@ -4,5 +4,9 @@ export interface OptionProps extends HTMLAttributes<HTMLSpanElement> {
4
4
  * Text of the option.
5
5
  */
6
6
  children: ReactNode;
7
+ /**
8
+ * Native tooltip text shown on hover.
9
+ */
10
+ title?: string;
7
11
  }
8
12
  //# sourceMappingURL=Option.props.d.ts.map
@@ -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;CACrB"}
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kommo-crm/crm-react-ui-kit",
3
3
  "description": "Ready-to-use React components which implements Kommo design",
4
- "version": "1.11.0",
4
+ "version": "1.13.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "engines": {