@uxf/ui 10.0.0-beta.85 → 10.0.0-beta.86

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.
@@ -1,9 +1,11 @@
1
1
  import React, { ReactNode } from "react";
2
+ import { DialogVariant } from "./theme";
2
3
  export interface DialogProps {
3
4
  children: ReactNode;
4
5
  className?: string;
5
6
  disableBackdropClose?: boolean;
6
7
  onClose: () => void;
7
8
  open: boolean;
9
+ variant?: DialogVariant;
8
10
  }
9
11
  export declare const Dialog: React.NamedExoticComponent<DialogProps>;
package/dialog/dialog.js CHANGED
@@ -27,8 +27,8 @@ exports.Dialog = void 0;
27
27
  const react_1 = require("@headlessui/react");
28
28
  const react_2 = __importStar(require("react"));
29
29
  exports.Dialog = (0, react_2.memo)((props) => {
30
- var _a;
31
- return (react_2.default.createElement(react_1.Dialog, { className: `uxf-dialog ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, open: props.open, onClose: props.disableBackdropClose ? () => null : props.onClose },
30
+ var _a, _b;
31
+ return (react_2.default.createElement(react_1.Dialog, { className: `uxf-dialog uxf-dialog--variant-${(_a = props.variant) !== null && _a !== void 0 ? _a : "default"} ${(_b = props.className) !== null && _b !== void 0 ? _b : ""}`, open: props.open, onClose: props.disableBackdropClose ? () => null : props.onClose },
32
32
  react_2.default.createElement(react_1.Dialog.Overlay, { className: "uxf-dialog__backdrop" }),
33
33
  react_2.default.createElement("div", { className: "uxf-dialog__wrapper" },
34
34
  react_2.default.createElement("div", { className: "uxf-dialog__body" },
@@ -0,0 +1,4 @@
1
+ export interface DialogVariants {
2
+ default: true;
3
+ }
4
+ export type DialogVariant = keyof DialogVariants;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/modal/modal.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import React, { ReactNode } from "react";
2
2
  import type { DialogProps } from "../dialog";
3
- import { ModalWidth } from "./theme";
3
+ import { ModalVariant, ModalWidth } from "./theme";
4
4
  export interface ModalProps {
5
5
  children: ReactNode;
6
6
  className?: DialogProps["className"];
7
7
  disableBackdropClose?: DialogProps["disableBackdropClose"];
8
8
  onClose?: () => void;
9
+ variant?: ModalVariant;
9
10
  width?: ModalWidth;
10
11
  }
11
12
  export interface ModalRef {
package/modal/modal.js CHANGED
@@ -27,7 +27,7 @@ exports.Modal = void 0;
27
27
  const react_1 = __importStar(require("react"));
28
28
  const dialog_1 = require("../dialog");
29
29
  exports.Modal = (0, react_1.forwardRef)((props, ref) => {
30
- var _a, _b;
30
+ var _a, _b, _c;
31
31
  const [content, setContent] = (0, react_1.useState)();
32
32
  const open = (0, react_1.useCallback)((newModal) => setContent(newModal), []);
33
33
  const close = (0, react_1.useCallback)(() => setContent(null), []);
@@ -46,6 +46,6 @@ exports.Modal = (0, react_1.forwardRef)((props, ref) => {
46
46
  return null;
47
47
  });
48
48
  }, []);
49
- return content ? (react_1.default.createElement(dialog_1.Dialog, { className: `uxf-modal uxf-modal--width-${(_a = content.width) !== null && _a !== void 0 ? _a : "default"} ${(_b = content.className) !== null && _b !== void 0 ? _b : ""}`, disableBackdropClose: content.disableBackdropClose, onClose: onClose, open: !!content }, content.children)) : null;
49
+ return content ? (react_1.default.createElement(dialog_1.Dialog, { className: `uxf-modal uxf-modal--variant-${(_a = content.variant) !== null && _a !== void 0 ? _a : "default"} uxf-modal--width-${(_b = content.width) !== null && _b !== void 0 ? _b : "default"} ${(_c = content.className) !== null && _c !== void 0 ? _c : ""}`, disableBackdropClose: content.disableBackdropClose, onClose: onClose, open: !!content, variant: content.variant }, content.children)) : null;
50
50
  });
51
51
  exports.Modal.displayName = "UxfUiModal";
package/modal/theme.d.ts CHANGED
@@ -6,3 +6,7 @@ export interface ModalWidths {
6
6
  xl: true;
7
7
  }
8
8
  export type ModalWidth = keyof ModalWidths;
9
+ export interface ModalVariants {
10
+ default: true;
11
+ }
12
+ export type ModalVariant = keyof ModalVariants;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/ui",
3
- "version": "10.0.0-beta.85",
3
+ "version": "10.0.0-beta.86",
4
4
  "description": "",
5
5
  "publishConfig": {
6
6
  "access": "public"