skillgrid 0.0.91-dev-68351-trigger-fixes.1802697 → 0.0.93

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.
Files changed (44) hide show
  1. package/dist/assets/components/Notification/Notification.module-BVePCO8H.css +1 -0
  2. package/dist/assets/components/Trigger/Trigger.module-BWzHgDVC.css +1 -0
  3. package/dist/components/Avatar/AvatarGroup/AvatarGroupRoot.js +5 -5
  4. package/dist/components/FileUpload/FileUpload.js +1 -1
  5. package/dist/components/InputBase/Input.js +6 -6
  6. package/dist/components/Modal/Modal.type.d.ts +1 -1
  7. package/dist/components/Notification/Notification.d.ts +7 -0
  8. package/dist/components/Notification/Notification.i18n.json.d.ts +17 -0
  9. package/dist/components/Notification/Notification.i18n.json.js +9 -0
  10. package/dist/components/Notification/Notification.js +299 -0
  11. package/dist/components/Notification/Notification.module.css.js +72 -0
  12. package/dist/components/Notification/Notification.type.d.ts +146 -0
  13. package/dist/components/Notification/NotificationControls.d.ts +21 -0
  14. package/dist/components/Notification/NotificationControls.js +70 -0
  15. package/dist/components/Notification/index.d.ts +2 -0
  16. package/dist/components/Notification/lib/guidelinesReferenceContent.d.ts +34 -0
  17. package/dist/components/Notification/lib/index.d.ts +2 -0
  18. package/dist/components/Notification/lib/notificationStyleConfig.d.ts +16 -0
  19. package/dist/components/Notification/lib/notificationStyleConfig.js +41 -0
  20. package/dist/components/Notification/lib/referenceGuidelinesGeometry.d.ts +19 -0
  21. package/dist/components/Notification/lib/referenceGuidelinesGeometry.js +24 -0
  22. package/dist/components/Notification/lib/referenceGuidelinesGeometry.test.d.ts +1 -0
  23. package/dist/components/Popover/lib/use-popover.js +1 -1
  24. package/dist/components/Tabs/ScrollWrapper.js +1 -1
  25. package/dist/components/Tabs/Tabs.js +1 -1
  26. package/dist/components/Trigger/Trigger.d.ts +1 -1
  27. package/dist/components/Trigger/Trigger.js +91 -97
  28. package/dist/components/Trigger/Trigger.module.css.js +23 -23
  29. package/dist/components/Trigger/Trigger.type.d.ts +2 -13
  30. package/dist/components/Trigger/lib/utils.d.ts +2 -3
  31. package/dist/components/Trigger/lib/utils.js +5 -9
  32. package/dist/index.cjs.js +4 -4
  33. package/dist/index.css +1 -1
  34. package/dist/index.d.ts +1 -0
  35. package/dist/index.es.js +22 -20
  36. package/dist/locale/en_US.d.ts +4 -0
  37. package/dist/locale/en_US.js +6 -4
  38. package/dist/locale/extendLocale.js +12 -8
  39. package/dist/locale/index.d.ts +1 -1
  40. package/dist/locale/ru_RU.d.ts +4 -0
  41. package/dist/locale/ru_RU.js +4 -2
  42. package/dist/locale/type.d.ts +6 -0
  43. package/package.json +2 -2
  44. package/dist/assets/components/Trigger/Trigger.module-Dc9gMp3_.css +0 -1
