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.
- package/README.md +2 -2
- package/ai/README.md +210 -16
- package/ai/schemas/components/Accordion.d.ts +84 -0
- package/ai/schemas/components/Button.d.ts +12 -0
- package/ai/schemas/components/ChatContainer.d.ts +0 -8
- package/ai/schemas/components/Column.d.ts +5 -5
- package/ai/schemas/components/InputFile.d.ts +17 -5
- package/ai/schemas/components/Menu.d.ts +37 -0
- package/ai/schemas/components/Row.d.ts +6 -6
- package/ai/schemas/components/Scroll.d.ts +7 -0
- package/ai/schemas/components/Typography.d.ts +0 -21
- package/assets/icons/account_circle.d.ts +1 -3
- package/assets/icons/account_circle.js +7 -14
- package/assets/icons/arrow-down.d.ts +2 -3
- package/assets/icons/arrow-down.js +6 -11
- package/assets/icons/arrow-forward.d.ts +1 -3
- package/assets/icons/arrow-forward.js +6 -13
- package/assets/icons/attachment.d.ts +1 -3
- package/assets/icons/attachment.js +7 -14
- package/assets/icons/check.d.ts +1 -3
- package/assets/icons/check.js +5 -11
- package/assets/icons/chevron-left.d.ts +1 -3
- package/assets/icons/chevron-left.js +7 -14
- package/assets/icons/chevron-right.d.ts +1 -3
- package/assets/icons/chevron-right.js +6 -13
- package/assets/icons/content-copy.d.ts +1 -3
- package/assets/icons/content-copy.js +7 -14
- package/assets/icons/delete_outlined.d.ts +1 -3
- package/assets/icons/delete_outlined.js +5 -12
- package/assets/icons/dot.d.ts +1 -3
- package/assets/icons/dot.js +5 -11
- package/assets/icons/error_outline.d.ts +1 -4
- package/assets/icons/error_outline.js +6 -18
- package/assets/icons/eye.d.ts +1 -3
- package/assets/icons/eye.js +7 -14
- package/assets/icons/file-copy.d.ts +1 -3
- package/assets/icons/file-copy.js +7 -13
- package/assets/icons/filter.d.ts +1 -3
- package/assets/icons/filter.js +6 -13
- package/assets/icons/folder.d.ts +1 -3
- package/assets/icons/folder.js +6 -13
- package/assets/icons/folderOpen.d.ts +1 -3
- package/assets/icons/folderOpen.js +7 -14
- package/assets/icons/home.d.ts +1 -3
- package/assets/icons/home.js +6 -13
- package/assets/icons/local_shipping.d.ts +1 -3
- package/assets/icons/local_shipping.js +4 -11
- package/assets/icons/minus.d.ts +1 -3
- package/assets/icons/minus.js +7 -13
- package/assets/icons/mobile_menu_button.d.ts +1 -3
- package/assets/icons/mobile_menu_button.js +7 -14
- package/assets/icons/paymentCard.d.ts +1 -3
- package/assets/icons/paymentCard.js +6 -13
- package/assets/icons/plus.d.ts +1 -3
- package/assets/icons/plus.js +5 -11
- package/assets/icons/portrait.d.ts +1 -3
- package/assets/icons/portrait.js +5 -12
- package/assets/icons/processing.d.ts +1 -3
- package/assets/icons/processing.js +6 -13
- package/assets/icons/ruler.d.ts +1 -3
- package/assets/icons/ruler.js +6 -13
- package/assets/icons/search.d.ts +1 -3
- package/assets/icons/search.js +6 -13
- package/assets/icons/shopping_bag.d.ts +1 -3
- package/assets/icons/shopping_bag.js +7 -14
- package/assets/icons/slash.d.ts +1 -3
- package/assets/icons/slash.js +6 -13
- package/assets/icons/star.d.ts +1 -3
- package/assets/icons/star.js +6 -12
- package/assets/icons/starOutlined.d.ts +1 -3
- package/assets/icons/starOutlined.js +5 -11
- package/assets/icons/toast_error.d.ts +1 -3
- package/assets/icons/toast_error.js +9 -15
- package/assets/icons/toast_info.d.ts +1 -3
- package/assets/icons/toast_info.js +7 -13
- package/assets/icons/toast_warning.d.ts +1 -3
- package/assets/icons/toast_warning.js +7 -13
- package/assets/icons/upload.d.ts +1 -3
- package/assets/icons/upload.js +6 -13
- package/assets/icons/volume-up.d.ts +1 -3
- package/assets/icons/volume-up.js +6 -13
- package/assets/icons/wifiTethering.d.ts +1 -3
- package/assets/icons/wifiTethering.js +4 -11
- package/components/core/Button/Button.js +30 -27
- package/components/core/Button/Button.types.d.ts +2 -2
- package/components/core/Button/ButtonStyled.js +40 -39
- package/components/core/Dropdown/Dropdown.d.ts +1 -1
- package/components/core/Dropdown/Dropdown.js +16 -16
- package/components/core/Dropdown/Dropdown.types.d.ts +3 -3
- package/components/core/Dropdown/DropdownStyled.js +13 -14
- package/components/core/Icon/Icon.js +41 -33
- package/components/core/Icon/Icon.types.d.ts +2 -1
- package/components/core/Icon/constants.d.ts +37 -109
- package/components/core/Input/Input.d.ts +1 -1
- package/components/core/InputFile/InputFile.d.ts +0 -32
- package/components/core/InputFile/InputFile.js +47 -33
- package/components/core/InputFile/InputFileStyled.js +24 -22
- package/components/core/Loader/Loader.js +19 -17
- package/components/core/Loader/Loader.types.d.ts +3 -1
- package/components/core/Loader/LoaderStyled.js +34 -30
- package/components/core/Menu/Menu.d.ts +2 -2
- package/components/core/Menu/Menu.js +113 -93
- package/components/core/Menu/Menu.types.d.ts +16 -11
- package/components/core/Menu/MenuStyled.d.ts +1 -1
- package/components/core/Menu/constants.js +4 -12
- package/components/core/Modal/Modal.js +60 -36
- package/components/core/Modal/ModalStyled.js +21 -22
- package/components/core/Scroll/Scroll.d.ts +6 -0
- package/components/core/Scroll/Scroll.js +53 -31
- package/components/core/Scroll/Scroll.types.d.ts +5 -0
- package/components/core/Scroll/ScrollBar.js +45 -43
- package/components/core/Scroll/ScrollStyled.js +46 -42
- package/components/core/Scroll/constants.d.ts +2 -0
- package/components/core/Scroll/constants.js +6 -4
- package/components/core/Select/Select.js +162 -134
- package/components/core/Select/Select.types.d.ts +2 -4
- package/components/core/Snackbar/Snackbar.js +60 -37
- package/components/core/Snackbar/Snackbar.types.d.ts +1 -2
- package/components/core/Snackbar/SnackbarManager.js +45 -30
- package/components/core/Snackbar/SnackbarStyled.d.ts +5 -5
- package/components/core/Snackbar/SnackbarStyled.js +111 -101
- package/components/core/Textarea/Textarea.d.ts +4 -0
- package/components/core/Tooltip/Tooltip.js +68 -44
- package/components/core/Tooltip/TooltipStyled.js +26 -27
- package/components/core/Tooltip/utils.js +47 -45
- package/components/core/Typography/Typography.js +18 -18
- package/components/core/Typography/Typography.types.d.ts +3 -3
- package/components/core/Typography/TypographyStyled.js +28 -29
- package/components/domainSpecific/Accordion/Accordion.d.ts +1 -1
- package/components/domainSpecific/Accordion/Accordion.js +19 -17
- package/components/domainSpecific/Accordion/Accordion.types.d.ts +7 -4
- package/components/domainSpecific/Accordion/AccordionContent/AccordionContent.d.ts +1 -1
- package/components/domainSpecific/Accordion/AccordionContent/AccordionContent.js +13 -12
- package/components/domainSpecific/Accordion/AccordionHeader/AccordionHeader.d.ts +1 -1
- package/components/domainSpecific/Accordion/AccordionHeader/AccordionHeader.js +15 -14
- package/components/domainSpecific/Accordion/AccordionItem/AccordionItem.d.ts +1 -1
- package/components/domainSpecific/Accordion/AccordionItem/AccordionItem.js +18 -16
- package/components/domainSpecific/Accordion/AccordionStyled.js +44 -35
- package/components/domainSpecific/Card/Card.js +31 -27
- package/components/domainSpecific/Card/CardTitle/constants.js +4 -4
- package/components/domainSpecific/Header/Header.js +4 -4
- package/components/domainSpecific/SearchModal/SearchModal.js +0 -1
- package/components/domainSpecific/SearchModal/SearchModal.types.d.ts +1 -1
- package/components/index.types.d.ts +1 -0
- package/components/layout/ChatContainer/ChatContainer.d.ts +1 -1
- package/components/layout/ChatContainer/ChatContainer.js +58 -41
- package/components/layout/ChatContainer/ChatContainer.types.d.ts +8 -5
- package/components/layout/ChatContainer/ChatContainerStyled.d.ts +2 -0
- package/components/layout/ChatContainer/ChatContainerStyled.js +105 -84
- package/components/layout/Column/Column.types.d.ts +3 -1
- package/components/layout/Column/ColumnStyled.js +23 -23
- package/components/layout/FlexContainer/FlexContainerStyled.js +7 -8
- package/components/layout/Row/Row.d.ts +1 -1
- package/components/layout/Row/Row.js +20 -20
- package/components/layout/Row/Row.types.d.ts +3 -1
- package/components/layout/Row/RowStyled.js +26 -26
- package/constants/index.d.ts +0 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/useLogger/NoOpLogger.d.ts +11 -0
- package/hooks/useLogger/NoOpLogger.js +15 -0
- package/hooks/useLogger/index.d.ts +2 -0
- package/hooks/useLogger/useLogger.d.ts +4 -0
- package/hooks/useLogger/useLogger.js +27 -0
- package/hooks/useLogger/useLogger.types.d.ts +30 -0
- package/hooks/useTheme/NoOpTheme.d.ts +4050 -0
- package/hooks/useTheme/NoOpTheme.js +15 -0
- package/hooks/useTheme/useTheme.d.ts +3 -4
- package/hooks/useTheme/useTheme.js +62 -41
- package/hooks/useTheme/useTheme.types.d.ts +3 -2
- package/index.d.ts +4 -0
- package/index.js +354 -350
- package/llms.txt +39 -19
- package/package.json +1 -1
- package/tokens/accordion.d.ts +9 -3
- package/tokens/accordion.js +14 -11
- package/tokens/button.d.ts +17 -19
- package/tokens/button.js +54 -56
- package/tokens/card.d.ts +2 -3
- package/tokens/card.js +50 -53
- package/tokens/carousel.d.ts +2 -2
- package/tokens/carousel.js +8 -9
- package/tokens/chat.d.ts +69 -48
- package/tokens/chat.js +86 -68
- package/tokens/constants.d.ts +0 -1
- package/tokens/constants.js +1 -1
- package/tokens/defaultTheme.d.ts +199 -112
- package/tokens/defaultTheme.js +27 -25
- package/tokens/header.d.ts +1 -1
- package/tokens/header.js +3 -4
- package/tokens/index.d.ts +175 -104
- package/tokens/index.js +102 -101
- package/tokens/input.d.ts +2 -2
- package/tokens/input.js +25 -26
- package/tokens/inputfile.d.ts +1 -1
- package/tokens/inputfile.js +4 -4
- package/tokens/link.d.ts +5 -0
- package/tokens/loader.d.ts +3 -0
- package/tokens/loader.js +3 -0
- package/tokens/menu.d.ts +1 -0
- package/tokens/menu.js +1 -0
- package/tokens/modal.d.ts +6 -4
- package/tokens/modal.js +42 -60
- package/tokens/scroll.d.ts +19 -2
- package/tokens/scroll.js +23 -7
- package/tokens/select.d.ts +9 -7
- package/tokens/select.js +30 -29
- package/tokens/snackbar.d.ts +36 -20
- package/tokens/snackbar.js +92 -93
- package/tokens/stepper.d.ts +1 -1
- package/tokens/stepper.js +3 -3
- package/tokens/tabs.d.ts +1 -1
- package/tokens/tabs.js +1 -1
- package/tokens/textarea.d.ts +4 -0
- package/tokens/tooltip.d.ts +5 -1
- package/tokens/tooltip.js +23 -21
- package/tokens/typography.js +114 -116
- package/tokens/values.d.ts +5 -1
- package/tokens/values.js +12 -8
- package/tokens/wrapper.d.ts +2 -2
- package/tokens/wrapper.js +7 -7
- package/tokens/zIndex.d.ts +9 -0
- package/tokens/zIndex.js +12 -0
- package/types/index.d.ts +0 -1
- package/types/styles.d.ts +1 -0
- package/utils/helpers.js +14 -15
- package/CHANGELOG.md +0 -177
- package/constants/positioning.d.ts +0 -9
- package/constants/positioning.js +0 -11
- package/types/chat.d.ts +0 -5
- 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
|
|
4
|
-
import { getBoxStyles as
|
|
5
|
-
import { Typography as
|
|
6
|
-
import { get as
|
|
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
|
-
|
|
9
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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: [
|
|
33
|
-
animation:
|
|
34
|
-
} : {},
|
|
35
|
-
}),
|
|
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:
|
|
39
|
-
...
|
|
32
|
+
snackbar: s,
|
|
33
|
+
...e
|
|
40
34
|
} = {},
|
|
41
|
-
styles:
|
|
42
|
-
...
|
|
43
|
-
} =
|
|
44
|
-
boxStyles:
|
|
45
|
-
restProps:
|
|
46
|
-
} =
|
|
47
|
-
return /* @__PURE__ */ y("div", { css:
|
|
48
|
-
},
|
|
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:
|
|
52
|
-
...
|
|
53
|
-
} = {}
|
|
54
|
-
|
|
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, { ...
|
|
58
|
-
},
|
|
52
|
+
return /* @__PURE__ */ y(f, { fill: `icon.${o}`, ...c });
|
|
53
|
+
}, W = (t) => {
|
|
59
54
|
const {
|
|
60
|
-
$variant:
|
|
55
|
+
$variant: s,
|
|
61
56
|
theme: {
|
|
62
|
-
snackbar:
|
|
63
|
-
...n
|
|
57
|
+
snackbar: e
|
|
64
58
|
} = {}
|
|
65
|
-
} =
|
|
59
|
+
} = t, o = n(e, ["icons", s], {
|
|
66
60
|
name: ""
|
|
67
61
|
});
|
|
68
|
-
return /* @__PURE__ */ y(f, { ...
|
|
69
|
-
},
|
|
62
|
+
return /* @__PURE__ */ y(f, { ...o });
|
|
63
|
+
}, q = (t) => {
|
|
70
64
|
const {
|
|
71
65
|
theme: {
|
|
72
|
-
snackbar:
|
|
73
|
-
...
|
|
66
|
+
snackbar: s,
|
|
67
|
+
...e
|
|
74
68
|
} = {},
|
|
75
|
-
styles:
|
|
76
|
-
...
|
|
77
|
-
} =
|
|
78
|
-
boxStyles:
|
|
79
|
-
restProps:
|
|
80
|
-
} =
|
|
81
|
-
return /* @__PURE__ */ y("div", { css:
|
|
82
|
-
},
|
|
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:
|
|
86
|
-
...
|
|
79
|
+
snackbar: s,
|
|
80
|
+
...e
|
|
87
81
|
} = {},
|
|
88
|
-
styles:
|
|
89
|
-
...
|
|
90
|
-
} =
|
|
91
|
-
boxStyles:
|
|
92
|
-
restProps:
|
|
93
|
-
} =
|
|
94
|
-
return /* @__PURE__ */ y("div", { css:
|
|
95
|
-
},
|
|
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:
|
|
99
|
-
...t
|
|
92
|
+
snackbar: s
|
|
100
93
|
} = {},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
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:
|
|
112
|
-
...
|
|
108
|
+
snackbar: s,
|
|
109
|
+
...e
|
|
113
110
|
} = {},
|
|
114
|
-
|
|
115
|
-
styles: e,
|
|
111
|
+
styles: o,
|
|
116
112
|
...r
|
|
117
|
-
} =
|
|
118
|
-
boxStyles:
|
|
113
|
+
} = t, {
|
|
114
|
+
boxStyles: c,
|
|
119
115
|
restProps: l
|
|
120
|
-
} =
|
|
121
|
-
return /* @__PURE__ */ y("div", { css:
|
|
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
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useTooltip as
|
|
5
|
-
import { COMPONENT_NAME as
|
|
6
|
-
import { TooltipStyled as
|
|
7
|
-
import { useTheme as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
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
|
-
} =
|
|
26
|
+
} = V(), s = Y(), {
|
|
25
27
|
isVisible: o,
|
|
26
|
-
coords:
|
|
27
|
-
containerRef:
|
|
28
|
-
tooltipRef:
|
|
29
|
-
showTooltip:
|
|
30
|
-
hideTooltip:
|
|
31
|
-
positionWithFallback:
|
|
32
|
-
} =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
73
|
+
q.displayName = e;
|
|
50
74
|
export {
|
|
51
|
-
|
|
75
|
+
q as default
|
|
52
76
|
};
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
}),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
30
|
-
|
|
28
|
+
w as TooltipStyled,
|
|
29
|
+
h as TooltipWrapperStyled
|
|
31
30
|
};
|
|
@@ -1,78 +1,80 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { DEFAULT_DELAY as
|
|
3
|
-
import { TooltipPosition as
|
|
4
|
-
const x = (e =
|
|
5
|
-
const [t, L] =
|
|
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
|
-
}), [
|
|
9
|
-
if (!
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
}, [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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,
|
|
19
|
-
|
|
18
|
+
}, [r, w]), l = E(() => {
|
|
19
|
+
s.current && clearTimeout(s.current), L(!1);
|
|
20
20
|
}, []);
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
}, []),
|
|
21
|
+
return B(() => () => {
|
|
22
|
+
s.current && (clearTimeout(s.current), s.current = null);
|
|
23
|
+
}, []), B(() => {
|
|
24
24
|
if (!t) return;
|
|
25
|
-
const
|
|
26
|
-
const m = a.target,
|
|
27
|
-
!
|
|
28
|
-
},
|
|
29
|
-
a.key === "Escape" &&
|
|
30
|
-
},
|
|
31
|
-
|
|
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",
|
|
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
|
-
}, [
|
|
38
|
+
}, [w, l, t]), {
|
|
37
39
|
isVisible: t,
|
|
38
|
-
coords:
|
|
39
|
-
containerRef:
|
|
40
|
-
tooltipRef:
|
|
41
|
-
showTooltip:
|
|
42
|
-
hideTooltip:
|
|
43
|
-
positionWithFallback:
|
|
40
|
+
coords: y,
|
|
41
|
+
containerRef: c,
|
|
42
|
+
tooltipRef: h,
|
|
43
|
+
showTooltip: X,
|
|
44
|
+
hideTooltip: l,
|
|
45
|
+
positionWithFallback: F
|
|
44
46
|
};
|
|
45
|
-
},
|
|
46
|
-
switch (
|
|
47
|
-
case
|
|
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
|
|
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
|
|
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
|
|
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 '${
|
|
70
|
+
throw Error(`Unexpected position '${o}'`);
|
|
69
71
|
}
|
|
70
|
-
},
|
|
72
|
+
}, S = (e, r, o) => {
|
|
71
73
|
let t = e;
|
|
72
|
-
return e ===
|
|
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
|
-
|
|
76
|
-
|
|
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
|
|
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 {
|
|
7
|
-
import {
|
|
8
|
-
const
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
23
|
+
g.displayName = t;
|
|
24
24
|
export {
|
|
25
|
-
|
|
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>;
|