@fluidattacks/design 10.4.1 → 11.0.1

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,91 +1,92 @@
1
- import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
- import { yupResolver as S } from "../../node_modules/@hookform/resolvers/yup/dist/yup.js";
3
- import { useForm as j, FormProvider as k } from "../../node_modules/react-hook-form/dist/index.esm.js";
4
- import { Controller as J, useController as K, useFieldArray as L, useFormContext as M, useWatch as N } from "../../node_modules/react-hook-form/dist/index.esm.js";
5
- import { useTheme as D } from "styled-components";
6
- import { InnerForm as U } from "./inner-form/index.js";
7
- import { StyledForm as P, FormContent as R } from "./styles.js";
8
- import { Button as h } from "../button/index.js";
1
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
2
+ import { yupResolver as j } from "../../node_modules/@hookform/resolvers/yup/dist/yup.js";
3
+ import { useForm as k, FormProvider as D } from "../../node_modules/react-hook-form/dist/index.esm.js";
4
+ import { Controller as K, useController as L, useFieldArray as M, useFormContext as N, useWatch as Q } from "../../node_modules/react-hook-form/dist/index.esm.js";
5
+ import { useTheme as P } from "styled-components";
6
+ import { InnerForm as V } from "./inner-form/index.js";
7
+ import { StyledForm as R, FormContent as W } from "./styles.js";
8
+ import { Button as x } from "../button/index.js";
9
9
  import { Container as l } from "../container/index.js";
