jp-composter 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/dist/index.d.mts +997 -0
  2. package/dist/index.d.ts +997 -0
  3. package/dist/index.js +36837 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.mjs +36778 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/package.json +66 -0
  8. package/src/SliceUI/IconMoon.tsx +33 -0
  9. package/src/SliceUI/assets/Anatomy diagram copy.svg +19 -0
  10. package/src/SliceUI/assets/Anatomy diagram.svg +19 -0
  11. package/src/SliceUI/assets/Anatomycheck.svg +15 -0
  12. package/src/SliceUI/assets/Anatomyinput.svg +32 -0
  13. package/src/SliceUI/assets/Checkbox.jpg +0 -0
  14. package/src/SliceUI/assets/Diagram copy.svg +15 -0
  15. package/src/SliceUI/assets/Diagram.jpg +0 -0
  16. package/src/SliceUI/assets/Diagram.svg +15 -0
  17. package/src/SliceUI/assets/Frame 5 copy.png +0 -0
  18. package/src/SliceUI/assets/Frame 5.png +0 -0
  19. package/src/SliceUI/assets/Frame 65.png +0 -0
  20. package/src/SliceUI/assets/Frame_65.png +0 -0
  21. package/src/SliceUI/assets/Icon copy.svg +3 -0
  22. package/src/SliceUI/assets/Icon.svg +3 -0
  23. package/src/SliceUI/assets/Icon_Bridging copy.svg +39 -0
  24. package/src/SliceUI/assets/Icon_Bridging.svg +39 -0
  25. package/src/SliceUI/assets/Icon_Consistent copy.svg +39 -0
  26. package/src/SliceUI/assets/Icon_Consistent.svg +39 -0
  27. package/src/SliceUI/assets/Icon_Plug copy.svg +38 -0
  28. package/src/SliceUI/assets/Icon_Plug.svg +38 -0
  29. package/src/SliceUI/assets/Icon_Reusable copy.svg +39 -0
  30. package/src/SliceUI/assets/Icon_Reusable.svg +39 -0
  31. package/src/SliceUI/assets/Layer_1.png +0 -0
  32. package/src/SliceUI/assets/accessibility.png +0 -0
  33. package/src/SliceUI/assets/accessibility.svg +1 -0
  34. package/src/SliceUI/assets/addon-library.png +0 -0
  35. package/src/SliceUI/assets/assets.png +0 -0
  36. package/src/SliceUI/assets/avif-test-image.avif +0 -0
  37. package/src/SliceUI/assets/bridging.svg +13 -0
  38. package/src/SliceUI/assets/consistent.svg +11 -0
  39. package/src/SliceUI/assets/context.png +0 -0
  40. package/src/SliceUI/assets/discord.svg +1 -0
  41. package/src/SliceUI/assets/docs.png +0 -0
  42. package/src/SliceUI/assets/figma-plugin.png +0 -0
  43. package/src/SliceUI/assets/github.svg +1 -0
  44. package/src/SliceUI/assets/resources/Anatomy diagram.svg +19 -0
  45. package/src/SliceUI/assets/resources/Anatomycheck.svg +15 -0
  46. package/src/SliceUI/assets/resources/Anatomyinput.svg +32 -0
  47. package/src/SliceUI/assets/resources/Diagram.svg +15 -0
  48. package/src/SliceUI/assets/resources/Frame 5.png +0 -0
  49. package/src/SliceUI/assets/resources/Frame 65.png +0 -0
  50. package/src/SliceUI/assets/resources/Icon.svg +3 -0
  51. package/src/SliceUI/assets/resources/Icon_Bridging.svg +39 -0
  52. package/src/SliceUI/assets/resources/Icon_Consistent.svg +39 -0
  53. package/src/SliceUI/assets/resources/Icon_Plug.svg +38 -0
  54. package/src/SliceUI/assets/resources/Icon_Reusable.svg +39 -0
  55. package/src/SliceUI/assets/resources/fonts/FontIcon.json +150 -0
  56. package/src/SliceUI/assets/resources/fonts/Lato-Black.ttf +0 -0
  57. package/src/SliceUI/assets/resources/fonts/Lato-Bold.ttf +0 -0
  58. package/src/SliceUI/assets/resources/fonts/Lato-Heavy.ttf +0 -0
  59. package/src/SliceUI/assets/resources/fonts/Lato-Medium.ttf +0 -0
  60. package/src/SliceUI/assets/resources/fonts/Lato-Regular.ttf +0 -0
  61. package/src/SliceUI/assets/resources/fonts/Lato.woff2 +0 -0
  62. package/src/SliceUI/assets/resources/fonts/icomoon.eot +0 -0
  63. package/src/SliceUI/assets/resources/fonts/icomoon.svg +601 -0
  64. package/src/SliceUI/assets/resources/fonts/icomoon.ttf +0 -0
  65. package/src/SliceUI/assets/resources/fonts/icomoon.woff +0 -0
  66. package/src/SliceUI/assets/resources/fonts/selection.json +1 -0
  67. package/src/SliceUI/assets/share.png +0 -0
  68. package/src/SliceUI/assets/styling.png +0 -0
  69. package/src/SliceUI/assets/testing.png +0 -0
  70. package/src/SliceUI/assets/theming.png +0 -0
  71. package/src/SliceUI/assets/tutorials.svg +1 -0
  72. package/src/SliceUI/assets/youtube.svg +1 -0
  73. package/src/SliceUI/automation/helper.ts +29 -0
  74. package/src/SliceUI/avatar/Avatar.tsx +237 -0
  75. package/src/SliceUI/avatar/Token.ts +116 -0
  76. package/src/SliceUI/avatar/Type.ts +36 -0
  77. package/src/SliceUI/avatar/helper.ts +53 -0
  78. package/src/SliceUI/badge/Badge.tsx +308 -0
  79. package/src/SliceUI/badge/Token.ts +202 -0
  80. package/src/SliceUI/badge/Type.ts +46 -0
  81. package/src/SliceUI/badge/helper.ts +39 -0
  82. package/src/SliceUI/button/Button.tsx +243 -0
  83. package/src/SliceUI/button/Token.ts +138 -0
  84. package/src/SliceUI/button/Type.ts +34 -0
  85. package/src/SliceUI/button/helper.ts +125 -0
  86. package/src/SliceUI/checkbox/Checkbox.tsx +176 -0
  87. package/src/SliceUI/checkbox/Token.ts +128 -0
  88. package/src/SliceUI/checkbox/Type.ts +35 -0
  89. package/src/SliceUI/chip/Chip.tsx +290 -0
  90. package/src/SliceUI/chip/Token.ts +151 -0
  91. package/src/SliceUI/chip/Type.ts +43 -0
  92. package/src/SliceUI/chip/helper.ts +40 -0
  93. package/src/SliceUI/colors/Pallete.ts +151 -0
  94. package/src/SliceUI/colors/Token.ts +110 -0
  95. package/src/SliceUI/colors/Type.ts +56 -0
  96. package/src/SliceUI/contextProvider/context.tsx +108 -0
  97. package/src/SliceUI/divider/Divider.tsx +109 -0
  98. package/src/SliceUI/divider/Token.ts +18 -0
  99. package/src/SliceUI/divider/Type.ts +26 -0
  100. package/src/SliceUI/icon/CustomIcon.ts +4 -0
  101. package/src/SliceUI/icon/IcoMoonIcon.tsx +11 -0
  102. package/src/SliceUI/icon/Icon.tsx +38 -0
  103. package/src/SliceUI/icon/Token.ts +14 -0
  104. package/src/SliceUI/icon/Type.ts +13 -0
  105. package/src/SliceUI/icon/selection.json +1 -0
  106. package/src/SliceUI/input/Input.tsx +573 -0
  107. package/src/SliceUI/input/ToDo.md +99 -0
  108. package/src/SliceUI/input/Token.ts +372 -0
  109. package/src/SliceUI/input/Type.ts +109 -0
  110. package/src/SliceUI/input/components/InputPortal.tsx +211 -0
  111. package/src/SliceUI/input/components/NativeBottomSheet.tsx +296 -0
  112. package/src/SliceUI/input/components/SelectChip.tsx +185 -0
  113. package/src/SliceUI/input/components/SelectList.tsx +173 -0
  114. package/src/SliceUI/input/components/SelectListItem.tsx +377 -0
  115. package/src/SliceUI/input/components/SelectScrollbarStyle.ts +44 -0
  116. package/src/SliceUI/input/hooks/useCustomScrollbar.ts +17 -0
  117. package/src/SliceUI/input/hooks/useInputState.ts +41 -0
  118. package/src/SliceUI/input/hooks/useLabelAnimation.ts +132 -0
  119. package/src/SliceUI/input/hooks/useOutsideClick.ts +38 -0
  120. package/src/SliceUI/input/hooks/useSelectLogic.ts +338 -0
  121. package/src/SliceUI/input/utils/inputUtils.ts +120 -0
  122. package/src/SliceUI/input/utils/selectUtils.ts +85 -0
  123. package/src/SliceUI/input/utils/styleUtils.ts +50 -0
  124. package/src/SliceUI/input/variants/CurrencyInput/CurrencyInput.tsx +16 -0
  125. package/src/SliceUI/input/variants/CurrencyInput/NativeCurrencyInput.tsx +181 -0
  126. package/src/SliceUI/input/variants/CurrencyInput/WebCurrencyInput.tsx +163 -0
  127. package/src/SliceUI/input/variants/CurrencyInput/types.ts +17 -0
  128. package/src/SliceUI/input/variants/PhoneInput/NativePhoneInput.tsx +189 -0
  129. package/src/SliceUI/input/variants/PhoneInput/PhoneInput.tsx +16 -0
  130. package/src/SliceUI/input/variants/PhoneInput/WebPhoneInput.tsx +291 -0
  131. package/src/SliceUI/input/variants/PhoneInput/types.ts +22 -0
  132. package/src/SliceUI/input/variants/SelectInput/SelectInput.tsx +407 -0
  133. package/src/SliceUI/input/variants/SelectInput/types.ts +34 -0
  134. package/src/SliceUI/input/variants/TextInput.tsx +68 -0
  135. package/src/SliceUI/layout/Box.tsx +38 -0
  136. package/src/SliceUI/layout/Center.tsx +38 -0
  137. package/src/SliceUI/layout/Divider.tsx +37 -0
  138. package/src/SliceUI/layout/Grid.tsx +75 -0
  139. package/src/SliceUI/layout/PageContainer.tsx +60 -0
  140. package/src/SliceUI/layout/ScrollContainer.tsx +72 -0
  141. package/src/SliceUI/layout/Spacer.tsx +54 -0
  142. package/src/SliceUI/layout/Stack.tsx +97 -0
  143. package/src/SliceUI/layout/StickyHeader.tsx +71 -0
  144. package/src/SliceUI/radio/RadioButton.tsx +130 -0
  145. package/src/SliceUI/radio/Token.ts +197 -0
  146. package/src/SliceUI/radio/Type.ts +35 -0
  147. package/src/SliceUI/react-native.config.js +3 -0
  148. package/src/SliceUI/responsive/Type.ts +7 -0
  149. package/src/SliceUI/responsive/helper.ts +53 -0
  150. package/src/SliceUI/switch/Switch.tsx +119 -0
  151. package/src/SliceUI/switch/Token.ts +205 -0
  152. package/src/SliceUI/switch/Type.ts +26 -0
  153. package/src/SliceUI/tab/TabItem.tsx +204 -0
  154. package/src/SliceUI/tab/Tabs.tsx +110 -0
  155. package/src/SliceUI/tab/Token.ts +282 -0
  156. package/src/SliceUI/tab/Type.ts +66 -0
  157. package/src/SliceUI/tab/helper.ts +53 -0
  158. package/src/SliceUI/table/Table.tsx +388 -0
  159. package/src/SliceUI/table/TableCell.tsx +158 -0
  160. package/src/SliceUI/table/TableFooter.tsx +353 -0
  161. package/src/SliceUI/table/TableHeader.tsx +247 -0
  162. package/src/SliceUI/table/TableRow.tsx +218 -0
  163. package/src/SliceUI/table/Token.ts +252 -0
  164. package/src/SliceUI/table/Type.ts +213 -0
  165. package/src/SliceUI/table/helper.ts +376 -0
  166. package/src/SliceUI/table/index.ts +53 -0
  167. package/src/SliceUI/theme/dummyColors.tsx +7 -0
  168. package/src/SliceUI/theme/theme.ts +107 -0
  169. package/src/SliceUI/typography/BaseTypographyToken.ts +62 -0
  170. package/src/SliceUI/typography/FoundationToken.ts +48 -0
  171. package/src/SliceUI/typography/Token.ts +228 -0
  172. package/src/SliceUI/typography/Type.ts +20 -0
  173. package/src/SliceUI/typography/Typography.tsx +99 -0
  174. package/src/SliceUI/values/BorderRadius.ts +17 -0
  175. package/src/SliceUI/values/BorderWidth.ts +7 -0
  176. package/src/SliceUI/values/Dimension.ts +35 -0
  177. package/src/SliceUI/values/IconSizes.ts +13 -0
  178. package/src/SliceUI/values/Spacing.ts +22 -0
  179. package/src/declarations.d.ts +8 -0
  180. package/src/index.tsx +119 -0
  181. package/src/stories/Colors.mdx +1418 -0
  182. package/src/stories/Dimensions.mdx +60 -0
  183. package/src/stories/GetStarted.mdx +90 -0
  184. package/src/stories/Introduction.mdx +136 -0
  185. package/src/stories/Shape.mdx +126 -0
  186. package/src/stories/Spacing.mdx +104 -0
  187. package/src/stories/Typography.mdx +454 -0
  188. package/src/stories/Utils.mdx +277 -0
  189. package/src/stories/story-components/AddIcon.js +13 -0
  190. package/src/stories/story-components/RectangleWithBox.jsx +51 -0
  191. package/src/stories/story-components/RoundedRectangle.jsx +18 -0
  192. package/src/stories/story-components/RoundedWithWhiteInside.jsx +33 -0
  193. package/src/stories/story-components/WhiteRoundedRectangle.jsx +107 -0
  194. package/src/stories/story-components/svgPaths.js +126 -0
