@alphakits/ui 2.0.6 → 2.0.7
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/sidepanel/component.d.ts +1 -0
- package/dist/sidepanel/component.js +22 -20
- package/dist/sidepanel/component.js.map +1 -1
- package/dist/sidepanel-header/component.d.ts +1 -0
- package/dist/sidepanel-header/component.js +9 -8
- package/dist/sidepanel-header/component.js.map +1 -1
- package/dist/sidepanel-header/index.module.css +1 -1
- package/package.json +1 -1
|
@@ -1,41 +1,43 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { FlexColumns as
|
|
5
|
-
import { SidepanelHeader as
|
|
6
|
-
import { Skeleton as
|
|
1
|
+
import { jsx as e, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import N from "react";
|
|
3
|
+
import x from "classnames";
|
|
4
|
+
import { FlexColumns as S } from "../flex-columns/component.js";
|
|
5
|
+
import { SidepanelHeader as g } from "../sidepanel-header/component.js";
|
|
6
|
+
import { Skeleton as y } from "../skeleton/component.js";
|
|
7
7
|
import r from "./index.module.css.js";
|
|
8
|
-
const
|
|
8
|
+
const R = ({
|
|
9
9
|
dataTestId: i,
|
|
10
10
|
title: m,
|
|
11
11
|
loading: t,
|
|
12
12
|
headerRightAddons: a,
|
|
13
13
|
subtitle: l,
|
|
14
14
|
noCloser: s,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
showCloser: n,
|
|
16
|
+
headerBottomAddons: c,
|
|
17
|
+
noStickyFooter: d,
|
|
18
|
+
noStickyHeader: p,
|
|
18
19
|
bottomAddons: o,
|
|
19
|
-
children:
|
|
20
|
-
...
|
|
21
|
-
}) => /* @__PURE__ */ e(
|
|
20
|
+
children: f,
|
|
21
|
+
...h
|
|
22
|
+
}) => /* @__PURE__ */ e(N.Fragment, { children: t ? /* @__PURE__ */ e(S, { className: r.loader, columns: 1, gr: 20, children: new Array(7).fill("").map((j, u) => /* @__PURE__ */ e(y, { animate: !0, visible: !0, className: r.input }, u)) }) : /* @__PURE__ */ v("div", { children: [
|
|
22
23
|
/* @__PURE__ */ e(
|
|
23
|
-
|
|
24
|
+
g,
|
|
24
25
|
{
|
|
25
26
|
title: m,
|
|
26
|
-
className:
|
|
27
|
+
className: p ? void 0 : r.header,
|
|
27
28
|
subtitle: l,
|
|
28
29
|
noCloser: s,
|
|
30
|
+
showCloser: n,
|
|
29
31
|
dataTestId: i,
|
|
30
32
|
rightAddons: a,
|
|
31
|
-
bottomAddons:
|
|
32
|
-
...
|
|
33
|
+
bottomAddons: c,
|
|
34
|
+
...h
|
|
33
35
|
}
|
|
34
36
|
),
|
|
35
|
-
/* @__PURE__ */ e("div", { className: r.content, children:
|
|
36
|
-
o && /* @__PURE__ */ e("div", { className:
|
|
37
|
+
/* @__PURE__ */ e("div", { className: r.content, children: f }),
|
|
38
|
+
o && /* @__PURE__ */ e("div", { className: x(r.footer, { [r.noSticky]: d }), children: o })
|
|
37
39
|
] }) });
|
|
38
40
|
export {
|
|
39
|
-
|
|
41
|
+
R as Sidepanel
|
|
40
42
|
};
|
|
41
43
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/sidepanel/component.tsx"],"sourcesContent":["/* eslint-disable react/no-array-index-key */\nimport React from 'react';\nimport classNames from 'classnames';\n\nimport { FlexColumns } from '../flex-columns';\nimport { TFunction } from '../modal';\nimport { SidepanelHeader } from '../sidepanel-header';\nimport { Skeleton } from '../skeleton';\n\nimport styles from './index.module.css';\n\ntype Back = {\n back?: () => void;\n t: TFunction;\n} | {\n back?: never;\n t?: never;\n};\n\nexport type SidepanelProps = {\n title?: string;\n loading?: boolean;\n subtitle?: string;\n headerRightAddons?: React.ReactNode;\n headerBottomAddons?: React.ReactNode;\n bottomAddons?: React.ReactNode;\n dataTestId?: string;\n noCloser?: boolean;\n noStickyFooter?: boolean;\n noStickyHeader?: boolean;\n} & Back;\n\nexport const Sidepanel: React.FC<SidepanelProps> = ({\n dataTestId,\n title,\n loading,\n headerRightAddons,\n subtitle,\n noCloser,\n headerBottomAddons,\n noStickyFooter,\n noStickyHeader,\n bottomAddons,\n children,\n ...props\n}) => (\n <React.Fragment>\n { loading ? (\n <FlexColumns className={ styles.loader } columns={ 1 } gr={ 20 }>\n { new Array(7).fill('').map((_, i) => (\n <Skeleton key={ i } animate={ true } visible={ true } className={ styles.input } />\n )) }\n </FlexColumns>\n ) : (\n <div>\n <SidepanelHeader\n title={ title }\n className={ noStickyHeader ? undefined : styles.header }\n subtitle={ subtitle }\n noCloser={ noCloser }\n dataTestId={ dataTestId }\n rightAddons={ headerRightAddons }\n bottomAddons={ headerBottomAddons }\n { ...props }\n />\n\n <div className={ styles.content }>\n { children }\n </div>\n\n { bottomAddons && (\n <div className={ classNames(styles.footer, { [styles.noSticky]: noStickyFooter }) }>\n { bottomAddons }\n </div>\n ) }\n </div>\n ) }\n </React.Fragment>\n);\n"],"names":["Sidepanel","dataTestId","title","loading","headerRightAddons","subtitle","noCloser","headerBottomAddons","noStickyFooter","noStickyHeader","bottomAddons","children","props","React","FlexColumns","styles","_","i","jsx","Skeleton","SidepanelHeader","classNames"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/sidepanel/component.tsx"],"sourcesContent":["/* eslint-disable react/no-array-index-key */\nimport React from 'react';\nimport classNames from 'classnames';\n\nimport { FlexColumns } from '../flex-columns';\nimport { TFunction } from '../modal';\nimport { SidepanelHeader } from '../sidepanel-header';\nimport { Skeleton } from '../skeleton';\n\nimport styles from './index.module.css';\n\ntype Back = {\n back?: () => void;\n t: TFunction;\n} | {\n back?: never;\n t?: never;\n};\n\nexport type SidepanelProps = {\n title?: string;\n loading?: boolean;\n subtitle?: string;\n headerRightAddons?: React.ReactNode;\n headerBottomAddons?: React.ReactNode;\n bottomAddons?: React.ReactNode;\n dataTestId?: string;\n noCloser?: boolean;\n showCloser?: boolean;\n noStickyFooter?: boolean;\n noStickyHeader?: boolean;\n} & Back;\n\nexport const Sidepanel: React.FC<SidepanelProps> = ({\n dataTestId,\n title,\n loading,\n headerRightAddons,\n subtitle,\n noCloser,\n showCloser,\n headerBottomAddons,\n noStickyFooter,\n noStickyHeader,\n bottomAddons,\n children,\n ...props\n}) => (\n <React.Fragment>\n { loading ? (\n <FlexColumns className={ styles.loader } columns={ 1 } gr={ 20 }>\n { new Array(7).fill('').map((_, i) => (\n <Skeleton key={ i } animate={ true } visible={ true } className={ styles.input } />\n )) }\n </FlexColumns>\n ) : (\n <div>\n <SidepanelHeader\n title={ title }\n className={ noStickyHeader ? undefined : styles.header }\n subtitle={ subtitle }\n noCloser={ noCloser }\n showCloser={ showCloser }\n dataTestId={ dataTestId }\n rightAddons={ headerRightAddons }\n bottomAddons={ headerBottomAddons }\n { ...props }\n />\n\n <div className={ styles.content }>\n { children }\n </div>\n\n { bottomAddons && (\n <div className={ classNames(styles.footer, { [styles.noSticky]: noStickyFooter }) }>\n { bottomAddons }\n </div>\n ) }\n </div>\n ) }\n </React.Fragment>\n);\n"],"names":["Sidepanel","dataTestId","title","loading","headerRightAddons","subtitle","noCloser","showCloser","headerBottomAddons","noStickyFooter","noStickyHeader","bottomAddons","children","props","React","FlexColumns","styles","_","i","jsx","Skeleton","SidepanelHeader","classNames"],"mappings":";;;;;;;AAiCO,MAAMA,IAAsC,CAAC;AAAA,EAChD,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACP,wBACKC,EAAM,UAAN,EACK,UAAAX,sBACGY,GAAA,EAAY,WAAYC,EAAO,QAAS,SAAU,GAAI,IAAK,IACtD,UAAA,IAAI,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,CAACC,GAAGC,MAC5B,gBAAAC,EAACC,GAAA,EAAmB,SAAU,IAAO,SAAU,IAAO,WAAYJ,EAAO,MAAA,GAAzDE,CAAiE,CACpF,EAAA,CACL,sBAEC,OAAA,EACG,UAAA;AAAA,EAAA,gBAAAC;AAAA,IAACE;AAAA,IAAA;AAAA,MACG,OAAAnB;AAAA,MACA,WAAYQ,IAAiB,SAAYM,EAAO;AAAA,MAChD,UAAAX;AAAA,MACA,UAAAC;AAAA,MACA,YAAAC;AAAA,MACA,YAAAN;AAAA,MACA,aAAcG;AAAA,MACd,cAAeI;AAAA,MACb,GAAGK;AAAA,IAAA;AAAA,EAAA;AAAA,EAGT,gBAAAM,EAAC,OAAA,EAAI,WAAYH,EAAO,SAClB,UAAAJ,GACN;AAAA,EAEED,KACE,gBAAAQ,EAAC,OAAA,EAAI,WAAYG,EAAWN,EAAO,QAAQ,EAAE,CAACA,EAAO,QAAQ,GAAGP,EAAA,CAAgB,GAC1E,UAAAE,EAAA,CACN;AAAA,EAAA,CAER,EAAA,CAER;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import p from "classnames";
|
|
3
|
-
import { BackButton as
|
|
4
|
-
import { FlexColumns as
|
|
3
|
+
import { BackButton as g } from "../back-button/component.js";
|
|
4
|
+
import { FlexColumns as w } from "../flex-columns/component.js";
|
|
5
5
|
import { Typography as t } from "../typography/component.js";
|
|
6
6
|
import e from "./index.module.css.js";
|
|
7
|
-
const h = ({ title: m, subtitle: l }) => /* @__PURE__ */ a(
|
|
7
|
+
const h = ({ title: m, subtitle: l }) => /* @__PURE__ */ a(w, { columns: 1, gr: 4, className: e.title, children: [
|
|
8
8
|
/* @__PURE__ */ r(t.Title, { color: "primary", tag: "div", view: "small", weight: "bold", children: m }),
|
|
9
9
|
l && /* @__PURE__ */ r(t.Text, { view: "title", weight: "regular", color: "secondary", children: l })
|
|
10
|
-
] }),
|
|
10
|
+
] }), u = ({
|
|
11
11
|
className: m,
|
|
12
12
|
dataTestId: l,
|
|
13
13
|
title: o,
|
|
@@ -16,7 +16,8 @@ const h = ({ title: m, subtitle: l }) => /* @__PURE__ */ a(g, { columns: 1, gr:
|
|
|
16
16
|
subtitle: c,
|
|
17
17
|
t: d,
|
|
18
18
|
bottomAddons: n,
|
|
19
|
-
noCloser:
|
|
19
|
+
noCloser: f,
|
|
20
|
+
showCloser: v
|
|
20
21
|
}) => /* @__PURE__ */ a(
|
|
21
22
|
"div",
|
|
22
23
|
{
|
|
@@ -24,9 +25,9 @@ const h = ({ title: m, subtitle: l }) => /* @__PURE__ */ a(g, { columns: 1, gr:
|
|
|
24
25
|
className: p(e.wrapper, m),
|
|
25
26
|
children: [
|
|
26
27
|
(i || o || s) && /* @__PURE__ */ a("div", { className: e.heading, children: [
|
|
27
|
-
i && d && /* @__PURE__ */ r(
|
|
28
|
+
i && d && /* @__PURE__ */ r(g, { onClick: i, t: d }),
|
|
28
29
|
!i && o && /* @__PURE__ */ r(h, { title: o, subtitle: c }),
|
|
29
|
-
s && /* @__PURE__ */ r("div", { className: p(e.rightAddons, { [e.noCloser]: !!v }), children: s })
|
|
30
|
+
s && /* @__PURE__ */ r("div", { className: p(e.rightAddons, { [e.noCloser]: !!f || v === !1 }), children: s })
|
|
30
31
|
] }),
|
|
31
32
|
!!i && o && /* @__PURE__ */ r(h, { title: o, subtitle: c }),
|
|
32
33
|
!!n && /* @__PURE__ */ r("div", { className: e.bottomAddons, children: n })
|
|
@@ -34,6 +35,6 @@ const h = ({ title: m, subtitle: l }) => /* @__PURE__ */ a(g, { columns: 1, gr:
|
|
|
34
35
|
}
|
|
35
36
|
);
|
|
36
37
|
export {
|
|
37
|
-
|
|
38
|
+
u as SidepanelHeader
|
|
38
39
|
};
|
|
39
40
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/sidepanel-header/component.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { BackButton } from '../back-button';\nimport { FlexColumns } from '../flex-columns';\nimport { TFunction } from '../modal';\nimport { Typography } from '../typography';\n\nimport styles from './index.module.css';\n\ntype Back = {\n back?: () => void;\n t: TFunction;\n} | {\n back?: never;\n t?: never;\n};\n\nexport type SidepanelHeaderProps = {\n /**\n * Кастомный класс\n */\n className?: string;\n\n /**\n * title\n */\n title?: string;\n\n /**\n * rightAddons - слот слева\n */\n rightAddons?: React.ReactNode;\n\n /**\n * bottomAddons - слот внизу\n */\n bottomAddons?: React.ReactNode;\n\n /**\n * Id компонента для тестов\n */\n noCloser?: boolean;\n dataTestId?: string;\n\n subtitle?: string;\n} & Back;\n\nconst Title = ({ title, subtitle }: {title: string; subtitle?: string}) => (\n <FlexColumns columns={ 1 } gr={ 4 } className={ styles.title }>\n\n <Typography.Title color=\"primary\" tag=\"div\" view=\"small\" weight=\"bold\">\n { title }\n </Typography.Title>\n\n { subtitle && (\n <Typography.Text view=\"title\" weight=\"regular\" color=\"secondary\">\n { subtitle }\n </Typography.Text>\n ) }\n\n </FlexColumns>\n);\n\nexport const SidepanelHeader: React.FC<SidepanelHeaderProps> = ({\n className,\n dataTestId,\n title,\n rightAddons,\n back,\n subtitle,\n t,\n bottomAddons,\n noCloser,\n}) => (\n <div\n data-test-id={ dataTestId }\n className={ cn(styles.wrapper, className) }\n >\n { (back || title || rightAddons) && (\n <div className={ styles.heading }>\n { back && t && (\n <BackButton onClick={ back } t={ t } />\n ) }\n\n { !back && title && (\n <Title title={ title } subtitle={ subtitle } />\n ) }\n\n { rightAddons && <div className={ cn(styles.rightAddons, { [styles.noCloser]: !!noCloser }) }>{ rightAddons }</div> }\n </div>\n ) }\n\n { !!back && title && (\n <Title title={ title } subtitle={ subtitle } />\n ) }\n\n { !!bottomAddons && <div className={ styles.bottomAddons }>{ bottomAddons }</div> }\n\n </div>\n);\n"],"names":["Title","title","subtitle","jsxs","FlexColumns","styles","jsx","Typography","SidepanelHeader","className","dataTestId","rightAddons","back","t","bottomAddons","noCloser","cn","BackButton"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/sidepanel-header/component.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { BackButton } from '../back-button';\nimport { FlexColumns } from '../flex-columns';\nimport { TFunction } from '../modal';\nimport { Typography } from '../typography';\n\nimport styles from './index.module.css';\n\ntype Back = {\n back?: () => void;\n t: TFunction;\n} | {\n back?: never;\n t?: never;\n};\n\nexport type SidepanelHeaderProps = {\n /**\n * Кастомный класс\n */\n className?: string;\n\n /**\n * title\n */\n title?: string;\n\n /**\n * rightAddons - слот слева\n */\n rightAddons?: React.ReactNode;\n\n /**\n * bottomAddons - слот внизу\n */\n bottomAddons?: React.ReactNode;\n\n /**\n * Id компонента для тестов\n */\n noCloser?: boolean;\n showCloser?: boolean;\n dataTestId?: string;\n\n subtitle?: string;\n} & Back;\n\nconst Title = ({ title, subtitle }: {title: string; subtitle?: string}) => (\n <FlexColumns columns={ 1 } gr={ 4 } className={ styles.title }>\n\n <Typography.Title color=\"primary\" tag=\"div\" view=\"small\" weight=\"bold\">\n { title }\n </Typography.Title>\n\n { subtitle && (\n <Typography.Text view=\"title\" weight=\"regular\" color=\"secondary\">\n { subtitle }\n </Typography.Text>\n ) }\n\n </FlexColumns>\n);\n\nexport const SidepanelHeader: React.FC<SidepanelHeaderProps> = ({\n className,\n dataTestId,\n title,\n rightAddons,\n back,\n subtitle,\n t,\n bottomAddons,\n noCloser,\n showCloser,\n}) => (\n <div\n data-test-id={ dataTestId }\n className={ cn(styles.wrapper, className) }\n >\n { (back || title || rightAddons) && (\n <div className={ styles.heading }>\n { back && t && (\n <BackButton onClick={ back } t={ t } />\n ) }\n\n { !back && title && (\n <Title title={ title } subtitle={ subtitle } />\n ) }\n\n { rightAddons && <div className={ cn(styles.rightAddons, { [styles.noCloser]: !!noCloser || showCloser === false }) }>{ rightAddons }</div> }\n </div>\n ) }\n\n { !!back && title && (\n <Title title={ title } subtitle={ subtitle } />\n ) }\n\n { !!bottomAddons && <div className={ styles.bottomAddons }>{ bottomAddons }</div> }\n\n </div>\n);\n"],"names":["Title","title","subtitle","jsxs","FlexColumns","styles","jsx","Typography","SidepanelHeader","className","dataTestId","rightAddons","back","t","bottomAddons","noCloser","showCloser","cn","BackButton"],"mappings":";;;;;;AAiDA,MAAMA,IAAQ,CAAC,EAAE,OAAAC,GAAO,UAAAC,QACpB,gBAAAC,EAACC,GAAA,EAAY,SAAU,GAAI,IAAK,GAAI,WAAYC,EAAO,OAEnD,UAAA;AAAA,EAAA,gBAAAC,EAACC,EAAW,OAAX,EAAiB,OAAM,WAAU,KAAI,OAAM,MAAK,SAAQ,QAAO,QAC1D,UAAAN,EAAA,CACN;AAAA,EAEEC,KACE,gBAAAI,EAACC,EAAW,MAAX,EAAgB,MAAK,SAAQ,QAAO,WAAU,OAAM,aAC/C,UAAAL,EAAA,CACN;AAAA,GAGR,GAGSM,IAAkD,CAAC;AAAA,EAC5D,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAT;AAAA,EACA,aAAAU;AAAA,EACA,MAAAC;AAAA,EACA,UAAAV;AAAA,EACA,GAAAW;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACJ,MACI,gBAAAb;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,gBAAeO;AAAA,IACf,WAAYO,EAAGZ,EAAO,SAASI,CAAS;AAAA,IAErC,UAAA;AAAA,OAAAG,KAAQX,KAASU,MAChB,gBAAAR,EAAC,OAAA,EAAI,WAAYE,EAAO,SAClB,UAAA;AAAA,QAAAO,KAAQC,KACN,gBAAAP,EAACY,GAAA,EAAW,SAAUN,GAAO,GAAAC,GAAQ;AAAA,QAGvC,CAACD,KAAQX,KACP,gBAAAK,EAACN,GAAA,EAAM,OAAAC,GAAgB,UAAAC,GAAsB;AAAA,QAG/CS,KAAe,gBAAAL,EAAC,OAAA,EAAI,WAAYW,EAAGZ,EAAO,aAAa,EAAE,CAACA,EAAO,QAAQ,GAAG,CAAC,CAACU,KAAYC,MAAe,IAAO,GAAM,UAAAL,EAAA,CAAa;AAAA,MAAA,GACzI;AAAA,MAGF,CAAC,CAACC,KAAQX,KACR,gBAAAK,EAACN,GAAA,EAAM,OAAAC,GAAgB,UAAAC,GAAsB;AAAA,MAG/C,CAAC,CAACY,KAAgB,gBAAAR,EAAC,SAAI,WAAYD,EAAO,cAAiB,UAAAS,EAAA,CAAc;AAAA,IAAA;AAAA,EAAA;AAE/E;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.wrapper_QxqD{padding:28px 32px 12px;background-color:var(--color-bg-primary);box-sizing:border-box}.heading_XGDy{display:flex;justify-content:space-between;min-height:48px}.title_jwxc,.bottomAddons_3yzd{padding-bottom:8px;padding-top:8px}.rightAddons_aZFa{margin-right:48px;height:48px;display:flex;align-items:center}.noCloser_O7u0{margin-right:0}@media(max-width:823px){.wrapper_QxqD{padding:16px 16px 12px!important}}
|
|
1
|
+
.wrapper_QxqD{padding:28px 32px 12px;background-color:var(--color-bg-primary);box-sizing:border-box}.heading_XGDy{display:flex;justify-content:space-between;min-height:48px}.title_jwxc,.bottomAddons_3yzd{padding-bottom:8px;padding-top:8px}.rightAddons_aZFa{margin-right:48px;height:48px;display:flex;align-items:center}.noCloser_O7u0{margin-right:0!important}@media(max-width:823px){.wrapper_QxqD{padding:16px 16px 12px!important}}
|