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,134 +1,144 @@
1
- "use client";
2
1
  import { jsx as y } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as O } from "react";
4
- import { getBoxStyles as m, tokensHandler as d, convertJsonToCssKeyframeCss as P } from "../../../tokens/utils.js";
5
- import { Typography as h } from "../Typography/Typography.js";
6
- import { get as a } from "../../../utils/helpers.js";
2
+ import { forwardRef as N } from "react";
3
+ import { getBoxStyles as i, tokensHandler as S, convertJsonToCssKeyframeCss as u } from "../../../tokens/utils.js";
4
+ import { Typography as P } from "../Typography/Typography.js";
5
+ import { get as n } from "../../../utils/helpers.js";
7
6
  import { Icon as f } from "../Icon/Icon.js";
8
- import { TypographyStyleVariant as x, TypographyVariant as g, TextAlign as $ } from "../../../types/typography.js";
9
- const E = O((s, o) => {
7
+ const J = N(({
8
+ theme: {
9
+ animations: t,
10
+ snackbar: s,
11
+ ...e
12
+ } = {},
13
+ $variant: o,
14
+ $colored: r,
15
+ $isClosing: c,
16
+ $isAnimated: l,
17
+ styles: d,
18
+ ...a
19
+ }, b) => {
10
20
  const {
11
- theme: {
12
- animations: t,
13
- snackbar: n,
14
- ...e
15
- } = {},
16
- $variant: r,
17
- $colored: i,
18
- $isClosing: l,
19
- $isAnimated: c,
20
- styles: p,
21
- ...v
22
- } = s, {
23
- boxStyles: w,
24
- restProps: C
25
- } = m(v), S = new Proxy(n || {}, d(e)), B = P(t == null ? void 0 : t.slideIn), A = P(t == null ? void 0 : t.slideOut), b = a(S, "snackbar.animation.duration"), k = a(S, "snackbar.animation.timing"), N = `
26
- ${A} ${b} ${k} 50ms forwards
27
- `, T = `
28
- ${B} ${b} ${k} forwards
29
- `, u = a(S, "snackbar.background.default"), I = a(S, "snackbar.default", {}), V = {
30
- background: i ? a(S, `snackbar.background.variants.${r}`, u) : u
21
+ boxStyles: h,
22
+ restProps: x
23
+ } = i(a), p = new Proxy(s || {}, S(e)), v = u(t == null ? void 0 : t.slideIn), C = u(t == null ? void 0 : t.slideOut), m = n(p, "snackbar.animation"), $ = `${C} ${m.closeEffect}`, g = `${v} ${m.openEffect}`, k = n(p, "snackbar.background.default"), w = n(p, "snackbar.default", {}), B = {
24
+ background: r ? n(p, `snackbar.background.variants.${o}`, k) : k
31
25
  };
32
- return /* @__PURE__ */ y("div", { css: [c ? {
33
- animation: l ? N : T
34
- } : {}, I, V, w, p], ...C, ref: o });
35
- }), F = (s) => {
26
+ return /* @__PURE__ */ y("div", { css: [l ? {
27
+ animation: c ? $ : g
28
+ } : {}, w, B, h, d], ...x, ref: b });
29
+ }), K = (t) => {
36
30
  const {
37
31
  theme: {
38
- snackbar: o,
39
- ...t
32
+ snackbar: s,
33
+ ...e
40
34
  } = {},
41
- styles: n,
42
- ...e
43
- } = s, {
44
- boxStyles: r,
45
- restProps: i
46
- } = m(e), l = new Proxy(o || {}, d(t)), c = [a(l, "closeButton", {}), r, n];
47
- return /* @__PURE__ */ y("div", { css: c, ...i });
48
- }, G = (s) => {
35
+ styles: o,
36
+ ...r
37
+ } = t, {
38
+ boxStyles: c,
39
+ restProps: l
40
+ } = i(r), d = new Proxy(s || {}, S(e)), a = [n(d, "closeButton", {}), c, o];
41
+ return /* @__PURE__ */ y("div", { css: a, ...l });
42
+ }, R = (t) => {
49
43
  const {
50
44
  theme: {
51
- snackbar: o,
52
- ...t
53
- } = {}
54
- } = s, n = new Proxy(o || {}, d(t)), e = a(n, "icons.close", {
45
+ snackbar: s,
46
+ ...e
47
+ } = {},
48
+ $variant: o
49
+ } = t, r = new Proxy(s || {}, S(e)), c = n(r, "icons.close", {
55
50
  name: "cross"
56
51
  });
57
- return /* @__PURE__ */ y(f, { ...e });
58
- }, L = (s) => {
52
+ return /* @__PURE__ */ y(f, { fill: `icon.${o}`, ...c });
53
+ }, W = (t) => {
59
54
  const {
60
- $variant: o,
55
+ $variant: s,
61
56
  theme: {
62
- snackbar: t,
63
- ...n
57
+ snackbar: e
64
58
  } = {}
65
- } = s, e = new Proxy(t || {}, d(n)), r = a(e, ["icons", o], {
59
+ } = t, o = n(e, ["icons", s], {
66
60
  name: ""
67
61
  });
68
- return /* @__PURE__ */ y(f, { ...r });
69
- }, M = (s) => {
62
+ return /* @__PURE__ */ y(f, { ...o });
63
+ }, q = (t) => {
70
64
  const {
71
65
  theme: {
72
- snackbar: o,
73
- ...t
66
+ snackbar: s,
67
+ ...e
74
68
  } = {},
75
- styles: n,
76
- ...e
77
- } = s, {
78
- boxStyles: r,
79
- restProps: i
80
- } = m(e), l = new Proxy(o || {}, d(t)), c = [a(l, "snackbarBody", {}), r, n];
81
- return /* @__PURE__ */ y("div", { css: c, ...i });
82
- }, Q = (s) => {
69
+ styles: o,
70
+ ...r
71
+ } = t, {
72
+ boxStyles: c,
73
+ restProps: l
74
+ } = i(r), d = new Proxy(s || {}, S(e)), a = [n(d, "snackbarBody", {}), c, o];
75
+ return /* @__PURE__ */ y("div", { css: a, ...l });
76
+ }, z = (t) => {
83
77
  const {
84
78
  theme: {
85
- snackbar: o,
86
- ...t
79
+ snackbar: s,
80
+ ...e
87
81
  } = {},
88
- styles: n,
89
- ...e
90
- } = s, {
91
- boxStyles: r,
92
- restProps: i
93
- } = m(e), l = new Proxy(o || {}, d(t)), c = [a(l, "snackbarContent", {}), r, n];
94
- return /* @__PURE__ */ y("div", { css: c, ...i });
95
- }, U = (s) => /* @__PURE__ */ y(h, { align: $.Start, variant: g.Body2, styleVariant: x.Semibold, ...s }), X = (s) => /* @__PURE__ */ y(h, { align: $.Start, variant: g.Body2, styleVariant: x.Normal, ...s }), Y = (s) => {
82
+ styles: o,
83
+ ...r
84
+ } = t, {
85
+ boxStyles: c,
86
+ restProps: l
87
+ } = i(r), d = new Proxy(s || {}, S(e)), a = [n(d, "snackbarContent", {}), c, o];
88
+ return /* @__PURE__ */ y("div", { css: a, ...l });
89
+ }, F = (t) => {
96
90
  const {
97
91
  theme: {
98
- snackbar: o,
99
- ...t
92
+ snackbar: s
100
93
  } = {},
101
- styles: n,
102
- ...e
103
- } = s, {
104
- boxStyles: r,
105
- restProps: i
106
- } = m(e), l = new Proxy(o || {}, d(t)), c = [a(l, "actionsContainer", {}), r, n];
107
- return /* @__PURE__ */ y("div", { css: c, ...i });
108
- }, Z = (s) => {
94
+ children: e
95
+ } = t;
96
+ return /* @__PURE__ */ y(P, { ...n(s, "title.attrs", {}), children: e });
97
+ }, G = (t) => {
98
+ const {
99
+ theme: {
100
+ snackbar: s
101
+ } = {},
102
+ children: e
103
+ } = t;
104
+ return /* @__PURE__ */ y(P, { ...n(s, "description.attrs", {}), children: e });
105
+ }, L = (t) => {
109
106
  const {
110
107
  theme: {
111
- snackbar: o,
112
- ...t
108
+ snackbar: s,
109
+ ...e
113
110
  } = {},
114
- $position: n,
115
- styles: e,
111
+ styles: o,
116
112
  ...r
117
- } = s, {
118
- boxStyles: i,
113
+ } = t, {
114
+ boxStyles: c,
119
115
  restProps: l
120
- } = m(r), c = new Proxy(o || {}, d(t)), p = [a(c, "container.default", {}), a(c, ["positions", n], {}), i, e];
121
- return /* @__PURE__ */ y("div", { css: p, ...l });
116
+ } = i(r), d = new Proxy(s || {}, S(e)), a = [n(d, "actionsContainer", {}), c, o];
117
+ return /* @__PURE__ */ y("div", { css: a, ...l });
118
+ }, M = (t) => {
119
+ const {
120
+ theme: {
121
+ snackbar: s,
122
+ ...e
123
+ } = {},
124
+ $position: o,
125
+ styles: r,
126
+ ...c
127
+ } = t, {
128
+ boxStyles: l,
129
+ restProps: d
130
+ } = i(c), a = new Proxy(s || {}, S(e)), b = [n(a, "container.default", {}), n(a, ["positions", o], {}), l, r];
131
+ return /* @__PURE__ */ y("div", { css: b, ...d });
122
132
  };