10
- const A = ({
10
+ const E = ({
11
11
  alert: n,
12
- buttonAlignment: a,
13
- cancelButton: o,
12
+ buttonAlignment: d,
13
+ cancelButton: e,
14
14
  children: u,
15
- confirmButton: t,
16
- defaultDisabled: x = !0,
17
- id: d = "modal-confirm",
18
- maxButtonWidth: y = "392px",
19
- mode: b,
20
- onSubmit: g,
21
- padding: C = !0,
22
- showButtons: m = !0,
23
- yupSchema: p,
15
+ confirmButton: i,
16
+ defaultDisabled: y = !0,
17
+ id: p = "modal-confirm",
18
+ maxButtonWidth: b,
19
+ mode: g,
20
+ onSubmit: C,
21
+ padding: m = !0,
22
+ showButtons: a = !0,
23
+ yupSchema: c,
24
24
  ...F
25
25
  }) => {
26
- const e = D(), i = j({
26
+ const r = P(), t = k({
27
27
  ...F,
28
- mode: b ?? "all",
29
- resolver: p ? S(p) : void 0
28
+ mode: g ?? "all",
29
+ resolver: c ? j(c) : void 0
30
30
  });
31
- function $(f) {
32
- f.stopPropagation(), i.handleSubmit(g)(f);
31
+ function $(h) {
32
+ h.stopPropagation(), t.handleSubmit(C)(h);
33
33
  }
34
- const v = m ? `calc(100% - ${n ? "139px" : "83px"})` : "100%", c = C ? 1.5 : 0;
35
- return /* @__PURE__ */ r(k, { ...i, children: /* @__PURE__ */ r(P, { onSubmit: $, children: /* @__PURE__ */ s(l, { scroll: "y", width: "100%", children: [
36
- /* @__PURE__ */ r(
37
- R,
34
+ const v = a ? `calc(100% - ${n ? "139px" : "83px"})` : "100%", f = m ? 1.5 : 0, S = b ?? (e ? "392px" : "190px");
35
+ return /* @__PURE__ */ o(D, { ...t, children: /* @__PURE__ */ o(R, { onSubmit: $, children: /* @__PURE__ */ s(l, { scroll: "y", width: "100%", children: [
36
+ /* @__PURE__ */ o(
37
+ W,
38
38
  {
39
- borderRadius: `0 0 ${e.spacing[0.25]} ${e.spacing[0.25]}`,
39
+ $padded: m,
40
+ borderRadius: `0 0 ${r.spacing[0.25]} ${r.spacing[0.25]}`,
40
41
  display: "flex",
41
42
  flexDirection: "column",
42
43
  gap: 0.5,
43
44
  height: v,
44
- pb: c,
45
+ pb: f,
45
46
  pt: 0,
46
- px: c,
47
+ px: f,
47
48
  scroll: "y",
48
49
  children: u
49
50
  }
50
51
  ),
51
- m && /* @__PURE__ */ s(
52
+ a && /* @__PURE__ */ s(
52
53
  l,
53
54
  {
54
- borderRadius: `0 0 ${e.spacing[0.25]} ${e.spacing[0.25]}`,
55
- borderTop: `1px solid ${e.palette.gray[200]}`,
55
+ borderRadius: `0 0 ${r.spacing[0.25]} ${r.spacing[0.25]}`,
56
+ borderTop: `1px solid ${r.palette.gray[200]}`,
56
57
  display: "flex",
57
- flexDirection: a ? "unset" : "column",
58
+ flexDirection: d ? "unset" : "column",
58
59
  gap: 0.625,
59
- justify: a ?? "stretch",
60
+ justify: d ?? "stretch",
60
61
  position: "sticky",
61
62
  px: 1.25,
62
63
  py: 1.25,
63
64
  children: [
64
65
  n,
65
- /* @__PURE__ */ s(l, { display: "flex", gap: 0.75, maxWidth: y, children: [
66
- o ? /* @__PURE__ */ r(
67
- h,
66
+ /* @__PURE__ */ s(l, { display: "flex", gap: 0.75, maxWidth: S, children: [
67
+ e ? /* @__PURE__ */ o(
68
+ x,
68
69
  {
69
- icon: o.icon,
70
- id: `${d}-cancel`,
70
+ icon: e.icon,
71
+ id: `${p}-cancel`,
71
72
  justify: "center",
72
- onClick: o.onClick,
73
+ onClick: e.onClick,
73
74
  type: "reset",
74
75
  variant: "tertiary",
75
76
  width: "100%",
76
- children: o.label ?? "Cancel"
77
+ children: e.label ?? "Cancel"
77
78
  }
78
79
  ) : void 0,
79
- /* @__PURE__ */ r(
80
- h,
80
+ /* @__PURE__ */ o(
81
+ x,
81
82
  {
82
- disabled: (t?.disabled ?? !1) || i.formState.isSubmitting || x && !i.formState.isDirty,
83
- icon: t?.icon,
84
- id: d,
83
+ disabled: (i?.disabled ?? !1) || t.formState.isSubmitting || y && !t.formState.isDirty,
84
+ icon: i?.icon,
85
+ id: p,
85
86
  justify: "center",
86
87
  type: "submit",
87
88
  width: "100%",
88
- children: t?.label ?? "Confirm"
89
+ children: i?.label ?? "Confirm"
89
90
  }
90
91
  )
91
92
  ] })
@@ -95,11 +96,11 @@ const A = ({
95
96
  ] }) }) });
96
97
  };
97
98
  export {
98
- J as Controller,
99
- A as Form,
100
- U as InnerForm,
101
- K as useController,
102
- L as useFieldArray,
103
- M as useFormContext,
104
- N as useWatch
99
+ K as Controller,
100
+ E as Form,
101
+ V as InnerForm,
102
+ L as useController,
103
+ M as useFieldArray,
104
+ N as useFormContext,
105
+ Q as useWatch
105
106
  };
@@ -1,7 +1,11 @@
1
- declare const FormContent: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<Omit<Readonly<import('react').PropsWithChildren<import('../container').IContainerProps>> & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
1
+ declare const FormContent: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<Omit<Readonly<import('react').PropsWithChildren<import('../container').IContainerProps>> & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
2
2
  ref?: ((instance: HTMLDivElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLDivElement> | null | undefined;
3
- }, never> & Partial<Pick<Omit<Readonly<import('react').PropsWithChildren<import('../container').IContainerProps>> & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
3
+ }, "$padded"> & {
4
+ $padded: boolean;
5
+ }, never> & Partial<Pick<import('styled-components').FastOmit<Omit<Readonly<import('react').PropsWithChildren<import('../container').IContainerProps>> & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
4
6
  ref?: ((instance: HTMLDivElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLDivElement> | null | undefined;
7
+ }, "$padded"> & {
8
+ $padded: boolean;
5
9
  }, never>>> & string & Omit<import('react').ForwardRefExoticComponent<Readonly<import('react').PropsWithChildren<import('../container').IContainerProps>> & import('react').RefAttributes<HTMLDivElement>>, keyof import('react').Component<any, {}, any>>;
6
10
  declare const StyledForm: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, never>>> & string;
7
11
  export { FormContent, StyledForm };
@@ -1,26 +1,30 @@
1
- import { styled as o } from "styled-components";
2
- import { Container as e } from "../container/index.js";
3
- const l = o(e)`
1
+ import { styled as i } from "styled-components";
2
+ import { Container as n } from "../container/index.js";
3
+ const e = i(n)`
4
4
  > * {
5
5
  flex-shrink: 0;
6
6
  }
7
7
 
8
- &:has(> #sticky-footer) {
9
- height: auto;
10
- overflow: visible;
11
- }
12
- `, n = o.form`
13
- ${({ theme: t }) => `
8
+ ${({ $padded: o, theme: t }) => o ? "" : `
9
+ > #footer {
10
+ box-sizing: content-box;
11
+ padding-bottom: ${t.spacing[1.25]};
12
+ padding-left: ${t.spacing[1.25]};
13
+ padding-right: ${t.spacing[1.25]};
14
+ }
15
+ `}
16
+ `, s = i.form`
17
+ ${({ theme: o }) => `
14
18
  align-items: flex-start;
15
19
  align-self: stretch;
16
20
  display: flex;
17
21
  flex-direction: column;
18
- gap: ${t.spacing[0.5]};
22
+ gap: ${o.spacing[0.5]};
19
23
  overflow: hidden auto;
20
24
  width: 100%;
21
25
  `}
22
26
  `;
23
27
  export {
24
- l as FormContent,
25
- n as StyledForm
28
+ e as FormContent,
29
+ s as StyledForm
26
30
  };
@@ -29,7 +29,7 @@ interface IButtonProps {
29
29
  * @property { IButtonProps } [confirmButton] - The confirm button props.
30
30
  * @property { boolean } [defaultDisabled] - Whether the submit button is disabled by default.
31
31
  * @property { string } [id] - The form id.
32
- * @property { string } [maxButtonWidth] - The max button width.
32
+ * @property { string } [maxButtonWidth] - The max width of the buttons row. Defaults to 392px with a cancel button, or 190px for a single button.
33
33
  * @property { Function } onSubmit - The callback to be called when the form is submitted.
34
34
  * @property { boolean } [showButtons] - Whether to show the action buttons.
35
35
  * @property { Schema } [yupSchema] - The yup schema for form validation.
@@ -1,58 +1,61 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as b } from "react";
3
- import { IconWrap as g } from "./styles.js";
4
- const w = b(function({
5
- clickable: d,
6
- disabled: i,
7
- hoverColor: l,
8
- icon: o,
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as u } from "react";
3
+ import { IconWrap as N } from "./styles.js";
4
+ const S = {
5
+ "fa-gradient": "fa-solid",
6
+ "fa-kit-duotone": "fakd"
7
+ }, E = u(function({
8
+ clickable: s,
9
+ disabled: d,
10
+ hoverColor: i,
11
+ icon: a,
9
12
  iconClass: n = "",
10
- iconColor: c,
13
+ iconColor: l,
11
14
  iconMask: r,
12
15
  iconSize: f,
13
- iconTransform: e,
14
- iconType: a = "fa-solid",
15
- onClick: $,
16
- rotation: m,
17
- spanClass: p,
18
- secondaryColor: v,
19
- secondaryOpacity: I,
20
- ...y
16
+ iconTransform: t,
17
+ iconType: o = "fa-solid",
18
+ onClick: c,
19
+ rotation: $,
20
+ spanClass: m,
21
+ secondaryColor: I,
22
+ secondaryOpacity: p,
23
+ ...v
21
24
  }, C) {
22
- const t = a === "fa-gradient", N = [
23
- t ? "fa-solid" : a,
24
- `fa-${o}`,
25
- t ? "fill-gradient-01" : "",
25
+ const g = o === "fa-gradient", k = [
26
+ S[o] ?? o,
27
+ `fa-${a}`,
28
+ g ? "fill-gradient-01" : "",
26
29
  n
27
30
  ].filter(Boolean).join(" ");
28
- return /* @__PURE__ */ s(
29
- g,
31
+ return /* @__PURE__ */ e(
32
+ N,
30
33
  {
31
- $clickable: d,
32
- $color: c,
33
- $disabled: i,
34
- $hoverColor: l,
35
- $rotation: m,
36
- $secondaryColor: v,
37
- $secondaryOpacity: I,
34
+ $clickable: s,
35
+ $color: l,
36
+ $disabled: d,
37
+ $hoverColor: i,
38
+ $rotation: $,
39
+ $secondaryColor: I,
40
+ $secondaryOpacity: p,
38
41
  $size: f,
39
- className: p,
40
- "data-testid": `${o}-icon`,
41
- onClick: $,
42
+ className: m,
43
+ "data-testid": `${a}-icon`,
44
+ onClick: c,
42
45
  ref: C,
43
- ...y,
44
- children: /* @__PURE__ */ s(
46
+ ...v,
47
+ children: /* @__PURE__ */ e(
45
48
  "i",
46
49
  {
47
- className: N,
50
+ className: k,
48
51
  ...r !== void 0 ? { "data-fa-mask": r } : {},
49
- ...e !== void 0 ? { "data-fa-transform": e } : {}
52
+ ...t !== void 0 ? { "data-fa-transform": t } : {}
50
53
  }
51
54
  )
52
55
  },
53
- `${a}-${o}`
56
+ `${o}-${a}`
54
57
  );
55
58
  });
56
59
  export {
57
- w as Icon
60
+ E as Icon
58
61
  };
@@ -1,25 +1,27 @@
1
1
  import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
- import { l as x } from "../../../_virtual/lodash.js";
2
+ import { l as C } from "../../../_virtual/lodash.js";
3
3
  import { useCallback as l } from "react";
4
- import { Footer as C } from "../styles.js";
4
+ import { useTheme as f } from "styled-components";
5
+ import { Footer as k } from "../styles.js";
5
6
  import { Button as s } from "../../button/index.js";
6
- import { Container as f } from "../../container/index.js";
7
+ import { Container as n } from "../../container/index.js";
7
8
  const w = ({
8
9
  alert: p,
9
10
  modalRef: a,
10
11
  confirmButton: i = void 0,
11
12
  cancelButton: r = void 0
12
13
  }) => {
13
- const { close: o } = a, h = l(() => {
14
+ const m = f(), { close: o } = a, t = l(() => {
14
15
  r?.onClick && r.onClick(), o();
15
- }, [r, o]), m = l(() => {
16
+ }, [r, o]), h = l(() => {
16
17
  i?.onClick && i.onClick(), o();
17
18
  }, [i, o]);
18
19
  return [i, r].some(
19
- (t) => !x.isEmpty(t)
20
+ (x) => !C.isEmpty(x)
20
21
  ) ? /* @__PURE__ */ d(
21
- f,
22
+ n,
22
23
  {
24
+ borderTop: `1px solid ${m.palette.gray[200]}`,
23
25
  display: "flex",
24
26
  flexDirection: "column",
25
27
  gap: 0.625,
@@ -29,12 +31,12 @@ const w = ({
29
31
  py: 1.25,
30
32
  children: [
31
33
  p,
32
- /* @__PURE__ */ e(C, { children: /* @__PURE__ */ d("div", { children: [
34
+ /* @__PURE__ */ e(k, { children: /* @__PURE__ */ d("div", { children: [
33
35
  r && /* @__PURE__ */ e(
34
36
  s,
35
37
  {
36
38
  id: r.id,
37
- onClick: h,
39
+ onClick: t,
38
40
  variant: i ? "tertiary" : "primary",
39
41
  width: "100%",
40
42
  children: r.text
@@ -44,7 +46,7 @@ const w = ({
44
46
  s,
45
47
  {
46
48
  id: i.id,
47
- onClick: m,
49
+ onClick: h,
48
50
  variant: "primary",
49
51
  width: "100%",
50
52
  children: i.text
@@ -1,107 +1,91 @@
1
- import { jsx as r, jsxs as v } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as g } from "react/jsx-runtime";
2
2
  import o from "../../_virtual/lodash.js";
3
- import { useState as E, useRef as y, useEffect as F } from "react";
4
- import { createPortal as $ } from "react-dom";
5
- import { useTheme as z } from "styled-components";
6
- import { Dialog as k } from "./dialog/index.js";
7
- import { ModalFooter as A } from "./footer/index.js";
8
- import { Header as D } from "./header/index.js";
9
- import { ModalConfirm as si } from "./modal-confirm/index.js";
10
- import { ModalContainer as I, ModalContent as w, ImageContainer as B } from "./styles.js";
11
- import { CloudImage as N } from "../cloud-image/index.js";
12
- import { Container as P } from "../container/index.js";
13
- import { Tabs as _ } from "../tabs/index.js";
3
+ import { useState as S, useRef as h, useEffect as T } from "react";
4
+ import { createPortal as F } from "react-dom";
5
+ import { Dialog as z } from "./dialog/index.js";
6
+ import { ModalFooter as E } from "./footer/index.js";
7
+ import { Header as k } from "./header/index.js";
8
+ import { ModalConfirm as ei } from "./modal-confirm/index.js";
9
+ import { ModalContainer as A, ModalContent as B, ImageContainer as D } from "./styles.js";
10
+ import { CloudImage as I } from "../cloud-image/index.js";
11
+ import { Container as $ } from "../container/index.js";
12
+ import { Tabs as w } from "../tabs/index.js";
14
13
  import "../typography/heading/index.js";
15
14
  import "../typography/span/index.js";
16
- import { Text as q } from "../typography/text/index.js";
17
- import { ColumnsModal as ai } from "./columns-modal/index.js";
18
- const oi = ({
19
- _portal: b = !0,
20
- alert: C,
21
- cancelButton: n = void 0,
22
- children: l = void 0,
23
- confirmButton: p = void 0,
15
+ import { Text as N } from "../typography/text/index.js";
16
+ import { ColumnsModal as ti } from "./columns-modal/index.js";
17
+ const R = ({
18
+ _portal: v = !0,
19
+ alert: x,
20
+ cancelButton: y = void 0,
21
+ children: n = void 0,
22
+ confirmButton: C = void 0,
24
23
  content: i = void 0,
25
24
  description: M = void 0,
26
25
  dismissable: O = !0,
27
- headerActions: T = void 0,
26
+ headerActions: b = void 0,
28
27
  modalRef: e,
29
28
  onClose: j = void 0,
30
29
  tabItems: t = void 0,
31
- title: s = void 0,
30
+ title: d = void 0,
32
31
  size: H,
33
- id: c = "modal-container"
32
+ id: l = "modal-container"
34
33
  }) => {
35
- const f = z(), [g, u] = E(void 0), d = y(null), a = y(!1), m = Array.isArray(t) && t.length > 0, S = n ?? p;
36
- F(() => {
37
- if (m && !a.current && d.current) {
38
- const x = d.current.getBoundingClientRect().height;
39
- x > 50 && (u(x), a.current = !0);
34
+ const [p, c] = S(void 0), s = h(null), a = h(!1), m = Array.isArray(t) && t.length > 0;
35
+ T(() => {
36
+ if (m && !a.current && s.current) {
37
+ const u = s.current.getBoundingClientRect().height;
38
+ u > 50 && (c(u), a.current = !0);
40
39
  }
41
- e.isOpen || (u(void 0), a.current = !1);
40
+ e.isOpen || (c(void 0), a.current = !1);
42
41
  }, [m, e.isOpen]);
43
- const h = /* @__PURE__ */ r(k, { id: "modal-wrapper", label: e.name, children: /* @__PURE__ */ v(
44
- I,
42
+ const f = /* @__PURE__ */ r(z, { id: "modal-wrapper", label: e.name, children: /* @__PURE__ */ g(
43
+ A,
45
44
  {
46
45
  $size: H,
47
- "data-testid": c,
46
+ "data-testid": l,
48
47
  flexDirection: "column",
49
- id: c,
50
- ref: m ? d : void 0,
51
- style: m && g ? { height: g } : void 0,
48
+ id: l,
49
+ ref: m ? s : void 0,
50
+ style: m && p ? { height: p } : void 0,
52
51
  children: [
53
- !o.isEmpty(s) && !o.isNil(s) && /* @__PURE__ */ r(
54
- D,
52
+ !o.isEmpty(d) && !o.isNil(d) && /* @__PURE__ */ r(
53
+ k,
55
54
  {
56
55
  description: M,
57
56
  dismissable: O,
58
- headerActions: T,
57
+ headerActions: b,
59
58
  modalRef: e,
60
59
  onClose: j,
61
- title: s
62
- }
63
- ),
64
- t && /* @__PURE__ */ r(
65
- P,
66
- {
67
- borderTop: `1px solid ${f.palette.gray[300]}`,
68
- display: "block",
69
- mb: 1.25,
70
- position: "sticky",
71
- children: /* @__PURE__ */ r(_, { items: t })
72
- }
73
- ),
74
- (o.isObject(i) || l) && /* @__PURE__ */ v(
75
- w,
76
- {
77
- style: S ? { borderBottom: `1px solid ${f.palette.gray[200]}` } : void 0,
78
- children: [
79
- l,
80
- o.isObject(i) && o.isString(i.imageSrc) && /* @__PURE__ */ r(B, { $framed: i.imageFramed, children: /* @__PURE__ */ r(N, { alt: "modal-img", publicId: i.imageSrc }) }),
81
- o.isObject(i) && o.isString(i.imageText) && /* @__PURE__ */ r(q, { size: "md", children: i.imageText })
82
- ]
60
+ title: d
83
61
  }
84
62
  ),
63
+ t && /* @__PURE__ */ r($, { display: "block", position: "sticky", children: /* @__PURE__ */ r(w, { items: t }) }),
64
+ (o.isObject(i) || n) && /* @__PURE__ */ g(B, { children: [
65
+ n,
66
+ o.isObject(i) && o.isString(i.imageSrc) && /* @__PURE__ */ r(D, { $framed: i.imageFramed, children: /* @__PURE__ */ r(I, { alt: "modal-img", publicId: i.imageSrc }) }),
67
+ o.isObject(i) && o.isString(i.imageText) && /* @__PURE__ */ r(N, { size: "md", children: i.imageText })
68
+ ] }),
85
69
  /* @__PURE__ */ r(
86
- A,
70
+ E,
87
71
  {
88
- alert: C,
89
- cancelButton: n,
90
- confirmButton: p,
72
+ alert: x,
73
+ cancelButton: y,
74
+ confirmButton: C,
91
75
  modalRef: e
92
76
  }
93
77
  )
94
78
  ]
95
79
  }
96
80
  ) });
97
- return b && e.isOpen ? $(
98
- h,
81
+ return v && e.isOpen ? F(
82
+ f,
99
83
  document.getElementById("portals") ?? document.body
100
- ) : e.isOpen ? h : null;
84
+ ) : e.isOpen ? f : null;
101
85
  };
102
86
  export {
103
- ai as ColumnsModal,
104
- oi as Modal,
105
- si as ModalConfirm,
106
- A as ModalFooter
87
+ ti as ColumnsModal,
88
+ R as Modal,
89
+ ei as ModalConfirm,
90
+ E as ModalFooter
107
91
  };
@@ -1,31 +1,17 @@
1
1
  import { Meta, StoryFn } from '@storybook/react-vite';
2
2
  import { default as React } from 'react';
3
3
  import { IModalProps } from './types';
4
- declare const config: Meta;
5
- declare const Default: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
6
- id: string;
7
- }>>;
8
- declare const WithForm: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
9
- id: string;
10
- }>>;
11
- declare const WithTabsAndLongForm: StoryFn;
12
- declare const WithStickyConfirm: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
13
- id: string;
14
- }>>;
15
- declare const ScrollableContent: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
16
- id: string;
17
- }>>;
18
- declare const SingleAction: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
19
- id: string;
20
- }>>;
21
- declare const WithoutFooter: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
22
- id: string;
23
- }>>;
24
- declare const ImageModal: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
25
- id: string;
26
- }>>;
27
- declare const WithTabs: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IModalProps & {
28
- id: string;
29
- }>>;
4
+ type TContentExample = "Inputs" | "None" | "Text" | "Text with tags and alert";
5
+ interface IStoryProps extends IModalProps {
6
+ contentExample?: TContentExample;
7
+ footerAlert?: boolean;
8
+ id: string;
9
+ }
10
+ declare const config: Meta<IStoryProps>;
11
+ declare const Default: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IStoryProps>>;
12
+ declare const ImageModal: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IStoryProps>>;
13
+ declare const WithTabs: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, React.PropsWithChildren<IStoryProps>>;
14
+ declare const LongContent: StoryFn;
15
+ declare const LongForm: StoryFn;
30
16
  export default config;
31
- export { Default, ImageModal, WithTabs, ScrollableContent, SingleAction, WithoutFooter, WithForm, WithStickyConfirm, WithTabsAndLongForm, };
17
+ export { Default, ImageModal, WithTabs, LongContent, LongForm };
@@ -1,3 +1,3 @@
1
1
  import { IModalConfirmProps } from '../types';
2
- declare const ModalConfirm: ({ disabled, id, onCancel, onConfirm, sticky, txtCancel, txtConfirm, }: Readonly<IModalConfirmProps>) => JSX.Element;
2
+ declare const ModalConfirm: ({ disabled, id, onCancel, onConfirm, txtCancel, txtConfirm, }: Readonly<IModalConfirmProps>) => JSX.Element;
3
3
  export { ModalConfirm };
@@ -1,18 +1,17 @@
1
- import { jsx as i, jsxs as f } from "react/jsx-runtime";
2
- import { useTheme as u } from "styled-components";
1
+ import { jsxs as s, jsx as m } from "react/jsx-runtime";
3
2
  import { Button as n } from "../../button/index.js";
4
- import { Container as p } from "../../container/index.js";
5
- const j = ({
6
- disabled: a,
7
- id: o = "modal-confirm",
3
+ import { Container as c } from "../../container/index.js";
4
+ const u = ({
5
+ disabled: e,
6
+ id: i = "modal-confirm",
8
7
  onCancel: t,
9
8
  onConfirm: r = "submit",
10
- sticky: c = !1,
11
- txtCancel: d,
12
- txtConfirm: l
9
+ txtCancel: a,
10
+ txtConfirm: d
13
11
  }) => {
14
- const e = u(), m = r === "submit", s = /* @__PURE__ */ f(
15
- p,
12
+ const o = r === "submit";
13
+ return /* @__PURE__ */ s(
14
+ c,
16
15
  {
17
16
  display: "flex",
18
17
  gap: 0.75,
@@ -20,47 +19,34 @@ const j = ({
20
19
  maxWidth: t ? "392px" : "190px",
21
20
  mt: 1.5,
22
21
  children: [
23
- t ? /* @__PURE__ */ i(
22
+ t ? /* @__PURE__ */ m(
24
23
  n,
25
24
  {
26
- id: `${o}-cancel`,
25
+ id: `${i}-cancel`,
27
26
  justify: "center",
28
27
  onClick: t,
29
28
  variant: "tertiary",
30
29
  width: "100%",
31
- children: d ?? "Cancel"
30
+ children: a ?? "Cancel"
32
31
  }
33
32
  ) : void 0,
34
- /* @__PURE__ */ i(
33
+ /* @__PURE__ */ m(
35
34
  n,
36
35
  {
37
- disabled: a,
38
- id: o,
36
+ disabled: e,
37
+ id: i,
39
38
  justify: "center",
40
- onClick: m ? void 0 : r,
41
- type: m ? "submit" : "button",
39
+ onClick: o ? void 0 : r,
40
+ type: o ? "submit" : "button",
42
41
  variant: "primary",
43
42
  width: "100%",
44
- children: l ?? "Confirm"
43
+ children: d ?? "Confirm"
45
44
  }
46
45
  )
47
46
  ]
48
47
  }
49
48
  );
50
- return c ? /* @__PURE__ */ i(
51
- p,
52
- {
53
- bgColor: e.palette.white,
54
- borderTop: `1px solid ${e.palette.gray[200]}`,
55
- bottom: "0",
56
- id: "sticky-footer",
57
- pb: 1.25,
58
- position: "sticky",
59
- px: 1.25,
60
- children: s
61
- }
62
- ) : s;
63
49
  };
64
50
  export {
65
- j as ModalConfirm
51
+ u as ModalConfirm
66
52
  };
@@ -1,7 +1,8 @@
1
1
  import { styled as a } from "styled-components";
2
- import { variantBuilder as n } from "../@core/variants/utils.js";
3
- import { Container as t } from "../container/index.js";
4
- const { getVariant: r } = n(
2
+ import { variantBuilder as p } from "../@core/variants/utils.js";
3
+ import { Container as c } from "../container/index.js";
4
+ import { FormContent as g } from "../form/styles.js";
5
+ const { getVariant: l } = p(
5
6
  (i) => ({
6
7
  fixed: `
7
8
  height: auto;
@@ -31,7 +32,7 @@ const { getVariant: r } = n(
31
32
  }
32
33
  `
33
34
  })
34
- ), l = a.div.attrs({
35
+ ), b = a.div.attrs({
35
36
  className: "comp-modal fixed inset-0 overflow-auto"
36
37
  })`
37
38
  align-items: center;
@@ -39,7 +40,7 @@ const { getVariant: r } = n(
39
40
  display: flex;
40
41
  justify-content: center;
41
42
  z-index: 99999;
42
- `, c = a(t)`
43
+ `, w = a(c)`
43
44
  ${({ theme: i, $size: o }) => `
44
45
  background-color: ${i.palette.white};
45
46
  border: 1px solid ${i.palette.gray[200]};
@@ -58,9 +59,12 @@ const { getVariant: r } = n(
58
59
  margin-top: auto;
59
60
  }
60
61
 
61
- ${r(i, o)}
62
+ ${l(i, o)}
62
63
  `}
63
- `, p = a.div`
64
+ `, t = (i, o) => {
65
+ const n = i.spacing[1.5], r = `1px + ${i.spacing[1.25]}`, d = `${i.spacing[1.25]} + 2 * ${o} + 2px`, s = i.spacing[0.5];
66
+ return `calc(${n} + ${r} + ${d} + ${s})`;
67
+ }, m = a.div`
64
68
  ${({ theme: i }) => `
65
69
  background-color: ${i.palette.white};
66
70
  border-radius: 0 0 ${i.spacing[0.25]} ${i.spacing[0.25]};
@@ -68,32 +72,57 @@ const { getVariant: r } = n(
68
72
  flex-direction: column;
69
73
  flex-grow: 1;
70
74
  overflow: hidden auto;
71
- padding: 0 ${i.spacing[1.5]} ${i.spacing[1.5]} ${i.spacing[1.5]};
75
+ padding: ${i.spacing[1.25]} ${i.spacing[1.5]} ${i.spacing[1.5]};
72
76
  scrollbar-color: ${i.palette.gray[600]} ${i.palette.gray[100]};
73
77
  scroll-padding: ${i.spacing[0.5]};
74
78
 
75
- &:has(form) {
76
- flex-direction: unset;
77
- overflow: hidden;
78
- padding: 0;
79
+ &,
80
+ ${g} {
81
+ > #footer {
82
+ background-color: ${i.palette.white};
83
+ border-top: 1px solid transparent;
84
+ border-image: linear-gradient(
85
+ ${i.palette.gray[200]},
86
+ ${i.palette.gray[200]}
87
+ )
88
+ 1 / 1px 0 0 / 0 100vmax;
89
+ bottom: 0;
90
+ box-shadow: 0 0 0 100vmax ${i.palette.white};
91
+ clip-path: inset(0 -100vmax -100vmax);
92
+ padding-top: ${i.spacing[1.25]};
93
+ position: sticky;
94
+ z-index: 1;
95
+ }
79
96
 
80
- > form > div {
81
- flex-grow: 1;
97
+ > :has(+ #footer) {
98
+ margin-bottom: auto;
99
+ }
100
+
101
+ > #footer:first-child {
102
+ margin-top: auto;
103
+ }
104
+
105
+ &:has(> #footer) {
106
+ scroll-padding-bottom: ${t(i, i.spacing[0.625])};
107
+
108
+ @media screen and (max-width: ${i.breakpoints.mobile}) {
109
+ scroll-padding-bottom: ${t(i, i.spacing[1])};
110
+ }
82
111
  }
83
112
  }
84
113
 
85
- &:has(#footer) {
86
- flex-direction: column;
114
+ &:has(form) {
115
+ flex-direction: unset;
87
116
  overflow: hidden;
88
- height: 100%;
117
+ padding: ${i.spacing[1.25]} 0 0;
89
118
 
90
- > *:not(#footer) {
91
- flex: 1 1 auto;
92
- overflow-y: auto;
119
+ > form > div {
120
+ flex-grow: 1;
93
121
  }
94
122
  }
95
123
  `}
96
- `, g = a.div`
124
+ `, u = a.div`
125
+ border-bottom: 1px solid ${({ theme: i }) => i.palette.gray[200]};
97
126
  border-radius: ${({ theme: i }) => `${i.spacing[0.25]} ${i.spacing[0.25]} 0 0`};
98
127
  display: block;
99
128
  overflow: unset;
@@ -104,9 +133,9 @@ const { getVariant: r } = n(
104
133
  padding-bottom: ${({ theme: i }) => `${i.spacing[1.5]}`};
105
134
  position: sticky;
106
135
  z-index: 1;
107
- `, f = a.div.attrs({
136
+ `, y = a.div.attrs({
108
137
  className: "flex items-center justify-between"
109
- })``, $ = a.div`
138
+ })``, v = a.div`
110
139
  ${({ theme: i }) => `
111
140
  border-radius: 0 0 ${i.spacing[0.25]} ${i.spacing[0.25]};
112
141
  display: flex;
@@ -137,7 +166,7 @@ const { getVariant: r } = n(
137
166
  margin-right: 0;
138
167
  }
139
168
  `}
140
- `, x = a.div`
169
+ `, h = a.div`
141
170
  img {
142
171
  margin: 0 calc(-${({ theme: i }) => i.spacing[1.25]} - 1px)
143
172
  ${({ theme: i }) => i.spacing[1.25]};
@@ -155,11 +184,11 @@ const { getVariant: r } = n(
155
184
  }
156
185
  `;
157
186
  export {
158
- $ as Footer,
159
- g as Header,
160
- x as ImageContainer,
161
- c as ModalContainer,
162
- p as ModalContent,
163
- l as ModalWrapper,
164
- f as Title
187
+ v as Footer,
188
+ u as Header,
189
+ h as ImageContainer,
190
+ w as ModalContainer,
191
+ m as ModalContent,
192
+ b as ModalWrapper,
193
+ y as Title
165
194
  };
@@ -54,12 +54,12 @@ interface IModalHeaderAction {
54
54
  tooltip?: string;
55
55
  visible?: boolean;
56
56
  }
57
- type TModalHeaderActions = readonly [IModalHeaderAction, IModalHeaderAction, IModalHeaderAction] | readonly [IModalHeaderAction, IModalHeaderAction] | readonly [IModalHeaderAction];
57
+ type TModalHeaderActions = readonly [IModalHeaderAction, IModalHeaderAction] | readonly [IModalHeaderAction];
58
58
  /**
59
59
  * Modal header component props.
60
60
  * @interface IModalHeaderProps
61
61
  * @property { React.ReactNode | string } [description] - The description of the modal.
62
- * @property { TModalHeaderActions } [headerActions] - Up to three buttons shown left of the close button.
62
+ * @property { TModalHeaderActions } [headerActions] - Up to two buttons shown left of the close button.
63
63
  * @property { IUseModal } [modalRef] - The modal reference.
64
64
  * @property { Function } [onClose] - The function to call when the modal is closed.
65
65
  * @property { React.ReactNode | string } [title] - The title of the modal.
@@ -111,7 +111,6 @@ interface IModalProps extends Omit<IModalHeaderProps, "modalRef">, IModalFooterP
111
111
  * @property { string } [id] - The id of the confirm button.
112
112
  * @property { Function } [onCancel] - The function to call when the cancel button is clicked.
113
113
  * @property { "submit" | Function } [onConfirm] - The function to call when the confirm button is clicked.
114
- * @property { boolean } [sticky] - Whether the buttons stay at the bottom while the content scrolls.
115
114
  * @property { string } [txtCancel] - The text of the cancel button.
116
115
  * @property { React.ReactNode | string } [txtConfirm] - The text of the confirm button.
117
116
  */
@@ -120,7 +119,6 @@ interface IModalConfirmProps {
120
119
  id?: string;
121
120
  onCancel?: () => void;
122
121
  onConfirm?: "submit" | (() => void);
123
- sticky?: boolean;
124
122
  txtCancel?: string;
125
123
  txtConfirm?: React.ReactNode | string;
126
124
  }
@@ -4,8 +4,8 @@ import { useMemo as l, useCallback as c } from "react";
4
4
  import { Button as f } from "../../button/index.js";
5
5
  import "../../../_virtual/lodash.js";
6
6
  import "react-dom";
7
- import "styled-components";
8
7
  import { useColumnsModal as b } from "../../../hooks/use-columns-modal.js";
8
+ import "styled-components";
9
9
  import "../../container/index.js";
10
10
  import "../../icon-button/index.js";
11
11
  import "../../typography/heading/index.js";
package/package.json CHANGED
@@ -135,5 +135,5 @@
135
135
  "./dist/index.js"
136
136
  ],
137
137
  "typings": "./dist/index.d.ts",
138
- "version": "10.4.1"
138
+ "version": "11.0.1"
139
139
  }