@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.
Files changed (171) hide show
  1. package/dist/components/Badge/Badge.js +32 -9
  2. package/dist/components/Badge/styles.d.ts +10 -1
  3. package/dist/components/Badge/styles.js +14 -39
  4. package/dist/components/Button/Button.js +27 -4
  5. package/dist/components/Button/IconButton.js +27 -4
  6. package/dist/components/Button/components/Button/Button.d.ts +16 -0
  7. package/dist/components/Button/components/Button/Button.js +13 -0
  8. package/dist/components/Button/components/Button/styles.d.ts +1 -0
  9. package/dist/components/Button/components/Button/styles.js +118 -0
  10. package/dist/components/Button/constants/index.d.ts +163 -0
  11. package/dist/components/Button/constants/index.js +89 -0
  12. package/dist/components/Button/icon-button-styles.d.ts +12 -1
  13. package/dist/components/Button/icon-button-styles.js +16 -69
  14. package/dist/components/Button/styles.d.ts +16 -1
  15. package/dist/components/Button/styles.js +30 -88
  16. package/dist/components/Input/Input.js +29 -6
  17. package/dist/components/Input/styles.d.ts +18 -1
  18. package/dist/components/Input/styles.js +42 -146
  19. package/dist/components/Select/Select.js +125 -101
  20. package/dist/components/Select/SelectTrigger.js +57 -71
  21. package/dist/components/Table/Table.js +27 -8
  22. package/dist/components/Table/TableControls/CustomPagination.js +66 -50
  23. package/dist/components/Table/TableControls/PaginationNumber.js +43 -27
  24. package/dist/components/Table/TableControls/PrimaryTableControlsRow.js +17 -16
  25. package/dist/components/Table/TableControls/SecondaryTableControlsRow.js +36 -14
  26. package/dist/components/Table/TableControls/TableControls.js +4 -3
  27. package/dist/components/Table/TablePagination.js +21 -4
  28. package/dist/components/Table/__mocks__/table-mocks.js +24 -15
  29. package/dist/components/Table/styles.d.ts +15 -1
  30. package/dist/components/Table/styles.js +13 -57
  31. package/dist/components/Table/useTable.js +166 -69
  32. package/dist/components/TableWithControls/TableWithControls.js +7 -6
  33. package/dist/components/TableWithControls/components/Badge/Badge.d.ts +16 -0
  34. package/dist/components/TableWithControls/components/Badge/Badge.js +28 -0
  35. package/dist/components/TableWithControls/components/Badge/index.d.ts +2 -0
  36. package/dist/components/TableWithControls/components/Badge/index.js +1 -0
  37. package/dist/components/TableWithControls/components/Badge/styles.d.ts +4 -0
  38. package/dist/components/TableWithControls/components/Badge/styles.js +46 -0
  39. package/dist/components/TableWithControls/components/Button/Button.d.ts +16 -0
  40. package/dist/components/TableWithControls/components/Button/Button.js +13 -0
  41. package/dist/components/TableWithControls/components/Button/IconButton.d.ts +8 -0
  42. package/dist/components/TableWithControls/components/Button/IconButton.js +9 -0
  43. package/dist/components/TableWithControls/components/Button/icon-button-styles.d.ts +1 -0
  44. package/dist/components/TableWithControls/components/Button/icon-button-styles.js +76 -0
  45. package/dist/components/TableWithControls/components/Button/index.d.ts +4 -0
  46. package/dist/components/TableWithControls/components/Button/index.js +2 -0
  47. package/dist/components/TableWithControls/components/Button/styles.d.ts +1 -0
  48. package/dist/components/TableWithControls/components/Button/styles.js +118 -0
  49. package/dist/components/TableWithControls/components/Input/Input.d.ts +13 -0
  50. package/dist/components/TableWithControls/components/Input/Input.js +34 -0
  51. package/dist/components/TableWithControls/components/Input/index.d.ts +2 -0
  52. package/dist/components/TableWithControls/components/Input/index.js +1 -0
  53. package/dist/components/TableWithControls/components/Input/styles.d.ts +1 -0
  54. package/dist/components/TableWithControls/components/Input/styles.js +180 -0
  55. package/dist/components/TableWithControls/components/Select/Select.d.ts +26 -0
  56. package/dist/components/TableWithControls/components/Select/Select.js +175 -0
  57. package/dist/components/TableWithControls/components/Select/SelectTrigger.d.ts +23 -0
  58. package/dist/components/TableWithControls/components/Select/SelectTrigger.js +103 -0
  59. package/dist/components/TableWithControls/components/Select/index.d.ts +2 -0
  60. package/dist/components/TableWithControls/components/Select/index.js +1 -0
  61. package/dist/components/TableWithControls/components/Table/Table.d.ts +51 -0
  62. package/dist/components/TableWithControls/components/Table/Table.js +14 -0
  63. package/dist/components/TableWithControls/components/Table/TableControls/CustomPagination.d.ts +13 -0
  64. package/dist/components/TableWithControls/components/Table/TableControls/CustomPagination.js +158 -0
  65. package/dist/components/TableWithControls/components/Table/TableControls/PaginationNumber.d.ts +7 -0
  66. package/dist/components/TableWithControls/components/Table/TableControls/PaginationNumber.js +30 -0
  67. package/dist/components/TableWithControls/components/Table/TableControls/PrimaryTableControlsRow.d.ts +18 -0
  68. package/dist/components/TableWithControls/components/Table/TableControls/PrimaryTableControlsRow.js +77 -0
  69. package/dist/components/TableWithControls/components/Table/TableControls/SecondaryTableControlsRow.d.ts +11 -0
  70. package/dist/components/TableWithControls/components/Table/TableControls/SecondaryTableControlsRow.js +43 -0
  71. package/dist/components/TableWithControls/components/Table/TableControls/TableControls.d.ts +14 -0
  72. package/dist/components/TableWithControls/components/Table/TableControls/TableControls.js +13 -0
  73. package/dist/components/TableWithControls/components/Table/TableControls/index.d.ts +2 -0
  74. package/dist/components/TableWithControls/components/Table/TableControls/index.js +1 -0
  75. package/dist/components/TableWithControls/components/Table/TablePagination.d.ts +13 -0
  76. package/dist/components/TableWithControls/components/Table/TablePagination.js +11 -0
  77. package/dist/components/TableWithControls/components/Table/__mocks__/table-mocks.d.ts +20 -0
  78. package/dist/components/TableWithControls/components/Table/__mocks__/table-mocks.js +301 -0
  79. package/dist/components/TableWithControls/components/Table/index.d.ts +6 -0
  80. package/dist/components/TableWithControls/components/Table/index.js +3 -0
  81. package/dist/components/TableWithControls/components/Table/styles.d.ts +14 -0
  82. package/dist/components/TableWithControls/components/Table/styles.js +64 -0
  83. package/dist/components/TableWithControls/components/Table/useTable.d.ts +26 -0
  84. package/dist/components/TableWithControls/components/Table/useTable.js +141 -0
  85. package/dist/components/TableWithControls/components/TableWithControls/TableWithControls.d.ts +12 -0
  86. package/dist/components/TableWithControls/components/TableWithControls/TableWithControls.js +20 -0
  87. package/dist/components/TableWithControls/components/TableWithControls/useTableWithControls.d.ts +29 -0
  88. package/dist/components/TableWithControls/components/TableWithControls/useTableWithControls.js +136 -0
  89. package/dist/components/TableWithControls/components/Tooltip/Tooltip.d.ts +7 -0
  90. package/dist/components/TableWithControls/components/Tooltip/Tooltip.js +8 -0
  91. package/dist/components/TableWithControls/components/Tooltip/index.d.ts +2 -0
  92. package/dist/components/TableWithControls/components/Tooltip/index.js +1 -0
  93. package/dist/components/TableWithControls/components/Tooltip/styles.d.ts +6 -0
  94. package/dist/components/TableWithControls/components/Tooltip/styles.js +26 -0
  95. package/dist/components/TableWithControls/components/Typography/Typography.d.ts +17 -0
  96. package/dist/components/TableWithControls/components/Typography/Typography.js +16 -0
  97. package/dist/components/TableWithControls/components/Typography/index.d.ts +2 -0
  98. package/dist/components/TableWithControls/components/Typography/index.js +1 -0
  99. package/dist/components/TableWithControls/components/Typography/styles.d.ts +3 -0
  100. package/dist/components/TableWithControls/components/Typography/styles.js +54 -0
  101. package/dist/components/TableWithControls/components/UtilityButton/UtilityButton.d.ts +5 -0
  102. package/dist/components/TableWithControls/components/UtilityButton/UtilityButton.js +9 -0
  103. package/dist/components/TableWithControls/components/UtilityButton/index.d.ts +2 -0
  104. package/dist/components/TableWithControls/components/UtilityButton/index.js +1 -0
  105. package/dist/components/TableWithControls/components/shared/DropdownChevron.d.ts +2 -0
  106. package/dist/components/TableWithControls/components/shared/DropdownChevron.js +7 -0
  107. package/dist/components/TableWithControls/constants/index.d.ts +163 -0
  108. package/dist/components/TableWithControls/constants/index.js +89 -0
  109. package/dist/components/TableWithControls/types/events.d.ts +22 -0
  110. package/dist/components/TableWithControls/types/events.js +1 -0
  111. package/dist/components/TableWithControls/useTableWithControls.js +63 -82
  112. package/dist/components/TableWithControls/utils/icon-util.d.ts +3 -0
  113. package/dist/components/TableWithControls/utils/icon-util.js +116 -0
  114. package/dist/components/Tooltip/Tooltip.js +2 -1
  115. package/dist/components/Tooltip/styles.d.ts +14 -1
  116. package/dist/components/Tooltip/styles.js +14 -23
  117. package/dist/components/Typography/Typography.js +29 -6
  118. package/dist/components/Typography/styles.d.ts +21 -3
  119. package/dist/components/Typography/styles.js +24 -41
  120. package/dist/components/UtilityButton/UtilityButton.js +27 -4
  121. package/dist/components/UtilityButton/components/Button/Button.d.ts +16 -0
  122. package/dist/components/UtilityButton/components/Button/Button.js +13 -0
  123. package/dist/components/UtilityButton/components/Button/IconButton.d.ts +8 -0
  124. package/dist/components/UtilityButton/components/Button/IconButton.js +9 -0
  125. package/dist/components/UtilityButton/components/Button/icon-button-styles.d.ts +1 -0
  126. package/dist/components/UtilityButton/components/Button/icon-button-styles.js +76 -0
  127. package/dist/components/UtilityButton/components/Button/index.d.ts +4 -0
  128. package/dist/components/UtilityButton/components/Button/index.js +2 -0
  129. package/dist/components/UtilityButton/components/Button/styles.d.ts +1 -0
  130. package/dist/components/UtilityButton/components/Button/styles.js +118 -0
  131. package/dist/components/UtilityButton/components/UtilityButton/UtilityButton.d.ts +5 -0
  132. package/dist/components/UtilityButton/components/UtilityButton/UtilityButton.js +9 -0
  133. package/dist/components/UtilityButton/constants/index.d.ts +163 -0
  134. package/dist/components/UtilityButton/constants/index.js +89 -0
  135. package/dist/components/index.js +7 -0
  136. package/dist/components/shared/DropdownChevron.js +14 -3
  137. package/dist/index.js +10 -89
  138. package/dist/utils/icon-util.d.ts +2 -2
  139. package/dist/utils/icon-util.js +19 -16
  140. package/package.json +1 -1
  141. package/dist/components/Button/Button.tsx +0 -59
  142. package/dist/components/Table/Table.tsx +0 -112
  143. package/dist/components/Table/useTable.ts +0 -194
  144. package/dist/components/TableWithControls/TableWithControls.tsx +0 -54
  145. package/dist/components/TableWithControls/useTableWithControls.tsx +0 -161
  146. package/dist/components/UtilityButton/UtilityButton.tsx +0 -36
  147. package/dist/components/index.ts +0 -7
  148. package/dist/constants/index.ts +0 -98
  149. package/dist/genesis-theme.types.d.ts +0 -263
  150. package/dist/genesis-theme.types.js +0 -6
  151. package/dist/index.ts +0 -10
  152. package/dist/styled.d.ts +0 -1
  153. package/dist/styled.js +0 -44
  154. package/dist/styles/theme/genesis-theme.types.ts +0 -297
  155. package/dist/utils/styled.ts +0 -52
  156. /package/dist/{Table → components/Table/Table}/Table.d.ts +0 -0
  157. /package/dist/{Table → components/Table/Table}/Table.js +0 -0
  158. /package/dist/{Table → components/Table/Table}/TableControls/CustomPagination.d.ts +0 -0
  159. /package/dist/{Table → components/Table/Table}/TableControls/CustomPagination.js +0 -0
  160. /package/dist/{Table → components/Table/Table}/TableControls/PaginationNumber.d.ts +0 -0
  161. /package/dist/{Table → components/Table/Table}/TableControls/PaginationNumber.js +0 -0
  162. /package/dist/{Table → components/Table/Table}/styles.d.ts +0 -0
  163. /package/dist/{Table → components/Table/Table}/styles.js +0 -0
  164. /package/dist/{Table → components/Table/Table}/useTable.d.ts +0 -0
  165. /package/dist/{Table → components/Table/Table}/useTable.js +0 -0
  166. /package/dist/{Typography → components/Table/Typography}/Typography.d.ts +0 -0
  167. /package/dist/{Typography → components/Table/Typography}/Typography.js +0 -0
  168. /package/dist/{Typography → components/Table/Typography}/index.d.ts +0 -0
  169. /package/dist/{Typography → components/Table/Typography}/index.js +0 -0
  170. /package/dist/{Typography → components/Table/Typography}/styles.d.ts +0 -0
  171. /package/dist/{Typography → components/Table/Typography}/styles.js +0 -0
