gd-design-library 1.0.2 → 1.2.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 (230) hide show
  1. package/README.md +2 -2
  2. package/ai/README.md +210 -16
  3. package/ai/schemas/components/Accordion.d.ts +84 -0
  4. package/ai/schemas/components/Button.d.ts +12 -0
  5. package/ai/schemas/components/ChatContainer.d.ts +0 -8
  6. package/ai/schemas/components/Column.d.ts +5 -5
  7. package/ai/schemas/components/InputFile.d.ts +17 -5
  8. package/ai/schemas/components/Menu.d.ts +37 -0
  9. package/ai/schemas/components/Row.d.ts +6 -6
  10. package/ai/schemas/components/Scroll.d.ts +7 -0
  11. package/ai/schemas/components/Typography.d.ts +0 -21
  12. package/assets/icons/account_circle.d.ts +1 -3
  13. package/assets/icons/account_circle.js +7 -14
  14. package/assets/icons/arrow-down.d.ts +2 -3
  15. package/assets/icons/arrow-down.js +6 -11
  16. package/assets/icons/arrow-forward.d.ts +1 -3
  17. package/assets/icons/arrow-forward.js +6 -13
  18. package/assets/icons/attachment.d.ts +1 -3
  19. package/assets/icons/attachment.js +7 -14
  20. package/assets/icons/check.d.ts +1 -3
  21. package/assets/icons/check.js +5 -11
  22. package/assets/icons/chevron-left.d.ts +1 -3
  23. package/assets/icons/chevron-left.js +7 -14
  24. package/assets/icons/chevron-right.d.ts +1 -3
  25. package/assets/icons/chevron-right.js +6 -13
  26. package/assets/icons/content-copy.d.ts +1 -3
  27. package/assets/icons/content-copy.js +7 -14
  28. package/assets/icons/delete_outlined.d.ts +1 -3
  29. package/assets/icons/delete_outlined.js +5 -12
  30. package/assets/icons/dot.d.ts +1 -3
  31. package/assets/icons/dot.js +5 -11
  32. package/assets/icons/error_outline.d.ts +1 -4
  33. package/assets/icons/error_outline.js +6 -18
  34. package/assets/icons/eye.d.ts +1 -3
  35. package/assets/icons/eye.js +7 -14
  36. package/assets/icons/file-copy.d.ts +1 -3
  37. package/assets/icons/file-copy.js +7 -13
  38. package/assets/icons/filter.d.ts +1 -3
  39. package/assets/icons/filter.js +6 -13
  40. package/assets/icons/folder.d.ts +1 -3
  41. package/assets/icons/folder.js +6 -13
  42. package/assets/icons/folderOpen.d.ts +1 -3
  43. package/assets/icons/folderOpen.js +7 -14
  44. package/assets/icons/home.d.ts +1 -3
  45. package/assets/icons/home.js +6 -13
  46. package/assets/icons/local_shipping.d.ts +1 -3
  47. package/assets/icons/local_shipping.js +4 -11
  48. package/assets/icons/minus.d.ts +1 -3
  49. package/assets/icons/minus.js +7 -13
  50. package/assets/icons/mobile_menu_button.d.ts +1 -3
  51. package/assets/icons/mobile_menu_button.js +7 -14
  52. package/assets/icons/paymentCard.d.ts +1 -3
  53. package/assets/icons/paymentCard.js +6 -13
  54. package/assets/icons/plus.d.ts +1 -3
  55. package/assets/icons/plus.js +5 -11
  56. package/assets/icons/portrait.d.ts +1 -3
  57. package/assets/icons/portrait.js +5 -12
  58. package/assets/icons/processing.d.ts +1 -3
  59. package/assets/icons/processing.js +6 -13
  60. package/assets/icons/ruler.d.ts +1 -3
  61. package/assets/icons/ruler.js +6 -13
  62. package/assets/icons/search.d.ts +1 -3
  63. package/assets/icons/search.js +6 -13
  64. package/assets/icons/shopping_bag.d.ts +1 -3
  65. package/assets/icons/shopping_bag.js +7 -14
  66. package/assets/icons/slash.d.ts +1 -3
  67. package/assets/icons/slash.js +6 -13
  68. package/assets/icons/star.d.ts +1 -3
  69. package/assets/icons/star.js +6 -12
  70. package/assets/icons/starOutlined.d.ts +1 -3
  71. package/assets/icons/starOutlined.js +5 -11
  72. package/assets/icons/toast_error.d.ts +1 -3
  73. package/assets/icons/toast_error.js +9 -15
  74. package/assets/icons/toast_info.d.ts +1 -3
  75. package/assets/icons/toast_info.js +7 -13
  76. package/assets/icons/toast_warning.d.ts +1 -3
  77. package/assets/icons/toast_warning.js +7 -13
  78. package/assets/icons/upload.d.ts +1 -3
  79. package/assets/icons/upload.js +6 -13
  80. package/assets/icons/volume-up.d.ts +1 -3
  81. package/assets/icons/volume-up.js +6 -13
  82. package/assets/icons/wifiTethering.d.ts +1 -3
  83. package/assets/icons/wifiTethering.js +4 -11
  84. package/components/core/Button/Button.js +30 -27
  85. package/components/core/Button/Button.types.d.ts +2 -2
  86. package/components/core/Button/ButtonStyled.js +40 -39
  87. package/components/core/Dropdown/Dropdown.d.ts +1 -1
  88. package/components/core/Dropdown/Dropdown.js +16 -16
  89. package/components/core/Dropdown/Dropdown.types.d.ts +3 -3
  90. package/components/core/Dropdown/DropdownStyled.js +13 -14
  91. package/components/core/Icon/Icon.js +41 -33
  92. package/components/core/Icon/Icon.types.d.ts +2 -1
  93. package/components/core/Icon/constants.d.ts +37 -109
  94. package/components/core/Input/Input.d.ts +1 -1
  95. package/components/core/InputFile/InputFile.d.ts +0 -32
  96. package/components/core/InputFile/InputFile.js +47 -33
  97. package/components/core/InputFile/InputFileStyled.js +24 -22
  98. package/components/core/Loader/Loader.js +19 -17
  99. package/components/core/Loader/Loader.types.d.ts +3 -1
  100. package/components/core/Loader/LoaderStyled.js +34 -30
  101. package/components/core/Menu/Menu.d.ts +2 -2
  102. package/components/core/Menu/Menu.js +113 -93
  103. package/components/core/Menu/Menu.types.d.ts +16 -11
  104. package/components/core/Menu/MenuStyled.d.ts +1 -1
  105. package/components/core/Menu/constants.js +4 -12
  106. package/components/core/Modal/Modal.js +60 -36
  107. package/components/core/Modal/ModalStyled.js +21 -22
  108. package/components/core/Scroll/Scroll.d.ts +6 -0
  109. package/components/core/Scroll/Scroll.js +53 -31
  110. package/components/core/Scroll/Scroll.types.d.ts +5 -0
  111. package/components/core/Scroll/ScrollBar.js +45 -43
  112. package/components/core/Scroll/ScrollStyled.js +46 -42
  113. package/components/core/Scroll/constants.d.ts +2 -0
  114. package/components/core/Scroll/constants.js +6 -4
  115. package/components/core/Select/Select.js +162 -134
  116. package/components/core/Select/Select.types.d.ts +2 -4
  117. package/components/core/Snackbar/Snackbar.js +60 -37
  118. package/components/core/Snackbar/Snackbar.types.d.ts +1 -2
  119. package/components/core/Snackbar/SnackbarManager.js +45 -30
  120. package/components/core/Snackbar/SnackbarStyled.d.ts +5 -5
  121. package/components/core/Snackbar/SnackbarStyled.js +111 -101
  122. package/components/core/Textarea/Textarea.d.ts +4 -0
  123. package/components/core/Tooltip/Tooltip.js +68 -44
  124. package/components/core/Tooltip/TooltipStyled.js +26 -27
  125. package/components/core/Tooltip/utils.js +47 -45
  126. package/components/core/Typography/Typography.js +18 -18
  127. package/components/core/Typography/Typography.types.d.ts +3 -3
  128. package/components/core/Typography/TypographyStyled.js +28 -29
  129. package/components/domainSpecific/Accordion/Accordion.d.ts +1 -1
  130. package/components/domainSpecific/Accordion/Accordion.js +19 -17
  131. package/components/domainSpecific/Accordion/Accordion.types.d.ts +7 -4
  132. package/components/domainSpecific/Accordion/AccordionContent/AccordionContent.d.ts +1 -1
  133. package/components/domainSpecific/Accordion/AccordionContent/AccordionContent.js +13 -12
  134. package/components/domainSpecific/Accordion/AccordionHeader/AccordionHeader.d.ts +1 -1
  135. package/components/domainSpecific/Accordion/AccordionHeader/AccordionHeader.js +15 -14
  136. package/components/domainSpecific/Accordion/AccordionItem/AccordionItem.d.ts +1 -1
  137. package/components/domainSpecific/Accordion/AccordionItem/AccordionItem.js +18 -16
  138. package/components/domainSpecific/Accordion/AccordionStyled.js +44 -35
  139. package/components/domainSpecific/Card/Card.js +31 -27
  140. package/components/domainSpecific/Card/CardTitle/constants.js +4 -4
  141. package/components/domainSpecific/Header/Header.js +4 -4
  142. package/components/domainSpecific/SearchModal/SearchModal.js +0 -1
  143. package/components/domainSpecific/SearchModal/SearchModal.types.d.ts +1 -1
  144. package/components/index.types.d.ts +1 -0
  145. package/components/layout/ChatContainer/ChatContainer.d.ts +1 -1
  146. package/components/layout/ChatContainer/ChatContainer.js +58 -41
  147. package/components/layout/ChatContainer/ChatContainer.types.d.ts +8 -5
  148. package/components/layout/ChatContainer/ChatContainerStyled.d.ts +2 -0
  149. package/components/layout/ChatContainer/ChatContainerStyled.js +105 -84
  150. package/components/layout/Column/Column.types.d.ts +3 -1
  151. package/components/layout/Column/ColumnStyled.js +23 -23
  152. package/components/layout/FlexContainer/FlexContainerStyled.js +7 -8
  153. package/components/layout/Row/Row.d.ts +1 -1
  154. package/components/layout/Row/Row.js +20 -20
  155. package/components/layout/Row/Row.types.d.ts +3 -1
  156. package/components/layout/Row/RowStyled.js +26 -26
  157. package/constants/index.d.ts +0 -1
  158. package/hooks/index.d.ts +1 -0
  159. package/hooks/useLogger/NoOpLogger.d.ts +11 -0
  160. package/hooks/useLogger/NoOpLogger.js +15 -0
  161. package/hooks/useLogger/index.d.ts +2 -0
  162. package/hooks/useLogger/useLogger.d.ts +4 -0
  163. package/hooks/useLogger/useLogger.js +27 -0
  164. package/hooks/useLogger/useLogger.types.d.ts +30 -0
  165. package/hooks/useTheme/NoOpTheme.d.ts +4050 -0
  166. package/hooks/useTheme/NoOpTheme.js +15 -0
  167. package/hooks/useTheme/useTheme.d.ts +3 -4
  168. package/hooks/useTheme/useTheme.js +62 -41
  169. package/hooks/useTheme/useTheme.types.d.ts +3 -2
  170. package/index.d.ts +4 -0
  171. package/index.js +354 -350
  172. package/llms.txt +39 -19
  173. package/package.json +1 -1
  174. package/tokens/accordion.d.ts +9 -3
  175. package/tokens/accordion.js +14 -11
  176. package/tokens/button.d.ts +17 -19
  177. package/tokens/button.js +54 -56
  178. package/tokens/card.d.ts +2 -3
  179. package/tokens/card.js +50 -53
  180. package/tokens/carousel.d.ts +2 -2
  181. package/tokens/carousel.js +8 -9
  182. package/tokens/chat.d.ts +69 -48
  183. package/tokens/chat.js +86 -68
  184. package/tokens/constants.d.ts +0 -1
  185. package/tokens/constants.js +1 -1
  186. package/tokens/defaultTheme.d.ts +199 -112
  187. package/tokens/defaultTheme.js +27 -25
  188. package/tokens/header.d.ts +1 -1
  189. package/tokens/header.js +3 -4
  190. package/tokens/index.d.ts +175 -104
  191. package/tokens/index.js +102 -101
  192. package/tokens/input.d.ts +2 -2
  193. package/tokens/input.js +25 -26
  194. package/tokens/inputfile.d.ts +1 -1
  195. package/tokens/inputfile.js +4 -4
  196. package/tokens/link.d.ts +5 -0
  197. package/tokens/loader.d.ts +3 -0
  198. package/tokens/loader.js +3 -0
  199. package/tokens/menu.d.ts +1 -0
  200. package/tokens/menu.js +1 -0
  201. package/tokens/modal.d.ts +6 -4
  202. package/tokens/modal.js +42 -60
  203. package/tokens/scroll.d.ts +19 -2
  204. package/tokens/scroll.js +23 -7
  205. package/tokens/select.d.ts +9 -7
  206. package/tokens/select.js +30 -29
  207. package/tokens/snackbar.d.ts +36 -20
  208. package/tokens/snackbar.js +92 -93
  209. package/tokens/stepper.d.ts +1 -1
  210. package/tokens/stepper.js +3 -3
  211. package/tokens/tabs.d.ts +1 -1
  212. package/tokens/tabs.js +1 -1
  213. package/tokens/textarea.d.ts +4 -0
  214. package/tokens/tooltip.d.ts +5 -1
  215. package/tokens/tooltip.js +23 -21
  216. package/tokens/typography.js +114 -116
  217. package/tokens/values.d.ts +5 -1
  218. package/tokens/values.js +12 -8
  219. package/tokens/wrapper.d.ts +2 -2
  220. package/tokens/wrapper.js +7 -7
  221. package/tokens/zIndex.d.ts +9 -0
  222. package/tokens/zIndex.js +12 -0
  223. package/types/index.d.ts +0 -1
  224. package/types/styles.d.ts +1 -0
  225. package/utils/helpers.js +14 -15
  226. package/CHANGELOG.md +0 -177
  227. package/constants/positioning.d.ts +0 -9
  228. package/constants/positioning.js +0 -11
  229. package/types/chat.d.ts +0 -5
  230. package/types/chat.js +0 -4
