@gobolt/genesis 0.3.21 → 0.3.23

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 (133) hide show
  1. package/dist/components/Button/components/Button/Button.d.ts +16 -0
  2. package/dist/components/Button/components/Button/Button.js +13 -0
  3. package/dist/components/Button/components/Button/styles.d.ts +1 -0
  4. package/dist/components/Button/components/Button/styles.js +118 -0
  5. package/dist/components/Button/constants/index.d.ts +163 -0
  6. package/dist/components/Button/constants/index.js +89 -0
  7. package/dist/components/Table/Table/Table.d.ts +51 -0
  8. package/dist/components/Table/Table/Table.js +14 -0
  9. package/dist/components/Table/Table/TableControls/CustomPagination.d.ts +13 -0
  10. package/dist/components/Table/Table/TableControls/CustomPagination.js +158 -0
  11. package/dist/components/Table/Table/TableControls/PaginationNumber.d.ts +7 -0
  12. package/dist/components/Table/Table/TableControls/PaginationNumber.js +30 -0
  13. package/dist/components/Table/Table/styles.d.ts +14 -0
  14. package/dist/components/Table/Table/styles.js +64 -0
  15. package/dist/components/Table/Table/useTable.d.ts +26 -0
  16. package/dist/components/Table/Table/useTable.js +141 -0
  17. package/dist/components/Table/Typography/Typography.d.ts +17 -0
  18. package/dist/components/Table/Typography/Typography.js +16 -0
  19. package/dist/components/Table/Typography/index.d.ts +2 -0
  20. package/dist/components/Table/Typography/index.js +1 -0
  21. package/dist/components/Table/Typography/styles.d.ts +3 -0
  22. package/dist/components/Table/Typography/styles.js +54 -0
  23. package/dist/components/TableWithControls/components/Badge/Badge.d.ts +16 -0
  24. package/dist/components/TableWithControls/components/Badge/Badge.js +28 -0
  25. package/dist/components/TableWithControls/components/Badge/index.d.ts +2 -0
  26. package/dist/components/TableWithControls/components/Badge/index.js +1 -0
  27. package/dist/components/TableWithControls/components/Badge/styles.d.ts +4 -0
  28. package/dist/components/TableWithControls/components/Badge/styles.js +46 -0
  29. package/dist/components/TableWithControls/components/Button/Button.d.ts +16 -0
  30. package/dist/components/TableWithControls/components/Button/Button.js +13 -0
  31. package/dist/components/TableWithControls/components/Button/IconButton.d.ts +8 -0
  32. package/dist/components/TableWithControls/components/Button/IconButton.js +9 -0
  33. package/dist/components/TableWithControls/components/Button/icon-button-styles.d.ts +1 -0
  34. package/dist/components/TableWithControls/components/Button/icon-button-styles.js +76 -0
  35. package/dist/components/TableWithControls/components/Button/index.d.ts +4 -0
  36. package/dist/components/TableWithControls/components/Button/index.js +2 -0
  37. package/dist/components/TableWithControls/components/Button/styles.d.ts +1 -0
  38. package/dist/components/TableWithControls/components/Button/styles.js +118 -0
  39. package/dist/components/TableWithControls/components/Input/Input.d.ts +13 -0
  40. package/dist/components/TableWithControls/components/Input/Input.js +34 -0
  41. package/dist/components/TableWithControls/components/Input/index.d.ts +2 -0
  42. package/dist/components/TableWithControls/components/Input/index.js +1 -0
  43. package/dist/components/TableWithControls/components/Input/styles.d.ts +1 -0
  44. package/dist/components/TableWithControls/components/Input/styles.js +180 -0
  45. package/dist/components/TableWithControls/components/Select/Select.d.ts +26 -0
  46. package/dist/components/TableWithControls/components/Select/Select.js +175 -0
  47. package/dist/components/TableWithControls/components/Select/SelectTrigger.d.ts +23 -0
  48. package/dist/components/TableWithControls/components/Select/SelectTrigger.js +103 -0
  49. package/dist/components/TableWithControls/components/Select/index.d.ts +2 -0
  50. package/dist/components/TableWithControls/components/Select/index.js +1 -0
  51. package/dist/components/TableWithControls/components/Table/Table.d.ts +51 -0
  52. package/dist/components/TableWithControls/components/Table/Table.js +14 -0
  53. package/dist/components/TableWithControls/components/Table/TableControls/CustomPagination.d.ts +13 -0
  54. package/dist/components/TableWithControls/components/Table/TableControls/CustomPagination.js +158 -0
  55. package/dist/components/TableWithControls/components/Table/TableControls/PaginationNumber.d.ts +7 -0
  56. package/dist/components/TableWithControls/components/Table/TableControls/PaginationNumber.js +30 -0
  57. package/dist/components/TableWithControls/components/Table/TableControls/PrimaryTableControlsRow.d.ts +18 -0
  58. package/dist/components/TableWithControls/components/Table/TableControls/PrimaryTableControlsRow.js +77 -0
  59. package/dist/components/TableWithControls/components/Table/TableControls/SecondaryTableControlsRow.d.ts +11 -0
  60. package/dist/components/TableWithControls/components/Table/TableControls/SecondaryTableControlsRow.js +43 -0
  61. package/dist/components/TableWithControls/components/Table/TableControls/TableControls.d.ts +14 -0
  62. package/dist/components/TableWithControls/components/Table/TableControls/TableControls.js +13 -0
  63. package/dist/components/TableWithControls/components/Table/TableControls/index.d.ts +2 -0
  64. package/dist/components/TableWithControls/components/Table/TableControls/index.js +1 -0
  65. package/dist/components/TableWithControls/components/Table/TablePagination.d.ts +13 -0
  66. package/dist/components/TableWithControls/components/Table/TablePagination.js +11 -0
  67. package/dist/components/TableWithControls/components/Table/__mocks__/table-mocks.d.ts +20 -0
  68. package/dist/components/TableWithControls/components/Table/__mocks__/table-mocks.js +301 -0
  69. package/dist/components/TableWithControls/components/Table/index.d.ts +6 -0
  70. package/dist/components/TableWithControls/components/Table/index.js +3 -0
  71. package/dist/components/TableWithControls/components/Table/styles.d.ts +14 -0
  72. package/dist/components/TableWithControls/components/Table/styles.js +64 -0
  73. package/dist/components/TableWithControls/components/Table/useTable.d.ts +26 -0
  74. package/dist/components/TableWithControls/components/Table/useTable.js +141 -0
  75. package/dist/components/TableWithControls/components/TableWithControls/TableWithControls.d.ts +12 -0
  76. package/dist/components/TableWithControls/components/TableWithControls/TableWithControls.js +20 -0
  77. package/dist/components/TableWithControls/components/TableWithControls/useTableWithControls.d.ts +29 -0
  78. package/dist/components/TableWithControls/components/TableWithControls/useTableWithControls.js +136 -0
  79. package/dist/components/TableWithControls/components/Tooltip/Tooltip.d.ts +7 -0
  80. package/dist/components/TableWithControls/components/Tooltip/Tooltip.js +8 -0
  81. package/dist/components/TableWithControls/components/Tooltip/index.d.ts +2 -0
  82. package/dist/components/TableWithControls/components/Tooltip/index.js +1 -0
  83. package/dist/components/TableWithControls/components/Tooltip/styles.d.ts +6 -0
  84. package/dist/components/TableWithControls/components/Tooltip/styles.js +26 -0
  85. package/dist/components/TableWithControls/components/Typography/Typography.d.ts +17 -0
  86. package/dist/components/TableWithControls/components/Typography/Typography.js +16 -0
  87. package/dist/components/TableWithControls/components/Typography/index.d.ts +2 -0
  88. package/dist/components/TableWithControls/components/Typography/index.js +1 -0
  89. package/dist/components/TableWithControls/components/Typography/styles.d.ts +3 -0
  90. package/dist/components/TableWithControls/components/Typography/styles.js +54 -0
  91. package/dist/components/TableWithControls/components/UtilityButton/UtilityButton.d.ts +5 -0
  92. package/dist/components/TableWithControls/components/UtilityButton/UtilityButton.js +9 -0
  93. package/dist/components/TableWithControls/components/UtilityButton/index.d.ts +2 -0
  94. package/dist/components/TableWithControls/components/UtilityButton/index.js +1 -0
  95. package/dist/components/TableWithControls/components/shared/DropdownChevron.d.ts +2 -0
  96. package/dist/components/TableWithControls/components/shared/DropdownChevron.js +7 -0
  97. package/dist/components/TableWithControls/constants/index.d.ts +163 -0
  98. package/dist/components/TableWithControls/constants/index.js +89 -0
  99. package/dist/components/TableWithControls/types/events.d.ts +22 -0
  100. package/dist/components/TableWithControls/types/events.js +1 -0
  101. package/dist/components/TableWithControls/utils/icon-util.d.ts +3 -0
  102. package/dist/components/TableWithControls/utils/icon-util.js +116 -0
  103. package/dist/components/UtilityButton/components/Button/Button.d.ts +16 -0
  104. package/dist/components/UtilityButton/components/Button/Button.js +13 -0
  105. package/dist/components/UtilityButton/components/Button/IconButton.d.ts +8 -0
  106. package/dist/components/UtilityButton/components/Button/IconButton.js +9 -0
  107. package/dist/components/UtilityButton/components/Button/icon-button-styles.d.ts +1 -0
  108. package/dist/components/UtilityButton/components/Button/icon-button-styles.js +76 -0
  109. package/dist/components/UtilityButton/components/Button/index.d.ts +4 -0
  110. package/dist/components/UtilityButton/components/Button/index.js +2 -0
  111. package/dist/components/UtilityButton/components/Button/styles.d.ts +1 -0
  112. package/dist/components/UtilityButton/components/Button/styles.js +118 -0
  113. package/dist/components/UtilityButton/components/UtilityButton/UtilityButton.d.ts +5 -0
  114. package/dist/components/UtilityButton/components/UtilityButton/UtilityButton.js +9 -0
  115. package/dist/components/UtilityButton/constants/index.d.ts +163 -0
  116. package/dist/components/UtilityButton/constants/index.js +89 -0
  117. package/dist/components/index.d.ts +6 -6
  118. package/dist/components/index.js +7 -0
  119. package/dist/components/index.ts +6 -6
  120. package/dist/constants/index.js +14 -14
  121. package/dist/index.d.ts +9 -9
  122. package/dist/index.js +10 -0
  123. package/dist/index.ts +9 -9
  124. package/package.json +1 -1
  125. package/dist/components/Button/Button.tsx +0 -59
  126. package/dist/components/Table/Table.tsx +0 -112
  127. package/dist/components/Table/useTable.ts +0 -194
  128. package/dist/components/TableWithControls/TableWithControls.tsx +0 -54
  129. package/dist/components/TableWithControls/useTableWithControls.tsx +0 -161
  130. package/dist/components/UtilityButton/UtilityButton.tsx +0 -36
  131. package/dist/constants/index.ts +0 -98
  132. package/dist/styles/theme/genesis-theme.types.ts +0 -297
  133. package/dist/utils/styled.ts +0 -52