@@ -1,9 +1,36 @@
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
+ };
1
28
  import { jsx as _jsx } from "react/jsx-runtime";
2
29
  import { useState } from "react";
3
30
  import { useTable } from "../Table/useTable";
4
31
  import { mockColumns, mockDataSource } from "../Table/__mocks__/table-mocks";
5
32
  //import
6
- const tableControlsData = {
33
+ var tableControlsData = {
7
34
  primaryTableRowData: {
8
35
  sortOptions: [
9
36
  { value: "status", label: _jsx("span", { children: "Status" }) },
@@ -22,7 +49,7 @@ const tableControlsData = {
22
49
  totalRecords: mockDataSource.appointments.length,
23
50
  },
24
51
  };
25
- const startingUseTableConfig = {
52
+ var startingUseTableConfig = {
26
53
  columns: mockColumns,
27
54
  filters: {
28
55
  order: "asc",
@@ -31,106 +58,60 @@ const startingUseTableConfig = {
31
58
  disableAutoFetch: true,
32
59
  dataSource: [],
33
60
  };
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);
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;
45
68
  // Ensure we always return a valid object, even if dataSource is empty
46
- const safeDataSource = dataSource || [];
47
- const onGroupItemClick = (title, item) => {
48
- const newGroups = { ...groups };
49
- newGroups[title] = newGroups[title].filter((group) => group !== item);
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; });
50
73
  setGroups(newGroups);
51
74
  };
52
- const onChange = (actionEvent) => {
75
+ var onChange = function (actionEvent) {
53
76
  if (actionEvent.event === "inputChange") {
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
- }));
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
+ }) }) })); });
72
82
  }