@@ -1,57 +1,74 @@
1
1
  "use client";
2
- import { jsxs as n, jsx as r } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as O, useRef as N, useState as x, useImperativeHandle as H } from "react";
2
+ import { jsxs as l, jsx as d } from "@emotion/react/jsx-runtime";
3
+ import { forwardRef as N, useRef as I, useState as W, useCallback as $, useImperativeHandle as j } from "react";
4
4
  import { COMPONENT_NAME as t } from "./constants.js";
5
- import { MainWrapperStyled as I, SidebarWrapperStyled as M, SidebarStyled as v, SidebarHeaderStyled as R, SidebarToggleButtonStyled as p, BodyStyled as j, MainHeaderStyled as k, ContentStyled as A } from "./ChatContainerStyled.js";
6
- import { ChatLayoutVariant as B } from "../../../types/chat.js";
7
- import { useTheme as D } from "../../../hooks/useTheme/useTheme.js";
8
- import { Icon as h } from "../../core/Icon/Icon.js";
9
- import { get as f } from "../../../utils/helpers.js";
10
- const E = O((S, u) => {
5
+ import { MainWrapperStyled as B, SidebarWrapperStyled as D, SidebarStyled as E, SidebarHeaderStyled as H, SidebarToggleButtonStyled as y, SidebarContentWrapperStyled as P, SidebarMinifiedStyled as v, BodyStyled as A, MainHeaderStyled as L, ContentStyled as Q } from "./ChatContainerStyled.js";
6
+ import { useMediaQuery as _ } from "../../../hooks/useMediaQuery/useMediaQuery.js";
7
+ import { useTheme as q } from "../../../hooks/useTheme/useTheme.js";
8
+ import { useLogger as z } from "../../../hooks/useLogger/useLogger.js";
9
+ import { get as p } from "../../../utils/helpers.js";
10
+ import { Icon as b } from "../../core/Icon/Icon.js";
11
+ const F = N(({
12
+ sidebarContent: g,
13
+ headerContent: m,
14
+ children: S,
15
+ isOpen: w,
16
+ sidebarHeaderContent: u,
17
+ sidebarMinifiedContent: f,
18
+ onToggleSidebar: i,
19
+ styles: C = {},
20
+ showSidebarAsideControl: k = !0,
21
+ showSidebarHeaderControl: M = !0,
22
+ ...O
23
+ }, x) => {
11
24
  const {
12
- sidebarContent: y,
13
- headerContent: s,
14
- children: b,
15
- isOpen: g = !0,
16
- sidebarHeaderContent: l,
17
- onToggleSidebar: d,
18
- styles: C = {},
19
- variant: $ = B.Auto,
20
- ...w
21
- } = S, {
22
25
  theme: e
23
- } = D(), c = N(null), [a, i] = x(g), o = () => {
24
- const m = !a;
25
- i(m), d == null || d(m);
26
- };
27
- return H(u, () => ({
28
- ref: c,
29
- isOpen: a,
30
- open: () => i(!0),
31
- close: () => i(!1),
32
- toggle: o
33
- })), /* @__PURE__ */ n(I, { className: "gd-chat-container", "data-testid": `${t}-main-wrapper`, theme: e, ref: c, ...w, styles: C, children: [
34
- a && /* @__PURE__ */ r(M, { theme: e, $variant: $, "data-testid": `${t}-sidebar-wrapper`, children: /* @__PURE__ */ n(v, { theme: e, "data-testid": `${t}-sidebar`, children: [
35
- l ? /* @__PURE__ */ n(R, { theme: e, "data-testid": `${t}-sidebar-header`, children: [
36
- /* @__PURE__ */ r(p, { theme: e, onClick: o, $open: a, children: /* @__PURE__ */ r(h, { ...f(e, "chat.toggleIcon", {
26
+ } = q(), n = z(), h = I(null), [r, o] = W(w), s = _(`(max-width: ${p(e, "values.screenMedium", "768px")})`), c = $(() => {
27
+ const a = !r;
28
+ n.debug(`${t}: Toggle triggered (user interaction)`, {
29
+ isOpen: a
30
+ }), o(a), i == null || i(a);
31
+ }, [r, i, n]), R = $((a) => {
32
+ s && r && a.target === a.currentTarget && (n.debug(`${t}: Sidebar wrapper clicked (mobile close)`, {
33
+ isMobile: s,
34
+ wasOpen: r
35
+ }), o(!1), i == null || i(!1));
36
+ }, [s, r]);
37
+ return j(x, () => ({
38
+ ref: h,
39
+ isOpen: r,
40
+ open: () => {
41
+ n.debug(`${t}: Ref method called - open()`), o(!0);
42
+ },
43
+ close: () => {
44
+ n.debug(`${t}: Ref method called - close()`), o(!1);
45
+ },
46
+ toggle: () => {
47
+ n.debug(`${t}: Ref method called - toggle()`), c();
48
+ }
49
+ })), /* @__PURE__ */ l(B, { className: "gd-chat-container", "data-testid": `${t}-main-wrapper`, theme: e, ref: h, ...O, styles: C, children: [
50
+ /* @__PURE__ */ d(D, { theme: e, "data-testid": `${t}-sidebar-wrapper`, $open: r, onClick: R, children: /* @__PURE__ */ l(E, { theme: e, "data-testid": `${t}-sidebar`, $open: r, onClick: (a) => a.stopPropagation(), children: [
51
+ u ? /* @__PURE__ */ l(H, { theme: e, "data-testid": `${t}-sidebar-header`, children: [
52
+ k && /* @__PURE__ */ d(y, { theme: e, onClick: c, $open: r, children: /* @__PURE__ */ d(b, { ...p(e, "chat.toggleIcon", {
37
53
  name: "arrowDown"
38
54
  }) }) }),
39
- l
55
+ u
40
56
  ] }) : null,
41
- y
57
+ /* @__PURE__ */ d(P, { theme: e, children: g })
42
58
  ] }) }),
43
- /* @__PURE__ */ n(j, { theme: e, "data-testid": `${t}-body`, children: [
44
- s ? /* @__PURE__ */ n(k, { theme: e, "data-testid": `${t}-main-header`, children: [
45
- !a && /* @__PURE__ */ r(p, { theme: e, onClick: o, children: /* @__PURE__ */ r(h, { ...f(e, "chat.toggleIcon", {
59
+ f && /* @__PURE__ */ d(v, { theme: e, "data-testid": `${t}-sidebar-minified`, $open: !r, children: f }),
60
+ /* @__PURE__ */ l(A, { theme: e, "data-testid": `${t}-body`, children: [
61
+ m ? /* @__PURE__ */ l(L, { theme: e, "data-testid": `${t}-main-header`, children: [
62
+ !r && M && /* @__PURE__ */ d(y, { theme: e, onClick: c, children: /* @__PURE__ */ d(b, { ...p(e, "chat.toggleIcon", {
46
63
  name: "arrowDown"
47
64
  }) }) }),
48
- s
65
+ m
49
66
  ] }) : null,
50
- /* @__PURE__ */ r(A, { theme: e, "data-testid": `${t}-content`, children: b })
67
+ /* @__PURE__ */ d(Q, { theme: e, "data-testid": `${t}-content`, children: S })
51
68
  ] })
52
69
  ] });
53
70
  });
54
- E.displayName = t;
71
+ F.displayName = t;
55
72
  export {
56
- E as ChatContainer
73
+ F as ChatContainer
57
74
  };
@@ -1,24 +1,27 @@
1
1
  import { PropsWithChildren, ReactNode } from 'react';
2
- import { EnumOrPrimitive, ChatLayoutVariant } from '../../../types';
3
2
  import { CommonCssComponentProps, CommonCssComponentStyledProps } from '../..';
4
3
  export interface ChatContainerProps extends PropsWithChildren<CommonCssComponentProps> {
5
4
  sidebarContent?: ReactNode;
5
+ sidebarMinifiedContent?: ReactNode;
6
6
  sidebarHeaderContent?: ReactNode;
7
7
  headerContent?: ReactNode;
8
8
  children?: ReactNode;
9
9
  isOpen?: boolean;
10
- variant?: EnumOrPrimitive<ChatLayoutVariant>;
10
+ showSidebarAsideControl?: boolean;
11
+ showSidebarHeaderControl?: boolean;
11
12
  onToggleSidebar?: (open: boolean) => void;
12
13
  }
13
14
  export interface ChatContainerRef {
14
- isOpen: boolean;
15
+ isOpen?: boolean;
15
16
  open: () => void;
16
17
  close: () => void;
17
18
  toggle: () => void;
18
19
  }
19
- export type ChatCommonStyledProps = PropsWithChildren<CommonCssComponentStyledProps>;
20
+ export interface ChatCommonStyledProps extends PropsWithChildren<CommonCssComponentStyledProps> {
21
+ $open?: boolean;
22
+ }
20
23
  export interface SidebarWrapperStyledProps extends CommonCssComponentStyledProps {
21
- $variant?: EnumOrPrimitive<ChatLayoutVariant>;
24
+ $open?: boolean;
22
25
  }
23
26
  export interface SidebarToggleButtonStyledProps extends CommonCssComponentStyledProps<HTMLButtonElement> {
24
27
  $open?: boolean;
@@ -4,6 +4,8 @@ export declare const MainHeaderStyled: (props: ChatCommonStyledProps) => import(
4
4
  export declare const BodyStyled: (props: ChatCommonStyledProps) => import("@emotion/react/jsx-runtime").JSX.Element;
5
5
  export declare const SidebarWrapperStyled: (props: SidebarWrapperStyledProps) => import("@emotion/react/jsx-runtime").JSX.Element;
6
6
  export declare const SidebarStyled: (props: ChatCommonStyledProps) => import("@emotion/react/jsx-runtime").JSX.Element;
7
+ export declare const SidebarMinifiedStyled: (props: ChatCommonStyledProps) => import("@emotion/react/jsx-runtime").JSX.Element;
7
8
  export declare const SidebarHeaderStyled: (props: ChatCommonStyledProps) => import("@emotion/react/jsx-runtime").JSX.Element;
9
+ export declare const SidebarContentWrapperStyled: (props: ChatCommonStyledProps) => import("@emotion/react/jsx-runtime").JSX.Element;
8
10
  export declare const ContentStyled: (props: ChatCommonStyledProps) => import("@emotion/react/jsx-runtime").JSX.Element;
9
11
  export declare const SidebarToggleButtonStyled: (props: SidebarToggleButtonStyledProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,133 +1,154 @@
1
- "use client";
2
- import { jsx as d } from "@emotion/react/jsx-runtime";
1
+ import { jsx as p } from "@emotion/react/jsx-runtime";
3
2
  import { forwardRef as P } from "react";
4
- import { getBoxStyles as l, tokensHandler as m, getMediaQuery as i } from "../../../tokens/utils.js";
5
- import { get as e } from "../../../utils/helpers.js";
6
- import { ButtonVariant as u } from "../../../types/button.js";
7
- import { Button as x } from "../../core/Button/Button.js";
3
+ import { getBoxStyles as m, tokensHandler as i, getMediaQuery as S } from "../../../tokens/utils.js";
4
+ import { get as t } from "../../../utils/helpers.js";
5
+ import { ButtonVariant as b } from "../../../types/button.js";
6
+ import { Button as u } from "../../core/Button/Button.js";
8
7
  const N = P((n, s) => {
9
8
  const {
10
9
  theme: {
11
- chat: t,
12
- ...r
10
+ chat: e,
11
+ ...c
13
12
  } = {},
14
- styles: c = {},
15
- ...a
13
+ styles: o = {},
14
+ ...r
16
15
  } = n, {
17
- boxStyles: p,
18
- restProps: o
19
- } = l(a), y = new Proxy(t || {}, m(r)), S = [e(y, "wrapper.default", {}), p, c];
20
- return /* @__PURE__ */ d("div", { css: S, ...o, ref: s });
21
- }), k = (n) => {
16
+ boxStyles: d,
17
+ restProps: a
18
+ } = m(r), l = new Proxy(e || {}, i(c)), y = [t(l, "wrapper.default", {}), d, o];
19
+ return /* @__PURE__ */ p("div", { css: y, ...a, ref: s });
20
+ }), W = (n) => {
22
21
  const {
23
22
  theme: {
24
23
  chat: s,
25
- ...t
24
+ ...e
26
25
  } = {},
27
- ...r
26
+ ...c
28
27
  } = n, {
29
- boxStyles: c,
30
- restProps: a
31
- } = l(r), p = new Proxy(s || {}, m(t)), o = [e(p, "mainHeader", {}), c];
32
- return /* @__PURE__ */ d("header", { css: o, ...a });
33
- }, v = (n) => {
28
+ boxStyles: o,
29
+ restProps: r
30
+ } = m(c), d = new Proxy(s || {}, i(e)), a = [t(d, "mainHeader", {}), o];
31
+ return /* @__PURE__ */ p("header", { css: a, ...r });
32
+ }, M = (n) => {
34
33
  const {
35
34
  theme: {
36
35
  chat: s,
37
- ...t
36
+ ...e
38
37
  } = {},
39
- ...r
38
+ ...c
40
39
  } = n, {
41
- boxStyles: c,
42
- restProps: a
43
- } = l(r), p = new Proxy(s || {}, m(t)), o = [e(p, "body", {}), c];
44
- return /* @__PURE__ */ d("div", { css: o, ...a });
45
- }, H = (n) => {
40
+ boxStyles: o,
41
+ restProps: r
42
+ } = m(c), d = new Proxy(s || {}, i(e)), a = [t(d, "body", {}), o];
43
+ return /* @__PURE__ */ p("div", { css: a, ...r });
44
+ }, k = (n) => {
46
45
  const {
47
46
  theme: {
48
47
  chat: s,
49
- ...t
48
+ ...e
50
49
  } = {},
51
- $variant: r,
52
- ...c
50
+ $open: c,
51
+ ...o
53
52
  } = n, {
54
- boxStyles: a,
55
- restProps: p
56
- } = l(c), o = new Proxy(s || {}, m(t)), y = [e(o, "sidebarWrapper.default", {}), e(o, ["sidebarWrapper", r, "default"], {}), i({
57
- max: e(t, "breakpoints.md")
58
- }, e(s, ["sidebarWrapper", r, "md"], (S) => ({}))(t)), a];
59
- return /* @__PURE__ */ d("div", { css: y, ...p });
60
- }, W = (n) => {
53
+ boxStyles: r,
54
+ restProps: d
55
+ } = m(o), a = new Proxy(s || {}, i(e)), l = [t(a, "sidebarWrapper.default", {}), t(a, c ? "sidebarWrapper.open" : "sidebarWrapper.close", {}), S({
56
+ max: t(e, "breakpoints.md")
57
+ }, t(s, ["sidebarWrapper", "md"], (y) => ({}))(e)), r];
58
+ return /* @__PURE__ */ p("div", { css: l, ...d });
59
+ }, v = (n) => {
61
60
  const {
62
61
  theme: {
63
62
  chat: s,
64
- ...t
63
+ ...e
65
64
  } = {},
66
- ...r
65
+ $open: c,
66
+ ...o
67
67
  } = n, {
68
- boxStyles: c,
69
- restProps: a
70
- } = l(r), p = new Proxy(s || {}, m(t)), o = [e(p, "sidebar", {}), c];
71
- return /* @__PURE__ */ d("aside", { css: o, ...a });
72
- }, M = (n) => {
68
+ boxStyles: r,
69
+ restProps: d
70
+ } = m(o), a = new Proxy(s || {}, i(e)), l = [t(a, "sidebar.default", {}), t(a, c ? "sidebar.open" : "sidebar.close", {}), r];
71
+ return /* @__PURE__ */ p("aside", { css: l, ...d });
72
+ }, H = (n) => {
73
73
  const {
74
74
  theme: {
75
75
  chat: s,
76
- ...t
76
+ ...e
77
77
  } = {},
78
- ...r
78
+ $open: c,
79
+ ...o
80
+ } = n, r = new Proxy(s || {}, i(e)), d = [t(r, "sidebarMinified.default", {}), t(r, c ? "sidebarMinified.open" : "sidebarMinified.close", {})];
81
+ return /* @__PURE__ */ p("aside", { css: d, ...o });
82
+ }, $ = (n) => {
83
+ const {
84
+ theme: {
85
+ chat: s,
86
+ ...e
87
+ } = {},
88
+ ...c
79
89
  } = n, {
80
- boxStyles: c,
81
- restProps: a
82
- } = l(r), p = new Proxy(s || {}, m(t)), o = [e(p, "sidebarHeader", {}), c];
83
- return /* @__PURE__ */ d("header", { css: o, ...a });
90
+ boxStyles: o,
91
+ restProps: r
92
+ } = m(c), d = new Proxy(s || {}, i(e)), a = [t(d, "sidebarHeader", {}), t(d, "sidebar.open", {}), o];
93
+ return /* @__PURE__ */ p("header", { css: a, ...r });
84
94
  }, T = (n) => {
85
95
  const {
86
96
  theme: {
87
97
  chat: s,
88
- ...t
98
+ ...e
89
99
  } = {},
90
- styles: r = {},
91
100
  ...c
101
+ } = n, o = new Proxy(s || {}, i(e)), r = [t(o, "sidebarContentWrapper", {}), t(o, "sidebar.open", {})];
102
+ return /* @__PURE__ */ p("div", { css: r, ...c });
103
+ }, j = (n) => {
104
+ const {
105
+ theme: {
106
+ chat: s,
107
+ ...e
108
+ } = {},
109
+ styles: c = {},
110
+ ...o
92
111
  } = n, {
93
- boxStyles: a,
94
- restProps: p
95
- } = l(c), o = new Proxy(s || {}, m(t)), y = [e(o, "content.default", {}), i({
96
- max: e(t, "breakpoints.md")
97
- }, e(s, "content.md", {})), i({
98
- min: e(t, "breakpoints.md"),
99
- max: e(t, "breakpoints.xl")
100
- }, e(s, "content.mdXl", {})), i({
101
- min: e(t, "breakpoints.xl")
102
- }, e(s, "content.xl", {})), a, r];
103
- return /* @__PURE__ */ d("main", { css: y, ...p });
104
- }, $ = (n) => {
112
+ boxStyles: r,
113
+ restProps: d
114
+ } = m(o), a = new Proxy(s || {}, i(e)), l = [t(a, "content.default", {}), S({
115
+ max: t(e, "breakpoints.md")
116
+ }, t(s, "content.md", {})), S({
117
+ min: t(e, "breakpoints.md"),
118
+ max: t(e, "breakpoints.xl")
119
+ }, t(s, "content.mdXl", {})), S({
120
+ min: t(e, "breakpoints.xl")
121
+ }, t(s, "content.xl", {})), r, c];
122
+ return /* @__PURE__ */ p("main", { css: l, ...d });
123
+ }, I = (n) => {
105
124
  const {
106
125
  theme: {
107
126
  chat: s,
108
- ...t
127
+ ...e
109
128
  } = {},
110
- $open: r,
111
- ...c
129
+ $open: c,
130
+ ...o
112
131
  } = n, {
113
- boxStyles: a,
114
- restProps: p
115
- } = l(c), o = new Proxy(s || {}, m(t)), y = r ? e(o, "toggleButton.open") : {}, S = e(o, "toggleButton.attrs", {
116
- variant: u.Text
132
+ boxStyles: r,
133
+ restProps: d
134
+ } = m(o), a = new Proxy(s || {}, i(e)), l = c ? t(a, "toggleButton.open") : {}, y = t(a, "toggleButton.attrs", {
135
+ variant: b.Text
117
136
  }), h = {
118
- ...e(o, "toggleButton.default"),
119
- ...y,
120
- ...a
137
+ ...t(a, "toggleButton.default"),
138
+ ...l,
139
+ ...r
121
140
  };
122
- return /* @__PURE__ */ d(x, { ...S, ...p, isIcon: !0, styles: h });
141
+ return /* @__PURE__ */ p(u, { ...y, ...d, isIcon: !0, styles: h });
123
142
  };
124
143
  export {
125
- v as BodyStyled,
126
- T as ContentStyled,
127
- k as MainHeaderStyled,
144
+ M as BodyStyled,
145
+ j as ContentStyled,
146
+ W as MainHeaderStyled,
128
147
  N as MainWrapperStyled,
129
- M as SidebarHeaderStyled,
130
- W as SidebarStyled,
131
- $ as SidebarToggleButtonStyled,
132
- H as SidebarWrapperStyled
148
+ T as SidebarContentWrapperStyled,
149
+ $ as SidebarHeaderStyled,
150
+ H as SidebarMinifiedStyled,
151
+ v as SidebarStyled,
152
+ I as SidebarToggleButtonStyled,
153
+ k as SidebarWrapperStyled
133
154
  };
@@ -1,6 +1,8 @@
1
- import { PropsWithChildren } from 'react';
1
+ import { ElementType, PropsWithChildren } from 'react';
2
2
  import { BoxCssComponentProps, BoxCssComponentStyledProps, FlexElementProps, FlexElementStyledProps } from '../..';
3
3
  export interface ColumnProps extends BoxCssComponentProps, FlexElementProps, PropsWithChildren {
4
+ as?: keyof HTMLElementTagNameMap | ElementType;
4
5
  }
5
6
  export interface ColumnStyledProps extends BoxCssComponentStyledProps, FlexElementStyledProps, PropsWithChildren {
7
+ as?: keyof HTMLElementTagNameMap | ElementType;
6
8
  }
@@ -1,37 +1,37 @@
1
- "use client";
2
- import { jsx as d } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as g } from "react";
4
- import { getBoxStyles as $, tokensHandler as S } from "../../../tokens/utils.js";
5
- import { calculateGutter as w, calculateJustify as P, calculateAlign as j } from "../../../utils/layout.js";
1
+ import { jsx as g } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as $ } from "react";
3
+ import { getBoxStyles as S, tokensHandler as w } from "../../../tokens/utils.js";
4
+ import { calculateGutter as C, calculateJustify as P, calculateAlign as j } from "../../../utils/layout.js";
6
5
  import { get as v } from "../../../utils/helpers.js";
7
- const k = g((t, r) => {
6
+ const A = $((e, o) => {
8
7
  const {
9
8
  theme: {
10
- column: o,
9
+ column: r,
11
10
  ...s
12
11
  } = {},
13
12
  $isWrap: l,
14
13
  $align: n,
15
14
  $justify: m,
16
- $gutter: c,
17
- $flex: e,
18
- $isReversed: i,
19
- styles: u,
20
- ...a
21
- } = t, {
22
- boxStyles: f,
23
- restProps: p
24
- } = $(a), y = new Proxy(o || {}, S(s)), x = [v(y, "default", {}), {
25
- flexDirection: i ? "column-reverse" : "column",
15
+ $gutter: a,
16
+ $flex: t,
17
+ $isReversed: c,
18
+ styles: f,
19
+ as: i = "div",
20
+ ...p
21
+ } = e, {
22
+ boxStyles: u,
23
+ restProps: y
24
+ } = S(p), x = new Proxy(r || {}, w(s)), d = [v(x, "default", {}), {
25
+ flexDirection: c ? "column-reverse" : "column",
26
26
  flexWrap: l ? "wrap" : "nowrap",
27
27
  alignItems: j(n),
28
28
  justifyContent: P(m),
29
- gap: w(c)
30
- }, f, e ? {
31
- flex: e
32
- } : {}, u];
33
- return /* @__PURE__ */ d("div", { css: x, ...p, ref: r });
29
+ gap: C(a)
30
+ }, u, t ? {
31
+ flex: t
32
+ } : {}, f];
33
+ return /* @__PURE__ */ g(i, { css: d, ...y, ref: o });
34
34
  });
35
35
  export {
36
- k as ColumnStyled
36
+ A as ColumnStyled
37
37
  };
@@ -1,9 +1,8 @@
1
- "use client";
2
- import { jsx as p } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as c } from "react";
4
- import { getBoxStyles as x, tokensHandler as d } from "../../../tokens/utils.js";
1
+ import { jsx as i } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as x } from "react";
3
+ import { getBoxStyles as c, tokensHandler as d } from "../../../tokens/utils.js";
5
4
  import { get as y } from "../../../utils/helpers.js";
6
- const C = c((e, t) => {
5
+ const C = x((t, e) => {
7
6
  const {
8
7
  theme: {
9
8
  flexContainer: o,
@@ -11,11 +10,11 @@ const C = c((e, t) => {
11
10
  } = {},
12
11
  styles: s,
13
12
  ...n
14
- } = e, {
13
+ } = t, {
15
14
  boxStyles: l,
16
15
  restProps: m
17
- } = x(n), f = new Proxy(o || {}, d(r)), i = [y(f, "default", {}), l, s];
18
- return /* @__PURE__ */ p("div", { css: i, ...m, ref: t });
16
+ } = c(n), f = new Proxy(o || {}, d(r)), p = [y(f, "default", {}), l, s];
17
+ return /* @__PURE__ */ i("div", { css: p, ...m, ref: e });
19
18
  });
20
19
  export {
21
20
  C as FlexContainerStyled
@@ -1,3 +1,3 @@
1
1
  import { default as React } from 'react';
2
- import { RowProps } from './Row.types';
2
+ import { RowProps } from './';
3
3
  export declare const Row: React.ForwardRefExoticComponent<RowProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,26 +1,26 @@
1
1
  "use client";
2
- import { jsx as d } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as u } from "react";
4
- import { convertToInlineBoxStyles as c } from "../../../tokens/utils.js";
2
+ import { jsx as n } from "@emotion/react/jsx-runtime";
3
+ import { forwardRef as d } from "react";
4
+ import { convertToInlineBoxStyles as u } from "../../../tokens/utils.js";
5
5
  import { RowStyled as $ } from "./RowStyled.js";
6
- import { COMPONENT_NAME as e } from "./constants.js";
7
- import { useTheme as x } from "../../../hooks/useTheme/useTheme.js";
8
- const y = u((t, r) => {
6
+ import { COMPONENT_NAME as t } from "./constants.js";
7
+ import { useTheme as c } from "../../../hooks/useTheme/useTheme.js";
8
+ const x = d(({
9
+ children: e,
10
+ gutter: r = 0,
11
+ align: o = "stretch",
12
+ justify: m = "start",
13
+ isWrap: s = !0,
14
+ isReversed: i = !1,
15
+ flex: f,
16
+ ...a
17
+ }, p) => {
9
18
  const {
10
- children: o,
11
- gutter: s = 0,
12
- align: i = "stretch",
13
- justify: m = "start",
14
- isWrap: f = !0,
15
- isReversed: a = !1,
16
- flex: l,
17
- ...n
18
- } = t, {
19
- theme: p
20
- } = x();
21
- return /* @__PURE__ */ d($, { ref: r, theme: p, $isReversed: a, $gutter: s, $align: i, $justify: m, $isWrap: f, $flex: l, "data-testid": e, ...c(n), children: o });
19
+ theme: l
20
+ } = c();
21
+ return /* @__PURE__ */ n($, { ref: p, theme: l, $isReversed: i, $gutter: r, $align: o, $justify: m, $isWrap: s, $flex: f, "data-testid": t, ...u(a), children: e });
22
22
  });
23
- y.displayName = e;
23
+ x.displayName = t;
24
24
  export {
25
- y as Row
25
+ x as Row
26
26
  };
@@ -1,6 +1,8 @@
1
- import { PropsWithChildren } from 'react';
1
+ import { ElementType, PropsWithChildren } from 'react';
2
2
  import { BoxCssComponentProps, BoxCssComponentStyledProps, FlexElementProps, FlexElementStyledProps } from '../..';
3
3
  export interface RowProps extends BoxCssComponentProps, FlexElementProps, PropsWithChildren {
4
+ as?: keyof HTMLElementTagNameMap | ElementType;
4
5
  }
5
6
  export interface RowStyledProps extends BoxCssComponentStyledProps, FlexElementStyledProps, PropsWithChildren {
7
+ as?: keyof HTMLElementTagNameMap | ElementType;
6
8
  }
@@ -1,36 +1,36 @@
1
- "use client";
2
- import { jsx as x } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as d } from "react";
4
- import { getBoxStyles as g, tokensHandler as $ } from "../../../tokens/utils.js";
5
- import { get as S } from "../../../utils/helpers.js";
6
- import { calculateGutter as P, calculateJustify as R, calculateAlign as j } from "../../../utils/layout.js";
7
- const A = d((t, r) => {
1
+ import { jsx as d } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as g } from "react";
3
+ import { getBoxStyles as $, tokensHandler as S } from "../../../tokens/utils.js";
4
+ import { get as P } from "../../../utils/helpers.js";
5
+ import { calculateGutter as R, calculateJustify as j, calculateAlign as v } from "../../../utils/layout.js";
6
+ const A = g((e, r) => {
8
7
  const {
9
8
  theme: {
10
9
  row: o,
11
10
  ...s
12
11
  } = {},
13
- $flex: e,
12
+ $flex: t,
14
13
  $isWrap: l,
15
- $align: i,
16
- $justify: n,
17
- $gutter: a,
18
- $isReversed: f,
19
- styles: c,
20
- ...p
21
- } = t, {
22
- boxStyles: m,
23
- restProps: u
24
- } = g(p), y = new Proxy(o || {}, $(s)), w = [S(y, "default", {}), {
25
- flexDirection: f ? "row-reverse" : "row",
14
+ $align: n,
15
+ $justify: a,
16
+ $gutter: f,
17
+ $isReversed: i,
18
+ styles: p,
19
+ as: m = "div",
20
+ ...c
21
+ } = e, {
22
+ boxStyles: u,
23
+ restProps: y
24
+ } = $(c), w = new Proxy(o || {}, S(s)), x = [P(w, "default", {}), {
25
+ flexDirection: i ? "row-reverse" : "row",
26
26
  flexWrap: l ? "wrap" : "nowrap",
27
- alignItems: j(i),
28
- justifyContent: R(n),
29
- gap: P(a)
30
- }, m, e ? {
31
- flex: e
32
- } : {}, c];
33
- return /* @__PURE__ */ x("div", { css: w, ...u, ref: r });
27
+ alignItems: v(n),
28
+ justifyContent: j(a),
29
+ gap: R(f)
30
+ }, u, t ? {
31
+ flex: t
32
+ } : {}, p];
33
+ return /* @__PURE__ */ d(m, { css: x, ...y, ref: r });
34
34
  });
35
35
  export {
36
36
  A as RowStyled
@@ -1,3 +1,2 @@
1
- export * from './positioning';
2
1
  export * from './timers';
3
2
  export * from './keyboard';
package/hooks/index.d.ts CHANGED
@@ -4,3 +4,4 @@ export * from './useAutoFocus';
4
4
  export * from './useMediaQuery';
5
5
  export * from './useKeyControls';
6
6
  export * from './useCarousel';
7
+ export * from './useLogger';