draft-components 4.18.0 → 4.19.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.
@@ -2461,6 +2461,10 @@
2461
2461
  top: 6px;
2462
2462
  }
2463
2463
 
2464
+ .dc-dialog__close-button[hidden] {
2465
+ display: none;
2466
+ }
2467
+
2464
2468
  .dc-dialog__header_content-align_left .dc-dialog__close-button,
2465
2469
  .dc-dialog__header_content-align_center .dc-dialog__close-button {
2466
2470
  right: 6px;
@@ -3,7 +3,8 @@ type DialogHeaderHTMLProps = ComponentProps<'div'>;
3
3
  type DialogHeaderBaseProps = {
4
4
  title?: ReactNode;
5
5
  contentAlign?: 'left' | 'right' | 'center';
6
+ shouldHideCloseButton?: boolean;
6
7
  };
7
8
  export type DialogHeaderProps = DialogHeaderBaseProps & Omit<DialogHeaderHTMLProps, keyof DialogHeaderBaseProps>;
8
- export declare function DialogHeader({ className, title, children, contentAlign, ...props }: DialogHeaderProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function DialogHeader({ className, title, children, contentAlign, shouldHideCloseButton, ...props }: DialogHeaderProps): import("react/jsx-runtime").JSX.Element;
9
10
  export {};
@@ -3,7 +3,7 @@ import {} from 'react';
3
3
  import { classNames } from '../../lib/react-helpers.js';
4
4
  import { useDialogContext } from './dialog-context.js';
5
5
  import { IconButton } from '../button/index.js';
6
- export function DialogHeader({ className, title, children, contentAlign = 'left', ...props }) {
6
+ export function DialogHeader({ className, title, children, contentAlign = 'left', shouldHideCloseButton = false, ...props }) {
7
7
  const { titleId, isBodyHasScroll, onClose } = useDialogContext();
8
8
  return (_jsxs("div", { className: classNames(className, {
9
9
  'dc-dialog__section': true,
@@ -12,7 +12,7 @@ export function DialogHeader({ className, title, children, contentAlign = 'left'
12
12
  [`dc-dialog__header_content-align_${contentAlign}`]: contentAlign,
13
13
  }), ...props, children: [title
14
14
  ? _jsx("h2", { id: titleId, className: "dc-dialog__title", children: title })
15
- : null, _jsx(IconButton, { className: "dc-dialog__close-button", buttonStyle: "plain", onClick: onClose, children: _jsx(XMarkIcon, { width: 18, height: 18, strokeWidth: 2 }) }), children
15
+ : null, _jsx(IconButton, { className: "dc-dialog__close-button", buttonStyle: "plain", hidden: shouldHideCloseButton, onClick: onClose, children: _jsx(XMarkIcon, { width: 18, height: 18, strokeWidth: 2 }) }), children
16
16
  ? _jsx("div", { className: "dc-dialog__header-body", children: children })
17
17
  : null] }));
18
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dialog-header.js","sourceRoot":"","sources":["../../../src/components/dialog/dialog-header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAahD,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,kBAAkB,YAAE,KAAK,GAAM;gBAC5D,CAAC,CAAC,IAAI,EACR,KAAC,UAAU,IACT,SAAS,EAAC,yBAAyB,EACnC,WAAW,EAAC,OAAO,EACnB,OAAO,EAAE,OAAO,YAEhB,KAAC,SAAS,IAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,GAAI,GACzC,EACZ,QAAQ;gBACP,CAAC,CAAC,cAAK,SAAS,EAAC,wBAAwB,YAAE,QAAQ,GAAO;gBAC1D,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,KAA4B;IAC7C,OAAO,CACL,cACE,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,WAAW,EACnB,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,MAAM,EAAC,cAAc,EACrB,WAAW,EAAE,GAAG,EAChB,IAAI,EAAC,MAAM,KACP,KAAK,YAET,eAAM,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,EAAC,CAAC,EAAC,sBAAsB,GAAG,GAC1E,CACP,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"dialog-header.js","sourceRoot":"","sources":["../../../src/components/dialog/dialog-header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAchD,MAAM,UAAU,YAAY,CAAC,EAC3B,SAAS,EACT,KAAK,EACL,QAAQ,EACR,YAAY,GAAG,MAAM,EACrB,qBAAqB,GAAG,KAAK,EAC7B,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,kBAAkB,YAAE,KAAK,GAAM;gBAC5D,CAAC,CAAC,IAAI,EACR,KAAC,UAAU,IACT,SAAS,EAAC,yBAAyB,EACnC,WAAW,EAAC,OAAO,EACnB,MAAM,EAAE,qBAAqB,EAC7B,OAAO,EAAE,OAAO,YAEhB,KAAC,SAAS,IAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,GAAI,GACzC,EACZ,QAAQ;gBACP,CAAC,CAAC,cAAK,SAAS,EAAC,wBAAwB,YAAE,QAAQ,GAAO;gBAC1D,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,KAA4B;IAC7C,OAAO,CACL,cACE,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,WAAW,EACnB,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,MAAM,EAAC,cAAc,EACrB,WAAW,EAAE,GAAG,EAChB,IAAI,EAAC,MAAM,KACP,KAAK,YAET,eAAM,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,EAAC,CAAC,EAAC,sBAAsB,GAAG,GAC1E,CACP,CAAC;AACJ,CAAC"}
@@ -266,6 +266,10 @@
266
266
  top: 6px;
267
267
  }
268
268
 
269
+ .dc-dialog__close-button[hidden] {
270
+ display: none;
271
+ }
272
+
269
273
  .dc-dialog__header_content-align_left .dc-dialog__close-button,
270
274
  .dc-dialog__header_content-align_center .dc-dialog__close-button {
271
275
  right: 6px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "draft-components",
3
- "version": "4.18.0",
3
+ "version": "4.19.0",
4
4
  "description": "The React based UI components library.",
5
5
  "type": "module",
6
6
  "exports": {