@@ -0,0 +1,282 @@
1
+ import type {TextStyle, ViewStyle} from 'react-native';
2
+ import {TYPOGRAPHY_STYLES} from '../typography/Token';
3
+ import type {ExtendedTheme} from '../colors/Type';
4
+ import type {
5
+ TabItemSizeType,
6
+ TabItemTextSizeType,
7
+ TabSizeType,
8
+ TabVariantType,
9
+ TabStateType,
10
+ TabBrandType,
11
+ } from './Type';
12
+
13
+ // Size dimensions for different tab sizes
14
+ const sizeDimensions = {
15
+ small: {
16
+ height: 32,
17
+ paddingHorizontal: 12,
18
+ paddingVertical: 6,
19
+ borderRadius: 4,
20
+ fontSize: 14,
21
+ lineHeight: 20,
22
+ },
23
+ medium: {
24
+ height: 40,
25
+ paddingHorizontal: 16,
26
+ paddingVertical: 8,
27
+ borderRadius: 6,
28
+ fontSize: 16,
29
+ lineHeight: 24,
30
+ },
31
+ large: {
32
+ height: 48,
33
+ paddingHorizontal: 20,
34
+ paddingVertical: 10,
35
+ borderRadius: 8,
36
+ fontSize: 18,
37
+ lineHeight: 28,
38
+ },
39
+ } as const;
40
+
41
+ // Helper function to create styles for a given size
42
+ const createStylesForSize = (
43
+ sizeDimensions: (typeof sizeDimensions)[keyof typeof sizeDimensions],
44
+ ) => ({
45
+ height: sizeDimensions.height,
46
+ paddingHorizontal: sizeDimensions.paddingHorizontal,
47
+ paddingVertical: sizeDimensions.paddingVertical,
48
+ borderRadius: sizeDimensions.borderRadius,
49
+ fontSize: sizeDimensions.fontSize,
50
+ lineHeight: sizeDimensions.lineHeight,
51
+ });
52
+
53
+ // Export the tab item styles
54
+ export const TAB_ITEM_STYLE: TabItemSizeType = {
55
+ small: createStylesForSize(sizeDimensions.small),
56
+ medium: createStylesForSize(sizeDimensions.medium),
57
+ large: createStylesForSize(sizeDimensions.large),
58
+ };
59
+
60
+ // Text styles for different sizes
61
+ export const TAB_ITEM_TXT_STYLE: TabItemTextSizeType = {
62
+ small: {
63
+ ...TYPOGRAPHY_STYLES.captionBold,
64
+ fontSize: sizeDimensions.small.fontSize,
65
+ lineHeight: sizeDimensions.small.lineHeight,
66
+ },
67
+ medium: {
68
+ ...TYPOGRAPHY_STYLES.body2Bold,
69
+ fontSize: sizeDimensions.medium.fontSize,
70
+ lineHeight: sizeDimensions.medium.lineHeight,
71
+ },
72
+ large: {
73
+ ...TYPOGRAPHY_STYLES.body1Bold,
74
+ fontSize: sizeDimensions.large.fontSize,
75
+ lineHeight: sizeDimensions.large.lineHeight,
76
+ },
77
+ };
78
+
79
+ // Color tokens based on the design spec
80
+ export const TAB_ITEM_COLOR_TOKENS = {
81
+ // Bordered variant colors
82
+ bordered: {
83
+ cm: {
84
+ default: {
85
+ active: {
86
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundPrimary,
87
+ underline: (theme: ExtendedTheme) => theme.colors.colorBorderPositive,
88
+ },
89
+ inactive: {
90
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundTertiary,
91
+ underline: (theme: ExtendedTheme) => 'transparent',
92
+ },
93
+ },
94
+ hover: {
95
+ active: {
96
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundPositive,
97
+ underline: (theme: ExtendedTheme) => theme.colors.colorBorderPositive,
98
+ },
99
+ inactive: {
100
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundTertiary,
101
+ underline: (theme: ExtendedTheme) => 'transparent',
102
+ },
103
+ },
104
+ disabled: {
105
+ active: {
106
+ text: (theme: ExtendedTheme) => '#B0BEC5', // Light gray text
107
+ underline: (theme: ExtendedTheme) => '#B0BEC5', // Light gray underline
108
+ },
109
+ inactive: {
110
+ text: (theme: ExtendedTheme) => '#B0BEC5', // Light gray text
111
+ underline: (theme: ExtendedTheme) => 'transparent',
112
+ },
113
+ },
114
+ },
115
+ co: {
116
+ default: {
117
+ active: {
118
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundPrimary,
119
+ underline: (theme: ExtendedTheme) => '#D32F2F', // Red for CO brand
120
+ },
121
+ inactive: {
122
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundTertiary,
123
+ underline: (theme: ExtendedTheme) => 'transparent',
124
+ },
125
+ },
126
+ hover: {
127
+ active: {
128
+ text: (theme: ExtendedTheme) => '#D32F2F', // Red text for active hover
129
+ underline: (theme: ExtendedTheme) => '#D32F2F',
130
+ },
131
+ inactive: {
132
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundTertiary,
133
+ underline: (theme: ExtendedTheme) => 'transparent',
134
+ },
135
+ },
136
+ disabled: {
137
+ active: {
138
+ text: (theme: ExtendedTheme) => '#B0BEC5', // Light gray text
139
+ underline: (theme: ExtendedTheme) => '#B0BEC5', // Light gray underline
140
+ },
141
+ inactive: {
142
+ text: (theme: ExtendedTheme) => '#B0BEC5', // Light gray text
143
+ underline: (theme: ExtendedTheme) => 'transparent',
144
+ },
145
+ },
146
+ },
147
+ },
148
+ // Filled variant colors
149
+ filled: {
150
+ cm: {
151
+ default: {
152
+ active: {
153
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundPositive,
154
+ background: (_theme: ExtendedTheme) => 'transparent',
155
+ },
156
+ inactive: {
157
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundTertiary,
158
+ background: (_theme: ExtendedTheme) => 'transparent',
159
+ },
160
+ },
161
+ hover: {
162
+ active: {
163
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundPositive,
164
+ background: (_theme: ExtendedTheme) => 'transparent',
165
+ },
166
+ inactive: {
167
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundTertiary,
168
+ background: (_theme: ExtendedTheme) => 'transparent',
169
+ },
170
+ },
171
+ disabled: {
172
+ active: {
173
+ text: (theme: ExtendedTheme) => '#B0BEC5',
174
+ background: (_theme: ExtendedTheme) => 'transparent',
175
+ },
176
+ inactive: {
177
+ text: (theme: ExtendedTheme) => '#B0BEC5',
178
+ background: (_theme: ExtendedTheme) => 'transparent',
179
+ },
180
+ },
181
+ },
182
+ co: {
183
+ default: {
184
+ active: {
185
+ text: (theme: ExtendedTheme) => '#FFFFFF', // White text on red background
186
+ background: (theme: ExtendedTheme) => '#D32F2F', // Solid red background
187
+ },
188
+ inactive: {
189
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundTertiary,
190
+ background: (theme: ExtendedTheme) => '#F5F5F5', // Light gray background
191
+ },
192
+ },
193
+ hover: {
194
+ active: {
195
+ text: (theme: ExtendedTheme) => '#FFFFFF', // White text
196
+ background: (theme: ExtendedTheme) => '#B71C1C', // Darker red
197
+ },
198
+ inactive: {
199
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundTertiary,
200
+ background: (theme: ExtendedTheme) => '#E0E0E0', // Darker gray
201
+ },
202
+ },
203
+ disabled: {
204
+ active: {
205
+ text: (theme: ExtendedTheme) => '#B0BEC5', // Light gray text
206
+ background: (theme: ExtendedTheme) => '#E0E0E0', // Light gray background
207
+ },
208
+ inactive: {
209
+ text: (theme: ExtendedTheme) => '#B0BEC5', // Light gray text
210
+ background: (theme: ExtendedTheme) => '#F5F5F5', // Light gray background
211
+ },
212
+ },
213
+ },
214
+ },
215
+ // FilledRounded variant colors (same as filled but with rounded corners)
216
+ filledRounded: {
217
+ cm: {
218
+ default: {
219
+ active: {
220
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundPositive,
221
+ background: (_theme: ExtendedTheme) => 'transparent',
222
+ },
223
+ inactive: {
224
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundTertiary,
225
+ background: (_theme: ExtendedTheme) => 'transparent',
226
+ },
227
+ },
228
+ hover: {
229
+ active: {
230
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundPositive,
231
+ background: (_theme: ExtendedTheme) => 'transparent',
232
+ },
233
+ inactive: {
234
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundTertiary,
235
+ background: (_theme: ExtendedTheme) => 'transparent',
236
+ },
237
+ },
238
+ disabled: {
239
+ active: {
240
+ text: (theme: ExtendedTheme) => '#B0BEC5',
241
+ background: (_theme: ExtendedTheme) => 'transparent',
242
+ },
243
+ inactive: {
244
+ text: (theme: ExtendedTheme) => '#B0BEC5',
245
+ background: (_theme: ExtendedTheme) => 'transparent',
246
+ },
247
+ },
248
+ },
249
+ co: {
250
+ default: {
251
+ active: {
252
+ text: (theme: ExtendedTheme) => '#FFFFFF', // White text on red background
253
+ background: (theme: ExtendedTheme) => '#D32F2F', // Solid red background
254
+ },
255
+ inactive: {
256
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundPrimary,
257
+ background: (theme: ExtendedTheme) => '#F5F5F5', // Light gray background
258
+ },
259
+ },
260
+ hover: {
261
+ active: {
262
+ text: (theme: ExtendedTheme) => '#FFFFFF', // White text
263
+ background: (theme: ExtendedTheme) => '#B71C1C', // Darker red
264
+ },
265
+ inactive: {
266
+ text: (theme: ExtendedTheme) => theme.colors.colorForegroundPrimary,
267
+ background: (theme: ExtendedTheme) => '#E0E0E0', // Darker gray
268
+ },
269
+ },
270
+ disabled: {
271
+ active: {
272
+ text: (theme: ExtendedTheme) => '#B0BEC5', // Light gray text
273
+ background: (theme: ExtendedTheme) => '#E0E0E0', // Light gray background
274
+ },
275
+ inactive: {
276
+ text: (theme: ExtendedTheme) => '#B0BEC5', // Light gray text
277
+ background: (theme: ExtendedTheme) => '#F5F5F5', // Light gray background
278
+ },
279
+ },
280
+ },
281
+ },
282
+ } as const;
@@ -0,0 +1,66 @@
1
+ // @ts-ignore
2
+ import type {TextStyle, ViewStyle} from 'react-native';
3
+
4
+ export type TabSizeType = 'small' | 'medium' | 'large';
5
+
6
+ export type TabVariantType = 'bordered' | 'filled' | 'filledRounded';
7
+
8
+ export type TabStateType = 'default' | 'hover' | 'disabled';
9
+
10
+ export type TabBrandType = 'cm' | 'co';
11
+
12
+ export type TabItemSizeType = {
13
+ [key in TabSizeType]: {
14
+ height: number;
15
+ paddingHorizontal: number;
16
+ paddingVertical: number;
17
+ borderRadius?: number;
18
+ fontSize: number;
19
+ lineHeight: number;
20
+ };
21
+ };
22
+
23
+ export type TabItemTextSizeType = {
24
+ [key in TabSizeType]: TextStyle;
25
+ };
26
+
27
+ export type TabItemVariant = {
28
+ variant: TabVariantType;
29
+ brand: TabBrandType;
30
+ state: TabStateType;
31
+ isActive: boolean;
32
+ };
33
+
34
+ export const TAB_SIZES = {
35
+ SMALL: 'small',
36
+ MEDIUM: 'medium',
37
+ LARGE: 'large',
38
+ } as const;
39
+
40
+ export const TAB_VARIANTS = {
41
+ BORDERED: 'bordered',
42
+ FILLED: 'filled',
43
+ FILLED_ROUNDED: 'filledRounded',
44
+ } as const;
45
+
46
+ export const TAB_STATES = {
47
+ DEFAULT: 'default',
48
+ HOVER: 'hover',
49
+ DISABLED: 'disabled',
50
+ } as const;
51
+
52
+ export const TAB_BRANDS = {
53
+ CM: 'cm',
54
+ CO: 'co',
55
+ } as const;
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
@@ -0,0 +1,53 @@
1
+ import type {ExtendedTheme} from '../colors/Type';
2
+ import {TAB_ITEM_COLOR_TOKENS} from './Token';
3
+ import type {TabVariantType, TabStateType, TabBrandType} from './Type';
4
+
5
+ export const getTextColor = (
6
+ variant: TabVariantType,
7
+ brand: TabBrandType,
8
+ state: TabStateType,
9
+ isActive: boolean,
10
+ theme: ExtendedTheme,
11
+ ) => {
12
+ const variantTokens = TAB_ITEM_COLOR_TOKENS[variant];
13
+ const brandTokens = variantTokens[brand];
14
+ const stateTokens = brandTokens[state];
15
+ const activeTokens = stateTokens[isActive ? 'active' : 'inactive'];
16
+
17
+ return activeTokens.text(theme);
18
+ };
19
+
20
+ export const getBackgroundColor = (
21
+ variant: TabVariantType,
22
+ brand: TabBrandType,
23
+ state: TabStateType,
24
+ isActive: boolean,
25
+ theme: ExtendedTheme,
26
+ ) => {
27
+ const variantTokens = TAB_ITEM_COLOR_TOKENS[variant];
28
+ const brandTokens = variantTokens[brand];
29
+ const stateTokens = brandTokens[state];
30
+ const activeTokens = stateTokens[isActive ? 'active' : 'inactive'];
31
+
32
+ return activeTokens.background ? activeTokens.background(theme) : 'transparent';
33
+ };
34
+
35
+ export const getUnderlineColor = (
36
+ variant: TabVariantType,
37
+ brand: TabBrandType,
38
+ state: TabStateType,
39
+ isActive: boolean,
40
+ theme: ExtendedTheme,
41
+ ) => {
42
+ const variantTokens = TAB_ITEM_COLOR_TOKENS[variant];
43
+ const brandTokens = variantTokens[brand];
44
+ const stateTokens = brandTokens[state];
45
+ const activeTokens = stateTokens[isActive ? 'active' : 'inactive'];
46
+
47
+ return activeTokens.underline ? activeTokens.underline(theme) : 'transparent';
48
+ };
49
+
50
+
51
+
52
+
53
+