gd-design-library 1.3.0 → 1.4.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.
Files changed (74) hide show
  1. package/ai/schemas/components/InputFile.d.ts +1 -1
  2. package/ai/schemas/components/Table.d.ts +78 -0
  3. package/ai/schemas/components/Truncate.d.ts +46 -0
  4. package/components/core/Button/Button.js +14 -14
  5. package/components/core/Input/Input.js +61 -61
  6. package/components/core/Input/Input.types.d.ts +0 -1
  7. package/components/core/Input/InputWrapper/InputWrapper.js +10 -11
  8. package/components/core/Input/InputWrapper/InputWrapperStyled.js +13 -16
  9. package/components/core/Input/constants.d.ts +0 -1
  10. package/components/core/Input/constants.js +10 -12
  11. package/components/core/Modal/Modal.js +42 -53
  12. package/components/core/Modal/Modal.stories.play.d.ts +5 -0
  13. package/components/core/Modal/Modal.types.d.ts +1 -0
  14. package/components/core/Table/Table.d.ts +2 -0
  15. package/components/core/Table/Table.js +275 -0
  16. package/components/core/Table/Table.types.d.ts +94 -0
  17. package/components/core/Table/TableBody.d.ts +2 -0
  18. package/components/core/Table/TableBody.js +20 -0
  19. package/components/core/Table/TableCell.d.ts +2 -0
  20. package/components/core/Table/TableCell.js +20 -0
  21. package/components/core/Table/TableFooter.d.ts +2 -0
  22. package/components/core/Table/TableFooter.js +21 -0
  23. package/components/core/Table/TableHead.d.ts +2 -0
  24. package/components/core/Table/TableHead.js +20 -0
  25. package/components/core/Table/TableHeaderCell.d.ts +2 -0
  26. package/components/core/Table/TableHeaderCell.js +20 -0
  27. package/components/core/Table/TablePagination.d.ts +2 -0
  28. package/components/core/Table/TablePagination.js +66 -0
  29. package/components/core/Table/TableRow.d.ts +2 -0
  30. package/components/core/Table/TableRow.js +28 -0
  31. package/components/core/Table/TableStyled.d.ts +11 -0
  32. package/components/core/Table/TableStyled.js +141 -0
  33. package/components/core/Table/constants.d.ts +9 -0
  34. package/components/core/Table/constants.js +12 -0
  35. package/components/core/Table/index.d.ts +9 -0
  36. package/components/core/Tooltip/Tooltip.js +49 -58
  37. package/components/core/Truncate/Truncate.d.ts +2 -0
  38. package/components/core/Truncate/Truncate.js +52 -0
  39. package/components/core/Truncate/Truncate.types.d.ts +12 -0
  40. package/components/core/Truncate/TruncateStyled.d.ts +2 -0
  41. package/components/core/Truncate/TruncateStyled.js +22 -0
  42. package/components/core/Truncate/constants.d.ts +1 -0
  43. package/components/core/Truncate/constants.js +4 -0
  44. package/components/core/Truncate/index.d.ts +2 -0
  45. package/components/core/index.d.ts +2 -0
  46. package/components/domainSpecific/Counter/Counter.stories.play.d.ts +6 -0
  47. package/components/domainSpecific/DragAndDropFiles/DragAndDropFiles.stories.play.d.ts +5 -0
  48. package/components/domainSpecific/Price/Price.stories.play.d.ts +8 -0
  49. package/components/domainSpecific/Search/Search.js +4 -4
  50. package/components/domainSpecific/Search/Search.stories.play.d.ts +5 -0
  51. package/hooks/useTheme/NoOpTheme.d.ts +150 -14
  52. package/index.js +336 -316
  53. package/llms.txt +14 -1
  54. package/package.json +4 -2
  55. package/tokens/borders.d.ts +1 -1
  56. package/tokens/borders.js +8 -9
  57. package/tokens/button.d.ts +1 -1
  58. package/tokens/defaultTheme.d.ts +150 -14
  59. package/tokens/defaultTheme.js +24 -20
  60. package/tokens/index.d.ts +26 -14
  61. package/tokens/index.js +8 -5
  62. package/tokens/input.d.ts +14 -13
  63. package/tokens/input.js +50 -49
  64. package/tokens/table.d.ts +124 -0
  65. package/tokens/table.js +128 -0
  66. package/tokens/tooltip.d.ts +2 -1
  67. package/tokens/tooltip.js +2 -1
  68. package/tokens/truncate.d.ts +9 -0
  69. package/tokens/truncate.js +12 -0
  70. package/tokens/utils.d.ts +1 -1
  71. package/tokens/utils.js +32 -33
  72. package/utils/play/index.d.ts +1 -0
  73. package/utils/play/interactionUtils.d.ts +16 -0
  74. package/utils/play/mockUtils.d.ts +14 -0
