@alphakits/ui 2.0.7 → 2.0.8
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/badge/component.d.ts +1 -1
- package/dist/badge/component.js +19 -19
- package/dist/badge/component.js.map +1 -1
- package/dist/badge/index.module.css +1 -1
- package/dist/badge/index.module.css.js +46 -32
- package/dist/badge/index.module.css.js.map +1 -1
- package/dist/cell/base/component.d.ts +6 -0
- package/dist/cell/base/component.js +69 -37
- package/dist/cell/base/component.js.map +1 -1
- package/dist/cell/base/index.module.css +1 -1
- package/dist/cell/base/index.module.css.js +12 -8
- package/dist/cell/base/index.module.css.js.map +1 -1
- package/dist/cell/pure/component.d.ts +2 -0
- package/dist/cell/pure/component.js +16 -14
- package/dist/cell/pure/component.js.map +1 -1
- package/dist/cell/pure/index.module.css +1 -1
- package/dist/cell/pure/index.module.css.js +16 -14
- package/dist/cell/pure/index.module.css.js.map +1 -1
- package/dist/filter-tag/component.d.ts +12 -0
- package/dist/filter-tag/component.js +38 -0
- package/dist/filter-tag/component.js.map +1 -0
- package/dist/filter-tag/index.d.ts +1 -0
- package/dist/filter-tag/index.js +5 -0
- package/dist/filter-tag/index.js.map +1 -0
- package/dist/filter-tag/index.module.css +1 -0
- package/dist/filter-tag/index.module.css.js +29 -0
- package/dist/filter-tag/index.module.css.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +268 -266
- package/dist/index.js.map +1 -1
- package/dist/table/columns.js +2 -4
- package/dist/table/columns.js.map +1 -1
- package/dist/table/components/cell/component.d.ts +1 -0
- package/dist/table/components/cell/component.js +42 -35
- package/dist/table/components/cell/component.js.map +1 -1
- package/dist/table/components/cell/index.module.css +1 -1
- package/dist/table/components/cell/index.module.css.js +12 -8
- package/dist/table/components/cell/index.module.css.js.map +1 -1
- package/dist/table/components/cells/index.module.css +1 -1
- package/dist/table/components/table-header/index.module.css +1 -1
- package/dist/table/index.module.css.js +9 -6
- package/dist/table/index.module.css.js.map +1 -1
- package/dist/table/table.d.ts +2 -1
- package/dist/table/table.js +107 -101
- package/dist/table/table.js.map +1 -1
- package/dist/table/utils/prepare-rows.d.ts +2 -1
- package/dist/table/utils/prepare-rows.js +60 -27
- package/dist/table/utils/prepare-rows.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ export interface BadgeProps {
|
|
|
11
11
|
/**
|
|
12
12
|
* Цвет компонента
|
|
13
13
|
*/
|
|
14
|
-
color?: 'accent' | 'secondary';
|
|
14
|
+
color?: 'accent' | 'secondary' | 'green' | 'orange' | 'red' | 'blue' | 'grey' | 'teal' | 'purple';
|
|
15
15
|
/**
|
|
16
16
|
* Размер компонента (только для view=count)
|
|
17
17
|
*/
|
package/dist/badge/component.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import l from "classnames";
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
className:
|
|
6
|
-
size:
|
|
7
|
-
view:
|
|
3
|
+
import s from "./index.module.css.js";
|
|
4
|
+
const C = ({
|
|
5
|
+
className: m,
|
|
6
|
+
size: t = "m",
|
|
7
|
+
view: o = "count",
|
|
8
8
|
visibleIconOutline: d = !1,
|
|
9
|
-
content:
|
|
10
|
-
iconColor:
|
|
9
|
+
content: e,
|
|
10
|
+
iconColor: r,
|
|
11
11
|
color: n = "secondary",
|
|
12
12
|
dataTestId: p
|
|
13
13
|
}) => {
|
|
14
|
-
const
|
|
14
|
+
const i = o === "count", c = i && typeof e == "number" && e <= 0, u = i && typeof e == "number" && e >= 100 ? "99+" : e, a = typeof e == "number" && e < 10;
|
|
15
15
|
return /* @__PURE__ */ f(
|
|
16
16
|
"div",
|
|
17
17
|
{
|
|
18
18
|
className: l(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
s.component,
|
|
20
|
+
s[t],
|
|
21
|
+
s[o],
|
|
22
|
+
s[n],
|
|
23
|
+
r && s[r],
|
|
24
24
|
{
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
25
|
+
[s.isHidden]: c,
|
|
26
|
+
[s.dot]: !e,
|
|
27
|
+
[s.outline]: d,
|
|
28
|
+
[s.circle]: a
|
|
29
29
|
},
|
|
30
|
-
|
|
30
|
+
m
|
|
31
31
|
),
|
|
32
32
|
"data-test-id": p,
|
|
33
33
|
children: u
|
|
@@ -35,6 +35,6 @@ const w = ({
|
|
|
35
35
|
);
|
|
36
36
|
};
|
|
37
37
|
export {
|
|
38
|
-
|
|
38
|
+
C as Badge
|
|
39
39
|
};
|
|
40
40
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/badge/component.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport styles from './index.module.css';\n\nexport interface BadgeProps {\n /**\n * Дополнительный класс\n */\n className?: string;\n\n /**\n * Вид компонента\n */\n view?: 'icon' | 'count';\n\n /**\n * Цвет компонента\n */\n color?: 'accent' | 'secondary';\n\n /**\n * Размер компонента (только для view=count)\n */\n size?: 's' | 'm' | 'l';\n\n /**\n * Видимость обводки вокруг иконки (только для view=icon)\n */\n visibleIconOutline?: boolean;\n\n /**\n * Контент компонента\n */\n content?: React.ReactNode | number | string;\n\n /**\n * Цветовое оформление иконки\n */\n iconColor?: 'positive' | 'attention' | 'negative' | 'tertiary' | 'secondary' | 'primary';\n\n /**\n * Идентификатор для систем автоматизированного тестирования\n */\n dataTestId?: string;\n}\n\nexport const Badge = ({\n className,\n size = 'm',\n view = 'count',\n visibleIconOutline = false,\n content,\n iconColor,\n color = 'secondary',\n dataTestId,\n}: BadgeProps) => {\n const isCountView = view === 'count';\n\n const isHidden = isCountView && typeof content === 'number' && content <= 0;\n const componentContent =\n isCountView && typeof content === 'number' && content >= 100 ? '99+' : content;\n\n const isCircle = typeof content === 'number' && content < 10;\n\n return (\n <div\n className={ cn(\n styles.component,\n styles[size],\n styles
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/badge/component.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport styles from './index.module.css';\n\nexport interface BadgeProps {\n /**\n * Дополнительный класс\n */\n className?: string;\n\n /**\n * Вид компонента\n */\n view?: 'icon' | 'count';\n\n /**\n * Цвет компонента\n */\n color?: 'accent' | 'secondary' | 'green' | 'orange' | 'red' | 'blue' | 'grey' | 'teal' | 'purple';\n\n /**\n * Размер компонента (только для view=count)\n */\n size?: 's' | 'm' | 'l';\n\n /**\n * Видимость обводки вокруг иконки (только для view=icon)\n */\n visibleIconOutline?: boolean;\n\n /**\n * Контент компонента\n */\n content?: React.ReactNode | number | string;\n\n /**\n * Цветовое оформление иконки\n */\n iconColor?: 'positive' | 'attention' | 'negative' | 'tertiary' | 'secondary' | 'primary';\n\n /**\n * Идентификатор для систем автоматизированного тестирования\n */\n dataTestId?: string;\n}\n\nexport const Badge = ({\n className,\n size = 'm',\n view = 'count',\n visibleIconOutline = false,\n content,\n iconColor,\n color = 'secondary',\n dataTestId,\n}: BadgeProps) => {\n const isCountView = view === 'count';\n\n const isHidden = isCountView && typeof content === 'number' && content <= 0;\n const componentContent =\n isCountView && typeof content === 'number' && content >= 100 ? '99+' : content;\n\n const isCircle = typeof content === 'number' && content < 10;\n\n return (\n <div\n className={ cn(\n styles.component,\n styles[size],\n styles[view],\n styles[color],\n iconColor && styles[iconColor],\n {\n [styles.isHidden]: isHidden,\n [styles.dot]: !content,\n [styles.outline]: visibleIconOutline,\n [styles.circle]: isCircle,\n },\n className,\n ) }\n data-test-id={ dataTestId }\n >\n { componentContent }\n </div>\n );\n};\n"],"names":["Badge","className","size","view","visibleIconOutline","content","iconColor","color","dataTestId","isCountView","isHidden","componentContent","isCircle","jsx","cn","styles"],"mappings":";;;AA+CO,MAAMA,IAAQ,CAAC;AAAA,EAClB,WAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,oBAAAC,IAAqB;AAAA,EACrB,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,YAAAC;AACJ,MAAkB;AACd,QAAMC,IAAcN,MAAS,SAEvBO,IAAWD,KAAe,OAAOJ,KAAY,YAAYA,KAAW,GACpEM,IACFF,KAAe,OAAOJ,KAAY,YAAYA,KAAW,MAAM,QAAQA,GAErEO,IAAW,OAAOP,KAAY,YAAYA,IAAU;AAE1D,SACI,gBAAAQ;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAYC;AAAA,QACRC,EAAO;AAAA,QACPA,EAAOb,CAAI;AAAA,QACXa,EAAOZ,CAAI;AAAA,QACXY,EAAOR,CAAK;AAAA,QACZD,KAAaS,EAAOT,CAAS;AAAA,QAC7B;AAAA,UACI,CAACS,EAAO,QAAQ,GAAGL;AAAA,UACnB,CAACK,EAAO,GAAG,GAAG,CAACV;AAAA,UACf,CAACU,EAAO,OAAO,GAAGX;AAAA,UAClB,CAACW,EAAO,MAAM,GAAGH;AAAA,QAAA;AAAA,QAErBX;AAAA,MAAA;AAAA,MAEJ,gBAAeO;AAAA,MAEb,UAAAG;AAAA,IAAA;AAAA,EAAA;AAGd;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--badge-icon-bg-color: var(--color-bg-primary)}.component_ZLNa{position:relative;z-index:2;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border-radius:99px;overflow:hidden}.accent_i-f-{background-color:var(--color-bg-accent);color:var(--color-text-primary-inverted)}.secondary_TJV0{background-color:var(--color-bg-secondary);color:var(--color-text-secondary)}.s_VUGf{font-size:11px;line-height:13px;font-weight:500;font-family:var(--font-family);height:16px;min-width:16px;padding:0 var(--gap-xs)}.m_vUD5{font-size:13px;line-height:24px;font-weight:500;font-family:var(--font-family);font-weight:700;height:20px;min-width:20px;padding:0 var(--gap-xs)}.l_Qq57{font-size:13px;line-height:24px;font-weight:500;font-family:var(--font-family);font-weight:700;height:24px;min-width:24px;padding:0 var(--gap-xs)}.circle_uaS5{padding:0;border-radius:var(--radius-circle)}.icon_AmgA{height:auto;min-width:0;padding:0;color:var(--color-graphic-positive);background-color:transparent}.icon_AmgA.positive_nd8h{color:var(--color-graphic-positive)}.icon_AmgA.attention_gK6W{color:var(--color-graphic-attention)}.icon_AmgA.negative_Q3IO{color:var(--color-graphic-negative)}.icon_AmgA.tertiary_PJi6{color:var(--color-graphic-tertiary)}.icon_AmgA.secondary_TJV0{color:var(--color-graphic-secondary)}.icon_AmgA.primary_6z3n{color:var(--color-graphic-primary)}.icon_AmgA:before{position:absolute;z-index:-1;inset:16%;background-color:var(--badge-icon-bg-color);border-radius:99px;content:""}.outline_59f8:before{inset:0}.dot_m71m{width:8px;height:8px;min-width:0;padding:0}.isHidden_wpIC{display:none}.count_UWIM{height:auto}
|
|
1
|
+
:root{--badge-icon-bg-color: var(--color-bg-primary)}.component_ZLNa{position:relative;z-index:2;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border-radius:99px;overflow:hidden}.accent_i-f-{background-color:var(--color-bg-accent);color:var(--color-text-primary-inverted)}.secondary_TJV0{background-color:var(--color-bg-secondary);color:var(--color-text-secondary)}.green_zrgX{background-color:color-mix(in srgb,var(--color-graphic-positive) 16%,transparent);color:var(--color-graphic-positive)}.orange_lX9C{background-color:color-mix(in srgb,var(--color-graphic-attention) 16%,transparent);color:var(--color-graphic-attention)}.red_d9v3{background-color:color-mix(in srgb,var(--color-graphic-negative) 16%,transparent);color:var(--color-graphic-negative)}.blue_-KAO{background-color:color-mix(in srgb,var(--color-graphic-accent) 16%,transparent);color:var(--color-graphic-accent)}.grey_HcST{background-color:color-mix(in srgb,var(--color-graphic-secondary) 16%,transparent);color:var(--color-graphic-secondary)}.teal_F3BI{background-color:color-mix(in srgb,var(--color-status-teal) 16%,transparent);color:var(--color-status-teal)}.purple_A2pW{background-color:color-mix(in srgb,var(--color-status-purple) 16%,transparent);color:var(--color-status-purple)}.s_VUGf{font-size:11px;line-height:13px;font-weight:500;font-family:var(--font-family);height:16px;min-width:16px;padding:0 var(--gap-xs)}.m_vUD5{font-size:13px;line-height:24px;font-weight:500;font-family:var(--font-family);font-weight:700;height:20px;min-width:20px;padding:0 var(--gap-xs)}.l_Qq57{font-size:13px;line-height:24px;font-weight:500;font-family:var(--font-family);font-weight:700;height:24px;min-width:24px;padding:0 var(--gap-xs)}.circle_uaS5{padding:0;border-radius:var(--radius-circle)}.icon_AmgA{height:auto;min-width:0;padding:0;color:var(--color-graphic-positive);background-color:transparent}.icon_AmgA.positive_nd8h{color:var(--color-graphic-positive)}.icon_AmgA.attention_gK6W{color:var(--color-graphic-attention)}.icon_AmgA.negative_Q3IO{color:var(--color-graphic-negative)}.icon_AmgA.tertiary_PJi6{color:var(--color-graphic-tertiary)}.icon_AmgA.secondary_TJV0{color:var(--color-graphic-secondary)}.icon_AmgA.primary_6z3n{color:var(--color-graphic-primary)}.icon_AmgA:before{position:absolute;z-index:-1;inset:16%;background-color:var(--badge-icon-bg-color);border-radius:99px;content:""}.outline_59f8:before{inset:0}.dot_m71m{width:8px;height:8px;min-width:0;padding:0}.isHidden_wpIC{display:none}.count_UWIM{height:auto}
|
|
@@ -1,41 +1,55 @@
|
|
|
1
1
|
import './index.module.css';
|
|
2
|
-
const t = "component_ZLNa", n = "accent_i-f-",
|
|
2
|
+
const t = "component_ZLNa", n = "accent_i-f-", e = "secondary_TJV0", o = "green_zrgX", c = "orange_lX9C", s = "red_d9v3", i = "blue_-KAO", r = "grey_HcST", a = "teal_F3BI", _ = "purple_A2pW", l = "s_VUGf", d = "m_vUD5", p = "l_Qq57", g = "circle_uaS5", u = "icon_AmgA", y = "positive_nd8h", m = "attention_gK6W", v = "negative_Q3IO", f = "tertiary_PJi6", A = "primary_6z3n", H = "outline_59f8", I = "dot_m71m", b = "isHidden_wpIC", U = "count_UWIM", W = {
|
|
3
3
|
component: t,
|
|
4
4
|
accent: n,
|
|
5
|
-
secondary:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
secondary: e,
|
|
6
|
+
green: o,
|
|
7
|
+
orange: c,
|
|
8
|
+
red: s,
|
|
9
|
+
blue: i,
|
|
10
|
+
grey: r,
|
|
11
|
+
teal: a,
|
|
12
|
+
purple: _,
|
|
13
|
+
s: l,
|
|
14
|
+
m: d,
|
|
15
|
+
l: p,
|
|
16
|
+
circle: g,
|
|
17
|
+
icon: u,
|
|
18
|
+
positive: y,
|
|
19
|
+
attention: m,
|
|
20
|
+
negative: v,
|
|
21
|
+
tertiary: f,
|
|
22
|
+
primary: A,
|
|
23
|
+
outline: H,
|
|
24
|
+
dot: I,
|
|
25
|
+
isHidden: b,
|
|
26
|
+
count: U
|
|
20
27
|
};
|
|
21
28
|
export {
|
|
22
29
|
n as accent,
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
m as attention,
|
|
31
|
+
i as blue,
|
|
32
|
+
g as circle,
|
|
25
33
|
t as component,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
U as count,
|
|
35
|
+
W as default,
|
|
36
|
+
I as dot,
|
|
37
|
+
o as green,
|
|
38
|
+
r as grey,
|
|
39
|
+
u as icon,
|
|
40
|
+
b as isHidden,
|
|
41
|
+
p as l,
|
|
42
|
+
d as m,
|
|
43
|
+
v as negative,
|
|
44
|
+
c as orange,
|
|
45
|
+
H as outline,
|
|
46
|
+
y as positive,
|
|
47
|
+
A as primary,
|
|
48
|
+
_ as purple,
|
|
49
|
+
s as red,
|
|
50
|
+
l as s,
|
|
51
|
+
e as secondary,
|
|
52
|
+
a as teal,
|
|
53
|
+
f as tertiary
|
|
40
54
|
};
|
|
41
55
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -13,5 +13,11 @@ export type BaseProps = {
|
|
|
13
13
|
dataTestId?: string;
|
|
14
14
|
/** addon - контейнер для фото или иконки */
|
|
15
15
|
addon?: React.ReactNode;
|
|
16
|
+
/** Компактное расположение addon рядом с текстом */
|
|
17
|
+
compactAddon?: boolean;
|
|
18
|
+
/** Запрет переноса заголовка и обрезка в одну строку */
|
|
19
|
+
singleLineTitle?: boolean;
|
|
20
|
+
/** Показывать tooltip только при обрезке заголовка */
|
|
21
|
+
showTitleTooltipOnOverflow?: boolean;
|
|
16
22
|
};
|
|
17
23
|
export declare const Base: React.FC<BaseProps>;
|
|
@@ -1,50 +1,82 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { getDataTestId as
|
|
5
|
-
import { useFocus as
|
|
6
|
-
import { Typography as
|
|
7
|
-
import { Pure as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
className:
|
|
11
|
-
dataTestId:
|
|
12
|
-
title:
|
|
13
|
-
subtitle:
|
|
14
|
-
size:
|
|
15
|
-
addon:
|
|
1
|
+
import { jsx as s, jsxs as z } from "react/jsx-runtime";
|
|
2
|
+
import I, { useRef as u, useState as N, useMemo as E, useEffect as j } from "react";
|
|
3
|
+
import p from "classnames";
|
|
4
|
+
import { getDataTestId as k } from "../../__internal/utils/getDataTestId.js";
|
|
5
|
+
import { useFocus as F } from "../../hooks/useFocus/index.js";
|
|
6
|
+
import { Typography as v } from "../../typography/component.js";
|
|
7
|
+
import { Pure as S } from "../pure/component.js";
|
|
8
|
+
import r from "./index.module.css.js";
|
|
9
|
+
const q = ({
|
|
10
|
+
className: h,
|
|
11
|
+
dataTestId: w,
|
|
12
|
+
title: e,
|
|
13
|
+
subtitle: m,
|
|
14
|
+
size: y = "m",
|
|
15
|
+
addon: g,
|
|
16
|
+
compactAddon: b,
|
|
17
|
+
singleLineTitle: i,
|
|
18
|
+
showTitleTooltipOnOverflow: n
|
|
16
19
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
const d = u(null), a = u(null), [x] = F(d, "keyboard"), [R, f] = N(!1), c = E(
|
|
21
|
+
() => typeof e == "string" || typeof e == "number" ? String(e) : void 0,
|
|
22
|
+
[e]
|
|
23
|
+
);
|
|
24
|
+
return j(() => {
|
|
25
|
+
if (!i || !n || !c) {
|
|
26
|
+
f(!1);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const t = a.current;
|
|
30
|
+
if (!t) return;
|
|
31
|
+
const o = () => {
|
|
32
|
+
f(t.scrollWidth > t.clientWidth);
|
|
33
|
+
};
|
|
34
|
+
if (o(), typeof ResizeObserver != "undefined") {
|
|
35
|
+
const l = new ResizeObserver(o);
|
|
36
|
+
return l.observe(t), () => l.disconnect();
|
|
37
|
+
}
|
|
38
|
+
return window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
|
|
39
|
+
}, [i, n, c]), /* @__PURE__ */ s(
|
|
40
|
+
S,
|
|
20
41
|
{
|
|
21
|
-
slot:
|
|
22
|
-
|
|
23
|
-
|
|
42
|
+
slot: g,
|
|
43
|
+
compact: b,
|
|
44
|
+
className: p(r.component, { [r.focused]: x }, h),
|
|
45
|
+
dataTestId: k("cell-action", w, !0),
|
|
24
46
|
tabIndex: 0,
|
|
25
|
-
size:
|
|
26
|
-
ref:
|
|
27
|
-
children: /* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
|
|
47
|
+
size: y,
|
|
48
|
+
ref: d,
|
|
49
|
+
children: /* @__PURE__ */ z(I.Fragment, { children: [
|
|
50
|
+
e && /* @__PURE__ */ s(
|
|
51
|
+
"div",
|
|
30
52
|
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
children:
|
|
53
|
+
ref: a,
|
|
54
|
+
className: p(r.title_wrap, {
|
|
55
|
+
[r.single_line]: i
|
|
56
|
+
}),
|
|
57
|
+
title: R && n ? c : void 0,
|
|
58
|
+
children: /* @__PURE__ */ s(
|
|
59
|
+
v.Text,
|
|
60
|
+
{
|
|
61
|
+
view: "title",
|
|
62
|
+
color: "primary",
|
|
63
|
+
weight: "medium",
|
|
64
|
+
tag: "div",
|
|
65
|
+
className: r.title,
|
|
66
|
+
children: e
|
|
67
|
+
}
|
|
68
|
+
)
|
|
37
69
|
}
|
|
38
70
|
),
|
|
39
|
-
|
|
40
|
-
|
|
71
|
+
m && /* @__PURE__ */ s(
|
|
72
|
+
v.Text,
|
|
41
73
|
{
|
|
42
74
|
weight: "medium",
|
|
43
75
|
view: "caps",
|
|
44
76
|
tag: "div",
|
|
45
|
-
className:
|
|
77
|
+
className: r.subtitle,
|
|
46
78
|
color: "secondary",
|
|
47
|
-
children:
|
|
79
|
+
children: m
|
|
48
80
|
}
|
|
49
81
|
)
|
|
50
82
|
] })
|
|
@@ -52,6 +84,6 @@ const j = ({
|
|
|
52
84
|
);
|
|
53
85
|
};
|
|
54
86
|
export {
|
|
55
|
-
|
|
87
|
+
q as Base
|
|
56
88
|
};
|
|
57
89
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/cell/base/component.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport cn from 'classnames';\n\nimport { getDataTestId } from '../../__internal/utils';\nimport { useFocus } from '../../hooks/useFocus';\nimport { Typography } from '../../typography';\nimport { Pure, PureProps } from '../pure/component';\n\nimport styles from './index.module.css';\n\nexport type BaseProps = {\n /** Заголовок */\n title?: React.ReactNode;\n /** Подзаголовок */\n subtitle?: React.ReactNode;\n /** Css-класс для стилизации */\n className?: string;\n /** Размер ячейки */\n size?: PureProps['size'];\n /** Id компонента для тестов */\n dataTestId?: string;\n\n /** addon - контейнер для фото или иконки */\n addon?: React.ReactNode;\n};\n\nexport const Base: React.FC<BaseProps> = ({\n className,\n dataTestId,\n title,\n subtitle,\n size = 'm',\n addon,\n}) => {\n const componentRef = useRef<HTMLDivElement>(null);\n const [focused] = useFocus(componentRef, 'keyboard');\n\n return (\n <Pure\n slot={ addon }\n className={ cn(styles.component, { [styles.focused]: focused }, className) }\n dataTestId={ getDataTestId('cell-action', dataTestId, true) }\n tabIndex={ 0 }\n size={ size }\n ref={ componentRef }\n >\n <React.Fragment>\n { title && (\n <Typography.Text\n
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/cell/base/component.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useRef, useState } from 'react';\nimport cn from 'classnames';\n\nimport { getDataTestId } from '../../__internal/utils';\nimport { useFocus } from '../../hooks/useFocus';\nimport { Typography } from '../../typography';\nimport { Pure, PureProps } from '../pure/component';\n\nimport styles from './index.module.css';\n\nexport type BaseProps = {\n /** Заголовок */\n title?: React.ReactNode;\n /** Подзаголовок */\n subtitle?: React.ReactNode;\n /** Css-класс для стилизации */\n className?: string;\n /** Размер ячейки */\n size?: PureProps['size'];\n /** Id компонента для тестов */\n dataTestId?: string;\n\n /** addon - контейнер для фото или иконки */\n addon?: React.ReactNode;\n /** Компактное расположение addon рядом с текстом */\n compactAddon?: boolean;\n /** Запрет переноса заголовка и обрезка в одну строку */\n singleLineTitle?: boolean;\n /** Показывать tooltip только при обрезке заголовка */\n showTitleTooltipOnOverflow?: boolean;\n};\n\nexport const Base: React.FC<BaseProps> = ({\n className,\n dataTestId,\n title,\n subtitle,\n size = 'm',\n addon,\n compactAddon,\n singleLineTitle,\n showTitleTooltipOnOverflow,\n}) => {\n const componentRef = useRef<HTMLDivElement>(null);\n const titleRef = useRef<HTMLDivElement>(null);\n const [focused] = useFocus(componentRef, 'keyboard');\n const [isTitleOverflow, setIsTitleOverflow] = useState(false);\n\n const titleTooltip = useMemo(\n () => (\n (typeof title === 'string' || typeof title === 'number')\n ? String(title)\n : undefined\n ),\n [title],\n );\n\n useEffect(() => {\n if (!singleLineTitle || !showTitleTooltipOnOverflow || !titleTooltip) {\n setIsTitleOverflow(false);\n return undefined;\n }\n\n const node = titleRef.current;\n if (!node) return undefined;\n\n const checkOverflow = () => {\n setIsTitleOverflow(node.scrollWidth > node.clientWidth);\n };\n\n checkOverflow();\n\n if (typeof ResizeObserver !== 'undefined') {\n const observer = new ResizeObserver(checkOverflow);\n observer.observe(node);\n\n return () => observer.disconnect();\n }\n\n window.addEventListener('resize', checkOverflow);\n return () => window.removeEventListener('resize', checkOverflow);\n }, [singleLineTitle, showTitleTooltipOnOverflow, titleTooltip]);\n\n return (\n <Pure\n slot={ addon }\n compact={ compactAddon }\n className={ cn(styles.component, { [styles.focused]: focused }, className) }\n dataTestId={ getDataTestId('cell-action', dataTestId, true) }\n tabIndex={ 0 }\n size={ size }\n ref={ componentRef }\n >\n <React.Fragment>\n { title && (\n <div\n ref={ titleRef }\n className={ cn(styles.title_wrap, {\n [styles.single_line]: singleLineTitle,\n }) }\n title={\n isTitleOverflow && showTitleTooltipOnOverflow\n ? titleTooltip\n : undefined\n }\n >\n <Typography.Text\n view=\"title\"\n color=\"primary\"\n weight=\"medium\"\n tag=\"div\"\n className={ styles.title }\n >\n { title }\n </Typography.Text>\n </div>\n ) }\n { subtitle && (\n <Typography.Text\n weight=\"medium\"\n view=\"caps\"\n tag=\"div\"\n className={ styles.subtitle }\n color=\"secondary\"\n >\n { subtitle }\n </Typography.Text>\n ) }\n </React.Fragment>\n </Pure>\n );\n};\n"],"names":["Base","className","dataTestId","title","subtitle","size","addon","compactAddon","singleLineTitle","showTitleTooltipOnOverflow","componentRef","useRef","titleRef","focused","useFocus","isTitleOverflow","setIsTitleOverflow","useState","titleTooltip","useMemo","useEffect","node","checkOverflow","observer","jsx","Pure","cn","styles","getDataTestId","jsxs","React","Typography"],"mappings":";;;;;;;;AAgCO,MAAMA,IAA4B,CAAC;AAAA,EACtC,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,4BAAAC;AACJ,MAAM;AACF,QAAMC,IAAeC,EAAuB,IAAI,GAC1CC,IAAWD,EAAuB,IAAI,GACtC,CAACE,CAAO,IAAIC,EAASJ,GAAc,UAAU,GAC7C,CAACK,GAAiBC,CAAkB,IAAIC,EAAS,EAAK,GAEtDC,IAAeC;AAAA,IACjB,MACK,OAAOhB,KAAU,YAAY,OAAOA,KAAU,WACzC,OAAOA,CAAK,IACZ;AAAA,IAEV,CAACA,CAAK;AAAA,EAAA;AAGV,SAAAiB,EAAU,MAAM;AACZ,QAAI,CAACZ,KAAmB,CAACC,KAA8B,CAACS,GAAc;AAClE,MAAAF,EAAmB,EAAK;AACxB;AAAA,IACJ;AAEA,UAAMK,IAAOT,EAAS;AACtB,QAAI,CAACS,EAAM;AAEX,UAAMC,IAAgB,MAAM;AACxB,MAAAN,EAAmBK,EAAK,cAAcA,EAAK,WAAW;AAAA,IAC1D;AAIA,QAFAC,EAAA,GAEI,OAAO,kBAAmB,aAAa;AACvC,YAAMC,IAAW,IAAI,eAAeD,CAAa;AACjD,aAAAC,EAAS,QAAQF,CAAI,GAEd,MAAME,EAAS,WAAA;AAAA,IAC1B;AAEA,kBAAO,iBAAiB,UAAUD,CAAa,GACxC,MAAM,OAAO,oBAAoB,UAAUA,CAAa;AAAA,EACnE,GAAG,CAACd,GAAiBC,GAA4BS,CAAY,CAAC,GAG1D,gBAAAM;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,MAAOnB;AAAA,MACP,SAAUC;AAAA,MACV,WAAYmB,EAAGC,EAAO,WAAW,EAAE,CAACA,EAAO,OAAO,GAAGd,EAAA,GAAWZ,CAAS;AAAA,MACzE,YAAa2B,EAAc,eAAe1B,GAAY,EAAI;AAAA,MAC1D,UAAW;AAAA,MACX,MAAAG;AAAA,MACA,KAAMK;AAAA,MAEN,UAAA,gBAAAmB,EAACC,EAAM,UAAN,EACK,UAAA;AAAA,QAAA3B,KACE,gBAAAqB;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,KAAMZ;AAAA,YACN,WAAYc,EAAGC,EAAO,YAAY;AAAA,cAC9B,CAACA,EAAO,WAAW,GAAGnB;AAAA,YAAA,CACzB;AAAA,YACD,OACIO,KAAmBN,IACbS,IACA;AAAA,YAGV,UAAA,gBAAAM;AAAA,cAACO,EAAW;AAAA,cAAX;AAAA,gBACG,MAAK;AAAA,gBACL,OAAM;AAAA,gBACN,QAAO;AAAA,gBACP,KAAI;AAAA,gBACJ,WAAYJ,EAAO;AAAA,gBAEjB,UAAAxB;AAAA,cAAA;AAAA,YAAA;AAAA,UACN;AAAA,QAAA;AAAA,QAGNC,KACE,gBAAAoB;AAAA,UAACO,EAAW;AAAA,UAAX;AAAA,YACG,QAAO;AAAA,YACP,MAAK;AAAA,YACL,KAAI;AAAA,YACJ,WAAYJ,EAAO;AAAA,YACnB,OAAM;AAAA,YAEJ,UAAAvB;AAAA,UAAA;AAAA,QAAA;AAAA,MACN,EAAA,CAER;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.component_BNjZ{outline:none}.component_BNjZ .superEllipse_FONr{--super-ellipse-success-icon-color: var(--color-graphic-thirdly)}.component_BNjZ .iconMixColors_Zfj6{color:var(--color-graphic-primary)}.iconMixColors_Zfj6,.superEllipse_FONr{--super-ellipse-transition: fill .15s ease-in-out;--super-ellipse-icon-transition: color .15s ease-in-out;transition:transform .15s ease-in-out}.
|
|
1
|
+
.component_BNjZ{outline:none}.component_BNjZ .superEllipse_FONr{--super-ellipse-success-icon-color: var(--color-graphic-thirdly)}.component_BNjZ .iconMixColors_Zfj6{color:var(--color-graphic-primary)}.iconMixColors_Zfj6,.superEllipse_FONr{--super-ellipse-transition: fill .15s ease-in-out;--super-ellipse-icon-transition: color .15s ease-in-out;transition:transform .15s ease-in-out}.title_wrap_10zd{display:flex;align-items:center}.title_wrap_10zd+.subtitle_OOoZ{margin-top:var(--gap-2xs)}.title_wrap_10zd{min-width:0}.title_VeYl{display:flex;align-items:center}.single_line_4wfi .title_VeYl{display:block;min-width:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.focused_ootM{outline:2px solid var(--focus-color);outline-offset:2px}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import './index.module.css';
|
|
2
|
-
const t = "component_BNjZ",
|
|
2
|
+
const t = "component_BNjZ", e = "title_wrap_10zd", o = "subtitle_OOoZ", n = "title_VeYl", s = "single_line_4wfi", l = "focused_ootM", i = {
|
|
3
3
|
component: t,
|
|
4
|
-
|
|
5
|
-
subtitle:
|
|
6
|
-
|
|
4
|
+
title_wrap: e,
|
|
5
|
+
subtitle: o,
|
|
6
|
+
title: n,
|
|
7
|
+
single_line: s,
|
|
8
|
+
focused: l
|
|
7
9
|
};
|
|
8
10
|
export {
|
|
9
11
|
t as component,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
o as
|
|
12
|
+
i as default,
|
|
13
|
+
l as focused,
|
|
14
|
+
s as single_line,
|
|
15
|
+
o as subtitle,
|
|
16
|
+
n as title,
|
|
17
|
+
e as title_wrap
|
|
14
18
|
};
|
|
15
19
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -9,6 +9,8 @@ type ComponentProps = {
|
|
|
9
9
|
direction?: 'horizontal' | 'vertical';
|
|
10
10
|
/** Размер ячейки */
|
|
11
11
|
size?: 's' | 'm' | 'l';
|
|
12
|
+
/** Компактный режим расположения слота */
|
|
13
|
+
compact?: boolean;
|
|
12
14
|
/** Сss-класс для стилизации контейнера */
|
|
13
15
|
className?: string;
|
|
14
16
|
/** Id компонента для тестов */
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as u, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as v } from "react";
|
|
3
3
|
import m from "classnames";
|
|
4
|
-
import { getDataTestId as
|
|
4
|
+
import { getDataTestId as h } from "../../__internal/utils/getDataTestId.js";
|
|
5
5
|
import r from "./index.module.css.js";
|
|
6
|
-
const
|
|
6
|
+
const w = v(
|
|
7
7
|
({
|
|
8
8
|
slot: e,
|
|
9
9
|
size: t = "m",
|
|
10
|
+
compact: d = !1,
|
|
10
11
|
order: o = "normal",
|
|
11
|
-
direction:
|
|
12
|
+
direction: c = "horizontal",
|
|
12
13
|
children: i,
|
|
13
14
|
className: n,
|
|
14
|
-
dataTestId:
|
|
15
|
-
...
|
|
16
|
-
},
|
|
15
|
+
dataTestId: l,
|
|
16
|
+
...p
|
|
17
|
+
}, f) => {
|
|
17
18
|
const a = {
|
|
18
19
|
[r.normalOrder]: o === "normal" && e,
|
|
19
20
|
[r.reverseOrder]: o === "reverse" && e,
|
|
20
|
-
[r[
|
|
21
|
+
[r[c]]: !0,
|
|
22
|
+
[r.compact]: d
|
|
21
23
|
};
|
|
22
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ u(
|
|
23
25
|
"div",
|
|
24
26
|
{
|
|
25
|
-
ref:
|
|
27
|
+
ref: f,
|
|
26
28
|
className: m(r.component, r[t], { ...a }, n),
|
|
27
|
-
"data-test-id":
|
|
28
|
-
...
|
|
29
|
+
"data-test-id": h("cell-pure", l, !0),
|
|
30
|
+
...p,
|
|
29
31
|
children: [
|
|
30
32
|
e && /* @__PURE__ */ s("div", { className: m(r.addon, { ...a }), children: e }),
|
|
31
33
|
/* @__PURE__ */ s("div", { className: m(r.child, { ...a }), children: i })
|
|
@@ -35,6 +37,6 @@ const g = u(
|
|
|
35
37
|
}
|
|
36
38
|
);
|
|
37
39
|
export {
|
|
38
|
-
|
|
40
|
+
w as Pure
|
|
39
41
|
};
|
|
40
42
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/cell/pure/component.tsx"],"sourcesContent":["import React, { forwardRef, HTMLAttributes } from 'react';\nimport cn from 'classnames';\n\nimport { getDataTestId } from '../../__internal/utils';\n\nimport styles from './index.module.css';\n\ntype ComponentProps = {\n children?: React.ReactNode;\n /** Слот для иконки */\n slot?: React.ReactNode;\n /** Порядок отображения слота и children */\n order?: 'normal' | 'reverse';\n /** Направление */\n direction?: 'horizontal' | 'vertical';\n /** Размер ячейки */\n size?: 's' | 'm' | 'l';\n /** Сss-класс для стилизации контейнера */\n className?: string;\n /** Id компонента для тестов */\n dataTestId?: string;\n};\n\nexport type PureProps = Omit<HTMLAttributes<HTMLDivElement>, 'slot'> & ComponentProps;\n\n/**\n * Ячейка\n *\n * Отвечает за отступы и вертикальное или горизонтальное положение\n */\nexport const Pure = forwardRef<HTMLDivElement, PureProps>(\n (\n {\n slot,\n size = 'm',\n order = 'normal',\n direction = 'horizontal',\n children,\n className,\n dataTestId,\n ...props\n },\n ref,\n ) => {\n const addClasses = {\n [styles.normalOrder]: order === 'normal' && slot,\n [styles.reverseOrder]: order === 'reverse' && slot,\n [styles[direction]]: true,\n };\n\n return (\n <div\n ref={ ref }\n className={ cn(styles.component, styles[size], { ...addClasses }, className) }\n data-test-id={ getDataTestId('cell-pure', dataTestId, true) }\n { ...props }\n >\n { slot && <div className={ cn(styles.addon, { ...addClasses }) }>{ slot }</div> }\n <div className={ cn(styles.child, { ...addClasses }) }>{ children }</div>\n </div>\n );\n },\n);\n"],"names":["Pure","forwardRef","slot","size","order","direction","children","className","dataTestId","props","ref","addClasses","styles","jsxs","cn","getDataTestId","jsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/cell/pure/component.tsx"],"sourcesContent":["import React, { forwardRef, HTMLAttributes } from 'react';\nimport cn from 'classnames';\n\nimport { getDataTestId } from '../../__internal/utils';\n\nimport styles from './index.module.css';\n\ntype ComponentProps = {\n children?: React.ReactNode;\n /** Слот для иконки */\n slot?: React.ReactNode;\n /** Порядок отображения слота и children */\n order?: 'normal' | 'reverse';\n /** Направление */\n direction?: 'horizontal' | 'vertical';\n /** Размер ячейки */\n size?: 's' | 'm' | 'l';\n /** Компактный режим расположения слота */\n compact?: boolean;\n /** Сss-класс для стилизации контейнера */\n className?: string;\n /** Id компонента для тестов */\n dataTestId?: string;\n};\n\nexport type PureProps = Omit<HTMLAttributes<HTMLDivElement>, 'slot'> & ComponentProps;\n\n/**\n * Ячейка\n *\n * Отвечает за отступы и вертикальное или горизонтальное положение\n */\nexport const Pure = forwardRef<HTMLDivElement, PureProps>(\n (\n {\n slot,\n size = 'm',\n compact = false,\n order = 'normal',\n direction = 'horizontal',\n children,\n className,\n dataTestId,\n ...props\n },\n ref,\n ) => {\n const addClasses = {\n [styles.normalOrder]: order === 'normal' && slot,\n [styles.reverseOrder]: order === 'reverse' && slot,\n [styles[direction]]: true,\n [styles.compact]: compact,\n };\n\n return (\n <div\n ref={ ref }\n className={ cn(styles.component, styles[size], { ...addClasses }, className) }\n data-test-id={ getDataTestId('cell-pure', dataTestId, true) }\n { ...props }\n >\n { slot && <div className={ cn(styles.addon, { ...addClasses }) }>{ slot }</div> }\n <div className={ cn(styles.child, { ...addClasses }) }>{ children }</div>\n </div>\n );\n },\n);\n"],"names":["Pure","forwardRef","slot","size","compact","order","direction","children","className","dataTestId","props","ref","addClasses","styles","jsxs","cn","getDataTestId","jsx"],"mappings":";;;;;AAgCO,MAAMA,IAAOC;AAAA,EAChB,CACI;AAAA,IACI,MAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,SAAAC,IAAU;AAAA,IACV,OAAAC,IAAQ;AAAA,IACR,WAAAC,IAAY;AAAA,IACZ,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAEPC,MACC;AACD,UAAMC,IAAa;AAAA,MACf,CAACC,EAAO,WAAW,GAAGR,MAAU,YAAYH;AAAA,MAC5C,CAACW,EAAO,YAAY,GAAGR,MAAU,aAAaH;AAAA,MAC9C,CAACW,EAAOP,CAAS,CAAC,GAAG;AAAA,MACrB,CAACO,EAAO,OAAO,GAAGT;AAAA,IAAA;AAGtB,WACI,gBAAAU;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,KAAAH;AAAA,QACA,WAAYI,EAAGF,EAAO,WAAWA,EAAOV,CAAI,GAAG,EAAE,GAAGS,EAAA,GAAcJ,CAAS;AAAA,QAC3E,gBAAeQ,EAAc,aAAaP,GAAY,EAAI;AAAA,QACxD,GAAGC;AAAA,QAEH,UAAA;AAAA,UAAAR,KAAQ,gBAAAe,EAAC,OAAA,EAAI,WAAYF,EAAGF,EAAO,OAAO,EAAE,GAAGD,EAAA,CAAY,GAAM,UAAAV,EAAA,CAAM;AAAA,UACzE,gBAAAe,EAAC,OAAA,EAAI,WAAYF,EAAGF,EAAO,OAAO,EAAE,GAAGD,GAAY,GAAM,UAAAL,EAAA,CAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAG/E;AACJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.component_iR2U{display:grid;align-items:center}.component_iR2U.s_GdoG{min-height:48px}.component_iR2U.m_JynK{min-height:56px}.component_iR2U.l_cl-v{min-height:68px}.component_iR2U.horizontal_4AlH{grid-template-rows:0 auto 0}.component_iR2U.horizontal_4AlH.s_GdoG{gap:var(--gap-2xs) var(--gap-xs)}.component_iR2U.horizontal_4AlH.m_JynK{gap:var(--gap-2xs) var(--gap-s)}.component_iR2U.horizontal_4AlH.l_cl-v{gap:var(--gap-s) var(--gap-m)}.horizontal_4AlH.normalOrder_DKaD{grid-template-columns:minmax(40px,min-content) auto}.horizontal_4AlH.reverseOrder_1O-1{grid-template-columns:auto minmax(40px,min-content)}.component_iR2U.horizontal_4AlH:before,.component_iR2U.horizontal_4AlH:after{content:""}.component_iR2U.horizontal_4AlH.normalOrder_DKaD:before,.component_iR2U.horizontal_4AlH.normalOrder_DKaD:after,.component_iR2U.horizontal_4AlH.reverseOrder_1O-1:before,.component_iR2U.horizontal_4AlH.reverseOrder_1O-1:after{grid-column:span 2}.component_iR2U.vertical_qSAh{grid-auto-flow:row;justify-items:center;text-align:center}.component_iR2U.vertical_qSAh.m_JynK,.component_iR2U.vertical_qSAh.l_cl-v{gap:var(--gap-m)}.component_iR2U.vertical_qSAh.s_GdoG{gap:var(--gap-s)}.addon_BlWH{line-height:0}.addon_BlWH.reverseOrder_1O-1{order:2}.child_LJU5.reverseOrder_1O-1{order:1}.addon_BlWH.horizontal_4AlH.reverseOrder_1O-1,.child_LJU5.horizontal_4AlH.reverseOrder_1O-1{grid-row:2/3}
|
|
1
|
+
.component_iR2U{display:grid;align-items:center}.component_iR2U.s_GdoG{min-height:48px}.component_iR2U.m_JynK{min-height:56px}.component_iR2U.l_cl-v{min-height:68px}.component_iR2U.horizontal_4AlH{grid-template-rows:0 auto 0}.component_iR2U.horizontal_4AlH.s_GdoG{gap:var(--gap-2xs) var(--gap-xs)}.component_iR2U.horizontal_4AlH.m_JynK{gap:var(--gap-2xs) var(--gap-s)}.component_iR2U.horizontal_4AlH.l_cl-v{gap:var(--gap-s) var(--gap-m)}.horizontal_4AlH.normalOrder_DKaD{grid-template-columns:minmax(40px,min-content) auto}.horizontal_4AlH.reverseOrder_1O-1{grid-template-columns:auto minmax(40px,min-content)}.component_iR2U.horizontal_4AlH.normalOrder_DKaD.compact_YYtT{grid-template-columns:minmax(28px,min-content) auto}.component_iR2U.horizontal_4AlH.reverseOrder_1O-1.compact_YYtT{grid-template-columns:auto minmax(28px,min-content)}.component_iR2U.horizontal_4AlH:before,.component_iR2U.horizontal_4AlH:after{content:""}.component_iR2U.horizontal_4AlH.normalOrder_DKaD:before,.component_iR2U.horizontal_4AlH.normalOrder_DKaD:after,.component_iR2U.horizontal_4AlH.reverseOrder_1O-1:before,.component_iR2U.horizontal_4AlH.reverseOrder_1O-1:after{grid-column:span 2}.component_iR2U.vertical_qSAh{grid-auto-flow:row;justify-items:center;text-align:center}.component_iR2U.vertical_qSAh.m_JynK,.component_iR2U.vertical_qSAh.l_cl-v{gap:var(--gap-m)}.component_iR2U.vertical_qSAh.s_GdoG{gap:var(--gap-s)}.addon_BlWH{line-height:0}.addon_BlWH.reverseOrder_1O-1{order:2}.child_LJU5.reverseOrder_1O-1{order:1}.child_LJU5{min-width:0}.addon_BlWH.horizontal_4AlH.reverseOrder_1O-1,.child_LJU5.horizontal_4AlH.reverseOrder_1O-1{grid-row:2/3}
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
import './index.module.css';
|
|
2
|
-
const o = "component_iR2U",
|
|
2
|
+
const o = "component_iR2U", c = "s_GdoG", n = "m_JynK", r = "l_cl-v", t = "horizontal_4AlH", e = "normalOrder_DKaD", s = "reverseOrder_1O-1", l = "compact_YYtT", a = "vertical_qSAh", d = "addon_BlWH", m = "child_LJU5", _ = {
|
|
3
3
|
component: o,
|
|
4
|
-
s:
|
|
4
|
+
s: c,
|
|
5
5
|
m: n,
|
|
6
|
-
l:
|
|
6
|
+
l: r,
|
|
7
7
|
horizontal: t,
|
|
8
|
-
normalOrder:
|
|
9
|
-
reverseOrder:
|
|
10
|
-
|
|
8
|
+
normalOrder: e,
|
|
9
|
+
reverseOrder: s,
|
|
10
|
+
compact: l,
|
|
11
|
+
vertical: a,
|
|
11
12
|
addon: d,
|
|
12
|
-
child:
|
|
13
|
+
child: m
|
|
13
14
|
};
|
|
14
15
|
export {
|
|
15
16
|
d as addon,
|
|
16
|
-
|
|
17
|
+
m as child,
|
|
18
|
+
l as compact,
|
|
17
19
|
o as component,
|
|
18
|
-
|
|
20
|
+
_ as default,
|
|
19
21
|
t as horizontal,
|
|
20
|
-
|
|
22
|
+
r as l,
|
|
21
23
|
n as m,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
e as normalOrder,
|
|
25
|
+
s as reverseOrder,
|
|
26
|
+
c as s,
|
|
27
|
+
a as vertical
|
|
26
28
|
};
|
|
27
29
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type FilterTagColor = 'green' | 'orange' | 'red' | 'blue' | 'grey' | 'teal' | 'purple';
|
|
3
|
+
export type FilterTagProps = {
|
|
4
|
+
active?: boolean;
|
|
5
|
+
color?: FilterTagColor;
|
|
6
|
+
count?: number | string;
|
|
7
|
+
className?: string;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
dataTestId?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const FilterTag: React.FC<FilterTagProps>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxs as n, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import c from "classnames";
|
|
3
|
+
import { Badge as p } from "../badge/component.js";
|
|
4
|
+
import e from "./index.module.css.js";
|
|
5
|
+
const u = ({
|
|
6
|
+
active: s = !1,
|
|
7
|
+
color: a = "blue",
|
|
8
|
+
count: t,
|
|
9
|
+
className: l,
|
|
10
|
+
children: m,
|
|
11
|
+
onClick: r,
|
|
12
|
+
dataTestId: i
|
|
13
|
+
}) => /* @__PURE__ */ n(
|
|
14
|
+
"button",
|
|
15
|
+
{
|
|
16
|
+
type: "button",
|
|
17
|
+
"data-test-id": i,
|
|
18
|
+
onClick: r,
|
|
19
|
+
className: c(e.component, e[a], { [e.active]: s }, l),
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ o("span", { className: e.label, children: m }),
|
|
22
|
+
t != null && /* @__PURE__ */ o(
|
|
23
|
+
p,
|
|
24
|
+
{
|
|
25
|
+
view: "count",
|
|
26
|
+
color: "secondary",
|
|
27
|
+
size: "m",
|
|
28
|
+
className: e.badge,
|
|
29
|
+
content: t
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
export {
|
|
36
|
+
u as FilterTag
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/filter-tag/component.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { Badge } from '../badge';\n\nimport styles from './index.module.css';\n\nexport type FilterTagColor = 'green' | 'orange' | 'red' | 'blue' | 'grey' | 'teal' | 'purple';\n\nexport type FilterTagProps = {\n active?: boolean;\n color?: FilterTagColor;\n count?: number | string;\n className?: string;\n children: React.ReactNode;\n onClick?: () => void;\n dataTestId?: string;\n};\n\nexport const FilterTag: React.FC<FilterTagProps> = ({\n active = false,\n color = 'blue',\n count,\n className,\n children,\n onClick,\n dataTestId,\n}) => (\n <button\n type=\"button\"\n data-test-id={ dataTestId }\n onClick={ onClick }\n className={ cn(styles.component, styles[color], { [styles.active]: active }, className) }\n >\n <span className={ styles.label }>{ children }</span>\n\n { count !== undefined && count !== null && (\n <Badge\n view=\"count\"\n color=\"secondary\"\n size=\"m\"\n className={ styles.badge }\n content={ count }\n />\n ) }\n </button>\n);\n"],"names":["FilterTag","active","color","count","className","children","onClick","dataTestId","jsxs","cn","styles","jsx","Badge"],"mappings":";;;;AAmBO,MAAMA,IAAsC,CAAC;AAAA,EAChD,QAAAC,IAAS;AAAA,EACT,OAAAC,IAAQ;AAAA,EACR,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC;AACJ,MACI,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,MAAK;AAAA,IACL,gBAAeD;AAAA,IACf,SAAAD;AAAA,IACA,WAAYG,EAAGC,EAAO,WAAWA,EAAOR,CAAK,GAAG,EAAE,CAACQ,EAAO,MAAM,GAAGT,EAAA,GAAUG,CAAS;AAAA,IAEtF,UAAA;AAAA,MAAA,gBAAAO,EAAC,QAAA,EAAK,WAAYD,EAAO,OAAU,UAAAL,GAAU;AAAA,MAEpBF,KAAU,QAC/B,gBAAAQ;AAAA,QAACC;AAAA,QAAA;AAAA,UACG,MAAK;AAAA,UACL,OAAM;AAAA,UACN,MAAK;AAAA,UACL,WAAYF,EAAO;AAAA,UACnB,SAAUP;AAAA,QAAA;AAAA,MAAA;AAAA,IACd;AAAA,EAAA;AAER;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './component';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|