73
83
  }
74
84
  if (actionEvent.event === "primaryChange") {
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
- }));
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
+ }) }) })); });
93
90
  }
94
91
  }
95
92
  if (actionEvent.event === "groupItemClick") {
96
- const { title, item } = actionEvent.payload;
93
+ var _a = actionEvent.payload, title = _a.title, item = _a.item;
97
94
  if (typeof title === "string" && typeof item === "string") {
98
95
  onGroupItemClick(title, item);
99
96
  }
100
97
  }
101
98
  if (actionEvent.event === "orderClick") {
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
- }));
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
+ }) }) })); });
124
105
  }
125
106
  }
126
107
  };
127
108
  return {
128
- onChange,
129
- primaryTableRowData,
109
+ onChange: onChange,
110
+ primaryTableRowData: primaryTableRowData,
130
111
  secondaryTableRowData: newSecondaryTableRowData,
131
112
  dataSource: safeDataSource,
132
- columns,
133
- rowSelection,
134
- updateDataSource,
113
+ columns: columns,
114
+ rowSelection: rowSelection,
115
+ updateDataSource: updateDataSource,
135
116
  };
136
117
  };
@@ -0,0 +1,3 @@
1
+ export declare const getIcon: (name: string) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const getIconColor: (state: any, theme: any) => any;
3
+ export declare const getBadgeStateIcon: (state: any, color: any, isFilled?: boolean, hasIcon?: boolean, customIcon?: any) => any;
@@ -0,0 +1,116 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { STATE } from "@gobolt/genesis/constants";
3
+ const iconSize = 18;
4
+ // check circle filled & outline
5
+ import { FaCircleCheck } from "react-icons/fa6";
6
+ import { HiOutlineCheckCircle } from "react-icons/hi";
7
+ // info circle filled & outline
8
+ import { PiInfoFill, PiInfo } from "react-icons/pi";
9
+ // error circle filled & outline
10
+ import { HiXCircle } from "react-icons/hi";
11
+ import { HiOutlineXCircle } from "react-icons/hi";
12
+ // warning circle filled & outline
13
+ import { HiExclamationCircle } from "react-icons/hi";
14
+ import { HiOutlineExclamationCircle } from "react-icons/hi";
15
+ // minus circle filled & outline
16
+ import { HiMinusCircle } from "react-icons/hi";
17
+ import { HiOutlineMinusCircle } from "react-icons/hi";
18
+ // clock circle filled & outline
19
+ import { HiClock } from "react-icons/hi";
20
+ import { HiOutlineClock } from "react-icons/hi";
21
+ import { HiOutlineGlobe } from "react-icons/hi";
22
+ import { TbFiles } from "react-icons/tb";
23
+ import { LuTag } from "react-icons/lu";
24
+ export const getIcon = (name) => {
25
+ switch (name.toLowerCase()) {
26
+ case "orders": {
27
+ return _jsx(LuTag, {});
28
+ }
29
+ case "warehouse": {
30
+ return _jsx(HiOutlineGlobe, {});
31
+ }
32
+ case "availability": {
33
+ return _jsx(TbFiles, {});
34
+ }
35
+ default: {
36
+ return null;
37
+ }
38
+ }
39
+ };
40
+ export const getIconColor = (state, theme) => {
41
+ switch (state) {
42
+ case STATE.error: {
43
+ return theme.colors.status.error.onsurface;
44
+ }
45
+ case STATE.success: {
46
+ return theme.colors.status.success.onsurface;
47
+ }
48
+ case STATE.warning: {
49
+ return theme.colors.status.warning.default;
50
+ }
51
+ case STATE.removed: {
52
+ return theme.colors.status.generic.default;
53
+ }
54
+ case STATE.progress: {
55
+ return theme.colors.timebox.evening.default;
56
+ }
57
+ case STATE.info:
58
+ default: {
59
+ return theme.colors.status.info.onsurface;
60
+ }
61
+ }
62
+ };
63
+ export const getBadgeStateIcon = (state, color, isFilled = true, hasIcon = true, customIcon = null) => {
64
+ if (!state || !hasIcon) {
65
+ return null;
66
+ }
67
+ if (customIcon) {
68
+ return customIcon;
69
+ }
70
+ if (!isFilled) {
71
+ switch (state) {
72
+ // isFilled is false
73
+ case STATE.warning: {
74
+ return _jsx(HiOutlineExclamationCircle, { size: iconSize, style: { color } });
75
+ }
76
+ case STATE.error: {
77
+ return _jsx(HiOutlineXCircle, { size: iconSize, style: { color } });
78
+ }
79
+ case STATE.success: {
80
+ return _jsx(HiOutlineCheckCircle, { size: iconSize, style: { color } });
81
+ }
82
+ case STATE.progress: {
83
+ return _jsx(HiOutlineClock, { size: iconSize, style: { color } });
84
+ }
85
+ case STATE.removed: {
86
+ return _jsx(HiOutlineMinusCircle, { size: iconSize, style: { color } });
87
+ }
88
+ case STATE.info:
89
+ default: {
90
+ return _jsx(PiInfo, { size: iconSize, style: { color } });
91
+ }
92
+ }
93
+ }
94
+ switch (state) {
95
+ // isFilled is true
96
+ case STATE.warning: {
97
+ return _jsx(HiExclamationCircle, { size: iconSize, style: { color } });
98
+ }
99
+ case STATE.error: {
100
+ return _jsx(HiXCircle, { size: iconSize, style: { color } });
101
+ }
102
+ case STATE.success: {
103
+ return _jsx(FaCircleCheck, { size: iconSize, style: { color } });
104
+ }
105
+ case STATE.progress: {
106
+ return _jsx(HiClock, { size: iconSize, style: { color } });
107
+ }
108
+ case STATE.removed: {
109
+ return _jsx(HiMinusCircle, { size: iconSize, style: { color } });
110
+ }
111
+ case STATE.info:
112
+ default: {
113
+ return _jsx(PiInfoFill, { size: iconSize, style: { color } });
114
+ }
115
+ }
116
+ };
@@ -2,7 +2,8 @@ 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
- const Tooltip = ({ tip = "", children }) => {
5
+ var Tooltip = function (_a) {
6
+ var _b = _a.tip, tip = _b === void 0 ? "" : _b, children = _a.children;
6
7
  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 }));