@@ -25,7 +25,7 @@ declare const _default: {
25
25
  name: string;
26
26
  type: string;
27
27
  description: string;
28
- enum: (string | boolean)[];
28
+ enum: readonly ["user", "environment"];
29
29
  default: string;
30
30
  required?: undefined;
31
31
  } | {
@@ -0,0 +1,78 @@
1
+ declare const _default: {
2
+ component: {
3
+ name: string;
4
+ import: string;
5
+ description: string;
6
+ category: string;
7
+ complexity: string;
8
+ accessibility: string;
9
+ performance: string;
10
+ dependencies: string[];
11
+ peerDependencies: string[];
12
+ bundleSize: string;
13
+ browserSupport: string;
14
+ touchSupport: boolean;
15
+ keyboardSupport: boolean;
16
+ screenReaderSupport: boolean;
17
+ props: ({
18
+ name: string;
19
+ type: string;
20
+ description: string;
21
+ required: boolean;
22
+ example: string;
23
+ default?: undefined;
24
+ } | {
25
+ name: string;
26
+ type: string;
27
+ description: string;
28
+ default: boolean;
29
+ required?: undefined;
30
+ example?: undefined;
31
+ } | {
32
+ name: string;
33
+ type: string;
34
+ description: string;
35
+ default: number;
36
+ required?: undefined;
37
+ example?: undefined;
38
+ } | {
39
+ name: string;
40
+ type: string;
41
+ description: string;
42
+ example: string;
43
+ required?: undefined;
44
+ default?: undefined;
45
+ } | {
46
+ name: string;
47
+ type: string;
48
+ description: string;
49
+ default: number[];
50
+ example: string;
51
+ required?: undefined;
52
+ } | {
53
+ name: string;
54
+ type: string;
55
+ description: string;
56
+ required?: undefined;
57
+ example?: undefined;
58
+ default?: undefined;
59
+ })[];
60
+ ref: {
61
+ type: string;
62
+ description: string;
63
+ methods: {
64
+ name: string;
65
+ type: string;
66
+ description: string;
67
+ example: string;
68
+ }[];
69
+ example: string;
70
+ };
71
+ examples: string[];
72
+ bestPractices: string[];
73
+ commonMistakes: string[];
74
+ relatedComponents: string[];
75
+ };
76
+ compositionTips: string[];
77
+ };
78
+ export default _default;
@@ -0,0 +1,46 @@
1
+ declare const _default: {
2
+ component: {
3
+ name: string;
4
+ import: string;
5
+ description: string;
6
+ category: string;
7
+ complexity: string;
8
+ accessibility: string;
9
+ performance: string;
10
+ dependencies: string[];
11
+ peerDependencies: string[];
12
+ bundleSize: string;
13
+ browserSupport: string;
14
+ touchSupport: boolean;
15
+ keyboardSupport: boolean;
16
+ screenReaderSupport: boolean;
17
+ props: ({
18
+ name: string;
19
+ type: string;
20
+ description: string;
21
+ required: boolean;
22
+ default?: undefined;
23
+ } | {
24
+ name: string;
25
+ type: string;
26
+ description: string;
27
+ default: number;
28
+ required?: undefined;
29
+ } | {
30
+ name: string;
31
+ type: string;
32
+ description: string;
33
+ default: {};
34
+ required?: undefined;
35
+ } | {
36
+ name: string;
37
+ type: string;
38
+ description: string;
39
+ required?: undefined;
40
+ default?: undefined;
41
+ })[];
42
+ examples: string[];
43
+ };
44
+ compositionTips: string[];
45
+ };
46
+ export default _default;
@@ -8,32 +8,32 @@ import { ButtonVariant as v, ButtonTypes as P, ButtonRole as M } from "../../../
8
8
  import { useTheme as O } from "../../../hooks/useTheme/useTheme.js";
9
9
  import { get as R } from "../../../utils/helpers.js";
10
10
  import { TabIndex as W } from "../../../types/accesability.js";
11
- const g = x((u, m) => {
11
+ const g = x((s, u) => {
12
12
  const {
13
13
  theme: t
14
14
  } = O(), {
15
- variant: c = v.Primary,
16
- rounded: f = R(t, "button.attrs.rounded", "none"),
15
+ variant: m = v.Primary,
16
+ rounded: c = R(t, "button.attrs.rounded", "none"),
17
17
  children: o,
18
18
  iconStart: r = null,
19
19
  iconEnd: a = null,
20
- type: p = P.Button,
21
- disabled: y = !1,
22
- isIcon: h = !1,
20
+ type: f = P.Button,
21
+ disabled: p = !1,
22
+ isIcon: y = !1,
23
23
  ariaLabel: i,
24
24
  ariaPressed: l,
25
- role: B = M.Button,
26
- fullWidth: I = !1,
27
- tabIndex: S = W.Default,
28
- onClick: $,
25
+ role: h = M.Button,
26
+ fullWidth: B = !1,
27
+ tabIndex: I = W.Default,
28
+ onClick: S,
29
29
  justifyContent: d,
30
- ...s
31
- } = u;
32
- return /* @__PURE__ */ b(C, { ref: m, $variant: c, $isIcon: h, $fullWidth: I, $rounded: f, disabled: y, onClick: $, type: p, role: B, theme: t, tabIndex: S, "data-testid": e, ...T(s), ...i ? {
30
+ ...$
31
+ } = s;
32
+ return /* @__PURE__ */ b(C, { ref: u, $variant: m, $isIcon: y, $fullWidth: B, $rounded: c, disabled: p, onClick: S, type: f, role: h, theme: t, tabIndex: I, "data-testid": e, ...T($), ...i ? {
33
33
  "aria-label": i
34
34
  } : {}, ...l ? {
35
35
  "aria-pressed": l
36
- } : {}, ...s, children: [
36
+ } : {}, children: [
37
37
  r ? /* @__PURE__ */ n(E, { theme: t, "data-testid": `${e}-icon-start`, children: r }) : null,
38
38
  o ? /* @__PURE__ */ n(N, { theme: t, styles: d ? {
39
39
  justifyContent: d
@@ -1,73 +1,73 @@
1
1
  "use client";
2
- import { jsxs as t, jsx as r, Fragment as L } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as P } from "react";
4
- import { DEFAULT_PROPS as e, COMPONENT_NAME as o, FOCUS_EXCLUDED_LIST as U } from "./constants.js";
5
- import { useInputHandlers as g } from "./useInputHandlers.js";
6
- import { InputStyled as j } from "./InputStyled.js";
7
- import { InputWrapper as c } from "./InputWrapper/InputWrapper.js";
2
+ import { jsxs as s, jsx as r, Fragment as j } from "@emotion/react/jsx-runtime";
3
+ import { forwardRef as q } from "react";
4
+ import { COMPONENT_NAME as o, DEFAULT_PROPS as e, FOCUS_EXCLUDED_LIST as x } from "./constants.js";
5
+ import { useInputHandlers as z } from "./useInputHandlers.js";
6
+ import { InputStyled as D } from "./InputStyled.js";
7
+ import { InputWrapper as l } from "./InputWrapper/InputWrapper.js";
8
8
  import { InputHelper as u } from "./InputHelper/InputHelper.js";
9
- import { InputAdornment as h } from "./InputAdornment/InputAdornment.js";
10
- import { useTheme as v } from "../../../hooks/useTheme/useTheme.js";
11
- import { SizeVariant as z } from "../../../types/common.js";
12
- const B = P((f, b) => {
9
+ import { InputAdornment as f } from "./InputAdornment/InputAdornment.js";
10
+ import { useTheme as T } from "../../../hooks/useTheme/useTheme.js";
11
+ import { SizeVariant as g } from "../../../types/common.js";
12
+ const G = q(({
13
+ wrapperAs: h = "label",
14
+ // Layout props
15
+ styles: I = {},
16
+ className: _ = "",
17
+ width: N,
18
+ // Input behavior props
19
+ variant: n = e.variant,
20
+ color: m = e.color,
21
+ disabled: S = e.disabled,
22
+ readOnly: O = e.readOnly,
23
+ // Accessibility props
24
+ ariaRequired: w = e.ariaRequired,
25
+ role: y = e.role,
26
+ tabIndex: E = e.tabIndex,
27
+ ariaDescribedBy: a,
28
+ // Event handling props
29
+ debounceCallbackTime: F,
30
+ onChange: M,
31
+ onKeyDown: $,
32
+ onMouseDown: b,
33
+ onBlur: A,
34
+ // Adornments
35
+ adornmentStart: p,
36
+ adornmentEnd: d,
37
+ // Helper text
38
+ label: i,
39
+ helperText: t,
40
+ ...C
41
+ }, H) => {
13
42
  const {
14
- theme: I
15
- } = v(), {
16
- wrapperAs: y = "label",
17
- // Layout props
18
- width: w,
19
- className: N = e.className,
20
- styles: S = e.styles,
21
- // Input behavior props
22
- variant: s = e.variant,
23
- color: i = e.color,
24
- disabled: _ = e.disabled,
25
- readOnly: x = e.readOnly,
26
- // Accessibility props
27
- ariaRequired: D = e.ariaRequired,
28
- role: E = e.role,
29
- tabIndex: O = e.tabIndex,
30
- ariaDescribedBy: l,
31
- // Event handling props
32
- debounceCallbackTime: T,
33
- onChange: C,
34
- onKeyDown: M,
35
- onMouseDown: A,
36
- onBlur: F,
37
- // Adornments
38
- adornmentStart: d,
39
- adornmentEnd: m,
40
- // Helper text
41
- label: a,
42
- helperText: n,
43
- ...R
44
- } = f, p = !U.includes(s), $ = !!(a || n), {
45
- handlers: q,
46
- isMouseInteraction: H
47
- } = g({
48
- onKeyDown: M,
49
- onBlur: F,
50
- onMouseDown: A,
51
- onChange: C,
52
- debounceCallbackTime: T
43
+ theme: L
44
+ } = T(), c = !x.includes(n), P = !!(i || t), {
45
+ handlers: R,
46
+ isMouseInteraction: U
47
+ } = z({
48
+ onKeyDown: $,
49
+ onBlur: A,
50
+ onMouseDown: b,
51
+ onChange: M,
52
+ debounceCallbackTime: F
53
53
  });
54
- return /* @__PURE__ */ t(c, { as: y, withGap: $, className: N, width: w, styles: S, children: [
55
- a && /* @__PURE__ */ r(u, { children: a }),
56
- /* @__PURE__ */ t(c, { width: "100%", children: [
57
- d && /* @__PURE__ */ r(h, { children: d }),
58
- /* @__PURE__ */ r(j, { $isMouseInteraction: H && p, $color: i, ref: b, disabled: _, role: E, theme: I, type: s, readOnly: x, tabIndex: O, "aria-required": D, "data-testid": o, ...q, ...l ? {
59
- "aria-describedby": l
60
- } : {}, ...R }),
61
- p && /* @__PURE__ */ t(L, { children: [
54
+ return /* @__PURE__ */ s(l, { as: h, withGap: P, className: _, width: N, styles: I, children: [
55
+ i && /* @__PURE__ */ r(u, { children: i }),
56
+ /* @__PURE__ */ s(l, { width: "100%", children: [
57
+ p && /* @__PURE__ */ r(f, { children: p }),
58
+ /* @__PURE__ */ r(D, { $isMouseInteraction: U && c, $color: m, ref: H, disabled: S, role: y, theme: L, type: n, readOnly: O, tabIndex: E, "aria-required": w, "data-testid": o, ...R, ...a ? {
59
+ "aria-describedby": a
60
+ } : {}, ...C }),
61
+ c && /* @__PURE__ */ s(j, { children: [
62
62
  /* @__PURE__ */ r("span", { className: `${o}__border` }),
63
63
  /* @__PURE__ */ r("span", { className: `${o}__outline` })
64
64
  ] }),
65
- m && /* @__PURE__ */ r(h, { children: m })
65
+ d && /* @__PURE__ */ r(f, { children: d })
66
66
  ] }),
67
- n && /* @__PURE__ */ r(u, { color: i, size: z.Sm, children: n })
67
+ t && /* @__PURE__ */ r(u, { color: m, size: g.Sm, children: t })
68
68
  ] });
69
69
  });
70
- B.displayName = o;
70
+ G.displayName = o;
71
71
  export {
72
- B as Input
72
+ G as Input
73
73
  };
@@ -57,7 +57,6 @@ export interface InputHelperProps extends CommonCssComponentProps, PropsWithChil
57
57
  }
58
58
  export interface InputWrapperPropsStyled extends CommonCssComponentStyledProps<HTMLBaseElement>, PropsWithChildren {
59
59
  $as?: keyof HTMLElementTagNameMap | ElementType;
60
- $width?: string;
61
60
  $withGap?: boolean;
62
61
  }
63
62
  export interface InputHelperPropsStyled extends CommonCssComponentStyledProps, PropsWithChildren {
@@ -1,22 +1,21 @@
1
1
  "use client";
2
- import { jsx as d } from "@emotion/react/jsx-runtime";
2
+ import { jsx as s } from "@emotion/react/jsx-runtime";
3
3
  import { forwardRef as f } from "react";
4
- import { COMPONENT_NAME as t } from "./constants.js";
4
+ import { COMPONENT_NAME as r } from "./constants.js";
5
5
  import { InputWrapperStyled as n } from "./InputWrapperStyled.js";
6
- import { useTheme as h } from "../../../../hooks/useTheme/useTheme.js";
7
- const c = f((r, e) => {
6
+ import { useTheme as d } from "../../../../hooks/useTheme/useTheme.js";
7
+ const c = f((t, e) => {
8
8
  const {
9
9
  theme: o
10
- } = h(), {
10
+ } = d(), {
11
11
  children: p,
12
- as: i,
13
- width: m,
12
+ as: m,
14
13
  withGap: a,
15
- ...s
16
- } = r;
17
- return /* @__PURE__ */ d(n, { $as: i, $width: m, $withGap: a, ref: e, theme: o, "data-testid": t, ...s, children: p });
14
+ ...i
15
+ } = t;
16
+ return /* @__PURE__ */ s(n, { $as: m, $withGap: a, ref: e, theme: o, "data-testid": r, ...i, children: p });
18
17
  });
19
- c.displayName = t;
18
+ c.displayName = r;
20
19
  export {
21
20
  c as InputWrapper
22
21
  };
@@ -1,26 +1,23 @@
1
1
  "use client";
2
2
  import { jsx as u } from "@emotion/react/jsx-runtime";
3
- import { getBoxStyles as h, tokensHandler as w } from "../../../../tokens/utils.js";
3
+ import { getBoxStyles as S, tokensHandler as d } from "../../../../tokens/utils.js";
4
4
  import { get as t } from "../../../../utils/helpers.js";
5
- const P = (s) => {
5
+ const w = (o) => {
6
6
  const {
7
7
  theme: {
8
- input: r,
9
- ...p
8
+ input: s,
9
+ ...r
10
10
  } = {},
11
- $width: e,
12
- $as: n = "span",
13
- $withGap: m,
14
- styles: c = {},
15
- ...l
16
- } = s, {
17
- boxStyles: i,
11
+ $as: p = "span",
12
+ $withGap: n,
13
+ styles: m = {},
14
+ ...c
15
+ } = o, {
16
+ boxStyles: l,
18
17
  restProps: a
19
- } = h(l), y = new Proxy(r || {}, w(p)), o = t(y, "wrapper", {}), d = [t(o, "default", {}), m ? t(o, "withGap", {}) : {}, e ? {
20
- width: e
21
- } : {}, i, c];
22
- return /* @__PURE__ */ u(n, { css: d, ...a });
18
+ } = S(c), y = new Proxy(s || {}, d(r)), e = t(y, "wrapper", {}), i = [t(e, "default", {}), n ? t(e, "withGap", {}) : {}, l, m];
19
+ return /* @__PURE__ */ u(p, { css: i, ...a });
23
20
  };
24
21
  export {
25
- P as InputWrapperStyled
22
+ w as InputWrapperStyled
26
23
  };
@@ -3,7 +3,6 @@ export declare const COMPONENT_NAME = "Input";
3
3
  export declare const DEFAULT_PROPS: {
4
4
  variant: InputVariantType;
5
5
  color: InputColorVariant;
6
- className: string;
7
6
  disabled: boolean;
8
7
  readOnly: boolean;
9
8
  ariaRequired: boolean;
@@ -1,18 +1,16 @@
1
- import { InputVariantType as a, InputColorVariant as e, InputRole as t } from "../../../types/input.js";
2
- import { TabIndex as o } from "../../../types/accesability.js";
3
- const l = "Input", s = {
1
+ import { InputVariantType as a, InputRole as e, InputColorVariant as o } from "../../../types/input.js";
2
+ import { TabIndex as t } from "../../../types/accesability.js";
3
+ const i = "Input", l = {
4
4
  variant: a.Text,
5
- color: e.Primary,
6
- className: "",
5
+ color: o.Primary,
7
6
  disabled: !1,
8
7
  readOnly: !1,
9
8
  ariaRequired: !1,
10
- role: t.Textbox,
11
- tabIndex: o.Default,
12
- styles: {}
13
- }, i = [a.Checkbox, a.Radio, a.Range];
9
+ role: e.Textbox,
10
+ tabIndex: t.Default
11
+ }, p = [a.Checkbox, a.Radio, a.Range];
14
12
  export {
15
- l as COMPONENT_NAME,
16
- s as DEFAULT_PROPS,
17
- i as FOCUS_EXCLUDED_LIST
13
+ i as COMPONENT_NAME,
14
+ l as DEFAULT_PROPS,
15
+ p as FOCUS_EXCLUDED_LIST
18
16
  };
@@ -1,71 +1,60 @@
1
1
  "use client";
2
- import { jsx as a, jsxs as g, Fragment as T } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as x, useEffect as u, useCallback as h } from "react";
4
- import { COMPONENT_NAME as t } from "./constants.js";
5
- import { ModalOverlayStyled as N, ModalContentStyled as P, ModalHeaderStyled as A, ModalTitleStyled as B, CloseButtonStyled as F, ModalBodyStyled as K, ModalFooterStyled as L } from "./ModalStyled.js";
6
- import { useTheme as j } from "../../../hooks/useTheme/useTheme.js";
7
- import { useLogger as D } from "../../../hooks/useLogger/useLogger.js";
8
- import { get as p } from "../../../utils/helpers.js";
2
+ import { jsx as d, jsxs as y, Fragment as B } from "@emotion/react/jsx-runtime";
3
+ import { forwardRef as T, useCallback as g, useEffect as w } from "react";
4
+ import { COMPONENT_NAME as e } from "./constants.js";
5
+ import { ModalOverlayStyled as x, ModalContentStyled as N, ModalHeaderStyled as P, ModalTitleStyled as A, CloseButtonStyled as K, ModalBodyStyled as L, ModalFooterStyled as j } from "./ModalStyled.js";
6
+ import { useTheme as D } from "../../../hooks/useTheme/useTheme.js";
7
+ import { useLogger as F } from "../../../hooks/useLogger/useLogger.js";
8
+ import { get as s } from "../../../utils/helpers.js";
9
9
  import { Portal as H } from "../Portal/Portal.js";
10
10
  import { convertToInlineBoxStyles as I } from "../../../tokens/utils.js";
11
11
  import { Icon as R } from "../Icon/Icon.js";
12
12
  import { KEYBOARD_KEYS as Y } from "../../../constants/keyboard.js";
13
- const _ = x(({
14
- isOpen: o = !1,
15
- isCustomView: f = !1,
16
- onClose: r,
17
- showCloseButton: i = !0,
18
- closeOnEscape: c,
19
- title: e,
20
- children: y,
21
- footer: m,
22
- styles: s,
13
+ const _ = T(({
14
+ isOpen: c = !1,
15
+ isCustomView: p = !1,
16
+ onClose: t,
17
+ showCloseButton: n = !0,
18
+ closeOnClickOutside: o = !0,
19
+ closeOnEscape: f,
20
+ title: a,
21
+ children: m,
22
+ footer: u,
23
+ styles: h,
23
24
  ...S
24
- }, k) => {
25
+ }, M) => {
25
26
  const {
26
- theme: d
27
- } = j(), l = D(), b = p(d, "modal.icons", {}), M = e || !!(i && r);
28
- u(() => {
29
- o && l.debug(`${t}: Open`, {
30
- title: e,
31
- isCustomView: f,
32
- showCloseButton: i,
33
- closeOnEscape: c,
34
- hasFooter: !!m
35
- });
36
- }, [o, e, f, i, c, m]);
37
- const $ = h(() => {
38
- l.debug(`${t}: Close`, {
39
- title: e,
40
- trigger: "overlay"
41
- }), r == null || r();
42
- }, [r, e]), v = h(() => {
43
- l.debug(`${t}: Close`, {
44
- title: e,
27
+ theme: r
28
+ } = D(), l = F(), b = s(r, "modal.icons", {}), k = a || !!(n && t), E = g(() => {
29
+ l.debug(`${e}: Close`, {
30
+ trigger: "overlay",
31
+ closeOnClickOutside: o
32
+ }), o && (t == null || t());
33
+ }, [t, o]), $ = g(() => {
34
+ l.debug(`${e}: Close`, {
45
35
  trigger: "closeButton"
46
- }), r == null || r();
47
- }, [r, e]);
48
- return u(() => {
49
- if (!c) return;
50
- const n = (E) => {
51
- r && E.key === Y.ESCAPE && (l.debug(`${t}: Close`, {
52
- title: e,
36
+ }), t == null || t();
37
+ }, [t]);
38
+ return w(() => {
39
+ if (!f) return;
40
+ const i = (v) => {
41
+ t && v.key === Y.ESCAPE && (l.debug(`${e}: Close`, {
53
42
  trigger: "escape"
54
- }), r());
43
+ }), t == null || t());
55
44
  };
56
- return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
57
- }, [o, c, r, e]), o ? /* @__PURE__ */ a(H, { blocksScroll: !0, children: /* @__PURE__ */ a(N, { onClick: $, theme: d, children: /* @__PURE__ */ a(P, { ref: k, onClick: (n) => n.stopPropagation(), "data-testid": t, theme: d, styles: s, ...I(S), children: f ? y : /* @__PURE__ */ g(T, { children: [
58
- M && /* @__PURE__ */ g(A, { theme: d, $withTitle: !!e, "data-testid": `${t}-header`, children: [
59
- e && /* @__PURE__ */ a(B, { theme: d, "data-testid": `${t}-title`, children: e }),
60
- i && r && /* @__PURE__ */ a(F, { onClick: v, "data-testid": "close-button", theme: d, children: /* @__PURE__ */ a(R, { ...p(b, "close", {
45
+ return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
46
+ }, [c, f, t]), c ? /* @__PURE__ */ d(H, { blocksScroll: !0, children: /* @__PURE__ */ d(x, { onClick: E, theme: r, children: /* @__PURE__ */ d(N, { ref: M, onClick: (i) => i.stopPropagation(), "data-testid": e, theme: r, styles: h, ...I(S), children: p ? m : /* @__PURE__ */ y(B, { children: [
47
+ k && /* @__PURE__ */ y(P, { theme: r, $withTitle: !!a, "data-testid": `${e}-header`, children: [
48
+ a && /* @__PURE__ */ d(A, { theme: r, "data-testid": `${e}-title`, children: a }),
49
+ n && t && /* @__PURE__ */ d(K, { onClick: $, "data-testid": "close-button", theme: r, children: /* @__PURE__ */ d(R, { ...s(b, "close", {
61
50
  name: "cross"
62
51
  }) }) })
63
52
  ] }),
64
- y && /* @__PURE__ */ a(K, { theme: d, "data-testid": `${t}-body`, children: y }),
65
- m && /* @__PURE__ */ a(L, { theme: d, "data-testid": `${t}-footer`, children: m })
53
+ m && /* @__PURE__ */ d(L, { theme: r, "data-testid": `${e}-body`, children: m }),
54
+ u && /* @__PURE__ */ d(j, { theme: r, "data-testid": `${e}-footer`, children: u })
66
55
  ] }) }) }) }) : null;
67
56
  });
68
- _.displayName = t;
57
+ _.displayName = e;
69
58
  export {
70
59
  _ as Modal
71
60
  };
@@ -0,0 +1,5 @@
1
+ import { StoryContext } from '@storybook/types';
2
+ export declare const defaultActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
3
+ export declare const noEscapeCloseContentWithScrollActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
4
+ export declare const customViewActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
5
+ export declare const noClickOutsideCloseActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
@@ -5,6 +5,7 @@ export interface ModalProps extends Omit<BoxCssComponentProps, 'title'>, PropsWi
5
5
  isCustomView?: boolean;
6
6
  showCloseButton?: boolean;
7
7
  closeOnEscape?: boolean;
8
+ closeOnClickOutside?: boolean;
8
9
  onClose?: () => void;
9
10
  title?: ReactNode;
10
11
  footer?: ReactNode;
@@ -0,0 +1,2 @@
1
+ import { TableProps, TableRef, TableRowData } from './Table.types';
2
+ export declare const Table: import('react').ForwardRefExoticComponent<TableProps<TableRowData<Record<string, unknown>>> & import('react').RefAttributes<TableRef>>;