gd-design-library 1.2.0 → 1.3.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 (48) hide show
  1. package/ai/schemas/components/Image.d.ts +8 -0
  2. package/ai/schemas/components/Menu.d.ts +5 -0
  3. package/ai/schemas/components/Switch.d.ts +5 -5
  4. package/components/core/Form/Form.stories.play.d.ts +4 -0
  5. package/components/core/Image/Image.d.ts +4 -0
  6. package/components/core/Image/Image.js +26 -24
  7. package/components/core/Image/Image.types.d.ts +10 -3
  8. package/components/core/Image/ImageStyled.js +39 -37
  9. package/components/core/InputFile/InputFile.d.ts +4 -0
  10. package/components/core/Menu/Menu.js +74 -66
  11. package/components/core/Menu/Menu.types.d.ts +5 -1
  12. package/components/core/Menu/constants.d.ts +0 -8
  13. package/components/core/Switch/Switch.js +35 -35
  14. package/components/core/Switch/Switch.types.d.ts +4 -4
  15. package/components/domainSpecific/Accordion/Accordion.d.ts +1 -1
  16. package/components/domainSpecific/Accordion/Accordion.js +38 -29
  17. package/components/domainSpecific/Accordion/Accordion.types.d.ts +4 -0
  18. package/components/domainSpecific/Accordion/AccordionHeader/AccordionHeader.js +17 -16
  19. package/components/domainSpecific/Accordion/AccordionItem/AccordionItem.d.ts +1 -1
  20. package/components/domainSpecific/Accordion/AccordionItem/AccordionItem.js +14 -14
  21. package/components/domainSpecific/Accordion/AccordionStyled.js +25 -22
  22. package/components/domainSpecific/Accordion/constants.js +6 -5
  23. package/components/domainSpecific/Card/Card.stories.play.d.ts +4 -0
  24. package/components/domainSpecific/ChatBubble/ChatBubbleStyled.js +11 -11
  25. package/components/domainSpecific/Header/Header.stories.play.d.ts +9 -0
  26. package/components/domainSpecific/SearchModal/SearchModal.stories.play.d.ts +2 -0
  27. package/components/widget/DragAndDrop/DragAndDrop.stories.play.d.ts +6 -0
  28. package/hooks/useMediaQuery/useMediaQuery.d.ts +3 -0
  29. package/hooks/useMediaQuery/useMediaQuery.js +9 -7
  30. package/hooks/useTheme/NoOpTheme.d.ts +27 -5
  31. package/llms.txt +6 -3
  32. package/package.json +1 -1
  33. package/tokens/accordion.d.ts +17 -4
  34. package/tokens/accordion.js +19 -6
  35. package/tokens/chatbubble.d.ts +2 -1
  36. package/tokens/chatbubble.js +4 -3
  37. package/tokens/defaultTheme.d.ts +27 -5
  38. package/tokens/index.d.ts +10 -1
  39. package/tokens/menu.d.ts +7 -0
  40. package/tokens/menu.js +12 -5
  41. package/tokens/select.d.ts +1 -0
  42. package/tokens/select.js +6 -5
  43. package/utils/play/formUtils.d.ts +27 -0
  44. package/utils/play/imageUtils.d.ts +12 -0
  45. package/utils/play/index.d.ts +5 -0
  46. package/utils/play/mockUtils.d.ts +29 -0
  47. package/utils/play/modalUtils.d.ts +26 -0
  48. package/utils/play/waitUtils.d.ts +47 -0
