@gobolt/genesis 0.3.22 → 0.3.24
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/dist/components/Badge/Badge.js +32 -9
- package/dist/components/Badge/styles.d.ts +10 -1
- package/dist/components/Badge/styles.js +14 -39
- package/dist/components/Button/Button.js +27 -4
- package/dist/components/Button/IconButton.js +27 -4
- package/dist/components/Button/components/Button/Button.d.ts +16 -0
- package/dist/components/Button/components/Button/Button.js +13 -0
- package/dist/components/Button/components/Button/styles.d.ts +1 -0
- package/dist/components/Button/components/Button/styles.js +118 -0
- package/dist/components/Button/constants/index.d.ts +163 -0
- package/dist/components/Button/constants/index.js +89 -0
- package/dist/components/Button/icon-button-styles.d.ts +12 -1
- package/dist/components/Button/icon-button-styles.js +16 -69
- package/dist/components/Button/styles.d.ts +16 -1
- package/dist/components/Button/styles.js +30 -88
- package/dist/components/Input/Input.js +29 -6
- package/dist/components/Input/styles.d.ts +18 -1
- package/dist/components/Input/styles.js +42 -146
- package/dist/components/Select/Select.js +125 -101
- package/dist/components/Select/SelectTrigger.js +57 -71
- package/dist/components/Table/Table.js +27 -8
- package/dist/components/Table/TableControls/CustomPagination.js +66 -50
- package/dist/components/Table/TableControls/PaginationNumber.js +43 -27
- package/dist/components/Table/TableControls/PrimaryTableControlsRow.js +17 -16
- package/dist/components/Table/TableControls/SecondaryTableControlsRow.js +36 -14
- package/dist/components/Table/TableControls/TableControls.js +4 -3
- package/dist/components/Table/TablePagination.js +21 -4
- package/dist/components/Table/__mocks__/table-mocks.js +24 -15
- package/dist/components/Table/styles.d.ts +15 -1
- package/dist/components/Table/styles.js +13 -57
- package/dist/components/Table/useTable.js +166 -69
- package/dist/components/TableWithControls/TableWithControls.js +7 -6
- package/dist/components/TableWithControls/components/Badge/Badge.d.ts +16 -0
- package/dist/components/TableWithControls/components/Badge/Badge.js +28 -0
- package/dist/components/TableWithControls/components/Badge/index.d.ts +2 -0
- package/dist/components/TableWithControls/components/Badge/index.js +1 -0
- package/dist/components/TableWithControls/components/Badge/styles.d.ts +4 -0
- package/dist/components/TableWithControls/components/Badge/styles.js +46 -0
- package/dist/components/TableWithControls/components/Button/Button.d.ts +16 -0
- package/dist/components/TableWithControls/components/Button/Button.js +13 -0
- package/dist/components/TableWithControls/components/Button/IconButton.d.ts +8 -0
- package/dist/components/TableWithControls/components/Button/IconButton.js +9 -0
- package/dist/components/TableWithControls/components/Button/icon-button-styles.d.ts +1 -0
- package/dist/components/TableWithControls/components/Button/icon-button-styles.js +76 -0
- package/dist/components/TableWithControls/components/Button/index.d.ts +4 -0
- package/dist/components/TableWithControls/components/Button/index.js +2 -0
- package/dist/components/TableWithControls/components/Button/styles.d.ts +1 -0
- package/dist/components/TableWithControls/components/Button/styles.js +118 -0
- package/dist/components/TableWithControls/components/Input/Input.d.ts +13 -0
- package/dist/components/TableWithControls/components/Input/Input.js +34 -0
- package/dist/components/TableWithControls/components/Input/index.d.ts +2 -0
- package/dist/components/TableWithControls/components/Input/index.js +1 -0
- package/dist/components/TableWithControls/components/Input/styles.d.ts +1 -0
- package/dist/components/TableWithControls/components/Input/styles.js +180 -0
- package/dist/components/TableWithControls/components/Select/Select.d.ts +26 -0
- package/dist/components/TableWithControls/components/Select/Select.js +175 -0
- package/dist/components/TableWithControls/components/Select/SelectTrigger.d.ts +23 -0
- package/dist/components/TableWithControls/components/Select/SelectTrigger.js +103 -0
- package/dist/components/TableWithControls/components/Select/index.d.ts +2 -0
- package/dist/components/TableWithControls/components/Select/index.js +1 -0
- package/dist/components/TableWithControls/components/Table/Table.d.ts +51 -0
- package/dist/components/TableWithControls/components/Table/Table.js +14 -0
- package/dist/components/TableWithControls/components/Table/TableControls/CustomPagination.d.ts +13 -0
- package/dist/components/TableWithControls/components/Table/TableControls/CustomPagination.js +158 -0
- package/dist/components/TableWithControls/components/Table/TableControls/PaginationNumber.d.ts +7 -0
- package/dist/components/TableWithControls/components/Table/TableControls/PaginationNumber.js +30 -0
- package/dist/components/TableWithControls/components/Table/TableControls/PrimaryTableControlsRow.d.ts +18 -0
- package/dist/components/TableWithControls/components/Table/TableControls/PrimaryTableControlsRow.js +77 -0
- package/dist/components/TableWithControls/components/Table/TableControls/SecondaryTableControlsRow.d.ts +11 -0
- package/dist/components/TableWithControls/components/Table/TableControls/SecondaryTableControlsRow.js +43 -0
- package/dist/components/TableWithControls/components/Table/TableControls/TableControls.d.ts +14 -0
- package/dist/components/TableWithControls/components/Table/TableControls/TableControls.js +13 -0
- package/dist/components/TableWithControls/components/Table/TableControls/index.d.ts +2 -0
- package/dist/components/TableWithControls/components/Table/TableControls/index.js +1 -0
- package/dist/components/TableWithControls/components/Table/TablePagination.d.ts +13 -0
- package/dist/components/TableWithControls/components/Table/TablePagination.js +11 -0
- package/dist/components/TableWithControls/components/Table/__mocks__/table-mocks.d.ts +20 -0
- package/dist/components/TableWithControls/components/Table/__mocks__/table-mocks.js +301 -0
- package/dist/components/TableWithControls/components/Table/index.d.ts +6 -0
- package/dist/components/TableWithControls/components/Table/index.js +3 -0
- package/dist/components/TableWithControls/components/Table/styles.d.ts +14 -0
- package/dist/components/TableWithControls/components/Table/styles.js +64 -0
- package/dist/components/TableWithControls/components/Table/useTable.d.ts +26 -0
- package/dist/components/TableWithControls/components/Table/useTable.js +141 -0
- package/dist/components/TableWithControls/components/TableWithControls/TableWithControls.d.ts +12 -0
- package/dist/components/TableWithControls/components/TableWithControls/TableWithControls.js +20 -0
- package/dist/components/TableWithControls/components/TableWithControls/useTableWithControls.d.ts +29 -0
- package/dist/components/TableWithControls/components/TableWithControls/useTableWithControls.js +136 -0
- package/dist/components/TableWithControls/components/Tooltip/Tooltip.d.ts +7 -0
- package/dist/components/TableWithControls/components/Tooltip/Tooltip.js +8 -0
- package/dist/components/TableWithControls/components/Tooltip/index.d.ts +2 -0
- package/dist/components/TableWithControls/components/Tooltip/index.js +1 -0
- package/dist/components/TableWithControls/components/Tooltip/styles.d.ts +6 -0
- package/dist/components/TableWithControls/components/Tooltip/styles.js +26 -0
- package/dist/components/TableWithControls/components/Typography/Typography.d.ts +17 -0
- package/dist/components/TableWithControls/components/Typography/Typography.js +16 -0
- package/dist/components/TableWithControls/components/Typography/index.d.ts +2 -0
- package/dist/components/TableWithControls/components/Typography/index.js +1 -0
- package/dist/components/TableWithControls/components/Typography/styles.d.ts +3 -0
- package/dist/components/TableWithControls/components/Typography/styles.js +54 -0
- package/dist/components/TableWithControls/components/UtilityButton/UtilityButton.d.ts +5 -0
- package/dist/components/TableWithControls/components/UtilityButton/UtilityButton.js +9 -0
- package/dist/components/TableWithControls/components/UtilityButton/index.d.ts +2 -0
- package/dist/components/TableWithControls/components/UtilityButton/index.js +1 -0
- package/dist/components/TableWithControls/components/shared/DropdownChevron.d.ts +2 -0
- package/dist/components/TableWithControls/components/shared/DropdownChevron.js +7 -0
- package/dist/components/TableWithControls/constants/index.d.ts +163 -0
- package/dist/components/TableWithControls/constants/index.js +89 -0
- package/dist/components/TableWithControls/types/events.d.ts +22 -0
- package/dist/components/TableWithControls/types/events.js +1 -0
- package/dist/components/TableWithControls/useTableWithControls.js +63 -82
- package/dist/components/TableWithControls/utils/icon-util.d.ts +3 -0
- package/dist/components/TableWithControls/utils/icon-util.js +116 -0
- package/dist/components/Tooltip/Tooltip.js +2 -1
- package/dist/components/Tooltip/styles.d.ts +14 -1
- package/dist/components/Tooltip/styles.js +14 -23
- package/dist/components/Typography/Typography.js +29 -6
- package/dist/components/Typography/styles.d.ts +21 -3
- package/dist/components/Typography/styles.js +24 -41
- package/dist/components/UtilityButton/UtilityButton.js +27 -4
- package/dist/components/UtilityButton/components/Button/Button.d.ts +16 -0
- package/dist/components/UtilityButton/components/Button/Button.js +13 -0
- package/dist/components/UtilityButton/components/Button/IconButton.d.ts +8 -0
- package/dist/components/UtilityButton/components/Button/IconButton.js +9 -0
- package/dist/components/UtilityButton/components/Button/icon-button-styles.d.ts +1 -0
- package/dist/components/UtilityButton/components/Button/icon-button-styles.js +76 -0
- package/dist/components/UtilityButton/components/Button/index.d.ts +4 -0
- package/dist/components/UtilityButton/components/Button/index.js +2 -0
- package/dist/components/UtilityButton/components/Button/styles.d.ts +1 -0
- package/dist/components/UtilityButton/components/Button/styles.js +118 -0
- package/dist/components/UtilityButton/components/UtilityButton/UtilityButton.d.ts +5 -0
- package/dist/components/UtilityButton/components/UtilityButton/UtilityButton.js +9 -0
- package/dist/components/UtilityButton/constants/index.d.ts +163 -0
- package/dist/components/UtilityButton/constants/index.js +89 -0
- package/dist/components/index.js +7 -0
- package/dist/components/shared/DropdownChevron.js +14 -3
- package/dist/index.js +10 -89
- package/dist/utils/icon-util.d.ts +2 -2
- package/dist/utils/icon-util.js +19 -16
- package/package.json +1 -1
- package/dist/components/Button/Button.tsx +0 -59
- package/dist/components/Table/Table.tsx +0 -112
- package/dist/components/Table/useTable.ts +0 -194
- package/dist/components/TableWithControls/TableWithControls.tsx +0 -54
- package/dist/components/TableWithControls/useTableWithControls.tsx +0 -161
- package/dist/components/UtilityButton/UtilityButton.tsx +0 -36
- package/dist/components/index.ts +0 -7
- package/dist/constants/index.ts +0 -98
- package/dist/genesis-theme.types.d.ts +0 -263
- package/dist/genesis-theme.types.js +0 -6
- package/dist/index.ts +0 -10
- package/dist/styled.d.ts +0 -1
- package/dist/styled.js +0 -44
- package/dist/styles/theme/genesis-theme.types.ts +0 -297
- package/dist/utils/styled.ts +0 -52
- /package/dist/{Table → components/Table/Table}/Table.d.ts +0 -0
- /package/dist/{Table → components/Table/Table}/Table.js +0 -0
- /package/dist/{Table → components/Table/Table}/TableControls/CustomPagination.d.ts +0 -0
- /package/dist/{Table → components/Table/Table}/TableControls/CustomPagination.js +0 -0
- /package/dist/{Table → components/Table/Table}/TableControls/PaginationNumber.d.ts +0 -0
- /package/dist/{Table → components/Table/Table}/TableControls/PaginationNumber.js +0 -0
- /package/dist/{Table → components/Table/Table}/styles.d.ts +0 -0
- /package/dist/{Table → components/Table/Table}/styles.js +0 -0
- /package/dist/{Table → components/Table/Table}/useTable.d.ts +0 -0
- /package/dist/{Table → components/Table/Table}/useTable.js +0 -0
- /package/dist/{Typography → components/Table/Typography}/Typography.d.ts +0 -0
- /package/dist/{Typography → components/Table/Typography}/Typography.js +0 -0
- /package/dist/{Typography → components/Table/Typography}/index.d.ts +0 -0
- /package/dist/{Typography → components/Table/Typography}/index.js +0 -0
- /package/dist/{Typography → components/Table/Typography}/styles.d.ts +0 -0
- /package/dist/{Typography → components/Table/Typography}/styles.js +0 -0
|
@@ -1,76 +1,23 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
1
5
|
import styled from "@gobolt/genesis/utils/styled";
|
|
2
|
-
|
|
6
|
+
var getPadding = function (size, sizing) {
|
|
3
7
|
if (size === "small") {
|
|
4
|
-
return
|
|
8
|
+
return "".concat(sizing.Size1, "px ").concat(sizing.Size1, "px");
|
|
5
9
|
}
|
|
6
|
-
return
|
|
10
|
+
return "".concat(sizing.Size2, "px ").concat(sizing.Size2, "px");
|
|
7
11
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
text-align: center;
|
|
14
|
-
color: ${colors[$themeType][$state].color};
|
|
15
|
-
font-size: ${sizing.Size4}px;
|
|
16
|
-
line-height: ${sizing.Size6}px;
|
|
17
|
-
letter-spacing: 0;
|
|
18
|
-
font-weight: 400;
|
|
19
|
-
border-width: 1px;
|
|
20
|
-
cursor: pointer;
|
|
21
|
-
width: auto; !important;
|
|
22
|
-
height: auto; !important;
|
|
23
|
-
|
|
24
|
-
background-color:${$isSelected
|
|
12
|
+
var getVariant = function (_a, $themeType, $state, size, $isSelected) {
|
|
13
|
+
var colors = _a.colors, sizing = _a.sizing, borderRadius = _a.borderRadius, components = _a.components;
|
|
14
|
+
return "\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n color: ".concat(colors[$themeType][$state].color, ";\n font-size: ").concat(sizing.Size4, "px;\n line-height: ").concat(sizing.Size6, "px;\n letter-spacing: 0;\n font-weight: 400;\n border-width: 1px;\n cursor: pointer;\n width: auto; !important;\n height: auto; !important;\n\n background-color:").concat($isSelected
|
|
25
15
|
? colors[$themeType].hover.backgroundColor
|
|
26
|
-
: colors[$themeType][$state].backgroundColor};
|
|
27
|
-
padding: ${getPadding(size, sizing)};
|
|
28
|
-
|
|
29
|
-
box-shadow: ${$themeType === "utility" ? "0px 1px 2px 0px #00000026" : "none"};
|
|
30
|
-
|
|
31
|
-
border-radius: ${borderRadius.BorderRadiusMd}px;
|
|
32
|
-
gap: ${components.button.gap}px;
|
|
33
|
-
border-style: solid;
|
|
34
|
-
border-color: ${colors[$themeType][$state].borderColor};
|
|
35
|
-
|
|
36
|
-
transition: all 0.2s ease-in-out;
|
|
37
|
-
|
|
38
|
-
&:hover {
|
|
39
|
-
color: ${colors[$themeType].hover.color};
|
|
40
|
-
background-color: ${colors[$themeType].hover.backgroundColor};
|
|
41
|
-
border-color: ${colors[$themeType].hover.borderColor};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&:active {
|
|
45
|
-
color: ${colors[$themeType].pressed.color};
|
|
46
|
-
background-color: ${colors[$themeType].pressed.backgroundColor};
|
|
47
|
-
border-color: ${colors[$themeType].pressed.borderColor};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&:focus-visible {
|
|
51
|
-
outline: none;
|
|
52
|
-
color: ${colors[$themeType].focussed.color};
|
|
53
|
-
background-color: ${colors[$themeType].focussed.backgroundColor};
|
|
54
|
-
box-shadow: 0 0 0 1px #fff, 0 0 0 4px ${colors[$themeType].focussed.ringColor};
|
|
55
|
-
border-radius: ${borderRadius.BorderRadiusMd}px;
|
|
56
|
-
border-color: ${colors[$themeType].focussed.borderColor};
|
|
57
|
-
transition: box-shadow 0.2s ease-in-out;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
&:disabled {
|
|
61
|
-
color: ${colors[$themeType].disabled.color};
|
|
62
|
-
background-color: ${colors[$themeType].disabled.backgroundColor};
|
|
63
|
-
border-color: ${colors[$themeType].disabled.borderColor};
|
|
64
|
-
cursor: not-allowed;
|
|
65
|
-
}
|
|
66
|
-
`;
|
|
16
|
+
: colors[$themeType][$state].backgroundColor, ";\n padding: ").concat(getPadding(size, sizing), ";\n\n box-shadow: ").concat($themeType === "utility" ? "0px 1px 2px 0px #00000026" : "none", ";\n\n border-radius: ").concat(borderRadius.BorderRadiusMd, "px;\n gap: ").concat(components.button.gap, "px;\n border-style: solid;\n border-color: ").concat(colors[$themeType][$state].borderColor, ";\n \n transition: all 0.2s ease-in-out;\n\n &:hover {\n color: ").concat(colors[$themeType].hover.color, ";\n background-color: ").concat(colors[$themeType].hover.backgroundColor, ";\n border-color: ").concat(colors[$themeType].hover.borderColor, ";\n }\n\n &:active {\n color: ").concat(colors[$themeType].pressed.color, ";\n background-color: ").concat(colors[$themeType].pressed.backgroundColor, ";\n border-color: ").concat(colors[$themeType].pressed.borderColor, ";\n }\n\n &:focus-visible {\n outline: none;\n color: ").concat(colors[$themeType].focussed.color, ";\n background-color: ").concat(colors[$themeType].focussed.backgroundColor, ";\n box-shadow: 0 0 0 1px #fff, 0 0 0 4px ").concat(colors[$themeType].focussed.ringColor, ";\n border-radius: ").concat(borderRadius.BorderRadiusMd, "px;\n border-color: ").concat(colors[$themeType].focussed.borderColor, ";\n transition: box-shadow 0.2s ease-in-out;\n }\n\n &:disabled {\n color: ").concat(colors[$themeType].disabled.color, ";\n background-color: ").concat(colors[$themeType].disabled.backgroundColor, ";\n border-color: ").concat(colors[$themeType].disabled.borderColor, ";\n cursor: not-allowed;\n }\n ");
|
|
67
17
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
`;
|
|
72
|
-
export const Button = styled.button `
|
|
73
|
-
${({ theme, $themeType, $state, size, $isSelected }) => {
|
|
18
|
+
var getGenesisButtonClass = function (theme, $themeType, $state, size, $isSelected) { return "\n font-family: 'Inter', sans-serif;\n ".concat(getVariant(theme, $themeType, $state, size, $isSelected), "\n"); };
|
|
19
|
+
export var Button = styled.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
20
|
+
var theme = _a.theme, $themeType = _a.$themeType, $state = _a.$state, size = _a.size, $isSelected = _a.$isSelected;
|
|
74
21
|
return getGenesisButtonClass(theme, $themeType, $state, size, $isSelected);
|
|
75
|
-
}
|
|
76
|
-
|
|
22
|
+
});
|
|
23
|
+
var templateObject_1;
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ButtonProps as AntButtonProperties } from "antd/es/button";
|
|
2
|
+
import { type GenesisTheme } from "@gobolt/genesis/styles/theme/genesis-theme.types";
|
|
3
|
+
interface StyledButtonProperties extends Omit<AntButtonProperties, "type" | "size"> {
|
|
4
|
+
theme?: GenesisTheme;
|
|
5
|
+
$themeType?: "primary" | "secondary" | "tertiary" | "destructive" | "utility" | "icon";
|
|
6
|
+
$state?: "active" | "hover" | "pressed" | "focus" | "disabled" | "selected";
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
$isIconButton?: boolean;
|
|
9
|
+
size?: "small" | "normal" | "large";
|
|
10
|
+
}
|
|
11
|
+
export declare const Button: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<AntButtonProperties & import("react").RefAttributes<HTMLButtonElement | HTMLAnchorElement>, "ref"> & {
|
|
12
|
+
ref?: ((instance: HTMLButtonElement | HTMLAnchorElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement | HTMLAnchorElement> | null | undefined;
|
|
13
|
+
}, StyledButtonProperties>> & string & Omit<import("react").ForwardRefExoticComponent<AntButtonProperties & import("react").RefAttributes<HTMLButtonElement | HTMLAnchorElement>> & {
|
|
14
|
+
Group: import("react").FC<import("antd/es/button").ButtonGroupProps>;
|
|
15
|
+
}, keyof import("react").Component<any, {}, any>>;
|
|
16
|
+
export {};
|
|
@@ -1,118 +1,60 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
1
5
|
import styled from "@gobolt/genesis/utils/styled";
|
|
2
6
|
import { Button as AntButton } from "antd";
|
|
3
|
-
|
|
7
|
+
var getPadding = function (size, $themeType, sizing, $isIconButton) {
|
|
4
8
|
if ($isIconButton && (size === "normal" || size === "large")) {
|
|
5
|
-
return
|
|
9
|
+
return "".concat(sizing.Size2, "px ").concat(sizing.Size2, "px");
|
|
6
10
|
}
|
|
7
11
|
if ($isIconButton && size === "small") {
|
|
8
|
-
return
|
|
12
|
+
return "".concat(sizing.Size1, "px ").concat(sizing.Size1, "px");
|
|
9
13
|
}
|
|
10
14
|
// utility button padding is different from the main button
|
|
11
15
|
if ($themeType === "utility" && size === "small") {
|
|
12
|
-
return
|
|
16
|
+
return "".concat(sizing.Size1_5, "px ").concat(sizing.Size2, "px");
|
|
13
17
|
}
|
|
14
18
|
if ($themeType === "utility" && (size === "normal" || size === "large")) {
|
|
15
|
-
return
|
|
19
|
+
return "".concat(sizing.Size2_5, "px ").concat(sizing.Size3, "px");
|
|
16
20
|
}
|
|
17
21
|
if (size === "small") {
|
|
18
|
-
return
|
|
22
|
+
return "".concat(sizing.Size1_5, "px ").concat(sizing.Size4, "px");
|
|
19
23
|
}
|
|
20
24
|
if (size === "normal" || size === "large") {
|
|
21
|
-
return
|
|
25
|
+
return "".concat(sizing.Size2_5, "px ").concat(sizing.Size6, "px");
|
|
22
26
|
}
|
|
23
|
-
return
|
|
27
|
+
return "".concat(sizing.Size2, "px ").concat(sizing.Size2, "px");
|
|
24
28
|
};
|
|
25
|
-
|
|
29
|
+
var getHeight = function (size) {
|
|
26
30
|
if (size === "normal" || size === "large") {
|
|
27
|
-
return
|
|
31
|
+
return "40px";
|
|
28
32
|
}
|
|
29
33
|
if (size === "small") {
|
|
30
|
-
return
|
|
34
|
+
return "32px";
|
|
31
35
|
}
|
|
32
|
-
return
|
|
36
|
+
return "40px";
|
|
33
37
|
};
|
|
34
|
-
|
|
38
|
+
var getWidth = function (size, $isIconButton) {
|
|
35
39
|
if (!$isIconButton) {
|
|
36
|
-
return
|
|
40
|
+
return "auto";
|
|
37
41
|
}
|
|
38
42
|
if (size === "normal" || size === "large") {
|
|
39
|
-
return
|
|
43
|
+
return "40px";
|
|
40
44
|
}
|
|
41
45
|
if (size === "small") {
|
|
42
|
-
return
|
|
46
|
+
return "32px";
|
|
43
47
|
}
|
|
44
|
-
return
|
|
48
|
+
return "40px";
|
|
45
49
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
&.ant-btn {
|
|
50
|
-
|
|
51
|
-
color: ${colors[$themeType][$state].color};
|
|
52
|
-
font-size: ${sizing.Size4}px;
|
|
53
|
-
line-height: ${sizing.Size6}px;
|
|
54
|
-
letter-spacing: 0;
|
|
55
|
-
font-weight: 400;
|
|
56
|
-
border-width: 1px;
|
|
57
|
-
line-height: 1 !important;
|
|
58
|
-
|
|
59
|
-
width: ${getWidth(size, $isIconButton)}; !important;
|
|
60
|
-
height: ${getHeight(size)}; !important;
|
|
61
|
-
|
|
62
|
-
background-color: ${colors[$themeType][$state].backgroundColor};
|
|
63
|
-
padding: ${getPadding(size, $themeType, sizing, $isIconButton)};
|
|
64
|
-
|
|
65
|
-
box-shadow: ${$themeType === "utility" ? "0px 1px 2px 0px #00000026" : "none"};
|
|
66
|
-
|
|
67
|
-
border-radius: ${borderRadius.BorderRadiusMd}px;
|
|
68
|
-
gap: ${components.button.gap}px;
|
|
69
|
-
border-style: solid;
|
|
70
|
-
border-color: ${colors[$themeType][$state].borderColor};
|
|
71
|
-
|
|
72
|
-
transition: all 0.2s ease-in-out;
|
|
73
|
-
|
|
74
|
-
&:hover {
|
|
75
|
-
color: ${colors[$themeType].hover.color};
|
|
76
|
-
background-color: ${colors[$themeType].hover.backgroundColor};
|
|
77
|
-
border-color: ${colors[$themeType].hover.borderColor};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
&:active {
|
|
81
|
-
color: ${colors[$themeType].pressed.color};
|
|
82
|
-
background-color: ${colors[$themeType].pressed.backgroundColor};
|
|
83
|
-
border-color: ${colors[$themeType].pressed.borderColor};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&:focus-visible {
|
|
87
|
-
outline: none;
|
|
88
|
-
color: ${colors[$themeType].focussed.color};
|
|
89
|
-
background-color: ${colors[$themeType].focussed.backgroundColor};
|
|
90
|
-
box-shadow: 0 0 0 1px #fff, 0 0 0 4px ${colors[$themeType].focussed.ringColor};
|
|
91
|
-
border-radius: ${borderRadius.BorderRadiusMd}px;
|
|
92
|
-
border-color: ${colors[$themeType].focussed.borderColor};
|
|
93
|
-
transition: box-shadow 0.2s ease-in-out;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
&:disabled {
|
|
97
|
-
color: ${colors[$themeType].disabled.color};
|
|
98
|
-
background-color: ${colors[$themeType].disabled.backgroundColor};
|
|
99
|
-
border-color: ${colors[$themeType].disabled.borderColor};
|
|
100
|
-
cursor: not-allowed;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
`;
|
|
50
|
+
var getVariant = function (_a, $themeType, $state, size, $isIconButton) {
|
|
51
|
+
var colors = _a.colors, sizing = _a.sizing, borderRadius = _a.borderRadius, components = _a.components;
|
|
52
|
+
var backgroundColor = colors[$themeType][$state].backgroundColor;
|
|
53
|
+
return "\n &.ant-btn {\n \n color: ".concat(colors[$themeType][$state].color, ";\n font-size: ").concat(sizing.Size4, "px;\n line-height: ").concat(sizing.Size6, "px;\n letter-spacing: 0;\n font-weight: 400;\n border-width: 1px;\n line-height: 1 !important;\n\n width: ").concat(getWidth(size, $isIconButton), "; !important;\n height: ").concat(getHeight(size), "; !important;\n\n background-color: ").concat(colors[$themeType][$state].backgroundColor, ";\n padding: ").concat(getPadding(size, $themeType, sizing, $isIconButton), ";\n\n box-shadow: ").concat($themeType === "utility" ? "0px 1px 2px 0px #00000026" : "none", ";\n\n border-radius: ").concat(borderRadius.BorderRadiusMd, "px;\n gap: ").concat(components.button.gap, "px;\n border-style: solid;\n border-color: ").concat(colors[$themeType][$state].borderColor, ";\n \n transition: all 0.2s ease-in-out;\n\n &:hover {\n color: ").concat(colors[$themeType].hover.color, ";\n background-color: ").concat(colors[$themeType].hover.backgroundColor, ";\n border-color: ").concat(colors[$themeType].hover.borderColor, ";\n }\n\n &:active {\n color: ").concat(colors[$themeType].pressed.color, ";\n background-color: ").concat(colors[$themeType].pressed.backgroundColor, ";\n border-color: ").concat(colors[$themeType].pressed.borderColor, ";\n }\n\n &:focus-visible {\n outline: none;\n color: ").concat(colors[$themeType].focussed.color, ";\n background-color: ").concat(colors[$themeType].focussed.backgroundColor, ";\n box-shadow: 0 0 0 1px #fff, 0 0 0 4px ").concat(colors[$themeType].focussed.ringColor, ";\n border-radius: ").concat(borderRadius.BorderRadiusMd, "px;\n border-color: ").concat(colors[$themeType].focussed.borderColor, ";\n transition: box-shadow 0.2s ease-in-out;\n }\n\n &:disabled {\n color: ").concat(colors[$themeType].disabled.color, ";\n background-color: ").concat(colors[$themeType].disabled.backgroundColor, ";\n border-color: ").concat(colors[$themeType].disabled.borderColor, ";\n cursor: not-allowed;\n }\n \n }\n \n ");
|
|
106
54
|
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
${getVariant(theme, $themeType, $state, size, $isIconButton)}
|
|
112
|
-
}
|
|
113
|
-
`;
|
|
114
|
-
export const Button = styled(AntButton) `
|
|
115
|
-
${({ theme, $themeType, $state, children, $isIconButton, size }) => {
|
|
55
|
+
var getGenesisButtonClass = function (theme, $themeType, $state, $isIconButton, size) { return "\n &.ant-btn {\n font-family: 'Inter', sans-serif;\n \n ".concat(getVariant(theme, $themeType, $state, size, $isIconButton), "\n } \n"); };
|
|
56
|
+
export var Button = styled(AntButton)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
57
|
+
var theme = _a.theme, $themeType = _a.$themeType, $state = _a.$state, children = _a.children, $isIconButton = _a.$isIconButton, size = _a.size;
|
|
116
58
|
return getGenesisButtonClass(theme, $themeType, $state, $isIconButton, size);
|
|
117
|
-
}
|
|
118
|
-
|
|
59
|
+
});
|
|
60
|
+
var templateObject_1;
|
|
@@ -1,21 +1,44 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
1
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
24
|
import React from "react";
|
|
3
25
|
import * as S from "./styles";
|
|
4
26
|
import { STATE } from "../../constants";
|
|
5
27
|
import DropdownChevron from "../shared/DropdownChevron";
|
|
6
28
|
import { Select } from "antd";
|
|
7
|
-
|
|
29
|
+
var Input = React.forwardRef(function (_a, ref) {
|
|
30
|
+
var _b = _a.state, state = _b === void 0 ? STATE.active : _b, _c = _a.size, size = _c === void 0 ? "normal" : _c, onChange = _a.onChange, value = _a.value, rest = __rest(_a, ["state", "size", "onChange", "value"]);
|
|
8
31
|
// make sure rest.type is ignored in the final output
|
|
9
32
|
// we don't want the rest type "number" to be passed to the input
|
|
10
33
|
// since we have our own version of type
|
|
11
|
-
|
|
34
|
+
var type = rest.type, validRest = __rest(rest, ["type"]);
|
|
12
35
|
// If addonAfter is a Select, use our custom chevron
|
|
13
|
-
|
|
36
|
+
var addonAfter = React.isValidElement(rest.addonAfter) && rest.addonAfter.type === Select
|
|
14
37
|
? React.cloneElement(rest.addonAfter, {
|
|
15
38
|
suffixIcon: _jsx(DropdownChevron, {}),
|
|
16
39
|
})
|
|
17
40
|
: rest.addonAfter;
|
|
18
|
-
|
|
41
|
+
var handleChange = React.useCallback(function (e) {
|
|
19
42
|
if (onChange) {
|
|
20
43
|
onChange({
|
|
21
44
|
event: "inputChange",
|
|
@@ -25,9 +48,9 @@ const Input = React.forwardRef(({ state = STATE.active, size = "normal", onChang
|
|
|
25
48
|
});
|
|
26
49
|
}
|
|
27
50
|
}, [onChange]);
|
|
28
|
-
return (_jsx(S.Input, {
|
|
51
|
+
return (_jsx(S.Input, __assign({}, validRest, { ref: ref, size: size, state: state, disabled: state === "disabled" || rest.disabled, addonAfter: addonAfter, style: {
|
|
29
52
|
height: size === "normal" || size === "large" ? "40px" : "32px",
|
|
30
|
-
}, onChange: handleChange, value: value }));
|
|
53
|
+
}, onChange: handleChange, value: value })));
|
|
31
54
|
});
|
|
32
55
|
Input.displayName = "Input";
|
|
33
56
|
Input.__ANT_INPUT = true;
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import type { InputProps as AntInputProperties } from "antd";
|
|
2
|
+
import { STATE } from "@gobolt/genesis/constants";
|
|
3
|
+
import type { InputRef } from "antd";
|
|
4
|
+
interface InputStyledProperties extends Omit<AntInputProperties, "size"> {
|
|
5
|
+
state?: keyof typeof STATE;
|
|
6
|
+
size?: "normal" | "small" | "large";
|
|
7
|
+
value?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const Input: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<AntInputProperties & import("react").RefAttributes<InputRef>, "ref"> & {
|
|
10
|
+
ref?: ((instance: InputRef | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<InputRef> | null | undefined;
|
|
11
|
+
}, InputStyledProperties>> & string & Omit<import("react").ForwardRefExoticComponent<AntInputProperties & import("react").RefAttributes<InputRef>> & {
|
|
12
|
+
Group: import("react").FC<import("antd/es/input").GroupProps>;
|
|
13
|
+
Search: import("react").ForwardRefExoticComponent<import("antd/es/input").SearchProps & import("react").RefAttributes<InputRef>>;
|
|
14
|
+
TextArea: import("react").ForwardRefExoticComponent<import("antd/es/input").TextAreaProps & import("react").RefAttributes<import("antd/es/input/TextArea").TextAreaRef>>;
|
|
15
|
+
Password: import("react").ForwardRefExoticComponent<import("antd/es/input").PasswordProps & import("react").RefAttributes<InputRef>>;
|
|
16
|
+
OTP: import("react").ForwardRefExoticComponent<import("antd/es/input/OTP").OTPProps & import("react").RefAttributes<import("antd/es/input/OTP").OTPRef>>;
|
|
17
|
+
}, keyof import("react").Component<any, {}, any>>;
|
|
18
|
+
export {};
|
|
@@ -1,23 +1,38 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
6
|
+
var t = {};
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
8
|
+
t[p] = s[p];
|
|
9
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
10
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
11
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
12
|
+
t[p[i]] = s[p[i]];
|
|
13
|
+
}
|
|
14
|
+
return t;
|
|
15
|
+
};
|
|
1
16
|
import styled from "@gobolt/genesis/utils/styled";
|
|
2
17
|
import { Input as AntInput } from "antd";
|
|
3
18
|
import { TYPE, STATE } from "@gobolt/genesis/constants";
|
|
4
|
-
|
|
5
|
-
|
|
19
|
+
var getStateColors = function (colors, type, state) {
|
|
20
|
+
var filled = {
|
|
6
21
|
color: colors.inputs.onsurface.active,
|
|
7
22
|
borderColor: colors[TYPE.secondary].active.borderColor,
|
|
8
23
|
ringColor: colors[type].focussed.ringColor,
|
|
9
24
|
};
|
|
10
|
-
|
|
25
|
+
var success = {
|
|
11
26
|
color: colors.status.success.default,
|
|
12
27
|
borderColor: colors.status.success.default,
|
|
13
28
|
ringColor: colors.status.success.ringColor,
|
|
14
29
|
};
|
|
15
|
-
|
|
30
|
+
var error = {
|
|
16
31
|
color: colors.status.error.default,
|
|
17
32
|
borderColor: colors.status.error.default,
|
|
18
33
|
ringColor: colors.status.error.ringColor,
|
|
19
34
|
};
|
|
20
|
-
|
|
35
|
+
var themeState = state !== STATE.error && state !== STATE.success && state !== STATE.filled
|
|
21
36
|
? {
|
|
22
37
|
color: colors.inputs.onsurface.active,
|
|
23
38
|
backgroundColor: colors.inputs.surface.active,
|
|
@@ -25,156 +40,37 @@ const getStateColors = (colors, type, state) => {
|
|
|
25
40
|
ringColor: colors[type][state].ringColor,
|
|
26
41
|
}
|
|
27
42
|
: null;
|
|
28
|
-
|
|
29
|
-
filled,
|
|
30
|
-
error,
|
|
31
|
-
success,
|
|
32
|
-
themeState,
|
|
43
|
+
var stateMap = {
|
|
44
|
+
filled: filled,
|
|
45
|
+
error: error,
|
|
46
|
+
success: success,
|
|
47
|
+
themeState: themeState,
|
|
33
48
|
};
|
|
34
|
-
|
|
35
|
-
|
|
49
|
+
var getValidKey = function (state) {
|
|
50
|
+
var validStates = [STATE.filled, STATE.error, STATE.success];
|
|
36
51
|
return validStates.includes(state) ? state : "themeState";
|
|
37
52
|
};
|
|
38
|
-
|
|
53
|
+
var css = stateMap[getValidKey(state)];
|
|
39
54
|
return css;
|
|
40
55
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
56
|
+
var getGenesisInputClass = function (_a, type, state, hasBeforeAddon, hasAfterAddon, size) {
|
|
57
|
+
var colors = _a.colors, borderRadius = _a.borderRadius, components = _a.components, shadows = _a.shadows;
|
|
58
|
+
var stateColors = getStateColors(colors, type, state);
|
|
59
|
+
var getBorderRadius = function (hasBeforeAddon, hasAfterAddon) {
|
|
44
60
|
if (hasAfterAddon && !hasBeforeAddon) {
|
|
45
|
-
return
|
|
61
|
+
return "".concat(borderRadius.BorderRadiusMd, "px 0px 0px ").concat(borderRadius.BorderRadiusMd, "px");
|
|
46
62
|
}
|
|
47
63
|
if (hasBeforeAddon && !hasAfterAddon) {
|
|
48
|
-
return
|
|
64
|
+
return "0px ".concat(borderRadius.BorderRadiusMd, "px ").concat(borderRadius.BorderRadiusMd, "px 0px");
|
|
49
65
|
}
|
|
50
|
-
return
|
|
66
|
+
return "0px";
|
|
51
67
|
};
|
|
52
|
-
return
|
|
53
|
-
&.ant-input {
|
|
54
|
-
font-family: 'Inter', sans-serif;
|
|
55
|
-
color: ${stateColors.color};
|
|
56
|
-
border-color: ${stateColors.borderColor};
|
|
57
|
-
box-shadow: ${shadows.inputs[1]} !important;
|
|
58
|
-
height: ${size === "normal" || size === "large" ? "40px" : "32px"} !important;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/* Increase specificity for focus states */
|
|
62
|
-
&.ant-input.ant-input:focus,
|
|
63
|
-
&.ant-input.ant-input:focus-visible,
|
|
64
|
-
&.ant-input.ant-input-focused {
|
|
65
|
-
outline: none !important;
|
|
66
|
-
border-color: ${colors[type].focussed.borderColor} !important;
|
|
67
|
-
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors[type].focussed.ringColor} !important;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
&.ant-input-outlined {
|
|
71
|
-
border: 1px solid ${stateColors.borderColor};
|
|
72
|
-
|
|
73
|
-
&:hover {
|
|
74
|
-
border-color: ${stateColors.borderColor};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.ant-input-group & {
|
|
79
|
-
&:focus-within {
|
|
80
|
-
outline: none;
|
|
81
|
-
color: ${stateColors.color};
|
|
82
|
-
box-shadow: none;
|
|
83
|
-
border-color: ${colors[type].focussed.borderColor};
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.ant-input-group:focus-within {
|
|
88
|
-
outline: none;
|
|
89
|
-
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors[type].focussed.ringColor};
|
|
90
|
-
border-radius: ${borderRadius.BorderRadiusMd}px;
|
|
91
|
-
transition: box-shadow 0.2s ease-in-out;
|
|
92
|
-
|
|
93
|
-
/* Hide focus styles on inner input when parent is focused */
|
|
94
|
-
.ant-input:focus-within {
|
|
95
|
-
box-shadow: none;
|
|
96
|
-
border-radius: 0;
|
|
97
|
-
border-radius: ${getBorderRadius(hasBeforeAddon, hasAfterAddon)};
|
|
98
|
-
border-color: #ddd;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/* Remove inner input focus styles when in a group */
|
|
103
|
-
.ant-input-group .ant-input:focus,
|
|
104
|
-
.ant-input-group .ant-input:focus-visible,
|
|
105
|
-
.ant-input-group .ant-input:focus-within {
|
|
106
|
-
outline: none;
|
|
107
|
-
box-shadow: none;
|
|
108
|
-
border-color: ${colors[type].focussed.borderColor};
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/* Single focus ring on group */
|
|
112
|
-
.ant-input-group:focus-within {
|
|
113
|
-
outline: none;
|
|
114
|
-
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors[type].focussed.ringColor};
|
|
115
|
-
border-radius: ${borderRadius.BorderRadiusMd}px;
|
|
116
|
-
transition: box-shadow 0.2s ease-in-out;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/* Remove focus styles for standalone inputs */
|
|
120
|
-
&:not(.ant-input-group):focus-visible {
|
|
121
|
-
outline: none;
|
|
122
|
-
color: ${stateColors.color};
|
|
123
|
-
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors[type].focussed.ringColor};
|
|
124
|
-
border-radius: ${borderRadius.BorderRadiusMd}px;
|
|
125
|
-
border-color: ${colors[type].focussed.borderColor};
|
|
126
|
-
transition: box-shadow 0.2s ease-in-out;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
&:not(.ant-input-group .ant-input):focus-visible {
|
|
130
|
-
outline: none;
|
|
131
|
-
color: ${stateColors.color};
|
|
132
|
-
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors[type].focussed.ringColor};
|
|
133
|
-
border-radius: ${borderRadius.BorderRadiusMd}px;
|
|
134
|
-
border-color: ${colors[type].focussed.borderColor};
|
|
135
|
-
transition: box-shadow 0.2s ease-in-out;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
&.ant-input-group-wrapper {
|
|
139
|
-
.ant-input-group {
|
|
140
|
-
display: flex;
|
|
141
|
-
align-items: center;
|
|
142
|
-
height: ${size === "normal" || size === "large" ? "40px" : "32px"};
|
|
143
|
-
|
|
144
|
-
.ant-input {
|
|
145
|
-
height: 100% !important;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.ant-input-group-addon {
|
|
149
|
-
padding: 0 ${components.input.suffixPrefixHorPadding};
|
|
150
|
-
height: 100%;
|
|
151
|
-
display: flex;
|
|
152
|
-
align-items: center;
|
|
153
|
-
min-width: fit-content;
|
|
154
|
-
width: auto;
|
|
155
|
-
|
|
156
|
-
> * {
|
|
157
|
-
width: 100%;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.ant-select {
|
|
161
|
-
height: 100%;
|
|
162
|
-
|
|
163
|
-
.ant-select-selector {
|
|
164
|
-
height: 100%;
|
|
165
|
-
display: flex;
|
|
166
|
-
align-items: center;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
`;
|
|
68
|
+
return "\n &.ant-input {\n font-family: 'Inter', sans-serif;\n color: ".concat(stateColors.color, ";\n border-color: ").concat(stateColors.borderColor, ";\n box-shadow: ").concat(shadows.inputs[1], " !important;\n height: ").concat(size === "normal" || size === "large" ? "40px" : "32px", " !important;\n }\n\n /* Increase specificity for focus states */\n &.ant-input.ant-input:focus,\n &.ant-input.ant-input:focus-visible,\n &.ant-input.ant-input-focused {\n outline: none !important;\n border-color: ").concat(colors[type].focussed.borderColor, " !important;\n box-shadow: 0 0 0 1px #fff, 0 0 0 3px ").concat(colors[type].focussed.ringColor, " !important;\n }\n\n &.ant-input-outlined {\n border: 1px solid ").concat(stateColors.borderColor, ";\n\n &:hover {\n border-color: ").concat(stateColors.borderColor, ";\n }\n }\n\n .ant-input-group & {\n &:focus-within {\n outline: none;\n color: ").concat(stateColors.color, ";\n box-shadow: none;\n border-color: ").concat(colors[type].focussed.borderColor, ";\n }\n }\n\n .ant-input-group:focus-within {\n outline: none;\n box-shadow: 0 0 0 1px #fff, 0 0 0 3px ").concat(colors[type].focussed.ringColor, ";\n border-radius: ").concat(borderRadius.BorderRadiusMd, "px;\n transition: box-shadow 0.2s ease-in-out;\n\n /* Hide focus styles on inner input when parent is focused */\n .ant-input:focus-within {\n box-shadow: none;\n border-radius: 0;\n border-radius: ").concat(getBorderRadius(hasBeforeAddon, hasAfterAddon), ";\n border-color: #ddd;\n }\n }\n\n /* Remove inner input focus styles when in a group */\n .ant-input-group .ant-input:focus,\n .ant-input-group .ant-input:focus-visible,\n .ant-input-group .ant-input:focus-within {\n outline: none;\n box-shadow: none;\n border-color: ").concat(colors[type].focussed.borderColor, ";\n }\n\n /* Single focus ring on group */\n .ant-input-group:focus-within {\n outline: none;\n box-shadow: 0 0 0 1px #fff, 0 0 0 3px ").concat(colors[type].focussed.ringColor, ";\n border-radius: ").concat(borderRadius.BorderRadiusMd, "px;\n transition: box-shadow 0.2s ease-in-out;\n }\n\n /* Remove focus styles for standalone inputs */\n &:not(.ant-input-group):focus-visible {\n outline: none;\n color: ").concat(stateColors.color, ";\n box-shadow: 0 0 0 1px #fff, 0 0 0 3px ").concat(colors[type].focussed.ringColor, ";\n border-radius: ").concat(borderRadius.BorderRadiusMd, "px;\n border-color: ").concat(colors[type].focussed.borderColor, ";\n transition: box-shadow 0.2s ease-in-out;\n }\n\n &:not(.ant-input-group .ant-input):focus-visible {\n outline: none;\n color: ").concat(stateColors.color, ";\n box-shadow: 0 0 0 1px #fff, 0 0 0 3px ").concat(colors[type].focussed.ringColor, ";\n border-radius: ").concat(borderRadius.BorderRadiusMd, "px;\n border-color: ").concat(colors[type].focussed.borderColor, ";\n transition: box-shadow 0.2s ease-in-out;\n }\n\n &.ant-input-group-wrapper {\n .ant-input-group {\n display: flex;\n align-items: center;\n height: ").concat(size === "normal" || size === "large" ? "40px" : "32px", ";\n\n .ant-input {\n height: 100% !important;\n }\n\n .ant-input-group-addon {\n padding: 0 ").concat(components.input.suffixPrefixHorPadding, ";\n height: 100%;\n display: flex;\n align-items: center;\n min-width: fit-content;\n width: auto;\n \n > * {\n width: 100%;\n }\n \n .ant-select {\n height: 100%;\n \n .ant-select-selector {\n height: 100%;\n display: flex;\n align-items: center;\n }\n }\n }\n }\n }\n ");
|
|
173
69
|
};
|
|
174
|
-
export
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
70
|
+
export var Input = styled(AntInput)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
71
|
+
var theme = _a.theme, state = _a.state, _b = _a.type, type = _b === void 0 ? TYPE.primary : _b, _c = _a.size, size = _c === void 0 ? "normal" : _c, rest = __rest(_a, ["theme", "state", "type", "size"]);
|
|
72
|
+
var hasBeforeAddon = !!rest.addonBefore;
|
|
73
|
+
var hasAfterAddon = !!rest.addonAfter;
|
|
178
74
|
return getGenesisInputClass(theme, type, state, hasBeforeAddon, hasAfterAddon, size);
|
|
179
|
-
}
|
|
180
|
-
|
|
75
|
+
});
|
|
76
|
+
var templateObject_1;
|