@dilicorp/ui 0.1.16 → 0.1.17

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.
@@ -5,6 +5,7 @@ export declare type ModalProps = {
5
5
  title?: string;
6
6
  closeFn?: () => void;
7
7
  className?: string;
8
+ innerRef?: React.ForwardedRef<AlertRef>;
8
9
  };
9
10
  export declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<AlertRef>>;
10
11
  //# sourceMappingURL=modal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAS,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAGvD,oBAAY,UAAU,GAAG;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,KAAK,6EAmBhB,CAAA"}
1
+ {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAS,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAGvD,oBAAY,UAAU,GAAG;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAA;CACxC,CAAA;AAED,eAAO,MAAM,KAAK,6EAmBhB,CAAA"}
@@ -3,9 +3,9 @@ import { Button } from '../../atoms/button';
3
3
  import { Alert } from '../../molecules/alert';
4
4
  import classNames from 'classnames';
5
5
  export const Modal = forwardRef((props, ref) => {
6
- const { children, title, closeFn, className } = props;
7
- const classes = classNames(className || 'alert-small');
8
- return (React.createElement(Alert, { ref: ref, className: classes },
6
+ const { children, title, closeFn, className, innerRef } = props;
7
+ const classes = classNames(className !== null && className !== void 0 ? className : 'alert-small');
8
+ return (React.createElement(Alert, { ref: ref !== null && ref !== void 0 ? ref : innerRef, className: classes },
9
9
  React.createElement("div", { className: "modal modal-sm" },
10
10
  React.createElement("div", { className: "modal-header" },
11
11
  React.createElement("div", { className: "title" }, title),
@@ -1 +1 @@
1
- {"version":3,"file":"page-create.d.ts","sourceRoot":"","sources":["../../../src/components/page-create/page-create.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,UAAU,EAAS,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAGtC,aAAK,YAAY,GAAG;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,iBAAiB,EAAE,CAAA;CAC3B,CAAA;AAED,oBAAY,eAAe,CAAC,MAAM,GAAG,GAAG,IAAI;IAC1C,IAAI,EAAE,gBAAgB,EAAE,CAAA;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,IAAI,CAAA;IACxE,KAAK,EAAE,MAAM,GAAC,KAAK,CAAC,SAAS,CAAA;IAC7B,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,YAAY,CAAC,EAAE,iBAAiB,EAAE,GAAG,YAAY,CAAA;IACjD,YAAY,CAAC,EAAE;QACb,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;CACF,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA8ChD,CAAA"}
1
+ {"version":3,"file":"page-create.d.ts","sourceRoot":"","sources":["../../../src/components/page-create/page-create.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,UAAU,EAAS,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAGtC,aAAK,YAAY,GAAG;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,iBAAiB,EAAE,CAAA;CAC3B,CAAA;AAED,oBAAY,eAAe,CAAC,MAAM,GAAG,GAAG,IAAI;IAC1C,IAAI,EAAE,gBAAgB,EAAE,CAAA;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,IAAI,CAAA;IACxE,KAAK,EAAE,MAAM,GAAC,KAAK,CAAC,SAAS,CAAA;IAC7B,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,YAAY,CAAC,EAAE,iBAAiB,EAAE,GAAG,YAAY,CAAA;IACjD,YAAY,CAAC,EAAE;QACb,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;CACF,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA6ChD,CAAA"}
@@ -3,7 +3,6 @@ import { Modal } from '../modal/modal';
3
3
  import { Button, Col, Dropdown, FormBuilder, Icon, Link, Row, Typography } from '../../';
4
4
  export const PageCreate = (props) => {
5
5
  const { title, extraButtons = [], cancelButton, onSubmit, data, modal } = props;
6
- const isModalPresent = modal && modal.children;
7
6
  return (React.createElement(React.Fragment, null,
8
7
  React.createElement(Row, { className: "mb-3" },
9
8
  React.createElement(Col, null,
@@ -15,5 +14,5 @@ export const PageCreate = (props) => {
15
14
  React.createElement(Icon, { icon: "faAngleLeft", className: "me-1" }), cancelButton === null || cancelButton === void 0 ? void 0 :
16
15
  cancelButton.label))))),
17
16
  React.createElement(FormBuilder, { data: data, onSubmit: onSubmit }),
18
- isModalPresent && (React.createElement(Modal, { title: modal === null || modal === void 0 ? void 0 : modal.title, closeFn: modal === null || modal === void 0 ? void 0 : modal.closeFn, className: modal === null || modal === void 0 ? void 0 : modal.className }, modal === null || modal === void 0 ? void 0 : modal.children))));
17
+ modal && (React.createElement(Modal, { ref: modal.innerRef, title: modal.title, closeFn: modal.closeFn, className: modal.className }, modal.children))));
19
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dilicorp/ui",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "A simple UI design for Dilicorp",
5
5
  "repository": {
6
6
  "type": "git",