@@ -1,18 +1,18 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { EnumOrPrimitive, LabelPosition } from '../../../types';
3
- import { CommonCssComponentProps, CommonCssComponentStyledProps, CommonCssInputStyledProps } from '../..';
4
- export interface SwitchProps<T> extends PropsWithChildren<CommonCssComponentProps<T>> {
3
+ import { BoxCssComponentProps, BoxCssComponentStyledProps, CommonCssInputStyledProps } from '../..';
4
+ export interface SwitchProps<T> extends PropsWithChildren<BoxCssComponentProps<T>> {
5
5
  label?: EnumOrPrimitive<LabelPosition>;
6
6
  name?: string;
7
7
  disabled?: boolean;
8
8
  checked?: boolean;
9
9
  onValueChange?: (value: boolean) => void;
10
10
  }
11
- export interface SwitchStyledProps<T> extends PropsWithChildren<CommonCssComponentStyledProps<T>> {
11
+ export interface SwitchStyledProps<T> extends PropsWithChildren<BoxCssComponentStyledProps<T>> {
12
12
  $disabled?: boolean;
13
13
  $checked?: boolean;
14
14
  }
15
- export interface SwitchLabelStyledProps extends PropsWithChildren<CommonCssComponentStyledProps> {
15
+ export interface SwitchLabelStyledProps extends PropsWithChildren<BoxCssComponentStyledProps> {
16
16
  $label?: EnumOrPrimitive<LabelPosition>;
17
17
  }
18
18
  export interface HiddenCheckboxStyledProps extends CommonCssInputStyledProps {
@@ -1,2 +1,2 @@
1
1
  import { AccordionWrapperProps } from './Accordion.types';
2
- export declare const Accordion: ({ children, allowMultipleExpand, withoutSeparator, value, defaultValue, onChange, }: AccordionWrapperProps) => import("@emotion/react/jsx-runtime").JSX.Element;
2
+ export declare const Accordion: ({ children, allowMultipleExpand, withoutSeparator, value, defaultValue, onChange, isInline, }: AccordionWrapperProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,37 +1,46 @@
1
1
  "use client";
2
- import { jsx as x } from "@emotion/react/jsx-runtime";
3
- import { useState as A, useCallback as p, useMemo as b } from "react";
2
+ import { jsx as P } from "@emotion/react/jsx-runtime";
3
+ import { useState as T, useCallback as f, useMemo as $ } from "react";
4
+ import { COMPONENT_NAME as O } from "./constants.js";
4
5
  import { isArray as j, without as v } from "../../../utils/helpers.js";
5
- import { AccordionContext as P } from "./hooks/useAccordion.js";
6
- const G = ({
7
- children: u,
8
- allowMultipleExpand: m = !1,
9
- withoutSeparator: n,
10
- value: d,
11
- defaultValue: I = [],
12
- onChange: s
6
+ import { AccordionContext as L } from "./hooks/useAccordion.js";
7
+ import { useLogger as M } from "../../../hooks/useLogger/useLogger.js";
8
+ const D = ({
9
+ children: g,
10
+ allowMultipleExpand: s = !1,
11
+ withoutSeparator: p,
12
+ value: u,
13
+ defaultValue: A = [],
14
+ onChange: o,
15
+ isInline: i
13
16
  }) => {
14
- const [f, l] = A(I), o = j(d), e = o ? d : f, r = p((t) => {
15
- if (o) {
16
- s == null || s(t);
17
- return;
18
- }
19
- l(t);
20
- }, [s, o]), i = p((t) => {
21
- if (e.includes(t)) {
22
- const c = v(e, t);
23
- r(c);
17
+ const r = M(), [b, l] = T(A), m = j(u), t = m ? u : b, c = f((e) => {
18
+ r.debug(`${O}: Items updated`, {
19
+ openedItems: e
20
+ }), o == null || o(e), !m && l(e);
21
+ }, [o, m]), I = f((e) => {
22
+ const d = t.includes(e), x = d ? "Close" : "Open";
23
+ if (r.debug(`${O}: Toggle item`, {
24
+ itemId: e,
25
+ action: x,
26
+ wasOpened: d,
27
+ allowMultipleExpand: s,
28
+ currentOpenedItems: t
29
+ }), d) {
30
+ const n = v(t, e);
31
+ c(n);
24
32
  } else {
25
- const c = m ? [...e, t] : [t];
26
- r(c);
33
+ const n = s ? [...t, e] : [e];
34
+ c(n);
27
35
  }
28
- }, [m, e, r]), O = b(() => ({
29
- openedItems: e,
30
- toggleItem: i,
31
- withoutSeparator: n
32
- }), [i, e, n]);
33
- return /* @__PURE__ */ x(P.Provider, { value: O, children: u });
36
+ }, [s, t, c, r]), N = $(() => ({
37
+ openedItems: t,
38
+ toggleItem: I,
39
+ withoutSeparator: p,
40
+ isInline: i
41
+ }), [I, t, p, i]);
42
+ return /* @__PURE__ */ P(L.Provider, { value: N, children: g });
34
43
  };
35
44
  export {
36
- G as Accordion
45
+ D as Accordion
37
46
  };
@@ -9,13 +9,16 @@ export interface AccordionHeaderProps extends AccordionBaseProps {
9
9
  export interface AccordionBasePropsStyled extends CommonCssComponentStyledProps, Omit<BoxCssComponentStyledProps, 'onAbort'>, PropsWithChildren {
10
10
  $isOpen?: boolean;
11
11
  $withoutSeparator?: boolean;
12
+ $isInline?: boolean;
12
13
  }
13
14
  export interface AccordionHeaderPropsStyled extends CommonCssComponentStyledProps, Omit<BoxCssComponentStyledProps, 'onAbort'>, PropsWithChildren {
15
+ $isInline?: boolean;
14
16
  }
15
17
  export type AccordionContextType = {
16
18
  openedItems: string[];
17
19
  toggleItem: (key: string) => void;
18
20
  withoutSeparator?: boolean;
21
+ isInline?: boolean;
19
22
  };
20
23
  export interface AccordionWrapperProps {
21
24
  children: ReactNode;
@@ -23,5 +26,6 @@ export interface AccordionWrapperProps {
23
26
  withoutSeparator?: boolean;
24
27
  value?: string[];
25
28
  defaultValue?: string[];
29
+ isInline?: boolean;
26
30
  onChange?: (openedItems: string[]) => void;
27
31
  }
@@ -1,30 +1,31 @@
1
1
  "use client";
2
- import { jsxs as p, jsx as f } from "@emotion/react/jsx-runtime";
3
- import { HEADER_COMPONENT as h } from "../constants.js";
4
- import { AccordionHeaderStyled as A, AccordionIconStyled as $ } from "../AccordionStyled.js";
2
+ import { jsxs as f, jsx as h } from "@emotion/react/jsx-runtime";
3
+ import { HEADER_COMPONENT as $ } from "../constants.js";
4
+ import { AccordionHeaderStyled as A, AccordionIconStyled as I } from "../AccordionStyled.js";
5
5
  import { useTheme as u } from "../../../../hooks/useTheme/useTheme.js";
6
6
  import { useAccordion as x } from "../hooks/useAccordion.js";
7
- const j = ({
8
- children: t,
7
+ const k = ({
8
+ children: c,
9
9
  id: o,
10
- styles: n = {},
11
- className: d = "",
10
+ styles: t = {},
11
+ className: i = "",
12
12
  isOpen: e = !1,
13
13
  expandIcon: r,
14
- ...i
14
+ ...d
15
15
  }) => {
16
16
  const {
17
- theme: c
17
+ theme: n
18
18
  } = u(), {
19
- toggleItem: a
20
- } = x(), s = `accordion-header-${o}`, l = `accordion-panel-${o}`, m = () => {
21
- o && a(o);
19
+ toggleItem: s,
20
+ isInline: a
21
+ } = x(), l = `accordion-header-${o}`, m = `accordion-panel-${o}`, p = () => {
22
+ o && s(o);
22
23
  };
23
- return /* @__PURE__ */ p(A, { theme: c, id: s, "data-testid": `${h}-${o}`, className: d, "aria-expanded": e, "aria-controls": l, onClick: m, styles: n, ...i, children: [
24
- t,
25
- r && /* @__PURE__ */ f($, { theme: c, $isOpen: e, children: r })
24
+ return /* @__PURE__ */ f(A, { theme: n, id: l, "data-testid": `${$}-${o}`, className: i, "aria-expanded": e, "aria-controls": m, onClick: p, styles: t, $isInline: a, ...d, children: [
25
+ c,
26
+ r && /* @__PURE__ */ h(I, { theme: n, $isOpen: e, children: r })
26
27
  ] });
27
28
  };
28
29
  export {
29
- j as AccordionHeader
30
+ k as AccordionHeader
30
31
  };
@@ -1,2 +1,2 @@
1
1
  import { AccordionBaseProps } from '../Accordion.types';
2
- export declare const AccordionItem: ({ children, id, styles, className, ...rest }: AccordionBaseProps) => import("@emotion/react/jsx-runtime").JSX.Element;
2
+ export declare const AccordionItem: ({ children, id, styles, ...rest }: AccordionBaseProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,26 +1,26 @@
1
1
  "use client";
2
- import { jsx as s } from "@emotion/react/jsx-runtime";
2
+ import { jsx as c } from "@emotion/react/jsx-runtime";
3
3
  import { Children as l, isValidElement as u, cloneElement as d } from "react";
4
4
  import { ITEM_COMPONENT as f } from "../constants.js";
5
- import { AccordionItemStyled as h } from "../AccordionStyled.js";
6
- import { useAccordion as E } from "../hooks/useAccordion.js";
7
- import { useTheme as I } from "../../../../hooks/useTheme/useTheme.js";
5
+ import { AccordionItemStyled as I } from "../AccordionStyled.js";
6
+ import { useAccordion as h } from "../hooks/useAccordion.js";
7
+ import { useTheme as $ } from "../../../../hooks/useTheme/useTheme.js";
8
8
  const x = ({
9
9
  children: r,
10
- id: t,
10
+ id: e,
11
11
  styles: n = {},
12
- className: m = "",
13
12
  ...i
14
13
  }) => {
15
14
  const {
16
- openedItems: a,
17
- withoutSeparator: c
18
- } = E(), {
19
- theme: p
20
- } = I(), e = t && a.includes(t);
21
- return /* @__PURE__ */ s(h, { "data-testid": `${f}-${t}`, "data-open": e, "data-value": t, theme: p, $withoutSeparator: c, className: m, styles: n, ...i, children: l.map(r, (o) => u(o) ? d(o, {
22
- id: t,
23
- isOpen: e
15
+ openedItems: m,
16
+ withoutSeparator: s,
17
+ isInline: p
18
+ } = h(), {
19
+ theme: a
20
+ } = $(), t = e && m.includes(e);
21
+ return /* @__PURE__ */ c(I, { "data-testid": `${f}-${e}`, "data-open": t, "data-value": e, theme: a, $withoutSeparator: s, $isInline: p, $isOpen: !!t, styles: n, ...i, children: l.map(r, (o) => u(o) ? d(o, {
22
+ id: e,
23
+ isOpen: t
24
24
  }) : null) });
25
25
  };
26
26
  export {
@@ -1,7 +1,7 @@
1
- import { jsx as y } from "@emotion/react/jsx-runtime";
2
- import { getBoxStyles as a, tokensHandler as i } from "../../../tokens/utils.js";
1
+ import { jsx as S } from "@emotion/react/jsx-runtime";
2
+ import { getBoxStyles as u, tokensHandler as a } from "../../../tokens/utils.js";
3
3
  import { get as t } from "../../../utils/helpers.js";
4
- const A = (e) => {
4
+ const f = (e) => {
5
5
  const {
6
6
  theme: {
7
7
  accordion: s,
@@ -12,22 +12,23 @@ const A = (e) => {
12
12
  ...d
13
13
  } = e, {
14
14
  boxStyles: o,
15
- restProps: p
16
- } = a(d), l = new Proxy(s || {}, i(n)), m = t(l, "content", {}), S = c ? "opened" : "closed", u = [t(m, "default", {}), t(m, S, {}), o, r];
17
- return /* @__PURE__ */ y("div", { css: u, ...p });
18
- }, f = (e) => {
15
+ restProps: l
16
+ } = u(d), p = new Proxy(s || {}, a(n)), i = t(p, "content", {}), m = c ? "opened" : "closed", y = [t(i, "default", {}), t(i, m, {}), o, r];
17
+ return /* @__PURE__ */ S("div", { css: y, ...l });
18
+ }, $ = (e) => {
19
19
  const {
20
20
  theme: {
21
21
  accordion: s,
22
22
  ...n
23
23
  } = {},
24
- styles: c,
25
- ...r
24
+ $isInline: c,
25
+ styles: r,
26
+ ...d
26
27
  } = e, {
27
- boxStyles: d,
28
- restProps: o
29
- } = a(r), p = new Proxy(s || {}, i(n)), l = t(p, "header", {}), m = [t(l, "default", {}), d, c];
30
- return /* @__PURE__ */ y("button", { css: m, ...o });
28
+ boxStyles: o,
29
+ restProps: l
30
+ } = u(d), p = new Proxy(s || {}, a(n)), i = t(p, "header", {}), m = [t(i, "default", {}), c ? t(i, "inline", {}) : {}, o, r];
31
+ return /* @__PURE__ */ S("button", { css: m, ...l });
31
32
  }, w = (e) => {
32
33
  const {
33
34
  theme: {
@@ -36,12 +37,14 @@ const A = (e) => {
36
37
  } = {},
37
38
  styles: c,
38
39
  $withoutSeparator: r,
39
- ...d
40
+ $isInline: d,
41
+ $isOpen: o,
42
+ ...l
40
43
  } = e, {
41
- boxStyles: o,
42
- restProps: p
43
- } = a(d), l = new Proxy(s || {}, i(n)), m = t(l, r ? "itemNoSeparator" : "item", {}), S = [t(m, "default", {}), o, c];
44
- return /* @__PURE__ */ y("div", { css: S, ...p });
44
+ boxStyles: p,
45
+ restProps: i
46
+ } = u(l), m = new Proxy(s || {}, a(n)), y = t(m, "item", {}), P = [d ? t(y, "inline", {}) : {}, t(y, r ? "noSeparator" : "default", {}), t(y, o ? "opened" : "closed", {}), p, c];
47
+ return /* @__PURE__ */ S("div", { css: P, ...i });
45
48
  }, b = (e) => {
46
49
  const {
47
50
  theme: {
@@ -50,12 +53,12 @@ const A = (e) => {
50
53
  } = {},
51
54
  $isOpen: c,
52
55
  ...r
53
- } = e, d = new Proxy(s || {}, i(n)), o = t(d, "icon", {}), p = c ? "opened" : "closed", l = [t(o, "default", {}), t(o, p, {})];
54
- return /* @__PURE__ */ y("span", { css: l, ...r });
56
+ } = e, d = new Proxy(s || {}, a(n)), o = t(d, "icon", {}), l = c ? "opened" : "closed", p = [t(o, "default", {}), t(o, l, {})];
57
+ return /* @__PURE__ */ S("span", { css: p, ...r });
55
58
  };
56
59
  export {
57
- A as AccordionContentStyled,
58
- f as AccordionHeaderStyled,
60
+ f as AccordionContentStyled,
61
+ $ as AccordionHeaderStyled,
59
62
  b as AccordionIconStyled,
60
63
  w as AccordionItemStyled
61
64
  };
@@ -1,7 +1,8 @@
1
- const o = "AccordionItem", c = "AccordionContent", n = "AccordionHeader", t = "Accordion Context must be inside Accordion component";
1
+ const o = "Accordion", c = "AccordionItem", n = "AccordionContent", t = "AccordionHeader", E = "Accordion Context must be inside Accordion component";
2
2
  export {
3
- c as CONTENT_COMPONENT,
4
- t as CONTEXT_ERROR_MESSAGE,
5
- n as HEADER_COMPONENT,
6
- o as ITEM_COMPONENT
3
+ o as COMPONENT_NAME,
4
+ n as CONTENT_COMPONENT,
5
+ E as CONTEXT_ERROR_MESSAGE,
6
+ t as HEADER_COMPONENT,
7
+ c as ITEM_COMPONENT
7
8
  };
@@ -0,0 +1,4 @@
1
+ import { StoryContext } from '@storybook/types';
2
+ export declare const withVerticalCardActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
3
+ export declare const withHorizontalCardActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
4
+ export declare const myCardWithFallbackImageActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as u, jsxs as S } from "@emotion/react/jsx-runtime";
3
3
  import { forwardRef as P } from "react";
4
- import { getBoxStyles as y, tokensHandler as h, getMediaQuery as a } from "../../../tokens/utils.js";
4
+ import { getBoxStyles as y, tokensHandler as h, getMediaQuery as d } from "../../../tokens/utils.js";
5
5
  import { Loader as f } from "../../core/Loader/Loader.js";
6
6
  import { get as t } from "../../../utils/helpers.js";
7
7
  const B = P((r, n) => {
@@ -13,20 +13,20 @@ const B = P((r, n) => {
13
13
  styles: c = {},
14
14
  $variant: o,
15
15
  $status: l,
16
- ...d
16
+ ...p
17
17
  } = r, {
18
18
  boxStyles: i,
19
- restProps: m
20
- } = y(d), p = new Proxy(s || {}, h(e)), b = [t(p, "default", {}), t(p, [o, "default"], {}), t(p, l, {}), a({
19
+ restProps: a
20
+ } = y(p), m = new Proxy(s || {}, h(e)), b = [t(m, "default", {}), t(m, [o, "default"], {}), t(m, l, {}), d({
21
21
  min: t(e, "breakpoints.xs")
22
- }, t(s, [o, "xs"], {})), a({
22
+ }, t(s, [o, "xs"], {})), d({
23
23
  min: t(e, "breakpoints.sm")
24
- }, t(s, [o, "sm"], {})), a({
24
+ }, t(s, [o, "sm"], {})), d({
25
25
  min: t(e, "breakpoints.md")
26
- }, t(s, [o, "sm"], {})), a({
26
+ }, t(s, [o, "sm"], {})), d({
27
27
  min: t(e, "breakpoints.lg")
28
28
  }, t(s, [o, "lg"], {})), i, c];
29
- return /* @__PURE__ */ u("div", { css: b, ...m, ref: n });
29
+ return /* @__PURE__ */ u("div", { css: b, ...a, ref: n });
30
30
  }), w = (r) => {
31
31
  const {
32
32
  theme: {
@@ -38,11 +38,11 @@ const B = P((r, n) => {
38
38
  styles: o,
39
39
  ...l
40
40
  } = r, {
41
- boxStyles: d,
41
+ boxStyles: p,
42
42
  restProps: i
43
- } = y(l), m = new Proxy(n || {}, h(s)), p = t(m, "loader.props", {}), b = [t(m, "content.default", {}), t(m, ["content", e], {}), d, o];
43
+ } = y(l), a = new Proxy(n || {}, h(s)), m = t(a, "loader.attrs", {}), b = [t(a, "content.default", {}), t(a, ["content", e], {}), p, o];
44
44
  return /* @__PURE__ */ S("div", { css: b, ...i, children: [
45
- e === "pending" && /* @__PURE__ */ u(f, { ...p }),
45
+ e === "pending" && /* @__PURE__ */ u(f, { ...m }),
46
46
  c
47
47
  ] });
48
48
  }, N = (r) => {
@@ -0,0 +1,9 @@
1
+ import { StoryContext } from '@storybook/types';
2
+ export declare const completeHeaderActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
3
+ export declare const withSearchActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
4
+ export declare const withActionsActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
5
+ export declare const withMenuActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
6
+ export declare const darkHeaderActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
7
+ export declare const interactiveMobileMenuActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
8
+ export declare const withCustomChildrenActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
9
+ export declare const minimalActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { StoryContext } from '@storybook/types';
2
+ export declare const withSearchModalActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
@@ -0,0 +1,6 @@
1
+ import { StoryContext } from '@storybook/types';
2
+ export declare const defaultActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
3
+ export declare const disabledActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
4
+ export declare const loadingActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
5
+ export declare const errorActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
6
+ export declare const usageAsWrapperActions: ({ canvasElement, step }: StoryContext) => Promise<void>;
@@ -1 +1,4 @@
1
+ /**
2
+ * @TODO: Common util uses window prevent SSR issues
3
+ */
1
4
  export declare const useMediaQuery: (query: string) => boolean;
@@ -1,13 +1,15 @@
1
1
  "use client";
2
- import { useState as i, useEffect as r } from "react";
2
+ import { useState as a, useEffect as c } from "react";
3
3
  const o = (e) => {
4
- const [a, s] = i(() => window.matchMedia(e).matches);
5
- return r(() => {
6
- const t = window.matchMedia(e), n = (c) => s(c.matches);
7
- return t.addEventListener("change", n), s(t.matches), () => {
8
- t.removeEventListener("change", n);
4
+ const [i, n] = a(() => typeof window > "u" ? !1 : window.matchMedia(e).matches);
5
+ return c(() => {
6
+ if (typeof window > "u")
7
+ return;
8
+ const t = window.matchMedia(e), s = (r) => n(r.matches);
9
+ return t.addEventListener("change", s), n(t.matches), () => {
10
+ t.removeEventListener("change", s);
9
11
  };
10
- }, [e]), a;
12
+ }, [e]), i;
11
13
  };
12
14
  export {
13
15
  o as useMediaQuery
@@ -290,10 +290,11 @@ export declare class NoOpTheme implements ITheme {
290
290
  flexDirection: import('../../types').FlexDirection;
291
291
  };
292
292
  loader: {
293
- props: {
293
+ attrs: {
294
294
  name: string;
295
295
  size: string;
296
296
  withWrapper: boolean;
297
+ rounded: (theme: Record<symbol, unknown>) => string;
297
298
  };
298
299
  };
299
300
  };
@@ -2428,6 +2429,7 @@ export declare class NoOpTheme implements ITheme {
2428
2429
  dropdown: {
2429
2430
  position: string;
2430
2431
  textAlign: string;
2432
+ color: (theme: Record<symbol, unknown>) => string;
2431
2433
  background: (theme: Record<symbol, unknown>) => string;
2432
2434
  boxShadow: (theme: Record<symbol, unknown>) => string;
2433
2435
  fontFamily: (theme: Record<symbol, unknown>) => string;
@@ -3205,11 +3207,18 @@ export declare class NoOpTheme implements ITheme {
3205
3207
  content: {
3206
3208
  default: {
3207
3209
  backgroundColor: (theme: Record<symbol, unknown>) => string;
3210
+ zIndex: (theme: Record<symbol, unknown>) => string;
3208
3211
  position: string;
3209
3212
  overflow: string;
3210
3213
  boxShadow: (theme: Record<symbol, unknown>) => string;
3211
3214
  };
3212
3215
  };
3216
+ attrs: {
3217
+ minHeight: number;
3218
+ maxHeight: number;
3219
+ offsetX: number;
3220
+ offsetY: number;
3221
+ };
3213
3222
  };
3214
3223
  price: {
3215
3224
  default: {
@@ -3421,10 +3430,16 @@ export declare class NoOpTheme implements ITheme {
3421
3430
  display: string;
3422
3431
  alignItems: string;
3423
3432
  justifyContent: string;
3433
+ gap: (theme: Record<symbol, unknown>) => string;
3424
3434
  ':first-of-type': {
3425
3435
  flex: string;
3426
3436
  };
3427
3437
  };
3438
+ inline: {
3439
+ width: string;
3440
+ display: string;
3441
+ justifyContent: string;
3442
+ };
3428
3443
  };
3429
3444
  content: {
3430
3445
  default: {
@@ -3453,16 +3468,23 @@ export declare class NoOpTheme implements ITheme {
3453
3468
  left: (theme: Record<symbol, unknown>) => string;
3454
3469
  right: (theme: Record<symbol, unknown>) => string;
3455
3470
  height: string;
3456
- width: string;
3457
3471
  backgroundColor: (theme: Record<symbol, unknown>) => string;
3458
3472
  };
3459
3473
  };
3460
- };
3461
- itemNoSeparator: {
3462
- default: {
3474
+ noSeparator: {
3463
3475
  position: string;
3464
3476
  padding: (theme: Record<symbol, unknown>) => string;
3465
3477
  };
3478
+ inline: {
3479
+ width: string;
3480
+ display: string;
3481
+ flexWrap: string;
3482
+ flexDirection: string;
3483
+ };
3484
+ opened: {
3485
+ width: string;
3486
+ };
3487
+ closed: {};
3466
3488
  };
3467
3489
  icon: {
3468
3490
  default: {
package/llms.txt CHANGED
@@ -84,19 +84,21 @@ Each component has:
84
84
  - [Tabs](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/organisms-tabs--docs) - Tab navigation component with keyboard support
85
85
  - [Stepper](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/organisms-stepper--docs) - Step-by-step navigation indicator
86
86
  - [List](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/molecules-list--docs) - List container component with flexible item rendering
87
- - [Accordion](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/organisms-accordion--docs) - Collapsible content sections with animation. Built with subcomponents: AccordionItem (wrapper with unique id), AccordionHeader (clickable header with optional expandIcon), AccordionContent (collapsible content). Supports controlled/uncontrolled modes, multiple expand, and custom styling per subcomponent
87
+ - [Accordion](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/organisms-accordion--docs) - Collapsible content sections with animation. Built with subcomponents: AccordionItem (wrapper with unique id), AccordionHeader (clickable header with optional expandIcon), AccordionContent (collapsible content). Supports controlled/uncontrolled modes, multiple expand, custom styling per subcomponent, inline layout via `isInline` prop, and integrated logging support via useLogger hook for debugging component behavior, state changes, and user interactions
88
88
  - [AccordionItem](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/organisms-accordion-accordionitem--docs) - Individual accordion item wrapper (requires unique id prop). **Supports all Box layout props** including margin, padding, width, height, flex, position, and more for flexible layout control
89
89
  - [AccordionHeader](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/organisms-accordion-accordionheader--docs) - Clickable header with optional expandIcon and rich content support
90
90
  - [AccordionContent](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/organisms-accordion-accordioncontent--docs) - Collapsible content section with smooth animations
91
91
  - [Link](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/molecules-link--docs) - Navigation link component with external link support
92
92
  - [Dropdown](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/molecules-dropdown--docs) - Dropdown menu container with positioning
93
93
  - [DropdownItem](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/molecules-dropdownitem--docs) - Individual dropdown menu item
94
- - [Menu](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/molecules-menu--docs) - Menu component for navigation and actions with accurate corner positioning, ref API for programmatic control (open, close), closeOnSelect prop for multi-select scenarios, placement prop for explicit positioning, and full Box layout support.
94
+ - [Menu](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/molecules-menu--docs) - Menu component for navigation and actions with accurate corner positioning, ref API for programmatic control (open, close), closeOnSelect prop for multi-select scenarios, placement prop for explicit positioning, dynamic height constraints, and full Box layout support.
95
95
  - Ref API: Use `ref.open(event.target)` and `ref.close(event.target)` for programmatic control. Pass `event.target` as the parameter to identify API-controlled interactions, which helps distinguish programmatic control from user interactions. Access current state via `ref.isOpen`, `ref.selectedValue`. Example: `<Button onClick={(e) => menuRef.current?.open(e.target)}>Open Menu</Button>`.
96
96
  - Close on select: Set `closeOnSelect={false}` to keep menu open after selecting items, useful for multiple selections.
97
97
  - Placement: Use `placement="top-left"`, `placement="top-right"`, `placement="bottom-left"`, or `placement="bottom-right"` to explicitly set menu position relative to trigger edges. Defaults to `"bottom-right"` if not specified. Placement provides accurate corner positioning aligned to trigger edges.
98
+ - Offset: Use `offsetX` and `offsetY` props to control the horizontal and vertical distance in pixels between the menu and trigger element. Defaults are 4 pixels for both. Use `offsetX` for horizontal spacing and `offsetY` for vertical spacing. Example: `<Menu offsetX={8} offsetY={12} content={menuItems}>Menu</Menu>`.
99
+ - Height constraints: Use `minHeight` and `maxHeight` props (in pixels) to control dynamic height calculations based on available viewport space. Defaults are 80px and 400px respectively. The menu will adjust its height based on available space, respecting these constraints. Example: `<Menu minHeight={100} maxHeight={500} content={menuItems}>Menu</Menu>`.
98
100
  - Positioning: Menu uses absolute positioning with viewport-based coordinate calculations that account for scroll position, ensuring accurate placement in Portal-rendered content.
99
- - Box props: Full Box component props support for flexible layout control - use `margin`, `padding`, `position`, `flex`, `gap`, `width`, `height`, `minWidth`, `minHeight`, `maxWidth`, `maxHeight`, `display`, `overflow`, `zIndex`, and more for precise positioning and spacing. Example: `<Menu padding="16px" marginTop="8px" content={menuItems}>Menu</Menu>` or `<Menu width="200px" maxHeight="300px" overflow="auto" content={menuItems}>Menu</Menu>`.
101
+ - Box props: Full Box component props support for flexible layout control - use `margin`, `padding`, `position`, `flex`, `gap`, `width`, `height`, `minWidth`, `maxWidth`, `display`, `overflow`, `zIndex`, and more for precise positioning and spacing. Example: `<Menu padding="16px" marginTop="8px" content={menuItems}>Menu</Menu>` or `<Menu width="200px" overflow="auto" content={menuItems}>Menu</Menu>`.
100
102
 
101
103
  **Display & Content:**
102
104
  - [Typography](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/atoms-typography--docs) - Text component with hierarchical variants and styling
@@ -108,6 +110,7 @@ Each component has:
108
110
  - [Icon](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/atoms-icon--docs) - Icon component with 51 built-in icons from IconsList. **CRITICAL: Use ONLY these exact icon names**: cross, success, error, warning, info, dot, check, arrowDown, arrowRight, arrowLeft, arrowForward, keyboardArrowDown, keyboardArrowUp, mobileMenu, home, slash, localShipping, favorite, favoriteOutlined, shoppingBag, paymentCard, accountCircle, portrait, deleteOutlined, minus, plus, edit, search, filter, ruler, processing, eye, attachment, upload, folder, folderOpen, wifiTethering, contentCopy, thumbUp, thumbDown, fileCopy, send, thumbUpFilled, thumbDownFilled, chat, chatBubble, phone, star, starOutlined, errorOutline, volumeUp. Do NOT use: "add" (use plus), "chevronRight" (use arrowRight), "expandMore" (use arrowDown), "close" (use cross), "settings", "infoIcon", or any other invented names
109
111
  - Box props: Icon supports full Box component props for flexible layout control. Use `margin`, `padding`, `position`, `flex`, `gap`, and more for precise positioning and spacing. Example: `<Icon name="check" marginRight="12px" />` or `<Icon name="search" position="absolute" top="10px" right="10px" />`
110
112
  - [Image](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/molecules-image--docs) - Image component with optimization and fallback handling
113
+ - As prop: Use `as="figure"` for semantic HTML when Image has a caption, or `as="span"` for inline images. The wrapper element can be any HTML tag or React component. Example: `<Image src="/photo.jpg" alt="Product" as="figure" caption="Product photo" />`.
111
114
  - [Card](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/templates-card--docs) - Content container with subcomponents, layout variants, and interactive hover effects. Built on Box with support for withShadowHover
112
115
  - [Avatar](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/organisms-avatar--docs) - User avatar component with fallback and badge support
113
116
  - [Carousel](https://storybook.cto-rnd-system-design.griddynamics.net/?path=/docs/organisms-carousel--docs) - Image/content carousel with navigation controls
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gd-design-library",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -11,10 +11,16 @@ export declare const accordion: {
11
11
  display: string;
12
12
  alignItems: string;
13
13
  justifyContent: string;
14
+ gap: (theme: Record<symbol, unknown>) => string;
14
15
  ':first-of-type': {
15
16
  flex: string;
16
17
  };
17
18
  };
19
+ inline: {
20
+ width: string;
21
+ display: string;
22
+ justifyContent: string;
23
+ };
18
24
  };
19
25
  content: {
20
26
  default: {
@@ -43,16 +49,23 @@ export declare const accordion: {
43
49
  left: (theme: Record<symbol, unknown>) => string;
44
50
  right: (theme: Record<symbol, unknown>) => string;
45
51
  height: string;
46
- width: string;
47
52
  backgroundColor: (theme: Record<symbol, unknown>) => string;
48
53
  };
49
54
  };
50
- };
51
- itemNoSeparator: {
52
- default: {
55
+ noSeparator: {
53
56
  position: string;
54
57
  padding: (theme: Record<symbol, unknown>) => string;
55
58
  };
59
+ inline: {
60
+ width: string;
61
+ display: string;
62
+ flexWrap: string;
63
+ flexDirection: string;
64
+ };
65
+ opened: {
66
+ width: string;
67
+ };
68
+ closed: {};
56
69
  };
57
70
  icon: {
58
71
  default: {