@@ -1,161 +0,0 @@
1
- import { useState } from "react";
2
-
3
- import { useTable, type UseTableConfig } from "../Table/useTable";
4
- import { mockColumns, mockDataSource } from "../Table/__mocks__/table-mocks";
5
- import { ActionEvent, TableEventPayload } from "../../types/events";
6
-
7
- //import
8
-
9
- const tableControlsData = {
10
- primaryTableRowData: {
11
- sortOptions: [
12
- { value: "status", label: <span>Status</span> },
13
- { value: "address", label: <span>Address</span> },
14
- { value: "job_subtype", label: <span>Type</span> },
15
- ],
16
- searchByPlaceholder: "Search by Address",
17
- isSortedAscending: true,
18
- },
19
- secondaryTableRowData: {
20
- groups: {
21
- orders: ["Cancelled", "Paused"],
22
- warehouse: ["D2C"],
23
- availability: ["Out of Stock"],
24
- },
25
- totalRecords: mockDataSource.appointments.length,
26
- },
27
- };
28
-
29
- const startingUseTableConfig: UseTableConfig = {
30
- columns: mockColumns,
31
- filters: {
32
- order: "asc",
33
- },
34
- // Disable auto-fetch to allow external data management
35
- disableAutoFetch: true,
36
- dataSource: [],
37
- };
38
-
39
- export const useTableWithControls = (tableConfig: UseTableConfig) => {
40
- const [useTableConfig, setUseTableConfig] = useState<UseTableConfig>(
41
- startingUseTableConfig
42
- );
43
-
44
- const [groups, setGroups] = useState(
45
- tableControlsData.secondaryTableRowData.groups
46
- );
47
-
48
- const [primaryTableRowData, setPrimaryTableRowData] = useState(
49
- tableControlsData.primaryTableRowData
50
- );
51
-
52
- const { secondaryTableRowData } = tableControlsData;
53
-
54
- const newSecondaryTableRowData = {
55
- ...secondaryTableRowData,
56
- groups,
57
- totalRecords: safeDataSource.length,
58
- };
59
-
60
- const { dataSource, columns, rowSelection, updateDataSource } =
61
- useTable(useTableConfig);
62
-
63
- // Ensure we always return a valid object, even if dataSource is empty
64
- const safeDataSource = dataSource || [];
65
-
66
- const onGroupItemClick = (title: string, item: string) => {
67
- const newGroups = { ...groups };
68
- newGroups[title] = newGroups[title].filter((group) => group !== item);
69
- setGroups(newGroups);
70
- };
71
-
72
- const onChange = (actionEvent: ActionEvent<TableEventPayload>) => {
73
- if (actionEvent.event === "inputChange") {
74
- const { value } = actionEvent.payload;
75
- if (typeof value === "string") {
76
- setUseTableConfig((previous) => ({
77
- ...previous,
78
- filters: {
79
- ...previous.filters,
80
- search: value,
81
- },
82
- fetchOptions: {
83
- ...previous.fetchOptions,
84
- body: JSON.stringify({
85
- filters: {
86
- ...previous.filters,
87
- search: value,
88
- },
89
- }),
90
- },
91
- }));
92
- }
93
- }
94
-
95
- if (actionEvent.event === "primaryChange") {
96
- const { value } = actionEvent.payload;
97
- if (typeof value === "string") {
98
- setUseTableConfig((previous) => ({
99
- ...previous,
100
- filters: {
101
- ...previous.filters,
102
- sort: value,
103
- },
104
- fetchOptions: {
105
- ...previous.fetchOptions,
106
- body: JSON.stringify({
107
- filters: {
108
- ...previous.filters,
109
- sort: value,
110
- },
111
- }),
112
- },
113
- }));
114
- }
115
- }
116
-
117
- if (actionEvent.event === "groupItemClick") {
118
- const { title, item } = actionEvent.payload;
119
- if (typeof title === "string" && typeof item === "string") {
120
- onGroupItemClick(title, item);
121
- }
122
- }
123
-
124
- if (actionEvent.event === "orderClick") {
125
- setPrimaryTableRowData((previous) => ({
126
- ...previous,
127
- isSortedAscending: !previous.isSortedAscending,
128
- }));
129
-
130
- const { value } = actionEvent.payload;
131
- if (typeof value === "string") {
132
- setUseTableConfig((previous) => ({
133
- ...previous,
134
- filters: {
135
- ...previous.filters,
136
- order: value,
137
- },
138
- fetchOptions: {
139
- ...previous.fetchOptions,
140
- body: JSON.stringify({
141
- filters: {
142
- ...previous.filters,
143
- order: value,
144
- },
145
- }),
146
- },
147
- }));
148
- }
149
- }
150
- };
151
-
152
- return {
153
- onChange,
154
- primaryTableRowData,
155
- secondaryTableRowData: newSecondaryTableRowData,
156
- dataSource: safeDataSource,
157
- columns,
158
- rowSelection,
159
- updateDataSource,
160
- };
161
- };
@@ -1,36 +0,0 @@
1
- // a convenience component for utility buttons where we hardcode the themeType to "utility"
2
-
3
- import React from "react";
4
- import Button from "../Button";
5
- import type { ButtonProps } from "../Button";
6
- import { TYPE } from "../../constants";
7
-
8
- export interface UtilityButtonProps extends Omit<ButtonProps, "themeType"> {}
9
-
10
- const UtilityButton = ({
11
- children,
12
- onClick,
13
- state = "active",
14
- isIconButton = false,
15
- size = "normal",
16
- ...rest
17
- }: UtilityButtonProps) => {
18
- const buttonState =
19
- state === "active" || state === "disabled" ? state : "active";
20
- const themeType = TYPE.utility as keyof typeof TYPE;
21
- return (
22
- <Button
23
- onClick={onClick}
24
- themeType={themeType}
25
- state={buttonState}
26
- disabled={state === "disabled" || rest.disabled}
27
- isIconButton={isIconButton}
28
- size={size}
29
- {...rest}
30
- >
31
- {children}
32
- </Button>
33
- );
34
- };
35
-
36
- export default UtilityButton;
@@ -1,98 +0,0 @@
1
- import Icon from "@ant-design/icons";
2
-
3
- export const TYPE = {
4
- primary: "primary",
5
- secondary: "secondary",
6
- tertiary: "tertiary",
7
- destructive: "destructive",
8
- utility: "utility",
9
- icon: "icon",
10
- };
11
-
12
- export const BREAKPOINTS = {
13
- wide: "wide",
14
- medium: "medium",
15
- narrow: "narrow",
16
- };
17
-
18
- export const STATE = {
19
- active: "active",
20
- hover: "hover",
21
- pressed: "pressed",
22
- focussed: "focus",
23
- disabled: "disabled",
24
- error: "error",
25
- success: "success",
26
- warning: "warning",
27
- progress: "progress",
28
- info: "info",
29
- filled: "filled",
30
- generic: "generic",
31
- removed: "removed",
32
- hollow: "hollow",
33
- };
34
-
35
- export const TYPOGRAPHY_VARIANT = {
36
- display1: "display1",
37
- display2: "display2",
38
- display3: "display3",
39
- heading1: "heading1",
40
- heading2: "heading2",
41
- heading3: "heading3",
42
- subHeading1: "subHeading1",
43
- subHeading2: "subHeading2",
44
- subHeading3: "subHeading3",
45
- body1: "body1",
46
- body2: "body2",
47
- body3: "body3",
48
- body4: "body4",
49
- body5: "body5",
50
- message: "message",
51
- overline1: "overline1",
52
- overline2: "overline2",
53
- overline3: "overline3",
54
- label1: "label1",
55
- label2: "label2",
56
- label3: "label3",
57
- link1: "link1",
58
- link2: "link2",
59
- link3: "link3",
60
- digits1: "digits1",
61
- digits2: "digits2",
62
- digits3: "digits3",
63
- };
64
-
65
- export const BUTTON_VARIANT = {
66
- primary: "primary",
67
- secondary: "secondary",
68
- tertiary: "tertiary",
69
- };
70
-
71
- export const SIZE = {
72
- small: "small",
73
- medium: "medium",
74
- large: "large",
75
- standard: "standard",
76
- };
77
-
78
- export const BADGE = {
79
- appointment: "appointment",
80
- asn: "asn",
81
- inventory: "inventory",
82
- parcel: "parcel",
83
- product: "product",
84
- route: "route",
85
- shipment: "shipment",
86
- shoppingCart: "shopping cart",
87
- system: "system",
88
- };
89
-
90
- export default {
91
- TYPE,
92
- BREAKPOINTS,
93
- STATE,
94
- TYPOGRAPHY_VARIANT,
95
- BUTTON_VARIANT,
96
- SIZE,
97
- BADGE,
98
- };
@@ -1,297 +0,0 @@
1
- export enum BreakpointLabel {
2
- Narrow = "narrow",
3
- Medium = "medium",
4
- Wide = "wide",
5
- }
6
-
7
- export type Breakpoints = {
8
- [key in BreakpointLabel]: number;
9
- };
10
-
11
- export type Sizing = {
12
- Size1: number;
13
- Size2: number;
14
- Size3: number;
15
- Size4: number;
16
- Size5: number;
17
- Size6: number;
18
- Size7: number;
19
- Size8: number;
20
- Size10: number;
21
- Size12: number;
22
- Size13: number;
23
- Size14: number;
24
- Size16: number;
25
- Size18: number;
26
- Size20: number;
27
- Size24: number;
28
- Size27: number;
29
- Size28: number;
30
- Size30: number;
31
- Size32: number;
32
- Size34: number;
33
- Size35: number;
34
- Size39: number;
35
- Size43: number;
36
- Size50: number;
37
- Size64: number;
38
- Size05: number;
39
- Size15: number;
40
- Size025: number;
41
- Size25: number;
42
- };
43
-
44
- type BorderRadius = {
45
- BorderRadiusNone: number;
46
- BorderRadiusXs: number;
47
- BorderRadiusSm: number;
48
- BorderRadiusMd: number;
49
- BorderRadiusLg: number;
50
- BorderRadiusXl: number;
51
- BorderRadiusXxl: number;
52
- BorderRadiusXxxl: number;
53
- BorderRadiusRounded: number;
54
- };
55
-
56
- type FontStyle = {
57
- fontSize: string;
58
- lineHeight: string;
59
- fontWeight: number;
60
- };
61
-
62
- export type TypographySize = {
63
- display1: FontStyle;
64
- display2: FontStyle;
65
- display3: FontStyle;
66
- heading1: FontStyle;
67
- heading2: FontStyle;
68
- heading3: FontStyle;
69
- subHeading1: FontStyle;
70
- subHeading2: FontStyle;
71
- subHeading3: FontStyle;
72
- body1: FontStyle;
73
- body2: FontStyle;
74
- body3: FontStyle;
75
- body4: FontStyle;
76
- body5: FontStyle;
77
- message: FontStyle;
78
- overline: FontStyle;
79
- label: FontStyle;
80
- link1: FontStyle;
81
- link2: FontStyle;
82
- link3: FontStyle;
83
- digits1: FontStyle;
84
- digits2: FontStyle;
85
- digits3: FontStyle;
86
- };
87
-
88
- export type Typography = {
89
- wide: TypographySize;
90
- medium: TypographySize;
91
- narrow: TypographySize;
92
- fontFamily: string;
93
- lineHeight: string;
94
- body1: FontStyle;
95
- body2: FontStyle;
96
- };
97
-
98
- export type ColorShades = {
99
- 100?: string;
100
- 200?: string;
101
- 300?: string;
102
- 400?: string;
103
- 500?: string;
104
- 600?: string;
105
- 700?: string;
106
- 800?: string;
107
- 900?: string;
108
- black?: string;
109
- white?: string;
110
- };
111
-
112
- type ColorLayer = {
113
- textColor: string;
114
- backgroundColor: string;
115
- borderColor: string;
116
- ringColor?: string;
117
- active: ColorShades;
118
- checked?: string;
119
- default?: string;
120
- border?: string;
121
- onsurface: string;
122
- generic?: string;
123
- disabled?: string;
124
- surface?: string;
125
- hover?: string;
126
- pressed?: string;
127
- focus?: string;
128
- info?: string;
129
- success?: string;
130
- error?: string;
131
- empty?: string;
132
- };
133
-
134
- type ColorState = {
135
- active: ColorLayer;
136
- hover: ColorLayer;
137
- pressed: ColorLayer;
138
- focussed: ColorLayer;
139
- disabled: ColorLayer;
140
- link: ColorLayer;
141
- surface: ColorLayer;
142
- success: ColorLayer;
143
- error: ColorLayer;
144
- onsurface: ColorLayer;
145
- warning: ColorLayer;
146
- generic?: ColorLayer;
147
- hollow?: ColorLayer;
148
- info?: ColorLayer;
149
- utility?: ColorLayer;
150
- icon?: ColorLayer;
151
- default?: ColorLayer;
152
- selected?: ColorLayer;
153
- border?: ColorLayer;
154
- tertiary?: string;
155
- copy?: string;
156
- "copy-dark"?: string;
157
- "border-light"?: string;
158
- primary?: string;
159
- progress?: ColorLayer;
160
- };
161
-
162
- export type ColorMode = {
163
- primary: ColorState;
164
- secondary: ColorState;
165
- tertiary: ColorState;
166
- destructive: ColorState;
167
- success: ColorState;
168
- warning: ColorState;
169
- danger: ColorState;
170
- info: ColorState;
171
- onsurface: ColorState;
172
- surface: ColorState;
173
- inputs: ColorState;
174
- interactive: ColorState;
175
- status: ColorState;
176
- brandon: ColorState;
177
- };
178
-
179
- export type ColorModes = {
180
- light: ColorMode;
181
- dark: ColorMode;
182
- };
183
-
184
- export type ColorGroup =
185
- | "red"
186
- | "orange"
187
- | "yellow"
188
- | "green"
189
- | "blue"
190
- | "purple"
191
- | "sky"
192
- | "gray";
193
-
194
- type AllColors = {
195
- red: ColorShades;
196
- orange: ColorShades;
197
- yellow: ColorShades;
198
- green: ColorShades;
199
- blue: ColorShades;
200
- purple: ColorShades;
201
- sky: ColorShades;
202
- gray: ColorShades;
203
- };
204
-
205
- type Mode = "light" | "dark";
206
-
207
- type Button = {
208
- padding: {
209
- verPadding: number;
210
- horPadding: number;
211
- };
212
- gap: number;
213
- radius: number;
214
- };
215
-
216
- type Input = {
217
- suffixPrefixHorPadding: number;
218
- suffixPrefixVerPadding: number;
219
- };
220
-
221
- type Badge = {
222
- "ver-padding": number;
223
- "left-padding": number;
224
- "right-padding": number;
225
- radius: number;
226
- };
227
-
228
- type CommonContainer = {
229
- "ver-padding": number;
230
- "hor-padding": number;
231
- radius: number;
232
- gap: number;
233
- };
234
-
235
- type Popover = CommonContainer;
236
-
237
- type Row = CommonContainer;
238
-
239
- type TableCell = {
240
- surface: string;
241
- hover: string;
242
- pressed: string;
243
- };
244
-
245
- export type Components = {
246
- button: Button;
247
- utilityButton: Button;
248
- iconButton: Button;
249
- input: Input;
250
- row: Row;
251
- badge: Badge;
252
- popover: Popover;
253
- tableCell: TableCell;
254
- };
255
-
256
- type Motion = {
257
- instant: string;
258
- veryfast: string;
259
- fast: string;
260
- medium: string;
261
- slow: string;
262
- };
263
-
264
- type Shadows = {
265
- general: {
266
- "1": string;
267
- "2": string;
268
- "3": string;
269
- };
270
- actions: {
271
- "1": string;
272
- "2": string;
273
- };
274
- inputs: {
275
- "1": string;
276
- };
277
- };
278
-
279
- interface ConvenienceFunctions {
280
- getStatusColor: (colors: ColorMode, status: string) => string;
281
- }
282
-
283
- export interface BaseTokens extends ConvenienceFunctions {
284
- breakpoints: Breakpoints;
285
- sizing: Sizing;
286
- borderRadius: BorderRadius;
287
- typography: Typography;
288
- allColors: AllColors;
289
- components: Components;
290
- motion: Motion;
291
- shadows: Shadows;
292
- }
293
-
294
- export interface GenesisTheme extends BaseTokens {
295
- colors: ColorMode;
296
- mode: Mode;
297
- }
@@ -1,52 +0,0 @@
1
- /*
2
- Warning: this was a failed attempt to create a universal styled-components library.
3
- When importing styled-components into a non React Native app, it will throw an error!
4
-
5
- Even when React Native was setup as an optional peer dependency; it's not actually working.
6
- Now it's seems like a better idea to create a separate Genesis package for React Native styled-components which is basically only the theme provider.
7
- */
8
-
9
- /*
10
- import * as styledComponents from "styled-components";
11
-
12
- // Platform detection
13
- const isReactNative =
14
- typeof navigator !== "undefined" && navigator.product === "ReactNative";
15
-
16
- // Set up platform-specific styled
17
- let platformStyled;
18
- if (isReactNative) {
19
- try {
20
- platformStyled = require("styled-components/native");
21
- } catch (e) {
22
- console.warn(
23
- "Failed to load styled-components/native, falling back to web"
24
- );
25
- platformStyled = styledComponents;
26
- }
27
- } else {
28
- platformStyled = styledComponents;
29
- }
30
-
31
- // Export named exports
32
- export const styled = platformStyled.default;
33
- export const ThemeProvider = platformStyled.ThemeProvider;
34
- export const useTheme = platformStyled.useTheme;
35
- export const css = platformStyled.css;
36
-
37
- // Add createGlobalStyle (web only)
38
- export const createGlobalStyle = isReactNative
39
- ? () => null
40
- : styledComponents.createGlobalStyle;
41
-
42
- // Export default too for backwards compatibility
43
- export default styled;
44
- */
45
-
46
- export {
47
- default,
48
- createGlobalStyle,
49
- useTheme,
50
- ThemeProvider,
51
- css,
52
- } from "styled-components";