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,17 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
|
|
4
|
-
import { SizeVariant as m } from "../../types/common.js";
|
|
5
|
-
const {
|
|
6
|
-
width: h,
|
|
7
|
-
height: s
|
|
8
|
-
} = l.size[m.Sm], V = ({
|
|
9
|
-
width: o = h,
|
|
10
|
-
height: i = s,
|
|
2
|
+
import { jsx as o } from "@emotion/react/jsx-runtime";
|
|
3
|
+
const l = ({
|
|
11
4
|
fillSvg: e = "none",
|
|
12
|
-
fill:
|
|
13
|
-
...
|
|
14
|
-
}) => /* @__PURE__ */
|
|
5
|
+
fill: n = "currentColor",
|
|
6
|
+
...r
|
|
7
|
+
}) => /* @__PURE__ */ o("svg", { fill: e, viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", ...r, children: /* @__PURE__ */ o("path", { d: "M2 5.99999V9.99999H4.66667L8 13.3333V2.66665L4.66667 5.99999H2ZM11 7.99999C11 6.81999 10.32 5.80665 9.33333 5.31332V10.68C10.32 10.1933 11 9.17999 11 7.99999ZM9.33333 2.15332V3.52665C11.26 4.09999 12.6667 5.88665 12.6667 7.99999C12.6667 10.1133 11.26 11.9 9.33333 12.4733V13.8467C12.0067 13.24 14 10.8533 14 7.99999C14 5.14665 12.0067 2.75999 9.33333 2.15332Z", fill: n }) });
|
|
15
8
|
export {
|
|
16
|
-
|
|
9
|
+
l as VolumeUpIcon
|
|
17
10
|
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export declare const WifiTetheringIcon: ({
|
|
1
|
+
export declare const WifiTetheringIcon: ({ fillSvg, fill, ...rest }: {
|
|
2
2
|
[x: string]: any;
|
|
3
|
-
width?: number | undefined;
|
|
4
|
-
height?: number | undefined;
|
|
5
3
|
fillSvg?: string | undefined;
|
|
6
4
|
fill?: string | undefined;
|
|
7
5
|
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as C } from "@emotion/react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
import { SizeVariant as h } from "../../types/common.js";
|
|
5
|
-
const {
|
|
6
|
-
width: l,
|
|
7
|
-
height: m
|
|
8
|
-
} = n.size[h.Sm], d = ({
|
|
9
|
-
width: t = l,
|
|
10
|
-
height: i = m,
|
|
3
|
+
const t = ({
|
|
11
4
|
fillSvg: o = "none",
|
|
12
5
|
fill: e = "currentColor",
|
|
13
|
-
...
|
|
14
|
-
}) => /* @__PURE__ */ C("svg", {
|
|
6
|
+
...n
|
|
7
|
+
}) => /* @__PURE__ */ C("svg", { viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", fill: o, ...n, children: /* @__PURE__ */ C("path", { d: "M7.99998 7.33333C7.26665 7.33333 6.66665 7.93333 6.66665 8.66667C6.66665 9.4 7.26665 10 7.99998 10C8.73331 10 9.33331 9.4 9.33331 8.66667C9.33331 7.93333 8.73331 7.33333 7.99998 7.33333ZM12 8.66667C12 6.46 10.2066 4.66667 7.99998 4.66667C5.79331 4.66667 3.99998 6.46 3.99998 8.66667C3.99998 10.1467 4.80665 11.4333 5.99998 12.1267L6.66665 10.9667C5.87331 10.5 5.33331 9.65333 5.33331 8.66667C5.33331 7.19333 6.52665 6 7.99998 6C9.47331 6 10.6666 7.19333 10.6666 8.66667C10.6666 9.65333 10.1266 10.5 9.33331 10.9667L9.99998 12.1267C11.1933 11.4333 12 10.1467 12 8.66667ZM7.99998 2C4.31998 2 1.33331 4.98667 1.33331 8.66667C1.33331 11.1333 2.67331 13.28 4.65998 14.4333L5.32665 13.28C3.73998 12.3533 2.66665 10.64 2.66665 8.66667C2.66665 5.72 5.05331 3.33333 7.99998 3.33333C10.9466 3.33333 13.3333 5.72 13.3333 8.66667C13.3333 10.64 12.26 12.3533 10.6666 13.28L11.3333 14.4333C13.3266 13.28 14.6666 11.1333 14.6666 8.66667C14.6666 4.98667 11.68 2 7.99998 2Z", fill: e }) });
|
|
15
8
|
export {
|
|
16
|
-
|
|
9
|
+
t as WifiTetheringIcon
|
|
17
10
|
};
|
|
@@ -1,44 +1,47 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { convertToInlineBoxStyles as
|
|
2
|
+
import { jsxs as b, jsx as n } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as x } from "react";
|
|
4
|
+
import { convertToInlineBoxStyles as T } from "../../../tokens/utils.js";
|
|
5
5
|
import { COMPONENT_NAME as e } from "./constants.js";
|
|
6
|
-
import { ButtonStyled as
|
|
7
|
-
import { ButtonVariant as
|
|
8
|
-
import { useTheme as
|
|
9
|
-
import { get as
|
|
10
|
-
import { TabIndex as
|
|
11
|
-
const
|
|
6
|
+
import { ButtonStyled as C, StartIconStyled as E, ContentStyled as N, EndIconStyled as j } from "./ButtonStyled.js";
|
|
7
|
+
import { ButtonVariant as v, ButtonTypes as P, ButtonRole as M } from "../../../types/button.js";
|
|
8
|
+
import { useTheme as O } from "../../../hooks/useTheme/useTheme.js";
|
|
9
|
+
import { get as R } from "../../../utils/helpers.js";
|
|
10
|
+
import { TabIndex as W } from "../../../types/accesability.js";
|
|
11
|
+
const g = x((u, m) => {
|
|
12
12
|
const {
|
|
13
13
|
theme: t
|
|
14
|
-
} =
|
|
15
|
-
variant:
|
|
16
|
-
rounded:
|
|
14
|
+
} = O(), {
|
|
15
|
+
variant: c = v.Primary,
|
|
16
|
+
rounded: f = R(t, "button.attrs.rounded", "none"),
|
|
17
17
|
children: o,
|
|
18
18
|
iconStart: r = null,
|
|
19
19
|
iconEnd: a = null,
|
|
20
|
-
type:
|
|
21
|
-
disabled:
|
|
22
|
-
isIcon:
|
|
20
|
+
type: p = P.Button,
|
|
21
|
+
disabled: y = !1,
|
|
22
|
+
isIcon: h = !1,
|
|
23
23
|
ariaLabel: i,
|
|
24
24
|
ariaPressed: l,
|
|
25
|
-
role:
|
|
26
|
-
fullWidth:
|
|
27
|
-
tabIndex:
|
|
28
|
-
onClick:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
role: B = M.Button,
|
|
26
|
+
fullWidth: I = !1,
|
|
27
|
+
tabIndex: S = W.Default,
|
|
28
|
+
onClick: $,
|
|
29
|
+
justifyContent: d,
|
|
30
|
+
...s
|
|
31
|
+
} = u;
|
|
32
|
+
return /* @__PURE__ */ b(C, { ref: m, $variant: c, $isIcon: h, $fullWidth: I, $rounded: f, disabled: y, onClick: $, type: p, role: B, theme: t, tabIndex: S, "data-testid": e, ...T(s), ...i ? {
|
|
32
33
|
"aria-label": i
|
|
33
34
|
} : {}, ...l ? {
|
|
34
35
|
"aria-pressed": l
|
|
35
|
-
} : {}, ...
|
|
36
|
+
} : {}, ...s, children: [
|
|
36
37
|
r ? /* @__PURE__ */ n(E, { theme: t, "data-testid": `${e}-icon-start`, children: r }) : null,
|
|
37
|
-
o ? /* @__PURE__ */ n(N, { theme: t,
|
|
38
|
-
|
|
38
|
+
o ? /* @__PURE__ */ n(N, { theme: t, styles: d ? {
|
|
39
|
+
justifyContent: d
|
|
40
|
+
} : {}, "data-testid": `${e}-content`, children: o }) : null,
|
|
41
|
+
a ? /* @__PURE__ */ n(j, { theme: t, "data-testid": `${e}-icon-end`, children: a }) : null
|
|
39
42
|
] });
|
|
40
43
|
});
|
|
41
|
-
|
|
44
|
+
g.displayName = e;
|
|
42
45
|
export {
|
|
43
|
-
|
|
46
|
+
g as Button
|
|
44
47
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PropsWithChildren, MouseEvent, ReactNode } from 'react';
|
|
2
|
-
import { ButtonRole, ButtonTypes, ButtonVariant, EnumOrPrimitive } from '../../../types';
|
|
2
|
+
import { ButtonRole, ButtonTypes, ButtonVariant, EnumOrPrimitive, Rounded } from '../../../types';
|
|
3
3
|
import { BoxCssComponentProps, BoxCssComponentStyledProps } from '../..';
|
|
4
4
|
export interface ButtonProps extends BoxCssComponentProps<HTMLButtonElement>, PropsWithChildren {
|
|
5
5
|
variant?: EnumOrPrimitive<ButtonVariant>;
|
|
6
|
-
rounded?:
|
|
6
|
+
rounded?: Rounded;
|
|
7
7
|
iconStart?: ReactNode;
|
|
8
8
|
iconEnd?: ReactNode;
|
|
9
9
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
@@ -1,58 +1,59 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as c } from "@emotion/react/jsx-runtime";
|
|
3
2
|
import { forwardRef as b } from "react";
|
|
4
|
-
import { getBoxStyles as h, tokensHandler as
|
|
3
|
+
import { getBoxStyles as h, tokensHandler as x } from "../../../tokens/utils.js";
|
|
5
4
|
import { get as t } from "../../../utils/helpers.js";
|
|
6
|
-
const
|
|
5
|
+
const w = b(({
|
|
6
|
+
theme: {
|
|
7
|
+
button: e,
|
|
8
|
+
...o
|
|
9
|
+
} = {},
|
|
10
|
+
$isIcon: n,
|
|
11
|
+
$fullWidth: s,
|
|
12
|
+
$variant: l,
|
|
13
|
+
$rounded: d,
|
|
14
|
+
className: m,
|
|
15
|
+
styles: p = {},
|
|
16
|
+
...a
|
|
17
|
+
}, f) => {
|
|
7
18
|
const {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
$isIcon: u,
|
|
13
|
-
$fullWidth: d,
|
|
14
|
-
$variant: p,
|
|
15
|
-
$rounded: a,
|
|
16
|
-
styles: m = {},
|
|
17
|
-
...f
|
|
18
|
-
} = e, {
|
|
19
|
-
boxStyles: i,
|
|
20
|
-
restProps: y
|
|
21
|
-
} = h(f), r = new Proxy(s || {}, P(o)), l = t(o, ["radius", a], "0px"), S = [t(r, "default", {}), t(r, p, {}), i, u ? t(r, "icon", {}) : {}, d ? t(r, "fullWidth", {}) : {}, {
|
|
22
|
-
borderRadius: l,
|
|
19
|
+
boxStyles: y,
|
|
20
|
+
restProps: S
|
|
21
|
+
} = h(a), r = new Proxy(e || {}, x(o)), u = t(o, ["radius", d], "0px"), i = [t(r, "default", {}), t(r, l, {}), y, n ? t(r, "icon", {}) : {}, s ? t(r, "fullWidth", {}) : {}, {
|
|
22
|
+
borderRadius: u,
|
|
23
23
|
"&:focus-visible::after": {
|
|
24
|
-
borderRadius:
|
|
24
|
+
borderRadius: u
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
return /* @__PURE__ */ c("button", { css:
|
|
28
|
-
}),
|
|
26
|
+
}, p];
|
|
27
|
+
return /* @__PURE__ */ c("button", { css: i, className: m, ...S, ref: f });
|
|
28
|
+
}), N = (e) => {
|
|
29
29
|
const {
|
|
30
30
|
theme: {
|
|
31
|
-
button:
|
|
31
|
+
button: o
|
|
32
32
|
} = {},
|
|
33
|
+
styles: n,
|
|
33
34
|
...s
|
|
34
|
-
} = e,
|
|
35
|
-
return /* @__PURE__ */ c("span", { css: t(
|
|
36
|
-
},
|
|
35
|
+
} = e, l = t(o, "content", {});
|
|
36
|
+
return /* @__PURE__ */ c("span", { css: [t(l, "default", {}), n], className: "gd-button__content", ...s });
|
|
37
|
+
}, R = (e) => {
|
|
37
38
|
const {
|
|
38
39
|
theme: {
|
|
39
|
-
button:
|
|
40
|
+
button: o
|
|
40
41
|
} = {},
|
|
41
|
-
...
|
|
42
|
-
} = e,
|
|
43
|
-
return /* @__PURE__ */ c("span", { css: t(
|
|
44
|
-
},
|
|
42
|
+
...n
|
|
43
|
+
} = e, s = t(o, "startIcon", {});
|
|
44
|
+
return /* @__PURE__ */ c("span", { css: t(s, "default", {}), ...n });
|
|
45
|
+
}, _ = (e) => {
|
|
45
46
|
const {
|
|
46
47
|
theme: {
|
|
47
|
-
button:
|
|
48
|
+
button: o
|
|
48
49
|
} = {},
|
|
49
|
-
...
|
|
50
|
-
} = e,
|
|
51
|
-
return /* @__PURE__ */ c("span", { css: t(
|
|
50
|
+
...n
|
|
51
|
+
} = e, s = t(o, "endIcon", {});
|
|
52
|
+
return /* @__PURE__ */ c("span", { css: t(s, "default", {}), ...n });
|
|
52
53
|
};
|
|
53
54
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
w as ButtonStyled,
|
|
56
|
+
N as ContentStyled,
|
|
57
|
+
_ as EndIconStyled,
|
|
58
|
+
R as StartIconStyled
|
|
58
59
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const Dropdown: import('react').ForwardRefExoticComponent<import('../..').
|
|
1
|
+
export declare const Dropdown: import('react').ForwardRefExoticComponent<import('../..').BoxCssComponentProps<HTMLDivElement> & {
|
|
2
2
|
children?: import('react').ReactNode | undefined;
|
|
3
3
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as
|
|
2
|
+
import { jsx as a } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as u } from "react";
|
|
4
4
|
import { KEYBOARD_KEYS as s } from "../../../constants/keyboard.js";
|
|
5
|
-
import { getClosestFocusable as
|
|
6
|
-
import { DropdownStyled as
|
|
5
|
+
import { getClosestFocusable as y } from "../../../utils/focus.js";
|
|
6
|
+
import { DropdownStyled as D } from "./DropdownStyled.js";
|
|
7
7
|
import { COMPONENT_NAME as c } from "./constants.js";
|
|
8
|
-
import { useTheme as
|
|
9
|
-
const
|
|
8
|
+
import { useTheme as E } from "../../../hooks/useTheme/useTheme.js";
|
|
9
|
+
const R = u(({
|
|
10
|
+
children: p,
|
|
11
|
+
...l
|
|
12
|
+
}, d) => {
|
|
10
13
|
const {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
theme: a
|
|
15
|
-
} = R();
|
|
16
|
-
return /* @__PURE__ */ u(E, { ref: p, theme: a, "data-testid": c, onKeyDown: (o) => {
|
|
14
|
+
theme: f
|
|
15
|
+
} = E();
|
|
16
|
+
return /* @__PURE__ */ a(D, { ref: d, theme: f, "data-testid": c, onKeyDown: (o) => {
|
|
17
17
|
var m;
|
|
18
18
|
if (![s.ARROW_DOWN, s.ARROW_UP].includes(o.key))
|
|
19
19
|
return;
|
|
@@ -22,7 +22,7 @@ const w = y((l, p) => {
|
|
|
22
22
|
if (t && e.contains(t)) {
|
|
23
23
|
const r = document.createElement("div");
|
|
24
24
|
e.insertBefore(r, i ? t : t.nextSibling);
|
|
25
|
-
const n =
|
|
25
|
+
const n = y({
|
|
26
26
|
initial: r,
|
|
27
27
|
previous: i,
|
|
28
28
|
root: e,
|
|
@@ -30,9 +30,9 @@ const w = y((l, p) => {
|
|
|
30
30
|
});
|
|
31
31
|
e.removeChild(r), n == null || n.focus();
|
|
32
32
|
}
|
|
33
|
-
}, ...
|
|
33
|
+
}, ...l, children: p });
|
|
34
34
|
});
|
|
35
|
-
|
|
35
|
+
R.displayName = c;
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
R as Dropdown
|
|
38
38
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BoxCssComponentProps, BoxCssComponentStyledProps } from '../../index.types';
|
|
3
3
|
import { OnSelectProps } from '../types/events.types';
|
|
4
|
-
export type DropdownProps = PropsWithChildren<
|
|
5
|
-
export type DropdownStyledProps = PropsWithChildren<
|
|
4
|
+
export type DropdownProps = PropsWithChildren<BoxCssComponentProps>;
|
|
5
|
+
export type DropdownStyledProps = PropsWithChildren<BoxCssComponentStyledProps>;
|
|
6
6
|
export interface DropdownContextType {
|
|
7
7
|
onSelect?: (props: OnSelectProps) => void;
|
|
8
8
|
}
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx as d } from "@emotion/react/jsx-runtime";
|
|
1
|
+
import { jsx as c } from "@emotion/react/jsx-runtime";
|
|
3
2
|
import { forwardRef as f } from "react";
|
|
4
|
-
import { getBoxStyles as
|
|
3
|
+
import { getBoxStyles as l, tokensHandler as y } from "../../../tokens/utils.js";
|
|
5
4
|
import { get as S } from "../../../utils/helpers.js";
|
|
6
|
-
const a = f((
|
|
5
|
+
const a = f(({
|
|
6
|
+
theme: {
|
|
7
|
+
select: o,
|
|
8
|
+
...t
|
|
9
|
+
} = {},
|
|
10
|
+
styles: e = {},
|
|
11
|
+
...r
|
|
12
|
+
}, s) => {
|
|
7
13
|
const {
|
|
8
|
-
theme: {
|
|
9
|
-
select: o,
|
|
10
|
-
...r
|
|
11
|
-
} = {},
|
|
12
|
-
styles: s = {},
|
|
13
|
-
...n
|
|
14
|
-
} = t, {
|
|
15
14
|
boxStyles: m,
|
|
16
|
-
restProps:
|
|
17
|
-
} =
|
|
18
|
-
return /* @__PURE__ */
|
|
15
|
+
restProps: n
|
|
16
|
+
} = l(r), p = new Proxy(o || {}, y(t)), d = [S(p, "dropdown", {}), m, e];
|
|
17
|
+
return /* @__PURE__ */ c("div", { css: d, ...n, ref: s });
|
|
19
18
|
});
|
|
20
19
|
export {
|
|
21
20
|
a as DropdownStyled
|
|
@@ -1,40 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
...
|
|
2
|
+
import { jsx as x } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as L } from "react";
|
|
4
|
+
import { getBoxStyles as C } from "../../../tokens/utils.js";
|
|
5
|
+
import { IconsList as P, COMPONENT_NAME as i } from "./constants.js";
|
|
6
|
+
import { useTheme as g } from "../../../hooks/useTheme/useTheme.js";
|
|
7
|
+
import { get as e } from "../../../utils/helpers.js";
|
|
8
|
+
let r = {};
|
|
9
|
+
const j = (o) => {
|
|
10
|
+
r = {
|
|
11
|
+
...r,
|
|
12
|
+
...o
|
|
12
13
|
};
|
|
13
|
-
},
|
|
14
|
+
}, h = L(({
|
|
15
|
+
name: o,
|
|
16
|
+
width: m = 18,
|
|
17
|
+
height: p = 18,
|
|
18
|
+
fill: t,
|
|
19
|
+
fillSvg: s,
|
|
20
|
+
size: u,
|
|
21
|
+
styles: I,
|
|
22
|
+
...d
|
|
23
|
+
}, f) => {
|
|
14
24
|
const {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = s, {
|
|
23
|
-
theme: d
|
|
24
|
-
} = L(), {
|
|
25
|
-
icon: p,
|
|
26
|
-
colors: r
|
|
27
|
-
} = d || {}, g = n(p, ["size", I], {
|
|
28
|
-
width: f,
|
|
29
|
-
height: u
|
|
25
|
+
theme: y
|
|
26
|
+
} = g(), {
|
|
27
|
+
icon: N,
|
|
28
|
+
colors: n
|
|
29
|
+
} = y || {}, S = e(N, ["size", u], {
|
|
30
|
+
width: m,
|
|
31
|
+
height: p
|
|
30
32
|
}), c = {
|
|
31
|
-
|
|
32
|
-
...
|
|
33
|
-
}[
|
|
34
|
-
|
|
33
|
+
...P,
|
|
34
|
+
...r
|
|
35
|
+
}[o];
|
|
36
|
+
if (!c)
|
|
37
|
+
return console.warn(`Icon "${String(o)}" not found.`), null;
|
|
38
|
+
const {
|
|
39
|
+
boxStyles: $,
|
|
40
|
+
restProps: a
|
|
41
|
+
} = C(d), l = [$, I];
|
|
42
|
+
return /* @__PURE__ */ x(c, { ref: f, "data-testid": `${i}-${o}`, fill: t && e(n, t, t), fillSvg: s && e(n, s, s), ...S, css: l, ...a });
|
|
35
43
|
});
|
|
36
|
-
|
|
44
|
+
h.displayName = i;
|
|
37
45
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
h as Icon,
|
|
47
|
+
j as registerCustomIcons
|
|
40
48
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MouseEventHandler } from 'react';
|
|
2
2
|
import { EnumOrPrimitive, SizeVariant } from '../../../types';
|
|
3
|
-
|
|
3
|
+
import { BoxCssComponentProps } from '../..';
|
|
4
|
+
export interface IconProps extends Omit<BoxCssComponentProps<SVGElement>, 'width' | 'height'> {
|
|
4
5
|
name: string;
|
|
5
6
|
width?: number;
|
|
6
7
|
height?: number;
|