@@ -0,0 +1,21 @@
1
+ export type NotificationControlsProps = {
2
+ showClose: boolean;
3
+ showCopy: boolean;
4
+ closeAriaLabel: string;
5
+ copyAriaLabel: string;
6
+ iconSize?: number;
7
+ /** Порядок: close→copy (reference column) или copy→close (header). */
8
+ order?: 'close-first' | 'copy-first';
9
+ column?: boolean;
10
+ aside?: boolean;
11
+ className?: string;
12
+ dataTestId: string;
13
+ onClose: () => void;
14
+ onCopy?: () => void;
15
+ };
16
+ /**
17
+ * Кнопки close/copy уведомления.
18
+ *
19
+ * @param props - {@link NotificationControlsProps}
20
+ */
21
+ export declare function NotificationControls({ showClose, showCopy, closeAriaLabel, copyAriaLabel, iconSize, order, column, aside, className, dataTestId, onClose, onCopy, }: NotificationControlsProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,70 @@
1
+ import { jsx as t, jsxs as c, Fragment as d } from "react/jsx-runtime";
2
+ import { clsx as C } from "clsx";
3
+ import { CrossOutlined as g, CopyOutlined as j } from "../Icon/categories/general.js";
4
+ import e from "./Notification.module.css.js";
5
+ function $({
6
+ showClose: r,
7
+ showCopy: o,
8
+ closeAriaLabel: u,
9
+ copyAriaLabel: f,
10
+ iconSize: l = 16,
11
+ order: m = "copy-first",
12
+ column: p = !1,
13
+ aside: y = !1,
14
+ className: b,
15
+ dataTestId: n,
16
+ onClose: x,
17
+ onCopy: i
18
+ }) {
19
+ if (!r && !o)
20
+ return null;
21
+ const s = r ? /* @__PURE__ */ t(
22
+ g,
23
+ {
24
+ as: "button",
25
+ type: "button",
26
+ iconSize: l,
27
+ mode: "tertiary",
28
+ style: "neutral",
29
+ padding: 4,
30
+ "aria-label": u,
31
+ "data-testid": `${n}-close`,
32
+ onClick: x
33
+ }
34
+ ) : null, a = o ? /* @__PURE__ */ t(
35
+ j,
36
+ {
37
+ as: "button",
38
+ type: "button",
39
+ iconSize: l,
40
+ mode: "tertiary",
41
+ style: "neutral",
42
+ padding: 6,
43
+ "aria-label": f,
44
+ "data-testid": `${n}-copy`,
45
+ disabled: !i,
46
+ onClick: i
47
+ }
48
+ ) : null;
49
+ return /* @__PURE__ */ t(
50
+ "div",
51
+ {
52
+ className: C(
53
+ e.controls,
54
+ p && e.referenceControlsColumn,
55
+ y && e.referenceRootAside,
56
+ b
57
+ ),
58
+ children: m === "close-first" ? /* @__PURE__ */ c(d, { children: [
59
+ s,
60
+ a
61
+ ] }) : /* @__PURE__ */ c(d, { children: [
62
+ a,
63
+ s
64
+ ] })
65
+ }
66
+ );
67
+ }
68
+ export {
69
+ $ as NotificationControls
70
+ };
@@ -0,0 +1,2 @@
1
+ export { Notification } from './Notification';
2
+ export type { NotificationPlatform, NotificationPrimaryAction, NotificationProps, NotificationSecondaryAction, NotificationStyle, NotificationWidth, } from './Notification.type';
@@ -0,0 +1,34 @@
1
+ /** Тексты и слоты пяти Figma guidelines instances (node 145:852861). */
2
+ export declare const GUIDELINES_IMPORT_BODY = "\u041F\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u043E\u0442\u0447\u0435\u0442 \u043C\u043E\u0436\u043D\u043E \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \"\u0418\u0441\u0442\u043E\u0440\u0438\u044F \u0438\u043C\u043F\u043E\u0440\u0442\u043E\u0432\"";
3
+ export declare const GUIDELINES_ACTION_PRIMARY: {
4
+ children: "Главное";
5
+ };
6
+ export declare const GUIDELINES_ACTION_SECONDARY: {
7
+ children: "Дополнительное";
8
+ };
9
+ export declare const GUIDELINES_LINK: {
10
+ children: "Подробнее";
11
+ as: "button";
12
+ };
13
+ /** Целевые размеры SRC-09 / AC-05 (subpixel допускается при QA). */
14
+ export declare const GUIDELINES_REFERENCE_SIZES: readonly [{
15
+ readonly testId: "guideline-326-11573";
16
+ readonly width: 326;
17
+ readonly height: 115.73;
18
+ }, {
19
+ readonly testId: "guideline-287-94925";
20
+ readonly width: 287;
21
+ readonly height: 94.925;
22
+ }, {
23
+ readonly testId: "guideline-400-142";
24
+ readonly width: 400;
25
+ readonly height: 142;
26
+ }, {
27
+ readonly testId: "guideline-287-70315";
28
+ readonly width: 287;
29
+ readonly height: 70.315;
30
+ }, {
31
+ readonly testId: "guideline-326-8034";
32
+ readonly width: 326;
33
+ readonly height: 80.34;
34
+ }];
@@ -0,0 +1,2 @@
1
+ export { ASSERTIVE_NOTIFICATION_STYLES, NOTIFICATION_STYLE_CONFIG, } from './notificationStyleConfig';
2
+ export type { NotificationStyleTokens } from './notificationStyleConfig';
@@ -0,0 +1,16 @@
1
+ import { ElementType, ReactElement } from 'react';
2
+ import { IconProps } from '../../Icon/Icon.type';
3
+ import { NotificationStyle } from '../Notification.type';
4
+ type NotificationIconComponent = (<E extends ElementType = 'button'>(props: Omit<IconProps<E>, 'icon'>) => ReactElement | null) & {
5
+ displayName?: string;
6
+ };
7
+ export type NotificationStyleTokens = {
8
+ icon: NotificationIconComponent;
9
+ iconColor: string;
10
+ iconBackground: string;
11
+ background: string;
12
+ };
13
+ export declare const NOTIFICATION_STYLE_CONFIG: Record<NotificationStyle, NotificationStyleTokens>;
14
+ /** Стили с assertive live-region семантикой. */
15
+ export declare const ASSERTIVE_NOTIFICATION_STYLES: NotificationStyle[];
16
+ export {};
@@ -0,0 +1,41 @@
1
+ import { CrossCircleOutlined as r, ExclamationCircleOutlined as a, ExclamationTriangleOutlined as n, CheckCircleOutlined as o, InfoCircleOutlined as i } from "../../Icon/categories/general.js";
2
+ const c = {
3
+ neutral: {
4
+ icon: i,
5
+ iconColor: "var(--base-graphite-45)",
6
+ iconBackground: "var(--bg-secondary)",
7
+ background: "var(--bg-primary)"
8
+ },
9
+ positive: {
10
+ icon: o,
11
+ iconColor: "var(--base-green-55)",
12
+ iconBackground: "var(--bg-positive-secondary)",
13
+ background: "var(--bg-primary)"
14
+ },
15
+ warning: {
16
+ icon: n,
17
+ iconColor: "var(--base-orange-50)",
18
+ iconBackground: "var(--bg-warning-secondary)",
19
+ background: "var(--bg-primary)"
20
+ },
21
+ error: {
22
+ icon: a,
23
+ iconColor: "var(--base-red-55)",
24
+ iconBackground: "var(--bg-negative-secondary)",
25
+ background: "var(--bg-primary)"
26
+ },
27
+ negative: {
28
+ icon: r,
29
+ iconColor: "var(--base-red-55)",
30
+ iconBackground: "var(--bg-negative-secondary)",
31
+ background: "var(--bg-primary)"
32
+ }
33
+ }, g = [
34
+ "warning",
35
+ "error",
36
+ "negative"
37
+ ];
38
+ export {
39
+ g as ASSERTIVE_NOTIFICATION_STYLES,
40
+ c as NOTIFICATION_STYLE_CONFIG
41
+ };
@@ -0,0 +1,19 @@
1
+ /** Ключи пяти Figma guidelines instances (SRC-09 / AC-05). */
2
+ export type ReferenceGuidelinesGeometryKey = '326-11573' | '287-94925' | '400-142' | '287-70315' | '326-8034';
3
+ /** Целевые width/height px — синхронны с Notification.module.css geometry modifiers. */
4
+ export declare const REFERENCE_GUIDELINES_GEOMETRY_TARGETS: Record<ReferenceGuidelinesGeometryKey, {
5
+ width: number;
6
+ height: number;
7
+ }>;
8
+ export type ResolveReferenceGuidelinesGeometryInput = {
9
+ referenceComposition: boolean;
10
+ referenceGuidelinesScale?: 'desktop' | '326' | '287';
11
+ referenceControlsColumn?: boolean;
12
+ hasActions: boolean;
13
+ hasLink: boolean;
14
+ };
15
+ /**
16
+ * Определяет geometry modifier только для referenceComposition + referenceGuidelinesScale.
17
+ * Обычный Notification не затрагивается.
18
+ */
19
+ export declare function resolveReferenceGuidelinesGeometry(input: ResolveReferenceGuidelinesGeometryInput): ReferenceGuidelinesGeometryKey | undefined;
@@ -0,0 +1,24 @@
1
+ function f(i) {
2
+ const {
3
+ referenceComposition: o,
4
+ referenceGuidelinesScale: e,
5
+ referenceControlsColumn: t,
6
+ hasActions: r,
7
+ hasLink: n
8
+ } = i;
9
+ if (!(!o || !e)) {
10
+ if (e === "desktop")
11
+ return "400-142";
12
+ if (e === "326")
13
+ return t ? "326-8034" : r ? "326-11573" : void 0;
14
+ if (e === "287") {
15
+ if (n)
16
+ return "287-94925";
17
+ if (!r && !n)
18
+ return "287-70315";
19
+ }
20
+ }
21
+ }
22
+ export {
23
+ f as resolveReferenceGuidelinesGeometry
24
+ };
@@ -1,7 +1,7 @@
1
1
  import { offset as G, flip as H, shift as V, inline as q, size as J, hide as K, useFloating as Q, autoUpdate as Z, useTransitionStyles as M, useClick as ee, useHover as te, useFocus as oe, useDismiss as ne, useRole as se, useInteractions as re } from "@floating-ui/react";
2
2
  import { useState as i, useMemo as v, useCallback as ce, useEffect as ae, useLayoutEffect as ie } from "react";
3
- import { useCompatId as S } from "../../../hooks/useCompatId.js";
4
3
  import { DEFAULT_FLOATING as le, hasMiddleware as fe } from "./utils.js";
4
+ import { useCompatId as S } from "../../../hooks/useCompatId.js";
5
5
  const r = 8, ue = (c) => {
6
6
  switch (c.split("-")[0]) {
7
7
  case "top":
@@ -1,8 +1,8 @@
1
1
  import { jsxs as N, jsx as r } from "react/jsx-runtime";
2
2
  import { useRef as W, useState as g, useEffect as w } from "react";
3
- import { useBackgroundColor as M } from "../../hooks/useBackgroundColor.js";
4
3
  import { clsx as a } from "clsx";
5
4
  import e from "./ScrollWrapper.module.css.js";
5
+ import { useBackgroundColor as M } from "../../hooks/useBackgroundColor.js";
6
6
  const B = "white", G = ({
7
7
  children: b,
8
8
  withControls: i = !0,
@@ -1,10 +1,10 @@
1
1
  import { jsx as l, jsxs as w } from "react/jsx-runtime";
2
2
  import F, { useState as U, createContext as V, useContext as M } from "react";
3
3
  import { ScrollWrapper as R } from "./ScrollWrapper.js";
4
- import { useIsMobile as j } from "../../hooks/useIsMobile.js";
5
4
  import { clsx as p } from "clsx";
6
5
  import f from "../../styles/typography.module.css.js";
7
6
  import a from "./Tabs.module.css.js";
7
+ import { useIsMobile as j } from "../../hooks/useIsMobile.js";
8
8
  import { Badge as k } from "../Badge/Badge.js";
9
9
  const G = "md", W = !1, Y = !1, Z = 8, z = "top-right-inside", P = V(null), h = () => {
10
10
  const t = M(P);
@@ -2,4 +2,4 @@ import { TriggerCommonProps } from './Trigger.type';
2
2
  /**
3
3
  Component Trigger
4
4
  */
5
- export declare const Trigger: ({ "data-testid": testId, content, size, description, label, stretched, truncateContent: contentTruncation, selectionStyle, clearable, showClear, showChevron, error, prefixIcon, postfixTitle, disabled, open, onClear, classNames, styles, }: TriggerCommonProps) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const Trigger: ({ content, size, description, label, stretched, selectionStyle, clearable, error, prefixIcon, postfixTitle, disabled, open, onClear, classNames, styles, }: TriggerCommonProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,140 +1,134 @@
1
- import { jsxs as f, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as y, jsx as a } from "react/jsx-runtime";
2
2
  import { clsx as n } from "clsx";
3
- import { LabelState as H } from "./Trigger.type.js";
4
- import t from "./Trigger.module.css.js";
5
- import { getLabelState as V, getLabelTypographySize as Y, truncateContent as Z, getContentTypographySize as E, getIconSize as X } from "./lib/utils.js";
6
- import { Typography as y } from "../Typography/Typography.js";
7
- import { XIcon as _ } from "../InputBase/assets/XIcon.js";
8
- import { ChevronIcon as tt } from "./assets/ChevronIcon.js";
9
- import { Helper as rt } from "../Helper/Helper.js";
10
- const pt = ({
11
- "data-testid": j = "trigger",
12
- content: p,
3
+ import { LabelState as W } from "./Trigger.type.js";
4
+ import r from "./Trigger.module.css.js";
5
+ import { getLabelState as K, getLabelTypographySize as M, truncateContent as Q, getContentTypographySize as H, getIconSize as E } from "./lib/utils.js";
6
+ import { Typography as v } from "../Typography/Typography.js";
7
+ import { XIcon as R } from "../InputBase/assets/XIcon.js";
8
+ import { ChevronIcon as U } from "./assets/ChevronIcon.js";
9
+ import { Helper as V } from "../Helper/Helper.js";
10
+ const cr = ({
11
+ content: d,
13
12
  size: i = "XL",
14
- description: I,
15
- label: v,
16
- stretched: h = !1,
17
- truncateContent: z = !0,
18
- selectionStyle: x = "selected",
19
- clearable: A = !1,
20
- showClear: D,
21
- showChevron: F,
22
- error: d,
23
- prefixIcon: u,
24
- postfixTitle: b,
13
+ description: u,
14
+ label: N,
15
+ stretched: C = !1,
16
+ selectionStyle: s = "selected",
17
+ clearable: m = !1,
18
+ error: f,
19
+ prefixIcon: S,
20
+ postfixTitle: L,
25
21
  disabled: o = !1,
26
- open: N,
27
- onClear: m,
28
- classNames: r = {},
22
+ open: p,
23
+ onClear: I,
24
+ classNames: t = {},
29
25
  styles: e = {}
30
26
  }) => {
31
- const c = !!p, S = !!v, g = !!d, L = x === "applied", w = D ?? (c && (L || A)), W = F ?? !w, k = !!I && (!g || o) || g && !o, G = (g && !o ? d : I) || "", l = g && !o, T = V(i, c), s = S && T === H.FLOATING, O = T === H.HIDDEN, P = n(
32
- t["trigger-wrapper"],
33
- { [t["trigger-stretched"]]: h },
34
- r.wrapper
35
- ), $ = n(
36
- t["trigger-container"],
37
- t[`trigger-container-size-${i}`],
27
+ const g = !!d, b = !!N, c = !!f, w = s === "applied", O = !!u && (!c || o) || c && !o, X = (c && !o ? f : u) || "", h = c && !o, T = K(i, g), l = b && T === W.FLOATING, j = T === W.HIDDEN, z = n(
28
+ r["trigger-wrapper"],
29
+ { [r["trigger-stretched"]]: C },
30
+ t.wrapper
31
+ ), A = n(
32
+ r["trigger-container"],
33
+ r[`trigger-container-size-${i}`],
38
34
  {
39
- [t["trigger-stretched"]]: h,
40
- [t["trigger-container-applied"]]: L && c,
41
- [t["trigger-container-error"]]: g && !o,
42
- [t["trigger-container-open"]]: N,
43
- [t["trigger-container-floating"]]: s
35
+ [r["trigger-stretched"]]: C,
36
+ [r["trigger-container-applied"]]: w && g,
37
+ [r["trigger-container-error"]]: c && !o,
38
+ [r["trigger-container-open"]]: p,
39
+ [r["trigger-container-floating"]]: l
44
40
  },
45
- r.triggerContainer
46
- ), q = n(
47
- t["trigger-content-container"],
41
+ t.triggerContainer
42
+ ), D = n(
43
+ r["trigger-content-container"],
48
44
  {
49
- [t["trigger-content-container-floating"]]: s
45
+ [r["trigger-content-container-floating"]]: l
50
46
  },
51
- r.triggerContent
52
- ), B = n(
53
- t["trigger-label"],
47
+ t.triggerContent
48
+ ), F = n(
49
+ r["trigger-label"],
54
50
  {
55
- [t["trigger-label-floating"]]: s,
56
- [t["trigger-label-hidden"]]: O
51
+ [r["trigger-label-floating"]]: l,
52
+ [r["trigger-label-hidden"]]: j
57
53
  },
58
- r.label
59
- ), J = n(t["trigger-content"], r.content), K = n(t["trigger-postfix"], r.postfixTitle), M = n(t["trigger-chevron-icon"], r.chevronIcon), Q = n(
60
- t["trigger-prefix-icon"],
61
- r.prefixIconContainer
62
- ), R = n(t["trigger-clear-icon"], r.clearIcon), U = (C) => {
63
- C == null || C.stopPropagation(), m == null || m();
64
- };
65
- return /* @__PURE__ */ f("div", { className: P, style: e.wrapper, children: [
66
- /* @__PURE__ */ f(
54
+ t.label
55
+ ), k = n(r["trigger-content"], t.content), G = n(r["trigger-postfix"], t.postfixTitle), P = n(r["trigger-chevron-icon"], t.chevronIcon), $ = n(
56
+ r["trigger-prefix-icon"],
57
+ t.prefixIconContainer
58
+ ), q = n(r["trigger-clear-icon"], t.clearIcon), B = (x) => {
59
+ x == null || x.stopPropagation(), I == null || I();
60
+ }, J = g && p && (s === "selected" && m || s === "applied") || g && !p && (w || s === "selected" && m);
61
+ return /* @__PURE__ */ y("div", { className: z, style: e.wrapper, children: [
62
+ /* @__PURE__ */ y(
67
63
  "button",
68
64
  {
69
- "data-testid": j,
70
- "aria-invalid": g,
65
+ "data-testid": "trigger",
66
+ "aria-invalid": c,
71
67
  "aria-haspopup": "listbox",
72
- "aria-expanded": N,
68
+ "aria-expanded": p,
73
69
  role: "combobox",
74
- className: $,
70
+ className: A,
75
71
  style: e.triggerContainer,
76
72
  disabled: o,
77
73
  type: "button",
78
74
  children: [
79
- u && i !== "XL" && /* @__PURE__ */ a("div", { className: Q, style: e.prefixIconContainer, children: u }),
80
- /* @__PURE__ */ f("div", { className: q, style: e.triggerContent, children: [
81
- S && /* @__PURE__ */ a(
82
- y.Label,
75
+ S && i !== "XL" && /* @__PURE__ */ a("div", { className: $, style: e.prefixIconContainer, children: S }),
76
+ /* @__PURE__ */ y("div", { className: D, style: e.triggerContent, children: [
77
+ b && /* @__PURE__ */ a(
78
+ v.Label,
83
79
  {
84
80
  "data-testid": "trigger-label",
85
- className: B,
81
+ className: F,
86
82
  style: e.label,
87
- size: Y(i, s),
83
+ size: M(i, l),
88
84
  as: "span",
89
85
  disabled: o,
90
- typographyStyle: s ? "secondary" : "tertiary",
91
- children: v
86
+ typographyStyle: l ? "secondary" : "tertiary",
87
+ children: N
92
88
  }
93
89
  ),
94
- c && /* @__PURE__ */ a(
95
- y.Label,
90
+ g && /* @__PURE__ */ a(
91
+ v.Label,
96
92
  {
97
93
  "data-testid": "trigger-content-container",
98
- className: J,
94
+ className: k,
99
95
  style: e.content,
100
- size: E(i),
96
+ size: H(i),
101
97
  as: "span",
102
98
  disabled: o,
103
- children: h ? p : Z(p, z)
99
+ children: C ? d : Q(d)
104
100
  }
105
101
  ),
106
- c && !!b && /* @__PURE__ */ a(
107
- y.Label,
102
+ g && !!L && /* @__PURE__ */ a(
103
+ v.Label,
108
104
  {
109
105
  "data-testid": "trigger-postfix",
110
- className: K,
106
+ className: G,
111
107
  style: e.postfixTitle,
112
- size: E(i),
108
+ size: H(i),
113
109
  disabled: o,
114
110
  typographyStyle: "secondary",
115
- fontWeight: "medium",
116
- children: b
111
+ children: L
117
112
  }
118
113
  )
119
114
  ] }),
120
- w && /* @__PURE__ */ a(
121
- _,
115
+ J ? /* @__PURE__ */ a(
116
+ R,
122
117
  {
123
- className: R,
118
+ className: q,
124
119
  "data-testid": "trigger-clear",
125
- size: X(i),
120
+ size: E(i),
126
121
  tabIndex: -1,
127
- onClick: U,
122
+ onClick: B,
128
123
  style: { outline: "none", ...e.clearIcon },
129
- color: x === "selected" ? "var(--icon-tertiary)" : void 0
124
+ color: s === "selected" && m ? "var(--icon-tertiary)" : void 0
130
125
  }
131
- ),
132
- W && /* @__PURE__ */ a(
133
- tt,
126
+ ) : /* @__PURE__ */ a(
127
+ U,
134
128
  {
135
129
  "data-testid": "trigger-chevron",
136
- size: X(i),
137
- className: M,
130
+ size: E(i),
131
+ className: P,
138
132
  color: "var(--icon-tertiary)",
139
133
  style: e.chevronIcon
140
134
  }
@@ -142,19 +136,19 @@ const pt = ({
142
136
  ]
143
137
  }
144
138
  ),
145
- k && /* @__PURE__ */ a(
146
- rt,
139
+ O && /* @__PURE__ */ a(
140
+ V,
147
141
  {
148
- title: G,
149
- error: l ? d : void 0,
150
- className: l ? r.error : r.description,
151
- style: l ? e.error : e.description,
142
+ title: X,
143
+ error: h ? f : void 0,
144
+ className: h ? t.error : t.description,
145
+ style: h ? e.error : e.description,
152
146
  disabled: o,
153
- "data-testid": l ? "trigger-error" : "trigger-description"
147
+ "data-testid": h ? "trigger-error" : "trigger-description"
154
148
  }
155
149
  )
156
150
  ] });
157
151
  };
158
152
  export {
159
- pt as Trigger
153
+ cr as Trigger
160
154
  };
@@ -1,26 +1,26 @@
1
- import '../../assets/components/Trigger/Trigger.module-Dc9gMp3_.css';const r = {
2
- "trigger-wrapper": "_trigger-wrapper_zp1ok_74",
3
- "trigger-container": "_trigger-container_zp1ok_80",
4
- "trigger-container-applied": "_trigger-container-applied_zp1ok_103",
5
- "trigger-container-open": "_trigger-container-open_zp1ok_108",
6
- "trigger-container-error": "_trigger-container-error_zp1ok_119",
7
- "trigger-container-size-XS": "_trigger-container-size-XS_zp1ok_131",
8
- "trigger-container-size-S": "_trigger-container-size-S_zp1ok_141",
9
- "trigger-container-size-M": "_trigger-container-size-M_zp1ok_147",
10
- "trigger-container-size-L": "_trigger-container-size-L_zp1ok_153",
11
- "trigger-container-size-XL": "_trigger-container-size-XL_zp1ok_161",
12
- "trigger-container-floating": "_trigger-container-floating_zp1ok_167",
13
- "trigger-stretched": "_trigger-stretched_zp1ok_172",
14
- "trigger-content-container": "_trigger-content-container_zp1ok_176",
15
- "trigger-content-container-floating": "_trigger-content-container-floating_zp1ok_185",
16
- "trigger-label": "_trigger-label_zp1ok_190",
17
- "trigger-label-floating": "_trigger-label-floating_zp1ok_197",
18
- "trigger-label-hidden": "_trigger-label-hidden_zp1ok_209",
19
- "trigger-content": "_trigger-content_zp1ok_176",
20
- "trigger-prefix-icon": "_trigger-prefix-icon_zp1ok_223",
21
- "trigger-chevron-icon": "_trigger-chevron-icon_zp1ok_228",
22
- "trigger-clear-icon": "_trigger-clear-icon_zp1ok_244",
23
- "trigger-postfix": "_trigger-postfix_zp1ok_260"
1
+ import '../../assets/components/Trigger/Trigger.module-BWzHgDVC.css';const r = {
2
+ "trigger-wrapper": "_trigger-wrapper_1vv90_77",
3
+ "trigger-container": "_trigger-container_1vv90_83",
4
+ "trigger-container-applied": "_trigger-container-applied_1vv90_106",
5
+ "trigger-container-open": "_trigger-container-open_1vv90_111",
6
+ "trigger-container-error": "_trigger-container-error_1vv90_122",
7
+ "trigger-container-size-XS": "_trigger-container-size-XS_1vv90_134",
8
+ "trigger-container-size-S": "_trigger-container-size-S_1vv90_144",
9
+ "trigger-container-size-M": "_trigger-container-size-M_1vv90_150",
10
+ "trigger-container-size-L": "_trigger-container-size-L_1vv90_156",
11
+ "trigger-container-size-XL": "_trigger-container-size-XL_1vv90_164",
12
+ "trigger-container-floating": "_trigger-container-floating_1vv90_170",
13
+ "trigger-stretched": "_trigger-stretched_1vv90_175",
14
+ "trigger-content-container": "_trigger-content-container_1vv90_179",
15
+ "trigger-content-container-floating": "_trigger-content-container-floating_1vv90_189",
16
+ "trigger-label": "_trigger-label_1vv90_194",
17
+ "trigger-label-floating": "_trigger-label-floating_1vv90_201",
18
+ "trigger-label-hidden": "_trigger-label-hidden_1vv90_213",
19
+ "trigger-content": "_trigger-content_1vv90_179",
20
+ "trigger-prefix-icon": "_trigger-prefix-icon_1vv90_227",
21
+ "trigger-chevron-icon": "_trigger-chevron-icon_1vv90_232",
22
+ "trigger-clear-icon": "_trigger-clear-icon_1vv90_248",
23
+ "trigger-postfix": "_trigger-postfix_1vv90_264"
24
24
  };
25
25
  export {
26
26
  r as default
@@ -15,8 +15,6 @@ export declare enum LabelState {
15
15
  * Основные пропсы компонента Trigger
16
16
  */
17
17
  export type TriggerCommonProps = {
18
- /** Идентификатор кнопки триггера для тестов */
19
- 'data-testid'?: string;
20
18
  /** Состояние триггера */
21
19
  open: boolean;
22
20
  /** Контент, отображаемый в триггере */
@@ -29,19 +27,10 @@ export type TriggerCommonProps = {
29
27
  description?: string;
30
28
  /** Растянуть компонент на всю ширину */
31
29
  stretched?: boolean;
32
- /** Обрезка content: false — отключить, true (по умолчанию) — 30 символов, число — свой лимит.
33
- * При stretched=true обрезка отключена. Дробный лимит округляется вниз;
34
- * отрицательный или не конечный лимит заменяется на 30.
35
- */
36
- truncateContent?: number | boolean;
37
30
  /** Стиль выделения: 'selected' - обычное состояние, 'applied' - применённое с возможностью очистки */
38
31
  selectionStyle?: 'selected' | 'applied';
39
- /** Показывать иконку очистки при наличии контента и selectionStyle = 'selected' */
32
+ /** Показывать ли иконку очистки (XIcon) при selectionStyle = 'selected' */
40
33
  clearable?: boolean;
41
- /** Показывать ли иконку очистки. Если не задано, определяется по content, selectionStyle и clearable. */
42
- showClear?: boolean;
43
- /** Показывать ли шеврон. Если не задано, отображается при отсутствии иконки очистки. */
44
- showChevron?: boolean;
45
34
  /** Иконка перед контентом */
46
35
  prefixIcon?: ReactNode;
47
36
  /** Текст после контента */
@@ -50,7 +39,7 @@ export type TriggerCommonProps = {
50
39
  error?: string;
51
40
  /** Дизейбл компонент */
52
41
  disabled?: boolean;
53
- /** Обработчик очистки поля (вызывается при клике на иконку очистки) */
42
+ /** Обработчик очистки поля (вызывается при клике на X-иконку в режиме 'applied') */
54
43
  onClear?: () => void;
55
44
  /**
56
45
  * Дополнительные классы для:
@@ -21,10 +21,9 @@ export declare const getContentTypographySize: (size: TriggerSize) => Typography
21
21
  */
22
22
  export declare const getIconSize: (size: TriggerSize) => "xs" | "sm";
23
23
  /**
24
- * Обрезает текст content по заданному лимиту (по умолчанию 30 символов)
24
+ * Обрезает текст content если он превышает 30 символов
25
25
  *
26
26
  * @param content - текст для обрезки
27
- * @param limit - false отключает обрезку, true задаёт лимит 30, число — свой лимит
28
27
  * @returns обрезанный текст с многоточием или исходный текст
29
28
  */
30
- export declare const truncateContent: (content: string, limit?: number | boolean) => string;
29
+ export declare const truncateContent: (content: string) => string;