123
133
  export {
124
- G as CloseButtonIconStyled,
125
- F as CloseButtonWrapperStyled,
126
- Y as SnackbarActionsContainerStyled,
127
- M as SnackbarBodyStyled,
128
- Z as SnackbarContainerStyled,
129
- Q as SnackbarContentStyled,
130
- X as SnackbarDescriptionStyled,
131
- L as SnackbarIconStyled,
132
- E as SnackbarStyled,
133
- U as SnackbarTitleStyled
134
+ R as CloseButtonIconStyled,
135
+ K as CloseButtonWrapperStyled,
136
+ L as SnackbarActionsContainerStyled,
137
+ q as SnackbarBodyStyled,
138
+ M as SnackbarContainerStyled,
139
+ z as SnackbarContentStyled,
140
+ G as SnackbarDescriptionStyled,
141
+ W as SnackbarIconStyled,
142
+ J as SnackbarStyled,
143
+ F as SnackbarTitleStyled
134
144
  };
@@ -1,2 +1,6 @@
1
1
  import { TextareaProps } from './Textarea.types';
2
+ /**
3
+ * @TODO: New design
4
+ * - Align with new design
5
+ */
2
6
  export declare const Textarea: import('react').ForwardRefExoticComponent<TextareaProps & Partial<Omit<HTMLTextAreaElement, keyof TextareaProps>> & import('react').RefAttributes<HTMLTextAreaElement>>;