7
8
  };
8
9
  export default Tooltip;
@@ -1,6 +1,19 @@
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
+ }
1
7
  export declare const getGenesisClass: ({ colors, borderRadius, sizing }: {
2
8
  colors: any;
3
9
  borderRadius: any;
4
10
  sizing: any;
5
11
  }, type?: string, state?: string) => string;
6
- export declare const Tooltip: any;
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 {};
@@ -1,26 +1,17 @@
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 { Tooltip as AntTooltip } from "antd";
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 }) => {
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;
24
15
  return getGenesisClass(theme, type, state);
25
- }}
26
- `;
16
+ });
17
+ var templateObject_1;
@@ -1,16 +1,39 @@
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 * as S from "./styles";
3
25
  import { useGenesis } from "@gobolt/genesis/providers";
4
26
  import { TYPE, TYPOGRAPHY_VARIANT, STATE, } from "@gobolt/genesis/constants";
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();
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;
7
30
  if (variant.startsWith("display") || variant.startsWith("heading")) {
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 }));
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 })));
10
33
  }
11
34
  if (isText) {
12
- return (_jsx(S.Text, { state: state, "$themeType": themeType, variant: variant, breakpoint: breakpoint, color: color, "$isFullWidth": isFullWidth, style: style, disabled: isDisabled, ...rest, children: children }));
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 })));
13
36
  }
14
- return (_jsx(S.Paragraph, { state: state, "$themeType": themeType, variant: variant, breakpoint: breakpoint, color: color, "$isFullWidth": isFullWidth, style: style, disabled: isDisabled, ...rest, children: children }));
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 })));
15
38
  };
16
39
  export default Typography;
@@ -1,3 +1,21 @@
1
- export declare const Headline: any;
2
- export declare const Paragraph: any;
3
- export declare const Text: any;
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,54 +1,37 @@
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 { Typography as AntTypography } from "antd";
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
- `;
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 ");
10
9
  };
