@wallarm-org/design-system 0.81.0 → 0.82.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/Dialog/DialogDescription.d.ts +5 -0
- package/dist/components/Dialog/DialogDescription.js +4 -0
- package/dist/components/Dialog/index.d.ts +1 -0
- package/dist/components/Dialog/index.js +1 -0
- package/dist/components/Drawer/DrawerDescription.d.ts +6 -0
- package/dist/components/Drawer/DrawerDescription.js +16 -0
- package/dist/components/Drawer/DrawerHeader.js +17 -2
- package/dist/components/Drawer/index.d.ts +1 -0
- package/dist/components/Drawer/index.js +1 -0
- package/dist/metadata/components.json +16 -2
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ export { Dialog } from './Dialog';
|
|
|
2
2
|
export { DialogBody } from './DialogBody';
|
|
3
3
|
export { DialogClose } from './DialogClose';
|
|
4
4
|
export { DialogContent } from './DialogContent';
|
|
5
|
+
export { DialogDescription } from './DialogDescription';
|
|
5
6
|
export { DialogFooter } from './DialogFooter';
|
|
6
7
|
export { DialogFooterControls } from './DialogFooterControls';
|
|
7
8
|
export { DialogHeader } from './DialogHeader';
|
|
@@ -2,6 +2,7 @@ export { Dialog } from "./Dialog.js";
|
|
|
2
2
|
export { DialogBody } from "./DialogBody.js";
|
|
3
3
|
export { DialogClose } from "./DialogClose.js";
|
|
4
4
|
export { DialogContent } from "./DialogContent.js";
|
|
5
|
+
export { DialogDescription } from "./DialogDescription.js";
|
|
5
6
|
export { DialogFooter } from "./DialogFooter.js";
|
|
6
7
|
export { DialogFooterControls } from "./DialogFooterControls.js";
|
|
7
8
|
export { DialogHeader } from "./DialogHeader.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog } from "@ark-ui/react/dialog";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { useTestId } from "../../utils/testId.js";
|
|
5
|
+
const DrawerDescription = ({ children, ref })=>{
|
|
6
|
+
const testId = useTestId("description");
|
|
7
|
+
return /*#__PURE__*/ jsx(Dialog.Description, {
|
|
8
|
+
ref: ref,
|
|
9
|
+
"data-testid": testId,
|
|
10
|
+
"data-slot": "drawer-description",
|
|
11
|
+
className: cn('text-sm font-normal text-text-secondary'),
|
|
12
|
+
children: children
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
DrawerDescription.displayName = "DrawerDescription";
|
|
16
|
+
export { DrawerDescription };
|
|
@@ -3,17 +3,32 @@ import { Children, isValidElement } from "react";
|
|
|
3
3
|
import { cn } from "../../utils/cn.js";
|
|
4
4
|
import { useTestId } from "../../utils/testId.js";
|
|
5
5
|
import { DrawerClose } from "./DrawerClose.js";
|
|
6
|
+
import { DrawerDescription } from "./DrawerDescription.js";
|
|
7
|
+
import { DrawerTitle } from "./DrawerTitle.js";
|
|
6
8
|
const isDrawerClose = (child)=>/*#__PURE__*/ isValidElement(child) && child.type === DrawerClose;
|
|
9
|
+
const isDrawerTitle = (child)=>/*#__PURE__*/ isValidElement(child) && child.type === DrawerTitle;
|
|
10
|
+
const isDrawerDescription = (child)=>/*#__PURE__*/ isValidElement(child) && child.type === DrawerDescription;
|
|
7
11
|
const DrawerHeader = ({ children, ref })=>{
|
|
8
12
|
const testId = useTestId('header');
|
|
9
|
-
const
|
|
13
|
+
const items = Children.toArray(children);
|
|
14
|
+
const hasExplicitClose = items.some(isDrawerClose);
|
|
15
|
+
const title = items.find(isDrawerTitle);
|
|
16
|
+
const description = items.find(isDrawerDescription);
|
|
17
|
+
const rest = items.filter((child)=>child !== title && child !== description);
|
|
10
18
|
return /*#__PURE__*/ jsxs("div", {
|
|
11
19
|
ref: ref,
|
|
12
20
|
"data-testid": testId,
|
|
13
21
|
"data-slot": "drawer-header",
|
|
14
22
|
className: cn('relative shrink-0 w-full', 'bg-bg-surface-2', 'flex items-start justify-between gap-12', 'pt-16 pb-12 pl-24 pr-16', 'rounded-t-12', 'outline-none'),
|
|
15
23
|
children: [
|
|
16
|
-
|
|
24
|
+
(title || description) && /*#__PURE__*/ jsxs("div", {
|
|
25
|
+
className: "flex flex-1 flex-col gap-0 min-w-0",
|
|
26
|
+
children: [
|
|
27
|
+
title,
|
|
28
|
+
description
|
|
29
|
+
]
|
|
30
|
+
}),
|
|
31
|
+
rest,
|
|
17
32
|
!hasExplicitClose && /*#__PURE__*/ jsx(DrawerClose, {})
|
|
18
33
|
]
|
|
19
34
|
});
|
|
@@ -5,6 +5,7 @@ export { DrawerBody, type DrawerBodyProps } from './DrawerBody';
|
|
|
5
5
|
export { DrawerClose, type DrawerCloseProps } from './DrawerClose';
|
|
6
6
|
export { DrawerContent, type DrawerContentProps } from './DrawerContent';
|
|
7
7
|
export { useDrawerContext } from './DrawerContext';
|
|
8
|
+
export { DrawerDescription, type DrawerDescriptionProps } from './DrawerDescription';
|
|
8
9
|
export { DrawerFooter, type DrawerFooterProps } from './DrawerFooter';
|
|
9
10
|
export { DrawerFooterControls, type DrawerFooterControlsProps, } from './DrawerFooterControls';
|
|
10
11
|
export { DrawerHeader, type DrawerHeaderProps } from './DrawerHeader';
|
|
@@ -4,6 +4,7 @@ export { DrawerBody } from "./DrawerBody.js";
|
|
|
4
4
|
export { DrawerClose } from "./DrawerClose.js";
|
|
5
5
|
export { DrawerContent } from "./DrawerContent.js";
|
|
6
6
|
export { useDrawerContext } from "./DrawerContext/index.js";
|
|
7
|
+
export { DrawerDescription } from "./DrawerDescription.js";
|
|
7
8
|
export { DrawerFooter } from "./DrawerFooter.js";
|
|
8
9
|
export { DrawerFooterControls } from "./DrawerFooterControls.js";
|
|
9
10
|
export { DrawerHeader } from "./DrawerHeader.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
3
|
-
"generatedAt": "2026-08-
|
|
2
|
+
"version": "0.81.0",
|
|
3
|
+
"generatedAt": "2026-08-04T09:35:49.157Z",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"name": "Accordion",
|
|
@@ -24603,6 +24603,11 @@
|
|
|
24603
24603
|
"code": "() => {\n return (\n <Dialog>\n <DialogTrigger asChild>\n <Button>Open Dialog</Button>\n </DialogTrigger>\n\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Dialog's title</DialogTitle>\n </DialogHeader>\n\n <DialogBody>\n <ContentPlaceholder />\n </DialogBody>\n\n <DialogFooter>\n <DialogFooterControls>\n <Button variant='ghost' color='neutral' size='large'>\n Button\n </Button>\n <Button variant='primary' color='brand' size='large'>\n Button\n </Button>\n </DialogFooterControls>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}",
|
|
24604
24604
|
"description": "Minimal example"
|
|
24605
24605
|
},
|
|
24606
|
+
{
|
|
24607
|
+
"name": "WithDescription",
|
|
24608
|
+
"code": "() => {\n return (\n <Dialog>\n <DialogTrigger asChild>\n <Button>Open Dialog</Button>\n </DialogTrigger>\n\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Dialog's title</DialogTitle>\n <DialogDescription>Description</DialogDescription>\n </DialogHeader>\n\n <DialogBody>\n <ContentPlaceholder />\n </DialogBody>\n\n <DialogFooter>\n <DialogFooterControls>\n <Button variant='ghost' color='neutral' size='large'>\n Button\n </Button>\n <Button variant='primary' color='brand' size='large'>\n Button\n </Button>\n </DialogFooterControls>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}",
|
|
24609
|
+
"description": "Header title with a supporting description stacked underneath"
|
|
24610
|
+
},
|
|
24606
24611
|
{
|
|
24607
24612
|
"name": "WithFooterLeftActions",
|
|
24608
24613
|
"code": "() => (\n <Dialog>\n <DialogTrigger asChild>\n <Button>Open with Footer Actions</Button>\n </DialogTrigger>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Footer with Left Actions</DialogTitle>\n </DialogHeader>\n\n <DialogBody>\n <ContentPlaceholder />\n </DialogBody>\n\n <DialogFooter>\n <DialogFooterControls placement='left'>\n <Switch>\n <SwitchControl />\n <SwitchLabel>Remember choice</SwitchLabel>\n </Switch>\n </DialogFooterControls>\n\n <DialogClose asChild>\n <Button variant='ghost' color='neutral' size='large'>\n Cancel\n </Button>\n </DialogClose>\n <Button variant='primary' color='brand' size='large'>\n Apply\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n)",
|
|
@@ -25089,6 +25094,10 @@
|
|
|
25089
25094
|
}
|
|
25090
25095
|
]
|
|
25091
25096
|
},
|
|
25097
|
+
{
|
|
25098
|
+
"name": "DrawerDescription",
|
|
25099
|
+
"props": []
|
|
25100
|
+
},
|
|
25092
25101
|
{
|
|
25093
25102
|
"name": "DrawerFooter",
|
|
25094
25103
|
"props": []
|
|
@@ -25462,6 +25471,11 @@
|
|
|
25462
25471
|
"code": "() => {\n return (\n <Drawer>\n <DrawerTrigger asChild>\n <Button>Open Drawer</Button>\n </DrawerTrigger>\n\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>Drawer's title</DrawerTitle>\n </DrawerHeader>\n <DrawerBody>\n <ContentPlaceholder fillHeight />\n </DrawerBody>\n <DrawerFooter>\n <DrawerFooterControls>\n <Button variant='ghost' color='neutral' size='large'>\n Button\n </Button>\n <Button variant='primary' color='brand' size='large'>\n Button\n </Button>\n </DrawerFooterControls>\n </DrawerFooter>\n </DrawerContent>\n </Drawer>\n );\n}",
|
|
25463
25472
|
"description": "Minimal example"
|
|
25464
25473
|
},
|
|
25474
|
+
{
|
|
25475
|
+
"name": "WithDescription",
|
|
25476
|
+
"code": "() => {\n return (\n <Drawer>\n <DrawerTrigger asChild>\n <Button>Open Drawer</Button>\n </DrawerTrigger>\n\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>Drawer's title</DrawerTitle>\n <DrawerDescription>Description TBD</DrawerDescription>\n </DrawerHeader>\n <DrawerBody>\n <ContentPlaceholder fillHeight />\n </DrawerBody>\n <DrawerFooter>\n <DrawerFooterControls>\n <Button variant='ghost' color='neutral' size='large'>\n Button\n </Button>\n <Button variant='primary' color='brand' size='large'>\n Button\n </Button>\n </DrawerFooterControls>\n </DrawerFooter>\n </DrawerContent>\n </Drawer>\n );\n}",
|
|
25477
|
+
"description": "Header title with a supporting description stacked underneath"
|
|
25478
|
+
},
|
|
25465
25479
|
{
|
|
25466
25480
|
"name": "WithFooterLeftActions",
|
|
25467
25481
|
"code": "() => (\n <Drawer>\n <DrawerTrigger asChild>\n <Button>Open with Footer Actions</Button>\n </DrawerTrigger>\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>Footer with Left Actions</DrawerTitle>\n </DrawerHeader>\n\n <DrawerBody>\n <ContentPlaceholder fillHeight />\n </DrawerBody>\n\n <DrawerFooter>\n <DrawerFooterControls placement='left'>\n <Switch>\n <SwitchControl />\n <SwitchLabel>Remember choice</SwitchLabel>\n </Switch>\n </DrawerFooterControls>\n\n <DrawerClose asChild>\n <Button variant='ghost' color='neutral' size='large'>\n Cancel\n </Button>\n </DrawerClose>\n <Button variant='primary' color='brand' size='large'>\n Apply\n </Button>\n </DrawerFooter>\n </DrawerContent>\n </Drawer>\n)",
|