@@ -1,52 +1,76 @@
1
1
  "use client";
2
- import { jsxs as g, Fragment as B, jsx as s } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as L, useCallback as r } from "react";
4
- import { useTooltip as O } from "./utils.js";
5
- import { COMPONENT_NAME as l } from "./constants.js";
6
- import { TooltipStyled as P, TooltipWrapperStyled as W } from "./TooltipStyled.js";
7
- import { useTheme as j } from "../../../hooks/useTheme/useTheme.js";
8
- import { KEYBOARD_KEYS as h } from "../../../constants/keyboard.js";
9
- import { Portal as v } from "../Portal/Portal.js";
10
- const V = L((u, y) => {
2
+ import { jsxs as O, Fragment as P, jsx as c } from "@emotion/react/jsx-runtime";
3
+ import { forwardRef as W, useCallback as a } from "react";
4
+ import { useTooltip as j } from "./utils.js";
5
+ import { COMPONENT_NAME as e } from "./constants.js";
6
+ import { TooltipStyled as v, TooltipWrapperStyled as L } from "./TooltipStyled.js";
7
+ import { useTheme as V } from "../../../hooks/useTheme/useTheme.js";
8
+ import { useLogger as Y } from "../../../hooks/useLogger/useLogger.js";
9
+ import { KEYBOARD_KEYS as T } from "../../../constants/keyboard.js";
10
+ import { Portal as _ } from "../Portal/Portal.js";
11
+ const q = W(({
12
+ id: t,
13
+ children: g,
14
+ content: r,
15
+ position: d,
16
+ delay: m,
17
+ className: $ = "",
18
+ ariaLabel: u,
19
+ gap: f,
20
+ as: k,
21
+ styles: w,
22
+ ...C
23
+ }, E) => {
11
24
  const {
12
- id: n,
13
- children: T,
14
- content: e,
15
- position: b,
16
- delay: w,
17
- className: E = "",
18
- ariaLabel: p,
19
- gap: N,
20
- as: C,
21
- ...c
22
- } = u, {
23
25
  theme: D
24
- } = j(), {
26
+ } = V(), s = Y(), {
25
27
  isVisible: o,
26
- coords: d,
27
- containerRef: K,
28
- tooltipRef: S,
29
- showTooltip: a,
30
- hideTooltip: t,
31
- positionWithFallback: k
32
- } = O(b, w, N), R = `${E.trim()} tooltip-${k}`, x = !p && typeof e == "string" ? e : p, f = o && !!e, i = r(() => {
33
- o && t();
34
- }, [t, o]), A = i, F = r(() => {
35
- o || a();
36
- }, [o, a]), M = r(() => {
37
- o && t();
38
- }, [t, o]), $ = r((m) => {
39
- [h.ENTER, h.SPACE].includes(m.key) && (m.preventDefault(), i());
40
- }, [i]);
41
- return /* @__PURE__ */ g(B, { children: [
42
- f && /* @__PURE__ */ s(v, { withWrapper: !1, ref: y, children: /* @__PURE__ */ s(P, { id: n, theme: D, className: R, ref: S, "data-testid": l, role: "tooltip", "aria-hidden": !o, style: {
43
- top: d.top,
44
- left: d.left
45
- }, ...c, children: e }) }),
46
- /* @__PURE__ */ s(W, { $as: C, ref: K, onMouseEnter: a, onMouseLeave: t, onClick: i, onTouchStart: A, onFocus: F, onBlur: M, onKeyDown: $, "aria-expanded": f, "aria-describedby": n, "aria-label": x, "data-testid": `${l}-wrapper`, ...c, children: T })
28
+ coords: K,
29
+ containerRef: N,
30
+ tooltipRef: R,
31
+ showTooltip: n,
32
+ hideTooltip: i,
33
+ positionWithFallback: h
34
+ } = j(d, m, f), S = `${$.trim()} tooltip-${h}`, F = !u && typeof r == "string" ? r : u, b = o && !!r, l = a(() => {
35
+ s.debug(`${e}: Click`, {
36
+ id: t,
37
+ isVisible: o
38
+ }), o && i();
39
+ }, [i, o]), x = l, A = a(() => {
40
+ s.debug(`${e}: Focus`, {
41
+ id: t,
42
+ isVisible: o
43
+ }), o || n();
44
+ }, [o, n]), B = a(() => {
45
+ s.debug(`${e}: Blur`, {
46
+ id: t,
47
+ isVisible: o
48
+ }), o && i();
49
+ }, [i, o]), M = a((p) => {
50
+ const y = [T.ENTER, T.SPACE].includes(p.key);
51
+ s.debug(`${e}: KeyDown`, {
52
+ id: t,
53
+ key: p.key,
54
+ matched: y
55
+ }), y && (p.preventDefault(), l());
56
+ }, [l]);
57
+ return s.debug(`${e}: Render`, {
58
+ id: t,
59
+ hasContent: !!r,
60
+ position: d,
61
+ positionWithFallback: h,
62
+ delay: m,
63
+ gap: f,
64
+ isVisible: o
65
+ }), /* @__PURE__ */ O(P, { children: [
66
+ b && /* @__PURE__ */ c(_, { withWrapper: !1, ref: E, children: /* @__PURE__ */ c(v, { id: t, theme: D, className: S, ref: R, "data-testid": e, role: "tooltip", "aria-hidden": !o, styles: {
67
+ ...w,
68
+ ...K
69
+ }, ...C, children: r }) }),
70
+ /* @__PURE__ */ c(L, { $as: k, ref: N, onMouseEnter: n, onMouseLeave: i, onClick: l, onTouchStart: x, onFocus: A, onBlur: B, onKeyDown: M, "aria-expanded": b, "aria-describedby": t, "aria-label": F, "data-testid": `${e}-wrapper`, children: g })
47
71
  ] });
48
72
  });
49
- V.displayName = l;
73
+ q.displayName = e;
50
74
  export {
51
- V as default
75
+ q as default
52
76
  };
@@ -1,31 +1,30 @@
1
- "use client";
2
- import { jsx as m } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as c } from "react";
4
- import { tokensHandler as i } from "../../../tokens/utils.js";
1
+ import { jsx as n } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as l } from "react";
3
+ import { tokensHandler as c } from "../../../tokens/utils.js";
5
4
  import { get as d } from "../../../utils/helpers.js";
6
- const w = c((t, o) => {
7
- const {
8
- theme: {
9
- tooltip: e,
10
- ...r
11
- } = {},
12
- styles: s = {},
13
- $as: p = "div",
14
- ...n
15
- } = t, l = new Proxy(e || {}, i(r)), f = [d(l, "wrapper.default", {}), s];
16
- return /* @__PURE__ */ m(p, { css: f, ...n, ref: o });
17
- }), x = c((t, o) => {
18
- const {
19
- theme: {
20
- tooltip: e,
21
- ...r
22
- } = {},
23
- styles: s = {},
24
- ...p
25
- } = t, n = new Proxy(e || {}, i(r)), l = [d(n, "default", {}), s];
26
- return /* @__PURE__ */ m("div", { css: l, ...p, ref: o });
5
+ const h = l(({
6
+ theme: {
7
+ tooltip: t,
8
+ ...e
9
+ } = {},
10
+ styles: o = {},
11
+ $as: r = "div",
12
+ ...p
13
+ }, s) => {
14
+ const m = new Proxy(t || {}, c(e)), f = [d(m, "wrapper.default", {}), o];
15
+ return /* @__PURE__ */ n(r, { css: f, ...p, ref: s });
16
+ }), w = l(({
17
+ theme: {
18
+ tooltip: t,
19
+ ...e
20
+ } = {},
21
+ styles: o = {},
22
+ ...r
23
+ }, p) => {
24
+ const s = new Proxy(t || {}, c(e)), m = [d(s, "default", {}), o];
25
+ return /* @__PURE__ */ n("div", { css: m, ...r, ref: p });
27
26
  });
28
27
  export {
29
- x as TooltipStyled,
30
- w as TooltipWrapperStyled
28
+ w as TooltipStyled,
29
+ h as TooltipWrapperStyled
31
30
  };
@@ -1,78 +1,80 @@
1
- import { useState as p, useRef as v, useCallback as E, useEffect as k } from "react";
2
- import { DEFAULT_DELAY as X, DEFAULT_GAP as D } from "./constants.js";
3
- import { TooltipPosition as o } from "./Tooltip.types.js";
4
- const x = (e = o.Top, r = X, n = D) => {
5
- const [t, L] = p(!1), [b, A] = p({
1
+ import { useState as v, useRef as p, useCallback as E, useEffect as B } from "react";
2
+ import { DEFAULT_DELAY as D, DEFAULT_GAP as z } from "./constants.js";
3
+ import { TooltipPosition as n } from "./Tooltip.types.js";
4
+ const x = (e = n.Top, r = D, o = z) => {
5
+ const [t, L] = v(!1), [y, A] = v({
6
6
  top: -1e3,
7
7
  left: -1e3
8
- }), [C, F] = p(e), d = v(null), f = v(null), i = v(null), c = E(() => {
9
- if (!f.current || !d.current) return;
10
- const s = d.current.getBoundingClientRect(), l = f.current.getBoundingClientRect(), w = B(s, l, e, n), u = y(e, l, w);
11
- F(u), A(u === e ? w : B(s, l, u, n));
12
- }, [n, e]), Y = E(() => {
13
- i.current = setTimeout(() => {
14
- d.current && (L(!0), requestAnimationFrame(() => {
15
- c();
8
+ }), [F, Y] = v(e), c = p(null), h = p(null), s = p(null), w = E(() => {
9
+ if (!h.current || !c.current) return;
10
+ const i = c.current.getBoundingClientRect(), d = h.current.getBoundingClientRect(), f = C(i, d, e, o), u = S(e, d, f);
11
+ Y(u), A(u === e ? f : C(i, d, u, o));
12
+ }, [o, e]), X = E(() => {
13
+ s.current = setTimeout(() => {
14
+ c.current && (L(!0), requestAnimationFrame(() => {
15
+ w();
16
16
  }));
17
17
  }, r);
18
- }, [r, c]), h = E(() => {
19
- i.current && clearTimeout(i.current), L(!1);
18
+ }, [r, w]), l = E(() => {
19
+ s.current && clearTimeout(s.current), L(!1);
20
20
  }, []);
21
- return k(() => () => {
22
- i.current && (clearTimeout(i.current), i.current = null);
23
- }, []), k(() => {
21
+ return B(() => () => {
22
+ s.current && (clearTimeout(s.current), s.current = null);
23
+ }, []), B(() => {
24
24
  if (!t) return;
25
- const s = (a) => {
26
- const m = a.target, g = d.current, T = f.current;
27
- !g || !m || g.contains(m) || T && T.contains(m) || h();
28
- }, l = (a) => {
29
- a.key === "Escape" && h();
30
- }, w = () => c(), u = () => c();
31
- return document.addEventListener("mousedown", s, !0), document.addEventListener("touchstart", s, !0), window.addEventListener("keydown", l), window.addEventListener("resize", w), window.addEventListener("scroll", u, {
25
+ const i = (a) => {
26
+ const m = a.target, b = c.current, k = h.current;
27
+ !b || !m || b.contains(m) || k && k.contains(m) || l();
28
+ }, d = (a) => {
29
+ a.key === "Escape" && l();
30
+ }, f = () => w(), u = () => w(), g = () => l(), T = () => {
31
+ document.hidden && l();
32
+ };
33
+ return document.addEventListener("mousedown", i, !0), document.addEventListener("touchstart", i, !0), document.addEventListener("visibilitychange", T), window.addEventListener("keydown", d), window.addEventListener("resize", f), window.addEventListener("scroll", u, {
32
34
  passive: !0
33
- }), () => {
34
- document.removeEventListener("mousedown", s, !0), document.removeEventListener("touchstart", s, !0), window.removeEventListener("keydown", l), window.removeEventListener("resize", w), window.removeEventListener("scroll", u);
35
+ }), window.addEventListener("blur", g), () => {
36
+ document.removeEventListener("mousedown", i, !0), document.removeEventListener("touchstart", i, !0), document.removeEventListener("visibilitychange", T), window.removeEventListener("keydown", d), window.removeEventListener("resize", f), window.removeEventListener("scroll", u), window.removeEventListener("blur", g);
35
37
  };
36
- }, [c, h, t]), {
38
+ }, [w, l, t]), {
37
39
  isVisible: t,
38
- coords: b,
39
- containerRef: d,
40
- tooltipRef: f,
41
- showTooltip: Y,
42
- hideTooltip: h,
43
- positionWithFallback: C
40
+ coords: y,
41
+ containerRef: c,
42
+ tooltipRef: h,
43
+ showTooltip: X,
44
+ hideTooltip: l,
45
+ positionWithFallback: F
44
46
  };
45
- }, B = (e, r, n, t) => {
46
- switch (n) {
47
- case o.Top:
47
+ }, C = (e, r, o, t) => {
48
+ switch (o) {
49
+ case n.Top:
48
50
  return {
49
51
  top: e.top + window.scrollY - r.height - t,
50
52
  left: e.left + window.scrollX + e.width / 2
51
53
  };
52
- case o.Bottom:
54
+ case n.Bottom:
53
55
  return {
54
56
  top: e.top + window.scrollY + e.height + t,
55
57
  left: e.left + window.scrollX + e.width / 2
56
58
  };
57
- case o.Left:
59
+ case n.Left:
58
60
  return {
59
61
  top: e.top + window.scrollY + e.height / 2,
60
62
  left: e.left + window.scrollX - r.width - t
61
63
  };
62
- case o.Right:
64
+ case n.Right:
63
65
  return {
64
66
  top: e.top + window.scrollY + e.height / 2,
65
67
  left: e.right + window.scrollX + t
66
68
  };
67
69
  default:
68
- throw Error(`Unexpected position '${n}'`);
70
+ throw Error(`Unexpected position '${o}'`);
69
71
  }
70
- }, y = (e, r, n) => {
72
+ }, S = (e, r, o) => {
71
73
  let t = e;
72
- return e === o.Top && n.top < 0 ? t = o.Bottom : e === o.Bottom && n.top + r.height > window.innerHeight + window.scrollY ? t = o.Top : e === o.Left && n.left < 0 ? t = o.Right : e === o.Right && n.left + r.width > window.innerWidth + window.scrollX && (t = o.Left), t;
74
+ return e === n.Top && o.top < 0 ? t = n.Bottom : e === n.Bottom && o.top + r.height > window.innerHeight + window.scrollY ? t = n.Top : e === n.Left && o.left < 0 ? t = n.Right : e === n.Right && o.left + r.width > window.innerWidth + window.scrollX && (t = n.Left), t;
73
75
  };
74
76
  export {
75
- B as getCoords,
76
- y as getFallbackPosition,
77
+ C as getCoords,
78
+ S as getFallbackPosition,
77
79
  x as useTooltip
78
80
  };
@@ -1,26 +1,26 @@
1
1
  "use client";
2
2
  import { jsx as y } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as c } from "react";
3
+ import { forwardRef as l } from "react";
4
4
  import { COMPONENT_NAME as t } from "./constants.js";
5
5
  import { TypographyStyled as d } from "./TypographyStyled.js";
6
- import { TypographyVariant as h, TextAlign as g } from "../../../types/typography.js";
7
- import { useTheme as T } from "../../../hooks/useTheme/useTheme.js";
8
- const $ = c((a, e) => {
6
+ import { useTheme as h } from "../../../hooks/useTheme/useTheme.js";
7
+ import { TextAlign as T, TypographyVariant as $ } from "../../../types/typography.js";
8
+ const g = l(({
9
+ variant: r = $.Inherit,
10
+ as: o,
11
+ size: e,
12
+ children: a,
13
+ align: i = T.Start,
14
+ color: m = "text.default",
15
+ styleVariant: p,
16
+ ...f
17
+ }, s) => {
9
18
  const {
10
- variant: r = h.Inherit,
11
- as: o,
12
- size: i,
13
- children: m,
14
- align: n = g.Start,
15
- color: s = "text.default",
16
- styleVariant: p,
17
- ...l
18
- } = a, {
19
- theme: f
20
- } = T();
21
- return /* @__PURE__ */ y(d, { ref: e, theme: f, $as: o || r, $variant: r, $align: n, $size: i, $color: s, $styleVariant: p, "data-testid": t, ...l, children: m });
19
+ theme: n
20
+ } = h();
21
+ return /* @__PURE__ */ y(d, { ref: s, theme: n, $as: o || r, $variant: r, $align: i, $size: e, $color: m, $styleVariant: p, "data-testid": t, ...f, children: a });
22
22
  });
23
- $.displayName = t;
23
+ g.displayName = t;
24
24
  export {
25
- $ as Typography
25
+ g as Typography
26
26
  };
@@ -1,8 +1,8 @@
1
1
  import { ElementType, PropsWithChildren } from 'react';
2
- import { CommonCssComponentProps, CommonCssComponentStyledProps } from '../..';
2
+ import { BoxCssComponentProps, BoxCssComponentStyledProps, CommonCssComponentProps, CommonCssComponentStyledProps } from '../..';
3
3
  import { EnumOrPrimitive, SizeVariant, TextAlign, TypographyStyleVariant, TypographyVariant } from '../../../types';
4
4
  export type StyleVariant = EnumOrPrimitive<TypographyStyleVariant> | EnumOrPrimitive<TypographyStyleVariant>[];
5
- export interface TypographyProps extends CommonCssComponentProps<HTMLBaseElement>, PropsWithChildren {
5
+ export interface TypographyProps extends CommonCssComponentProps<HTMLBaseElement>, Omit<BoxCssComponentProps<HTMLBaseElement>, 'onAbort'>, PropsWithChildren {
6
6
  as?: keyof HTMLElementTagNameMap | ElementType;
7
7
  color?: string;
8
8
  variant?: EnumOrPrimitive<TypographyVariant>;
@@ -10,7 +10,7 @@ export interface TypographyProps extends CommonCssComponentProps<HTMLBaseElement
10
10
  align?: EnumOrPrimitive<TextAlign>;
11
11
  styleVariant?: StyleVariant;
12
12
  }
13
- export interface TypographyStyledProps extends CommonCssComponentStyledProps<HTMLBaseElement>, PropsWithChildren {
13
+ export interface TypographyStyledProps extends CommonCssComponentStyledProps<HTMLBaseElement>, Omit<BoxCssComponentStyledProps<HTMLBaseElement>, 'onAbort'>, PropsWithChildren {
14
14
  $as?: keyof HTMLElementTagNameMap | ElementType;
15
15
  $color?: string;
16
16
  $variant?: EnumOrPrimitive<TypographyVariant>;