@gobolt/genesis 0.3.21 → 0.3.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/Table/Table.d.ts +51 -0
  2. package/dist/Table/Table.js +14 -0
  3. package/dist/Table/TableControls/CustomPagination.d.ts +13 -0
  4. package/dist/Table/TableControls/CustomPagination.js +158 -0
  5. package/dist/Table/TableControls/PaginationNumber.d.ts +7 -0
  6. package/dist/Table/TableControls/PaginationNumber.js +30 -0
  7. package/dist/Table/styles.d.ts +14 -0
  8. package/dist/Table/styles.js +64 -0
  9. package/dist/Table/useTable.d.ts +26 -0
  10. package/dist/Table/useTable.js +141 -0
  11. package/dist/Typography/Typography.d.ts +17 -0
  12. package/dist/Typography/Typography.js +16 -0
  13. package/dist/Typography/index.d.ts +2 -0
  14. package/dist/Typography/index.js +1 -0
  15. package/dist/Typography/styles.d.ts +3 -0
  16. package/dist/Typography/styles.js +54 -0
  17. package/dist/components/Badge/Badge.js +9 -32
  18. package/dist/components/Badge/styles.d.ts +1 -10
  19. package/dist/components/Badge/styles.js +39 -14
  20. package/dist/components/Button/Button.js +4 -27
  21. package/dist/components/Button/IconButton.js +4 -27
  22. package/dist/components/Button/icon-button-styles.d.ts +1 -12
  23. package/dist/components/Button/icon-button-styles.js +69 -16
  24. package/dist/components/Button/styles.d.ts +1 -16
  25. package/dist/components/Button/styles.js +88 -30
  26. package/dist/components/Input/Input.js +6 -29
  27. package/dist/components/Input/styles.d.ts +1 -18
  28. package/dist/components/Input/styles.js +146 -42
  29. package/dist/components/Select/Select.js +101 -125
  30. package/dist/components/Select/SelectTrigger.js +71 -57
  31. package/dist/components/Table/Table.js +8 -27
  32. package/dist/components/Table/TableControls/CustomPagination.js +50 -66
  33. package/dist/components/Table/TableControls/PaginationNumber.js +27 -43
  34. package/dist/components/Table/TableControls/PrimaryTableControlsRow.js +16 -17
  35. package/dist/components/Table/TableControls/SecondaryTableControlsRow.js +14 -36
  36. package/dist/components/Table/TableControls/TableControls.js +3 -4
  37. package/dist/components/Table/TablePagination.js +4 -21
  38. package/dist/components/Table/__mocks__/table-mocks.js +15 -24
  39. package/dist/components/Table/styles.d.ts +1 -15
  40. package/dist/components/Table/styles.js +57 -13
  41. package/dist/components/Table/useTable.js +69 -166
  42. package/dist/components/TableWithControls/TableWithControls.js +6 -7
  43. package/dist/components/TableWithControls/useTableWithControls.js +82 -63
  44. package/dist/components/Tooltip/Tooltip.js +1 -2
  45. package/dist/components/Tooltip/styles.d.ts +1 -14
  46. package/dist/components/Tooltip/styles.js +23 -14
  47. package/dist/components/Typography/Typography.js +6 -29
  48. package/dist/components/Typography/styles.d.ts +3 -21
  49. package/dist/components/Typography/styles.js +41 -24
  50. package/dist/components/UtilityButton/UtilityButton.js +4 -27
  51. package/dist/components/shared/DropdownChevron.js +3 -14
  52. package/dist/constants/index.js +14 -14
  53. package/dist/genesis-theme.types.d.ts +263 -0
  54. package/dist/genesis-theme.types.js +6 -0
  55. package/dist/index.js +89 -0
  56. package/dist/styled.d.ts +1 -0
  57. package/dist/styled.js +44 -0
  58. package/dist/utils/icon-util.d.ts +2 -2
  59. package/dist/utils/icon-util.js +16 -19
  60. package/package.json +1 -1
