draft-components 4.0.0 → 4.1.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/README.md
CHANGED
|
@@ -2,9 +2,8 @@ import { type ComponentProps, type ReactNode } from 'react';
|
|
|
2
2
|
type DialogHeaderHTMLProps = ComponentProps<'div'>;
|
|
3
3
|
type DialogHeaderBaseProps = {
|
|
4
4
|
title?: ReactNode;
|
|
5
|
-
hasDivider?: boolean;
|
|
6
5
|
contentAlign?: 'left' | 'right' | 'center';
|
|
7
6
|
};
|
|
8
7
|
export type DialogHeaderProps = DialogHeaderBaseProps & Omit<DialogHeaderHTMLProps, keyof DialogHeaderBaseProps>;
|
|
9
|
-
export declare function DialogHeader({ className, title, children, contentAlign
|
|
8
|
+
export declare function DialogHeader({ className, title, children, contentAlign, ...props }: DialogHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export {};
|
|
@@ -4,13 +4,13 @@ import { useDialogContext } from './dialog-context.js';
|
|
|
4
4
|
import {} from 'react';
|
|
5
5
|
import { IconButton } from '../button/index.js';
|
|
6
6
|
import { XMarkIcon } from '../hero-icons/24/outline/x-mark-icon.js';
|
|
7
|
-
export function DialogHeader({ className, title, children, contentAlign
|
|
7
|
+
export function DialogHeader({ className, title, children, contentAlign = 'left', ...props }) {
|
|
8
8
|
const { titleId, isBodyHasScroll, onClose } = useDialogContext();
|
|
9
9
|
return (_jsxs("div", { className: classNames(className, {
|
|
10
10
|
'dc-dialog__section': true,
|
|
11
11
|
'dc-dialog__header': true,
|
|
12
12
|
'dc-dialog__header_has_scroll-shadow': isBodyHasScroll,
|
|
13
|
-
[`dc-dialog__header_content-align_${
|
|
13
|
+
[`dc-dialog__header_content-align_${contentAlign}`]: contentAlign,
|
|
14
14
|
}), ...props, children: [title
|
|
15
15
|
? _jsx("h2", { id: titleId, className: "dc-dialog__title", children: title })
|
|
16
16
|
: null, _jsx(IconButton, { className: "dc-dialog__close-button", buttonStyle: "plain", onClick: onClose, children: _jsx(XMarkIcon, { width: 18, height: 18, strokeWidth: 2 }) }), children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-header.js","sourceRoot":"","sources":["../../../src/components/dialog/dialog-header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"dialog-header.js","sourceRoot":"","sources":["../../../src/components/dialog/dialog-header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAapE,MAAM,UAAU,YAAY,CAAC,EAC3B,SAAS,EACT,KAAK,EACL,QAAQ,EACR,YAAY,GAAG,MAAM,EACrB,GAAG,KAAK,EACU;IAClB,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAEjE,OAAO,CACL,eACE,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE;YAC/B,oBAAoB,EAAE,IAAI;YAC1B,mBAAmB,EAAE,IAAI;YACzB,qCAAqC,EAAE,eAAe;YACtD,CAAC,mCAAmC,YAAY,EAAE,CAAC,EAAE,YAAY;SAClE,CAAC,KACE,KAAK,aAER,KAAK;gBACJ,CAAC,CAAC,aAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAC,k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