11
- const getColor = (color, colors, $themeType) => {
10
+ var getColor = function (color, colors, $themeType) {
12
11
  if (color) {
13
12
  return color;
14
13
  }
15
14
  return colors[$themeType].active.color;
16
15
  };
17
- const getFontFamily = (variant) => {
18
- return `
19
- ${variant.includes("digits")
16
+ var getFontFamily = function (variant) {
17
+ return "\n ".concat(variant.includes("digits")
20
18
  ? "'Roboto Mono', sans-serif"
21
- : "'Inter', sans-serif"} !important;
22
- `;
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");
23
24
  };
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, }) => {
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;
42
27
  return getGenesisTypographyClass(theme, $themeType, variant, state, breakpoint, color, $isFullWidth);
43
- }}
44
- `;
45
- export const Paragraph = styled(AntTypography.Paragraph) `
46
- ${({ 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;
47
31
  return getGenesisTypographyClass(theme, $themeType, variant, state, breakpoint, color, $isFullWidth);
48
- }}
49
- `;
50
- export const Text = styled(AntTypography.Text) `
51
- ${({ 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;
52
35
  return getGenesisTypographyClass(theme, $themeType, variant, state, breakpoint, color, $isFullWidth);
53
- }}
54
- `;
36
+ });
37
+ var templateObject_1, templateObject_2, templateObject_3;
@@ -1,9 +1,32 @@
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 Button from "../Button";
3
25
  import { TYPE } from "../../constants";
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 }));
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 })));
8
31
  };
9
32
  export default UtilityButton;
@@ -0,0 +1,16 @@
1
+ import React, { MouseEvent } from "react";
2
+ import type { ButtonProps as AntButtonProperties } from "antd/es/button";
3
+ import { STATE } from "../../constants";
4
+ type ButtonThemeType = "primary" | "secondary" | "tertiary" | "destructive" | "utility" | "icon";
5
+ export interface ButtonProps extends Omit<AntButtonProperties, "type" | "size"> {
6
+ onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
7
+ children?: React.ReactNode;
8
+ themeType?: ButtonThemeType;
9
+ state?: keyof typeof STATE;
10
+ isIconButton?: boolean;
11
+ size?: "small" | "normal" | "large";
12
+ isSelected?: boolean;
13
+ icon?: React.ReactNode;
14
+ }
15
+ declare const Button: React.FC<ButtonProps>;
16
+ export default Button;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as S from "./styles";
3
+ const getState = (state, isSelected) => {
4
+ if (isSelected) {
5
+ return "selected";
6
+ }
7
+ return state === "active" || state === "disabled" ? state : "active";
8
+ };
9
+ const Button = ({ children, onClick, themeType = "primary", state = "active", isIconButton = false, size = "normal", isSelected, ...rest }) => {
10
+ const buttonState = getState(state, isSelected);
11
+ return (_jsx(S.Button, { onClick: onClick, "$themeType": themeType, "$state": buttonState, disabled: state === "disabled" || rest.disabled, "$isIconButton": isIconButton, size: size, ...rest, children: children }));
12
+ };
13
+ export default Button;
@@ -0,0 +1,8 @@
1
+ import type { ButtonProps } from "./Button";
2
+ export interface IconButtonProps extends Omit<ButtonProps, "themeType" | "size"> {
3
+ icon: React.ReactNode;
4
+ size?: "small" | "normal" | "large";
5
+ isSelected?: boolean;
6
+ }
7
+ declare const IconButton: ({ isSelected, state, onClick, icon, size, ...rest }: IconButtonProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default IconButton;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as S from "./icon-button-styles";
3
+ import { TYPE } from "../../constants";
4
+ const IconButton = ({ isSelected = false, state = "active", onClick, icon, size = "small", ...rest }) => {
5
+ const buttonState = state === "active" || state === "disabled" ? state : "active";
6
+ const themeType = TYPE.icon;
7
+ return (_jsx(S.Button, { onClick: onClick, "$themeType": themeType, "$state": buttonState, disabled: state === "disabled" || rest.disabled, size: size, "$isSelected": isSelected, ...rest, children: icon }));
8
+ };
9
+ export default IconButton;
@@ -0,0 +1 @@
1
+ export declare const Button: any;