@@ -1,36 +1,9 @@
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 __read = (this && this.__read) || function (o, n) {
13
- var m = typeof Symbol === "function" && o[Symbol.iterator];
14
- if (!m) return o;
15
- var i = m.call(o), r, ar = [], e;
16
- try {
17
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
18
- }
19
- catch (error) { e = { error: error }; }
20
- finally {
21
- try {
22
- if (r && !r.done && (m = i["return"])) m.call(i);
23
- }
24
- finally { if (e) throw e.error; }
25
- }
26
- return ar;
27
- };
28
1
  import { jsx as _jsx } from "react/jsx-runtime";
29
2
  import { useState } from "react";
30
3
  import { useTable } from "../Table/useTable";
31
4
  import { mockColumns, mockDataSource } from "../Table/__mocks__/table-mocks";
32
5
  //import
33
- var tableControlsData = {
6
+ const tableControlsData = {
34
7
  primaryTableRowData: {
35
8
  sortOptions: [
36
9
  { value: "status", label: _jsx("span", { children: "Status" }) },
@@ -49,7 +22,7 @@ var tableControlsData = {
49
22
  totalRecords: mockDataSource.appointments.length,
50
23
  },
51
24
  };
52
- var startingUseTableConfig = {
25
+ const startingUseTableConfig = {
53
26
  columns: mockColumns,
54
27
  filters: {
55
28
  order: "asc",
@@ -58,60 +31,106 @@ var startingUseTableConfig = {
58
31
  disableAutoFetch: true,
59
32
  dataSource: [],
60
33
  };
61
- export var useTableWithControls = function (tableConfig) {
62
- var _a = __read(useState(startingUseTableConfig), 2), useTableConfig = _a[0], setUseTableConfig = _a[1];
63
- var _b = __read(useState(tableControlsData.secondaryTableRowData.groups), 2), groups = _b[0], setGroups = _b[1];
64
- var _c = __read(useState(tableControlsData.primaryTableRowData), 2), primaryTableRowData = _c[0], setPrimaryTableRowData = _c[1];
65
- var secondaryTableRowData = tableControlsData.secondaryTableRowData;
66
- var newSecondaryTableRowData = __assign(__assign({}, secondaryTableRowData), { groups: groups, totalRecords: safeDataSource.length });
67
- var _d = useTable(useTableConfig), dataSource = _d.dataSource, columns = _d.columns, rowSelection = _d.rowSelection, updateDataSource = _d.updateDataSource;
34
+ export const useTableWithControls = (tableConfig) => {
35
+ const [useTableConfig, setUseTableConfig] = useState(startingUseTableConfig);
36
+ const [groups, setGroups] = useState(tableControlsData.secondaryTableRowData.groups);
37
+ const [primaryTableRowData, setPrimaryTableRowData] = useState(tableControlsData.primaryTableRowData);
38
+ const { secondaryTableRowData } = tableControlsData;
39
+ const newSecondaryTableRowData = {
40
+ ...secondaryTableRowData,
41
+ groups,
42
+ totalRecords: safeDataSource.length,
43
+ };
44
+ const { dataSource, columns, rowSelection, updateDataSource } = useTable(useTableConfig);
68
45
  // Ensure we always return a valid object, even if dataSource is empty
69
- var safeDataSource = dataSource || [];
70
- var onGroupItemClick = function (title, item) {
71
- var newGroups = __assign({}, groups);
72
- newGroups[title] = newGroups[title].filter(function (group) { return group !== item; });
46
+ const safeDataSource = dataSource || [];
47
+ const onGroupItemClick = (title, item) => {
48
+ const newGroups = { ...groups };
49
+ newGroups[title] = newGroups[title].filter((group) => group !== item);
73
50
  setGroups(newGroups);
74
51
  };
75
- var onChange = function (actionEvent) {
52
+ const onChange = (actionEvent) => {
76
53
  if (actionEvent.event === "inputChange") {
77
- var value_1 = actionEvent.payload.value;
78
- if (typeof value_1 === "string") {
79
- setUseTableConfig(function (previous) { return (__assign(__assign({}, previous), { filters: __assign(__assign({}, previous.filters), { search: value_1 }), fetchOptions: __assign(__assign({}, previous.fetchOptions), { body: JSON.stringify({
80
- filters: __assign(__assign({}, previous.filters), { search: value_1 }),
81
- }) }) })); });
54
+ const { value } = actionEvent.payload;
55
+ if (typeof value === "string") {
56
+ setUseTableConfig((previous) => ({
57
+ ...previous,
58
+ filters: {
59
+ ...previous.filters,
60
+ search: value,
61
+ },
62
+ fetchOptions: {
63
+ ...previous.fetchOptions,
64
+ body: JSON.stringify({
65
+ filters: {
66
+ ...previous.filters,
67
+ search: value,
68
+ },
69
+ }),
70
+ },
71
+ }));
82
72
  }
83
73
  }
84
74
  if (actionEvent.event === "primaryChange") {
85
- var value_2 = actionEvent.payload.value;
86
- if (typeof value_2 === "string") {
87
- setUseTableConfig(function (previous) { return (__assign(__assign({}, previous), { filters: __assign(__assign({}, previous.filters), { sort: value_2 }), fetchOptions: __assign(__assign({}, previous.fetchOptions), { body: JSON.stringify({
88
- filters: __assign(__assign({}, previous.filters), { sort: value_2 }),
89
- }) }) })); });
75
+ const { value } = actionEvent.payload;
76
+ if (typeof value === "string") {
77
+ setUseTableConfig((previous) => ({
78
+ ...previous,
79
+ filters: {
80
+ ...previous.filters,
81
+ sort: value,
82
+ },
83
+ fetchOptions: {
84
+ ...previous.fetchOptions,
85
+ body: JSON.stringify({
86
+ filters: {
87
+ ...previous.filters,
88
+ sort: value,
89
+ },
90
+ }),
91
+ },
92
+ }));
90
93
  }
91
94
  }
92
95
  if (actionEvent.event === "groupItemClick") {
93
- var _a = actionEvent.payload, title = _a.title, item = _a.item;
96
+ const { title, item } = actionEvent.payload;
94
97
  if (typeof title === "string" && typeof item === "string") {
95
98
  onGroupItemClick(title, item);
96
99
  }
97
100
  }
98
101
  if (actionEvent.event === "orderClick") {
99
- setPrimaryTableRowData(function (previous) { return (__assign(__assign({}, previous), { isSortedAscending: !previous.isSortedAscending })); });
100
- var value_3 = actionEvent.payload.value;
101
- if (typeof value_3 === "string") {
102
- setUseTableConfig(function (previous) { return (__assign(__assign({}, previous), { filters: __assign(__assign({}, previous.filters), { order: value_3 }), fetchOptions: __assign(__assign({}, previous.fetchOptions), { body: JSON.stringify({
103
- filters: __assign(__assign({}, previous.filters), { order: value_3 }),
104
- }) }) })); });
102
+ setPrimaryTableRowData((previous) => ({
103
+ ...previous,
104
+ isSortedAscending: !previous.isSortedAscending,
105
+ }));
106
+ const { value } = actionEvent.payload;
107
+ if (typeof value === "string") {
108
+ setUseTableConfig((previous) => ({
109
+ ...previous,
110
+ filters: {
111
+ ...previous.filters,
112
+ order: value,
113
+ },
114
+ fetchOptions: {
115
+ ...previous.fetchOptions,
116
+ body: JSON.stringify({
117
+ filters: {
118
+ ...previous.filters,
119
+ order: value,
120
+ },
121
+ }),
122
+ },
123
+ }));
105
124
  }
106
125
  }
107
126
  };
108
127
  return {
109
- onChange: onChange,
110
- primaryTableRowData: primaryTableRowData,
128
+ onChange,
129
+ primaryTableRowData,
111
130
  secondaryTableRowData: newSecondaryTableRowData,
112
131
  dataSource: safeDataSource,
113
- columns: columns,
114
- rowSelection: rowSelection,
115
- updateDataSource: updateDataSource,
132
+ columns,
133
+ rowSelection,
134
+ updateDataSource,
116
135
  };
117
136
  };
@@ -2,8 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as S from "./styles";
3
3
  import { Typography } from "@gobolt/genesis/components";
4
4
  import { TYPOGRAPHY_VARIANT } from "@gobolt/genesis/constants";
5
- var Tooltip = function (_a) {
6
- var _b = _a.tip, tip = _b === void 0 ? "" : _b, children = _a.children;
5
+ const Tooltip = ({ tip = "", children }) => {
7
6
  return (_jsx(S.Tooltip, { "data-testid": "Tooltip", placement: "top", title: _jsx("div", { style: { marginTop: 2 }, children: _jsx(Typography, { variant: TYPOGRAPHY_VARIANT.body2, color: "white", children: tip }) }), children: children }));
8
7
  };
9
8
  export default Tooltip;
@@ -1,19 +1,6 @@
1
- import { type GenesisTheme } from "@gobolt/genesis/styles/theme/genesis-theme.types";
2
- interface StyledTooltipProperties {
3
- theme?: GenesisTheme;
4
- type?: "primary" | "secondary";
5
- state?: "active" | "disabled";
6
- }
7
1
  export declare const getGenesisClass: ({ colors, borderRadius, sizing }: {
8
2
  colors: any;
9
3
  borderRadius: any;
10
4
  sizing: any;
11
5
  }, type?: string, state?: string) => string;
12
- export declare const Tooltip: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<(Omit<import("antd/es/tooltip").TooltipPropsWithTitle & import("react").RefAttributes<import("antd/es/tooltip").TooltipRef>, "ref"> & {
13
- ref?: ((instance: import("antd/es/tooltip").TooltipRef | 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<import("antd/es/tooltip").TooltipRef> | null | undefined;
14
- }) | (Omit<import("antd/es/tooltip").TooltipPropsWithOverlay & import("react").RefAttributes<import("antd/es/tooltip").TooltipRef>, "ref"> & {
15
- ref?: ((instance: import("antd/es/tooltip").TooltipRef | 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<import("antd/es/tooltip").TooltipRef> | null | undefined;
16
- }), StyledTooltipProperties>> & string & Omit<import("react").ForwardRefExoticComponent<import("antd").TooltipProps & import("react").RefAttributes<import("antd/es/tooltip").TooltipRef>> & {
17
- _InternalPanelDoNotUseOrYouWillBeFired: import("react").FC<import("antd/es/tooltip/PurePanel").PurePanelProps>;
18
- }, keyof import("react").Component<any, {}, any>>;
19
- export {};
6
+ export declare const Tooltip: any;
@@ -1,17 +1,26 @@
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
1
  import styled from "@gobolt/genesis/utils/styled";
6
2
  import { Tooltip as AntTooltip } from "antd";
7
- export var getGenesisClass = function (_a, type, state) {
8
- var colors = _a.colors, borderRadius = _a.borderRadius, sizing = _a.sizing;
9
- if (type === void 0) { type = "primary"; }
10
- if (state === void 0) { state = "active"; }
11
- return "\n .ant-tooltip {\n --antd-arrow-background-color: ".concat(colors.surface.dark, ";\n }\n\n .ant-tooltip-inner {\n background-color: ").concat(colors.surface.dark, ";\n border-radius: ").concat(borderRadius.sm, ";\n padding: ").concat(sizing.xs, " ").concat(sizing.sm, ";\n font-size: 14px;\n line-height: 20px;\n color: ").concat(colors.onsurface.white, ";\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);\n }\n\n .ant-tooltip-arrow-content {\n background-color: ").concat(colors.surface.dark, ";\n }\n");
12
- };
13
- export var Tooltip = styled(AntTooltip)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
14
- var theme = _a.theme, type = _a.type, state = _a.state;
3
+ export const getGenesisClass = ({ colors, borderRadius, sizing }, type = "primary", state = "active") => `
4
+ .ant-tooltip {
5
+ --antd-arrow-background-color: ${colors.surface.dark};
6
+ }
7
+
8
+ .ant-tooltip-inner {
9
+ background-color: ${colors.surface.dark};
10
+ border-radius: ${borderRadius.sm};
11
+ padding: ${sizing.xs} ${sizing.sm};
12
+ font-size: 14px;
13
+ line-height: 20px;
14
+ color: ${colors.onsurface.white};
15
+ box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
16
+ }
17
+
18
+ .ant-tooltip-arrow-content {
19
+ background-color: ${colors.surface.dark};
20
+ }
21
+ `;
22
+ export const Tooltip = styled(AntTooltip) `
23
+ ${({ theme, type, state }) => {
15
24
  return getGenesisClass(theme, type, state);
16
- });
17
- var templateObject_1;
25
+ }}
26
+ `;
@@ -1,39 +1,16 @@
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
- };
23
1
  import { jsx as _jsx } from "react/jsx-runtime";
24
2
  import * as S from "./styles";
25
3
  import { useGenesis } from "@gobolt/genesis/providers";
26
4
  import { TYPE, TYPOGRAPHY_VARIANT, STATE, } from "@gobolt/genesis/constants";
27
- var Typography = function (_a) {
28
- var children = _a.children, _b = _a.themeType, themeType = _b === void 0 ? TYPE.secondary : _b, _c = _a.variant, variant = _c === void 0 ? TYPOGRAPHY_VARIANT.body1 : _c, _d = _a.state, state = _d === void 0 ? STATE.active : _d, color = _a.color, _e = _a.isText, isText = _e === void 0 ? false : _e, isFullWidth = _a.isFullWidth, style = _a.style, isDisabled = _a.isDisabled, rest = __rest(_a, ["children", "themeType", "variant", "state", "color", "isText", "isFullWidth", "style", "isDisabled"]);
29
- var breakpoint = useGenesis().breakpoint;
5
+ const Typography = ({ children, themeType = TYPE.secondary, variant = TYPOGRAPHY_VARIANT.body1, state = STATE.active, color, isText = false, isFullWidth, style, isDisabled, ...rest }) => {
6
+ const { breakpoint } = useGenesis();
30
7
  if (variant.startsWith("display") || variant.startsWith("heading")) {
31
- var level = variant.split("heading")[1] || variant.split("display")[1];
32
- return (_jsx(S.Headline, __assign({ state: state, "$themeType": themeType, variant: variant, breakpoint: breakpoint, color: color, level: Number.parseInt(level), "$isFullWidth": isFullWidth, style: style, disabled: isDisabled }, rest, { children: children })));
8
+ const level = variant.split("heading")[1] || variant.split("display")[1];
9
+ return (_jsx(S.Headline, { state: state, "$themeType": themeType, variant: variant, breakpoint: breakpoint, color: color, level: Number.parseInt(level), "$isFullWidth": isFullWidth, style: style, disabled: isDisabled, ...rest, children: children }));
33
10
  }
34
11
  if (isText) {
35
- return (_jsx(S.Text, __assign({ state: state, "$themeType": themeType, variant: variant, breakpoint: breakpoint, color: color, "$isFullWidth": isFullWidth, style: style, disabled: isDisabled }, rest, { children: children })));
12
+ return (_jsx(S.Text, { state: state, "$themeType": themeType, variant: variant, breakpoint: breakpoint, color: color, "$isFullWidth": isFullWidth, style: style, disabled: isDisabled, ...rest, children: children }));
36
13
  }
37
- return (_jsx(S.Paragraph, __assign({ state: state, "$themeType": themeType, variant: variant, breakpoint: breakpoint, color: color, "$isFullWidth": isFullWidth, style: style, disabled: isDisabled }, rest, { children: children })));
14
+ return (_jsx(S.Paragraph, { state: state, "$themeType": themeType, variant: variant, breakpoint: breakpoint, color: color, "$isFullWidth": isFullWidth, style: style, disabled: isDisabled, ...rest, children: children }));
38
15
  };
39
16
  export default Typography;
@@ -1,21 +1,3 @@
1
- import { GenesisTheme } from "@/lib/styles/theme/genesis-theme.types";
2
- import { TYPE, STATE } from "@gobolt/genesis/constants";
3
- interface TypographyStyledProperties {
4
- theme: GenesisTheme;
5
- $themeType?: keyof typeof TYPE;
6
- variant?: string;
7
- state?: keyof typeof STATE;
8
- breakpoint?: string;
9
- color?: string;
10
- $isFullWidth?: boolean;
11
- }
12
- export declare const Headline: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<import("antd/es/typography/Title").TitleProps & import("react").RefAttributes<HTMLElement>, "ref"> & {
13
- ref?: ((instance: HTMLElement | 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<HTMLElement> | null | undefined;
14
- }, TypographyStyledProperties>> & string & Omit<import("react").ForwardRefExoticComponent<import("antd/es/typography/Title").TitleProps & import("react").RefAttributes<HTMLElement>>, keyof import("react").Component<any, {}, any>>;
15
- export declare const Paragraph: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<import("antd/es/typography/Paragraph").ParagraphProps & import("react").RefAttributes<HTMLElement>, "ref"> & {
16
- ref?: ((instance: HTMLElement | 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<HTMLElement> | null | undefined;
17
- }, TypographyStyledProperties>> & string & Omit<import("react").ForwardRefExoticComponent<import("antd/es/typography/Paragraph").ParagraphProps & import("react").RefAttributes<HTMLElement>>, keyof import("react").Component<any, {}, any>>;
18
- export declare const Text: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<import("antd/es/typography/Text").TextProps & import("react").RefAttributes<HTMLSpanElement>, "ref"> & {
19
- ref?: ((instance: HTMLSpanElement | 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<HTMLSpanElement> | null | undefined;
20
- }, TypographyStyledProperties>> & string & Omit<import("react").ForwardRefExoticComponent<import("antd/es/typography/Text").TextProps & import("react").RefAttributes<HTMLSpanElement>>, keyof import("react").Component<any, {}, any>>;
21
- export {};
1
+ export declare const Headline: any;
2
+ export declare const Paragraph: any;
3
+ export declare const Text: any;
@@ -1,37 +1,54 @@
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
1
  import styled from "@gobolt/genesis/utils/styled";
6
2
  import { Typography as AntTypography } from "antd";
7
- var getVariant = function (typography, variant, breakpoint) {
8
- return "\n font-size: ".concat(typography[breakpoint][variant].fontSize, "px !important;\n line-height: ").concat(typography[breakpoint][variant].lineHeight, ";\n letter-spacing: ").concat(typography[breakpoint][variant].letterSpacing, "px;\n font-weight: ").concat(typography[breakpoint][variant].fontWeight, ";\n ");
3
+ const getVariant = (typography, variant, breakpoint) => {
4
+ return `
5
+ font-size: ${typography[breakpoint][variant].fontSize}px !important;
6
+ line-height: ${typography[breakpoint][variant].lineHeight};
7
+ letter-spacing: ${typography[breakpoint][variant].letterSpacing}px;
8
+ font-weight: ${typography[breakpoint][variant].fontWeight};
9
+ `;
9
10
  };
10
- var getColor = function (color, colors, $themeType) {
11
+ const getColor = (color, colors, $themeType) => {
11
12
  if (color) {
12
13
  return color;
13
14
  }
14
15
  return colors[$themeType].active.color;
15
16
  };
16
- var getFontFamily = function (variant) {
17
- return "\n ".concat(variant.includes("digits")
17
+ const getFontFamily = (variant) => {
18
+ return `
19
+ ${variant.includes("digits")
18
20
  ? "'Roboto Mono', sans-serif"
19
- : "'Inter', sans-serif", " !important;\n ");
20
- };
21
- var getGenesisTypographyClass = function (_a, $themeType, variant, state, breakpoint, color, $isFullWidth) {
22
- var colors = _a.colors, typography = _a.typography;
23
- return "\n &.ant-typography {\n font-family: ".concat(getFontFamily(variant), ";\n color: ").concat(getColor(color, colors, $themeType), " !important;\n ").concat(getVariant(typography, variant, breakpoint), "\n margin-bottom: 0 !important;\n width: ").concat($isFullWidth ? "100%" : "auto", ";\n line-height: 1;\n\n &:disabled {\n color: ").concat(colors.status.disabled.default, " !important;\n userSelect: none;\n cursor: not-allowed;\n }\n } \n");
21
+ : "'Inter', sans-serif"} !important;
22
+ `;
24
23
  };
25
- export var Headline = styled(AntTypography.Title)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
26
- var theme = _a.theme, $themeType = _a.$themeType, variant = _a.variant, state = _a.state, breakpoint = _a.breakpoint, color = _a.color, $isFullWidth = _a.$isFullWidth;
24
+ const getGenesisTypographyClass = ({ colors, typography }, $themeType, variant, state, breakpoint, color, $isFullWidth) => `
25
+ &.ant-typography {
26
+ font-family: ${getFontFamily(variant)};
27
+ color: ${getColor(color, colors, $themeType)} !important;
28
+ ${getVariant(typography, variant, breakpoint)}
29
+ margin-bottom: 0 !important;
30
+ width: ${$isFullWidth ? "100%" : "auto"};
31
+ line-height: 1;
32
+
33
+ &:disabled {
34
+ color: ${colors.status.disabled.default} !important;
35
+ userSelect: none;
36
+ cursor: not-allowed;
37
+ }
38
+ }
39
+ `;
40
+ export const Headline = styled(AntTypography.Title) `
41
+ ${({ theme, $themeType, variant, state, breakpoint, color, $isFullWidth, }) => {
27
42
  return getGenesisTypographyClass(theme, $themeType, variant, state, breakpoint, color, $isFullWidth);
28
- });
29
- export var Paragraph = styled(AntTypography.Paragraph)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
30
- var theme = _a.theme, $themeType = _a.$themeType, variant = _a.variant, state = _a.state, breakpoint = _a.breakpoint, color = _a.color, $isFullWidth = _a.$isFullWidth;
43
+ }}
44
+ `;
45
+ export const Paragraph = styled(AntTypography.Paragraph) `
46
+ ${({ theme, $themeType, variant, state, breakpoint, color, $isFullWidth, }) => {
31
47
  return getGenesisTypographyClass(theme, $themeType, variant, state, breakpoint, color, $isFullWidth);
32
- });
33
- export var Text = styled(AntTypography.Text)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
34
- var theme = _a.theme, $themeType = _a.$themeType, variant = _a.variant, state = _a.state, breakpoint = _a.breakpoint, color = _a.color, $isFullWidth = _a.$isFullWidth;
48
+ }}
49
+ `;
50
+ export const Text = styled(AntTypography.Text) `
51
+ ${({ theme, $themeType, variant, state, breakpoint, color, $isFullWidth, }) => {
35
52
  return getGenesisTypographyClass(theme, $themeType, variant, state, breakpoint, color, $isFullWidth);
36
- });
37
- var templateObject_1, templateObject_2, templateObject_3;
53
+ }}
54
+ `;
@@ -1,32 +1,9 @@
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
- };
23
1
  import { jsx as _jsx } from "react/jsx-runtime";
24
2
  import Button from "../Button";
25
3
  import { TYPE } from "../../constants";
26
- var UtilityButton = function (_a) {
27
- var children = _a.children, onClick = _a.onClick, _b = _a.state, state = _b === void 0 ? "active" : _b, _c = _a.isIconButton, isIconButton = _c === void 0 ? false : _c, _d = _a.size, size = _d === void 0 ? "normal" : _d, rest = __rest(_a, ["children", "onClick", "state", "isIconButton", "size"]);
28
- var buttonState = state === "active" || state === "disabled" ? state : "active";
29
- var themeType = TYPE.utility;
30
- return (_jsx(Button, __assign({ onClick: onClick, themeType: themeType, state: buttonState, disabled: state === "disabled" || rest.disabled, isIconButton: isIconButton, size: size }, rest, { children: children })));
4
+ const UtilityButton = ({ children, onClick, state = "active", isIconButton = false, size = "normal", ...rest }) => {
5
+ const buttonState = state === "active" || state === "disabled" ? state : "active";
6
+ const themeType = TYPE.utility;
7
+ return (_jsx(Button, { onClick: onClick, themeType: themeType, state: buttonState, disabled: state === "disabled" || rest.disabled, isIconButton: isIconButton, size: size, ...rest, children: children }));
31
8
  };
32
9
  export default UtilityButton;
@@ -1,18 +1,7 @@
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
1
  import { jsx as _jsx } from "react/jsx-runtime";
13
2
  import { useGenesis } from "@gobolt/genesis/providers";
14
- var DropdownChevron = function (properties) {
15
- var theme = useGenesis().theme;
16
- return (_jsx("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: 20, height: 20, fill: "none" }, properties, { children: _jsx("path", { fill: "#222", fillRule: "evenodd", d: "M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414Z", clipRule: "evenodd" }) })));
3
+ const DropdownChevron = (properties) => {
4
+ const { theme } = useGenesis();
5
+ return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 20, height: 20, fill: "none", ...properties, children: _jsx("path", { fill: "#222", fillRule: "evenodd", d: "M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414Z", clipRule: "evenodd" }) }));
17
6
  };
18
7
  export default DropdownChevron;
@@ -1,4 +1,4 @@
1
- export var TYPE = {
1
+ export const TYPE = {
2
2
  primary: "primary",
3
3
  secondary: "secondary",
4
4
  tertiary: "tertiary",
@@ -6,12 +6,12 @@ export var TYPE = {
6
6
  utility: "utility",
7
7
  icon: "icon",
8
8
  };
9
- export var BREAKPOINTS = {
9
+ export const BREAKPOINTS = {
10
10
  wide: "wide",
11
11
  medium: "medium",
12
12
  narrow: "narrow",
13
13
  };
14
- export var STATE = {
14
+ export const STATE = {
15
15
  active: "active",
16
16
  hover: "hover",
17
17
  pressed: "pressed",
@@ -27,7 +27,7 @@ export var STATE = {
27
27
  removed: "removed",
28
28
  hollow: "hollow",
29
29
  };
30
- export var TYPOGRAPHY_VARIANT = {
30
+ export const TYPOGRAPHY_VARIANT = {
31
31
  display1: "display1",
32
32
  display2: "display2",
33
33
  display3: "display3",
@@ -56,18 +56,18 @@ export var TYPOGRAPHY_VARIANT = {
56
56
  digits2: "digits2",
57
57
  digits3: "digits3",
58
58
  };
59
- export var BUTTON_VARIANT = {
59
+ export const BUTTON_VARIANT = {
60
60
  primary: "primary",
61
61
  secondary: "secondary",
62
62
  tertiary: "tertiary",
63
63
  };
64
- export var SIZE = {
64
+ export const SIZE = {
65
65
  small: "small",
66
66
  medium: "medium",
67
67
  large: "large",
68
68
  standard: "standard",
69
69
  };
70
- export var BADGE = {
70
+ export const BADGE = {
71
71
  appointment: "appointment",
72
72
  asn: "asn",
73
73
  inventory: "inventory",
@@ -79,11 +79,11 @@ export var BADGE = {
79
79
  system: "system",
80
80
  };
81
81
  export default {
82
- TYPE: TYPE,
83
- BREAKPOINTS: BREAKPOINTS,
84
- STATE: STATE,
85
- TYPOGRAPHY_VARIANT: TYPOGRAPHY_VARIANT,
86
- BUTTON_VARIANT: BUTTON_VARIANT,
87
- SIZE: SIZE,
88
- BADGE: BADGE,
82
+ TYPE,
83
+ BREAKPOINTS,
84
+ STATE,
85
+ TYPOGRAPHY_VARIANT,
86
+ BUTTON_VARIANT,
87
+ SIZE,
88
+ BADGE,
89
89
  };