@dnanpm/ui-components 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Breadcrumb/Breadcrumb.css +9 -9
- package/dist/components/Breadcrumb/Breadcrumb.module.css.cjs +6 -6
- package/dist/components/Breadcrumb/Breadcrumb.module.css.js +6 -6
- package/dist/components/Button/Button.css +32 -30
- package/dist/components/Button/Button.module.css.cjs +11 -11
- package/dist/components/Button/Button.module.css.js +11 -11
- package/dist/components/ButtonCard/ButtonCard.cjs +105 -0
- package/dist/components/ButtonCard/ButtonCard.cjs.map +1 -0
- package/dist/components/ButtonCard/ButtonCard.css +167 -0
- package/dist/components/ButtonCard/ButtonCard.d.ts +3 -0
- package/dist/components/ButtonCard/ButtonCard.d.ts.map +1 -0
- package/dist/components/ButtonCard/ButtonCard.js +105 -0
- package/dist/components/ButtonCard/ButtonCard.js.map +1 -0
- package/dist/components/ButtonCard/ButtonCard.module.css.cjs +18 -0
- package/dist/components/ButtonCard/ButtonCard.module.css.cjs.map +1 -0
- package/dist/components/ButtonCard/ButtonCard.module.css.js +19 -0
- package/dist/components/ButtonCard/ButtonCard.module.css.js.map +1 -0
- package/dist/components/ButtonCard/ButtonCard.types.d.ts +103 -0
- package/dist/components/ButtonCard/ButtonCard.types.d.ts.map +1 -0
- package/dist/components/ButtonCard/index.d.ts +3 -0
- package/dist/components/ButtonCard/index.d.ts.map +1 -0
- package/dist/components/Drawer/Drawer.cjs +101 -0
- package/dist/components/Drawer/Drawer.cjs.map +1 -0
- package/dist/components/Drawer/Drawer.css +219 -0
- package/dist/components/Drawer/Drawer.d.ts +3 -0
- package/dist/components/Drawer/Drawer.d.ts.map +1 -0
- package/dist/components/Drawer/Drawer.js +101 -0
- package/dist/components/Drawer/Drawer.js.map +1 -0
- package/dist/components/Drawer/Drawer.module.css.cjs +37 -0
- package/dist/components/Drawer/Drawer.module.css.cjs.map +1 -0
- package/dist/components/Drawer/Drawer.module.css.js +37 -0
- package/dist/components/Drawer/Drawer.module.css.js.map +1 -0
- package/dist/components/Drawer/Drawer.types.d.ts +63 -0
- package/dist/components/Drawer/Drawer.types.d.ts.map +1 -0
- package/dist/components/Drawer/index.d.ts +3 -0
- package/dist/components/Drawer/index.d.ts.map +1 -0
- package/dist/components/Footer/Footer.css +81 -74
- package/dist/components/Footer/Footer.module.css.cjs +39 -39
- package/dist/components/Footer/Footer.module.css.js +39 -39
- package/dist/components/FunctionButton/FunctionButton.cjs +34 -0
- package/dist/components/FunctionButton/FunctionButton.cjs.map +1 -0
- package/dist/components/FunctionButton/FunctionButton.css +125 -0
- package/dist/components/FunctionButton/FunctionButton.d.ts +3 -0
- package/dist/components/FunctionButton/FunctionButton.d.ts.map +1 -0
- package/dist/components/FunctionButton/FunctionButton.js +34 -0
- package/dist/components/FunctionButton/FunctionButton.js.map +1 -0
- package/dist/components/FunctionButton/FunctionButton.module.css.cjs +11 -0
- package/dist/components/FunctionButton/FunctionButton.module.css.cjs.map +1 -0
- package/dist/components/FunctionButton/FunctionButton.module.css.js +12 -0
- package/dist/components/FunctionButton/FunctionButton.module.css.js.map +1 -0
- package/dist/components/FunctionButton/FunctionButton.types.d.ts +21 -0
- package/dist/components/FunctionButton/FunctionButton.types.d.ts.map +1 -0
- package/dist/components/FunctionButton/index.d.ts +3 -0
- package/dist/components/FunctionButton/index.d.ts.map +1 -0
- package/dist/components/IconButton/IconButton.css +31 -32
- package/dist/components/IconButton/IconButton.module.css.cjs +9 -9
- package/dist/components/IconButton/IconButton.module.css.js +9 -9
- package/dist/components/MainNavigation/MainNavigation.cjs +10 -26
- package/dist/components/MainNavigation/MainNavigation.cjs.map +1 -1
- package/dist/components/MainNavigation/MainNavigation.css +158 -156
- package/dist/components/MainNavigation/MainNavigation.d.ts.map +1 -1
- package/dist/components/MainNavigation/MainNavigation.js +10 -26
- package/dist/components/MainNavigation/MainNavigation.js.map +1 -1
- package/dist/components/MainNavigation/MainNavigation.module.css.cjs +68 -68
- package/dist/components/MainNavigation/MainNavigation.module.css.js +68 -68
- package/dist/components/Modal/Modal.cjs +101 -0
- package/dist/components/Modal/Modal.cjs.map +1 -0
- package/dist/components/Modal/Modal.css +205 -0
- package/dist/components/Modal/Modal.d.ts +3 -0
- package/dist/components/Modal/Modal.d.ts.map +1 -0
- package/dist/components/Modal/Modal.js +101 -0
- package/dist/components/Modal/Modal.js.map +1 -0
- package/dist/components/Modal/Modal.module.css.cjs +39 -0
- package/dist/components/Modal/Modal.module.css.cjs.map +1 -0
- package/dist/components/Modal/Modal.module.css.js +39 -0
- package/dist/components/Modal/Modal.module.css.js.map +1 -0
- package/dist/components/Modal/Modal.types.d.ts +62 -0
- package/dist/components/Modal/Modal.types.d.ts.map +1 -0
- package/dist/components/Modal/index.d.ts +3 -0
- package/dist/components/Modal/index.d.ts.map +1 -0
- package/dist/components/Modal/useDialogDismissal.cjs +41 -0
- package/dist/components/Modal/useDialogDismissal.cjs.map +1 -0
- package/dist/components/Modal/useDialogDismissal.d.ts +17 -0
- package/dist/components/Modal/useDialogDismissal.d.ts.map +1 -0
- package/dist/components/Modal/useDialogDismissal.js +41 -0
- package/dist/components/Modal/useDialogDismissal.js.map +1 -0
- package/dist/components/Modal/useNativeDialog.cjs +126 -0
- package/dist/components/Modal/useNativeDialog.cjs.map +1 -0
- package/dist/components/Modal/useNativeDialog.d.ts +14 -0
- package/dist/components/Modal/useNativeDialog.d.ts.map +1 -0
- package/dist/components/Modal/useNativeDialog.js +126 -0
- package/dist/components/Modal/useNativeDialog.js.map +1 -0
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/styles/utils/elevation.module.css.cjs +3 -0
- package/dist/styles/utils/elevation.module.css.cjs.map +1 -1
- package/dist/styles/utils/elevation.module.css.js +4 -1
- package/dist/styles/utils/elevation.module.css.js.map +1 -1
- package/dist/styles/utils/focus.css +21 -22
- package/dist/styles/utils/focus.module.css.cjs +3 -6
- package/dist/styles/utils/focus.module.css.cjs.map +1 -1
- package/dist/styles/utils/focus.module.css.js +4 -7
- package/dist/styles/utils/focus.module.css.js.map +1 -1
- package/dist/styles/utils/text-decoration.css +3 -2
- package/dist/styles/utils/text-decoration.module.css.cjs +2 -2
- package/dist/styles/utils/text-decoration.module.css.js +2 -2
- package/package.json +3 -3
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { Close } from "@dnanpm/icons";
|
|
4
|
+
import elevationStyles from "../../styles/utils/elevation.module.css.js";
|
|
5
|
+
import focusStyles from "../../styles/utils/focus.module.css.js";
|
|
6
|
+
import { useDialogDismissal } from "../Modal/useDialogDismissal.js";
|
|
7
|
+
import { useNativeDialog } from "../Modal/useNativeDialog.js";
|
|
8
|
+
import styles from "./Drawer.module.css.js";
|
|
9
|
+
import { cn } from "../../utils/cn/cn.js";
|
|
10
|
+
const Drawer = ({
|
|
11
|
+
open,
|
|
12
|
+
onOpenChange,
|
|
13
|
+
title,
|
|
14
|
+
description,
|
|
15
|
+
children,
|
|
16
|
+
footer,
|
|
17
|
+
size = "small",
|
|
18
|
+
headerStyle = "light",
|
|
19
|
+
side = "right",
|
|
20
|
+
fixedTitle = false,
|
|
21
|
+
disableCloseOptions = false,
|
|
22
|
+
closeLabel = "Sulje dialogi",
|
|
23
|
+
keepMounted = false,
|
|
24
|
+
className,
|
|
25
|
+
ref,
|
|
26
|
+
onKeyDown,
|
|
27
|
+
onClick,
|
|
28
|
+
onPointerDown,
|
|
29
|
+
"aria-label": ariaLabel,
|
|
30
|
+
"aria-labelledby": ariaLabelledBy,
|
|
31
|
+
"aria-describedby": ariaDescribedBy,
|
|
32
|
+
...props
|
|
33
|
+
}) => {
|
|
34
|
+
const titleId = useId();
|
|
35
|
+
const descriptionId = useId();
|
|
36
|
+
const { dialogRef, close, phase, isPresent } = useNativeDialog({
|
|
37
|
+
open: open ?? false,
|
|
38
|
+
keepMounted,
|
|
39
|
+
onOpenChange
|
|
40
|
+
});
|
|
41
|
+
const describedBy = [description ? descriptionId : void 0, ariaDescribedBy].filter(Boolean).join(" ") || void 0;
|
|
42
|
+
const dialogDismissalProps = useDialogDismissal({
|
|
43
|
+
close,
|
|
44
|
+
disableCloseOptions,
|
|
45
|
+
onClick,
|
|
46
|
+
onKeyDown,
|
|
47
|
+
onPointerDown
|
|
48
|
+
});
|
|
49
|
+
if (!isPresent) return null;
|
|
50
|
+
return /* @__PURE__ */ jsxs(
|
|
51
|
+
"dialog",
|
|
52
|
+
{
|
|
53
|
+
...props,
|
|
54
|
+
ref: (node) => {
|
|
55
|
+
dialogRef.current = node;
|
|
56
|
+
if (typeof ref === "function") ref(node);
|
|
57
|
+
else if (ref) ref.current = node;
|
|
58
|
+
},
|
|
59
|
+
className: cn(
|
|
60
|
+
styles.drawer,
|
|
61
|
+
elevationStyles.elevationHigh,
|
|
62
|
+
styles[`drawer--${size}`],
|
|
63
|
+
styles[`drawer--${headerStyle}`],
|
|
64
|
+
styles[`drawer--${side}`],
|
|
65
|
+
{ [styles["drawer--fixed-title"]]: fixedTitle },
|
|
66
|
+
{ [styles["drawer--opening"]]: phase !== "closing" },
|
|
67
|
+
{ [styles["drawer--closing"]]: phase === "closing" },
|
|
68
|
+
className
|
|
69
|
+
),
|
|
70
|
+
"aria-label": ariaLabel,
|
|
71
|
+
"aria-labelledby": ariaLabelledBy ?? (!ariaLabel && title ? titleId : void 0),
|
|
72
|
+
"aria-describedby": describedBy,
|
|
73
|
+
...dialogDismissalProps,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ jsxs("div", { className: styles.drawer__container, children: [
|
|
76
|
+
!disableCloseOptions && /* @__PURE__ */ jsx(
|
|
77
|
+
"button",
|
|
78
|
+
{
|
|
79
|
+
type: "button",
|
|
80
|
+
className: cn(styles.drawer__close, focusStyles.focusable),
|
|
81
|
+
"aria-label": closeLabel,
|
|
82
|
+
"data-dialog-autofocus": "true",
|
|
83
|
+
onClick: close,
|
|
84
|
+
children: /* @__PURE__ */ jsx(Close, { "aria-hidden": "true" })
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
(title || description) && /* @__PURE__ */ jsxs("div", { className: styles.drawer__title, children: [
|
|
88
|
+
title && /* @__PURE__ */ jsx("h2", { id: titleId, className: styles.drawer__heading, children: title }),
|
|
89
|
+
description && /* @__PURE__ */ jsx("div", { id: descriptionId, className: styles.drawer__description, children: description })
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ jsx("div", { className: styles.drawer__content, children })
|
|
92
|
+
] }),
|
|
93
|
+
footer && /* @__PURE__ */ jsx("div", { className: cn(styles["drawer__bottom-bar"], elevationStyles.elevationMedium), children: footer })
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
export {
|
|
99
|
+
Drawer
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=Drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Drawer.js","sources":["../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import { useId } from 'react';\nimport { Close } from '@dnanpm/icons';\nimport { cn } from '../../utils/cn';\nimport elevationStyles from '../../styles/utils/elevation.module.css';\nimport focusStyles from '../../styles/utils/focus.module.css';\nimport { useDialogDismissal } from '../Modal/useDialogDismissal';\nimport { useNativeDialog } from '../Modal/useNativeDialog';\nimport styles from './Drawer.module.css';\nimport type { DrawerProps } from './Drawer.types';\n\nexport const Drawer = ({\n open,\n onOpenChange,\n title,\n description,\n children,\n footer,\n size = 'small',\n headerStyle = 'light',\n side = 'right',\n fixedTitle = false,\n disableCloseOptions = false,\n closeLabel = 'Sulje dialogi',\n keepMounted = false,\n className,\n ref,\n onKeyDown,\n onClick,\n onPointerDown,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...props\n}: DrawerProps) => {\n const titleId = useId();\n const descriptionId = useId();\n const { dialogRef, close, phase, isPresent } = useNativeDialog({\n open: open ?? false,\n keepMounted,\n onOpenChange,\n });\n const describedBy =\n [description ? descriptionId : undefined, ariaDescribedBy].filter(Boolean).join(' ') ||\n undefined;\n const dialogDismissalProps = useDialogDismissal({\n close,\n disableCloseOptions,\n onClick,\n onKeyDown,\n onPointerDown,\n });\n\n if (!isPresent) return null;\n\n return (\n <dialog\n {...props}\n ref={(node) => {\n dialogRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n className={cn(\n styles.drawer,\n elevationStyles.elevationHigh,\n styles[`drawer--${size}`],\n styles[`drawer--${headerStyle}`],\n styles[`drawer--${side}`],\n { [styles['drawer--fixed-title']]: fixedTitle },\n { [styles['drawer--opening']]: phase !== 'closing' },\n { [styles['drawer--closing']]: phase === 'closing' },\n className,\n )}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy ?? (!ariaLabel && title ? titleId : undefined)}\n aria-describedby={describedBy}\n {...dialogDismissalProps}\n >\n <div className={styles.drawer__container}>\n {!disableCloseOptions && (\n <button\n type=\"button\"\n className={cn(styles.drawer__close, focusStyles.focusable)}\n aria-label={closeLabel}\n data-dialog-autofocus=\"true\"\n onClick={close}\n >\n <Close aria-hidden=\"true\" />\n </button>\n )}\n {(title || description) && (\n <div className={styles.drawer__title}>\n {title && (\n <h2 id={titleId} className={styles.drawer__heading}>\n {title}\n </h2>\n )}\n {description && (\n <div id={descriptionId} className={styles.drawer__description}>\n {description}\n </div>\n )}\n </div>\n )}\n <div className={styles.drawer__content}>{children}</div>\n </div>\n {footer && (\n <div className={cn(styles['drawer__bottom-bar'], elevationStyles.elevationMedium)}>\n {footer}\n </div>\n )}\n </dialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAUO,MAAM,SAAS,CAAC;AAAA,EACnB;A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A;AAAA,QACzC;AAAA,MAAA;AAAA,MAEJ,cAAY;AAAA,MACZ,mBAAiB,mBAAmB,CAAC,aAAa,QAAQ,UAAU;AAAA,MACpE,oBAAkB;AAAA,MACjB,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAA,qBAAC,OAAA,EAAI,WAAW,OAAO,mBAClB,UAAA;AAAA,UAAA,CAAC,uBACE;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,MAAK;AAAA,cACL,WAAW,GAAG,OAAO,eAAe,YAAY,SAAS;AAAA,cACzD,cAAY;AAAA,cACZ,yBAAsB;AAAA,cACtB,SAAS;AAAA,cAET,UAAA,oBAAC,OAAA,EAAM,eAAY,OAAA,CAAO;AAAA,YAAA;AAAA,UAAA;AAAA,WAGhC,SAAS,gBACP,qBAAC,OAAA,EAAI,WAAW,OAAO,eAClB,UAAA;AAAA,YAAA,6BACI,MAAA,EAAG,IAAI,SAAS,WAAW,OAAO,iBAC9B,UAAA,MAAA,CACL;AAAA,YAEH,mCACI,OAAA,EAAI,IAAI,eAAe,WAAW,OAAO,qBACrC,UAAA,YAAA,CACL;AAAA,UAAA,GAER;AAAA,UAEJ,oBAAC,OAAA,EAAI,WAAW,OAAO,iBAAkB,SAAA,CAAS;AAAA,QAAA,GACtD;AAAA,QACC,UACG,oBAAC,OAAA,EAAI,WAAW,GAAG,OAAO,oBAAoB,GAAG,gBAAgB,eAAe,GAC3E,UAAA,OAAA,CACL;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIhB;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
require('./Drawer.css');
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
4
|
+
const drawer = "_drawer_zzxde_1";
|
|
5
|
+
const drawer__container = "_drawer__container_zzxde_78";
|
|
6
|
+
const drawer__title = "_drawer__title_zzxde_88";
|
|
7
|
+
const drawer__heading = "_drawer__heading_zzxde_98";
|
|
8
|
+
const drawer__description = "_drawer__description_zzxde_102";
|
|
9
|
+
const drawer__content = "_drawer__content_zzxde_105";
|
|
10
|
+
const drawer__close = "_drawer__close_zzxde_113";
|
|
11
|
+
const styles = {
|
|
12
|
+
drawer,
|
|
13
|
+
"drawer--small": "_drawer--small_zzxde_29",
|
|
14
|
+
"drawer--medium": "_drawer--medium_zzxde_32",
|
|
15
|
+
"drawer--large": "_drawer--large_zzxde_35",
|
|
16
|
+
"drawer--opening": "_drawer--opening_zzxde_38",
|
|
17
|
+
"drawer--closing": "_drawer--closing_zzxde_39",
|
|
18
|
+
"drawer--left": "_drawer--left_zzxde_50",
|
|
19
|
+
drawer__container,
|
|
20
|
+
"drawer--fixed-title": "_drawer--fixed-title_zzxde_85",
|
|
21
|
+
drawer__title,
|
|
22
|
+
drawer__heading,
|
|
23
|
+
drawer__description,
|
|
24
|
+
drawer__content,
|
|
25
|
+
drawer__close,
|
|
26
|
+
"drawer__bottom-bar": "_drawer__bottom-bar_zzxde_133",
|
|
27
|
+
"drawer--dark": "_drawer--dark_zzxde_140"
|
|
28
|
+
};
|
|
29
|
+
exports.default = styles;
|
|
30
|
+
exports.drawer = drawer;
|
|
31
|
+
exports.drawer__close = drawer__close;
|
|
32
|
+
exports.drawer__container = drawer__container;
|
|
33
|
+
exports.drawer__content = drawer__content;
|
|
34
|
+
exports.drawer__description = drawer__description;
|
|
35
|
+
exports.drawer__heading = drawer__heading;
|
|
36
|
+
exports.drawer__title = drawer__title;
|
|
37
|
+
//# sourceMappingURL=Drawer.module.css.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Drawer.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import './Drawer.css';
|
|
2
|
+
const drawer = "_drawer_zzxde_1";
|
|
3
|
+
const drawer__container = "_drawer__container_zzxde_78";
|
|
4
|
+
const drawer__title = "_drawer__title_zzxde_88";
|
|
5
|
+
const drawer__heading = "_drawer__heading_zzxde_98";
|
|
6
|
+
const drawer__description = "_drawer__description_zzxde_102";
|
|
7
|
+
const drawer__content = "_drawer__content_zzxde_105";
|
|
8
|
+
const drawer__close = "_drawer__close_zzxde_113";
|
|
9
|
+
const styles = {
|
|
10
|
+
drawer,
|
|
11
|
+
"drawer--small": "_drawer--small_zzxde_29",
|
|
12
|
+
"drawer--medium": "_drawer--medium_zzxde_32",
|
|
13
|
+
"drawer--large": "_drawer--large_zzxde_35",
|
|
14
|
+
"drawer--opening": "_drawer--opening_zzxde_38",
|
|
15
|
+
"drawer--closing": "_drawer--closing_zzxde_39",
|
|
16
|
+
"drawer--left": "_drawer--left_zzxde_50",
|
|
17
|
+
drawer__container,
|
|
18
|
+
"drawer--fixed-title": "_drawer--fixed-title_zzxde_85",
|
|
19
|
+
drawer__title,
|
|
20
|
+
drawer__heading,
|
|
21
|
+
drawer__description,
|
|
22
|
+
drawer__content,
|
|
23
|
+
drawer__close,
|
|
24
|
+
"drawer__bottom-bar": "_drawer__bottom-bar_zzxde_133",
|
|
25
|
+
"drawer--dark": "_drawer--dark_zzxde_140"
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
styles as default,
|
|
29
|
+
drawer,
|
|
30
|
+
drawer__close,
|
|
31
|
+
drawer__container,
|
|
32
|
+
drawer__content,
|
|
33
|
+
drawer__description,
|
|
34
|
+
drawer__heading,
|
|
35
|
+
drawer__title
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=Drawer.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Drawer.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
export type DrawerSize = 'small' | 'medium' | 'large';
|
|
3
|
+
export type DrawerHeaderStyle = 'light' | 'dark';
|
|
4
|
+
export type DrawerSide = 'left' | 'right';
|
|
5
|
+
type DrawerAccessibleName = {
|
|
6
|
+
readonly title: ReactNode;
|
|
7
|
+
readonly 'aria-label'?: string;
|
|
8
|
+
readonly 'aria-labelledby'?: never;
|
|
9
|
+
} | {
|
|
10
|
+
readonly title: ReactNode;
|
|
11
|
+
readonly 'aria-label'?: never;
|
|
12
|
+
readonly 'aria-labelledby': string;
|
|
13
|
+
} | {
|
|
14
|
+
readonly title: ReactNode;
|
|
15
|
+
readonly 'aria-label'?: never;
|
|
16
|
+
readonly 'aria-labelledby'?: never;
|
|
17
|
+
} | {
|
|
18
|
+
readonly title?: never;
|
|
19
|
+
readonly 'aria-label': string;
|
|
20
|
+
readonly 'aria-labelledby'?: never;
|
|
21
|
+
} | {
|
|
22
|
+
readonly title?: never;
|
|
23
|
+
readonly 'aria-label'?: never;
|
|
24
|
+
readonly 'aria-labelledby': string;
|
|
25
|
+
};
|
|
26
|
+
export type DrawerProps = Omit<ComponentPropsWithRef<'dialog'>, 'children' | 'open' | 'onClose' | 'onCancel' | 'aria-label' | 'aria-labelledby' | 'title'> & DrawerAccessibleName & {
|
|
27
|
+
/**
|
|
28
|
+
* Controls whether the drawer is open. The drawer unmounts after its close animation unless
|
|
29
|
+
* `keepMounted` is true.
|
|
30
|
+
* `undefined` is treated as closed. @default false
|
|
31
|
+
*/
|
|
32
|
+
readonly open?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Keeps the closed drawer and its descendants mounted, preserving their React state and effects.
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
readonly keepMounted?: boolean;
|
|
38
|
+
/** Called with false when the user requests closing. Opening and closing are controlled by `open`. */
|
|
39
|
+
readonly onOpenChange?: (open: boolean) => void;
|
|
40
|
+
/** Supporting text displayed below the heading. */
|
|
41
|
+
readonly description?: ReactNode;
|
|
42
|
+
/** Content displayed in the drawer body. */
|
|
43
|
+
readonly children: ReactNode;
|
|
44
|
+
/** Optional content displayed in the bottom action bar. */
|
|
45
|
+
readonly footer?: ReactNode;
|
|
46
|
+
/** Drawer width. */
|
|
47
|
+
readonly size?: DrawerSize;
|
|
48
|
+
/** Visual style of the header and close button. */
|
|
49
|
+
readonly headerStyle?: DrawerHeaderStyle;
|
|
50
|
+
/** Side from which the drawer enters. @default 'right' */
|
|
51
|
+
readonly side?: DrawerSide;
|
|
52
|
+
/** Keeps the header fixed while the body scrolls. @default false */
|
|
53
|
+
readonly fixedTitle?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Disables the close button, backdrop click, and Escape key. Provide an action that sets
|
|
56
|
+
* `open` to false when this is enabled. @default false
|
|
57
|
+
*/
|
|
58
|
+
readonly disableCloseOptions?: boolean;
|
|
59
|
+
/** Accessible label for the close button. @default 'Sulje dialogi' */
|
|
60
|
+
readonly closeLabel?: string;
|
|
61
|
+
};
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=Drawer.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Drawer.types.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AACtD,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,MAAM,CAAC;AACjD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;AAE1C,KAAK,oBAAoB,GACnB;IACI,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC;CACtC,GACD;IACI,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC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